Add MW_CONFIG_FILE support to load a separate config file instead of LocalSettings...
[lhc/web/wiklou.git] / maintenance / addwiki.php
index de3e038..65f1aa1 100644 (file)
@@ -44,7 +44,7 @@ class AddWiki extends Maintenance {
        }
 
        public function execute() {
-               global $IP, $wgDefaultExternalStore, $wgNoDBParam, $wgPasswordSender;
+               global $IP, $wgDefaultExternalStore, $wgNoDBParam;
 
                $wgNoDBParam = true;
                $lang = $this->getArg( 0 );
@@ -132,8 +132,7 @@ class AddWiki extends Maintenance {
                $wgArticle = new Article( $wgTitle );
                $ucsite = ucfirst( $site );
 
-               $wgArticle->doEdit( $this->getFirstArticle( $ucsite, $name ), '', EDIT_NEW | EDIT_DEFER_UPDATES | EDIT_AUTOSUMMARY,
-                       false, null, false, false, '', true );
+               $wgArticle->insertNewArticle( $this->getFirstArticle( $ucsite, $name ), '', false, false );
 
                $this->output( "Adding to dblists\n" );
 
@@ -148,7 +147,7 @@ class AddWiki extends Maintenance {
                # print "Constructing interwiki SQL\n";
                # Rebuild interwiki tables
                # passthru( '/home/wikipedia/conf/interwiki/update' );
-               
+
                $time = wfTimestamp( TS_RFC2822 );
                // These arguments need to be escaped twice: once for echo and once for at
                $escDbName = wfEscapeShellArg( wfEscapeShellArg( $dbName ) );
@@ -158,14 +157,14 @@ class AddWiki extends Maintenance {
                $escLang = wfEscapeShellArg( wfEscapeShellArg( $lang ) );
                $escDomain = wfEscapeShellArg( wfEscapeShellArg( $domain ) );
                shell_exec( "echo notifyNewProjects $escDbName $escTime $escUcsite $escName $escLang $escDomain | at now + 15 minutes" );
-               
+
                $this->output( "Script ended. You still have to:
        * Add any required settings in InitialiseSettings.php
        * Run sync-common-all
        * Run /home/wikipedia/conf/interwiki/update
        " );
        }
-       
+
        private function getFirstArticle( $ucsite, $name ) {
                return <<<EOT
 ==This subdomain is reserved for the creation of a [[wikimedia:Our projects|$ucsite]] in '''[[w:en:{$name}|{$name}]]''' language==