From 7d9c3661aa4a2502d5d565c4d3686a9404b1952b Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Thu, 12 Jul 2007 05:48:55 +0000 Subject: [PATCH] "allow apps to specify there own php.ini checks, which get comulated by check_install, eg. to check for magic_quotes_gpc Off for fmail" --- setup/check_install.php | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/setup/check_install.php b/setup/check_install.php index 4a791559ea..b93be4b53e 100644 --- a/setup/check_install.php +++ b/setup/check_install.php @@ -174,13 +174,14 @@ { if ($checks[$name] == $data) continue; // identical check --> ignore it - if ($data['func'] == 'pear_check' || $data['func'] == 'extension_check' && !isset($args['warning'])) + if ($data['func'] == 'pear_check' || in_array($data['func'],array('extension_check','php_ini_check')) && !isset($data['warning'])) { if ($checks[$name]['from'] && !is_array($checks[$name]['from'])) { $checks[$name]['from'] = array($checks[$name]['from']); } - $checks[$name]['from'][] = $data['from'] ? $data['from'] : $app; + if (!isset($data['from'])) $data['from'] = $app; + if (!in_array($data['from'],$checks[$name]['from'])) $checks[$name]['from'][] = $data['from']; } else { @@ -189,6 +190,7 @@ } else { + if (!isset($data['from'])) $data['from'] = $app; $checks[$name] = $data; } //echo "added check $data[func]($name) for $app"; _debug_array($data); @@ -326,7 +328,7 @@ if (!class_exists($package)) $available = false; } } - // is the right version availible + // is the right version availible $available = (@$available || $pear_available && !$package) && (!$min_version || version_compare($min_version,$version_available) <= 0); echo '
'.($available ? $passed_icon : $warning_icon).' '. lang('Checking PEAR%1 is installed',($package?'::'.$package:'').($min_version?" ($min_version)":'')).': '. @@ -364,6 +366,7 @@ function extension_check($name,$args) { + //echo "

extension_check($name,".print_r($args,true).")

\n"; global $passed_icon, $error_icon, $warning_icon, $is_windows; if (isset($args['win_only']) && $args['win_only'] && !$is_windows) @@ -641,14 +644,20 @@ } if (!$result) { - if (isset($args['warning'])) - { - echo "
".$warning_icon.' '.$msg.'
'.$args['warning']."
\n"; - } if (isset($args['error'])) { echo "
".$error_icon.' '.$msg.'
'.$args['error']."
\n"; } + elseif (isset($args['warning'])) + { + echo "
".$warning_icon.' '.$msg.'
'.$args['warning']."
\n"; + } + elseif (!isset($args['safe_mode'])) + { + echo "
".$warning_icon.' '.$msg.'
'. + lang('%1 is needed by: %2.',$name,is_array($args['from']) ? implode(', ',$args['from']) : $args['from']) + ."
\n"; + } if (isset($args['safe_mode']) && $safe_mode || @$args['change']) { if (!isset($args['warning']) && !isset($args['error']))