simplified the error handling settings under php4

This commit is contained in:
Loïc Chapeaux
2001-11-21 20:55:06 +00:00
parent 28341df0e7
commit becb93a963

View File

@@ -288,7 +288,7 @@ if (!defined('__LIB_COMMON__')){
* @return integer the rank of the $toFind string in the array or '-1' if * @return integer the rank of the $toFind string in the array or '-1' if
* it hasn't been found * it hasn't been found
* *
* @access public * @access public
*/ */
function pmaIsInto($toFind = '', &$in) function pmaIsInto($toFind = '', &$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);
} }
@@ -774,7 +770,7 @@ if (!defined('__LIB_COMMON__')){
// IE6 and other browsers for win case // IE6 and other browsers for win case
else if (USR_OS == 'Win') { else if (USR_OS == 'Win') {
$font_size = 'small'; $font_size = 'small';
$font_bigger = 'large '; $font_bigger = 'large';
$font_smaller = (USR_BROWSER_AGENT == 'IE') $font_smaller = (USR_BROWSER_AGENT == 'IE')
? '90%' ? '90%'
: 'x-small'; : 'x-small';
@@ -785,14 +781,14 @@ if (!defined('__LIB_COMMON__')){
&& ((USR_BROWSER_AGENT != 'IE' && USR_BROWSER_AGENT != 'MOZILLA') && ((USR_BROWSER_AGENT != 'IE' && USR_BROWSER_AGENT != 'MOZILLA')
|| USR_BROWSER_VER < 5)) { || USR_BROWSER_VER < 5)) {
$font_size = 'medium'; $font_size = 'medium';
$font_bigger = 'x-large '; $font_bigger = 'x-large';
$font_smaller = 'small'; $font_smaller = 'small';
$font_smallest = 'x-small'; $font_smallest = 'x-small';
} }
// Other cases // Other cases
else { else {
$font_size = 'small'; $font_size = 'small';
$font_bigger = 'large '; $font_bigger = 'large';
$font_smaller = 'x-small'; $font_smaller = 'x-small';
$font_smallest = 'x-small'; $font_smallest = 'x-small';
} }