X-Git-Url: https://git.cyclocoop.org/%20%27.%28%24debut%20%20%20%24par_page%29.%27?a=blobdiff_plain;f=includes%2FOutputPage.php;h=b6c48abba22fbdd4de8548c60f576c4e40cfe651;hb=5928784f9936aafebbba597c6d6ddc04db5f4d7b;hp=2ae5f787a7a72ab6c083bd28cea6a05e0b8ee4e9;hpb=3600ad0e5b0d0f2382668dd7b23f7ea8db963f40;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 2ae5f787a7..b6c48abba2 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -290,6 +290,9 @@ class OutputPage extends ContextSource { */ private $copyrightUrl; + /** @var array Profiling data */ + private $limitReportData = []; + /** * Constructor for OutputPage. This should not be called directly. * Instead a new RequestContext should be created and it will implicitly create @@ -604,29 +607,6 @@ class OutputPage extends ContextSource { $this->mModuleStyles = array_merge( $this->mModuleStyles, (array)$modules ); } - /** - * Get the list of module messages to include on this page - * - * @deprecated since 1.26 Obsolete - * @param bool $filter - * @param string|null $position - * @return array Array of module names - */ - public function getModuleMessages( $filter = false, $position = null ) { - wfDeprecated( __METHOD__, '1.26' ); - return []; - } - - /** - * Load messages of one or more ResourceLoader modules. - * - * @deprecated since 1.26 Use addModules() instead - * @param string|array $modules Module name (string) or array of module names - */ - public function addModuleMessages( $modules ) { - wfDeprecated( __METHOD__, '1.26' ); - } - /** * @return null|string ResourceLoader target */ @@ -1787,11 +1767,14 @@ class OutputPage extends ContextSource { } } - // enable OOUI if requested via ParserOutput + // Enable OOUI if requested via ParserOutput if ( $parserOutput->getEnableOOUI() ) { $this->enableOOUI(); } + // Include profiling data + $this->limitReportData = $parserOutput->getLimitReportData(); + // Link flags are ignored for now, but may in the future be // used to mark individual language links. $linkFlags = []; @@ -3108,7 +3091,13 @@ class OutputPage extends ContextSource { * @return string */ function getBottomScripts() { - return $this->getScriptsForBottomQueue(); + return $this->getScriptsForBottomQueue() . + ResourceLoader::makeInlineScript( + ResourceLoader::makeConfigSetScript( + [ 'wgPageParseReport' => $this->limitReportData ], + true + ) + ); } /** @@ -3671,7 +3660,7 @@ class OutputPage extends ContextSource { ) { // We're on a preview of a CSS subpage // Exclude this page from the user module in case it's in there (bug 26283) - $link = $this->makeResourceLoaderLink( 'user', ResourceLoaderModule::TYPE_STYLES, + $link = $this->makeResourceLoaderLink( 'user.styles', ResourceLoaderModule::TYPE_STYLES, [ 'excludepage' => $this->getTitle()->getPrefixedDBkey() ] ); $otherTags = array_merge( $otherTags, $link['html'] ); @@ -3686,7 +3675,7 @@ class OutputPage extends ContextSource { $otherTags[] = Html::inlineStyle( $previewedCSS ); } else { // Load the user styles normally - $moduleStyles[] = 'user'; + $moduleStyles[] = 'user.styles'; } // Per-user preference styles