Index: trunk/phase3/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] ) ) { |
— | — | @@ -146,6 +148,16 @@ |
147 | 149 | # print "Constructing interwiki SQL\n"; |
148 | 150 | # Rebuild interwiki tables |
149 | 151 | # passthru( '/home/wikipedia/conf/interwiki/update' ); |
| 152 | + |
| 153 | + $user = getenv( 'USER' ); |
| 154 | + $time = wfTimestamp( TS_RFC2822 ); |
| 155 | + UserMailer::send( new MailAddress( 'newprojects@list.wikimedia.org' ), |
| 156 | + new MailAddress( $wgPasswordSender ), "New wiki: $dbName", |
| 157 | + <<<EOT |
| 158 | +A new wiki was created by $user at $time for a $ucsite in $name ($lang). |
| 159 | +Once the wiki is fully set up, it'll be visible at http://$domain |
| 160 | +EOT; |
| 161 | + ); |
150 | 162 | |
151 | 163 | $this->output( "Script ended. You still have to: |
152 | 164 | * Add any required settings in InitialiseSettings.php |