You can install this plugin into your CakePHP application using composer.
The recommended way to install composer packages is:
composer require fusic/encount
// config/bootstrap.php
<?php
// web
use Encount\Error\EncountErrorHandler;
(new EncountErrorHandler(Configure::read('Error')))->register();
// shell
use Encount\Console\EncountConsoleErrorHandler;
(new EncountConsoleErrorHandler(Configure::read('Error')))->register();
// 3.4.0 or higher
// src/Application.php
<?php
use Encount\Middleware\EncountErrorHandlerMiddleware;
$middleware
//->add(new ErrorHandlerMiddleware(Configure::read('Error.exceptionRenderer')))
->add(new EncountErrorHandlerMiddleware(Configure::read('Error.exceptionRenderer')))
// config/app.php
<?php
return [
-snip-
'Error' => [
'errorLevel' => E_ALL & ~E_DEPRECATED,
'exceptionRenderer' => 'Cake\Error\ExceptionRenderer',
'skipLog' => [],
'log' => true,
'trace' => true,
// Encount config
'encount' => [
'force' => false,
'sender' => ['Encount.Mail'],
'mail' => [
'prefix' => '',
'html' => true
]
],
],
-snip-
'Email' => [
'default' => [
'transport' => 'default',
'from' => 'you@localhost',
//'charset' => 'utf-8',
//'headerCharset' => 'utf-8',
],
// Encount Email config
'error' => [
'transport' => 'default',
'from' => '[email protected]',
'to' => '[email protected]'
]
],
-snip-
];