return FALSE;
} // END - if
- // Restore PHP's own error handler
- if (!restore_error_handler()) {
- // This is fatal
- reportBug(__FUNCTION__, __LINE__, 'Could not unregister error handler.');
- } // END - if
-
// Try to connect to the database
$linkResource = SQL_CONNECT(postRequestElement('mysql_host'), postRequestElement('mysql_login'), postRequestElement('mysql_password1'), __FUNCTION__, __LINE__);
// Is the link up
if (!is_resource($linkResource)) {
- // Restore own error handler again
- set_error_handler('__errorHandler');
-
// Cannot connect to database
$GLOBALS['installer_post_error'][$currentTab] = '{--INSTALLER_POST_DATABASE_CONNECT_ERROR--}';
array_push($GLOBALS['installer_failed_fields'][$currentTab], 'mysql_login', 'mysql_password1', 'mysql_password2');
// Then attempt to select the database
if (!SQL_SELECT_DB(postRequestElement('mysql_dbase'), __FUNCTION__, __LINE__)) {
- // Restore own error handler again
- set_error_handler('__errorHandler');
-
// Could not find database
$GLOBALS['installer_post_error'][$currentTab] = '{--INSTALLER_POST_DATABASE_SELECT_FAILED--}';
array_push($GLOBALS['installer_failed_fields'][$currentTab], 'mysql_dbase');
setConfigEntry('__DB_NAME' , postRequestElement('mysql_dbase'));
setConfigEntry('_MYSQL_PREFIX', postRequestElement('mysql_prefix'));
- // Restore own error handler again
- set_error_handler('__errorHandler');
-
// Get an array of all supported engines
$engines = getArrayFromSupportedSqlEngines();
// Is this an array?
if (!is_array($engines)) {
- // Restore own error handler again
- set_error_handler('__errorHandler');
-
// Something bad happened
$GLOBALS['installer_post_error'][$currentTab] = '{--INSTALLER_POST_DATABASE_ENGINES_SQL_ERROR--}';
array_push($GLOBALS['installer_failed_fields'][$currentTab], 'mysql_type');
return FALSE;
} elseif (count($engines) == 0) {
- // Restore own error handler again
- set_error_handler('__errorHandler');
-
// No engine is active
$GLOBALS['installer_post_error'][$currentTab] = '{--INSTALLER_POST_DATABASE_NO_ENGINES_ACTIVE--}';
array_push($GLOBALS['installer_failed_fields'][$currentTab], 'mysql_type');
// So, is the engine found?
if ($engineValid === FALSE) {
- // Restore own error handler again
- set_error_handler('__errorHandler');
-
// Requested engine is not active
$GLOBALS['installer_post_error'][$currentTab] = '{--INSTALLER_POST_DATABASE_ENGINE_UNSUPPORTED--}';
array_push($GLOBALS['installer_failed_fields'][$currentTab], 'mysql_type');
// Disconnect here, we don't need idle database connections laying around
SQL_CLOSE(__FUNCTION__, __LINE__);
- // Restore own error handler again
- set_error_handler('__errorHandler');
-
// If the status is true, disconnect the database
if ($isValid === FALSE) {
// Still something bad happened (e.g. tables found)