Fix r93820: PROT_ -> PROTO_
[lhc/web/wiklou.git] / maintenance / sqlite.php
index ef70d32..dc8a430 100644 (file)
@@ -41,20 +41,19 @@ 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->error( "This maintenance script requires a SQLite database.\n" );
                        return;
                }
 
                $this->db = wfGetDB( DB_MASTER );
 
+               if ( $this->db->getType() != 'sqlite' ) {
+                       $this->error( "This maintenance script requires a SQLite database.\n" );
+                       return;
+               }
+
                if ( $this->hasOption( 'vacuum' ) ) {
                        $this->vacuum();
                }
@@ -124,10 +123,10 @@ class SqliteMaintenance extends Maintenance {
                if ( $result === true ) {
                        $this->output( "SQL syntax check: no errors detected.\n" );
                } else {
-                       $this->error( "Error: $result\n" ); 
+                       $this->error( "Error: $result\n" );
                }
        }
 }
 
 $maintClass = "SqliteMaintenance";
-require_once( DO_MAINTENANCE );
\ No newline at end of file
+require_once( RUN_MAINTENANCE_IF_MAIN );
\ No newline at end of file