Tim Starling has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/93907


Change subject: Clean up WikimediaMaintenance class
......................................................................

Clean up WikimediaMaintenance class

The code in WikimediaMaintenance::loadSettings() was superseded by
equivalent code in multiversion/MWScript.php. $wgNoDBParam has been
replaced by the $wikiless list there. WikimediaMaintenance was always
the wrong place for --wiki argument parsing, since the --wiki argument
is meant to work even for core maintenance scripts. The $site and $lang
globals and the wikilang environment variable are no longer read by
anything. The TESTWIKI constant is set by MWVersion.php.

So basically, the only effect of this class was to screw up attempts to
run these maintenance scripts on non-WMF installations.

Change-Id: Icdd0f89b24b860d84e041acba51d7b1931065852
---
M WikimediaMaintenance.php
M addWiki.php
2 files changed, 2 insertions(+), 52 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikimediaMaintenance 
refs/changes/07/93907/1

diff --git a/WikimediaMaintenance.php b/WikimediaMaintenance.php
index 95b5050..a7f91e0 100644
--- a/WikimediaMaintenance.php
+++ b/WikimediaMaintenance.php
@@ -13,52 +13,6 @@
 require_once( "$IP/maintenance/Maintenance.php" );
 
 /**
- * Wikimedia-specific maintenance classes should extend this. This class will
- * override some maintenance setup process to be wmf-specific.
+ * @deprecated
  */
-abstract class WikimediaMaintenance extends Maintenance {
-       /**
-        * Override the core loadSettings.
-        */
-       public function loadSettings() {
-               global $IP, $wgNoDBParam, $wgConf, $site, $lang;
-
-               if ( empty( $wgNoDBParam ) ) {
-                       # Check if we were passed a db name
-                       if ( isset( $this->mOptions['wiki'] ) ) {
-                               $db = $this->mOptions['wiki'];
-                       } else {
-                               $db = array_shift( $this->mArgs );
-                       }
-                       list( $site, $lang ) = $wgConf->siteFromDB( $db );
-
-                       # If not, work out the language and site the old way
-                       if ( is_null( $site ) || is_null( $lang ) ) {
-                               if ( !$db ) {
-                                       $lang = 'aa';
-                               } else {
-                                       $lang = $db;
-                               }
-                               if ( isset( $this->mArgs[0] ) ) {
-                                       $site = array_shift( $this->mArgs );
-                               } else {
-                                       $site = 'wikipedia';
-                               }
-                       }
-               } else {
-                       $lang = 'aa';
-                       $site = 'wikipedia';
-               }
-
-               putenv( 'wikilang=' . $lang );
-
-               ini_set( 'include_path', 
".:$IP:$IP/includes:$IP/languages:$IP/maintenance" );
-
-               if ( $lang == 'test' && $site == 'wikipedia' ) {
-                       if ( !defined( 'TESTWIKI' ) ) {
-                               define( 'TESTWIKI', 1 );
-                       }
-               }
-               return MWInit::interpretedPath( 
'../wmf-config/CommonSettings.php' );
-       }
-}
+abstract class WikimediaMaintenance extends Maintenance {}
diff --git a/addWiki.php b/addWiki.php
index a1cb6d8..104bf67 100644
--- a/addWiki.php
+++ b/addWiki.php
@@ -30,16 +30,12 @@
 
 class AddWiki extends WikimediaMaintenance {
        public function __construct() {
-               global $wgNoDBParam;
-
                parent::__construct();
                $this->mDescription = "Add a new wiki to the family. Wikimedia 
specific!";
                $this->addArg( 'language', 'Language code of new site, e.g. en' 
);
                $this->addArg( 'site', 'Type of site, e.g. wikipedia' );
                $this->addArg( 'dbname', 'Name of database to create, e.g. 
enwiki' );
                $this->addArg( 'domain', 'Domain name of the wiki, e.g. 
en.wikipedia.org' );
-
-               $wgNoDBParam = true;
        }
 
        public function getDbType() {

-- 
To view, visit https://gerrit.wikimedia.org/r/93907
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icdd0f89b24b860d84e041acba51d7b1931065852
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikimediaMaintenance
Gerrit-Branch: master
Gerrit-Owner: Tim Starling <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to