Cleanup some docs (maintenance)
[lhc/web/wiklou.git] / maintenance / sqlite.inc
index 49f4e00..43b2598 100644 (file)
@@ -33,19 +33,16 @@ class Sqlite {
         * @return bool
         */
        public static function isPresent() {
-               wfSuppressWarnings();
-               $compiled = wfDl( 'pdo_sqlite' );
-               wfRestoreWarnings();
-               return $compiled;
+               return extension_loaded( 'pdo_sqlite' );
        }
 
        /**
         * Checks given files for correctness of SQL syntax. MySQL DDL will be converted to
         * SQLite-compatible during processing.
         * Will throw exceptions on SQL errors
-        * @param $files
+        * @param array|string $files
         * @throws MWException
-        * @return mixed true if no error or error string in case of errors
+        * @return True if no error or error string in case of errors
         */
        public static function checkSqlSyntax( $files ) {
                if ( !Sqlite::isPresent() ) {
@@ -81,6 +78,7 @@ class Sqlite {
                                foreach ( $columns as $col ) {
                                        if ( !isset( $allowedTypes[strtolower( $col->type )] ) ) {
                                                $db->close();
+
                                                return "Table {$table->name} has column {$col->name} with non-native type '{$col->type}'";
                                        }
                                }
@@ -89,6 +87,7 @@ class Sqlite {
                        return $e->getMessage();
                }
                $db->close();
+
                return true;
        }
-};
+}