Re: Patch for bugs in errorhandling in PEAR 1.3
| From: | Ian Eure | Date: | Wed, 03 Mar 2004 20:20:48 +0000 |
| Subject: | Re: Patch for bugs in errorhandling in PEAR 1.3 | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-26068@lists.php.net to get a copy of this message | ||
On Wednesday 03 March 2004 02:30 am, Markus Kalkbrenner wrote:
> Hi!
>
> Due to the fact that nobody replied to my last mail, I'll try it twice.
>
> The errorhandling of PEAR contains some bugs regarding how to detect if a
> method is called staticly or not. In PEAR 1.3 the check for
> isset($this)
> in methods like setErrorHandling() was replaced by
> isset($this) && is_a($this, 'PEAR')
>
I submitted that patch, as it worked for me. But you're right, it is
deficient. Not as deficient (imo) as killing the calling script with a PHP
error when it gets called from a class that doesn't extend PEAR, though.
Either way, static functions in PHP aren't supposed to touch $this, so the
only proper solution is to add static-only methods, like
pushGlobalErrorHandling(). That obviously isn't going to happen, since it
breaks BC. Sigh.
Patch looks good.