Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: mantisbt/mantisbt
base: 328a6322770c
...
head fork: mantisbt/mantisbt
compare: 49d4e76c05cd
Checking mergeability… Don't worry, you can still create the pull request.
  • 2 commits
  • 6 files changed
  • 0 commit comments
  • 1 contributor
Commits on Feb 13, 2014
@dregad dregad Change default from mysql to mysqli
The mysql extension is deprecated as of PHP 5.5.0 [1] so we use mysqli
as our default database type.

Commit includes relevant changes in installer, admin checks and
documentation (admin guide).

Fixes #16941

[1] http://php.net/intro.mysql
c13c74b
@dregad dregad db_prepare_string() remove special handling for mysql
Since ADOdb's qstr() method calls mysql_real_escape_string() /
mysql_real_escape_string() depending on driver type, it does not make
sense to have special logic within database api to handle mysql
differently from mysqli. Let ADOdb quote the string.
49d4e76
View
10 admin/check/check_database_inc.php
@@ -91,11 +91,19 @@
. '. The version of PHP installed on this server does not have support for this database type.' )
);
+if( db_is_mysql() ) {
+ check_print_test_warn_row(
+ 'PHP support for MySQL driver',
+ 'mysql' != $t_database_type,
+ array( false => "'mysql' driver is deprecated as of PHP 5.5.0, please use 'mysqli' instead" )
+ );
+}
+
if ( db_is_mssql() ) {
check_print_test_warn_row(
'PHP support for Microsoft SQL Server driver',
- 'mssql' != config_get_global( 'db_type' ),
+ 'mssql' != $t_database_type,
array( false => "'mssql' driver is no longer supported in PHP >= 5.3, please use 'mssqlnative' instead" )
);
View
13 admin/install.php
@@ -522,18 +522,21 @@ function print_test( $p_test_description, $p_result, $p_hard_fail = true, $p_mes
<select id="db_type" name="db_type">
<?php
- // Build selection list of available DB types
+ # Build selection list of available DB types
$t_db_list = array(
- 'mysql' => 'MySQL (default)',
- 'mysqli' => 'MySQLi',
+ 'mysqli' => 'MySQL Improved',
+ 'mysql' => 'MySQL',
'mssql' => 'Microsoft SQL Server',
'mssqlnative' => 'Microsoft SQL Server Native Driver',
'pgsql' => 'PostgreSQL',
'oci8' => 'Oracle',
'db2' => 'IBM DB2',
);
-
- // mssql is not supported with PHP >= 5.3
+ # mysql is deprecated as of PHP 5.5.0
+ if( version_compare( phpversion(), '5.5.0' ) >= 0 ) {
+ unset( $t_db_list['mysql']);
+ }
+ # mssql is not supported with PHP >= 5.3
if( version_compare( phpversion(), '5.3' ) >= 0 ) {
unset( $t_db_list['mssql']);
}
View
6 config_defaults_inc.php
@@ -74,8 +74,8 @@
*
* RDBMS db_type PHP ext Comments
* ----- ------- ------- --------
- * MySQL mysql mysql default
- * mysqli mysqli
+ * MySQL mysql mysql
+ * mysqli mysqli default
* PostgreSQL pgsql pgsql
* MS SQL Server mssqlnative sqlsrv experimental
* Oracle oci8 oci8 experimental
@@ -83,7 +83,7 @@
*
* @global string $g_db_type
*/
-$g_db_type = 'mysql';
+$g_db_type = 'mysqli';
/**
* adodb Data Source Name
View
3  core/database_api.php
@@ -698,10 +698,7 @@ function db_prepare_string( $p_string ) {
return utf8_substr( $t_escaped, 1, utf8_strlen( $t_escaped ) - 2 );
break;
case 'mysql':
- return mysql_real_escape_string( $p_string );
case 'mysqli':
- # For some reason mysqli_escape_string( $p_string ) always returns an empty
- # string. This is happening with PHP v5.0.2.
$t_escaped = $g_db->qstr( $p_string, false );
return utf8_substr( $t_escaped, 1, utf8_strlen( $t_escaped ) - 2 );
case 'postgres':
View
10 docbook/Admin_Guide/en-US/Configuration.xml
@@ -74,14 +74,14 @@
<tbody>
<row>
<entry morerows='1' valign='middle'>MySQL</entry>
- <entry>mysql</entry>
- <entry>mysql</entry>
+ <entry>mysqli</entry>
+ <entry>mysqli</entry>
<entry>default</entry>
</row>
<row>
- <entry>mysqli</entry>
- <entry>mysqli</entry>
- <entry></entry>
+ <entry>mysql</entry>
+ <entry>mysql</entry>
+ <entry>Deprecated as of PHP 5.5.0</entry>
</row>
<row>
<entry>PostgreSQL</entry>
View
2  docbook/Admin_Guide/en-US/Installation.xml
@@ -259,7 +259,7 @@
<entry>MySQL</entry>
<entry>5.0.8</entry>
<entry>5.5.x or above</entry>
- <entry>PHP extension: mysql/mysqli</entry>
+ <entry>PHP extension: mysqli (recommended) or mysql</entry>
</row>
<row>
<entry>PostgreSQL</entry>

No commit comments for this range

Something went wrong with that request. Please try again.