]> granicus.if.org Git - php/commitdiff
- Define the PEAR constants when they are not set (be nice
authorTomas V.V.Cox <cox@php.net>
Mon, 1 Apr 2002 19:13:37 +0000 (19:13 +0000)
committerTomas V.V.Cox <cox@php.net>
Mon, 1 Apr 2002 19:13:37 +0000 (19:13 +0000)
  with the "--wihout-pear" people who finally regrets)
- Added method getLayers()

pear/PEAR/Config.php

index 62ad1cdea3a8935e3c77365a72b44a16282a17d8..c9283046dea67a42aef0349b1682c655cc3178c2 100644 (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);
+    }
 }
 
 ?>
\ No newline at end of file