cvs: pear-core /PEAR/Command Channels.php

From: Date: Mon, 15 Nov 2004 21:24:41 +0000
Subject: cvs: pear-core /PEAR/Command Channels.php
Groups: php.pear.cvs php.pear.core 
Request: Send a blank email to pear-cvs+get-25991@lists.php.net to get a copy of this message
cellog Mon Nov 15 16:24:41 2004 EDT Modified files: /pear-core/PEAR/Command Channels.php Log: upgrade old registry/remote fetching code http://cvs.php.net/diff.php/pear-core/PEAR/Command/Channels.php?r1=1.7&r2=1.8&ty=u Index: pear-core/PEAR/Command/Channels.php diff -u pear-core/PEAR/Command/Channels.php:1.7 pear-core/PEAR/Command/Channels.php:1.8 --- pear-core/PEAR/Command/Channels.php:1.7 Fri Sep 24 01:24:23 2004 +++ pear-core/PEAR/Command/Channels.php Mon Nov 15 16:24:36 2004 @@ -17,7 +17,7 @@ // | | // +----------------------------------------------------------------------+ // -// $Id: Channels.php,v 1.7 2004/09/24 05:24:23 cellog Exp $ +// $Id: Channels.php,v 1.8 2004/11/15 21:24:36 cellog Exp $ require_once 'PEAR/Command/Common.php'; require_once 'PEAR/Registry.php'; @@ -140,7 +140,7 @@ function doList($command, $options, $params) { - $reg = new PEAR_Registry($this->config->get('php_dir')); + $reg = &$this->config->getRegistry(); $registered = $reg->getChannels(); usort($registered, array(&$this, '_sortchannels')); $i = $j = 0; @@ -163,12 +163,12 @@ function doUpdateAll($command, $options, $params) { - $reg = new PEAR_Registry($this->config->get('php_dir')); + $reg = &$this->config->getRegistry(); $chan = $this->config->get('default_channel'); if ($chan != 'pear.php.net') { $this->ui->outputData('WARNING: default channel is not pear.php.net'); } - $remote = &new PEAR_Remote($this->config, $reg); + $remote = &$this->config->getRemote(); $channels = $remote->call('channel.listAll'); if (PEAR::isError($channels)) { return $channels; @@ -351,7 +351,7 @@ if (sizeof($params) != 1) { return $this->raiseError('No Channel Specified'); } - $reg = new PEAR_Registry($this->config->get('php_dir')); + $reg = &$this->config->getRegistry(); if (($channel = $reg->channelName($params[0])) == 'pear.php.net') { return $this->raiseError('Cannot delete the pear.php.net channel'); } @@ -402,16 +402,18 @@ return $this->raiseError('Invalid channel.xml file'); } } - $reg = new PEAR_Registry($this->config->get('php_dir')); + $reg = &$this->config->getRegistry(); if ($reg->channelExists($channel->getName())) { - return $this->raiseError('Error: Channel `' . $channel->getName() . "' exists, use channel-update to update entry"); + return $this->raiseError('Error: Channel `' . $channel->getName() . + "' exists, use channel-update to update entry"); } $ret = $reg->addChannel($channel); if (PEAR::isError($ret)) { return $ret; } if (!$ret) { - return $this->raiseError("Adding Channel `" . $channel->getName() . "' to registry failed"); + return $this->raiseError("Adding Channel `" . $channel->getName() . + "' to registry failed"); } $this->config->setChannels($reg->listChannels()); $this->config->writeConfigFile(); @@ -420,7 +422,7 @@ function doUpdate($command, $options, $params) { - $reg = &new PEAR_Registry($this->config->get('php_dir')); + $reg = &$this->config->getRegistry(); if (sizeof($params) != 1) { return $this->raiseError("No channel file specified"); } @@ -430,7 +432,7 @@ $this->ui->outputData('Retrieving channel.xml from remote server'); $chan = $this->config->get('default_channel'); $this->config->set('default_channel', strtolower($params[0])); - $remote = &new PEAR_Remote($this->config); + $remote = &$this->config->getRemote(); // if force is specified, use a timestamp of "1" to force retrieval $lastmodified = isset($options['force']) ? 1 : $c->lastModified(); $contents = $remote->call('channel.update', $lastmodified); @@ -499,7 +501,7 @@ function doAlias($command, $options, $params) { - $reg = &new PEAR_Registry($this->config->get('php_dir')); + $reg = &$this->config->getRegistry(); if (sizeof($params) == 1) { return $this->raiseError("No channel alias specified"); } @@ -512,7 +514,7 @@ function doDiscover($command, $options, $params) { - $reg = &new PEAR_Registry($this->config->get('php_dir')); + $reg = &$this->config->getRegistry(); if (sizeof($params) != 1) { return $this->raiseError("No channel server specified"); }

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