diff --git a/setup/check_install.php b/setup/check_install.php index bc58e9089c..24d7433021 100644 --- a/setup/check_install.php +++ b/setup/check_install.php @@ -11,6 +11,7 @@ /* $Id$ */ + @set_time_limit(0); $run_by_webserver = !!$_SERVER['PHP_SELF']; $is_windows = strtoupper(substr(PHP_OS,0,3)) == 'WIN'; @@ -247,19 +248,24 @@ if (!class_exists('PEAR_Config')) return false; $config = new PEAR_Config('',$pear_config); - //echo "
config = ".print_r($config,true)."\n"; - + //echo "
config = ".print_r($config,true)."\n"; + $channel = $config->get('default_channel'); - //echo "
channel = ".print_r($channel,true)."\n"; + //echo "
channel = ".print_r($channel,true)."\n"; if (!method_exists($config,'getRegistry')) return false; // PEAR version to old $reg = &$config->getRegistry(); - //echo "
reg = ".print_r($reg,true)."\n"; - + //echo "
reg = ".print_r($reg,true)."\n"; + + // a bug in pear causes an endless loop if the install-dir does not exist + // bug reported: http://pear.php.net/bugs/bug.php?id=11317 + if (!file_exists($reg->install_dir)) return false; + $installed = $reg->packageInfo(null,null,$channel); + //echo "
installed =".print_r($installed,true)."\n"; - $packages = array(); + $packages = array(); foreach($installed as $package) { $name = isset($package['package']) ? $package['package'] : $package['name']; @@ -286,11 +292,13 @@ { $pear_packages = get_installed_pear_packages(); } + $version_available = false; + // check if egw-pear is availible and packages is included if ($package && is_dir('../egw-pear') && file_exists('../egw-pear/'.str_replace('_','/',$package).'.php')) { $available = true; - $version_availible = '999.egw-pear'; + $version_available = '999.egw-pear'; } // packages found in the pear registry --> use that info elseif ($pear_packages) @@ -299,30 +307,30 @@ // check if package is installed if ($package && isset($pear_packages[$package])) $available = true; // check if it's the right version - $version_availible = $pear_packages[$package ? $package : 'PEAR']; + $version_available = $pear_packages[$package ? $package : 'PEAR']; } else // use the old checks as fallback { if (is_null($pear_available)) { - $pear_available = @include('PEAR.php'); + $pear_available = @include_once('PEAR.php'); if (!class_exists('PEAR')) $pear_available = false; } if ($pear_available && $package) { $file = str_replace('_','/',$package).'.php'; - $available = @include($file); + + $available = @include_once($file); if (!class_exists($package)) $available = false; } } // is the right version availible - $available = $pear_available && (!$package || $available) && (!$min_version || version_compare($min_version,$version_availible) <= 0); - + $available = $pear_available && (!$package || $available) && (!$min_version || version_compare($min_version,$version_available) <= 0); echo '