In LogFormatter:
[lhc/web/wiklou.git] / includes / installer / DatabaseUpdater.php
index 0ad14a3..f2e36ae 100644 (file)
@@ -153,6 +153,8 @@ abstract class DatabaseUpdater {
         * Add a new update coming from an extension. This should be called by
         * extensions while executing the LoadExtensionSchemaUpdates hook.
         *
+        * @since 1.17
+        *
         * @param $update Array: the update to run. Format is the following:
         *                first item is the callback function, it also can be a
         *                simple string with the name of a function in this class,
@@ -167,6 +169,9 @@ abstract class DatabaseUpdater {
        /**
         * Convenience wrapper for addExtensionUpdate() when adding a new table (which
         * is the most common usage of updaters in an extension)
+        *
+        * @since 1.18
+        *
         * @param $tableName String Name of table to create
         * @param $sqlPath String Full path to the schema file
         */
@@ -175,6 +180,8 @@ abstract class DatabaseUpdater {
        }
 
        /**
+        * @since 1.19
+        *
         * @param $tableName string
         * @param $indexName string
         * @param $sqlPath string
@@ -184,6 +191,9 @@ abstract class DatabaseUpdater {
        }
 
        /**
+        *
+        * @since 1.19
+        *
         * @param $tableName string
         * @param $columnName string
         * @param $sqlPath string
@@ -240,6 +250,10 @@ abstract class DatabaseUpdater {
 
                $this->setAppliedUpdates( $wgVersion, $this->updates );
 
+               if ( isset( $what['stats'] ) ) {
+                       $this->checkStats();
+               }
+
                if ( isset( $what['purge'] ) ) {
                        $this->purgeCache();
 
@@ -247,9 +261,6 @@ abstract class DatabaseUpdater {
                                $this->rebuildLocalisationCache();
                        }
                }
-               if ( isset( $what['stats'] ) ) {
-                       $this->checkStats();
-               }
        }
 
        /**
@@ -454,9 +465,9 @@ abstract class DatabaseUpdater {
         */
        protected function addIndex( $table, $index, $patch, $fullpath = false ) {
                if ( $this->db->indexExists( $table, $index, __METHOD__ ) ) {
-                       $this->output( "...$index key already set on $table table.\n" );
+                       $this->output( "...index $index already set on $table table.\n" );
                } else {
-                       $this->output( "Adding $index key to table $table... " );
+                       $this->output( "Adding index $index to table $table... " );
                        $this->applyPatch( $patch, $fullpath );
                        $this->output( "done.\n" );
                }
@@ -490,7 +501,7 @@ abstract class DatabaseUpdater {
         */
        protected function dropIndex( $table, $index, $patch, $fullpath = false ) {
                if ( $this->db->indexExists( $table, $index, __METHOD__ ) ) {
-                       $this->output( "Dropping $index key from table $table... " );
+                       $this->output( "Dropping $index index from table $table... " );
                        $this->applyPatch( $patch, $fullpath );
                        $this->output( "done.\n" );
                } else {
@@ -552,7 +563,7 @@ abstract class DatabaseUpdater {
         * Check the site_stats table is not properly populated.
         */
        protected function checkStats() {
-               $this->output( "Checking site_stats row..." );
+               $this->output( "...site_stats is populated..." );
                $row = $this->db->selectRow( 'site_stats', '*', array( 'ss_row_id' => 1 ), __METHOD__ );
                if ( $row === false ) {
                        $this->output( "data is missing! rebuilding...\n" );
@@ -657,7 +668,6 @@ abstract class DatabaseUpdater {
         */
        protected function doMigrateUserOptions() {
                $cl = $this->maintenance->runChild( 'ConvertUserOptions', 'convertUserOptions.php' );
-               $this->output( "Migrating remaining user_options... " );
                $cl->execute();
                $this->output( "done.\n" );
        }