@anonymous-piwik-user opened this Issue on January 26th 2009

If a developer uses the API as described in the tutorial at http://dev.piwik.org/trac/wiki/API/CallingTechniques it is difficult to use inside of an existing project that already sets the error_handler and exception_handler or has a different level of error reporting enabled in php. It should be possible to make it optional to call set_exception_handler and set_error_handler so that it is simpler to integrate the piwik API directly into an existing code base.

I have attached a simplistic patch that makes it possible for a user to define DISABLE_PIWIKERROR inside of their code so that it is possible to integrate the API directly into a project without resetting the error_handler and exception_handler.

I'm sure that this could be done better as the submitted patch has the limitation that it won't catch any serious errors that might actually occur in the API, but it does allow a user to integrate the API as part of a large code base (in my case drupal).

Let me know if you have any questions/comments.

@anonymous-piwik-user commented on January 26th 2009

Attachment: Patch index.php to disable error handlers

@mattab commented on February 11th 2009 Member

fixed in [890]

you can now disable piwik error handler and exception handler by doing:
define('ENABLE_ERROR_HANDLER', false);

This Issue was closed on August 18th 2009
Powered by GitHub Issue Mirror