JosephLenton / PHP-Error

Better error reporting for PHP, and prettier too!
1.35k stars 151 forks source link

Fails on WordPress #8

Closed Geczy closed 12 years ago

Geczy commented 12 years ago
[02-Jul-2012 15:51:50 UTC] Redefining already defined constructor for class WP_Widget
           C:\wamp\www\wordpress\wp-includes\widgets.php, 93
        #0 C:\wamp\www\wordpress\wp-settings.php(144): php_error\{closure}(2048, 'Redefining alre...', 'C:\wamp\www\wor...', 93, Array)
        #1 C:\wamp\www\wordpress\wp-settings.php(144): require()
        #2 C:\wamp\www\wordpress\wp-config.php(96): require_once('C:\wamp\www\wor...')
        #3 C:\wamp\www\wordpress\wp-load.php(29): require_once('C:\wamp\www\wor...')
        #4 C:\wamp\www\wordpress\wp-admin\admin.php(30): require_once('C:\wamp\www\wor...')
        #5 C:\wamp\www\wordpress\wp-admin\index.php(10): require_once('C:\wamp\www\wor...')
        #6 {main}

Turning on php_error.wordpress = On fixes this issue...Not ideal, though

JosephLenton commented 12 years ago

The core problem is that the Wordpress code base is full of minor errors, whilst the whole point of this library is to be ultra strict about errors. They don't go hand in hand.

An ideal solution would be to detect if it's wordpress, and then be less strict about error reporting, but that's easy to say.

You can also use 'withoutErrors', and pass a callback into there. That's useful if your loading wordpress for a specific section, such as to grab out some blog posts for a non-Wordpress page.

Geczy commented 12 years ago

Oh I see! So your class actually just quits if there's any error or notice at all, right?

JosephLenton commented 12 years ago

Yes.

The idea is that for those times when you just want to try the code, by having a very aggressive and "look at me" attitude with errors, you'll be more focused churn away at the errors one at a time. It also means the minor ones are just as important.

Essentially, you are forced to fix every bug it finds, there and then.

Geczy commented 12 years ago

I like this. Thanks for clearing that up, I was used to xdebug's ways of continuing to execute the rest of the script, yet showing the errors at the top.

Perhaps a new issue for a feature request to "continue = on" rather than quit? Unless this exists already?

Geczy commented 12 years ago

Closing as this is intentional behavior