discover and install PEAR packages from a channel, like Horde_IMAP_Client needed by new mail

This commit is contained in:
Ralf Becker 2014-04-17 15:32:48 +00:00
parent e02c62bccd
commit 8c1c2c9d76

View File

@ -619,7 +619,23 @@ function check_install_pear_packages()
} }
if ($to_install) if ($to_install)
{ {
$cmd = $config['pear'].' install '.implode(' ',$to_install); $channels = array();
$cmd = $config['pear'].' install';
foreach($to_install as $package)
{
// if package is prefixed with a channel, discover it before installing package
if (strpos($package, '/') !== false)
{
list($channel) = explode('/', $package);
if (!in_array($channel, $channels))
{
$discover_cmd = $config['pear'].' channel-discover '.$channel;
echo "$discover_cmd\n"; system($discover_cmd);
$channels[] = $channel;
}
}
$cmd .= ' '.$package;
}
echo "$cmd\n"; system($cmd); echo "$cmd\n"; system($cmd);
} }
} }