Php Error Handling Library
Contents |
Sign in Pricing Blog Support Search GitHub This repository Watch 20 Star 232 Fork 14 thephpleague/booboo Code Issues 8 Pull requests 3 Projects 0 Pulse Graphs A whoops php modern error handler capable of logging and formatting errors in a variety of
Define Oops
ways. 139 commits 2 branches 8 releases Fetching contributors MIT PHP 100.0% PHP Clone or download Clone with HTTPS whoops laravel Use Git or checkout with SVN using the web URL. Open in Desktop Download ZIP Find file Branch: master Switch branches/tags Branches Tags gh-pages master Nothing to show 1.0.0 0.4.2 0.4.1 0.4.0
Whoops Bakery
0.3.1 0.3.0 0.2.0 0.1.0 Nothing to show New pull request Latest commit 309e9b2 Feb 15, 2016 brandonsavage Updating Travis to include the released PHP 7.0 Permalink Failed to load latest commit information. src Use PHP_EOL constant, to stop unit tests breaking on Windows Oct 7, 2015 tests/unit Use PHP_EOL constant, to stop unit tests breaking on Windows Oct 7, 2015 .gitattributes Adding woops a .gitattributes file. Dec 5, 2014 .gitignore Update .gitignore Feb 27, 2015 .travis.yml Updating Travis to include the released PHP 7.0 Feb 15, 2016 CHANGELOG.md Updating the changelog to reflect work done to this point on future. Mar 3, 2015 CONTRIBUTING.md Adding a contributors document. Dec 14, 2014 LICENSE Adding license and readme. Dec 3, 2014 README.md Fixed typo Mar 19, 2015 composer.json Changing the name of the package to league/booboo for packagist. Feb 25, 2015 phpunit.xml This drops the code coverage amount a lot, but it's actually accurate. Jan 22, 2015 README.md BooBoo Quality Purpose An error handler for PHP that allows for the execution of handlers and formatters for viewing and managing errors in development and production. Because we all make mistakes. Installation This library requires PHP 5.4 or later. One test is skipped against HHVM, but all others pass. BooBoo will support PHP 7 in a future release. It is recommended that you install this library using Composer. $ composer require league/booboo BooBoo is compliant with PSR-1, PSR-2, PSR-3 and PSR-4. If you notice compliance oversights, please send a patch via pull request. Dependencies BooBoo relies
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more
Whops
about Stack Overflow the company Business Learn more about hiring developers or posting ads
Define Upsy Daisy
with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack whoops synonym Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Exceptions/errors handling library for PHP up vote 3 down vote favorite 3 https://github.com/thephpleague/booboo Is there any PHP library for handling exceptions/errors(including fatal) in PHP? It should be very configurable, support log to file, send Emails, and have integration with different browsers console. php debugging exception share|improve this question edited Dec 24 '12 at 21:00 hakre 134k26216390 asked Oct 8 '10 at 10:33 phparch 1407 add a comment| 3 Answers 3 active oldest votes up vote 3 down vote accepted the best library http://stackoverflow.com/questions/3889685/exceptions-errors-handling-library-for-php I found is Lagger - support FirePHP extension for Firefox and has own extension for Google Chrome console share|improve this answer answered Oct 8 '10 at 10:37 barbushin 2,35922135 2 I can't find Google Chrome extension for Lagger. Does it really esists? –phparch Dec 28 '10 at 5:07 chrome.google.com/extensions/detail/… –barbushin Dec 28 '10 at 5:08 add a comment| up vote 0 down vote I've used ErrorHandler in the past but Whoops is way better. Amazing! http://filp.github.io/whoops/ http://filp.github.io/whoops/demo/ share|improve this answer answered Sep 26 '13 at 16:49 Slawa 403616 add a comment| up vote -1 down vote including fatal So after PHP has crashed trying to untangle the source code, you want to run more PHP code to identify where it went wrong? This is not possible with PHP code. share|improve this answer answered Oct 8 '10 at 15:11 symcbean 34.4k42662 You're wrong. For example, I tested Lagger library with fatal error, and it sent me email with error text and saved error to file log. –barbushin Oct 8 '10 at 18:27 @SeniorDev: Lagger is written in PHP - from 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_ERRO
handled in a different way than "Errors". In PHP, any anomaly in the logic such as "Divide by zero" are considered as errors and things such as "Trying to access a private property" is considered as "Exceptions". "Exceptions" are thrown in PHP https://www.owasp.org/index.php/Error_Handler_Library like any other language, but "Errors" are not thrown and they need to be converted to "Exceptions" and thrown accordingly by the programmer. This introduces many confusion among developers as they are accustomed to treat everything as an "Exception" and expect them to be thrown automatically. Need for this Library: PHP has a mechanism that allows the developers to set functions that they can register in case any error is generated. This function, once registered, is php error called whenever an error is generated and then it will be converted to an "Exception" and then will be thrown. In this library we take this task to register the function and to convert them to an "Exception" from the developers and do it ourselves so that they do not have to worry about this. This library first registers the function that converts "Errors" to "Exceptions" so that PHP can call this function and handle it php error handling properly in case any "Error" is generated. This function also has the job to convert the PHP "Error" to "Exception". The name of the exception that is produced after the conversion is "ErrorException". PHPSEC Error Handling Implementation: As per PHP requirements, we first need to define functions to register the function and then to shutdown the function. Then we need to define other methods such as method to convert the error to exceptions. Below is the list of all the function and their uses: enable: This method sets the phpsec error handler as error handler. What we mean is that once the developers calls this function, the PHP's own error handler passes the authority to handle PHP errors to this function. This function checks if the function is already registered or not and if not registered, this method registers our error handler using PHP's "set_error_handler" function. Similarly it also checks if the shutdown function is registered or not and if not registered, it registers our own shutdown function using "register_shutdown_function". In addition to all the above mentioned task, it also saves the PHP's current error reporting state for in case the user wants to turn off our error reporting mechanism, they can go back to their own PHP's error reporting mechanism. disable: This function does the exact opposite of the "Enable" function. It first checks if t