Remove MW_SPECIALPAGE_VERSION. Unused anywhere.
[lhc/web/wiklou.git] / maintenance / update.php
index 8ab1ddb..0fd1fd8 100755 (executable)
@@ -56,6 +56,10 @@ class UpdateMediaWiki extends Maintenance {
                        true
                );
                $this->addOption( 'force', 'Override when $wgAllowSchemaUpdates disables this script' );
+               $this->addOption(
+                       'skip-external-dependencies',
+                       'Skips checking whether external dependencies are up to date, mostly for developers'
+               );
        }
 
        function getDbType() {
@@ -132,8 +136,14 @@ class UpdateMediaWiki extends Maintenance {
                }
 
                // Check external dependencies are up to date
-               $composerLockUpToDate = $this->runChild( 'CheckComposerLockUpToDate' );
-               $composerLockUpToDate->execute();
+               if ( !$this->hasOption( 'skip-external-dependencies' ) ) {
+                       $composerLockUpToDate = $this->runChild( 'CheckComposerLockUpToDate' );
+                       $composerLockUpToDate->execute();
+               } else {
+                       $this->output(
+                               "Skipping checking whether external dependencies are up to date, proceed at your own risk\n"
+                       );
+               }
 
                # Attempt to connect to the database as a privileged user
                # This will vomit up an error if there are permissions problems
@@ -141,7 +151,7 @@ class UpdateMediaWiki extends Maintenance {
 
                $this->output( "Going to run database updates for " . wfWikiID() . "\n" );
                if ( $db->getType() === 'sqlite' ) {
-                       $this->output( "Using SQLite file: '{$db->mDatabaseFile}'\n" );
+                       $this->output( "Using SQLite file: '{$db->getDbFilePath()}'\n" );
                }
                $this->output( "Depending on the size of your database this may take a while!\n" );
 
@@ -151,7 +161,7 @@ class UpdateMediaWiki extends Maintenance {
                        wfCountDown( 5 );
                }
 
-               $time1 = new MWTimestamp();
+               $time1 = microtime( true );
 
                $shared = $this->hasOption( 'doshared' );
 
@@ -187,9 +197,10 @@ class UpdateMediaWiki extends Maintenance {
                        $updater->purgeCache();
                }
 
-               $time2 = new MWTimestamp();
-               $timeDiff = $time2->diff( $time1 );
-               $this->output( "\nDone in " . $timeDiff->format( "%i:%S" ) . ".\n" );
+               $time2 = microtime( true );
+
+               $timeDiff = $wgLang->formatTimePeriod( $time2 - $time1 );
+               $this->output( "\nDone in $timeDiff.\n" );
        }
 
        function afterFinalSetup() {