install_version_checks();
print "<li>PHP " . phpversion() . " ok</li>\n";
-/*
+$sapi = php_sapi_name();
+$conf->prettyURLs = true;
+print "<li>PHP server API is $sapi; ";
+switch( $sapi ) {
+case "apache":
+ print "ok, using pretty URLs (<tt>index.php/Page_Title</tt>)";
+ break;
+case "cgi":
+case "cgi-fcgi":
+ print "using ugly URLs (<tt>index.php?title=Page_Title</tt>)";
+ $conf->prettyURLs = false;
+ break;
+default:
+ print "unknown; using pretty URLs (<tt>index.php/Page_Title</tt>), if you have trouble change this in <tt>LocalSettings.php</tt>";
+}
+print "</li>\n";
+
$conf->zlib = function_exists( "gzencode" );
-$z = $conf->zlib ? "Have" : "No";
-print "<li>$z zlib support</li>\n";
-*/
+if( $conf->zlib ) {
+ print "<li>Have zlib support; enabling output compression.</li>\n";
+} else {
+ print "<li>No zlib support.</li>\n";
+}
+
+$conf->ImageMagick = false;
$conf->HaveGD = function_exists( "imagejpeg" );
if( $conf->HaveGD ) {
print "<li>Found GD graphics library built-in, image thumbnailing will be enabled if you enable uploads.</li>\n";
} else {
- print "<li>No built-in GD library, image thumbnailing disabled.</li>\n";
-}
-
-/*
-if( file_exists( "/usr/bin/convert" ) ) {
- $conf->ImageMagick = "/usr/bin/convert";
- print "<li>Found ImageMagick: /usr/bin/convert</li>\n";
-} elseif( file_exists( "/usr/local/bin/convert" ) ) {
- $conf->ImageMagick = "/usr/local/bin/convert";
- print "<li>Found ImageMagick: /usr/local/bin/convert</li>\n";
-} else {
- $conf->ImageMagick = false;
- print "<li>No ImageMagick.</li>\n";
+ $imcheck = array( "/usr/bin", "/usr/local/bin", "/sw/bin" );
+ foreach( $imcheck as $dir ) {
+ $im = "$dir/convert";
+ if( file_exists( $im ) ) {
+ print "<li>Found ImageMagick: <tt>$im</tt>; image thumbnailing will be enabled if you enable uploads.</li>\n";
+ $conf->ImageMagick = $im;
+ break;
+ }
+ }
+ if( !$conf->ImageMagick ) {
+ print "<li>Couldn't find GD library or ImageMagick; image thumbnailing disabled.</li>\n";
+ }
}
-*/
-$conf->UseImageResize = $conf->HaveGD;
+$conf->UseImageResize = $conf->HaveGD || $conf->ImageMagick;
# $conf->IP = "/Users/brion/Sites/inplace";
chdir( ".." );
$u->addToDatabase();
$u->setPassword( $conf->getSysopPass() );
$u->addRight( "sysop" );
- $u->addRight( "developer" ); /* ?? */
+ $u->addRight( "bureaucrat" );
$u->saveSettings();
print "<li>Created sysop account <tt>" .
htmlspecialchars( $conf->SysopName ) . "</tt>.</li>\n";
wfStrencode( wfMsg( "mainpagetext" ) ) . "','$now','$won','$now')";
$wgDatabase->query( $sql, $fname );
- print "<li>";
+ print "<li><pre>";
initialiseMessages();
- print "</li>\n";
+ print "</pre></li>\n";
if( $conf->Root ) {
# Grant user permissions
function writeLocalSettings( $conf ) {
$conf->DBmysql4 = $conf->DBmysql4 ? 'true' : 'false';
$conf->UseImageResize = $conf->UseImageResize ? 'true' : 'false';
- $conf->DBsqluser = $conf->DBuser;
- $conf->DBsqlpassword = $conf->DBpassword;
$conf->PasswordSender = $conf->EmergencyContact;
if( $conf->LanguageCode == "en-utf8" ) {
$conf->LanguageCode = "en";
$conf->Encoding = "UTF-8";
}
+ $zlib = ($conf->zlib ? "" : "# ");
+ $magic = ($conf->ImageMagick ? "" : "# ");
+ $convert = ($conf->ImageMagick ? $conf->ImageMagick : "/usr/bin/convert" );
+ $pretty = ($conf->prettyURLs ? "" : "# ");
+ $ugly = ($conf->prettyURLs ? "# " : "");
+
$sep = (DIRECTORY_SEPARATOR == "\\") ? ";" : ":";
return "
-# This file was automatically generated. Don't touch unless you
-# know what you're doing; see LocalSettings.sample for an edit-
-# friendly file.
+# This file was automatically generated by the MediaWiki installer.
+# If you make manual changes, please keep track in case you need to
+# recreate them later.
\$IP = \"{$conf->IP}\";
ini_set( \"include_path\", \"\$IP/includes$sep\$IP/languages$sep\" . ini_get(\"include_path\") );
if( \$wgCommandLineMode ) {
die( \"Can't use command-line utils with in-place install yet, sorry.\" );
+} else {
+ ## Compress output if the browser supports it
+ {$zlib}if( !ini_get( 'zlib.output_compression' ) ) ob_start( 'ob_gzhandler' );
}
\$wgSitename = \"{$conf->Sitename}\";
\$wgScript = \"\$wgScriptPath/index.php\";
\$wgRedirectScript = \"\$wgScriptPath/redirect.php\";
-\$wgArticlePath = \"\$wgScript/\$1\";
+## If using PHP as a CGI module, use the ugly URLs
+{$pretty}\$wgArticlePath = \"\$wgScript/\$1\";
+{$ugly}\$wgArticlePath = \"\$wgScript?title=\$1\";
\$wgStyleSheetPath = \"\$wgScriptPath/stylesheets\";
\$wgStyleSheetDirectory = \"\$IP/stylesheets\";
\$wgDBname = \"{$conf->DBname}\";
\$wgDBuser = \"{$conf->DBuser}\";
\$wgDBpassword = \"{$conf->DBpassword}\";
-\$wgDBsqluser = \"{$conf->DBsqluser}\";
-\$wgDBsqlpassword = \"{$conf->DBsqlpassword}\";
+
+## To allow SQL queries through the wiki's Special:Askaql page,
+## uncomment the next lines. THIS IS VERY INSECURE. If you want
+## to allow semipublic read-only SQL access for your sysops,
+## you should define a MySQL user with limited privileges.
+## See MySQL docs: http://www.mysql.com/doc/en/GRANT.html
+#
+# $wgAllowSysopQueries = true;
+# $wgDBsqluser = \"sqluser\";
+# $wgDBsqlpassword = \"sqlpass\";
\$wgDBmysql4 = \$wgEnablePersistentLC = {$conf->DBmysql4};
## is writable, then uncomment this:
# \$wgDisableUploads = false;
\$wgUseImageResize = {$conf->UseImageResize};
+{$magic}\$wgUseImageMagick = true;
+{$magic}\$wgImageMagickConvertCommand = \"{$convert}\";
## If you have the appropriate support software installed
## you can enable inline LaTeX equations:
# \$wgUseTeX = true;
-# \$wgMathPath = \"{\$wgUploadPath}/math\";
-# \$wgMathDirectory = \"{\$wgUploadDirectory}/math\";
-# \$wgTmpDirectory = \"{\$wgUploadDirectory}/tmp\";
-
-\$wgLocalInterwiki = \$wgSitename;
-
-\$wgLanguageCode = \"{$conf->LanguageCode}\";
-" . ($conf->Encoding ? "\$wgInputEncoding = \$wgOutputEncoding = \"{$conf->Encoding}\";" : "" ) . "
+\$wgMathPath = \"{\$wgUploadPath}/math\";
+\$wgMathDirectory = \"{\$wgUploadDirectory}/math\";
+\$wgTmpDirectory = \"{\$wgUploadDirectory}/tmp\";
+## Experimental layout template subsystems
\$wgUsePHPTal = false;
\$wgUseSmarty = false;
if ( \$wgUsePHPTal ) {
- ini_set( \"include_path\", \"\$IP/PHPTAL-NP-0.7.0/libs:\" . ini_get(\"include_path\") );
+ ini_set( \"include_path\", \"\$IP/PHPTAL-NP-0.7.0/libs$sep\" . ini_get(\"include_path\") );
}
if ( \$wgUseSmarty ) {
- ini_set( \"include_path\", \"\$IP/Smarty-2.6.2/libs/:\" . ini_get(\"include_path\") );
+ ini_set( \"include_path\", \"\$IP/Smarty-2.6.2/libs$sep\" . ini_get(\"include_path\") );
}
+\$wgLocalInterwiki = \$wgSitename;
+
+\$wgLanguageCode = \"{$conf->LanguageCode}\";
+" . ($conf->Encoding ? "\$wgInputEncoding = \$wgOutputEncoding = \"{$conf->Encoding}\";" : "" ) . "
+
";
}
?>
</body>
-</html>
+</html>
\ No newline at end of file