simplified the error handling settings under php4
This commit is contained in:
@@ -465,12 +465,15 @@ if (!defined('__LIB_COMMON__')){
|
||||
}
|
||||
} // end if
|
||||
|
||||
if (PHP_INT_VERSION >= 40000) {
|
||||
$bkp_track_err = @ini_set('track_errors', 1);
|
||||
}
|
||||
|
||||
// Try to connect MySQL with the standard user profile (will be used to
|
||||
// get the privileges list for the current user but the true user link
|
||||
// must be open after this one so it would be default one for all the
|
||||
// scripts)
|
||||
if ($cfgServer['stduser'] != '') {
|
||||
$bkp_track_err = (PHP_INT_VERSION >= 40000) ? @ini_set('track_errors', 1) : '';
|
||||
$dbh = @$connect_func(
|
||||
$cfgServer['host'] . $server_port . $server_socket,
|
||||
$cfgServer['stduser'],
|
||||
@@ -484,21 +487,15 @@ if (!defined('__LIB_COMMON__')){
|
||||
} else {
|
||||
$conn_error = 'Cannot connect: invalid settings.';
|
||||
}
|
||||
if (PHP_INT_VERSION >= 40000) {
|
||||
@ini_set('track_errors', $bkp_track_err);
|
||||
}
|
||||
$local_query = $connect_func . '('
|
||||
. $cfgServer['host'] . $server_port . $server_socket . ', '
|
||||
. $cfgServer['stduser'] . ', '
|
||||
. $cfgServer['stdpass'] . ')';
|
||||
mysql_die($conn_error, $local_query, FALSE);
|
||||
} else if (PHP_INT_VERSION >= 40000) {
|
||||
@ini_set('track_errors', $bkp_track_err);
|
||||
}
|
||||
}
|
||||
} // end if
|
||||
} // end if
|
||||
|
||||
// Connects to the server (validates user's login)
|
||||
$bkp_track_err = (PHP_INT_VERSION >= 40000) ? @ini_set('track_errors', 1) : '';
|
||||
$userlink = @$connect_func(
|
||||
$cfgServer['host'] . $server_port . $server_socket,
|
||||
$cfgServer['user'],
|
||||
@@ -517,15 +514,14 @@ if (!defined('__LIB_COMMON__')){
|
||||
} else {
|
||||
$conn_error = 'Cannot connect: invalid settings.';
|
||||
}
|
||||
if (PHP_INT_VERSION >= 40000) {
|
||||
@ini_set('track_errors', $bkp_track_err);
|
||||
}
|
||||
$local_query = $connect_func . '('
|
||||
. $cfgServer['host'] . $server_port . $server_socket . ', '
|
||||
. $cfgServer['user'] . ', '
|
||||
. $cfgServer['password'] . ')';
|
||||
mysql_die($conn_error, $local_query, FALSE);
|
||||
} else if (PHP_INT_VERSION >= 40000) {
|
||||
} // end if
|
||||
|
||||
if (PHP_INT_VERSION >= 40000) {
|
||||
@ini_set('track_errors', $bkp_track_err);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user