diff --git a/setup/check_install.php b/setup/check_install.php index e8339b2268..eaa43e36d0 100644 --- a/setup/check_install.php +++ b/setup/check_install.php @@ -9,7 +9,6 @@ * @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License * @version $Id$ */ - $run_by_webserver = !!$_SERVER['PHP_SELF']; $is_windows = strtoupper(substr(PHP_OS,0,3)) == 'WIN'; @@ -44,6 +43,7 @@ else return is_null($arg1) ? $msg : str_replace(array('%1','%2','%3','%4'),array($arg1,$arg2,$arg3,$arg4),$msg); } } + $checks = array( 'phpversion' => array( 'func' => 'php_version', @@ -737,6 +737,50 @@ 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__)); + if (!($jpgraph_path = realpath($egw_path.'/..'))) + { + $jpgraph_path = dirname($egw_path); // realpath can fail because eg. open_basedir does NOT include .. + } + $jpgraph_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') || file_exists($jpgraph_path.'/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 "