}
}
+ 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');
}
}
- 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;
}
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 {
$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) {
echo '<script type="text/javascript" defer="defer">window.onload=toggledbinfo;</script>';
echo '<div id="mysql" name="mysql">' . get_string('databasesettingssub_mysql', 'install') . '</div>';
+ echo '<div id="mysqli" name="mysqli">' . get_string('databasesettingssub_mysqli', 'install') . '</div>';
+
echo '<div id="postgres7" name="postgres7">' . get_string('databasesettingssub_postgres7', 'install') . '</div>';
echo '<div id="mssql" name="mssql">' . get_string('databasesettingssub_mssql', 'install');
<td class="td_left"><p><?php print_string('dbtype', 'install') ?></p></td>
<td class="td_right">
<?php choose_from_menu (array('mysql' => get_string('mysql', 'install'),
+ 'mysqli' => get_string('mysqli', 'install'),
'oci8po' => get_string('oci8po', 'install'),
'postgres7' => get_string('postgres7', 'install'),
'mssql' => get_string('mssql', 'install'),
padding:0px;
margin:0px;
}
- #mysql, #postgres7, #mssql, #mssql_n, #odbc_mssql, #oci8po {
+ #mysql, #mysqli, #postgres7, #mssql, #mssql_n, #odbc_mssql, #oci8po {
display: none;
}
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 = '';
//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 = '';
//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 = '';
<b>User:</b> your database username<br />
<b>Password:</b> your database password<br />
<b>Tables Prefix:</b> prefix to use for all table names (optional)';
+$string['databasesettingssub_mysqli'] = '<b>Type:</b> Improved MySQL<br />
+ <b>Host:</b> eg localhost or db.isp.com<br />
+ <b>Name:</b> database name, eg moodle<br />
+ <b>User:</b> your database username<br />
+ <b>Password:</b> your database password<br />
+ <b>Tables Prefix:</b> prefix to use for all table names (optional)';
$string['databasesettingssub_oci8po'] = '<b>Type:</b> Oracle<br />
<b>Host:</b> not used, must be left blank<br />
<b>Name:</b> given name of the tnsnames.ora connection<br />
$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)';