Download the PHP package murganikolay/debug-errorhook without Composer

On this page you can find all versions of the php package murganikolay/debug-errorhook. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package debug-errorhook

Debug_ErrorHook: Intercept PHP errors (including fatals) and process them (e.g. send to E-mail). (C) Dmitry Koterov, http://en.dklab.ru/lib/Debug_ErrorHook/

This library allows to intercept PHP errors (including fatal!) with their context (file name, line number, often - stack trace, environment etc.) and do some work with this information. You may add any number of hooks which will be called in case of errors.

The most common usage is to send PHP notices, warnings and even fatal errors to developer's E-mail. Of course this sending is wise: if the same error already happened within N seconds, it will not be resent, so the mailbox is never overloaded, and sendmail program cannot crash the whole system even if your site is very popular.

Commony errors and notices are sent to web server's logs and die there. Nobody monitors server logs oftenly. If these errors are sent do developers' emails, developers could react immediately and fix them. It is quite handy, especially just after production deployment, and it works great especially for fatal errors.

Usage sample

Execute this in your script's bootstrap code:

$errorsToMail = new Debug_ErrorHook_Listener(); $errorsToMail->addNotifier( new Debug_ErrorHook_RemoveDupsWrapper( new Debug_ErrorHook_MailNotifier( "[email protected]", Debug_ErrorHook_TextNotifier::LOG_ALL ), "/tmp/errors", // lock directory 300 // do not resend the same error within 300 seconds ) );

Or using factory: $factory = new \Debug\ErrorHook\ErrorHookFactory(); $errorsToMail = $factory->create(require 'config/errorhook.php');

// Attention! When $errorsToMail is destroyed (e.g. went out of // scope), error hooks are removed. Hooks are active till $errorsToMail's // destructor execution. So you should commonly save $errorsToMail somewhere // in a safe place (e.g. in $GLOBALS or in a class static property) and // be sure it is not destroyed until your script is finished.

Be sure to set error_reporting(E_ALL) to catch all notices. To test notice emailing, execute something like:

echo $non_existed_var; call_non_existed_function();

You will receve 2 mails at [email protected] mailbox. First:

From: [email protected] To: [email protected] Subject: [ERROR] E_NOTICE: Undefined variable: a at script.php on line 10

//example.com/script.php?args E_NOTICE: Undefined variable: a at script.php on line 10

TRACE:

SERVER: COOKIES: GET: POST: SESSION: Second mail will contain information about your fatal error. (Unfortunately PHP does not allow to get stack trace for fatal errors, but other information will be mailed correctly, including file name, line number and superglobals state.)

All versions of debug-errorhook with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package murganikolay/debug-errorhook contains the following files

Loading the files please wait ....