From 84310e2fc82e7b3bee7aa5a3a8a7cf3c6ff51dbe Mon Sep 17 00:00:00 2001 From: Roan Kattouw Date: Mon, 19 Jul 2010 14:00:51 +0000 Subject: [PATCH] (bug 24398) Make addwiki.php send a notification e-mail to newprojects@lists.wikimedia.org . Needs addition of fourth parameter for domain name, will document at wikitechwiki --- maintenance/addwiki.php | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/maintenance/addwiki.php b/maintenance/addwiki.php index 7d251d8bc1..9dd95efd56 100644 --- a/maintenance/addwiki.php +++ b/maintenance/addwiki.php @@ -33,9 +33,10 @@ class AddWiki extends Maintenance { public function __construct() { parent::__construct(); $this->mDescription = "Add a new wiki to the family. Wikimedia specific!"; - $this->addArg( 'language', 'Language code of new site' ); - $this->addArg( 'site', 'Type of site' ); - $this->addArg( 'dbname', 'Name of database to create' ); + $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' ); } public function getDbType() { @@ -43,12 +44,13 @@ class AddWiki extends Maintenance { } public function execute() { - global $IP, $wgDefaultExternalStore, $wgNoDBParam; + global $IP, $wgDefaultExternalStore, $wgNoDBParam, $wgPasswordSender; $wgNoDBParam = true; $lang = $this->getArg( 0 ); $site = $this->getArg( 1 ); $dbName = $this->getArg( 2 ); + $domain = $this->getArg( 3 ); $languageNames = Language::getLanguageNames(); if ( !isset( $languageNames[$lang] ) ) { @@ -146,6 +148,16 @@ class AddWiki extends Maintenance { # print "Constructing interwiki SQL\n"; # Rebuild interwiki tables # passthru( '/home/wikipedia/conf/interwiki/update' ); + + $user = getenv( 'USER' ); + $time = wfTimestamp( TS_RFC2822 ); + UserMailer::send( new MailAddress( 'newprojects@list.wikimedia.org' ), + new MailAddress( $wgPasswordSender ), "New wiki: $dbName", + <<output( "Script ended. You still have to: * Add any required settings in InitialiseSettings.php -- 2.20.1