+
+ if( $conf->SysopName ) {
+ $u = User::newFromName( $conf->getSysopName() );
+ if ( 0 == $u->idForName() ) {
+ $u->addToDatabase();
+ $u->setPassword( $conf->getSysopPass() );
+ $u->addRight( "sysop" );
+ $u->addRight( "bureaucrat" );
+ $u->saveSettings();
+ 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";
+ }
+
+ print "<li>Initialising log pages...";
+ $logs = array(
+ "uploadlogpage" => "uploadlogpagetext",
+ "dellogpage" => "dellogpagetext",
+ "protectlogpage" => "protectlogtext",
+ "blocklogpage" => "blocklogtext"
+ );
+ $metaNamespace = Namespace::getWikipedia();
+ $now = wfTimestampNow();
+ $won = wfInvertTimestamp( $now );
+ foreach( $logs as $page => $text ) {
+ $logTitle = $wgDatabase->strencode( $wgLang->ucfirst( str_replace( " ", "_", wfMsgNoDB( $page ) ) ) );
+ $logText = $wgDatabase->strencode( wfMsgNoDB( $text ) );
+ $wgDatabase->query( "INSERT INTO cur (cur_namespace,cur_title,cur_text," .
+ "cur_restrictions,cur_timestamp,inverse_timestamp,cur_touched) " .
+ "VALUES ($metaNamespace,'$logTitle','$logText','sysop','$now','$won','$now')" );
+ }
+ print "</li>\n";
+
+ $titleobj = Title::newFromText( wfMsgNoDB( "mainpage" ) );
+ $title = $titleobj->getDBkey();
+ $sql = "INSERT INTO cur (cur_namespace,cur_title,cur_text,cur_timestamp,inverse_timestamp,cur_touched) " .
+ "VALUES (0,'$title','" .
+ wfStrencode( wfMsg( "mainpagetext" ) . "\n\n" . wfMsg( "mainpagedocfooter" ) ) . "','$now','$won','$now')";
+ $wgDatabase->query( $sql, $fname );
+
+ print "<li><pre>";
+ initialiseMessages();
+ print "</pre></li>\n";