X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/pie.php?a=blobdiff_plain;f=includes%2Fspecialpage%2FSpecialPageFactory.php;h=175b0cb1158d40c14170d139cbb59628db4eddd4;hb=aa21e125a34e8ca44e05d5dd96bb28562ec8e347;hp=9a6b787d2f0b55eab006ddf8e3bb49e1498ec744;hpb=8fc9ade3a809e52443c2cdf47f70d8bd725dca40;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specialpage/SpecialPageFactory.php b/includes/specialpage/SpecialPageFactory.php index 9a6b787d2f..175b0cb115 100644 --- a/includes/specialpage/SpecialPageFactory.php +++ b/includes/specialpage/SpecialPageFactory.php @@ -156,6 +156,7 @@ class SpecialPageFactory { 'Booksources' => 'SpecialBookSources', // Unlisted / redirects + 'ApiHelp' => 'SpecialApiHelp', 'Blankpage' => 'SpecialBlankpage', 'Diff' => 'SpecialDiff', 'Emailuser' => 'SpecialEmailUser', @@ -214,19 +215,14 @@ class SpecialPageFactory { */ private static function getPageList() { global $wgSpecialPages; - global $wgDisableCounters, $wgDisableInternalSearch, $wgEmailAuthentication; + global $wgDisableInternalSearch, $wgEmailAuthentication; global $wgEnableEmail, $wgEnableJavaScriptTest; global $wgPageLanguageUseDB; if ( !is_array( self::$list ) ) { - wfProfileIn( __METHOD__ ); self::$list = self::$coreList; - if ( !$wgDisableCounters ) { - self::$list['Popularpages'] = 'PopularPagesPage'; - } - if ( !$wgDisableInternalSearch ) { self::$list['Search'] = 'SpecialSearch'; } @@ -255,9 +251,8 @@ class SpecialPageFactory { // Run hooks // This hook can be used to remove undesired built-in special pages - wfRunHooks( 'SpecialPage_initList', array( &self::$list ) ); + Hooks::run( 'SpecialPage_initList', array( &self::$list ) ); - wfProfileOut( __METHOD__ ); } return self::$list; @@ -417,7 +412,11 @@ class SpecialPageFactory { // @deprecated, officially since 1.18, unofficially since forever wfDeprecated( "Array syntax for \$wgSpecialPages is deprecated ($className), " . "define a subclass of SpecialPage instead.", '1.18' ); - $page = MWFunction::newObj( $className, $rec ); + $page = ObjectFactory::getObjectFromSpec( array( + 'class' => $className, + 'args' => $rec, + 'closure_expansion' => false, + ) ); } elseif ( $rec instanceof SpecialPage ) { $page = $rec; //XXX: we should deep clone here } else { @@ -526,7 +525,6 @@ class SpecialPageFactory { * @return bool */ public static function executePath( Title &$title, IContextSource &$context, $including = false ) { - wfProfileIn( __METHOD__ ); // @todo FIXME: Redirects broken due to this call $bits = explode( '/', $title->getDBkey(), 2 ); @@ -548,7 +546,6 @@ class SpecialPageFactory { } $context->getOutput()->showErrorPage( 'nosuchspecialpage', 'nospecialpagetext' ); - wfProfileOut( __METHOD__ ); return false; } @@ -568,14 +565,12 @@ class SpecialPageFactory { $title = $page->getPageTitle( $par ); $url = $title->getFullURL( $query ); $context->getOutput()->redirect( $url ); - wfProfileOut( __METHOD__ ); return $title; } else { $context->setTitle( $page->getPageTitle( $par ) ); } } elseif ( !$page->isIncludable() ) { - wfProfileOut( __METHOD__ ); return false; } @@ -583,11 +578,7 @@ class SpecialPageFactory { $page->including( $including ); // Execute special page - $profName = 'Special:' . $page->getName(); - wfProfileIn( $profName ); $page->run( $par ); - wfProfileOut( $profName ); - wfProfileOut( __METHOD__ ); return true; }