本文整理汇总了PHP中WikiPage::setTimestamp方法的典型用法代码示例。如果您正苦于以下问题:PHP WikiPage::setTimestamp方法的具体用法?PHP WikiPage::setTimestamp怎么用?PHP WikiPage::setTimestamp使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WikiPage
的用法示例。
在下文中一共展示了WikiPage::setTimestamp方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: view
//.........这里部分代码省略.........
$outputDone = false;
$this->mParserOutput = false;
while (!$outputDone && ++$pass) {
switch ($pass) {
case 1:
wfRunHooks('ArticleViewHeader', array(&$this, &$outputDone, &$useParserCache));
break;
case 2:
# Early abort if the page doesn't exist
if (!$this->mPage->exists()) {
wfDebug(__METHOD__ . ": showing missing article\n");
$this->showMissingArticle();
wfProfileOut(__METHOD__);
return;
}
# Try the parser cache
if ($useParserCache) {
$this->mParserOutput = $parserCache->get($this, $parserOptions);
if ($this->mParserOutput !== false) {
if ($oldid) {
wfDebug(__METHOD__ . ": showing parser cache contents for current rev permalink\n");
$this->setOldSubtitle($oldid);
} else {
wfDebug(__METHOD__ . ": showing parser cache contents\n");
}
$outputPage->addParserOutput($this->mParserOutput);
# Ensure that UI elements requiring revision ID have
# the correct version information.
$outputPage->setRevisionId($this->mPage->getLatest());
# Preload timestamp to avoid a DB hit
$cachedTimestamp = $this->mParserOutput->getTimestamp();
if ($cachedTimestamp !== null) {
$outputPage->setRevisionTimestamp($cachedTimestamp);
$this->mPage->setTimestamp($cachedTimestamp);
}
$outputDone = true;
}
}
break;
case 3:
# This will set $this->mRevision if needed
$this->fetchContentObject();
# Are we looking at an old revision
if ($oldid && $this->mRevision) {
$this->setOldSubtitle($oldid);
if (!$this->showDeletedRevisionHeader()) {
wfDebug(__METHOD__ . ": cannot view deleted revision\n");
wfProfileOut(__METHOD__);
return;
}
}
# Ensure that UI elements requiring revision ID have
# the correct version information.
$outputPage->setRevisionId($this->getRevIdFetched());
# Preload timestamp to avoid a DB hit
$outputPage->setRevisionTimestamp($this->getTimestamp());
# Pages containing custom CSS or JavaScript get special treatment
if ($this->getTitle()->isCssOrJsPage() || $this->getTitle()->isCssJsSubpage()) {
wfDebug(__METHOD__ . ": showing CSS/JS source\n");
$this->showCssOrJsPage();
$outputDone = true;
} elseif (!wfRunHooks('ArticleContentViewCustom', array($this->fetchContentObject(), $this->getTitle(), $outputPage))) {
# Allow extensions do their own custom view for certain pages
$outputDone = true;
} elseif (!ContentHandler::runLegacyHooks('ArticleViewCustom', array($this->fetchContentObject(), $this->getTitle(), $outputPage))) {
# Allow extensions do their own custom view for certain pages
示例2: view
/**
* This is the default action of the index.php entry point: just view the
* page of the given title.
*/
public function view()
{
global $wgUser, $wgOut, $wgRequest, $wgParser;
global $wgUseFileCache, $wgUseETag;
wfProfileIn(__METHOD__);
# Get variables from query string
$oldid = $this->getOldID();
# getOldID may want us to redirect somewhere else
if ($this->mRedirectUrl) {
$wgOut->redirect($this->mRedirectUrl);
wfDebug(__METHOD__ . ": redirecting due to oldid\n");
wfProfileOut(__METHOD__);
return;
}
$wgOut->setArticleFlag(true);
# Set page title (may be overridden by DISPLAYTITLE)
$wgOut->setPageTitle($this->getTitle()->getPrefixedText());
# If we got diff in the query, we want to see a diff page instead of the article.
if ($wgRequest->getCheck('diff')) {
wfDebug(__METHOD__ . ": showing diff page\n");
$this->showDiffPage();
wfProfileOut(__METHOD__);
return;
}
# Allow frames by default
$wgOut->allowClickjacking();
$parserCache = ParserCache::singleton();
$parserOptions = $this->mPage->getParserOptions();
# Render printable version, use printable version cache
if ($wgOut->isPrintable()) {
$parserOptions->setIsPrintable(true);
$parserOptions->setEditSection(false);
} elseif ($wgUseETag && !$this->getTitle()->quickUserCan('edit')) {
$parserOptions->setEditSection(false);
}
# Try client and file cache
if ($oldid === 0 && $this->mPage->checkTouched()) {
if ($wgUseETag) {
$wgOut->setETag($parserCache->getETag($this, $parserOptions));
}
# Is it client cached?
if ($wgOut->checkLastModified($this->mPage->getTouched())) {
wfDebug(__METHOD__ . ": done 304\n");
wfProfileOut(__METHOD__);
return;
# Try file cache
} elseif ($wgUseFileCache && $this->tryFileCache()) {
wfDebug(__METHOD__ . ": done file cache\n");
# tell wgOut that output is taken care of
$wgOut->disable();
$this->mPage->viewUpdates();
wfProfileOut(__METHOD__);
return;
}
}
if (!$wgUseETag && !$this->getTitle()->quickUserCan('edit')) {
$parserOptions->setEditSection(false);
}
# Should the parser cache be used?
$useParserCache = $this->useParserCache($oldid);
wfDebug('Article::view using parser cache: ' . ($useParserCache ? 'yes' : 'no') . "\n");
if ($wgUser->getStubThreshold()) {
wfIncrStats('pcache_miss_stub');
}
$wasRedirected = $this->showRedirectedFromHeader();
$this->showNamespaceHeader();
# Iterate through the possible ways of constructing the output text.
# Keep going until $outputDone is set, or we run out of things to do.
$pass = 0;
$outputDone = false;
$this->mParserOutput = false;
while (!$outputDone && ++$pass) {
switch ($pass) {
case 1:
wfRunHooks('ArticleViewHeader', array(&$this, &$outputDone, &$useParserCache));
break;
case 2:
# Try the parser cache
if ($useParserCache) {
$this->mParserOutput = $parserCache->get($this, $parserOptions);
if ($this->mParserOutput !== false) {
wfDebug(__METHOD__ . ": showing parser cache contents\n");
$wgOut->addParserOutput($this->mParserOutput);
# Ensure that UI elements requiring revision ID have
# the correct version information.
$wgOut->setRevisionId($this->mPage->getLatest());
$outputDone = true;
# Preload timestamp to avoid a DB hit
if (isset($this->mParserOutput->mTimestamp)) {
$this->mPage->setTimestamp($this->mParserOutput->mTimestamp);
}
}
}
break;
case 3:
$text = $this->getContent();
//.........这里部分代码省略.........