?>
}
- function toggleDBarea(id) {
+ function toggleDBarea(id,defaultroot) {
hideall();
var dbarea = document.getElementById(id).style;
dbarea.display = (dbarea.display == 'none') ? 'block' : 'none';
var db = document.getElementById('RootUser');
- <?php foreach (array_keys($ourdb) as $db) {
- echo "\n if (id == '$db') { db.value = '".$ourdb[$db]['rootuser']."';}";
+ if (defaultroot) {
+<?php foreach (array_keys($ourdb) as $db) {
+ echo " if (id == '$db') { db.value = '".$ourdb[$db]['rootuser']."';}\n";
+}?>
}
- ?>
-
}
// -->
</script>
$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->turck = 'eaccelerator';
+ print "<li><a href=\"http://eaccelerator.sourceforge.net/\">eAccelerator</a> installed</li>\n";
}
if( !$conf->turck && !$conf->eaccel && !$conf->apc ) {
echo( '<li>Couldn\'t find <a href="http://turck-mmcache.sourceforge.net">Turck MMCache</a>,
- <a href="http://eaccelerator.sourceforge.net">eAccelerator</a> or
- <a href="http://www.php.net/apc">APC</a>. Object caching functions cannot be used.</li>' );
+ <a href="http://eaccelerator.sourceforge.net">eAccelerator</a> or
+ <a href="http://www.php.net/apc">APC</a>. Object caching functions cannot be used.</li>' );
}
$conf->diff3 = false;
$conf->SysopName = importPost( "SysopName", "WikiSysop" );
$conf->SysopPass = importPost( "SysopPass" );
$conf->SysopPass2 = importPost( "SysopPass2" );
- $conf->RootUser = importPost( "RootUser", "root" );
- $conf->RootPW = importPost( "RootPW", "-" );
+ $conf->RootUser = importPost( "RootUser", "root" );
+ $conf->RootPW = importPost( "RootPW", "-" );
## MySQL specific:
$conf->DBprefix = importPost( "DBprefix" );
require_once( "maintenance/InitialiseMessages.inc" );
$wgTitle = Title::newFromText( "Installation script" );
-error_reporting( E_ALL );
+ error_reporting( E_ALL );
print "<li>Loading class: $dbclass";
$dbc = new $dbclass;
$wgDatabase = $dbc->newFromParams($wgDBserver, $wgDBsuperuser, $conf->RootPW, "postgres", 1);
if (!$wgDatabase->isOpen()) {
print " error: " . $wgDatabase->lastError() . "</li>\n";
- $errs["DBserver"] = "Couldn't connect to database as superuser";
+ $errs["DBserver"] = "Could not connect to database as superuser";
$errs["RootUser"] = "Check username";
$errs["RootPW"] = "and password";
continue;
if( version_compare( $myver, "4.0.14" ) < 0 ) {
dieout( " -- mysql 4.0.14 or later required. Aborting." );
}
- $mysqlNewAuth = version_compare( $myver, "4.1.0", "ge" );
+ $mysqlNewAuth = version_compare( $myver, "4.1.0", "ge" );
if( $mysqlNewAuth && $mysqlOldClient ) {
print "; <b class='error'>You are using MySQL 4.1 server, but PHP is linked
to old client libraries; if you have trouble with authentication, see
print "<li>Initializing data...";
$wgDatabase->insert( 'site_stats',
- array( 'ss_row_id' => 1,
- 'ss_total_views' => 0,
- 'ss_total_edits' => 0,
- 'ss_good_articles' => 0 ) );
-
+ array ( 'ss_row_id' => 1,
+ 'ss_total_views' => 0,
+ 'ss_total_edits' => 0,
+ 'ss_good_articles' => 0 ) );
+
# Set up the "regular user" account *if we can, and if we need to*
if( $conf->Root and $conf->DBtype == 'mysql') {
# See if we need to
echo( "success.</li>" );
}
}
-
+
if( $conf->SysopName ) {
$u = User::newFromName( $conf->getSysopName() );
if ( 0 == $u->idForName() ) {
/* Write out the config file now that all is well */
print "<p>Creating LocalSettings.php...</p>\n\n";
- $localSettings = "<" . "?php$endl$local$endl?" . ">";
+ $localSettings = "<" . "?php$endl$local$endl?" . ">";
// Fix up a common line-ending problem (due to CVS on Windows)
$localSettings = str_replace( "\r\n", "\n", $localSettings );
?></div>
<div class="config-desc">
<p>The username specified above will have it's search path set to the above schemas,
- so it is recommended that you create a new user.</p>
+ so it is recommended that you create a new user.</p>
</div>
</div>
</div>
<script type="text/javascript">
-window.onload = toggleDBarea('<?php echo $conf->DBtype; ?>');
+window.onload = toggleDBarea('<?php echo $conf->DBtype; ?>',
+<?php
+ ## If they passed in a root user name, don't populate it on page load
+ echo strlen(importPost('RootUser', '')) ? 0 : 1;
+?>);
</script>
</form>
\$wgSitename = \"{$slconf['Sitename']}\";
-\$wgScriptPath = \"{$slconf['ScriptPath']}\";
+\$wgScriptPath = \"{$slconf['ScriptPath']}\";
\$wgScript = \"\$wgScriptPath/index.php\";
\$wgRedirectScript = \"\$wgScriptPath/redirect.php\";
}
echo "\t\t<input $xtype name=\"$field\" id=\"$id\" class=\"iput-$type\" $checked ";
if ($onclick) {
- echo " onclick='toggleDBarea(\"$value\")' " ;
+ echo " onclick='toggleDBarea(\"$value\",1)' " ;
}
echo "value=\"";
if( $type == "radio" ) {
if ( !function_exists( 'fsockopen' ) ) {
$errstr = "Can't connect to memcached, fsockopen() not present";
}
- if ( !$errstr && count( $hostport ) != 2 ) {
+ if ( !$errstr && count( $hostport ) != 2 ) {
$errstr = 'Please specify host and port';
var_dump( $hostport );
}