Back out unreviewed commit 17d23282dd6d8b1bf6b1b80f97cf02265cbec59d
[lhc/web/wiklou.git] / maintenance / update.php
index 16561f5..741ec90 100644 (file)
@@ -25,8 +25,8 @@
  * @ingroup Maintenance
  */
 
-if ( !function_exists( 'version_compare' ) || ( version_compare( phpversion(), '5.2.3' ) < 0 ) ) {
-       echo "You are using PHP version " . phpversion() . " but MediaWiki needs PHP 5.2.3 or higher. ABORTING.\n" .
+if ( !function_exists( 'version_compare' ) || ( version_compare( phpversion(), '5.3.2' ) < 0 ) ) {
+       echo "You are using PHP version " . phpversion() . " but MediaWiki needs PHP 5.3.2 or higher. ABORTING.\n" .
        "Check if you have a newer php executable with a different name, such as php5.\n";
        die( 1 );
 }
@@ -43,7 +43,7 @@ class UpdateMediaWiki extends Maintenance {
                $this->addOption( 'quick', 'Skip 5 second countdown before starting' );
                $this->addOption( 'doshared', 'Also update shared tables' );
                $this->addOption( 'nopurge', 'Do not purge the objectcache table after updates' );
-               $this->addOption( 'force', 'Override when $wgMiserMode disables this script' );
+               $this->addOption( 'force', 'Override when $wgAllowSchemaUpdates disables this script' );
        }
 
        function getDbType() {
@@ -76,9 +76,9 @@ class UpdateMediaWiki extends Maintenance {
        }
 
        function execute() {
-               global $wgVersion, $wgTitle, $wgLang, $wgMiserMode;
+               global $wgVersion, $wgTitle, $wgLang, $wgAllowSchemaUpdates;
 
-               if( $wgMiserMode && !$this->hasOption( 'force' ) ) {
+               if( !$wgAllowSchemaUpdates && !$this->hasOption( 'force' ) ) {
                        $this->error( "Do not run update.php on this wiki. If you're seeing this you should\n"
                                . "probably ask for some help in performing your schema updates.\n\n"
                                . "If you know what you are doing, you can continue with --force", true );
@@ -88,7 +88,7 @@ class UpdateMediaWiki extends Maintenance {
                $wgTitle = Title::newFromText( "MediaWiki database updater" );
 
                $this->output( "MediaWiki {$wgVersion} Updater\n\n" );
-               
+
                wfWaitForSlaves( 5 ); // let's not kill databases, shall we? ;) --tor
 
                if ( !$this->hasOption( 'skip-compat-checks' ) ) {
@@ -121,8 +121,12 @@ class UpdateMediaWiki extends Maintenance {
                $updater->doUpdates( $updates );
 
                foreach( $updater->getPostDatabaseUpdateMaintenance() as $maint ) {
+                       if ( $updater->updateRowExists( $maint ) ) {
+                               continue;
+                       }
                        $child = $this->runChild( $maint );
                        $child->execute();
+                       $updater->insertUpdateRow( $maint );
                }
 
                $this->output( "\nDone.\n" );