r69619 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r69618‎ | r69619 | r69620 >
Date:15:04, 20 July 2010
Author:catrope
Status:deferred
Tags:
Comment:
1.16wmf4: Merge addwiki.php tweaks from trunk: r69546, r69553, r69554, r69608, r69613
Modified paths:
  • /branches/wmf/1.16wmf4/maintenance/addwiki.php (modified) (history)

Diff [purge]

Index: branches/wmf/1.16wmf4/maintenance/addwiki.php
@@ -33,9 +33,10 @@
3434 public function __construct() {
3535 parent::__construct();
3636 $this->mDescription = "Add a new wiki to the family. Wikimedia specific!";
37 - $this->addArg( 'language', 'Language code of new site' );
38 - $this->addArg( 'site', 'Type of site' );
39 - $this->addArg( 'dbname', 'Name of database to create' );
 37+ $this->addArg( 'language', 'Language code of new site, e.g. en' );
 38+ $this->addArg( 'site', 'Type of site, e.g. wikipedia' );
 39+ $this->addArg( 'dbname', 'Name of database to create, e.g. enwiki' );
 40+ $this->addArg( 'domain', 'Domain name of the wiki, e.g. en.wikipedia.org' );
4041 }
4142
4243 public function getDbType() {
@@ -43,12 +44,13 @@
4445 }
4546
4647 public function execute() {
47 - global $IP, $wgDefaultExternalStore, $wgNoDBParam;
 48+ global $IP, $wgDefaultExternalStore, $wgNoDBParam, $wgPasswordSender;
4849
4950 $wgNoDBParam = true;
5051 $lang = $this->getArg(0);
5152 $site = $this->getArg(1);
5253 $dbName = $this->getArg(2);
 54+ $domain = $this->getArg( 3 );
5355 $languageNames = Language::getLanguageNames();
5456
5557 if ( !isset( $languageNames[$lang] ) ) {
@@ -81,6 +83,7 @@
8284 $dbw->sourceFile( "$IP/extensions/UsabilityInitiative/ClickTracking/ClickTrackingEvents.sql" );
8385 $dbw->sourceFile( "$IP/extensions/UsabilityInitiative/ClickTracking/ClickTracking.sql" );
8486 $dbw->sourceFile( "$IP/extensions/UsabilityInitiative/UserDailyContribs/UserDailyContribs.sql" );
 87+ $dbw->sourceFile( "$IP/extensions/UsabilityInitiative/OptIn/OptIn.sql" );
8588
8689 $dbw->query( "INSERT INTO site_stats(ss_row_id) VALUES (1)" );
8790
@@ -144,7 +147,17 @@
145148 #print "Constructing interwiki SQL\n";
146149 # Rebuild interwiki tables
147150 #passthru( '/home/wikipedia/conf/interwiki/update' );
148 -
 151+
 152+ $time = wfTimestamp( TS_RFC2822 );
 153+ // These arguments need to be escaped twice: once for echo and once for at
 154+ $escDbName = wfEscapeShellArg( wfEscapeShellArg( $dbName ) );
 155+ $escTime = wfEscapeShellArg( wfEscapeShellArg( $time ) );
 156+ $escUcsite = wfEscapeShellArg( wfEscapeShellArg( $ucsite ) );
 157+ $escName = wfEscapeShellArg( wfEscapeShellArg( $name ) );
 158+ $escLang = wfEscapeShellArg( wfEscapeShellArg( $lang ) );
 159+ $escDomain = wfEscapeShellArg( wfEscapeShellArg( $domain ) );
 160+ shell_exec( "echo notifyNewProjects $escDbName $escTime $escUcsite $escName $escLang $escDomain | at now + 15 minutes" );
 161+
149162 $this->output( "Script ended. You still have to:
150163 * Add any required settings in InitialiseSettings.php
151164 * Run sync-common-all
Property changes on: branches/wmf/1.16wmf4/maintenance/addwiki.php
___________________________________________________________________
Added: svn:mergeinfo
152165 Merged /branches/wmf-deployment/maintenance/addwiki.php:r60970
153166 Merged /trunk/phase3/maintenance/addwiki.php:r63545-63546,63549,63643,63764,63897-63901,63935,64113,64509,65387,65391,65555,65590,65650,65816,69546-69618

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r69546(bug 24398) Make addwiki.php send a notification e-mail to newprojects@lists....catrope14:00, 19 July 2010
r69553Followup to r69546: defer sending of notification by 15 minutescatrope15:13, 19 July 2010
r69554Fix typocatrope15:15, 19 July 2010
r69608Followup to r69553: double-escape arguments because we're feeding them to a s...catrope13:11, 20 July 2010
r69613Fix typocatrope14:06, 20 July 2010

Status & tagging log