From 3a5a5abaa93491e01220c6daa711dd1e1423a19e Mon Sep 17 00:00:00 2001 From: Chad Horohoe Date: Sun, 9 Aug 2009 13:40:43 +0000 Subject: [PATCH] Make DB_STD the normal DB access level. Some scripts need DB_ADMIN, so return that in them. --- maintenance/Maintenance.php | 14 +++++++------- maintenance/addwiki.php | 6 +++++- maintenance/renameDbPrefix.php | 6 +++++- maintenance/renamewiki.php | 4 ++++ 4 files changed, 21 insertions(+), 9 deletions(-) diff --git a/maintenance/Maintenance.php b/maintenance/Maintenance.php index 51ecfab240..f211822322 100644 --- a/maintenance/Maintenance.php +++ b/maintenance/Maintenance.php @@ -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; } /** diff --git a/maintenance/addwiki.php b/maintenance/addwiki.php index 0d44a5b564..46818e6e07 100644 --- a/maintenance/addwiki.php +++ b/maintenance/addwiki.php @@ -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; diff --git a/maintenance/renameDbPrefix.php b/maintenance/renameDbPrefix.php index d1bd1f5647..daf79fcacd 100644 --- a/maintenance/renameDbPrefix.php +++ b/maintenance/renameDbPrefix.php @@ -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' ) { diff --git a/maintenance/renamewiki.php b/maintenance/renamewiki.php index f5722cf179..da8742e683 100644 --- a/maintenance/renamewiki.php +++ b/maintenance/renamewiki.php @@ -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; -- 2.20.1