}
define( "MEDIAWIKI", true );
+require_once( "./includes/Defines.php" );
require_once( "./LocalSettings.php" );
require_once( "includes/Setup.php" );
$wgArticle = new Article( $wgTitle );
}
- wfQuery("BEGIN", DB_WRITE);
switch( $action ) {
case "view":
$wgOut->setSquidMaxage( $wgSquidMaxage );
case "rollback":
case "protect":
case "unprotect":
+ case "validate":
+ case "info":
$wgArticle->$action();
break;
case "print":
wfCreativeCommonsRdf( $wgArticle );
}
break;
+ case "credits":
+ require_once( "includes/Credits.php" );
+ showCreditsPage( $wgArticle );
+ break;
case "edit":
case "submit":
if( !$wgCommandLineMode && !$wgRequest->checkSessionCookie() ) {
default:
$wgOut->errorpage( "nosuchaction", "nosuchactiontext" );
}
- wfQuery("COMMIT", DB_WRITE);
}
+# 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.
+foreach ( $wgDeferredUpdateList as $up ) {
+ $up->doUpdate();
+}
+
+$wgLoadBalancer->saveMasterPos();
+
+# Now commit any transactions, so that unreported errors after output() don't roll back the whole thing
+$wgLoadBalancer->commitAll();
+
$wgOut->output();
-foreach ( $wgDeferredUpdateList as $up ) { $up->doUpdate(); }
logProfilingData();
+$wgLoadBalancer->closeAll();
wfDebug( "Request ended normally\n" );
?>