]> granicus.if.org Git - php/commitdiff
* added PEAR_Config::removeLayer()
authorStig Bakken <ssb@php.net>
Mon, 20 May 2002 10:42:47 +0000 (10:42 +0000)
committerStig Bakken <ssb@php.net>
Mon, 20 May 2002 10:42:47 +0000 (10:42 +0000)
pear/PEAR/Config.php

index 8e3ed6dbd5e4912c6ef633e8a40ede78e03cf7cd..75d973208f981c80c30db39a0b372fb92d9b199c 100644 (file)
@@ -663,6 +663,29 @@ when installing packages without a version or state specified',
         return false;
     }
 
+    // }}}
+    // {{{ removeLayer(layer)
+
+    /**
+     * Temporarily remove an entire config layer.  USE WITH CARE!
+     *
+     * @param string config key
+     *
+     * @param string (optional) config layer
+     *
+     * @return bool TRUE on success, FALSE on failure
+     *
+     * @access public
+     */
+    function removeLayer($layer)
+    {
+        if (isset($this->configuration[$layer])) {
+            unset($this->configuration[$layer]);
+            return true;
+        }
+        return false;
+    }
+
     // }}}
     // {{{ store([layer])