From: Max Semenik Date: Tue, 20 Oct 2009 18:21:08 +0000 (+0000) Subject: (bug 20242) Installer no longer promts for user credentials for SQLite databases X-Git-Tag: 1.31.0-rc.0~39217 X-Git-Url: http://git.cyclocoop.org/%28?a=commitdiff_plain;h=e869694cd666b5f39b26abd6fbc869208ccf4f12;p=lhc%2Fweb%2Fwiklou.git (bug 20242) Installer no longer promts for user credentials for SQLite databases --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 72fbe638f4..0f00ecf138 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -572,6 +572,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN on SQLite backend * (bug 20880) Fixed updater failure on SQLite backend * (bug 21182) Fixed invalid HTML in Special:Listgrouprights +* (bug 20242) Installer no longer promts for user credentials for SQLite databases == API changes in 1.16 == diff --git a/config/Installer.php b/config/Installer.php index 13ccc25ab0..f1196403a4 100644 --- a/config/Installer.php +++ b/config/Installer.php @@ -44,6 +44,8 @@ require_once( "$IP/includes/ProfilerStub.php" ); require_once( "$IP/includes/GlobalFunctions.php" ); require_once( "$IP/includes/Hooks.php" ); require_once( "$IP/includes/Exception.php" ); +require_once( "$IP/includes/json/Services_JSON.php" ); +require_once( "$IP/includes/json/FormatJson.php" ); # If we get an exception, the user needs to know # all the details @@ -53,41 +55,60 @@ wfInstallExceptionHandler(); ## Databases we support: $ourdb = array(); -$ourdb['mysql']['fullname'] = 'MySQL'; -$ourdb['mysql']['havedriver'] = 0; -$ourdb['mysql']['compile'] = 'mysql'; -$ourdb['mysql']['bgcolor'] = '#ffe5a7'; -$ourdb['mysql']['rootuser'] = 'root'; - -$ourdb['postgres']['fullname'] = 'PostgreSQL'; -$ourdb['postgres']['havedriver'] = 0; -$ourdb['postgres']['compile'] = 'pgsql'; -$ourdb['postgres']['bgcolor'] = '#aaccff'; -$ourdb['postgres']['rootuser'] = 'postgres'; - -$ourdb['sqlite']['fullname'] = 'SQLite'; -$ourdb['sqlite']['havedriver'] = 0; -$ourdb['sqlite']['compile'] = 'pdo_sqlite'; -$ourdb['sqlite']['bgcolor'] = '#b1ebb1'; -$ourdb['sqlite']['rootuser'] = ''; - -$ourdb['mssql']['fullname'] = 'MSSQL'; -$ourdb['mssql']['havedriver'] = 0; -$ourdb['mssql']['compile'] = 'mssql not ready'; # Change to 'mssql' after includes/DatabaseMssql.php added; -$ourdb['mssql']['bgcolor'] = '#ffc0cb'; -$ourdb['mssql']['rootuser'] = 'administrator'; - -$ourdb['ibm_db2']['fullname'] = 'DB2'; -$ourdb['ibm_db2']['havedriver'] = 0; -$ourdb['ibm_db2']['compile'] = 'ibm_db2'; -$ourdb['ibm_db2']['bgcolor'] = '#ffeba1'; -$ourdb['ibm_db2']['rootuser'] = 'db2admin'; - -$ourdb['oracle']['fullname'] = 'Oracle'; -$ourdb['oracle']['havedriver'] = 0; -$ourdb['oracle']['compile'] = 'oci8'; -$ourdb['oracle']['bgcolor'] = '#ffeba1'; -$ourdb['oracle']['rootuser'] = ''; + +$ourdb['mysql'] = array( + 'fullname' => 'MySQL', + 'havedriver' => 0, + 'compile' => 'mysql', + 'bgcolor' => '#ffe5a7', + 'rootuser' => 'root', + 'serverless' => false +); + +$ourdb['postgres'] = array( + 'fullname' => 'PostgreSQL', + 'havedriver' => 0, + 'compile' => 'pgsql', + 'bgcolor' => '#aaccff', + 'rootuser' => 'postgres', + 'serverless' => false +); + +$ourdb['sqlite'] = array( + 'fullname' => 'SQLite', + 'havedriver' => 0, + 'compile' => 'pdo_sqlite', + 'bgcolor' => '#b1ebb1', + 'rootuser' => '', + 'serverless' => true +); + +$ourdb['mssql'] = array( + 'fullname' => 'MSSQL', + 'havedriver' => 0, + 'compile' => 'mssql_not_ready', # Change to 'mssql' after includes/DatabaseMssql.php added; + 'bgcolor' => '#ffc0cb', + 'rootuser' => 'administrator', + 'serverless' => false +); + +$ourdb['ibm_db2'] = array( + 'fullname' => 'DB2', + 'havedriver' => 0, + 'compile' => 'ibm_db2', + 'bgcolor' => '#ffeba1', + 'rootuser' => 'db2admin', + 'serverless' => false +); + +$ourdb['oracle'] = array( + 'fullname' => 'Oracle', + 'havedriver' => 0, + 'compile' => 'oci8', + 'bgcolor' => '#ffeba1', + 'rootuser' => '', + 'serverless' => false +); ?> @@ -178,6 +199,7 @@ $ourdb['oracle']['rootuser'] = ''; font-size: 110%; color: green; } + .success-box { font-size: 130%; } @@ -185,23 +207,25 @@ $ourdb['oracle']['rootuser'] = ''; @@ -664,17 +688,19 @@ $errs = array(); if( preg_match( '/^$|^mediawiki$|#/i', $conf->Sitename ) ) { $errs["Sitename"] = "Must not be blank or \"MediaWiki\" and may not contain \"#\""; } -if( $conf->DBuser == "" ) { - $errs["DBuser"] = "Must not be blank"; -} -if( ($conf->DBtype == 'mysql') && (strlen($conf->DBuser) > 16) ) { - $errs["DBuser"] = "Username too long"; -} -if( $conf->DBpassword == "" && $conf->DBtype != "postgres" ) { - $errs["DBpassword"] = "Must not be blank"; -} -if( $conf->DBpassword != $conf->DBpassword2 ) { - $errs["DBpassword2"] = "Passwords don't match!"; +if( !$ourdb[$conf->DBtype]['serverless'] ) { + if( $conf->DBuser == "" ) { + $errs["DBuser"] = "Must not be blank"; + } + if( ($conf->DBtype == 'mysql') && (strlen($conf->DBuser) > 16) ) { + $errs["DBuser"] = "Username too long"; + } + if( $conf->DBpassword == "" && $conf->DBtype != "postgres" ) { + $errs["DBpassword"] = "Must not be blank"; + } + if( $conf->DBpassword != $conf->DBpassword2 ) { + $errs["DBpassword2"] = "Passwords don't match!"; + } } if( !preg_match( '/^[A-Za-z_0-9]*$/', $conf->DBprefix ) ) { $errs["DBprefix"] = "Invalid table prefix"; @@ -1543,38 +1569,42 @@ if( count( $errs ) ) { ?> -
- +
+
+ +
+

+ If your database server isn't on your web server, enter the name or IP address here. +

-

- If your database server isn't on your web server, enter the name or IP address here. -

- -
-
-
-
-

- If you only have a single user account and database available, - enter those here. If you have database root access (see below) - you can specify new accounts/databases to be created. This account - will not be created if it pre-exists. If this is the case, ensure that it - has SELECT, INSERT, UPDATE, and DELETE permissions on the MediaWiki database. -

-
- - checked="checked" /> -   +
+
+
+
+
+

+ If you only have a single user account and database available, + enter those here. If you have database root access (see below) + you can specify new accounts/databases to be created. This account + will not be created if it pre-exists. If this is the case, ensure that it + has SELECT, INSERT, UPDATE, and DELETE permissions on the MediaWiki database. +

+ +
+ + checked="checked" /> +   +
+
+
+ +

+ If the database user specified above does not exist, or does not have access to create + the database (if needed) or tables within it, please check the box and provide details + of a superuser account, such as root, which does. +

-
-
- -

- If the database user specified above does not exist, or does not have access to create - the database (if needed) or tables within it, please check the box and provide details - of a superuser account, such as root, which does. -

@@ -2194,7 +2224,7 @@ function database_switcher($db) { global $ourdb; $color = $ourdb[$db]['bgcolor']; $full = $ourdb[$db]['fullname']; - print "
$full specific options\n"; + print "
$full-specific options\n"; } function printListItem( $item ) {