2017 © Pedro Peláez
 

library error-handler

Error handler module for zend framework 3

image

vim/error-handler

Error handler module for zend framework 3

  • Friday, January 19, 2018
  • by vanvas
  • Repository
  • 1 Watchers
  • 0 Stars
  • 8 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

error-handler

Module for Zend Framework 3., (*1)

Installation

Installation of this module uses composer. For composer documentation, please refer to getcomposer.org., (*2)

composer require vim/error-handler

Register Vim\ErrorHandler in config/modules.config.php:, (*3)

<?php
return [
    'Vim\ErrorHandler',
];

Drivers

  • \Vim\ErrorHandler\Driver\DbDriver
  • \Vim\ErrorHandler\Driver\LogDriver

Default driver is \Vim\ErrorHandler\Driver\DbDriver., (*4)

To use Log Driver:

composer require zendframework/zend-log
<?php
return [
    'error_handler' => [
        'driver_list' => [
            \Vim\ErrorHandler\Driver\LogDriver::class,
        ],
    ],
];

Register Zend\Log in config/modules.config.php:, (*5)

<?php
return [
    'Zend\Log',
];

To import log data from file into database:

composer require zendframework/zend-mvc-console

Register Zend\Mvc\Console in config/modules.config.php:, (*6)

<?php
return [
    'Zend\Mvc\Console',
];

Add cron task:, (*7)

php public/index.php import_error_from_log_to_db

Entity paths

<?php
return [
    'doctrine' => [
        'driver' => [
            'application_annotation_driver' => [
                'paths' => [
                    './vendor/vim/error-handler/src/Entity',
                ],
            ],
            'orm_default' => [
                'drivers' => [
                    'Vim\ErrorHandler\Entity' => 'application_annotation_driver',
                ],
            ],
        ]
    ],
];

Map of ignored exceptions

<?php
return [
    'error_handler' => [
        'ignore_exception_map' => [],
    ],
];

Example

<?php
return [
    'error_handler' => [
        'ignore_exception_map' => [
            \MyModule\Exception\ExceptionOne::class,
            \MyModule\Exception\ExceptionTwo::class,
        ],
    ],
];

Map of codes

<?php
return [
    'error_handler' => [
        'code_map' => [
            E_ERROR => \Vim\ErrorHandler\Constant\ErrorHandlerConstant::FATAL,
            E_USER_ERROR => \Vim\ErrorHandler\Constant\ErrorHandlerConstant::FATAL,
            E_PARSE => \Vim\ErrorHandler\Constant\ErrorHandlerConstant::FATAL,
            E_COMPILE_ERROR => \Vim\ErrorHandler\Constant\ErrorHandlerConstant::FATAL,
            E_COMPILE_WARNING => \Vim\ErrorHandler\Constant\ErrorHandlerConstant::FATAL,
            E_CORE_ERROR => \Vim\ErrorHandler\Constant\ErrorHandlerConstant::FATAL,
            E_RECOVERABLE_ERROR => \Vim\ErrorHandler\Constant\ErrorHandlerConstant::FATAL,
            E_WARNING => \Vim\ErrorHandler\Constant\ErrorHandlerConstant::WARNING,
            E_STRICT => \Vim\ErrorHandler\Constant\ErrorHandlerConstant::WARNING,
            E_CORE_WARNING => \Vim\ErrorHandler\Constant\ErrorHandlerConstant::WARNING,
            E_USER_WARNING => \Vim\ErrorHandler\Constant\ErrorHandlerConstant::WARNING,
            E_DEPRECATED => \Vim\ErrorHandler\Constant\ErrorHandlerConstant::WARNING,
            E_USER_DEPRECATED => \Vim\ErrorHandler\Constant\ErrorHandlerConstant::WARNING,
            E_NOTICE => \Vim\ErrorHandler\Constant\ErrorHandlerConstant::NOTICE,
            E_USER_NOTICE => \Vim\ErrorHandler\Constant\ErrorHandlerConstant::NOTICE,
        ],
    ],
];

The Versions

19/01 2018

dev-master

9999999-dev https://github.com/vanvas/error-handler.git

Error handler module for zend framework 3

  Sources   Download

The Requires

 

php zend framework error handler zf2 module zf3 module

19/01 2018