From: Davide Franco Date: Tue, 5 Jul 2011 20:06:33 +0000 (+0200) Subject: bacula-web: Improved php version check and renammed variable X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=c66b126d5ee66d05c05ee5019487f320c909c2ca;p=bacula%2Fbacula bacula-web: Improved php version check and renammed variable --- diff --git a/gui/bacula-web/test.php b/gui/bacula-web/test.php index 723f940841..2b3b01b0f4 100644 --- a/gui/bacula-web/test.php +++ b/gui/bacula-web/test.php @@ -19,7 +19,7 @@ $bw = new Bweb(); // Check result icon - $check_result = array( true => 'ok.png', false => 'error.png' ); + $icon_result = array( true => 'ok.png', false => 'error.png' ); // Checks list $check_list = array( array( 'check_cmd' => 'php-gettext', @@ -50,27 +50,25 @@ switch( $check['check_cmd'] ) { case 'php-gettext': - $check['check_result'] = $check_result[ function_exists( 'gettext' ) ]; + $check['check_result'] = $icon_result[ function_exists( 'gettext' ) ]; break; case 'php-gd': - $check['check_result'] = $check_result[ function_exists( 'gd_info') ]; + $check['check_result'] = $icon_result[ function_exists( 'gd_info') ]; break; case 'pear-db': - $check['check_result'] = $check_result[ class_exists('DB') ]; + $check['check_result'] = $icon_result[ class_exists('DB') ]; break; case 'php-mysql': - $check['check_result'] = $check_result[ function_exists('mysql_connect') ]; + $check['check_result'] = $icon_result[ function_exists('mysql_connect') ]; break; case 'php-postgres': - $check['check_result'] = $check_result[ function_exists('pg_connect') ]; + $check['check_result'] = $icon_result[ function_exists('pg_connect') ]; break; case 'smarty-cache': - $check['check_result'] = $check_result[ is_writable( "./templates_c" ) ]; + $check['check_result'] = $icon_result[ is_writable( "./templates_c" ) ]; break; case 'php-version': - $phpversion = explode( '.', PHP_VERSION ); - $phpversion = $phpversion[0]; - $check['check_result'] = $check_result[ $phpversion >= 5 ]; + $check['check_result'] = $icon_result[ version_compare( PHP_VERSION, '5.0.0', '>=' ) ]; break; } }