r54653 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r54652‎ | r54653 | r54654 >
Date:12:26, 9 August 2009
Author:demon
Status:ok (Comments)
Tags:
Comment:
Move $wgUseNormalUser setting to constructors.
Modified paths:
  • /trunk/phase3/maintenance/eval.php (modified) (history)
  • /trunk/phase3/maintenance/http_session_download.php (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/http_session_download.php
@@ -27,19 +27,18 @@
2828
2929 class HttpSessionDownload extends Maintenance {
3030 public function __construct() {
 31+ global $wgUseNormalUser;
3132 parent::__construct();
3233 $this->mDescription = "Simple entry point to initiate a background download";
3334 $this->addOption( 'sid', 'Session ID', true, true );
3435 $this->addOption( 'usk', 'Upload session key', true, true );
 36+ $wgUseNormalUser = true;
3537 }
3638
3739 public function execute() {
38 - global $wgUseNormalUser;
 40+
3941 wfProfileIn(__METHOD__);
4042
41 - // act like a "normal user"
42 - $wgUseNormalUser = true;
43 -
4443 //run the download:
4544 Http::doSessionIdDownload( $this->getOption('sid'), $this->getOption('usk') );
4645
Index: trunk/phase3/maintenance/eval.php
@@ -35,15 +35,16 @@
3636 class EvalPrompt extends Maintenance {
3737
3838 public function __construct() {
 39+ global $wgUseNormalUser;
3940 parent::__construct();
4041 $this->mDescription = "This script lets a command-line user start up the wiki engine and then poke\n" .
4142 "about by issuing PHP commands directly.";
4243 $this->addOption( 'd', "Enable MediaWiki debug output", false, true );
 44+ $wgUseNormalUser = (bool)getenv('MW_WIKIUSER');
4345 }
4446
4547 public function execute() {
46 - global $wgUseNormalUser, $wgDebugFunctionEntry, $wgDebugLogFile;
47 - $wgUseNormalUser = (bool)getenv('MW_WIKIUSER');
 48+ global $wgDebugFunctionEntry, $wgDebugLogFile;
4849 if ( $this->hasOption('d') ) {
4950 $d = $this->getOption('d');
5051 if ( $d > 0 ) {

Follow-up revisions

RevisionCommit summaryAuthorDate
r54839Revert eval.php changes from r54653, r54312, r54225 (maintenance-work branch ...tstarling03:44, 12 August 2009

Comments

#Comment by Brion VIBBER (talk | contribs)   20:31, 10 August 2009

I'd recommend cycling this var out if possible... it looks like it's likely obsoleted by other changes?

#Comment by 😂 (talk | contribs)   20:57, 10 August 2009

It's on its way out. Just need to do some more cleanup in/around Maintenance::getDbType() first.

Status & tagging log