System - Debug does not work if any 3rd party extension uses php's function register_shutdown_function
i had recently wrote a plugin to send an email upon php's fatal error. it uses a code:
if (function_exists('register_shutdown_function'))
register_shutdown_function( "fatal_error_catcher" );
this code registers a shutdown function which is trigerred after php code is executed, but it also means that destructors are called once the output buffer is not possible to modify (connection to the client may be already closed).
i do not think that is's a proper event to load joomla's plugins on it's desctructor, but rather the core joomla should use it's own events to handle the plugin's output. (onAfterRender or other)
we find the php's register_shutdown_function function very useful especially on fastcgi/fpm php server where the connection can be closed (further with fastcgi_finish_request) and thus site speed is much better when we move time intensive work to this function:
if you'd like to use our "fatal catcher plugin" you may download it here (it's completely free for any use):
http://www.rupostel.com/free-virtuemart-extensions/extensions/fatal-catcher-plugin
No debug output is shown
tested on php5.3 to php5.6
and joomla 1.5, 2.5 and 3.3.6
Follow the Joomla event mechanism instead of trying to catch the destructor event, especially if it's not triggered by user code - there is no unset within the dispatcher.
Labels |
Added:
?
|
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2015-06-27 21:09:36 |
Closed_By | ⇒ | Bakual | |
Build | 3.3.6 | ⇒ | staging |
Closing as we have a PR.