r62067 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r62066‎ | r62067 | r62068 >
Date:14:29, 6 February 2010
Author:ialex
Status:ok
Tags:
Comment:
Use $wgUseNormalUser only in commandLine.inc (and use getDbType() instead in Maintenance)
Modified paths:
  • /trunk/phase3/maintenance/Maintenance.php (modified) (history)
  • /trunk/phase3/maintenance/commandLine.inc (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/commandLine.inc
@@ -18,6 +18,13 @@
1919 }
2020 }
2121
 22+ protected function getDbType() {
 23+ global $wgUseNormalUser;
 24+
 25+ return ( isset( $wgUseNormalUser ) && $wgUseNormalUser ) ?
 26+ Maintenance::DB_STD : Maintenance::DB_ADMIN;
 27+ }
 28+
2229 /**
2330 * No help, it would just be misleading since it misses custom options
2431 */
Index: trunk/phase3/maintenance/Maintenance.php
@@ -356,7 +356,7 @@
357357 * Do some sanity checking and basic setup
358358 */
359359 public function setup() {
360 - global $IP, $wgCommandLineMode, $wgUseNormalUser, $wgRequestTime;
 360+ global $IP, $wgCommandLineMode, $wgRequestTime;
361361
362362 # Abort if called from a web server
363363 if ( isset( $_SERVER ) && array_key_exists( 'REQUEST_METHOD', $_SERVER ) ) {
@@ -406,10 +406,6 @@
407407 # Turn off output buffering if it's on
408408 @ob_end_flush();
409409
410 - if ( !isset( $wgUseNormalUser ) ) {
411 - $wgUseNormalUser = false;
412 - }
413 -
414410 $this->loadParamsAndArgs();
415411 $this->maybeHelp();
416412 $this->validateParamsAndArgs();
@@ -603,7 +599,7 @@
604600 * Handle some last-minute setup here.
605601 */
606602 public function finalSetup() {
607 - global $wgCommandLineMode, $wgUseNormalUser, $wgShowSQLErrors;
 603+ global $wgCommandLineMode, $wgShowSQLErrors;
608604 global $wgTitle, $wgProfiling, $IP, $wgDBadminuser, $wgDBadminpassword;
609605 global $wgDBuser, $wgDBpassword, $wgDBservers, $wgLBFactoryConf;
610606
@@ -620,7 +616,7 @@
621617 if( $this->mDbPass )
622618 $wgDBadminpassword = $this->mDbPass;
623619
624 - if ( empty( $wgUseNormalUser ) && isset( $wgDBadminuser ) ) {
 620+ if ( $this->getDbType() == self::DB_ADMIN && isset( $wgDBadminuser ) ) {
625621 $wgDBuser = $wgDBadminuser;
626622 $wgDBpassword = $wgDBadminpassword;
627623

Follow-up revisions

RevisionCommit summaryAuthorDate
r62216Followup r62067, drop $wgUseNormalUser as un-neededdemon01:43, 10 February 2010

Status & tagging log