Remove SessionManager, temporarily
[lhc/web/wiklou.git] / includes / specialpage / SpecialPageFactory.php
index e794a5d..3babafd 100644 (file)
@@ -96,6 +96,7 @@ class SpecialPageFactory {
                'ResetTokens' => 'SpecialResetTokens',
                'Contributions' => 'SpecialContributions',
                'Listgrouprights' => 'SpecialListGroupRights',
+               'Listgrants' => 'SpecialListGrants',
                'Listusers' => 'SpecialListUsers',
                'Listadmins' => 'SpecialListAdmins',
                'Listbots' => 'SpecialListBots',
@@ -133,6 +134,7 @@ class SpecialPageFactory {
                'Randompage' => 'RandomPage',
                'RandomInCategory' => 'SpecialRandomInCategory',
                'Randomredirect' => 'SpecialRandomredirect',
+               'Randomrootpage' => 'SpecialRandomrootpage',
 
                // High use pages
                'Mostlinkedcategories' => 'MostlinkedCategoriesPage',
@@ -391,7 +393,7 @@ class SpecialPageFactory {
                                        'closure_expansion' => false,
                                ) );
                        } elseif ( $rec instanceof SpecialPage ) {
-                               $page = $rec; //XXX: we should deep clone here
+                               $page = $rec; // XXX: we should deep clone here
                        } else {
                                $page = null;
                        }
@@ -498,7 +500,6 @@ class SpecialPageFactory {
         * @return bool
         */
        public static function executePath( Title &$title, IContextSource &$context, $including = false ) {
-
                // @todo FIXME: Redirects broken due to this call
                $bits = explode( '/', $title->getDBkey(), 2 );
                $name = $bits[0];
@@ -507,8 +508,8 @@ class SpecialPageFactory {
                } else {
                        $par = $bits[1];
                }
+
                $page = self::getPage( $name );
-               // Nonexistent?
                if ( !$page ) {
                        $context->getOutput()->setArticleRelated( false );
                        $context->getOutput()->setRobotPolicy( 'noindex,nofollow' );
@@ -523,6 +524,15 @@ class SpecialPageFactory {
                        return false;
                }
 
+               if ( !$including ) {
+                       // Narrow DB query expectations for this HTTP request
+                       $trxLimits = $context->getConfig()->get( 'TrxProfilerLimits' );
+                       $trxProfiler = Profiler::instance()->getTransactionProfiler();
+                       if ( $context->getRequest()->wasPosted() && !$page->doesWrites() ) {
+                               $trxProfiler->setExpectations( $trxLimits['POST-nonwrite'], __METHOD__ );
+                       }
+               }
+
                // Page exists, set the context
                $page->setContext( $context );