- switch( $action ) {
- case "view":
- $wgOut->setSquidMaxage( $wgSquidMaxage );
- $wgArticle->view();
- break;
- case "watch":
- case "unwatch":
- case "delete":
- case "revert":
- case "rollback":
- case "protect":
- case "unprotect":
- case "validate":
- case "info":
- case "markpatrolled":
- $wgArticle->$action();
- break;
- case "print":
- $wgArticle->view();
- break;
- case "dublincore":
- if( !$wgEnableDublinCoreRdf ) {
- wfHttpError( 403, "Forbidden", wfMsg( "nodublincore" ) );
- } else {
- require_once( "includes/Metadata.php" );
- wfDublinCoreRdf( $wgArticle );
- }
- break;
- case "creativecommons":
- if( !$wgEnableCreativeCommonsRdf ) {
- wfHttpError( 403, "Forbidden", wfMsg("nocreativecommons") );
- } else {
- require_once( "includes/Metadata.php" );
- wfCreativeCommonsRdf( $wgArticle );
- }
- break;
- case "credits":
- require_once( "includes/Credits.php" );
- showCreditsPage( $wgArticle );
- break;
- case "submit":
- if( !$wgCommandLineMode && !$wgRequest->checkSessionCookie() ) {
- # Send a cookie so anons get talk message notifications
- User::SetupSession();
- }
- # Continue...
- case "edit":
- require_once( "includes/EditPage.php" );
- $editor = new EditPage( $wgArticle );
- $editor->submit();
- break;
- case "history":
- if ($_SERVER["REQUEST_URI"] == $wgTitle->getInternalURL('action=history')) {
- $wgOut->setSquidMaxage( $wgSquidMaxage );
- }
- require_once( "includes/PageHistory.php" );
- $history = new PageHistory( $wgArticle );
- $history->history();
- break;
- case "raw":
- require_once( "includes/RawPage.php" );
- $raw = new RawPage( $wgArticle );
- $raw->view();
- break;
- case "purge":
- wfPurgeSquidServers(array($wgTitle->getInternalURL()));
- $wgOut->setSquidMaxage( $wgSquidMaxage );
- $wgTitle->invalidateCache();
- $wgArticle->view();
- break;
- default:
- if (wfRunHooks('UnknownAction', $action, $wgArticle)) {
- $wgOut->errorpage( "nosuchaction", "nosuchactiontext" );
- }
- }
-}
-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" );
+# Setting global variables in mediaWiki
+$mediaWiki->setVal( 'Server', $wgServer );
+$mediaWiki->setVal( 'DisableInternalSearch', $wgDisableInternalSearch );
+$mediaWiki->setVal( 'action', $action );
+$mediaWiki->setVal( 'SquidMaxage', $wgSquidMaxage );
+$mediaWiki->setVal( 'EnableDublinCoreRdf', $wgEnableDublinCoreRdf );
+$mediaWiki->setVal( 'EnableCreativeCommonsRdf', $wgEnableCreativeCommonsRdf );
+$mediaWiki->setVal( 'CommandLineMode', $wgCommandLineMode );
+$mediaWiki->setVal( 'UseExternalEditor', $wgUseExternalEditor );
+$mediaWiki->setVal( 'DisabledActions', $wgDisabledActions );