2017-25 © Pedro Peláez
 

library exception-handler

Flexible exception handler for PHP

image

ashterix/exception-handler

Flexible exception handler for PHP

  • Wednesday, March 18, 2015
  • by Ashterix
  • Repository
  • 2 Watchers
  • 1 Stars
  • 65 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Exception handler

Flexible exception handler for PHP., (*1)

Requirement

  • PHP >= 5.4
  • "ashterix/log-to-file": "dev-master"

Installation

Via Composer:, (*2)

require "ashterix/exception-handler": "dev-master"

Features

This class has a number of exception handlers: - A simple inscription; - Write to a file; - Sending messages to email; - Elimination of Custom html page; - Plans to add SMS sending and http pusher., (*3)

Class allows you to combine different handlers, by comparing the input parameter with a bitmask. Therefore, in the input parameter of the method ->setTypeHandler() recommended to use the predefined constants TypesExceptionHandlers::E_TYPE_..., (*4)

Predefined types of handlers

TypesExceptionHandlers::E_TYPE_WRITE;   // write to console or browser
TypesExceptionHandlers::E_TYPE_LOG;     // write to log file
TypesExceptionHandlers::E_TYPE_EMAIL;   // send message to email
TypesExceptionHandlers::E_TYPE_HTML;    // print custom html page

Usage


use UFOException\FacadeException; use UFOException\Interfaces\TypesExceptionHandlers; $myException = new FacadeException(); // Set configs $myException->config ->setTypeHandler(TypesExceptionHandlers::E_TYPE_WRITE | TypesExceptionHandlers::E_TYPE_LOG) ->setLogFileName("tmp/logs/logfile.log"); // Register new exception handler $myException->registerHandler(); // ... // do something // ... throw new Exception('My exception message');

License

This library is available under the MIT license., (*5)

The Versions

18/03 2015

dev-master

9999999-dev

Flexible exception handler for PHP

  Sources   Download

MIT

The Requires

 

by Alex Maystrenko

18/03 2015

1.1.0

1.1.0.0

Flexible exception handler for PHP

  Sources   Download

MIT

The Requires

 

by Alex Maystrenko

16/03 2015

1.0.0

1.0.0.0

Flexible exception handler for PHP

  Sources   Download

MIT

The Requires

 

by Alex Maystrenko