PHP code example of jonatanmdez / php-error-handlers
1. Go to this page and download the library: Download jonatanmdez/php-error-handlers library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
jonatanmdez / php-error-handlers example snippets
// Create an array of configuration data to pass to the handler class
$config = [
'handlers' => [
// *Can* be the class name, not-namespaced
// The namespace will be "interpolated" in such cases
'NewrelicHandler' => [
],
// Can also rs\Handler($config))->register();
// Enjoy throwing exceptions and reporting them upstream
throw new \Exception('Test Exception');
$config = [
'handlers' => [
'BugsnagHandler' => [
'clientCallback' => function ($client) {
// do something interesting to the client
$client->setAppVersion('1.0.0');
return $client;
},
],
],
];
// around line 100
$isCli = PHP_SAPI === 'cli';
if ($isCli) {
(new \Josegonzalez\ErrorHandlers\Cake\ConsoleErrorHandler(Configure::read('Error')))->register();
} else {
(new \Josegonzalez\ErrorHandlers\Cake\ErrorHandler(Configure::read('Error')))->register();
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.