X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Finstaller%2FDatabaseUpdater.php;h=a5540dbb11cf1e1f18f4ce93b94acd56871eca8c;hb=dbca12bf93320af9df2972b607798f18c96dcb62;hp=dac43371a53dc4e31c892f298cb796dd80e77a6b;hpb=a9d435fb43f71695b1b4619281c21072d56433d0;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/installer/DatabaseUpdater.php b/includes/installer/DatabaseUpdater.php index dac43371a5..a5540dbb11 100644 --- a/includes/installer/DatabaseUpdater.php +++ b/includes/installer/DatabaseUpdater.php @@ -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 */