From: skodak Date: Tue, 21 Aug 2007 10:40:59 +0000 (+0000) Subject: MDL-10930 added mysqli support into installer; it needs install files refresh X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=e102e78a10c0f587d930077938db8b3834ceb404;p=moodle.git MDL-10930 added mysqli support into installer; it needs install files refresh --- diff --git a/install.php b/install.php index 0f55a56ad7..58ef05f9c3 100644 --- a/install.php +++ b/install.php @@ -282,6 +282,13 @@ if ($INSTALL['stage'] == DATABASE) { } } + if ($INSTALL['dbtype'] == 'mysqli') { /// Check MySQLi extension is present + if (!extension_loaded('mysqli')) { + $errormsg = get_string('mysqliextensionisnotpresentinphp', 'install'); + $nextstage = DATABASE; + } + } + if ($INSTALL['dbtype'] == 'postgres7') { /// Check PostgreSQL extension is present if (!extension_loaded('pgsql')) { $errormsg = get_string('pgsqlextensionisnotpresentinphp', 'install'); @@ -317,7 +324,7 @@ if ($INSTALL['stage'] == DATABASE) { } } - if (empty($INSTALL['prefix']) && $INSTALL['dbtype'] != 'mysql') { // All DBs but MySQL require prefix (reserv. words) + if (empty($INSTALL['prefix']) && $INSTALL['dbtype'] != 'mysql' && $INSTALL['dbtype'] != 'mysqli') { // All DBs but MySQL require prefix (reserv. words) $errormsg = get_string('dbwrongprefix', 'install'); $nextstage = DATABASE; } @@ -343,6 +350,7 @@ if ($INSTALL['stage'] == DATABASE) { if ($dbconnected = $db->Connect($INSTALL['dbhost'],$INSTALL['dbuser'],$INSTALL['dbpass'])) { switch ($INSTALL['dbtype']) { /// Try to create a database case 'mysql': + case 'mysqli': if ($db->Execute("CREATE DATABASE {$INSTALL['dbname']};")) { $dbconnected = $db->Connect($INSTALL['dbhost'],$INSTALL['dbuser'],$INSTALL['dbpass'],$INSTALL['dbname']); } else { @@ -358,6 +366,7 @@ if ($INSTALL['stage'] == DATABASE) { $encoding = ''; switch ($INSTALL['dbtype']) { case 'mysql': + case 'mysqli': /// Get MySQL character_set_database value $rs = $db->Execute("SHOW VARIABLES LIKE 'character_set_database'"); if ($rs && $rs->RecordCount() > 0) { @@ -589,6 +598,8 @@ if (isset($_GET['help'])) { echo ''; echo '
' . get_string('databasesettingssub_mysql', 'install') . '
'; + echo '
' . get_string('databasesettingssub_mysqli', 'install') . '
'; + echo '
' . get_string('databasesettingssub_postgres7', 'install') . '
'; echo '
' . get_string('databasesettingssub_mssql', 'install'); @@ -793,6 +804,7 @@ function form_table($nextstage = WELCOME, $formaction = "install.php") {

get_string('mysql', 'install'), + 'mysqli' => get_string('mysqli', 'install'), 'oci8po' => get_string('oci8po', 'install'), 'postgres7' => get_string('postgres7', 'install'), 'mssql' => get_string('mssql', 'install'), @@ -1201,7 +1213,7 @@ function css_styles() { padding:0px; margin:0px; } - #mysql, #postgres7, #mssql, #mssql_n, #odbc_mssql, #oci8po { + #mysql, #mysqli, #postgres7, #mssql, #mssql_n, #odbc_mssql, #oci8po { display: none; } @@ -1225,6 +1237,7 @@ function toggledbinfo() { if (document.getElementById) { //Hide all the divs document.getElementById('mysql').style.display = ''; + document.getElementById('mysqli').style.display = ''; document.getElementById('postgres7').style.display = ''; document.getElementById('mssql').style.display = ''; document.getElementById('mssql_n').style.display = ''; @@ -1236,6 +1249,7 @@ function toggledbinfo() { //This is the way old msie versions work //Hide all the divs document.all['mysql'].style.display = ''; + document.all['mysqli'].style.display = ''; document.all['postgres7'].style.display = ''; document.all['mssql'].style.display = ''; document.all['mssql_n'].style.display = ''; @@ -1247,6 +1261,7 @@ function toggledbinfo() { //This is the way nn4 works //Hide all the divs document.layers['mysql'].style.display = ''; + document.layers['mysqli'].style.display = ''; document.layers['postgres7'].style.display = ''; document.layers['mssql'].style.display = ''; document.layers['mssql_n'].style.display = ''; diff --git a/install/stringnames.txt b/install/stringnames.txt index 9416d8126c..b0ac9c7401 100644 --- a/install/stringnames.txt +++ b/install/stringnames.txt @@ -34,6 +34,7 @@ databasesettingssub databasesettingssub_mssql databasesettingssub_mssql_n databasesettingssub_mysql +databasesettingssub_mysqli databasesettingssub_oci8po databasesettingssub_odbc_mssql databasesettingssub_postgres7 @@ -97,9 +98,11 @@ mssql mssql_n mssqlextensionisnotpresentinphp mysql +mysqli mysql416bypassed mysql416required mysqlextensionisnotpresentinphp +mysqliextensionisnotpresentinphp name next oci8po diff --git a/lang/en_utf8/install.php b/lang/en_utf8/install.php index 76ce9f5c80..4d4ddf4481 100644 --- a/lang/en_utf8/install.php +++ b/lang/en_utf8/install.php @@ -86,6 +86,12 @@ $string['databasesettingssub_mysql'] = 'Type: MySQL
User: your database username
Password: your database password
Tables Prefix: prefix to use for all table names (optional)'; +$string['databasesettingssub_mysqli'] = 'Type: Improved MySQL
+ Host: eg localhost or db.isp.com
+ Name: database name, eg moodle
+ User: your database username
+ Password: your database password
+ Tables Prefix: prefix to use for all table names (optional)'; $string['databasesettingssub_oci8po'] = 'Type: Oracle
Host: not used, must be left blank
Name: given name of the tnsnames.ora connection
@@ -232,7 +238,9 @@ $string['mssql'] = 'SQL*Server (mssql)'; $string['mssql_n'] = 'SQL*Server with UTF-8 support (mssql_n)'; $string['mssqlextensionisnotpresentinphp'] = 'PHP has not been properly configured with the MSSQL extension so that it can communicate with SQL*Server. Please check your php.ini file or recompile PHP.'; $string['mysql'] = 'MySQL (mysql)'; +$string['mysqli'] = 'Improved MySQL (mysqli)'; $string['mysqlextensionisnotpresentinphp'] = 'PHP has not been properly configured with the MySQL extension so that it can communicate with MySQL. Please check your php.ini file or recompile PHP.'; +$string['mysqliextensionisnotpresentinphp'] = 'PHP has not been properly configured with the MySQLi extension so that it can communicate with MySQL. Please check your php.ini file or recompile PHP. MySQLi extension is not available for PHP 4.'; $string['oci8po'] = 'Oracle (oci8po)'; $string['ociextensionisnotpresentinphp'] = 'PHP has not been properly configured with the OCI8 extension so that it can communicate with Oracle. Please check your php.ini file or recompile PHP.'; $string['odbc_mssql'] = 'SQL*Server over ODBC (odbc_mssql)';