|
From: FlorinCB <ory...@us...> - 2008-09-30 07:05:55
|
Update of /cvsroot/mxbb/core/install/includes In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv26368/install/includes Modified Files: functions_install.php Log Message: rewrite for php4 and php6 issues Index: functions_install.php =================================================================== RCS file: /cvsroot/mxbb/core/install/includes/functions_install.php,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** functions_install.php 17 Sep 2008 08:24:23 -0000 1.19 --- functions_install.php 30 Sep 2008 07:04:45 -0000 1.20 *************** *** 315,324 **** function connect_check_db($error_connect, &$error, $dbms, $table_prefix, $dbhost, $dbuser, $dbpasswd, $dbname, $dbport, $prefix_may_exist = false, $load_dbal = true, $unicode_check = true) { ! global $phpbb_root_path, $phpEx, $config, $lang; if ($load_dbal) { // Include the DB layer ! require_once($mx_root_path . 'includes/db/' . $dbms['DRIVER'] . '.' . $phpEx); } --- 315,334 ---- function connect_check_db($error_connect, &$error, $dbms, $table_prefix, $dbhost, $dbuser, $dbpasswd, $dbname, $dbport, $prefix_may_exist = false, $load_dbal = true, $unicode_check = true) { ! global $phpbb_root_path, $phpEx, $config, $lang; $mx_php_version; if ($load_dbal) { // Include the DB layer ! // If we are on PHP < 5.0.0 we need to force include or we get a blank page ! if (version_compare(PHP_VERSION, '5.0.0', '<')) ! { ! global $mx_php_version; ! ! $dbms = 'mysqli' ? 'mysql4' : $dbms; //this version of php does not have mysqli extension and my crash the installer if finds a forum using this ! ! print("This version of php is not supported, returned: " . PHP_VERSION . "<br />Please upgrade at least to $mx_php_version.<br />"); ! ! } ! require_once($mx_root_path . 'includes/db/' . $dbms . '.' . $phpEx); // Load dbal and initiate class } *************** *** 857,860 **** --- 867,876 ---- install_die(GENERAL_ERROR, 'Configuration file ' . $config . ' couldn\'t be opened.'); } + + // If we are on PHP < 5.0.0 we need to force include or we get a blank page + if (version_compare(PHP_VERSION, '5.0.0', '<')) + { + $dbms = str_replace('mysqli', 'mysql4', $dbms); //this version of php does not have mysqli extension and my crash the installer if finds a forum using this + } return array( *************** *** 877,881 **** install_die(GENERAL_ERROR, 'Configuration file ' . $config . ' couldn\'t be opened.'); } ! return array( 'dbms' => $dbms, --- 893,897 ---- install_die(GENERAL_ERROR, 'Configuration file ' . $config . ' couldn\'t be opened.'); } ! return array( 'dbms' => $dbms, *************** *** 924,928 **** { global $mx_root_path, $phpEx; ! if( !defined('BEGIN_TRANSACTION') ) { --- 940,944 ---- { global $mx_root_path, $phpEx; ! if( !defined('BEGIN_TRANSACTION') ) { *************** *** 939,951 **** // If we are on PHP < 5.0.0 we need to force include or we get a blank page ! if (phpversion() < '5.0.0-dev') ! { ! print("This version of php is not supported, returned: " . phpversion() . '<br />Please upgrade at least to 5.1.2.'); ! require_once($mx_root_path . 'includes/db/' . $dbms . '.' . $phpEx); // Load dbal and initiate class ! } ! else ! { ! require_once($mx_root_path . 'includes/db/' . $dbms . '.' . $phpEx); // Load dbal and initiate class } if(!$db->db_connect_id) { --- 955,967 ---- // If we are on PHP < 5.0.0 we need to force include or we get a blank page ! if (version_compare(PHP_VERSION, '5.0.0', '<')) ! { ! $dbms = str_replace('mysqli', 'mysql4', $dbms); //this version of php does not have mysqli extension and my crash the installer if finds a forum using this } + + // Load dbal and initiate class + //Apache 2.0.x and php < 5.2.5 combination will crash here this is fixed by upgrading to php 5.2.6 or Apache 2.2.x + require_once($mx_root_path . 'includes/db/' . $dbms . '.' . $phpEx); + if(!$db->db_connect_id) { *************** *** 953,959 **** @define('SQL_LAYER', $dbms); $sql_db = 'dbal_' . $dbms; ! $db = new $sql_db(); ! if(!is_object($db)) { --- 969,975 ---- @define('SQL_LAYER', $dbms); $sql_db = 'dbal_' . $dbms; ! $db = new $sql_db(); ! if(!is_object($db)) { |