Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calling set_error_handler and set_exception_handler as part of the API makes it difficult to use #525

Closed
anonymous-matomo-user opened this issue Jan 26, 2009 · 2 comments
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Milestone

Comments

@anonymous-matomo-user
Copy link

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-matomo-user
Copy link
Author

Attachment: Patch index.php to disable error handlers
[index.php.patch1](http://issues.piwik.org/attachments/525/index.php.patch1)

@mattab
Copy link
Member

mattab commented Feb 11, 2009

fixed in 890

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

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Projects
None yet
Development

No branches or pull requests

2 participants