$IP = ".."; # Just to suppress notices, not for anything useful
define( "MEDIAWIKI", true );
define( "MEDIAWIKI_INSTALL", true );
+require_once( "../includes/Defines.php" );
require_once( "../includes/DefaultSettings.php" );
require_once( "../includes/MagicWord.php" );
require_once( "../includes/Namespace.php" );
$conf = new ConfigData;
install_version_checks();
-print "<li>PHP " . phpversion() . " ok</li>\n";
+
+print "<li>PHP " . phpversion() . ": ";
+if( version_compare( phpversion(), "5.0", "lt" ) ) {
+ print "ok";
+} else {
+ print " <b>the MonoBook skin will be disabled due to an incompatibility
+ between the PHPTAL template library and PHP 5</b>. The wiki should
+ function normally, but with the older look and feel.";
+}
+print "</li>\n";
+
+if( ini_get( "safe_mode" ) ) {
+ ?>
+ <li class='error'><b>Warning: PHP's
+ <a href='http://www.php.net/features.safe-mode'>safe mode</a> is active!</b>
+ You will likely have problems caused by this. You may need to make the
+ 'images' subdirectory writable or specify a TMP environment variable pointing to
+ a writable temporary directory owned by you, since safe mode breaks the system
+ temporary directory.</li>
+ <?php
+}
$sapi = php_sapi_name();
$conf->prettyURLs = true;
# $conf->IP = "/Users/brion/Sites/inplace";
chdir( ".." );
$conf->IP = getcwd();
-$conf->IP = preg_replace( "/\\\\/","\\\\\\\\",$conf->IP ); // For Windows, \ -> \\
chdir( "config" );
print "<li>Installation directory: <tt>" . htmlspecialchars( $conf->IP ) . "</tt></li>\n";
";
}
+function escapePhpString( $string ) {
+ return strtr( $string,
+ array(
+ "\n" => "\\n",
+ "\r" => "\\r",
+ "\t" => "\\t",
+ "\\" => "\\\\",
+ "\$" => "\\\$",
+ "\"" => "\\\""
+ ));
+}
+
function writeLocalSettings( $conf ) {
$conf->DBmysql4 = @$conf->DBmysql4 ? 'true' : 'false';
$conf->UseImageResize = $conf->UseImageResize ? 'true' : 'false';
}
# Add slashes to strings for double quoting
- $slconf = array_map( "addslashes", get_object_vars( $conf ) );
+ $slconf = array_map( "escapePhpString", get_object_vars( $conf ) );
$sep = (DIRECTORY_SEPARATOR == "\\") ? ";" : ":";