Directly grab the default installer values from DefaultSettings, so they stay in...
[lhc/web/wiklou.git] / config / Installer.php
index 6ab7680..fb76ef9 100644 (file)
@@ -112,7 +112,7 @@ $ourdb['oracle'] = array(
 
 ?>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr">
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en" dir="ltr">
 <head>
        <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
        <meta name="robots" content="noindex,nofollow"/>
@@ -503,11 +503,6 @@ if( $memlimit == -1 ) {
        print "</li>\n";
 }
 
-$conf->turck = function_exists( 'mmcache_get' );
-if ( $conf->turck ) {
-       print "<li><a href=\"http://turck-mmcache.sourceforge.net/\">Turck MMCache</a> installed</li>\n";
-}
-
 $conf->xcache = function_exists( 'xcache_get' );
 if( $conf->xcache )
        print "<li><a href=\"http://trac.lighttpd.net/xcache/\">XCache</a> installed</li>\n";
@@ -519,15 +514,13 @@ if ($conf->apc ) {
 
 $conf->eaccel = function_exists( 'eaccelerator_get' );
 if ( $conf->eaccel ) {
-       $conf->turck = 'eaccelerator';
        print "<li><a href=\"http://eaccelerator.sourceforge.net/\">eAccelerator</a> installed</li>\n";
 }
 
 $conf->dba = function_exists( 'dba_open' );
 
-if( !( $conf->turck || $conf->eaccel || $conf->apc || $conf->xcache ) ) {
-       echo( '<li>Couldn\'t find <a href="http://turck-mmcache.sourceforge.net">Turck MMCache</a>,
-               <a href="http://eaccelerator.sourceforge.net">eAccelerator</a>,
+if( !( $conf->eaccel || $conf->apc || $conf->xcache ) ) {
+       echo( '<li>Couldn\'t find <a href="http://eaccelerator.sourceforge.net">eAccelerator</a>,
                <a href="http://www.php.net/apc">APC</a> or <a href="http://trac.lighttpd.net/xcache/">XCache</a>;
                cannot use these for object caching.</li>' );
 }
@@ -620,9 +613,9 @@ print "<li style='font-weight:bold;color:green;font-size:110%'>Environment check
                $conf->DBtype = $DefaultDBtype;
        }
 
-       $conf->DBserver = importPost( "DBserver", "localhost" );
-       $conf->DBname = importPost( "DBname", "wikidb" );
-       $conf->DBuser = importPost( "DBuser", "wikiuser" );
+       $conf->DBserver = importPost( "DBserver", $wgDBserver );
+       $conf->DBname = importPost( "DBname", $wgDBname );
+       $conf->DBuser = importPost( "DBuser", $wgDBuser );
        $conf->DBpassword = importPost( "DBpassword" );
        $conf->DBpassword2 = importPost( "DBpassword2" );
        $conf->SysopName = importPost( "SysopName", "WikiSysop" );
@@ -639,12 +632,12 @@ print "<li style='font-weight:bold;color:green;font-size:110%'>Environment check
                importPost( "DBengine", "InnoDB" ) );
 
        ## Postgres specific:
-       $conf->DBport      = importPost( "DBport",      "5432" );
+       $conf->DBport      = importPost( "DBport",      $wgDBport );
        $conf->DBts2schema = importPost( "DBts2schema", "public" );
        $conf->DBpgschema  = importPost( "DBpgschema",  "mediawiki" );
 
        ## SQLite specific
-       $conf->SQLiteDataDir = importPost( "SQLiteDataDir", '../data' );
+       $conf->SQLiteDataDir = importPost( "SQLiteDataDir", "$IP/../data" );
 
        ## MSSQL specific
        // We need a second field so it doesn't overwrite the MySQL one
@@ -1459,11 +1452,6 @@ if( count( $errs ) ) {
                <ul class="plain">
                <li><?php aField( $conf, "Shm", "No caching", "radio", "none" ); ?></li>
                <?php
-                       if ( $conf->turck ) {
-                               echo "<li>";
-                               aField( $conf, "Shm", "Turck MMCache", "radio", "turck" );
-                               echo "</li>\n";
-                       }
                        if( $conf->xcache ) {
                                echo "<li>";
                                aField( $conf, 'Shm', 'XCache', 'radio', 'xcache' );
@@ -1493,7 +1481,7 @@ if( count( $errs ) ) {
                An object caching system such as memcached will provide a significant performance boost,
                but needs to be installed. Provide the server addresses and ports in a comma-separated list.
                <br /><br />
-               MediaWiki can also detect and support eAccelerator, Turck MMCache, APC, and XCache, but
+               MediaWiki can also detect and support eAccelerator, APC, and XCache, but
                these should not be used if the wiki will be running on multiple application servers.
                <br /><br />
                DBA (Berkeley-style DB) is generally slower than using no cache at all, and is only
@@ -1665,8 +1653,7 @@ if( count( $errs ) ) {
        ?></div>
        <div class="config-desc">
                <p>SQLite stores table data into files in the
-               filesystem.  By default the path is the "data"
-               directory in your document root.</p>
+               filesystem.</p>
 
                <p>This directory must exist and be writable by the web server.</p>
        </div>
@@ -1737,7 +1724,7 @@ window.onload = toggleDBarea( <?php echo Xml::encodeJsVar( $conf->DBtype ); ?>,
 function writeSuccessMessage() {
  $script = defined('MW_INSTALL_PHP5_EXT') ? 'index.php5' : 'index.php';
        if ( wfIniGetBool( 'safe_mode' ) && !ini_get( 'open_basedir' ) ) {
-               echo <<<EOT
+               echo <<<HTML
 <div class="success-box">
 <p>Installation successful!</p>
 <p>To complete the installation, please do the following:
@@ -1752,9 +1739,9 @@ remotely. LocalSettings.php is currently owned by the user your webserver is run
 which means that anyone on the same server can read your database password! Downloading
 it and uploading it again will hopefully change the ownership to a user ID specific to you.</p>
 </div>
-EOT;
+HTML;
        } else {
-               echo <<<EOT
+               echo <<<HTML
 <div class="success-box">
 <p>
 <span class="success-message">Installation successful!</span>
@@ -1763,7 +1750,7 @@ Move the <tt>config/LocalSettings.php</tt> file to the parent directory, then fo
 <p>You should change file permissions for <tt>LocalSettings.php</tt> as required to
 prevent other users on the server reading passwords and altering configuration data.</p>
 </div>
-EOT;
+HTML;
        }
 }
 
@@ -1789,10 +1776,11 @@ function writeLocalSettings( $conf ) {
        $convert = ($conf->ImageMagick ? $conf->ImageMagick : "/usr/bin/convert" );
        $rights = ($conf->RightsUrl) ? "" : "# ";
        $hashedUploads = $conf->safeMode ? '' : '# ';
-       $sqliteDataDir = escapePhpString( realpath($conf->SQLiteDataDir) );
-       if ( substr_compare( $conf->IP, $sqliteDataDir, 0 ) ) {
-               $sqliteDataDir = substr_replace( $sqliteDataDir, '$IP', 0, strlen($conf->IP) );
+       $dir = realpath( $conf->SQLiteDataDir );
+       if ( !$dir ) {
+               $dir = $conf->SQLiteDataDir; // dumb realpath sometimes fails
        }
+       $sqliteDataDir = escapePhpString( $dir );
 
        if ( $conf->ShellLocale ) {
                $locale = '';
@@ -1806,7 +1794,6 @@ function writeLocalSettings( $conf ) {
                        $cacheType = 'CACHE_MEMCACHED';
                        $mcservers = var_export( $conf->MCServerArray, true );
                        break;
-               case 'turck':
                case 'xcache':
                case 'apc':
                case 'eaccel':
@@ -2013,7 +2000,7 @@ if ( \$wgCommandLineMode ) {
 \$wgSecretKey = \"$secretKey\";
 
 ## Default skin: you can change the default skin. Use the internal symbolic
-## names, ie 'standard', 'nostalgia', 'cologneblue', 'monobook':
+## names, ie 'vector', 'monobook':
 \$wgDefaultSkin = 'monobook';
 
 ## For attaching licensing metadata to pages, and displaying an