function moveCustomMessages( $phase ) {
global $wgUser, $wgAllMessagesEn, $wgDeferredUpdateList, $wgLang ;
+ global $targets, $template, $replaceCount;
+
$wgUser = new User;
$wgUser->setLoaded( true ); # Don't load from DB
$wgUser->setName( "Template namespace initialisation script" );
# Create redirects from destination to source
if ( $phase == 0 || $phase == 1 ) {
+ print "Creating redirects\n";
foreach ( $targets as $partial => $dummy ) {
print "$partial...";
$nt = Title::makeTitle( NS_TEMPLATE, $partial );
# Move pages
if ( $phase == 0 || $phase == 2 ) {
- print "\n";
+ print "\nMoving pages...\n";
foreach ( $targets as $partial => $dummy ) {
$ot = Title::makeTitle( NS_MEDIAWIKI, $partial );
$nt = Title::makeTitle( NS_TEMPLATE, $partial );
# Convert text
if ( $phase == 0 || $phase == 3 ) {
- print "\n";
+ print "\nConverting text...\n";
$parser = new Parser;
$options = ParserOptions::newFromUser( $wgUser );
# 3. Convert the text to suit the new syntax
chdir( ".." );
-require_once( "commandLine.inc" );
+require_once( "liveCmdLine.inc" );
require_once( "moveCustomMessages.inc" );
$phase = 0;
-if ( is_numeric( @$argv[2] ) && $argv[2] > 0) {
- $phase = intval($argv[2]);
+if ( is_numeric( @$argv[3] ) && $argv[3] > 0) {
+ $phase = intval($argv[3]);
}
moveCustomMessages( $phase );