Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.9.4

Request #16386 PEAR_Config::remove() does not support specifying a channel
Submitted: 2009-06-29 14:18 UTC Modified: 2009-07-29 03:48 UTC
From: timj Assigned: timj
Status: Closed Package: PEAR (version 1.8.1)
PHP Version: 5.2.9 OS:
Roadmaps: 1.9.0    
Subscription  



Patch pear-bug-16386 Revisions
Revision 2009-06-29 14:19 UTC
Developer timj
 
Download patch

--- Config.php.orig	2009-06-29 14:11:46.000000000 +0100
+++ Config.php	2009-06-29 14:22:04.000000000 +0100
@@ -1831,13 +1831,14 @@
      *
      * @param string config key
      * @param string (optional) config layer
+     * @param string (optional) channel (defaults to default channel)
      * @return bool TRUE on success, FALSE on failure
      *
      * @access public
      */
-    function remove($key, $layer = 'user')
+    function remove($key, $layer = 'user', $channel=null)
     {
-        $channel = $this->getDefaultChannel();
+        if ($channel === null) $channel = $this->getDefaultChannel();
         if ($channel !== 'pear.php.net') {
             if (isset($this->configuration[$layer]['__channels'][$channel][$key])) {
                 unset($this->configuration[$layer]['__channels'][$channel][$key]);