Skip to content

Commit

Permalink
Remove code that is no longer needed when using PHP >= 5.5.0
Browse files Browse the repository at this point in the history
Fixes #23381
  • Loading branch information
atrol committed Sep 25, 2017
1 parent eebaef1 commit 677c247
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 31 deletions.
14 changes: 0 additions & 14 deletions admin/check/check_php_inc.php
Expand Up @@ -197,20 +197,6 @@
}
}

if( is_windows_server() ) {
check_print_test_warn_row(
'There is a performance issue on windows for PHP versions < 5.4 in openssl_random_pseudo_bytes',
version_compare( phpversion(), '5.4.0', '>=' ),
array( false => 'For best performance upgrade to PHP > 5.4.0.' )
);
}

check_print_test_warn_row(
'Check for php bug 61443 - php 5.4.0-5.4.3, trying to use compression with no output handler set',
!(ini_get( 'output_handler' ) == '' && function_exists( 'ini_set' ) &&
version_compare( PHP_VERSION, '5.4.0', '>=' ) && version_compare( PHP_VERSION, '5.4.4', '<' ) ),
array( false=> 'you should consider setting a php output handler, ensuring compression is disabled or upgrading to at least php 5.4.4' ) );

check_print_test_warn_row(
'webserver: check SCRIPT_NAME is returned to PHP by web server',
isset( $_SERVER['SCRIPT_NAME'] ),
Expand Down
7 changes: 1 addition & 6 deletions admin/install.php
Expand Up @@ -246,7 +246,7 @@ function print_test( $p_test_description, $p_result, $p_hard_fail = true, $p_mes

if( $f_db_type == 'mssql' ) {
print_test( 'Checking PHP support for Microsoft SQL Server driver',
version_compare( phpversion(), '5.3' ) < 0, true,
BAD, true,
'mssql driver is no longer supported in PHP >= 5.3, please use mssqlnative instead' );
}
}
Expand Down Expand Up @@ -578,15 +578,10 @@ function print_test( $p_test_description, $p_result, $p_hard_fail = true, $p_mes
# Build selection list of available DB types
$t_db_list = array(
'mysqli' => 'MySQL Improved',
'mysql' => 'MySQL',
'mssqlnative' => 'Microsoft SQL Server Native Driver',
'pgsql' => 'PostgreSQL',
'oci8' => 'Oracle',
);
# mysql is deprecated as of PHP 5.5.0
if( version_compare( phpversion(), '5.5.0' ) >= 0 ) {
unset( $t_db_list['mysql']);
}

foreach( $t_db_list as $t_db => $t_db_descr ) {
echo '<option value="' . $t_db . '"' .
Expand Down
11 changes: 0 additions & 11 deletions core/database_api.php
Expand Up @@ -186,18 +186,12 @@ function db_is_connected() {
*/
function db_check_database_support( $p_db_type ) {
switch( $p_db_type ) {
case 'mysql':
$t_support = function_exists( 'mysql_connect' );
break;
case 'mysqli':
$t_support = function_exists( 'mysqli_connect' );
break;
case 'pgsql':
$t_support = function_exists( 'pg_connect' );
break;
case 'mssql':
$t_support = function_exists( 'mssql_connect' );
break;
case 'mssqlnative':
$t_support = function_exists( 'sqlsrv_connect' );
break;
Expand All @@ -220,14 +214,12 @@ function db_check_database_support( $p_db_type ) {
*/
function db_get_type( $p_driver_type ) {
switch( $p_driver_type ) {
case 'mysql':
case 'mysqli':
return DB_TYPE_MYSQL;
case 'postgres':
case 'postgres7':
case 'pgsql':
return DB_TYPE_PGSQL;
case 'mssql':
case 'mssqlnative':
case 'odbc_mssql':
return DB_TYPE_MSSQL;
Expand Down Expand Up @@ -717,12 +709,10 @@ function db_prepare_string( $p_string ) {
$t_db_type = config_get_global( 'db_type' );

switch( $t_db_type ) {
case 'mssql':
case 'mssqlnative':
case 'odbc_mssql':
case 'ado_mssql':
return addslashes( $p_string );
case 'mysql':
case 'mysqli':
$t_escaped = $g_db->qstr( $p_string, false );
return utf8_substr( $t_escaped, 1, utf8_strlen( $t_escaped ) - 2 );
Expand Down Expand Up @@ -751,7 +741,6 @@ function db_prepare_binary_string( $p_string ) {
$t_db_type = config_get_global( 'db_type' );

switch( $t_db_type ) {
case 'mssql':
case 'odbc_mssql':
case 'ado_mssql':
$t_content = unpack( 'H*hex', $p_string );
Expand Down

0 comments on commit 677c247

Please sign in to comment.