r54657 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r54656‎ | r54657 | r54658 >
Date:13:40, 9 August 2009
Author:demon
Status:ok
Tags:
Comment:
Make DB_STD the normal DB access level. Some scripts need DB_ADMIN, so return that in them.
Modified paths:
  • /trunk/phase3/maintenance/Maintenance.php (modified) (history)
  • /trunk/phase3/maintenance/addwiki.php (modified) (history)
  • /trunk/phase3/maintenance/renameDbPrefix.php (modified) (history)
  • /trunk/phase3/maintenance/renamewiki.php (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/renameDbPrefix.php
@@ -29,7 +29,11 @@
3030 $this->addOption( "old", "Old db prefix [0 for none]", true, true );
3131 $this->addOption( "new", "New db prefix [0 for none]", true, true );
3232 }
33 -
 33+
 34+ protected function getDbType() {
 35+ return Maintenance::DB_ADMIN;
 36+ }
 37+
3438 public function execute() {
3539 // Allow for no old prefix
3640 if( $this->getOption( 'old', 0 ) === '0' ) {
Index: trunk/phase3/maintenance/renamewiki.php
@@ -30,6 +30,10 @@
3131 $this->mDescription = "Rename external storage dbs and leave a new one";
3232 $this->addArgs( array( 'olddb', 'newdb' ) );
3333 }
 34+
 35+ protected function getDbType() {
 36+ return Maintenance::DB_ADMIN;
 37+ }
3438
3539 public function execute() {
3640 global $wgDefaultExternalStore;
Index: trunk/phase3/maintenance/addwiki.php
@@ -31,7 +31,11 @@
3232 $this->mDescription = "Add a new wiki to the family. Wikimedia specific!";
3333 $this->addArgs( 'language', 'site', 'dbname' );
3434 }
35 -
 35+
 36+ protected function getDbType() {
 37+ return Maintenance::DB_ADMIN;
 38+ }
 39+
3640 public function execute() {
3741 global $IP, $wgLanguageNames, $wgDefaultExternalStore, $wgNoDBParam;
3842
Index: trunk/phase3/maintenance/Maintenance.php
@@ -224,17 +224,17 @@
225225 }
226226
227227 /**
228 - * Does the script need normal DB access? By default, we give Maintenance
229 - * scripts admin rights to the DB (when available). Sometimes, a script needs
230 - * normal access for a reason and sometimes they want no access. Subclasses
231 - * should override and return one of the following values, as needed:
 228+ * Does the script need different DB access? By default, we give Maintenance
 229+ * scripts normal rights to the DB. Sometimes, a script needs admin rights
 230+ * access for a reason and sometimes they want no access. Subclasses should
 231+ * override and return one of the following values, as needed:
232232 * Maintenance::DB_NONE - For no DB access at all
233 - * Maintenance::DB_STD - For normal DB access
234 - * Maintenance::DB_ADMIN - For admin DB access, default
 233+ * Maintenance::DB_STD - For normal DB access, default
 234+ * Maintenance::DB_ADMIN - For admin DB access
235235 * @return int
236236 */
237237 protected function getDbType() {
238 - return Maintenance :: DB_ADMIN;
 238+ return Maintenance::DB_STD;
239239 }
240240
241241 /**

Status & tagging log