- $ns = $wgTitle->getNamespace();
-
- // Namespace might change when using redirects
- if($action == 'view' && !$wgRequest->getVal( 'oldid' ) ) {
- $wgArticle = new Article( $wgTitle );
- $rTitle = Title::newFromRedirect( $wgArticle->fetchContent() );
- if($rTitle) {
- # Reload from the page pointed to later
- $wgArticle->mContentLoaded = false;
- $ns = $rTitle->getNamespace();
- }
- }
-
- // Categories and images are handled by a different class
- if ( $ns == NS_IMAGE ) {
- unset($wgArticle);
- require_once( 'includes/ImagePage.php' );
- $wgArticle = new ImagePage( $wgTitle );
- } elseif ( $ns == NS_CATEGORY ) {
- unset($wgArticle);
- require_once( 'includes/CategoryPage.php' );
- $wgArticle = new CategoryPage( $wgTitle );
- }
-
- require_once ( "includes/Wiki.php" ) ;
- $mediaWiki = new MediaWiki() ;
-
- if ( in_array( $action, $wgDisabledActions ) ) {
- $wgOut->errorpage( 'nosuchaction', 'nosuchactiontext' );
- } else {
- $mediaWiki->setVal ( "SquidMaxage" , $wgSquidMaxage ) ;
- $mediaWiki->setVal ( "EnableDublinCoreRdf" , $wgEnableDublinCoreRdf ) ;
- $mediaWiki->setVal ( "EnableCreativeCommonsRdf" , $wgEnableCreativeCommonsRdf ) ;
- $mediaWiki->setVal ( "CommandLineMode" , $wgCommandLineMode ) ;
- $mediaWiki->setVal ( "UseExternalEditor" , $wgUseExternalEditor ) ;
- $mediaWiki->performAction ( $action , $wgOut , $wgArticle , $wgTitle , $wgUser , $wgRequest ) ;
- }
-
-
-}
-wfProfileOut( 'main-action' );
-
-# Deferred updates aren't really deferred anymore. It's important to report errors to the
-# user, and that means doing this before OutputPage::output(). Note that for page saves,
-# the client will wait until the script exits anyway before following the redirect.
-wfProfileIn( 'main-updates' );
-foreach ( $wgDeferredUpdateList as $up ) {
- $up->doUpdate();
-}
-wfProfileOut( 'main-updates' );
-
-wfProfileIn( 'main-cleanup' );
-$wgLoadBalancer->saveMasterPos();
-
-# Now commit any transactions, so that unreported errors after output() don't roll back the whole thing
-$wgLoadBalancer->commitAll();