Skip to content

LancersDevTeam/encount

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Encount plugin for CakePHP

Code Quality

Installation

You can install this plugin into your CakePHP application using composer.

The recommended way to install composer packages is:

composer require fusic/encount

Usage

// 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

// 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-

];

Sender

Encount.Mail

Packages

No packages published

Languages

  • PHP 100.0%