Write the PEAR system config file while installing

This commit is contained in:
Tomas V.V.Cox 2003-07-03 06:45:49 +00:00
parent 6f14374b3b
commit 6ca92fbaa6

View File

@ -1,8 +1,5 @@
<?php
// XXX TODO write the config file at the end as for example
// in 'system' layer
/* $Id$ */
$pear_dir = dirname(__FILE__);
@ -112,6 +109,18 @@ foreach ($install_files as $package => $instfile) {
$new_ver = $reg->packageInfo($package, 'version');
$ui->outputData(sprintf("[PEAR] %-15s- installed: %s", $package, $new_ver));
}
if ($package == 'PEAR') {
if (is_file($ufile = $config->getConfFile('user'))) {
$ui->outputData('Warning! a PEAR user config file already exists from ' .
'a previous PEAR installation at ' .
"'$ufile'. You may probably want to remove it.");
}
$ui->outputData('Writing PEAR system config file at: ' . $config->files['system']);
$ui->outputData('You may want to add: ' . $config->get('php_dir') . ' to your php.ini include_path');
foreach ($config->getKeys() as $key) {
$data[$key] = $config->get($key);
}
$config->store('system', $data);
}
}
?>