From f865fcdfa876f22796774b31e1c38eeaa56415e4 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Wed, 3 Mar 2004 07:46:21 +0000 Subject: [PATCH] Initialize log pages; bow out quick if dir not writable. Installation now seems to be pretty much functional! --- config/index.php | 44 +++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 41 insertions(+), 3 deletions(-) diff --git a/config/index.php b/config/index.php index 3b45a38a2a..2b6535b815 100644 --- a/config/index.php +++ b/config/index.php @@ -125,6 +125,22 @@ if( file_exists( "./LocalSettings.php" ) || file_exists( "./AdminSettings.php" ) (You should remove this config directory for added security once you're done.)

" ); } +if( !is_writable( "." ) ) { + dieout( "

Can't write config file, aborting

+ +

In order to configure the wiki you have to make the config subdirectory + writable by the web server. Once configuration is done you'll move the created + LocalSettings.php to the parent directory, and for added safety you can + then remove the config subdirectory entirely.

+ +

To make the directory writable on a Unix/Linux system:

+ +
+	cd /path/to/wiki
+	chmod a+w config
+	
" ); +} + include( "../install-utils.inc" ); class ConfigData { @@ -333,9 +349,31 @@ if( $conf->posted && ( 0 == count( $errs ) ) ) { print "
  • Skipped sysop account creation, no name given.
  • \n"; } - # FIXME: Main page, logs - # FIXME: Initialize messages - print "
  • (NYI: pages)
  • \n"; + print "
  • Initialising log pages..."; + $logs = array( + "uploadlogpage" => "uploadlogpagetext", + "dellogpage" => "dellogpagetext", + "protectlogpage" => "protectlogtext", + "blocklogpage" => "bloglogtext" + ); + $metaNamespace = Namespace::getWikipedia(); + $now = wfTimestampNow(); + $won = wfInvertTimestamp( $now ); + foreach( $logs as $page => $text ) { + $logTitle = wfStrencode( $wgLang->ucfirst( str_replace( " ", "_", wfMsgNoDB( $page ) ) ) ); + $logText = wfStrencode( 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 "
  • \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" ) ) . "','$now','$won','$now')"; + $wgDatabase->query( $sql, $fname ); print "
  • "; initialiseMessages(); -- 2.20.1