cvs: pear-core /PEAR Config.php

From: Date: Sat, 14 Aug 2004 14:14:19 +0000
Subject: cvs: pear-core /PEAR Config.php
Groups: php.pear.cvs php.pear.core 
Request: Send a blank email to pear-cvs+get-22897@lists.php.net to get a copy of this message
cellog Sat Aug 14 10:14:19 2004 EDT Modified files: /pear-core/PEAR Config.php Log: add deleteChannels() method needed in order to properly erase a channel from the configuration http://cvs.php.net/diff.php/pear-core/PEAR/Config.php?r1=1.54&r2=1.55&ty=u Index: pear-core/PEAR/Config.php diff -u pear-core/PEAR/Config.php:1.54 pear-core/PEAR/Config.php:1.55 --- pear-core/PEAR/Config.php:1.54 Sat Aug 14 10:08:35 2004 +++ pear-core/PEAR/Config.php Sat Aug 14 10:14:19 2004 @@ -17,7 +17,7 @@ // | Greg Beaver <cellog@php.net> | // +----------------------------------------------------------------------+ // -// $Id: Config.php,v 1.54 2004/08/14 14:08:35 cellog Exp $ +// $Id: Config.php,v 1.55 2004/08/14 14:14:19 cellog Exp $ require_once 'PEAR.php'; require_once 'System.php'; @@ -550,6 +550,23 @@ } $this->_channels = array_values(array_flip($set)); $this->setChannels($this->_channels); + } + + // }}} + // {{{ deleteChannel(channel) + + function deleteChannel($channel) + { + foreach ($this->configuration as $layer => $data) { + if (isset($data['__channels'])) { + if (isset($data['__channels'][strtolower($channel)])) { + unset($data['__channels'][strtolower($channel)]); + } + } + } + $this->_channels = array_flip($this->_channels); + unset($this->_channels[strtolower($channel)]); + $this->_channels = array_flip($this->_channels); } // }}}

« previous php.pear.cvs (#22897) next »