PHP 5.3.2 might not be out until February, by which time a number of distros will...
[lhc/web/wiklou.git] / config / Installer.php
index 9699f25..b0739b1 100644 (file)
@@ -106,7 +106,7 @@ $ourdb['oracle'] = array(
        'havedriver' => 0,
        'compile'    => 'oci8',
        'bgcolor'    => '#ffeba1',
-       'rootuser'   => '',
+       'rootuser'   => 'sys',
        'serverless' => false
 );
 
@@ -419,7 +419,6 @@ if( wfIniGetBool( "zend.ze1_compatibility_mode" ) ) {
        <?php
 }
 
-
 if( $fatal ) {
        dieout( "Cannot install MediaWiki." );
 }
@@ -533,24 +532,6 @@ if( !( $conf->turck || $conf->eaccel || $conf->apc || $conf->xcache ) ) {
                cannot use these for object caching.</li>' );
 }
 
-$conf->phpCliPath = false;
-$phpClilocations = array_merge(
-       array(
-               "/usr/bin",
-               "/usr/local/bin",
-               "/opt/csw/bin",
-               "/usr/gnu/bin",
-               "/usr/sfw/bin" ),
-       explode( PATH_SEPARATOR, getenv( "PATH" ) ) );
-$phpClinames = array( "php", "php.exe" );
-foreach ($phpClilocations as $loc) {
-       $exe = locate_executable($loc, $phpClinames);
-       if ($exe !== false) {
-               $conf->phpCliPath= $exe;
-               break;
-       }
-}
-
 $conf->diff3 = false;
 $diff3locations = array_merge(
        array(
@@ -1027,7 +1008,10 @@ if( $conf->posted && ( 0 == count( $errs ) ) ) {
                        echo "ok</li>\n";
                } elseif ( $conf->DBtype == 'oracle' ) {
                        echo "<li>Attempting to connect to database \"" . htmlspecialchars( $wgDBname ) ."\"</li>";
+                       $old_error_level = error_reporting();
+                       error_reporting($old_error_level & ~E_WARNING); //disable E_WARNING for test connect (oci returns login denied as warning)
                        $wgDatabase = $dbc->newFromParams('DUMMY', $wgDBuser, $wgDBpassword, $wgDBname, 1);
+                       error_reporting($old_error_level);
                        if (!$wgDatabase->isOpen()) {
                                $ok = true;
                                echo "<li>Connect failed.</li>";
@@ -1268,7 +1252,7 @@ if( $conf->posted && ( 0 == count( $errs ) ) ) {
                        print " done.</li>\n";
                        
                
-                       if ($conf->DBtype == 'ibm_db2') {
+                       if ( $conf->DBtype == 'ibm_db2' ) {
                                // Now that table creation is done, make sure everything is committed
                                // Do this before doing inserts through API
                                if ($wgDatabase->lastError()) {
@@ -1279,6 +1263,10 @@ if( $conf->posted && ( 0 == count( $errs ) ) ) {
                                        print "<li>MediaWiki tables successfully created</li>\n";
                                        $wgDatabase->commit();
                                }
+                       } elseif ( $conf->DBtype == 'sqlite' ) {
+                               // Ensure proper searchindex format. We have to do that separately because
+                               // if SQLite is compiled without the FTS3 module, table creation syntax will be invalid.
+                               sqlite_setup_searchindex();
                        }
 
                        print "<li>Initializing statistics...</li>\n";
@@ -1507,7 +1495,7 @@ if( count( $errs ) ) {
                <br /><br />
                MediaWiki can also detect and support eAccelerator, Turck MMCache, APC, and XCache, but
                these should not be used if the wiki will be running on multiple application servers.
-               <br/><br/>
+               <br /><br />
                DBA (Berkeley-style DB) is generally slower than using no cache at all, and is only 
                recommended for testing.
        </p>
@@ -1653,9 +1641,9 @@ if( count( $errs ) ) {
        </div>
        <p class="config-desc">
                This option is ignored on upgrade, the same character set will be kept. 
-               <br/><br/>
+               <br /><br />
                <b>WARNING:</b> If you use <b>backwards-compatible UTF-8</b> on MySQL 4.1+, and subsequently back up the database with <tt>mysqldump</tt>, it may destroy all non-ASCII characters, irreversibly corrupting your backups!.
-               <br/><br/>
+               <br /><br />
                In <b>binary mode</b>, MediaWiki stores UTF-8 text to the database in binary fields. This is more efficient than MySQL's UTF-8 mode, and allows you to use the full range of Unicode characters. In <b>UTF-8 mode</b>, MySQL will know what character set your data is in, and can present and convert it appropriately, but it won't let you store characters above the <a target="_blank" href="http://en.wikipedia.org/wiki/Mapping_of_Unicode_character_planes">Basic Multilingual Plane</a>.
        </p>
        </fieldset>
@@ -1672,9 +1660,6 @@ if( count( $errs ) ) {
        </fieldset>
 
        <?php database_switcher('sqlite'); ?>
-       <div class="config-desc">
-               <b>NOTE:</b> SQLite only uses the <i>Database name</i> setting above, the user, password and root settings are ignored.
-       </div>
        <div class="config-input"><?php
                aField( $conf, "SQLiteDataDir", "SQLite data directory:" );
        ?></div>
@@ -1959,6 +1944,13 @@ if ( \$wgCommandLineMode ) {
 \$wgScriptPath       = \"{$slconf['ScriptPath']}\";
 \$wgScriptExtension  = \"{$slconf['ScriptExtension']}\";
 
+## The relative URL path to the skins directory 
+\$wgStylePath        = \"\$wgScriptPath/skins\";
+
+## The relative URL path to the logo.  Make sure you change this from the default,
+## or else you'll overwrite your logo when you upgrade!
+\$wgLogo             = \"\$wgStylePath/common/images/wiki.png\";
+
 ## UPO means: this is also a user preference option
 
 \$wgEnableEmail      = $enableemail;
@@ -2032,8 +2024,6 @@ if ( \$wgCommandLineMode ) {
 
 \$wgDiff3 = \"{$slconf['diff3']}\";
 
-\$wgPhpCliPath = \"{$slconf['phpCliPath']}\";
-
 # When you make changes to this configuration file, this will make
 # sure that cached pages are cleared.
 \$wgCacheEpoch = max( \$wgCacheEpoch, gmdate( 'YmdHis', @filemtime( __FILE__ ) ) );
@@ -2127,31 +2117,13 @@ function aField( &$conf, $field, $text, $type = "text", $value = "", $onclick =
 }
 
 function getLanguageList() {
-       global $wgLanguageNames, $IP;
-       if( !isset( $wgLanguageNames ) ) {
-               require_once( "$IP/languages/Names.php" );
-       }
+       global $wgDummyLanguageCodes;
 
        $codes = array();
-
-       $d = opendir( "../languages/messages" );
-       /* In case we are called from the root directory */
-       if (!$d)
-               $d = opendir( "languages/messages");
-       while( false !== ($f = readdir( $d ) ) ) {
-               $m = array();
-               if( preg_match( '/Messages([A-Z][a-z_]+)\.php$/', $f, $m ) ) {
-                       $code = str_replace( '_', '-', strtolower( $m[1] ) );
-                       if( $code == 'qqq' ) continue;
-                       if( isset( $wgLanguageNames[$code] ) ) {
-                               $name = wfBCP47( $code ) . ' - ' . $wgLanguageNames[$code];
-                       } else {
-                               $name = $code;
-                       }
-                       $codes[$code] = $name;
-               }
+       foreach ( Language::getLanguageNames() as $code => $name ) {
+               if( in_array( $code, $wgDummyLanguageCodes ) ) continue;
+               $codes[$code] = $code . ' - ' . $name;
        }
-       closedir( $d );
        ksort( $codes );
        return $codes;
 }