X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2Fsqlite.inc;h=f14856a5b21bafd904e3ea9d700baca11d90b1ba;hb=62ea31ad97e8885fa33b282cc0c82bdd1ccb66cc;hp=e17319087b435d997375bbd15bf298b9cff9f587;hpb=b8f78c331c07efacaedb3d054771e2428280f2ea;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/sqlite.inc b/maintenance/sqlite.inc index e17319087b..f14856a5b2 100644 --- a/maintenance/sqlite.inc +++ b/maintenance/sqlite.inc @@ -21,6 +21,9 @@ * @ingroup Maintenance */ +use Wikimedia\Rdbms\DatabaseSqlite; +use Wikimedia\Rdbms\DBError; + /** * This class contains code common to different SQLite-related maintenance scripts * @@ -45,19 +48,19 @@ class Sqlite { * @return bool True if no error or error string in case of errors */ public static function checkSqlSyntax( $files ) { - if ( !Sqlite::isPresent() ) { + if ( !self::isPresent() ) { throw new MWException( "Can't check SQL syntax: SQLite not found" ); } if ( !is_array( $files ) ) { - $files = array( $files ); + $files = [ $files ]; } - $allowedTypes = array_flip( array( + $allowedTypes = array_flip( [ 'integer', 'real', 'text', 'blob', // NULL type is omitted intentionally - ) ); + ] ); $db = DatabaseSqlite::newStandaloneInstance( ':memory:' ); try {