cvs: pear-core /PEAR Config.php /tests/PEAR_Config test_getFTP.phpt test_getKeys.phpt test_getType.phpt test_readFTPConfigFile_fail.phpt
test_setChannels.phpt test_setget_channelvalues.phpt test_writeConfigFile.phpt /tests/PEAR_Config/test_readFTPConfigFile FTP.php.inc

From: Date: Fri, 26 Nov 2004 06:05:35 +0000
Subject: cvs: pear-core /PEAR Config.php /tests/PEAR_Config test_getFTP.phpt test_getKeys.phpt test_getType.phpt test_readFTPConfigFile_fail.phpt
test_setChannels.phpt test_setget_channelvalues.phpt test_writeConfigFile.phpt /tests/PEAR_Config/test_readFTPConfigFile FTP.php.inc
Groups: php.pear.cvs php.pear.core 
Request: Send a blank email to pear-cvs+get-26509@lists.php.net to get a copy of this message
cellog Fri Nov 26 01:05:35 2004 EDT Modified files: /pear-core/PEAR Config.php /pear-core/tests/PEAR_Config test_getFTP.phpt test_getKeys.phpt test_getType.phpt test_readFTPConfigFile_fail.phpt test_setChannels.phpt test_setget_channelvalues.phpt test_writeConfigFile.phpt /pear-core/tests/PEAR_Config/test_readFTPConfigFile FTP.php.inc Log: make remote_config a password type fix minor problems with PEAR_Config unit tests

http://cvs.php.net/diff.php/pear-core/PEAR/Config.php?r1=1.79&r2=1.80&ty=u Index: pear-core/PEAR/Config.php diff -u pear-core/PEAR/Config.php:1.79 pear-core/PEAR/Config.php:1.80 --- pear-core/PEAR/Config.php:1.79 Wed Nov 24 16:41:56 2004 +++ pear-core/PEAR/Config.php Fri Nov 26 01:05:35 2004 @@ -17,7 +17,7 @@ // | Greg Beaver <cellog@php.net> | // +----------------------------------------------------------------------+ // -// $Id: Config.php,v 1.79 2004/11/24 21:41:56 cellog Exp $ +// $Id: Config.php,v 1.80 2004/11/26 06:05:35 cellog Exp $ require_once 'PEAR.php'; require_once 'PEAR/Registry.php'; @@ -283,7 +283,7 @@ 'group' => 'Internet Access', ), 'remote_config' => array( - 'type' => 'string', + 'type' => 'password', 'default' => '', 'doc' => 'ftp url of remote configuration file to use for synchronized install', 'prompt' => 'Remote Configuration File', http://cvs.php.net/diff.php/pear-core/tests/PEAR_Config/test_getFTP.phpt?r1=1.1&r2=1.2&ty=u Index: pear-core/tests/PEAR_Config/test_getFTP.phpt diff -u pear-core/tests/PEAR_Config/test_getFTP.phpt:1.1 pear-core/tests/PEAR_Config/test_getFTP.phpt:1.2 --- pear-core/tests/PEAR_Config/test_getFTP.phpt:1.1 Wed Nov 24 16:42:15 2004 +++ pear-core/tests/PEAR_Config/test_getFTP.phpt Fri Nov 26 01:05:35 2004 @@ -18,6 +18,7 @@ $phpunit->assertFalse($config->getFTP(), 'getFTP() false'); include_once dirname(__FILE__) . '/test_readFTPConfigFile/FTP.php.inc'; +ini_restore('include_path'); $ftp = &Net_FTP::singleton(); $ftp->addRemoteFile('config.ini', dirname(__FILE__) . DIRECTORY_SEPARATOR . 'test_readFTPConfigFile' . DIRECTORY_SEPARATOR . 'remote.ini'); http://cvs.php.net/diff.php/pear-core/tests/PEAR_Config/test_getKeys.phpt?r1=1.1&r2=1.2&ty=u Index: pear-core/tests/PEAR_Config/test_getKeys.phpt diff -u pear-core/tests/PEAR_Config/test_getKeys.phpt:1.1 pear-core/tests/PEAR_Config/test_getKeys.phpt:1.2 --- pear-core/tests/PEAR_Config/test_getKeys.phpt:1.1 Mon Nov 22 16:12:57 2004 +++ pear-core/tests/PEAR_Config/test_getKeys.phpt Fri Nov 26 01:05:35 2004 @@ -10,31 +10,31 @@ <?php error_reporting(E_ALL); require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'setup.php.inc'; -$config = new PEAR_Config; +$config = new PEAR_Config('fii', 'fii'); $phpunit->assertEquals(array ( - 0 => 'master_server', - 1 => 'preferred_state', - 2 => 'cache_dir', - 3 => 'php_dir', - 4 => 'ext_dir', - 5 => 'data_dir', - 6 => 'doc_dir', - 7 => 'test_dir', - 8 => 'bin_dir', - 9 => 'default_channel', - 10 => 'remote_config', - 11 => 'auto_discover', - 12 => 'http_proxy', - 13 => 'php_bin', - 14 => 'username', - 15 => 'password', - 16 => 'verbose', - 17 => 'umask', - 18 => 'cache_ttl', - 19 => 'sig_type', - 20 => 'sig_bin', - 21 => 'sig_keyid', - 22 => 'sig_keydir', + 'default_channel', + 'remote_config', + 'auto_discover', + 'master_server', + 'http_proxy', + 'php_dir', + 'ext_dir', + 'doc_dir', + 'bin_dir', + 'data_dir', + 'test_dir', + 'cache_dir', + 'php_bin', + 'username', + 'password', + 'verbose', + 'preferred_state', + 'umask', + 'cache_ttl', + 'sig_type', + 'sig_bin', + 'sig_keyid', + 'sig_keydir', ), $config->getKeys(), 'keys'); echo 'tests done'; ?> http://cvs.php.net/diff.php/pear-core/tests/PEAR_Config/test_getType.phpt?r1=1.2&r2=1.3&ty=u Index: pear-core/tests/PEAR_Config/test_getType.phpt diff -u pear-core/tests/PEAR_Config/test_getType.phpt:1.2 pear-core/tests/PEAR_Config/test_getType.phpt:1.3 --- pear-core/tests/PEAR_Config/test_getType.phpt:1.2 Mon Nov 22 16:06:55 2004 +++ pear-core/tests/PEAR_Config/test_getType.phpt Fri Nov 26 01:05:35 2004 @@ -12,7 +12,7 @@ require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'setup.php.inc'; $config = new PEAR_Config; $phpunit->assertEquals('string', $config->getType('default_channel'), 'default_channel'); -$phpunit->assertEquals('string', $config->getType('remote_config'), 'remote_config'); +$phpunit->assertEquals('password', $config->getType('remote_config'), 'remote_config'); $phpunit->assertEquals('integer', $config->getType('auto_discover'), 'auto_discover'); $phpunit->assertEquals('string', $config->getType('master_server'), 'master_server'); $phpunit->assertEquals('string', $config->getType('http_proxy'), 'http_proxy'); http://cvs.php.net/diff.php/pear-core/tests/PEAR_Config/test_readFTPConfigFile_fail.phpt?r1=1.1&r2=1.2&ty=u Index: pear-core/tests/PEAR_Config/test_readFTPConfigFile_fail.phpt diff -u pear-core/tests/PEAR_Config/test_readFTPConfigFile_fail.phpt:1.1 pear-core/tests/PEAR_Config/test_readFTPConfigFile_fail.phpt:1.2 --- pear-core/tests/PEAR_Config/test_readFTPConfigFile_fail.phpt:1.1 Wed Nov 24 15:26:36 2004 +++ pear-core/tests/PEAR_Config/test_readFTPConfigFile_fail.phpt Fri Nov 26 01:05:35 2004 @@ -1,5 +1,5 @@ --TEST-- -PEAR_Config->readFTPConfigFile() +PEAR_Config->readFTPConfigFile() (failure) --SKIPIF-- <?php if (!getenv('PHP_PEAR_RUNTESTS')) { @@ -18,6 +18,7 @@ ), 'no net_ftp'); include_once dirname(__FILE__) . '/test_readFTPConfigFile/FTP.php.inc'; +ini_restore('include_path'); $ftp = &Net_FTP::singleton(); $ftp->setConnectError('connect error'); $e = $config->readFTPConfigFile('ftp://example.com'); http://cvs.php.net/diff.php/pear-core/tests/PEAR_Config/test_setChannels.phpt?r1=1.1&r2=1.2&ty=u Index: pear-core/tests/PEAR_Config/test_setChannels.phpt diff -u pear-core/tests/PEAR_Config/test_setChannels.phpt:1.1 pear-core/tests/PEAR_Config/test_setChannels.phpt:1.2 --- pear-core/tests/PEAR_Config/test_setChannels.phpt:1.1 Mon Nov 22 16:35:29 2004 +++ pear-core/tests/PEAR_Config/test_setChannels.phpt Fri Nov 26 01:05:35 2004 @@ -10,7 +10,7 @@ <?php error_reporting(E_ALL); require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'setup.php.inc'; -$config = new PEAR_Config; +$config = new PEAR_Config('fii', 'fii'); $config->removeLayer('user'); $phpunit->assertFalse($config->setChannels(1), 1); $phpunit->assertTrue($config->setChannels(array('pear.php.net', '__uri', 'mychannel')), 'set'); http://cvs.php.net/diff.php/pear-core/tests/PEAR_Config/test_setget_channelvalues.phpt?r1=1.1&r2=1.2&ty=u Index: pear-core/tests/PEAR_Config/test_setget_channelvalues.phpt diff -u pear-core/tests/PEAR_Config/test_setget_channelvalues.phpt:1.1 pear-core/tests/PEAR_Config/test_setget_channelvalues.phpt:1.2 --- pear-core/tests/PEAR_Config/test_setget_channelvalues.phpt:1.1 Tue Nov 23 02:01:00 2004 +++ pear-core/tests/PEAR_Config/test_setget_channelvalues.phpt Fri Nov 26 01:05:35 2004 @@ -10,7 +10,7 @@ <?php error_reporting(E_ALL); require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'setup.php.inc'; -$config = new PEAR_Config; +$config = new PEAR_Config($temp_path . DIRECTORY_SEPARATOR . 'pear.ini'); // failures $phpunit->assertFalse($config->set('php_dir', 'oops', 'user', 'unknown'), 'unknown channel'); $phpunit->assertFalse($config->set('sig_bin', 'oops', 'user', '__uri'), 'global value'); http://cvs.php.net/diff.php/pear-core/tests/PEAR_Config/test_writeConfigFile.phpt?r1=1.1&r2=1.2&ty=u Index: pear-core/tests/PEAR_Config/test_writeConfigFile.phpt diff -u pear-core/tests/PEAR_Config/test_writeConfigFile.phpt:1.1 pear-core/tests/PEAR_Config/test_writeConfigFile.phpt:1.2 --- pear-core/tests/PEAR_Config/test_writeConfigFile.phpt:1.1 Mon Nov 22 17:17:12 2004 +++ pear-core/tests/PEAR_Config/test_writeConfigFile.phpt Fri Nov 26 01:05:35 2004 @@ -10,7 +10,7 @@ <?php error_reporting(E_ALL); require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'setup.php.inc'; -$config = new PEAR_Config; +$config = new PEAR_Config($temp_path . DIRECTORY_SEPARATOR . 'pear.ini'); $config->readConfigFile($temp_path . DIRECTORY_SEPARATOR . 'pear.ini'); $config->readConfigFile($temp_path . DIRECTORY_SEPARATOR . 'pear.frompf', 'system'); $phpunit->assertErrors(array( http://cvs.php.net/diff.php/pear-core/tests/PEAR_Config/test_readFTPConfigFile/FTP.php.inc?r1=1.2&r2=1.3&ty=u Index: pear-core/tests/PEAR_Config/test_readFTPConfigFile/FTP.php.inc diff -u pear-core/tests/PEAR_Config/test_readFTPConfigFile/FTP.php.inc:1.2 pear-core/tests/PEAR_Config/test_readFTPConfigFile/FTP.php.inc:1.3 --- pear-core/tests/PEAR_Config/test_readFTPConfigFile/FTP.php.inc:1.2 Wed Nov 24 16:42:15 2004 +++ pear-core/tests/PEAR_Config/test_readFTPConfigFile/FTP.php.inc Fri Nov 26 01:05:35 2004 @@ -71,6 +71,9 @@ if (isset($this->_cdErr[$path])) { return $this->raiseError($this->_cdErr[$path]); } + if ($path == '/' || $path == '\\') { + $path = ''; + } $this->_cdTo = $path; return true; } @@ -105,7 +108,9 @@ function get($remote, $local, $overwrite = false, $mode = null) { - $remote = $this->_cdTo . '/' . $remote; + if ($this->_cdTo) { + $remote = $this->_cdTo . '/' . $remote; + } if (isset($this->_remoteFiles[$remote])) { if (!$overwrite && file_exists($local)) { return $this->raiseError("Local file '$local_file' exists and may not be overwriten.", NET_FTP_ERR_OVERWRITELOCALFILE_FORBIDDEN);
« previous php.pear.cvs (#26509) next »