Make DB_STD the normal DB access level. Some scripts need DB_ADMIN, so return that...
authorChad Horohoe <demon@users.mediawiki.org>
Sun, 9 Aug 2009 13:40:43 +0000 (13:40 +0000)
committerChad Horohoe <demon@users.mediawiki.org>
Sun, 9 Aug 2009 13:40:43 +0000 (13:40 +0000)
maintenance/Maintenance.php
maintenance/addwiki.php
maintenance/renameDbPrefix.php
maintenance/renamewiki.php

index 51ecfab..f211822 100644 (file)
@@ -224,17 +224,17 @@ abstract class Maintenance {
        }
 
        /**
-        * Does the script need normal DB access? By default, we give Maintenance
-        * scripts admin rights to the DB (when available). Sometimes, a script needs
-        * normal access for a reason and sometimes they want no access. Subclasses 
-        * should override and return one of the following values, as needed:
+        * Does the script need different DB access? By default, we give Maintenance
+        * scripts normal rights to the DB. Sometimes, a script needs admin rights
+        * access for a reason and sometimes they want no access. Subclasses should 
+        * override and return one of the following values, as needed:
         *    Maintenance::DB_NONE  -  For no DB access at all
-        *    Maintenance::DB_STD   -  For normal DB access
-        *    Maintenance::DB_ADMIN -  For admin DB access, default
+        *    Maintenance::DB_STD   -  For normal DB access, default
+        *    Maintenance::DB_ADMIN -  For admin DB access
         * @return int
         */
        protected function getDbType() {
-               return Maintenance :: DB_ADMIN;
+               return Maintenance::DB_STD;
        }
 
        /**
index 0d44a5b..46818e6 100644 (file)
@@ -31,7 +31,11 @@ class AddWiki extends Maintenance {
                $this->mDescription = "Add a new wiki to the family. Wikimedia specific!";
                $this->addArgs( 'language', 'site', 'dbname' );
        }
-       
+
+       protected function getDbType() {
+               return Maintenance::DB_ADMIN;
+       }
+
        public function execute() {
                global $IP, $wgLanguageNames, $wgDefaultExternalStore, $wgNoDBParam;
 
index d1bd1f5..daf79fc 100644 (file)
@@ -29,7 +29,11 @@ class RenameDbPrefix extends Maintenance {
                $this->addOption( "old", "Old db prefix [0 for none]", true, true );
                $this->addOption( "new", "New db prefix [0 for none]", true, true );
        }
-       
+
+       protected function getDbType() {
+               return Maintenance::DB_ADMIN;
+       }
+
        public function execute() {
                // Allow for no old prefix
                if( $this->getOption( 'old', 0 ) === '0' ) {
index f5722cf..da8742e 100644 (file)
@@ -30,6 +30,10 @@ class RenameWiki extends Maintenance {
                $this->mDescription = "Rename external storage dbs and leave a new one";
                $this->addArgs( array( 'olddb', 'newdb' ) );
        }
+       
+       protected function getDbType() {
+               return Maintenance::DB_ADMIN;
+       }
 
        public function execute() {
                global $wgDefaultExternalStore;