Re: Net_Curl bug fixes / status

From: Date: Wed, 13 Jul 2005 22:51:54 +0000
Subject: Re: Net_Curl bug fixes / status
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-38628@lists.php.net to get a copy of this message
On Wednesday 13 July 2005 02:47 pm, Joe Stump wrote: > All, > > I've spent the last few hours clearing out all of the bugs for > Net_Curl, fixing the coding standards, adding PHP5 support (native > __construct()/__destruct() with 4.x BC) and adding extra error checking. > > The patches can be found here: > http://zebulon.miester.org/~jstump/pear/Net_Curl/ > Are these: // }}} // {{{ __construct($url = '', $userAgent = '') useful at all? Do they do some sort of editor folding/phpDocumentor magic? In 2_Net_Curl_PHP5_Compatiblity.patch: if (is_resource($this->_ch)) { This should be: if (isset($this->_ch) && is_resource($this->_ch)) { otherwise you'll get a warning with E_ALL if you call close() before $_ch is set. In 3_Net_Curl_Cleanup_and_Fields_Fix.patch: - var $follow_location = 1; + var $followLocation = 1; Doesn't this break BC? I don't think CS specifies anything about variable names. In 4_Net_Curl_Bug_2562.patch: $info = curl_getinfo($this->_ch); $httpCode = (string)$info['http_code']; if ($httpCode != '' ... Ugly. According to the PHP docs, curl_getinfo() always returns an array if called with just the resource argument. Why is this ugly code here? (I assume it's not your work, Joe.) How about: $info = curl_getinfo($this->_ch); if (!is_array($info) || !isset($info['http_code'])) { return PEAR::raiseError("Unknown or invalid HTTP response"); } $t = substr($info['http_code'], 0, 1); if ($t != 2 && $t != 3) { return PEAR::raiseError('Unexpected HTTP code: ' . $info['http_code']); } In 4_Net_Curl_Bug_2562.patch: if ($httpCode != '' && substr($httpCode,0,1) != '2') { What if the server returns a 3xx status?

Attachment: [application/pgp-signature]
« previous php.pear.dev (#38628) next »