cvs: pear-core /PEAR Downloader.php REST.php Remote.php

From: Date: Mon, 27 Mar 2006 04:33:11 +0000
Subject: cvs: pear-core /PEAR Downloader.php REST.php Remote.php
Groups: php.pear.cvs php.pear.core 
Request: Send a blank email to pear-core+get-4672@lists.php.net to get a copy of this message
cellog Mon Mar 27 04:33:11 2006 UTC Modified files: /pear-core/PEAR Downloader.php REST.php Remote.php Log: clean up @ in PEAR/REST.php default to 8080 port for proxies, cutting down code size [Hannes Magnusson noticed this] http://cvs.php.net/viewcvs.cgi/pear-core/PEAR/Downloader.php?r1=1.101&r2=1.102&diff_format=u Index: pear-core/PEAR/Downloader.php diff -u pear-core/PEAR/Downloader.php:1.101 pear-core/PEAR/Downloader.php:1.102 --- pear-core/PEAR/Downloader.php:1.101 Sun Mar 26 22:49:50 2006 +++ pear-core/PEAR/Downloader.php Mon Mar 27 04:33:11 2006 @@ -18,7 +18,7 @@ * @author Martin Jansen <mj@php.net> * @copyright 1997-2006 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version CVS: $Id: Downloader.php,v 1.101 2006/03/26 22:49:50 cellog Exp $ + * @version CVS: $Id: Downloader.php,v 1.102 2006/03/27 04:33:11 cellog Exp $ * @link http://pear.php.net/package/PEAR * @since File available since Release 1.3.0 */ @@ -1336,13 +1336,10 @@ if (isset($proxy['scheme']) && $proxy['scheme'] == 'https') { $proxy_host = 'ssl://' . $proxy_host; } - $proxy_port = isset($proxy['port']) ? $proxy['port'] : null; + $proxy_port = isset($proxy['port']) ? $proxy['port'] : 8080; $proxy_user = isset($proxy['user']) ? urldecode($proxy['user']) : null; $proxy_pass = isset($proxy['pass']) ? urldecode($proxy['pass']) : null; - if ($proxy_port == '') { - $proxy_port = 8080; - } if ($callback) { call_user_func($callback, 'message', "Using HTTP proxy $host:$port"); } http://cvs.php.net/viewcvs.cgi/pear-core/PEAR/REST.php?r1=1.20&r2=1.21&diff_format=u Index: pear-core/PEAR/REST.php diff -u pear-core/PEAR/REST.php:1.20 pear-core/PEAR/REST.php:1.21 --- pear-core/PEAR/REST.php:1.20 Thu Mar 2 03:09:31 2006 +++ pear-core/PEAR/REST.php Mon Mar 27 04:33:11 2006 @@ -15,7 +15,7 @@ * @author Greg Beaver <cellog@php.net> * @copyright 1997-2006 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version CVS: $Id: REST.php,v 1.20 2006/03/02 03:09:31 pajoye Exp $ + * @version CVS: $Id: REST.php,v 1.21 2006/03/27 04:33:11 cellog Exp $ * @link http://pear.php.net/package/PEAR * @since File available since Release 1.4.0a1 */ @@ -63,7 +63,7 @@ { $cachefile = $this->config->get('cache_dir') . DIRECTORY_SEPARATOR . md5($url) . 'rest.cachefile'; - if (@file_exists($cachefile)) { + if (file_exists($cachefile)) { return unserialize(implode('', file($cachefile))); } return $this->retrieveData($url, $accept, $forcestring); @@ -151,7 +151,7 @@ if ($cacheid === null) { $cacheidfile = $this->config->get('cache_dir') . DIRECTORY_SEPARATOR . md5($url) . 'rest.cacheid'; - if (@file_exists($cacheidfile)) { + if (file_exists($cacheidfile)) { $cacheid = unserialize(implode('', file($cacheidfile))); } else { return false; @@ -169,7 +169,7 @@ { $cacheidfile = $this->config->get('cache_dir') . DIRECTORY_SEPARATOR . md5($url) . 'rest.cacheid'; - if (@file_exists($cacheidfile)) { + if (file_exists($cacheidfile)) { $ret = unserialize(implode('', file($cacheidfile))); return $ret; } else { @@ -181,7 +181,7 @@ { $cachefile = $this->config->get('cache_dir') . DIRECTORY_SEPARATOR . md5($url) . 'rest.cachefile'; - if (@file_exists($cachefile)) { + if (file_exists($cachefile)) { return unserialize(implode('', file($cachefile))); } else { return PEAR::raiseError('No cached content available for "' . $url . '"'); @@ -235,7 +235,9 @@ fclose($fp); $fp = @fopen($cachefile, 'wb'); if (!$fp) { - @unlink($cacheidfile); + if (file_exists($cacheidfile)) { + @unlink($cacheidfile); + } return false; } fwrite($fp, serialize($contents)); @@ -286,17 +288,13 @@ $proxy_host = $proxy_port = $proxy_user = $proxy_pass = ''; if ($this->config->get('http_proxy')&& $proxy = parse_url($this->config->get('http_proxy'))) { - $proxy_host = @$proxy['host']; + $proxy_host = isset($proxy['host']) ? $proxy['host'] : null; if (isset($proxy['scheme']) && $proxy['scheme'] == 'https') { $proxy_host = 'ssl://' . $proxy_host; } - $proxy_port = @$proxy['port']; - $proxy_user = @$proxy['user']; - $proxy_pass = @$proxy['pass']; - - if ($proxy_port == '') { - $proxy_port = 8080; - } + $proxy_port = isset($proxy['port']) ? $proxy['port'] : 8080; + $proxy_user = isset($proxy['user']) ? urldecode($proxy['user']) : null; + $proxy_pass = isset($proxy['pass']) ? urldecode($proxy['pass']) : null; } if (empty($port)) { if (isset($info['scheme']) && $info['scheme'] == 'https') { http://cvs.php.net/viewcvs.cgi/pear-core/PEAR/Remote.php?r1=1.78&r2=1.79&diff_format=u Index: pear-core/PEAR/Remote.php diff -u pear-core/PEAR/Remote.php:1.78 pear-core/PEAR/Remote.php:1.79 --- pear-core/PEAR/Remote.php:1.78 Sun Mar 26 23:06:10 2006 +++ pear-core/PEAR/Remote.php Mon Mar 27 04:33:11 2006 @@ -16,7 +16,7 @@ * @author Greg Beaver <cellog@php.net> * @copyright 1997-2006 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version CVS: $Id: Remote.php,v 1.78 2006/03/26 23:06:10 cellog Exp $ + * @version CVS: $Id: Remote.php,v 1.79 2006/03/27 04:33:11 cellog Exp $ * @link http://pear.php.net/package/PEAR * @since File available since Release 0.1 */ @@ -211,7 +211,7 @@ if (isset($proxy['scheme']) && $proxy['scheme'] == 'https') { $proxy_host = 'https://' . $proxy_host; } - $proxy_port = isset($proxy['port']) ? $proxy['port'] : null; + $proxy_port = isset($proxy['port']) ? $proxy['port'] : 8080; $proxy_user = isset($proxy['user']) ? urldecode($proxy['user']) : null; $proxy_pass = isset($proxy['pass']) ? urldecode($proxy['pass']) : null; }

« previous php.pear.core (#4672) next »