}
private function vacuum() {
- $prevSize = filesize( $this->db->mDatabaseFile );
+ $prevSize = filesize( $this->db->getDbFilePath() );
if ( $prevSize == 0 ) {
$this->error( "Can't vacuum an empty database.\n", true );
}
$this->output( 'VACUUM: ' );
if ( $this->db->query( 'VACUUM' ) ) {
clearstatcache();
- $newSize = filesize( $this->db->mDatabaseFile );
+ $newSize = filesize( $this->db->getDbFilePath() );
$this->output( sprintf( "Database size was %d, now %d (%.1f%% reduction).\n",
$prevSize, $newSize, ( $prevSize - $newSize ) * 100.0 / $prevSize ) );
} else {
private function backup( $fileName ) {
$this->output( "Backing up database:\n Locking..." );
$this->db->query( 'BEGIN IMMEDIATE TRANSACTION', __METHOD__ );
- $ourFile = $this->db->mDatabaseFile;
+ $ourFile = $this->db->getDbFilePath();
$this->output( " Copying database file $ourFile to $fileName... " );
- wfSuppressWarnings( false );
+ MediaWiki\suppressWarnings( false );
if ( !copy( $ourFile, $fileName ) ) {
$err = error_get_last();
$this->error( " {$err['message']}" );
}
- wfSuppressWarnings( true );
+ MediaWiki\suppressWarnings( true );
$this->output( " Releasing lock...\n" );
$this->db->query( 'COMMIT TRANSACTION', __METHOD__ );
}