[horde] Horde_Exception leads to PHP-Error

stephan at admin.nabira.de stephan at admin.nabira.de
Thu May 5 13:05:15 UTC 2011


Hi everyone,

I almost forgot this problem, but obviously I have found a dirty  
workaround for this problem, since I'm testing horde4 and posting bug  
reports. ;)

After commenting out everything except the part inside the "this"  
bracket of the if statement, the PHP_Fatal_ERROR was gone. However I  
assume, that this breaks support for PHP Versions >= 5.3.0. So I  
recommend to use this "fix" with caution!

diff of lines commented out of Horde/Exception.php (framework):

2c2
< //if (version_compare(PHP_VERSION, '5.3.0', '<')) {
---
> if (version_compare(PHP_VERSION, '5.3.0', '<')) {
67c67
< //} else {
---
> } else {
79,80c79,80
< //    class Horde_Exception extends Exception
< //    {
---
>     class Horde_Exception extends Exception
>     {
87,89c87,89
< //        public $details;
< //    }
< //}
---
>         public $details;
>     }
> }


Zitat von Stephan Kleber <stephan at admin.nabira.de>:

> Hi everyone,
>
> I hope this is the right place to bring up this presumed bug.
>
> I found my problem discussed, but not solved here:
> http://lists.horde.org/archives/horde/Week-of-Mon-20101206/039564.html
>
> I assume it is an issue with the workaround for the PHP-Exception class
> with PHP-Version < 5.3 when the class definition of Exception.php is used.
>
> If any script part runs into an exception, PHP shows this error:
> PHP Fatal error:  Cannot redeclare class Horde_Exception in
> /usr/share/php/Horde/Exception.php on line 17
>
> If I insert a debug_print_backtrace(); in line 17 in Horde/Exception.php
> I end up with the stacktrace given in the attachment upon opening the
> main index.php of horde with the browser. The Exception was not thrown
> with an empty (as distributed) configuration in conf.php
>
> Any suggestions where this error originates?
>
> I use Horde 4.0.1 downloaded and installed from pear.
>
> Kind regards
> Stephan




More information about the horde mailing list