From 49dacbee8cab5ff0a4026057deb4b9031ca57296 Mon Sep 17 00:00:00 2001 From: "Tomas V.V.Cox" Date: Mon, 1 Apr 2002 19:13:37 +0000 Subject: [PATCH] - Define the PEAR constants when they are not set (be nice with the "--wihout-pear" people who finally regrets) - Added method getLayers() --- pear/PEAR/Config.php | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/pear/PEAR/Config.php b/pear/PEAR/Config.php index 62ad1cdea3a..c9283046dea 100644 --- a/pear/PEAR/Config.php +++ b/pear/PEAR/Config.php @@ -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); + } } ?> \ No newline at end of file