Stop using $wgProfileToDatabase
[lhc/web/wiklou.git] / includes / installer / DatabaseUpdater.php
index dac4337..a5540db 100644 (file)
@@ -1058,6 +1058,31 @@ abstract class DatabaseUpdater {
                }
        }
 
+       /**
+        * Enable profiling table when it's turned on
+        */
+       protected function doEnableProfiling() {
+               global $wgProfiler;
+
+               if ( !$this->doTable( 'profiling' ) ) {
+                       return true;
+               }
+
+               $profileToDb = false;
+               if ( isset( $wgProfiler['output'] ) ) {
+                       $out = $wgProfiler['output'];
+                       if ( $out === 'db' ) {
+                               $profileToDb = true;
+                       } elseif( is_array( $out ) && in_array( 'db', $out ) ) {
+                               $profileToDb = true;
+                       }
+               }
+
+               if ( $profileToDb && !$this->db->tableExists( 'profiling', __METHOD__ ) ) {
+                       $this->applyPatch( 'patch-profiling.sql', false, 'Add profiling table' );
+               }
+       }
+
        /**
         * Rebuilds the localisation cache
         */