PHPackages                             sobstel/execution - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. sobstel/execution

AbandonedLibrary

sobstel/execution
=================

Handles unrecoverable fatal errors.

2121PHP

Pushed 13y ago2 watchersCompare

[ Source](https://github.com/sobstel/Execution)[ Packagist](https://packagist.org/packages/sobstel/execution)[ RSS](/packages/sobstel-execution/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersionsUsed By (0)

Execution
=========

[](#execution)

Introduction
------------

[](#introduction)

When there is a problem with your web application, you do not want your visitors to see "fatal error" messages. Instead you want to be able to show them a more friendly page telling them what might be wrong or what they should do when they encounter such an error.

Fatal errors in PHP abort your script, but with this library you can add hooks to the shutdown system of PHP. This allows you to show more user-friendly error messages.

Requirements
------------

[](#requirements)

PHP 5.3+

Class loading
-------------

[](#class-loading)

Library can be loaded by including Execution.php file, it's also psr0 compatible.

```
// plain old require_once
require_once 'src/Execution/Execution.php';

// symfony2 autoloader
$loader = new \Symfony\Component\ClassLoader\UniversalClassLoader();
$loader->registerNamespaces(array(
    'Execution' => 'vendor/Execution/src',
));
$loader->register();

```

Usage
-----

[](#usage)

Call *Execution\\Execution::setErrorHandler($callback)* to initialize. *$callback* is any valid callback (array, string, closure, invokable object). *setErrorHandler* registers the necessary handlers with PHP.

Callback should expect one argument, which is associative array having following keys:

```
[type] => 1
[message] => Call to undefined function a()
[file] => /var/www/app/index.php
[line] => 12

```

Sample callback:

```
$callback = function($error) {
  $message = $error['message'];

  echo "This application did not succesfully finish its request. ".
        "The reason was:\n$message\n\n";
}

Execution\Execution::setErrorHandler($callback);

```

The library uses the register\_shutdown\_function() to allow the catching of fatal errors.

Tests
-----

[](#tests)

Simply type `phpunit tests` to run all tests.

Credits
-------

[](#credits)

Version 1.0 is derivative of ezcExecution package of ezComponents, which was originally developed by Sergey Alexeev, Sebastian Bergmannm, Jan Borsodim, Raymond Bosman, Frederik Holljen, Kore Nordmann, Derick Rethans, Vadym Savchuk, Tobias Schlitt and Alexandru Stanoi.

Major improvements in comparison with original ezcComponent:

- you can pass any callback, including closures and invokable objects (it is if they have \_\_invoke() method implemented),
- slimed and simplified,
- rewritten tests (100% code coverage).

Version 2.0 has been re-written from the scratch with more simplicity in mind. Credits go for my co-worker Paul Kamer, who used this trick in our code.

###  Health Score

13

—

LowBetter than 1% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity8

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/7457bb91566e5572c2d429636acc1ceada24a28335f662357c10a34c3693427a?d=identicon)[sobstel](/maintainers/sobstel)

---

Top Contributors

[![sobstel](https://avatars.githubusercontent.com/u/117428?v=4)](https://github.com/sobstel "sobstel (18 commits)")

### Embed Badge

![Health badge](/badges/sobstel-execution/health.svg)

```
[![Health](https://phpackages.com/badges/sobstel-execution/health.svg)](https://phpackages.com/packages/sobstel-execution)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
