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