diff --git a/setup/check_install.php b/setup/check_install.php index e8339b2268..e63a8049bf 100644 --- a/setup/check_install.php +++ b/setup/check_install.php @@ -270,7 +270,7 @@ foreach($setup_info as $app => $app_data) } } $sorted_checks = array(); -foreach(array('php_version','php_ini_check','extension_check','pear_check','gd_check','permission_check') as $func) +foreach(array('php_version','php_ini_check','extension_check','pear_check','gd_check','permission_check','jpgraph_check') as $func) { foreach($checks as $name => $data) { @@ -737,6 +737,46 @@ function php_ini_check($name,$args) return $result; } +function jpgraph_check($name,array $args) +{ + global $passed_icon, $error_icon, $warning_icon; + + $egw_path = defined(EGW_SERVER_ROOT) ? EGW_SERVER_ROOT : dirname(dirname(__FILE__)); + $jpgraph_path = realpath($egw_path.'/..').SEP.'jpgraph'; + + $min_version = isset($args['min_version']) ? $args['min_version'] : '1.13'; + + $available = false; + if (($check = file_exists($jpgraph_path) && is_dir($jpgraph_path)) && + file_exists($jpgraph_path.'/src/jpgraph.php')) + { + if (file_exists($jpgraph_path.'/VERSION') && preg_match('/Version: v([0-9.]+)/',file_get_contents($jpgraph_path.'/VERSION'),$matches)) + { + $version = $matches[1]; + $available = version_compare($version,$min_version,'>='); + } + else + { + $version = 'unknown'; + } + } + echo "