function importAll()
 {
     $this->importCurData();
     $this->fixCurTitles();
     $this->importOldData();
     $this->fixOldTitles();
     $this->importUserData();
     $this->fixUserOptions();
     $this->importWatchlists();
     $this->importLinkData();
     /*
     # For some reason this is broken. RecentChanges will just start anew...
     rebuildRecentChangesTablePass1();
     rebuildRecentChangesTablePass2();
     */
     print "Rebuilding search index:\n";
     dropTextIndex();
     rebuildTextIndex();
     createTextIndex();
     initialiseMessages();
 }
Exemple #2
0
             $u->addGroup("sysop");
             $u->addGroup("bureaucrat");
             print "<li>Created sysop account <tt>" . htmlspecialchars($conf->SysopName) . "</tt>.</li>\n";
         } else {
             print "<li>Could not create user - already exists!</li>\n";
         }
     } else {
         print "<li>Skipped sysop account creation, no name given.</li>\n";
     }
     $titleobj = Title::newFromText(wfMsgNoDB("mainpage"));
     $article = new Article($titleobj);
     $newid = $article->insertOn($wgDatabase);
     $revision = new Revision(array('page' => $newid, 'text' => wfMsg('mainpagetext') . "\n\n" . wfMsg('mainpagedocfooter'), 'comment' => '', 'user' => 0, 'user_text' => 'MediaWiki default'));
     $revid = $revision->insertOn($wgDatabase);
     $article->updateRevisionOn($wgDatabase, $revision);
     initialiseMessages(false, false, 'printListItem');
 }
 /* Write out the config file now that all is well */
 print "<p>Creating LocalSettings.php...</p>\n\n";
 $localSettings = "<" . "?php{$endl}{$local}{$endl}?" . ">\r\n";
 // Fix up a common line-ending problem (due to CVS on Windows)
 $localSettings = str_replace("\r\n", "\n", $localSettings);
 $f = fopen("LocalSettings.php", 'xt');
 if ($f == false) {
     dieout("<p>Couldn't write out LocalSettings.php. Check that the directory permissions are correct and that there isn't already a file of that name here...</p>\n" . "<p>Here's the file that would have been written, try to paste it into place manually:</p>\n" . "<pre>\n" . htmlspecialchars($localSettings) . "</pre>\n");
 }
 if (fwrite($f, $localSettings)) {
     fclose($f);
     writeSuccessMessage();
 } else {
     fclose($f);
             $u->addGroup("bureaucrat");
             print "<li>Created sysop account <tt>" . htmlspecialchars($conf->SysopName) . "</tt>.</li>\n";
         } else {
             print "<li>Could not create user - already exists!</li>\n";
         }
     } else {
         print "<li>Skipped sysop account creation, no name given.</li>\n";
     }
     $titleobj = Title::newFromText(wfMsgNoDB("mainpage"));
     $article = new Article($titleobj);
     $newid = $article->insertOn($wgDatabase);
     $revision = new Revision(array('page' => $newid, 'text' => wfMsg('mainpagetext') . "\n\n" . wfMsg('mainpagedocfooter'), 'comment' => '', 'user' => 0, 'user_text' => 'MediaWiki default'));
     $revid = $revision->insertOn($wgDatabase);
     $article->updateRevisionOn($wgDatabase, $revision);
     print "<li><pre>";
     initialiseMessages();
     print "</pre></li>\n";
 }
 /* Write out the config file now that all is well */
 print "<p>Creating LocalSettings.php...</p>\n\n";
 $localSettings = "<" . "?php{$endl}{$local}{$endl}?" . ">";
 // Fix up a common line-ending problem (due to CVS on Windows)
 $localSettings = str_replace("\r\n", "\n", $localSettings);
 if (version_compare(phpversion(), "4.3.2") >= 0) {
     $xt = "xt";
     # Refuse to overwrite an existing file
 } else {
     $xt = "wt";
     # 'x' is not available prior to PHP 4.3.2. We did check above, but race conditions blah blah
 }
 $f = fopen("LocalSettings.php", $xt);
if (isset($options['rebuild'])) {
    $response = 2;
}
if ($response == 0) {
    $dbr =& wfGetDB(DB_SLAVE);
    $row = $dbr->selectRow("page", array("count(*) as c"), array("page_namespace" => NS_MEDIAWIKI));
    print "Current namespace size: {$row->c}\n";
    print <<<END
Usage:   php rebuildMessages.php <action> [filename]

Action must be one of:
  --update   Update messages to include latest additions to MessagesXX.php
  --rebuild  Delete all messages and reinitialise namespace

If a message dump file is given, messages will be read from it to supplement
the defaults in MediaWiki's Language*.php. The file should contain a serialized
PHP associative array, as produced by dumpMessages.php.


END;
    exit(0);
}
switch ($response) {
    case 1:
        initialiseMessages(false, $messages);
        break;
    case 2:
        initialiseMessages(true, $messages);
        break;
}
exit;