Bug #19752 [Ana]: connect() returns false even if it successfully connects
| From: | lead2gold at gmail dot com | Date: | Tue, 18 Dec 2012 00:21:31 +0000 |
| Subject: | Bug #19752 [Ana]: connect() returns false even if it successfully connects | ||
| References: | 1 | Groups: | php.pear.bugs |
| Request: | Send a blank email to pear-bugs+get-9426@lists.php.net to get a copy of this message | ||
Edit report at https://pear.php.net/bugs/bug.php?id=19752&edit=1
ID: 19752
Updated by: lead2gold@gmail.com
Reported By: lead2gold at gmail dot com
Summary: connect() returns false even if it successfully
connects
Status: Analyzed
Type: Bug
Package: Net_NNTP
Operating System: Centos 5.8
Package Version: 1.5.0RC2
PHP Version: 5.3.19
Roadmap Versions:
New Comment:
Thank you for your feedback, and looking up all the links to back up
your comments. I'm satisfied with your suggested
workaround for this issue.
You can close the ticket as 'Wont Fix'
Previous Comments:
------------------------------------------------------------------------
[2012-12-17 13:02:54] heino
http://pear.php.net/bugs/bug.php?id=12057
(see comment by William
Steinford @
2009-11-04 16:28)
------------------------------------------------------------------------
[2012-12-17 12:59:40] heino
I haven't really been active in PEAR for years, but I don't think
backward compatibility
concerns have become less over time, so the returned false will just
have to stay. I
was never a fan of handling errors with PEAR_Error and would have
preferred
exceptions (and thus requiring PHP v5, but back then PEAR had to be v4
compatible.
Today this way of error handling seems even more frustrating, but it's
old code, and
should in my opinion honestly be rewritten to present standards. I
actually did write a
exception based version a lot of years ago, but the package would have
been
required to be renamed Net_NNTP2 or something, and there was a new
version of
NNTP in the works, so I chose to not mess things up. And pretty much
dropped PEAR
altogether...
Regarding the static call to PEAR::isError(), I suppose that it could be
changed into
$this->isError(), since this is apparently how PHP v5.x interprets it.
The Net_NTTP
v1.5.x requires PHP5 anyways due to use of PHP's streaming methods
instead of
Net_Socket, so from this version issues with PHP v4 can safely be
ignored.
The E_STRICT problem relates to ancient packages in PEAR - such as
Net_NNTP and
other mail related packages. Therefore you are always better off
excluding E_STRICT
when 'using' PEAR packages.
http://pear.php.net/manual/en/core.pear.pear.seterrorhandling.php
http://pear.php.net/manual/en/core.pear.pear.intro.php
------------------------------------------------------------------------
[2012-12-16 22:59:14] caronc
One last comment...
after experimenting with your sollution, i get the following now:
Strict Standards: Non-static method PEAR::isError() should not be called
statically, assuming $this from incompatible context in /blah/bla on
line XYZ
Where line ''XYZ' is the PEAR::isError() call..
Now i know i can edit the php.ini file and disable E_STRICT... at least
that's what every Google hit I search for tells me to do... but is that
really the solution... to disable logging?
------------------------------------------------------------------------
[2012-12-16 22:22:32] caronc
Thank you for the followup markup link; I can see this as being a
workaround.
I'm satisfied with that answer and 'suppose' a patch isn't necessary. I
can also understand the requirement for backwards compatibility.
Its just odd to call connect() and receive a false value and continue
working as everything is okay.
With respect to you first comment...are you implying that if i modify
the patch to include a isPostingAllowed() public function you'll accept
it and we can throw away our entire backwards compatibility discussion?
How hypocritical of me to ask eh?
------------------------------------------------------------------------
[2012-12-16 21:50:26] heino
http://svn.php.net/viewvc/pear/packages/Net_NNTP/trunk/docs/examples/phpdoc/con
nect.php?revision=202843&view=markup
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://pear.php.net/bugs/bug.php?id=19752
--
Edit this bug report at https://pear.php.net/bugs/bug.php?id=19752&edit=1