X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2Fsqlite.php;h=bfd4d971cbcff53c569cd3b0ce482213a8941954;hb=3b9e6bec3e8d3a8efbed9806cc9de685c14e48ab;hp=5cc35edc559a83d37ad4692b2b24eb5aa132c853;hpb=1f2706b49939bfc85ec5abc8ccc24aacd938eed0;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/sqlite.php b/maintenance/sqlite.php index 5cc35edc55..bfd4d971cb 100644 --- a/maintenance/sqlite.php +++ b/maintenance/sqlite.php @@ -83,7 +83,7 @@ class SqliteMaintenance extends Maintenance { private function vacuum() { $prevSize = filesize( $this->db->getDbFilePath() ); if ( $prevSize == 0 ) { - $this->error( "Can't vacuum an empty database.\n", true ); + $this->fatalError( "Can't vacuum an empty database.\n" ); } $this->output( 'VACUUM: ' ); @@ -117,22 +117,22 @@ class SqliteMaintenance extends Maintenance { $this->db->query( 'BEGIN IMMEDIATE TRANSACTION', __METHOD__ ); $ourFile = $this->db->getDbFilePath(); $this->output( " Copying database file $ourFile to $fileName... " ); - MediaWiki\suppressWarnings( false ); + Wikimedia\suppressWarnings(); if ( !copy( $ourFile, $fileName ) ) { $err = error_get_last(); $this->error( " {$err['message']}" ); } - MediaWiki\suppressWarnings( true ); + Wikimedia\restoreWarnings(); $this->output( " Releasing lock...\n" ); $this->db->query( 'COMMIT TRANSACTION', __METHOD__ ); } private function checkSyntax() { - if ( !Sqlite::IsPresent() ) { + if ( !Sqlite::isPresent() ) { $this->error( "Error: SQLite support not found\n" ); } - $files = array( $this->getOption( 'check-syntax' ) ); - $files += $this->mArgs; + $files = [ $this->getOption( 'check-syntax' ) ]; + $files = array_merge( $files, $this->mArgs ); $result = Sqlite::checkSqlSyntax( $files ); if ( $result === true ) { $this->output( "SQL syntax check: no errors detected.\n" ); @@ -142,5 +142,5 @@ class SqliteMaintenance extends Maintenance { } } -$maintClass = "SqliteMaintenance"; +$maintClass = SqliteMaintenance::class; require_once RUN_MAINTENANCE_IF_MAIN;