* (bug 20699) API watchlist should list log-events
[lhc/web/wiklou.git] / maintenance / sqlite.php
index 6a28328..4cd225d 100644 (file)
@@ -41,20 +41,18 @@ class SqliteMaintenance extends Maintenance {
        }
 
        public function execute() {
-               global $wgDBtype;
-
                // Should work even if we use a non-SQLite database
                if ( $this->hasOption( 'check-syntax' ) ) {
                        $this->checkSyntax();
                }
 
-               if ( $wgDBtype != 'sqlite' ) {
+               $this->db = wfGetDB( DB_MASTER );
+
+               if ( $this->db->getType() != 'sqlite' ) {
                        $this->error( "This maintenance script requires a SQLite database.\n" );
                        return;
                }
 
-               $this->db = wfGetDB( DB_MASTER );
-
                if ( $this->hasOption( 'vacuum' ) ) {
                        $this->vacuum();
                }
@@ -130,4 +128,4 @@ class SqliteMaintenance extends Maintenance {
 }
 
 $maintClass = "SqliteMaintenance";
-require_once( DO_MAINTENANCE );
\ No newline at end of file
+require_once( RUN_MAINTENANCE_IF_MAIN );
\ No newline at end of file