$package = $packageFile->fromPackageFile($packagexml, PEAR_VALIDATE_NORMAL);
if (!$package instanceof PEAR_Error) {
$packages[$package->getName()] = $package->getVersion();
}
}
try {
$versions = $hconfig->checkVersions();
} catch (Horde_Exception $e) {
$notification->push(_("Could not contact server. Try again later."), 'horde.error');
}
}
/* Update configurations if requested. */
if ($vars->action == 'config') {
foreach ($a as $app) {
$path = $registry->get('fileroot', $app) . '/config';
if (!file_exists($path . '/conf.xml') || file_exists($path . '/conf.php') && ($xml_ver = $hconfig->getVersion(@file_get_contents($path . '/conf.xml'))) !== false && ($php_ver = $hconfig->getVersion(@file_get_contents($path . '/conf.php'))) !== false && $xml_ver == $php_ver) {
continue;
}
$vars = new Horde_Variables();
$form = new Horde_Config_Form($vars, $app, true);
$form->setSubmitted(true);
if ($form->validate($vars)) {
$config = new Horde_Config($app);
if (!$config->writePHPConfig($vars)) {
$notification->push(sprintf(_("Could not save the configuration file %s. Use one of the options below to save the code."), Horde_Util::realPath($config->configFile())), 'horde.warning', array('content.raw', 'sticky'));
}
} else {
$notification->push(sprintf(_("The configuration for %s cannot be updated automatically. Please update the configuration manually."), $app), 'horde.error');
}
}
}