Index: branches/wmf/1.16wmf4/maintenance/addwiki.php |
— | — | @@ -33,9 +33,10 @@ |
34 | 34 | public function __construct() { |
35 | 35 | parent::__construct(); |
36 | 36 | $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' ); |
40 | 41 | } |
41 | 42 | |
42 | 43 | public function getDbType() { |
— | — | @@ -43,12 +44,13 @@ |
44 | 45 | } |
45 | 46 | |
46 | 47 | public function execute() { |
47 | | - global $IP, $wgDefaultExternalStore, $wgNoDBParam; |
| 48 | + global $IP, $wgDefaultExternalStore, $wgNoDBParam, $wgPasswordSender; |
48 | 49 | |
49 | 50 | $wgNoDBParam = true; |
50 | 51 | $lang = $this->getArg(0); |
51 | 52 | $site = $this->getArg(1); |
52 | 53 | $dbName = $this->getArg(2); |
| 54 | + $domain = $this->getArg( 3 ); |
53 | 55 | $languageNames = Language::getLanguageNames(); |
54 | 56 | |
55 | 57 | if ( !isset( $languageNames[$lang] ) ) { |
— | — | @@ -81,6 +83,7 @@ |
82 | 84 | $dbw->sourceFile( "$IP/extensions/UsabilityInitiative/ClickTracking/ClickTrackingEvents.sql" ); |
83 | 85 | $dbw->sourceFile( "$IP/extensions/UsabilityInitiative/ClickTracking/ClickTracking.sql" ); |
84 | 86 | $dbw->sourceFile( "$IP/extensions/UsabilityInitiative/UserDailyContribs/UserDailyContribs.sql" ); |
| 87 | + $dbw->sourceFile( "$IP/extensions/UsabilityInitiative/OptIn/OptIn.sql" ); |
85 | 88 | |
86 | 89 | $dbw->query( "INSERT INTO site_stats(ss_row_id) VALUES (1)" ); |
87 | 90 | |
— | — | @@ -144,7 +147,17 @@ |
145 | 148 | #print "Constructing interwiki SQL\n"; |
146 | 149 | # Rebuild interwiki tables |
147 | 150 | #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 | + |
149 | 162 | $this->output( "Script ended. You still have to: |
150 | 163 | * Add any required settings in InitialiseSettings.php |
151 | 164 | * Run sync-common-all |
Property changes on: branches/wmf/1.16wmf4/maintenance/addwiki.php |
___________________________________________________________________ |
Added: svn:mergeinfo |
152 | 165 | Merged /branches/wmf-deployment/maintenance/addwiki.php:r60970 |
153 | 166 | Merged /trunk/phase3/maintenance/addwiki.php:r63545-63546,63549,63643,63764,63897-63901,63935,64113,64509,65387,65391,65555,65590,65650,65816,69546-69618 |