当前位置: 首页>>代码示例>>PHP>>正文


PHP MWDebug::addModules方法代码示例

本文整理汇总了PHP中MWDebug::addModules方法的典型用法代码示例。如果您正苦于以下问题:PHP MWDebug::addModules方法的具体用法?PHP MWDebug::addModules怎么用?PHP MWDebug::addModules使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MWDebug的用法示例。


在下文中一共展示了MWDebug::addModules方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: output

 /**
  * Finally, all the text has been munged and accumulated into
  * the object, let's actually output it:
  */
 public function output()
 {
     if ($this->mDoNothing) {
         return;
     }
     $response = $this->getRequest()->response();
     $config = $this->getConfig();
     if ($this->mRedirect != '') {
         # Standards require redirect URLs to be absolute
         $this->mRedirect = wfExpandUrl($this->mRedirect, PROTO_CURRENT);
         $redirect = $this->mRedirect;
         $code = $this->mRedirectCode;
         if (Hooks::run("BeforePageRedirect", array($this, &$redirect, &$code))) {
             if ($code == '301' || $code == '303') {
                 if (!$config->get('DebugRedirects')) {
                     $response->statusHeader($code);
                 }
                 $this->mLastModified = wfTimestamp(TS_RFC2822);
             }
             if ($config->get('VaryOnXFP')) {
                 $this->addVaryHeader('X-Forwarded-Proto');
             }
             $this->sendCacheControl();
             $response->header("Content-Type: text/html; charset=utf-8");
             if ($config->get('DebugRedirects')) {
                 $url = htmlspecialchars($redirect);
                 print "<html>\n<head>\n<title>Redirect</title>\n</head>\n<body>\n";
                 print "<p>Location: <a href=\"{$url}\">{$url}</a></p>\n";
                 print "</body>\n</html>\n";
             } else {
                 $response->header('Location: ' . $redirect);
             }
         }
         return;
     } elseif ($this->mStatusCode) {
         $response->statusHeader($this->mStatusCode);
     }
     # Buffer output; final headers may depend on later processing
     ob_start();
     $response->header('Content-type: ' . $config->get('MimeType') . '; charset=UTF-8');
     $response->header('Content-language: ' . $config->get('LanguageCode'));
     // Avoid Internet Explorer "compatibility view" in IE 8-10, so that
     // jQuery etc. can work correctly.
     $response->header('X-UA-Compatible: IE=Edge');
     // Prevent framing, if requested
     $frameOptions = $this->getFrameOptions();
     if ($frameOptions) {
         $response->header("X-Frame-Options: {$frameOptions}");
     }
     if ($this->mArticleBodyOnly) {
         echo $this->mBodytext;
     } else {
         $sk = $this->getSkin();
         // add skin specific modules
         $modules = $sk->getDefaultModules();
         // enforce various default modules for all skins
         $coreModules = array('mediawiki.page.startup', 'mediawiki.user');
         // Support for high-density display images if enabled
         if ($config->get('ResponsiveImages')) {
             $coreModules[] = 'mediawiki.hidpi';
         }
         $this->addModules($coreModules);
         foreach ($modules as $group) {
             $this->addModules($group);
         }
         MWDebug::addModules($this);
         // Hook that allows last minute changes to the output page, e.g.
         // adding of CSS or Javascript by extensions.
         Hooks::run('BeforePageDisplay', array(&$this, &$sk));
         $sk->outputPage();
     }
     // This hook allows last minute changes to final overall output by modifying output buffer
     Hooks::run('AfterFinalPageOutput', array($this));
     $this->sendCacheControl();
     ob_end_flush();
 }
开发者ID:GoProjectOwner,项目名称:mediawiki,代码行数:80,代码来源:OutputPage.php

示例2: addDefaultModules

 /**
  * Add the default ResourceLoader modules to this object
  */
 private function addDefaultModules()
 {
     global $wgIncludeLegacyJavaScript, $wgPreloadJavaScriptMwUtil, $wgUseAjax, $wgAjaxWatch, $wgEnableMWSuggest;
     // Add base resources
     $this->addModules(array('mediawiki.user', 'mediawiki.page.startup', 'mediawiki.page.ready'));
     if ($wgIncludeLegacyJavaScript) {
         $this->addModules('mediawiki.legacy.wikibits');
     }
     if ($wgPreloadJavaScriptMwUtil) {
         $this->addModules('mediawiki.util');
     }
     MWDebug::addModules($this);
     $skin = $this->getSkin();
     // Add various resources if required
     if ($wgUseAjax) {
         # macbre: following files are part of merged JS for following skins - don't load them from here
         $skinName = get_class($skin);
         $skipWikiaSkins = array();
         if (!in_array($skinName, $skipWikiaSkins)) {
             $this->addModules('mediawiki.legacy.ajax');
         }
         wfRunHooks('AjaxAddScript', array(&$this));
         if (!in_array($skinName, $skipWikiaSkins)) {
             if ($wgAjaxWatch && $this->getUser()->isLoggedIn()) {
                 $this->addModules('mediawiki.action.watch.ajax');
             }
         }
         if (!in_array($skinName, $skipWikiaSkins)) {
             if ($wgEnableMWSuggest && !$this->getUser()->getOption('disablesuggest', false)) {
                 $this->addModules('mediawiki.legacy.mwsuggest');
             }
         }
     }
     if ($this->getUser()->getBoolOption('editsectiononrightclick')) {
         $this->addModules('mediawiki.action.view.rightClickEdit');
     }
     # Crazy edit-on-double-click stuff
     if ($this->isArticle() && $this->getUser()->getOption('editondblclick')) {
         $this->addModules('mediawiki.action.view.dblClickEdit');
     }
 }
开发者ID:schwarer2006,项目名称:wikia,代码行数:44,代码来源:OutputPage.php

示例3: output

 /**
  * Finally, all the text has been munged and accumulated into
  * the object, let's actually output it:
  */
 public function output()
 {
     global $wgLanguageCode, $wgDebugRedirects, $wgMimeType, $wgVaryOnXFP, $wgUseAjax, $wgResponsiveImages;
     if ($this->mDoNothing) {
         return;
     }
     wfProfileIn(__METHOD__);
     $response = $this->getRequest()->response();
     if ($this->mRedirect != '') {
         # Standards require redirect URLs to be absolute
         $this->mRedirect = wfExpandUrl($this->mRedirect, PROTO_CURRENT);
         $redirect = $this->mRedirect;
         $code = $this->mRedirectCode;
         if (wfRunHooks("BeforePageRedirect", array($this, &$redirect, &$code))) {
             if ($code == '301' || $code == '303') {
                 if (!$wgDebugRedirects) {
                     $message = HttpStatus::getMessage($code);
                     $response->header("HTTP/1.1 {$code} {$message}");
                 }
                 $this->mLastModified = wfTimestamp(TS_RFC2822);
             }
             if ($wgVaryOnXFP) {
                 $this->addVaryHeader('X-Forwarded-Proto');
             }
             $this->sendCacheControl();
             $response->header("Content-Type: text/html; charset=utf-8");
             if ($wgDebugRedirects) {
                 $url = htmlspecialchars($redirect);
                 print "<html>\n<head>\n<title>Redirect</title>\n</head>\n<body>\n";
                 print "<p>Location: <a href=\"{$url}\">{$url}</a></p>\n";
                 print "</body>\n</html>\n";
             } else {
                 $response->header('Location: ' . $redirect);
             }
         }
         wfProfileOut(__METHOD__);
         return;
     } elseif ($this->mStatusCode) {
         $message = HttpStatus::getMessage($this->mStatusCode);
         if ($message) {
             $response->header('HTTP/1.1 ' . $this->mStatusCode . ' ' . $message);
         }
     }
     # Buffer output; final headers may depend on later processing
     ob_start();
     $response->header("Content-type: {$wgMimeType}; charset=UTF-8");
     $response->header('Content-language: ' . $wgLanguageCode);
     // Prevent framing, if requested
     $frameOptions = $this->getFrameOptions();
     if ($frameOptions) {
         $response->header("X-Frame-Options: {$frameOptions}");
     }
     if ($this->mArticleBodyOnly) {
         echo $this->mBodytext;
     } else {
         $sk = $this->getSkin();
         // add skin specific modules
         $modules = $sk->getDefaultModules();
         // enforce various default modules for all skins
         $coreModules = array('mediawiki.page.startup', 'mediawiki.user');
         // Support for high-density display images if enabled
         if ($wgResponsiveImages) {
             $coreModules[] = 'mediawiki.hidpi';
         }
         $this->addModules($coreModules);
         foreach ($modules as $group) {
             $this->addModules($group);
         }
         MWDebug::addModules($this);
         if ($wgUseAjax) {
             // FIXME: deprecate? - not clear why this is useful
             wfRunHooks('AjaxAddScript', array(&$this));
         }
         // Hook that allows last minute changes to the output page, e.g.
         // adding of CSS or Javascript by extensions.
         wfRunHooks('BeforePageDisplay', array(&$this, &$sk));
         wfProfileIn('Output-skin');
         $sk->outputPage();
         wfProfileOut('Output-skin');
     }
     // This hook allows last minute changes to final overall output by modifying output buffer
     wfRunHooks('AfterFinalPageOutput', array($this));
     $this->sendCacheControl();
     ob_end_flush();
     wfProfileOut(__METHOD__);
 }
开发者ID:spring,项目名称:spring-website,代码行数:90,代码来源:OutputPage.php

示例4: addDefaultModules

 /**
  * Add the default ResourceLoader modules to this object
  */
 private function addDefaultModules()
 {
     global $wgIncludeLegacyJavaScript, $wgPreloadJavaScriptMwUtil, $wgUseAjax, $wgAjaxWatch, $wgEnableMWSuggest;
     // Add base resources
     $this->addModules(array('mediawiki.user', 'mediawiki.page.startup', 'mediawiki.page.ready'));
     if ($wgIncludeLegacyJavaScript) {
         $this->addModules('mediawiki.legacy.wikibits');
     }
     if ($wgPreloadJavaScriptMwUtil) {
         $this->addModules('mediawiki.util');
     }
     MWDebug::addModules($this);
     // Add various resources if required
     if ($wgUseAjax) {
         $this->addModules('mediawiki.legacy.ajax');
         wfRunHooks('AjaxAddScript', array(&$this));
         if ($wgAjaxWatch && $this->getUser()->isLoggedIn()) {
             $this->addModules('mediawiki.action.watch.ajax');
         }
         if ($wgEnableMWSuggest && !$this->getUser()->getOption('disablesuggest', false)) {
             $this->addModules('mediawiki.legacy.mwsuggest');
         }
     }
     if ($this->getUser()->getBoolOption('editsectiononrightclick')) {
         $this->addModules('mediawiki.action.view.rightClickEdit');
     }
     # Crazy edit-on-double-click stuff
     if ($this->isArticle() && $this->getUser()->getOption('editondblclick')) {
         $this->addModules('mediawiki.action.view.dblClickEdit');
     }
 }
开发者ID:slackfaith,项目名称:deadbrain_site,代码行数:34,代码来源:OutputPage.php


注:本文中的MWDebug::addModules方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。