[wp-hackers] Re: Plugin could not be activated because it triggered

DD32 wordpress at dd32.id.au
Thu Jun 21 12:53:05 GMT 2007


http://au2.php.net/manual/en/function.set-error-handler.php

"The following error types cannot be handled with a user defined function:
E_ERROR, E_PARSE, E_CORE_ERROR, E_CORE_WARNING, E_COMPILE_ERROR,
E_COMPILE_WARNING, and most of E_STRICT raised in the file where
set_error_handler() is called.

If errors occur before the script is executed (e.g. on file uploads) the
custom error handler cannot be called since it is not registered at that
time."

I agree that other information printed by the plugin(not PHP Errors) would
be useful to pass through to the plugin activated page though..
Something like this:

"
Plugin activated. (Standard WP response)
This Plugin is a BETA release, Please report any errors to me at blah blah
blah (output of the Plugin script while being activated)
"
That way it could be handled on a more general plugin aspect, It doesnt
seem right plugin authors capturing the output of their plugins when being
activated, If you want to store the message for later, just store it
instead of echoing the message.

On Thu, 21 Jun 2007 21:48:25 +1000, ozgreg <wphackers at galleryembedded.com>
wrote:

>
> wordpress at dd32.id.au wrote:
>>
>> The issue with trapping the error output is that its incredibly hard to
>> do..
>> Once a "Fatal" error occurs, the PHP script stops in its tracks, PHP  
>> Error
>> handlers CAN NOT do fatal errors, only notices/warnings(i think) and  
>> user
>> triggered errors.
>
>
> Actually this is incorrect, you might want to have a look at the php  
> manual under Error Handling and Logging Functions, php gives you a huge  
> array of possible ways to trap errors and how to handle them..  However  
> all that to one side, the issue here is not really just about errors it  
> is *any* message that is generated during activation, including warnings  
> etc..
>
> As I posted, put a error action hook in place on activation and we will  
> trap the messages on a plugin by plugin basis..  Hooks are cheap, just a  
> line of code..
>
> ------------------------
> WPG2 Installation, Operation & FAQ Documentation  
> (http://wpg2.galleryembedded.com/)
>
>
>
>
> -------------------- m2f --------------------
>
> Gallery2 Embedded Forums (http://www.galleryembedded.com/forums/)
> -------------------- m2f --------------------
>
>
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers

-- 
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/


More information about the wp-hackers mailing list