X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=maintenance%2Fsqlite.inc;h=33ca0ffc71b87867dab35a31b3060f1df92bf583;hb=6e9b4f0e9ce4ccd6089c18b205065ef7fa077484;hp=43b259806cc316a1e05bb8f66e5dae61f9ad0fb8;hpb=ec9002258c8a0264cb2d92df6a216e9fa11d3462;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/sqlite.inc b/maintenance/sqlite.inc index 43b259806c..33ca0ffc71 100644 --- a/maintenance/sqlite.inc +++ b/maintenance/sqlite.inc @@ -42,24 +42,24 @@ class Sqlite { * Will throw exceptions on SQL errors * @param array|string $files * @throws MWException - * @return True if no error or error string in case of errors + * @return bool True if no error or error string in case of errors */ public static function checkSqlSyntax( $files ) { if ( !Sqlite::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 = new DatabaseSqliteStandalone( ':memory:' ); + $db = DatabaseSqlite::newStandaloneInstance( ':memory:' ); try { foreach ( $files as $file ) { $err = $db->sourceFile( $file );