$ret = true;
ob_start( array( $this, 'outputHandler' ) );
+ $up = DatabaseUpdater::newForDB( $this->db );
try {
- $up = DatabaseUpdater::newForDB( $this->db );
$up->doUpdates();
} catch ( MWException $e ) {
echo "\nAn error occurred:\n";
echo $e->getText();
$ret = false;
}
+ $up->purgeCache();
ob_end_flush();
return $ret;
}
*
* @param $what Array: what updates to perform
*/
- public function doUpdates( $what = array( 'core', 'extensions', 'purge', 'stats' ) ) {
- global $wgLocalisationCacheConf, $wgVersion;
+ public function doUpdates( $what = array( 'core', 'extensions', 'stats' ) ) {
+ global $wgVersion;
$this->db->begin( __METHOD__ );
$what = array_flip( $what );
if ( isset( $what['stats'] ) ) {
$this->checkStats();
}
-
- if ( isset( $what['purge'] ) ) {
- $this->purgeCache();
-
- if ( $wgLocalisationCacheConf['manualRecache'] ) {
- $this->rebuildLocalisationCache();
- }
- }
$this->db->commit( __METHOD__ );
}
/**
* Purge the objectcache table
*/
- protected function purgeCache() {
+ public function purgeCache() {
+ global $wgLocalisationCacheConf;
# We can't guarantee that the user will be able to use TRUNCATE,
# but we know that DELETE is available to us
$this->output( "Purging caches..." );
$this->db->delete( 'objectcache', '*', __METHOD__ );
+ if ( $wgLocalisationCacheConf['manualRecache'] ) {
+ $this->rebuildLocalisationCache();
+ }
$this->output( "done.\n" );
}
$shared = $this->hasOption( 'doshared' );
$updates = array( 'core', 'extensions', 'stats' );
- if( !$this->hasOption('nopurge') ) {
- $updates[] = 'purge';
- }
$updater = DatabaseUpdater::newForDb( $db, $shared, $this );
$updater->doUpdates( $updates );
}
}
+ if( !$this->hasOption('nopurge') ) {
+ $updater->purgeCache();
+ }
+
$this->output( "\nDone.\n" );
}