本文整理汇总了PHP中wfReportTime函数的典型用法代码示例。如果您正苦于以下问题:PHP wfReportTime函数的具体用法?PHP wfReportTime怎么用?PHP wfReportTime使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wfReportTime函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: reject
function reject()
{
global $wgOut, $wgUser;
$dbw = wfGetDB(DB_MASTER);
$dbw->insert('rejected_email_links', array('rel_text' => "REJECTED\nuserid: " . $wgUser->getID() . "\n" . wfReportTime() . "\nReferer:" . $_SERVER["HTTP_REFERER"] . "\n" . wfGetIP() . "\n" . print_r($_POST, true)), __METHOD__);
//be coy
$this->thanks();
}
示例2: prepareQuickTemplate
//.........这里部分代码省略.........
// escape single quotes
$attrs = " lang=\"{$escUserlang}\" dir=\"{$escUserdir}\"";
$tpl->set('userlangattributes', $attrs);
}
$tpl->set('newtalk', $this->getNewtalks());
$tpl->set('logo', $this->logoText());
$tpl->set('copyright', false);
// No longer used
$tpl->set('viewcount', false);
$tpl->set('lastmod', false);
$tpl->set('credits', false);
$tpl->set('numberofwatchingusers', false);
if ($out->isArticle() && $title->exists()) {
if ($this->isRevisionCurrent()) {
if ($wgMaxCredits != 0) {
$tpl->set('credits', Action::factory('credits', $this->getWikiPage(), $this->getContext())->getCredits($wgMaxCredits, $wgShowCreditsIfMax));
} else {
$tpl->set('lastmod', $this->lastModified());
}
}
$tpl->set('copyright', $this->getCopyright());
}
$tpl->set('copyrightico', $this->getCopyrightIcon());
$tpl->set('poweredbyico', $this->getPoweredBy());
$tpl->set('disclaimer', $this->disclaimerLink());
$tpl->set('privacy', $this->privacyLink());
$tpl->set('about', $this->aboutLink());
$tpl->set('footerlinks', array('info' => array('lastmod', 'numberofwatchingusers', 'credits', 'copyright'), 'places' => array('privacy', 'about', 'disclaimer')));
global $wgFooterIcons;
$tpl->set('footericons', $wgFooterIcons);
foreach ($tpl->data['footericons'] as $footerIconsKey => &$footerIconsBlock) {
if (count($footerIconsBlock) > 0) {
foreach ($footerIconsBlock as &$footerIcon) {
if (isset($footerIcon['src'])) {
if (!isset($footerIcon['width'])) {
$footerIcon['width'] = 88;
}
if (!isset($footerIcon['height'])) {
$footerIcon['height'] = 31;
}
}
}
} else {
unset($tpl->data['footericons'][$footerIconsKey]);
}
}
$tpl->set('indicators', $out->getIndicators());
$tpl->set('sitenotice', $this->getSiteNotice());
$tpl->set('bottomscripts', $this->bottomScripts());
$tpl->set('printfooter', $this->printSource());
# An ID that includes the actual body text; without categories, contentSub, ...
$realBodyAttribs = array('id' => 'mw-content-text');
# Add a mw-content-ltr/rtl class to be able to style based on text direction
# when the content is different from the UI language, i.e.:
# not for special pages or file pages AND only when viewing AND if the page exists
# (or is in MW namespace, because that has default content)
if (!in_array($title->getNamespace(), array(NS_SPECIAL, NS_FILE)) && Action::getActionName($this) === 'view' && ($title->exists() || $title->getNamespace() == NS_MEDIAWIKI)) {
$pageLang = $title->getPageViewLanguage();
$realBodyAttribs['lang'] = $pageLang->getHtmlCode();
$realBodyAttribs['dir'] = $pageLang->getDir();
$realBodyAttribs['class'] = 'mw-content-' . $pageLang->getDir();
}
$out->mBodytext = Html::rawElement('div', $realBodyAttribs, $out->mBodytext);
$tpl->setRef('bodytext', $out->mBodytext);
$language_urls = $this->getLanguages();
if (count($language_urls)) {
$tpl->setRef('language_urls', $language_urls);
} else {
$tpl->set('language_urls', false);
}
# Personal toolbar
$tpl->set('personal_urls', $this->buildPersonalUrls());
$content_navigation = $this->buildContentNavigationUrls();
$content_actions = $this->buildContentActionUrls($content_navigation);
$tpl->setRef('content_navigation', $content_navigation);
$tpl->setRef('content_actions', $content_actions);
$tpl->set('sidebar', $this->buildSidebar());
$tpl->set('nav_urls', $this->buildNavUrls());
// Set the head scripts near the end, in case the above actions resulted in added scripts
$tpl->set('headelement', $out->headElement($this));
$tpl->set('debug', '');
$tpl->set('debughtml', $this->generateDebugHTML());
$tpl->set('reporttime', wfReportTime());
// original version by hansm
if (!Hooks::run('SkinTemplateOutputPageBeforeExec', array(&$this, &$tpl))) {
wfDebug(__METHOD__ . ": Hook SkinTemplateOutputPageBeforeExec broke outputPage execution!\n");
}
// Set the bodytext to another key so that skins can just output it on its own
// and output printfooter and debughtml separately
$tpl->set('bodycontent', $tpl->data['bodytext']);
// Append printfooter and debughtml onto bodytext so that skins that
// were already using bodytext before they were split out don't suddenly
// start not outputting information.
$tpl->data['bodytext'] .= Html::rawElement('div', array('class' => 'printfooter'), "\n{$tpl->data['printfooter']}") . "\n";
$tpl->data['bodytext'] .= $tpl->data['debughtml'];
// allow extensions adding stuff after the page content.
// See Skin::afterContentHook() for further documentation.
$tpl->set('dataAfterContent', $this->afterContentHook());
return $tpl;
}
示例3: reportTime
/**
* Deprecated, use wfReportTime() instead.
* @return string
* @deprecated
*/
public function reportTime()
{
wfDeprecated(__METHOD__);
$time = wfReportTime();
return $time;
}
示例4: executeActionWithErrorHandling
/**
* Execute an action, and in case of an error, erase whatever partial results
* have been accumulated, and replace it with an error message and a help screen.
*/
protected function executeActionWithErrorHandling()
{
// In case an error occurs during data output,
// clear the output buffer and print just the error information
ob_start();
try {
$this->executeAction();
} catch (Exception $e) {
// Log it
if ($e instanceof MWException) {
wfDebugLog('exception', $e->getLogMessage());
}
//
// Handle any kind of exception by outputing properly formatted error message.
// If this fails, an unhandled exception should be thrown so that global error
// handler will process and log it.
//
$errCode = $this->substituteResultWithError($e);
// Error results should not be cached
$this->setCacheMaxAge(0);
$headerStr = 'MediaWiki-API-Error: ' . $errCode;
if ($e->getCode() === 0) {
header($headerStr);
} else {
header($headerStr, true, $e->getCode());
}
// Reset and print just the error message
ob_clean();
// If the error occured during printing, do a printer->profileOut()
$this->mPrinter->safeProfileOut();
$this->printResult(true);
}
if ($this->mSquidMaxage == -1) {
# Nobody called setCacheMaxAge(), use the (s)maxage parameters
$smaxage = $this->getParameter('smaxage');
$maxage = $this->getParameter('maxage');
} else {
$smaxage = $maxage = $this->mSquidMaxage;
}
// Set the cache expiration at the last moment, as any errors may change the expiration.
// if $this->mSquidMaxage == 0, the expiry time is set to the first second of unix epoch
$exp = min($smaxage, $maxage);
$expires = $exp == 0 ? 1 : time() + $exp;
header('Expires: ' . wfTimestamp(TS_RFC2822, $expires));
header('Cache-Control: s-maxage=' . $smaxage . ', must-revalidate, max-age=' . $maxage);
if ($this->mPrinter->getIsHtml()) {
echo wfReportTime();
}
ob_end_flush();
}
示例5: outputPage
//.........这里部分代码省略.........
foreach ($tpl->data['footericons'] as $footerIconsKey => &$footerIconsBlock) {
if (count($footerIconsBlock) > 0) {
foreach ($footerIconsBlock as &$footerIcon) {
if (isset($footerIcon['src'])) {
if (!isset($footerIcon['width'])) {
$footerIcon['width'] = 88;
}
if (!isset($footerIcon['height'])) {
$footerIcon['height'] = 31;
}
}
}
} else {
unset($tpl->data['footericons'][$footerIconsKey]);
}
}
if ($wgDebugComments) {
$tpl->setRef('debug', $out->mDebugtext);
} else {
$tpl->set('debug', '');
}
$tpl->set('sitenotice', $this->getSiteNotice());
$tpl->set('bottomscripts', $this->bottomScripts());
$tpl->set('printfooter', $this->printSource());
# An ID that includes the actual body text; without categories, contentSub, ...
$realBodyAttribs = array('id' => 'mw-content-text');
# Add a mw-content-ltr/rtl class to be able to style based on text direction
# when the content is different from the UI language, i.e.:
# not for special pages or file pages AND only when viewing AND if the page exists
# (or is in MW namespace, because that has default content)
if (!in_array($title->getNamespace(), array(NS_SPECIAL, NS_FILE)) && in_array($request->getVal('action', 'view'), array('view', 'historysubmit')) && ($title->exists() || $title->getNamespace() == NS_MEDIAWIKI)) {
$pageLang = $title->getPageLanguage();
$realBodyAttribs['lang'] = $pageLang->getHtmlCode();
$realBodyAttribs['dir'] = $pageLang->getDir();
$realBodyAttribs['class'] = 'mw-content-' . $pageLang->getDir();
}
$out->mBodytext = Html::rawElement('div', $realBodyAttribs, $out->mBodytext);
$tpl->setRef('bodytext', $out->mBodytext);
# Language links
$language_urls = array();
if (!$wgHideInterlanguageLinks) {
foreach ($out->getLanguageLinks() as $l) {
$tmp = explode(':', $l, 2);
$class = 'interwiki-' . $tmp[0];
unset($tmp);
$nt = Title::newFromText($l);
if ($nt) {
$language_urls[] = array('href' => $nt->getFullURL(), 'text' => $wgContLang->getLanguageName($nt->getInterwiki()) != '' ? $wgContLang->getLanguageName($nt->getInterwiki()) : $l, 'title' => $nt->getText(), 'class' => $class, 'lang' => $nt->getInterwiki(), 'hreflang' => $nt->getInterwiki());
}
}
}
if (count($language_urls)) {
$tpl->setRef('language_urls', $language_urls);
} else {
$tpl->set('language_urls', false);
}
wfProfileOut(__METHOD__ . '-stuff4');
wfProfileIn(__METHOD__ . '-stuff5');
# Personal toolbar
$tpl->set('personal_urls', $this->buildPersonalUrls());
$content_navigation = $this->buildContentNavigationUrls();
$content_actions = $this->buildContentActionUrls($content_navigation);
$tpl->setRef('content_navigation', $content_navigation);
$tpl->setRef('content_actions', $content_actions);
$tpl->set('sidebar', $this->buildSidebar());
$tpl->set('nav_urls', $this->buildNavUrls());
// Set the head scripts near the end, in case the above actions resulted in added scripts
if ($this->useHeadElement) {
$tpl->set('headelement', $out->headElement($this));
} else {
$tpl->set('headscripts', $out->getHeadScripts() . $out->getHeadItems());
}
$tpl->set('debughtml', $this->generateDebugHTML());
$tpl->set('reporttime', wfReportTime());
// original version by hansm
if (!wfRunHooks('SkinTemplateOutputPageBeforeExec', array(&$this, &$tpl))) {
wfDebug(__METHOD__ . ": Hook SkinTemplateOutputPageBeforeExec broke outputPage execution!\n");
}
// Set the bodytext to another key so that skins can just output it on it's own
// and output printfooter and debughtml separately
$tpl->set('bodycontent', $tpl->data['bodytext']);
// Append printfooter and debughtml onto bodytext so that skins that were already
// using bodytext before they were split out don't suddenly start not outputting information
$tpl->data['bodytext'] .= Html::rawElement('div', array('class' => 'printfooter'), "\n{$tpl->data['printfooter']}") . "\n";
$tpl->data['bodytext'] .= $tpl->data['debughtml'];
// allow extensions adding stuff after the page content.
// See Skin::afterContentHook() for further documentation.
$tpl->set('dataAfterContent', $this->afterContentHook());
wfProfileOut(__METHOD__ . '-stuff5');
// execute template
wfProfileIn(__METHOD__ . '-execute');
$res = $tpl->execute();
wfProfileOut(__METHOD__ . '-execute');
// result may be an error
$this->printOrError($res);
if ($oldContext) {
$this->setContext($oldContext);
}
wfProfileOut(__METHOD__);
}
示例6: wfReportTime
<?php
echo wfReportTime();
示例7: reportTime
/**
* Returns a HTML comment with the elapsed time since request.
* This method has no side effects.
* Use wfReportTime() instead.
* @return string
* @deprecated
*/
function reportTime()
{
$time = wfReportTime();
return $time;
}
示例8: outputPage
//.........这里部分代码省略.........
$dbr = wfGetDB(DB_SLAVE);
$watchlist = $dbr->tableName('watchlist');
$res = $dbr->select('watchlist', array('COUNT(*) AS n'), array('wl_title' => $dbr->strencode($this->mTitle->getDBkey()), 'wl_namespace' => $this->mTitle->getNamespace()), __METHOD__);
$x = $dbr->fetchObject($res);
$numberofwatchingusers = $x->n;
if ($numberofwatchingusers > 0) {
$tpl->set('numberofwatchingusers', wfMsgExt('number_of_watching_users_pageview', array('parseinline'), $wgLang->formatNum($numberofwatchingusers)));
} else {
$tpl->set('numberofwatchingusers', false);
}
} else {
$tpl->set('numberofwatchingusers', false);
}
$tpl->set('copyright', $this->getCopyright());
$this->credits = false;
if ($wgMaxCredits != 0) {
$this->credits = Credits::getCredits($wgArticle, $wgMaxCredits, $wgShowCreditsIfMax);
} else {
$tpl->set('lastmod', $this->lastModified());
}
$tpl->setRef('credits', $this->credits);
} elseif (isset($oldid) && !isset($diff)) {
$tpl->set('copyright', $this->getCopyright());
$tpl->set('viewcount', false);
$tpl->set('lastmod', false);
$tpl->set('credits', false);
$tpl->set('numberofwatchingusers', false);
} else {
$tpl->set('copyright', false);
$tpl->set('viewcount', false);
$tpl->set('lastmod', false);
$tpl->set('credits', false);
$tpl->set('numberofwatchingusers', false);
}
wfProfileOut(__METHOD__ . '-stuff3');
wfProfileIn(__METHOD__ . '-stuff4');
$tpl->set('copyrightico', $this->getCopyrightIcon());
$tpl->set('poweredbyico', $this->getPoweredBy());
$tpl->set('disclaimer', $this->disclaimerLink());
$tpl->set('privacy', $this->privacyLink());
$tpl->set('about', $this->aboutLink());
if ($wgDebugComments) {
$tpl->setRef('debug', $out->mDebugtext);
} else {
$tpl->set('debug', '');
}
$tpl->set('reporttime', wfReportTime());
$tpl->set('sitenotice', wfGetSiteNotice());
$tpl->set('bottomscripts', $this->bottomScripts());
$printfooter = "<div class=\"printfooter\">\n" . $this->printSource() . "</div>\n";
$out->mBodytext .= $printfooter . $this->generateDebugHTML();
$tpl->setRef('bodytext', $out->mBodytext);
# Language links
$language_urls = array();
if (!$wgHideInterlanguageLinks) {
foreach ($out->getLanguageLinks() as $l) {
$tmp = explode(':', $l, 2);
$class = 'interwiki-' . $tmp[0];
unset($tmp);
$nt = Title::newFromText($l);
if ($nt) {
$language_urls[] = array('href' => $nt->getFullURL(), 'text' => $wgContLang->getLanguageName($nt->getInterwiki()) != '' ? $wgContLang->getLanguageName($nt->getInterwiki()) : $l, 'class' => $class);
}
}
}
if (count($language_urls)) {
$tpl->setRef('language_urls', $language_urls);
} else {
$tpl->set('language_urls', false);
}
wfProfileOut(__METHOD__ . '-stuff4');
wfProfileIn(__METHOD__ . '-stuff5');
# Personal toolbar
$tpl->set('personal_urls', $this->buildPersonalUrls());
$content_actions = $this->buildContentActionUrls();
$tpl->setRef('content_actions', $content_actions);
$tpl->set('sidebar', $this->buildSidebar());
$tpl->set('nav_urls', $this->buildNavUrls());
// Set the head scripts near the end, in case the above actions resulted in added scripts
if ($this->useHeadElement) {
$tpl->set('headelement', $out->headElement($this));
} else {
$tpl->set('headscripts', $out->getScript());
}
// original version by hansm
if (!wfRunHooks('SkinTemplateOutputPageBeforeExec', array(&$this, &$tpl))) {
wfDebug(__METHOD__ . ": Hook SkinTemplateOutputPageBeforeExec broke outputPage execution!\n");
}
// allow extensions adding stuff after the page content.
// See Skin::afterContentHook() for further documentation.
$tpl->set('dataAfterContent', $this->afterContentHook());
wfProfileOut(__METHOD__ . '-stuff5');
// execute template
wfProfileIn(__METHOD__ . '-execute');
$res = $tpl->execute();
wfProfileOut(__METHOD__ . '-execute');
// result may be an error
$this->printOrError($res);
wfProfileOut(__METHOD__);
}
示例9: outputPage
//.........这里部分代码省略.........
if ($wgPageShowWatchingUsers) {
$dbr = wfGetDB(DB_SLAVE);
$watchlist = $dbr->tableName('watchlist');
$sql = "SELECT COUNT(*) AS n FROM {$watchlist}\n\t\t\t\t\tWHERE wl_title='" . $dbr->strencode($this->mTitle->getDBkey()) . "' AND wl_namespace=" . $this->mTitle->getNamespace();
$res = $dbr->query($sql, 'SkinTemplate::outputPage');
$x = $dbr->fetchObject($res);
$numberofwatchingusers = $x->n;
if ($numberofwatchingusers > 0) {
$tpl->set('numberofwatchingusers', wfMsgExt('number_of_watching_users_pageview', array('parseinline'), $wgLang->formatNum($numberofwatchingusers)));
} else {
$tpl->set('numberofwatchingusers', false);
}
} else {
$tpl->set('numberofwatchingusers', false);
}
$tpl->set('copyright', $this->getCopyright());
$this->credits = false;
if ($wgMaxCredits != 0) {
$this->credits = Credits::getCredits($wgArticle, $wgMaxCredits, $wgShowCreditsIfMax);
} else {
$tpl->set('lastmod', $this->lastModified());
}
$tpl->setRef('credits', $this->credits);
} elseif (isset($oldid) && !isset($diff)) {
$tpl->set('copyright', $this->getCopyright());
$tpl->set('viewcount', false);
$tpl->set('lastmod', false);
$tpl->set('credits', false);
$tpl->set('numberofwatchingusers', false);
} else {
$tpl->set('copyright', false);
$tpl->set('viewcount', false);
$tpl->set('lastmod', false);
$tpl->set('credits', false);
$tpl->set('numberofwatchingusers', false);
}
wfProfileOut(__METHOD__ . "-stuff3");
wfProfileIn(__METHOD__ . "-stuff4");
$tpl->set('copyrightico', $this->getCopyrightIcon());
$tpl->set('poweredbyico', $this->getPoweredBy());
$tpl->set('disclaimer', $this->disclaimerLink());
$tpl->set('privacy', $this->privacyLink());
$tpl->set('about', $this->aboutLink());
$tpl->setRef('debug', $out->mDebugtext);
$tpl->set('reporttime', wfReportTime());
$tpl->set('sitenotice', wfGetSiteNotice());
$tpl->set('bottomscripts', $this->bottomScripts());
$printfooter = "<div class=\"printfooter\">\n" . $this->printSource() . "</div>\n";
$out->mBodytext .= $printfooter;
$tpl->setRef('bodytext', $out->mBodytext);
# Language links
$language_urls = array();
if (!$wgHideInterlanguageLinks) {
foreach ($out->getLanguageLinks() as $l) {
$tmp = explode(':', $l, 2);
$class = 'interwiki-' . $tmp[0];
unset($tmp);
$nt = Title::newFromText($l);
if ($nt) {
$language_urls[] = array('href' => $nt->getFullURL(), 'text' => $wgContLang->getLanguageName($nt->getInterwiki()) != '' ? $wgContLang->getLanguageName($nt->getInterwiki()) : $l, 'class' => $class);
}
}
}
if (count($language_urls)) {
$tpl->setRef('language_urls', $language_urls);
} else {
$tpl->set('language_urls', false);
}
wfProfileOut(__METHOD__ . "-stuff4");
wfProfileIn(__METHOD__ . "-stuff5");
# Personal toolbar
$tpl->set('personal_urls', $this->buildPersonalUrls());
$content_actions = $this->buildContentActionUrls();
$tpl->setRef('content_actions', $content_actions);
// XXX: attach this from javascript, same with section editing
if ($this->iseditable && $wgUser->getOption("editondblclick")) {
$encEditUrl = Xml::escapeJsString($this->mTitle->getLocalUrl($this->editUrlOptions()));
$tpl->set('body_ondblclick', 'document.location = "' . $encEditUrl . '";');
} else {
$tpl->set('body_ondblclick', false);
}
$tpl->set('body_onload', false);
$tpl->set('sidebar', $this->buildSidebar());
$tpl->set('nav_urls', $this->buildNavUrls());
// original version by hansm
if (!wfRunHooks('SkinTemplateOutputPageBeforeExec', array(&$this, &$tpl))) {
wfDebug(__METHOD__ . ': Hook SkinTemplateOutputPageBeforeExec broke outputPage execution!');
}
// allow extensions adding stuff after the page content.
// See Skin::afterContentHook() for further documentation.
$tpl->set('dataAfterContent', $this->afterContentHook());
wfProfileOut(__METHOD__ . "-stuff5");
// execute template
wfProfileIn(__METHOD__ . "-execute");
$res = $tpl->execute();
wfProfileOut(__METHOD__ . "-execute");
// result may be an error
$this->printOrError($res);
wfProfileOut(__METHOD__);
}
示例10: execute
//.........这里部分代码省略.........
<?php
if ($wgLanguageCode == 'en' && !$isLoggedIn && class_exists('GoogSearch')) {
?>
<?php
echo GoogSearch::getSearchBoxJS();
?>
<?php
}
?>
<script type="text/javascript">
(function ($) {
$(document).ready(function() {
WH.addScrollEffectToTOC();
});
$(window).load(function() {
if ($('.twitter-share-button').length && (!$.browser.msie || $.browser.version > 7)) {
$.getScript("https://platform.twitter.com/widgets.js", function() {
twttr.events.bind('tweet', function(event) {
if (event) {
var targetUrl;
if (event.target && event.target.nodeName == 'IFRAME') {
targetUrl = extractParamFromUri(event.target.src, 'url');
}
_gaq.push(['_trackSocial', 'twitter', 'tweet', targetUrl]);
}
});
});
}
if (isiPhone < 0 && isiPad < 0 && $('.gplus1_button').length) {
WH.setGooglePlusOneLangCode();
var node2 = document.createElement('script');
node2.type = 'text/javascript';
node2.async = true;
node2.src = 'http://apis.google.com/js/plusone.js';
$('body').append(node2);
}
if (typeof WH.FB != 'undefined') WH.FB.init('new');
if (typeof WH.GP != 'undefined') WH.GP.init();
if ($('#pinterest').length) {
var node3 = document.createElement('script');
node3.type = 'text/javascript';
node3.async = true;
node3.src = 'http://assets.pinterest.com/js/pinit.js';
$('body').append(node3);
}
if (typeof WH.imageFeedback != 'undefined') {
WH.imageFeedback();
}
if (typeof WH.uciFeedback != 'undefined') {
WH.uciFeedback();
}
});
})(jQuery);
</script>
<?php
//Temporarily taking down Jane
/*
var r = Math.random();
if(r <= .05) {
$('#starter_ad').show();
}*/
if ($showStaffStats) {
?>
<?php
echo Pagestats::getJSsnippet("article");
}
echo $wgOut->getBottomScripts();
?>
<?php
if (class_exists('GoodRevision')) {
?>
<?php
$grevid = $wgTitle ? GoodRevision::getUsedRev($wgTitle->getArticleID()) : '';
$title = $this->getSkin()->getContext()->getTitle();
$latestRev = $title->getNamespace() == NS_MAIN ? $title->getLatestRevID() : '';
?>
<!-- shown patrolled revid=<?php
echo $grevid;
?>
, latest=<?php
echo $latestRev;
?>
-->
<?php
}
echo wfReportTime();
$this->printTrail();
?>
</body>
</html>
<?php
}
示例11: executeActionWithErrorHandling
/**
* Execute an action, and in case of an error, erase whatever partial results
* have been accumulated, and replace it with an error message and a help screen.
*/
protected function executeActionWithErrorHandling()
{
// Verify the CORS header before executing the action
if (!$this->handleCORS()) {
// handleCORS() has sent a 403, abort
return;
}
// Exit here if the request method was OPTIONS
// (assume there will be a followup GET or POST)
if ($this->getRequest()->getMethod() === 'OPTIONS') {
return;
}
// In case an error occurs during data output,
// clear the output buffer and print just the error information
ob_start();
$t = microtime(true);
try {
$this->executeAction();
} catch (Exception $e) {
$this->handleException($e);
}
// Log the request whether or not there was an error
$this->logRequest(microtime(true) - $t);
// Send cache headers after any code which might generate an error, to
// avoid sending public cache headers for errors.
$this->sendCacheHeaders();
if ($this->mPrinter->getIsHtml() && !$this->mPrinter->isDisabled()) {
echo wfReportTime();
}
ob_end_flush();
}
示例12: function
<script src="<?php
echo $wg->ResourceBasePath;
?>
/resources/wikia/libraries/html5/html5.min.js"></script>
<![endif]-->
<!-- Combined JS files and head scripts -->
<?php
echo $jsFiles;
}
?>
<script type="text/javascript">/*<![CDATA[*/ Wikia.LazyQueue.makeQueue(wgAfterContentAndJS, function(fn) {fn();}); wgAfterContentAndJS.start(); /*]]>*/</script>
<?php
if ($wg->EnableAdEngineExt) {
?>
<script type="text/javascript">/*<![CDATA[*/ if (typeof AdEngine_trackPageInteractive === 'function') {wgAfterContentAndJS.push(AdEngine_trackPageInteractive);} /*]]>*/</script>
<?php
}
echo $bottomScripts;
?>
</body>
<?php
echo wfReportTime() . "\n";
echo F::app()->renderView('Ad', 'Config');
?>
</html>
示例13: outputPage
//.........这里部分代码省略.........
$tpl->set('numberofwatchingusers', false);
}
wfProfileOut(__METHOD__ . '-stuff3');
wfProfileIn(__METHOD__ . '-stuff4');
$tpl->set('copyrightico', $this->getCopyrightIcon());
$tpl->set('poweredbyico', $this->getPoweredBy());
$tpl->set('disclaimer', $this->disclaimerLink());
$tpl->set('privacy', $this->privacyLink());
$tpl->set('about', $this->aboutLink());
$tpl->set('footerlinks', array('info' => array('lastmod', 'viewcount', 'numberofwatchingusers', 'credits', 'copyright'), 'places' => array('privacy', 'about', 'disclaimer')));
global $wgFooterIcons;
$tpl->set('footericons', $wgFooterIcons);
foreach ($tpl->data['footericons'] as $footerIconsKey => &$footerIconsBlock) {
if (count($footerIconsBlock) > 0) {
foreach ($footerIconsBlock as &$footerIcon) {
if (isset($footerIcon['src'])) {
if (!isset($footerIcon['width'])) {
$footerIcon['width'] = 88;
}
if (!isset($footerIcon['height'])) {
$footerIcon['height'] = 31;
}
}
}
} else {
unset($tpl->data['footericons'][$footerIconsKey]);
}
}
if ($wgDebugComments) {
$tpl->setRef('debug', $out->mDebugtext);
} else {
$tpl->set('debug', '');
}
$tpl->set('reporttime', wfReportTime());
$tpl->set('sitenotice', $this->getSiteNotice());
$tpl->set('bottomscripts', $this->bottomScripts($out));
$tpl->set('printfooter', $this->printSource());
# Add a <div class="mw-content-ltr/rtl"> around the body text
# not for special pages or file pages AND only when viewing AND if the page exists
# (or is in MW namespace, because that has default content)
if (!in_array($this->getTitle()->getNamespace(), array(NS_SPECIAL, NS_FILE)) && in_array($action, array('view', 'historysubmit')) && ($this->getTitle()->exists() || $this->getTitle()->getNamespace() == NS_MEDIAWIKI)) {
$pageLang = $this->getTitle()->getPageLanguage();
$realBodyAttribs = array('lang' => $pageLang->getCode(), 'dir' => $pageLang->getDir(), 'class' => 'mw-content-' . $pageLang->getDir());
$out->mBodytext = Html::rawElement('div', $realBodyAttribs, $out->mBodytext);
}
$tpl->setRef('bodytext', $out->mBodytext);
# Language links
$language_urls = array();
if (!$wgHideInterlanguageLinks) {
foreach ($out->getLanguageLinks() as $l) {
$tmp = explode(':', $l, 2);
$class = 'interwiki-' . $tmp[0];
unset($tmp);
$nt = Title::newFromText($l);
if ($nt) {
$language_urls[] = array('href' => $nt->getFullURL(), 'text' => $wgContLang->getLanguageName($nt->getInterwiki()) != '' ? $wgContLang->getLanguageName($nt->getInterwiki()) : $l, 'title' => $nt->getText(), 'class' => $class, 'lang' => $nt->getInterwiki(), 'hreflang' => $nt->getInterwiki());
}
}
}
if (count($language_urls)) {
$tpl->setRef('language_urls', $language_urls);
} else {
$tpl->set('language_urls', false);
}
wfProfileOut(__METHOD__ . '-stuff4');
wfProfileIn(__METHOD__ . '-stuff5');
示例14: outputPage
function outputPage(OutputPage $out)
{
global $wgDebugComments;
wfProfileIn(__METHOD__);
$this->setMembers();
$this->initPage($out);
// See self::afterContentHook() for documentation
$afterContent = $this->afterContentHook();
$out->out($out->headElement($this));
$out->out("\n<body");
$ops = $this->getBodyOptions();
foreach ($ops as $name => $val) {
$out->out(" {$name}='{$val}'");
}
$out->out(">\n");
if ($wgDebugComments) {
$out->out("<!-- Wiki debugging output:\n" . $out->mDebugtext . "-->\n");
}
$out->out($this->beforeContent());
$out->out($out->mBodytext . "\n");
$out->out($this->afterContent());
$out->out($afterContent);
$out->out($this->bottomScripts());
$out->out(wfReportTime());
$out->out("\n</body></html>");
wfProfileOut(__METHOD__);
}
示例15: executeActionWithErrorHandling
/**
* Execute an action, and in case of an error, erase whatever partial results
* have been accumulated, and replace it with an error message and a help screen.
*/
protected function executeActionWithErrorHandling()
{
// Verify the CORS header before executing the action
if (!$this->handleCORS()) {
// handleCORS() has sent a 403, abort
return;
}
// Exit here if the request method was OPTIONS
// (assume there will be a followup GET or POST)
if ($this->getRequest()->getMethod() === 'OPTIONS') {
return;
}
// In case an error occurs during data output,
// clear the output buffer and print just the error information
ob_start();
$t = microtime(true);
try {
$this->executeAction();
} catch (Exception $e) {
// Allow extra cleanup and logging
wfRunHooks('ApiMain::onException', array($this, $e));
// Log it
if ($e instanceof MWException && !$e instanceof UsageException) {
global $wgLogExceptionBacktrace;
if ($wgLogExceptionBacktrace) {
wfDebugLog('exception', $e->getLogMessage() . "\n" . $e->getTraceAsString() . "\n");
} else {
wfDebugLog('exception', $e->getLogMessage());
}
}
// Handle any kind of exception by outputting properly formatted error message.
// If this fails, an unhandled exception should be thrown so that global error
// handler will process and log it.
$errCode = $this->substituteResultWithError($e);
// Error results should not be cached
$this->setCacheMode('private');
$response = $this->getRequest()->response();
$headerStr = 'MediaWiki-API-Error: ' . $errCode;
if ($e->getCode() === 0) {
$response->header($headerStr);
} else {
$response->header($headerStr, true, $e->getCode());
}
// Reset and print just the error message
ob_clean();
// If the error occurred during printing, do a printer->profileOut()
$this->mPrinter->safeProfileOut();
$this->printResult(true);
}
// Log the request whether or not there was an error
$this->logRequest(microtime(true) - $t);
// Send cache headers after any code which might generate an error, to
// avoid sending public cache headers for errors.
$this->sendCacheHeaders();
if ($this->mPrinter->getIsHtml() && !$this->mPrinter->isDisabled()) {
echo wfReportTime();
}
ob_end_flush();
}