2017 © Pedro Peláez
 

library exception

Exception Handler

image

ignaszak/exception

Exception Handler

  • Tuesday, July 11, 2017
  • by ignaszak
  • Repository
  • 1 Watchers
  • 0 Stars
  • 244 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

ignaszak/exception

Build Status Coverage Status, (*1)

This package provides error handler interface, (*2)

Screnshot, (*3)

Installing

The package is avilable via Composer/Packagist, so just add following lines to your composer.json file:, (*4)

"require" : {
    "ignaszak/exception" : "*"
}

or:, (*5)

php composer.phar require ignaszak/exception

Running Tests

Just run phpunit from the working directory, (*6)

php phpunit.phar

Requirments

php >= 7.0, (*7)

Example

include __DIR__ . '/autoload.php';

$exception = new Ignaszak\Exception\Start;

// Set which PHP errors are reported
$exception->errorReporting = E_ALL;

// Set display mode if error occured:
//    'dev'      - full developer error interface
//    'user'     - simple message for users
//    'location' - redirect to oder site with custom error message
//    'none'     - set no display
$exception->display = 'dev';

// Set which PHP errors are displayed in 'user' or 'location' mode
$exception->userReporting = E_ALL & ~E_NOTICE;

// Set message for 'user' mode
$exception->userMessage = 'Error occured.';

// Set location adress for 'location' mode
$exception->userLocation = 'http://example.com';

// Create log file if error occured
$exception->createLogFile = true;

// Log files dir
$exception->logFileDir = __DIR__ . '/logs';

$exception->run();

// Make some errors
notice;

class Test {
    public function throwException()
    {
        throw new Exception('Test exception');
    }
}

try {
    (new Test)->throwException();
} catch (Exception $e) {
    $exception->catchException($e);
}

fatalError();

The Versions

11/07 2017

dev-master

9999999-dev

Exception Handler

  Sources   Download

MIT

The Requires

 

by Tomasz Ignaszak

exception error handler

03/02 2016

v1.1.2

1.1.2.0

Exception Handler

  Sources   Download

MIT

The Requires

 

by Tomasz Ignaszak

exception error handler

30/01 2016

v1.1.1

1.1.1.0

Exception Handler

  Sources   Download

MIT

The Requires

 

by Tomasz Ignaszak

exception error handler

17/01 2016

v1.1.0

1.1.0.0

Exception Handler

  Sources   Download

MIT

The Requires

  • php >=7.0

 

by Tomasz Ignaszak

exception error handler

11/12 2015

v1.0.0

1.0.0.0

Exception Handler

  Sources   Download

MIT

The Requires

  • php >=5.5

 

by Tomasz Ignaszak

exception error handler