r78077 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r78076‎ | r78077 | r78078 >
Date:17:20, 8 December 2010
Author:ialex
Status:ok
Tags:
Comment:
* Use Article::doEdit() instead of old Article::insertNewArticle()
* No need for globals ($wgTitle and $wgArticle)
Modified paths:
  • /trunk/phase3/maintenance/addwiki.php (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/addwiki.php
@@ -126,13 +126,12 @@
127127 }
128128 }
129129
130 - global $wgTitle, $wgArticle;
131 - $wgTitle = Title::newFromText( wfMsgWeirdKey( "mainpage/$lang" ) );
132 - $this->output( "Writing main page to " . $wgTitle->getPrefixedDBkey() . "\n" );
133 - $wgArticle = new Article( $wgTitle );
 130+ $title = Title::newFromText( wfMsgWeirdKey( "mainpage/$lang" ) );
 131+ $this->output( "Writing main page to " . $title->getPrefixedDBkey() . "\n" );
 132+ $article = new Article( $title );
134133 $ucsite = ucfirst( $site );
135134
136 - $wgArticle->insertNewArticle( $this->getFirstArticle( $ucsite, $name ), '', false, false );
 135+ $article->doEdit( $this->getFirstArticle( $ucsite, $name ), '', EDIT_NEW | EDIT_AUTOSUMMARY );
137136
138137 $this->output( "Adding to dblists\n" );
139138

Status & tagging log