Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fusic/encount
ErrorHandler for CakePHP
https://github.com/fusic/encount
cakephp composer
Last synced: 2 months ago
JSON representation
ErrorHandler for CakePHP
- Host: GitHub
- URL: https://github.com/fusic/encount
- Owner: fusic
- License: mit
- Created: 2016-02-20T17:53:53.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2024-02-21T11:57:00.000Z (10 months ago)
- Last Synced: 2024-09-30T08:04:12.955Z (3 months ago)
- Topics: cakephp, composer
- Language: PHP
- Homepage:
- Size: 44.9 KB
- Stars: 10
- Watchers: 4
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Encount plugin for CakePHP5.x.
## Requirements
- PHP >= 8.1.*
- CakePHP >= 5.*## Installation
You can install this plugin into your CakePHP application using [composer](http://getcomposer.org).
The recommended way to install composer packages is:
```
composer require fusic/encount
```## Usage
```php
// config/bootstrap.php
register();
// (new ExceptionTrap(Configure::read('Error')))->register();
(new EncountErrorTrap(Configure::read('Error')))->register();
(new EncountExceptionTrap(Configure::read('Error')))->register();
``````php
// src/Application.php
add(new ErrorHandlerMiddleware(Configure::read('Error'), $this))
->add(new EncountErrorHandlerMiddleware(Configure::read('Error'), $this))
```## Config
```php
// config/app.php
[
'errorLevel' => E_ALL & ~E_DEPRECATED,
'skipLog' => [],
'log' => true,
'trace' => true,
'encount' => [
'force' => false,
'sender' => [
'Encount.Mail',
],
// ignore ex)
// 'deny' => [
// 'exception' => [
// '\Cake\Http\Exception\MissingControllerException', // 404
// '\Cake\Http\Exception\MethodNotAllowedException', // 404
// '\Cake\Http\Exception\ForbiddenException', // isAuthorized
// '\Cake\Controller\Exception\MissingActionException', // 404
// '\Cake\Datasource\Exception\RecordNotFoundException', // notFoundRecored
// ],
// ],
],
],-snip-
'EmailTransport' => [
'default' => [
],
// Encount Email config
'encount' => [
'className' => SmtpTransport::class,
'port' => xxx,
'timeout' => xx,
'host' => 'xxxxxxxxxxxxxxxxx',
'username' => '[email protected]',
'password' => 'xxxxxxxx',
'log' => true,
'tls' => true,
],
],'Email' => [
'default' => [
],
// Encount Email config
'error' => [
'transport' => 'encount',
'from' => '[email protected]',
'to' => '[email protected]',
'charset' => 'utf-8',
'headerCharset' => 'utf-8',
],
],-snip-
];
```## Sender
### Encount.Mail
### [Encount sender for faultline](https://github.com/fusic/encount-sender-faultline)