From: <gi...@ma...> - 2010-04-23 03:38:09
|
The branch, master-1.2.x has been updated via a41aeea10e7800b6ea59d4e3fdc7190c3e62541d (commit) from 7f68bdbae2f992a9cdb8f3d6de4e319c74f7c2fe (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit a41aeea10e7800b6ea59d4e3fdc7190c3e62541d Author: David Hicks <hic...@op...> Date: Fri Apr 23 13:36:05 2010 +1000 Fix #11797: Zend Optimizer version check fails for v4+ The Zend Optimizer version string from v4 looks like "with Zend Optimizer+ vX.Y" instead of the old system of just "with Zend Optimizer vX.Y". The version check has been simplified and made more robust. ----------------------------------------------------------------------- Summary of changes: admin/check.php | 44 ++++++++++---------------------------------- 1 files changed, 10 insertions(+), 34 deletions(-) ----------------------------------------------------------------------- commit a41aeea10e7800b6ea59d4e3fdc7190c3e62541d Author: David Hicks <hic...@op...> Date: Fri Apr 23 13:36:05 2010 +1000 Fix #11797: Zend Optimizer version check fails for v4+ The Zend Optimizer version string from v4 looks like "with Zend Optimizer+ vX.Y" instead of the old system of just "with Zend Optimizer vX.Y". The version check has been simplified and made more robust. diff --git a/admin/check.php b/admin/check.php index 44721d6..aa51b31 100644 --- a/admin/check.php +++ b/admin/check.php @@ -159,7 +159,7 @@ function test_bug_attachments_allow_flags() { } function check_zend_optimiser_version() { - $t_pass = true; + $t_pass = false; ob_start(); phpinfo(INFO_GENERAL); @@ -168,46 +168,22 @@ function check_zend_optimiser_version() { $t_output = str_replace(array(">", "<", """, "&", "'", " "), array(">", "<", "\"", "&", "'", " "), $t_output); - define ( 'ZEND_OPTIMIZER_VERSION', '3.3'); - define ( 'ZEND_OPTIMIZER_SUBVERSION', 3); + $t_zend_optimizer_min_version = '3.3.3'; $t_info = ''; - if (strstr($t_output, "Zend Optimizer")) { - $t_version = explode( 'Zend Optimizer', $t_output ); - $t_version = explode( ',', $t_version[1] ); - $t_version = trim($t_version[0]); - - if (!strstr($t_version,"v")) { - $t_info = 'Zend Optimizer Detected - Unknown Version.'; - $t_pass = false; - } else { - $t_version = str_replace("v","",$t_version); - $t_version = explode(".",$t_version); - $t_subVersion = $t_version[2]; - $t_dummy = array_pop($t_version); - $t_version = implode(".",$t_version); - - if ( ( $t_version < ZEND_OPTIMIZER_VERSION ) || - ( $t_version == ZEND_OPTIMIZER_VERSION && $t_subVersion < ZEND_OPTIMIZER_SUBVERSION ) ) { - $t_pass = false; - $t_info = 'Fail - Installed Version: ' . $t_version . '.' . $t_subVersion . '.'; - } + if ( preg_match( '/with Zend Optimizer\+? v([\d\.]*)/', $t_output, $t_matches ) === 1 ) { + if ( version_compare( $t_matches[1], $t_zend_optimizer_min_version, '>=' ) ) { + $t_pass = true; + } else { + $t_info = 'Fail - Installed Version: ' . $t_matches[1] . '. Zend Optimizer should be version be version ' . $t_zend_optimizer_min_version . ' or greater! Some old versions cause the view issues page not to display completely. The latest version of Zend Optimizer can be found at www.zend.com'; } } else { - $t_info = 'Zend Optimiser not detected'; - } - - if (strstr($t_output, 'has been disabled')) { - $t_info = 'Unable to determine Zend Optimizer version - phpinfo() is disabled.'; - $t_pass = false; - } - - if( $t_pass == false ) { - $t_info .= ' Zend Optimizer should be version be ' . ZEND_OPTIMIZER_VERSION . '.' . ZEND_OPTIMIZER_SUBVERSION . ' or greater! Some old versions cause the view issues page not to display completely. The latest version of Zend Optimizer can be found at www.zend.com'; + $t_pass = true; + $t_info = 'Zend Optimizer not detected.'; } - print_test_row( 'Checking Zend Optimiser version (if installed)...', $t_pass, $t_info ); + print_test_row( 'Checking Zend Optimizer version (if installed)...', $t_pass, $t_info ); return $t_pass; } ----------------------------------------------------------------------- -- Mantis Bug Tracker |