- Define the PEAR constants when they are not set (be nice

with the "--wihout-pear" people who finally regrets)
- Added method getLayers()
This commit is contained in:
Tomas V.V.Cox 2002-04-01 19:13:37 +00:00
parent 6ec8fbc30e
commit 49dacbee8c

View File

@ -28,6 +28,15 @@ $GLOBALS['_PEAR_Config_instance'] = null;
define('PEAR_CONFIG_DEFAULT_DOCDIR',
PHP_DATADIR.DIRECTORY_SEPARATOR.'pear'.DIRECTORY_SEPARATOR.'doc');
// in case a --without-pear PHP installation is used
if (!defined('PEAR_INSTALL_DIR')) {
define('PEAR_INSTALL_DIR', PHP_LIBDIR);
}
if (!defined('PEAR_EXTENSION_DIR')) {
define('PEAR_EXTENSION_DIR', PHP_EXTENSION_DIR);
}
/**
* This is a class for storing simple configuration values keeping
* track of which are system-defined, user-defined or defaulted. By
@ -766,6 +775,18 @@ when installing packages without a version or state specified',
}
// }}}
/**
* Returns the layers defined (except the 'default' one)
*
* @return array of the defined layers
*/
function getLayers()
{
$cf = $this->configuration;
unset($cf['default']);
return array_keys($cf);
}
}
?>