Giter VIP home page Giter VIP logo

encount's Introduction

Encount plugin for CakePHP5.x.

Requirements

  • PHP >= 8.1.*
  • CakePHP >= 5.*

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

use Encount\Error\EncountErrorTrap;
use Encount\Error\EncountExceptionTrap;

/*
 * Register application error and exception handlers.
 */
// (new ErrorTrap(Configure::read('Error')))->register();
// (new ExceptionTrap(Configure::read('Error')))->register();
(new EncountErrorTrap(Configure::read('Error')))->register();
(new EncountExceptionTrap(Configure::read('Error')))->register();
// src/Application.php
<?php

use Encount\Middleware\EncountErrorHandlerMiddleware;

$middleware
    // ->add(new ErrorHandlerMiddleware(Configure::read('Error'), $this))
    ->add(new EncountErrorHandlerMiddleware(Configure::read('Error'), $this))

Config

// config/app.php
<?php

return [

-snip-

    'Error' => [
        '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's People

Contributors

kozo avatar satthi avatar gorogoroyasu avatar k1low avatar tsukabo avatar

Stargazers

 avatar Yuki Kanazawa avatar tsmsogn avatar HirokazuKano avatar ISAYAMA Teppei avatar  avatar seike460 avatar m-shimao avatar Takashi Nojima avatar uzulla / Junichi Ishida avatar

Watchers

 avatar James Cloos avatar  avatar  avatar

encount's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.