PHPackages                             stafred/detector - 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. [Logging &amp; Monitoring](/categories/logging)
4. /
5. stafred/detector

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

stafred/detector
================

Error detection and startup services

025PHP

Since Sep 18Pushed 2y ago1 watchersCompare

[ Source](https://github.com/stafred/detector)[ Packagist](https://packagist.org/packages/stafred/detector)[ RSS](/packages/stafred-detector/feed)WikiDiscussions master Synced 5d ago

READMEChangelogDependenciesVersions (1)Used By (0)

Detector
========

[](#detector)

```
composer require stafred/detector
```

About Detector
==============

[](#about-detector)

the package is used to detect errors and exceptions with a small set of settings. the detector is lightweight and allows you to run any code in the handler. specify the settings to run: the path to the folder with the error log, the name of the error log file, permission to display brief information about the error, permission to start the debugger, or part of a subroutine.

Methods
=======

[](#methods)

```
->setErrorDebug(...)
```

```
->setErrorInfo(...)
```

```
->setErrorNameLog(...)
```

```
->setErrorPathLog(...)
```

```
->make(...)
```

Example
=======

[](#example)

```
$detector = new \Detector\Run;
$detector->setErrorDebug(your_constant_or_value);
$detector->setErrorInfo(your_constant_or_value);
$detector->setErrorNameLog(your_constant_or_value);
$detector->setErrorPathLog(your_constant_or_value);
$detector->make(function(){
     your_handler_or_code
});
```

Example With Package Filp\\Whoops
=================================

[](#example-with-package-filpwhoops)

```
$detector = new \Detector\Run;
$detector->setErrorDebug('APP_DEBUG');
$detector->setErrorInfo('ERROR_INFO');
$detector->setErrorNameLog('ERROR_NAME_LOG');
$detector->setErrorPathLog('ERROR_PATH_LOG');
$detector->make(function(){
     $whoops = new \Whoops\Run;
     $whoops->pushHandler(new \Whoops\Handler\PrettyPageHandler);
     $whoops->register();
});
```

Timing
======

[](#timing)

```
APP_DEBUG = false : max response 0.009 sec
APP_DEBUG = true  : max response 0.014 sec (+55%)
```

###  Health Score

14

—

LowBetter than 2% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity21

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/bff4f89f881ede2387c219eed6171154047b505019f2eb18bf9982ef54d0cb92?d=identicon)[stafred](/maintainers/stafred)

---

Top Contributors

[![stafred](https://avatars.githubusercontent.com/u/69296216?v=4)](https://github.com/stafred "stafred (28 commits)")

### Embed Badge

![Health badge](/badges/stafred-detector/health.svg)

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

###  Alternatives

[psr/log

Common interface for logging libraries

10.4k1.2B9.2k](/packages/psr-log)[itsgoingd/clockwork

php dev tools in your browser

5.9k27.6M94](/packages/itsgoingd-clockwork)[graylog2/gelf-php

A php implementation to send log-messages to a GELF compatible backend like Graylog2.

41838.2M138](/packages/graylog2-gelf-php)[bugsnag/bugsnag-psr-logger

Official Bugsnag PHP PSR Logger.

32132.5M2](/packages/bugsnag-bugsnag-psr-logger)[consolidation/log

Improved Psr-3 / Psr\\Log logger based on Symfony Console components.

15462.2M7](/packages/consolidation-log)[datadog/php-datadogstatsd

An extremely simple PHP datadogstatsd client

19124.6M15](/packages/datadog-php-datadogstatsd)

PHPackages © 2026

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