This should be set via a call to {@link PEAR_Registry::listChannels()}
public setChannels ( $channels, $merge = false ) : boolean | ||
Результат | boolean | success of operation |
/** * @param PEAR_ChannelFile Channel object * @param string Last-Modified header from HTTP for caching * @return boolean|PEAR_Error True on creation, false if it already exists */ function addChannel($channel, $lastmodified = false, $update = false) { if (!is_a($channel, 'PEAR_ChannelFile') || !$channel->validate()) { return false; } if (PEAR::isError($e = $this->_lock(LOCK_EX))) { return $e; } $ret = $this->_addChannel($channel, $update, $lastmodified); $this->_unlock(); if (!$update && $ret && is_a($this->_config, 'PEAR_Config')) { $this->_config->setChannels($this->listChannels()); } return $ret; }
/** * @param PEAR_ChannelFile Channel object * @param string Last-Modified header from HTTP for caching * @return boolean|PEAR_Error True on creation, false if it already exists */ function addChannel($channel, $lastmodified = false, $update = false) { if (!is_a($channel, 'PEAR_ChannelFile') || !$channel->validate()) { if (!$channel->validate()) { $msg = ''; $errors = $channel->getErrors(); foreach ($errors as $error) { $msg .= $error['message'] . ', '; } return PEAR::raiseError(substr($msg, 0, -2)); } return false; } if (PEAR::isError($e = $this->_lock(LOCK_EX))) { return $e; } $ret = $this->_addChannel($channel, $update, $lastmodified); $this->_unlock(); if (!$update && $ret && is_a($this->_config, 'PEAR_Config')) { $this->_config->setChannels($this->listChannels()); } return $ret; }