Add section header for r105954/r105963
[lhc/web/wiklou.git] / maintenance / sqlite.php
index 6a28328..864d5ab 100644 (file)
@@ -35,26 +35,27 @@ class SqliteMaintenance extends Maintenance {
        /**
         * While we use database connection, this simple lie prevents useless --dbpass and
         * --dbuser options from appearing in help message for this script.
+        *
+        * @return int DB constant
         */
        public function getDbType() {
                return Maintenance::DB_NONE;
        }
 
        public function execute() {
-               global $wgDBtype;
-
                // Should work even if we use a non-SQLite database
                if ( $this->hasOption( 'check-syntax' ) ) {
                        $this->checkSyntax();
+                       return;
                }
 
-               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 +131,4 @@ class SqliteMaintenance extends Maintenance {
 }
 
 $maintClass = "SqliteMaintenance";
-require_once( DO_MAINTENANCE );
\ No newline at end of file
+require_once( RUN_MAINTENANCE_IF_MAIN );