Index: branches/5.2.x/core/units/helpers/language_import_helper.php =================================================================== diff -u -N -r15225 -r15237 --- branches/5.2.x/core/units/helpers/language_import_helper.php (.../language_import_helper.php) (revision 15225) +++ branches/5.2.x/core/units/helpers/language_import_helper.php (.../language_import_helper.php) (revision 15237) @@ -1,6 +1,6 @@ count() ) { + // PHP 5.3 version would be: $languages->count() + if ( count($languages->children()) ) { $this->_processLanguages($languages); } @@ -806,7 +807,8 @@ /* @var $sub_node SimpleXMLElement */ if ( in_array($sub_node->getName(), $container_nodes) ) { - if ( !$sub_node->count() ) { + // PHP 5.3 version would be: !$sub_node->count() + if ( !count($sub_node->children()) ) { continue; } @@ -1062,7 +1064,8 @@ $fields_hash = array_merge($fields_hash, $other_translations[$country_state_id]); $this->Conn->doInsert($fields_hash, $this->_tables['country-state'], 'REPLACE', false); - if ( !$process_states && $country_state_node->count() ) { + // PHP 5.3 version would be: $country_state_node->count() + if ( !$process_states && count($country_state_node->children()) ) { $this->_processCountries($country_state_node, $language_id, $language_encoding, true); } } Index: branches/5.2.x/core/install/prerequisites.php =================================================================== diff -u -N -r15176 -r15237 --- branches/5.2.x/core/install/prerequisites.php (.../prerequisites.php) (revision 15176) +++ branches/5.2.x/core/install/prerequisites.php (.../prerequisites.php) (revision 15237) @@ -1,6 +1,6 @@ ='); + $ret['php_version'] = version_compare(PHP_VERSION, '5.2.0', '>='); $ret['url_rewriting'] = function_exists('apache_get_modules') && in_array('mod_rewrite', apache_get_modules()); $ret['memcache'] = class_exists('Memcache'); $ret['curl'] = function_exists('curl_init'); $ret['simplexml'] = function_exists('simplexml_load_string'); + $ret['spl'] = function_exists('spl_autoload_register'); $ret['freetype'] = function_exists('imagettfbbox'); - $ret['gd_version'] = $ret['jpeg'] = false; + $ret['gd_version'] = false; if ( function_exists('gd_info') ) { $gd_info = gd_info(); - $gd_version = preg_replace('/[^\d.]/', '', $gd_info['GD Version']); $ret['gd_version'] = version_compare($gd_version, '1.8', '>='); - - $ret['jpeg'] = isset($gd_info['JPEG Support']) && $gd_info['JPEG Support']; } + $ret['jpeg'] = function_exists('imagecreatefromjpeg'); $ret['mysql'] = function_exists('mysql_connect'); $ret['json'] = function_exists('json_encode'); $output = shell_exec('java -version 2>&1'); $ret['java'] = stripos($output, 'java version') !== false; $ret['memory_limit'] = $this->isPhpSettingChangeable('memory_limit', '33M'); + $ret['display_errors'] = $this->isPhpSettingChangeable('display_errors', '1'); + $ret['error_reporting'] = $this->canChangeErrorReporting(); $ret['date.timezone'] = ini_get('date.timezone') != ''; $ret['variables_order'] = strpos(ini_get('variables_order'), 'GPC') !== false; @@ -151,6 +152,26 @@ } /** + * Detects if error reporting can be changed at runtime + * + * @return bool + * @access protected + */ + protected function canChangeErrorReporting() + { + $old_value = error_reporting(E_PARSE); + $new_value = error_reporting(); + + if ( $new_value == E_PARSE ) { + error_reporting($old_value); + + return true; + } + + return false; + } + + /** * Detects if setting of php.ini can be changed * * @param string $setting_name @@ -159,16 +180,15 @@ */ protected function isPhpSettingChangeable($setting_name, $new_value) { - $backup_value = ini_get($setting_name); - ini_set($setting_name, $new_value); + $old_value = ini_get($setting_name); - if ( ini_get($setting_name) != $backup_value ) { - ini_set($setting_name, $backup_value); - - return true; + if ( ini_set($setting_name, $new_value) === false ) { + return false; } - return false; + ini_set($setting_name, $old_value); + + return true; } /** Index: branches/5.2.x/core/install/step_templates/sys_requirements.tpl =================================================================== diff -u -N -r15165 -r15237 --- branches/5.2.x/core/install/step_templates/sys_requirements.tpl (.../sys_requirements.tpl) (revision 15165) +++ branches/5.2.x/core/install/step_templates/sys_requirements.tpl (.../sys_requirements.tpl) (revision 15237) @@ -11,20 +11,23 @@ '; $check_titles = Array ( - 'php_version' => 'PHP version: 5.3.2+ (required)', + 'php_version' => 'PHP version: 5.2.0+ (required)', 'url_rewriting' => 'URL Rewriting Support (optional)', 'java' => 'Java (optional)', 'sep1' => 'PHP extensions:', 'memcache' => '- Memcache (optional)', 'curl' => '- Curl (required)', 'simplexml' => '- SimpleXML (required)', + 'spl' => '- Standard PHP Library (required)', 'freetype' => '- Freetype (required)', 'gd_version' => '- GD 1.8+ (required)', - 'jpeg' => '- jpeg (required)', + 'jpeg' => '- JPEG (required)', 'mysql' => '- MySQL (required)', 'json' => '- JSON (required)', 'sep2' => 'PHP settings:', 'memory_limit' => "- ini_set('memory_limit', ...) works (optional)", + 'display_errors' => "- ini_set('display_errors', ...) works (optional)", + 'error_reporting' => "- error_reporting(...) works (optional)", 'date.timezone' => "- ini_get('date.timezone') - timezone set (required)", 'variables_order' => "- ini_get('variables_order') - contains \"GPC\" string", 'output_buffering' => "- ini_get('output_buffering') > 0 - buffering works (required)",