diff options
| author | Meik Sievertsen <acydburn@phpbb.com> | 2009-01-21 17:03:00 +0000 |
|---|---|---|
| committer | Meik Sievertsen <acydburn@phpbb.com> | 2009-01-21 17:03:00 +0000 |
| commit | 9f060eba6eb8f2e54f5c26cc23c4f82eee7903b8 (patch) | |
| tree | fb92caada98efb76568a64d2492b59cd17442934 /phpBB/includes | |
| parent | dcd073bb44136ac0d22ade2a5ecf759e7e2ae3bc (diff) | |
| download | forums-9f060eba6eb8f2e54f5c26cc23c4f82eee7903b8.tar forums-9f060eba6eb8f2e54f5c26cc23c4f82eee7903b8.tar.gz forums-9f060eba6eb8f2e54f5c26cc23c4f82eee7903b8.tar.bz2 forums-9f060eba6eb8f2e54f5c26cc23c4f82eee7903b8.tar.xz forums-9f060eba6eb8f2e54f5c26cc23c4f82eee7903b8.zip | |
some adjustements to the installer
git-svn-id: file:///svn/phpbb/trunk@9284 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes')
| -rw-r--r-- | phpBB/includes/core/core.php | 10 | ||||
| -rw-r--r-- | phpBB/includes/functions.php | 21 | ||||
| -rw-r--r-- | phpBB/includes/functions_install.php | 81 |
3 files changed, 77 insertions, 35 deletions
diff --git a/phpBB/includes/core/core.php b/phpBB/includes/core/core.php index 09b6365da2..36fef1fccc 100644 --- a/phpBB/includes/core/core.php +++ b/phpBB/includes/core/core.php @@ -100,6 +100,16 @@ abstract class phpbb 'installed' => false, ); + /** + * @var array Last notice occurred in message handler + */ + public static $last_notice = array( + 'file' => '', + 'line' => 0, + 'message' => '', + 'errno' => E_NOTICE, + ); + /**#@+ * Permission constant */ diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 1f6e7bcae7..e304edee0c 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -2006,18 +2006,27 @@ function msg_handler($errno, $msg_text, $errfile, $errline) { global $msg_title, $msg_long_text; - // Do not display notices if we suppress them via @ - if (error_reporting() == 0) - { - return; - } - // Message handler is stripping text. In case we need it, we are able to define long text... if (isset($msg_long_text) && $msg_long_text && !$msg_text) { $msg_text = $msg_long_text; } + // Store information for later use + phpbb::$last_notice = array( + 'file' => $errfile, + 'line' => $errline, + 'message' => $msg_text, + 'php_error' => (!empty($php_errormsg)) ? $php_errormsg : '', + 'errno' => $errno, + ); + + // Do not display notices if we suppress them via @ + if (error_reporting() == 0) + { + return; + } + switch ($errno) { case E_NOTICE: diff --git a/phpBB/includes/functions_install.php b/phpBB/includes/functions_install.php index 16c10312ce..53be92ac14 100644 --- a/phpBB/includes/functions_install.php +++ b/phpBB/includes/functions_install.php @@ -70,8 +70,8 @@ function get_available_dbms($dbms = false, $return_unavailable = false, $only_30 '3.0.x' => true, ), 'mssql_2005'=> array( - 'LABEL' => 'MS SQL Server [ 2005 ]', - 'MODULE' => 'sqlsrv', + 'LABEL' => 'MS SQL Server [ 2005/2008 ]', + 'MODULE' => array('sqlsrv', 'sqlsrv_ts'), 'DRIVER' => 'mssql_2005', 'AVAILABLE' => true, '3.0.x' => true, @@ -118,6 +118,8 @@ function get_available_dbms($dbms = false, $return_unavailable = false, $only_30 } } + $any_db_support = false; + // now perform some checks whether they are really available foreach ($available_dbms as $db_name => $db_ary) { @@ -136,21 +138,34 @@ function get_available_dbms($dbms = false, $return_unavailable = false, $only_30 $dll = $db_ary['MODULE']; - if (!@extension_loaded($dll)) + if (!is_array($dll)) { - if (!can_load_dll($dll)) + $dll = array($dll); + } + + $is_available = false; + foreach ($dll as $test_dll) + { + if (@extension_loaded($test_dll) || can_load_dll($test_dll)) { - if ($return_unavailable) - { - $available_dbms[$db_name]['AVAILABLE'] = false; - } - else - { - unset($available_dbms[$db_name]); - } - continue; + $is_available = true; + break; } } + + if (!$is_available) + { + if ($return_unavailable) + { + $available_dbms[$db_name]['AVAILABLE'] = false; + } + else + { + unset($available_dbms[$db_name]); + } + continue; + } + $any_db_support = true; } @@ -343,21 +358,21 @@ function connect_check_db($dbms_details, $table_prefix, $dbhost, $dbuser, $dbpas case 'mysql': if (version_compare($db->sql_server_info(true), '4.1.3', '<')) { - $error[] = phpbb::$user->lang['INST_ERR_DB_NO_MYSQL']; + $error[] = phpbb::$user->lang['INST_ERR_DB_MYSQL_VERSION']; } break; case 'mysqli': if (version_compare($db->sql_server_info(true), '4.1.3', '<')) { - $error[] = phpbb::$user->lang['INST_ERR_DB_NO_MYSQLI']; + $error[] = phpbb::$user->lang['INST_ERR_DB_MYSQLI_VERSION']; } break; case 'sqlite': if (version_compare($db->sql_server_info(true), '2.8.2', '<')) { - $error[] = phpbb::$user->lang['INST_ERR_DB_NO_SQLITE']; + $error[] = phpbb::$user->lang['INST_ERR_DB_SQLITE_VERSION']; } break; @@ -369,7 +384,7 @@ function connect_check_db($dbms_details, $table_prefix, $dbhost, $dbuser, $dbpas preg_match('#V([\d.]+)#', $val, $match); if ($match[1] < 2) { - $error[] = phpbb::$user->lang['INST_ERR_DB_NO_FIREBIRD']; + $error[] = phpbb::$user->lang['INST_ERR_DB_FIREBIRD_VERSION']; } $db_info = @ibase_db_info($db->service_handle, $dbname, IBASE_STS_HDR_PAGES); @@ -383,9 +398,9 @@ function connect_check_db($dbms_details, $table_prefix, $dbhost, $dbuser, $dbpas else { $sql = "SELECT * - FROM RDB$FUNCTIONS - WHERE RDB$SYSTEM_FLAG IS NULL - AND RDB$FUNCTION_NAME = 'CHAR_LENGTH'"; + FROM RDB\$FUNCTIONS + WHERE RDB\$SYSTEM_FLAG IS NULL + AND RDB\$FUNCTION_NAME = 'CHAR_LENGTH'"; $result = $db->sql_query($sql); $row = $db->sql_fetchrow($result); $db->sql_freeresult($result); @@ -393,7 +408,7 @@ function connect_check_db($dbms_details, $table_prefix, $dbhost, $dbuser, $dbpas // if its a UDF, its too old if ($row) { - $error[] = phpbb::$user->lang['INST_ERR_DB_NO_FIREBIRD']; + $error[] = phpbb::$user->lang['INST_ERR_DB_FIREBIRD_VERSION']; } else { @@ -402,7 +417,7 @@ function connect_check_db($dbms_details, $table_prefix, $dbhost, $dbuser, $dbpas $result = $db->sql_query($sql); if (!$result) // This can only fail if char_length is not defined { - $error[] = phpbb::$user->lang['INST_ERR_DB_NO_FIREBIRD']; + $error[] = phpbb::$user->lang['INST_ERR_DB_FIREBIRD_VERSION']; } $db->sql_freeresult($result); } @@ -456,7 +471,7 @@ function connect_check_db($dbms_details, $table_prefix, $dbhost, $dbuser, $dbpas if (version_compare($stats['NLS_RDBMS_VERSION'], '9.2', '<')) { - $error[] = phpbb::$user->lang['INST_ERR_DB_NO_ORACLE']; + $error[] = phpbb::$user->lang['INST_ERR_DB_ORACLE_VERSION']; } if ($stats['NLS_CHARACTERSET'] !== 'AL32UTF8') @@ -466,14 +481,22 @@ function connect_check_db($dbms_details, $table_prefix, $dbhost, $dbuser, $dbpas break; case 'postgres': - $sql = "SHOW server_encoding;"; - $result = $db->sql_query($sql); - $row = $db->sql_fetchrow($result); - $db->sql_freeresult($result); - if ($row['server_encoding'] !== 'UNICODE' && $row['server_encoding'] !== 'UTF8') + if (version_compare($db->sql_server_info(true), '8.2', '<')) + { + $error[] = phpbb::$user->lang['INST_ERR_DB_POSTGRES_VERSION']; + } + else { - $error[] = phpbb::$user->lang['INST_ERR_DB_NO_POSTGRES']; + $sql = "SHOW server_encoding;"; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if ($row['server_encoding'] !== 'UNICODE' && $row['server_encoding'] !== 'UTF8') + { + $error[] = phpbb::$user->lang['INST_ERR_DB_NO_POSTGRES_UTF8']; + } } break; |
