PHPackages                             crontinel/php - 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. crontinel/php

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

crontinel/php
=============

Framework-agnostic PHP core for Crontinel — data objects, monitor contracts, and alert management.

v0.1.1(1mo ago)0512↓100%MITPHPPHP ^8.2|^8.3|^8.4CI passing

Since Apr 8Pushed 1mo agoCompare

[ Source](https://github.com/crontinel/php)[ Packagist](https://packagist.org/packages/crontinel/php)[ Docs](https://crontinel.com)[ RSS](/packages/crontinel-php/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (6)Versions (4)Used By (0)

crontinel/php
=============

[](#crontinelphp)

[![Latest Version](https://camo.githubusercontent.com/f4dcd9d084cfc47c68bfb42e675cc6009b46bf25632f12e206dab97baee6713a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f63726f6e74696e656c2f7068702e737667)](https://packagist.org/packages/crontinel/php)[![PHP](https://camo.githubusercontent.com/50b13d3d01778282febe11a92c7166976ae637e4ee8ffe64bce210549ed5e096/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e32253230253743253230382e33253230253743253230382e342d626c7565)](https://packagist.org/packages/crontinel/php)[![License](https://camo.githubusercontent.com/403a87e1f3bfcdb4d00db75b18cc06748fd96202997bc880a3a25bc85a36fb9f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f63726f6e74696e656c2f7068702e737667)](LICENSE)

Framework-agnostic PHP core for [Crontinel](https://crontinel.com). Provides monitor contracts, typed data objects, alert management with deduplication, and cron expression helpers.

**If you use Laravel, install [`crontinel/laravel`](https://github.com/crontinel/crontinel) instead.** It pulls in this package automatically and adds service providers, dashboard, Artisan commands, and event listeners.

Install `crontinel/php` directly when you are:

- Building an adapter for Symfony, Slim, or another framework
- Integrating Crontinel into a vanilla PHP application
- Writing a custom monitor that does not depend on Laravel

---

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

[](#requirements)

- PHP 8.2, 8.3, or 8.4
- Composer

Compatibility
-------------

[](#compatibility)

- **Laravel 10, 11, and 12** — install [`crontinel/laravel`](https://github.com/crontinel/crontinel) instead, which wraps this package and adds Laravel-specific integration.
- **Horizon** — this package reads the same Redis keys that Horizon uses. When you install `crontinel/laravel`, the `HorizonMonitor` works out of the box with no additional configuration.
- **Other frameworks** — Symfony, Slim, and any PHP 8.2+ application can use the contracts and data objects directly.

---

Installation
------------

[](#installation)

```
composer require crontinel/php
```

---

What this package provides
--------------------------

[](#what-this-package-provides)

### Contracts

[](#contracts)

- **`MonitorInterface`** -- implement `isHealthy(): bool` to create a custom monitor
- **`AlertChannelInterface`** -- implement `send(AlertEvent $event): void` to deliver alerts via any transport (Slack, email, webhook, etc.)

### Data objects

[](#data-objects)

Immutable, readonly value objects used across the stack:

- **`AlertEvent`** -- key, title, message, level (`critical` / `warning` / `info` / `resolved`), fired timestamp
- **`CronStatus`** -- command, expression, status, last run metadata, next due time
- **`HorizonStatus`** -- Horizon supervisor state
- **`QueueStatus`** -- queue depth, failed count, oldest job age

### Alert management

[](#alert-management)

**`AlertManager`** handles fire/resolve lifecycle with built-in deduplication. It accepts any PSR-16 cache and any `AlertChannelInterface` implementation:

- Deduplicates repeated alerts for the same key (default: 5 min TTL)
- Auto-sends "resolved" notifications when an issue clears
- Logs failures via PSR-3 logger (falls back to `NullLogger`)

### Cron expression helpers

[](#cron-expression-helpers)

**`CronExpressionHelper`** wraps `dragonmantank/cron-expression` with convenience methods:

- `nextDue(string $expression)` -- next scheduled run as `DateTimeImmutable`
- `previousDue(string $expression)` -- last scheduled run
- `isLate(DateTimeInterface $lastRunAt, string $expression, int $graceSeconds = 120)` -- whether a job has missed its window

### Built-in monitors

[](#built-in-monitors)

Ready-to-use monitor implementations (all implement `MonitorInterface`):

- `CronMonitor`, `HorizonMonitor`, `QueueMonitor`

---

Usage example
-------------

[](#usage-example)

Implement `MonitorInterface` to build a custom health check:

```
use Crontinel\Contracts\MonitorInterface;

final class DiskSpaceMonitor implements MonitorInterface
{
    public function __construct(
        private readonly string $path = '/',
        private readonly float $minFreePercent = 10.0,
    ) {}

    public function isHealthy(): bool
    {
        $free = disk_free_space($this->path);
        $total = disk_total_space($this->path);

        return ($free / $total) * 100 >= $this->minFreePercent;
    }
}
```

Wire up alert delivery by implementing `AlertChannelInterface`:

```
use Crontinel\Contracts\AlertChannelInterface;
use Crontinel\Data\AlertEvent;

final class WebhookChannel implements AlertChannelInterface
{
    public function __construct(
        private readonly string $url,
    ) {}

    public function send(AlertEvent $event): void
    {
        file_get_contents($this->url, false, stream_context_create([
            'http' => [
                'method' => 'POST',
                'header' => 'Content-Type: application/json',
                'content' => json_encode([
                    'key'      => $event->key,
                    'title'    => $event->title,
                    'message'  => $event->message,
                    'level'    => $event->level,
                    'resolved' => $event->resolved,
                ]),
            ],
        ]));
    }
}
```

Then use `AlertManager` to fire and resolve alerts:

```
use Crontinel\Alert\AlertManager;

// Requires any PSR-16 cache implementation
$alertManager = new AlertManager(
    cache: $cache,
    channel: new WebhookChannel('https://example.com/webhook'),
);

$monitor = new DiskSpaceMonitor('/data');

if (! $monitor->isHealthy()) {
    $alertManager->fire('disk.data', 'Low disk space', 'Disk /data is below 10% free', 'critical');
} else {
    $alertManager->resolve('disk.data');
}
```

### Using CronExpressionHelper

[](#using-cronexpressionhelper)

```
use Crontinel\Cron\CronExpressionHelper;

$helper = new CronExpressionHelper();

// When is the next run of "every minute"?
$next = $helper->nextDue('* * * * *');
echo $next->format('Y-m-d H:i:s');

// Is a job that's been silent for 10 minutes late for a 5-minute schedule?
$lastRun = new \DateTimeImmutable('2026-04-11 10:50:00');
$isLate = $helper->isLate($lastRun, '*/5 * * * *', graceSeconds: 60);
// Returns true if current time exceeds $lastRun + 5min + 60s grace
```

### Using built-in monitors with AlertManager

[](#using-built-in-monitors-with-alertmanager)

```
use Crontinel\Alert\AlertManager;
use Crontinel\Monitors\QueueMonitor;

$alertManager = new AlertManager(
    cache: $cache,
    channel: new WebhookChannel('https://example.com/alerts'),
);

$queueMonitor = new QueueMonitor(
    redisConnection: 'default',
    maxDepth: 100,
    maxFailed: 10,
);

if (! $queueMonitor->isHealthy()) {
    $status = $queueMonitor->getStatus(); // returns QueueStatus object
    $alertManager->fire(
        'queue.depth',
        'Queue depth exceeded',
        "Queue has {$status->depth} jobs (max: 100)",
        'warning',
    );
}
```

---

Ecosystem
---------

[](#ecosystem)

PackageDescription[crontinel/php](https://github.com/crontinel/php) (this repo)Framework-agnostic PHP core[crontinel/laravel](https://github.com/crontinel/crontinel)Laravel package with dashboard, Artisan commands, and event listeners[crontinel/mcp-server](https://github.com/crontinel/mcp-server)MCP server for AI assistants (Claude, Cursor)[docs.crontinel.com](https://docs.crontinel.com)Full documentation[app.crontinel.com](https://app.crontinel.com)Hosted SaaS dashboard---

License
-------

[](#license)

MIT. See [LICENSE](LICENSE).

Built by [Harun R Rayhan](https://github.com/HarunRRayhan) · [crontinel.com](https://crontinel.com)

###  Health Score

42

—

FairBetter than 88% of packages

Maintenance91

Actively maintained with recent releases

Popularity17

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 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.

###  Release Activity

Cadence

Every ~6 days

Total

2

Last Release

55d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7e06d54482377487e4780224cc416c7441c6b94112647d51afa448b3b7555272?d=identicon)[HarunRay](/maintainers/HarunRay)

---

Top Contributors

[![HarunRRayhan](https://avatars.githubusercontent.com/u/8705727?v=4)](https://github.com/HarunRRayhan "HarunRRayhan (24 commits)")

---

Tags

phpmonitoringqueuecronhorizoncrontinel

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/crontinel-php/health.svg)

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

###  Alternatives

[laravel/framework

The Laravel Framework.

34.7k532.1M19.2k](/packages/laravel-framework)[algolia/algoliasearch-client-php

API powering the features of Algolia.

69534.4M144](/packages/algolia-algoliasearch-client-php)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.4M506](/packages/shopware-core)[ptrofimov/beanstalk_console

Admin console for Beanstalk queue server

1.3k125.6k](/packages/ptrofimov-beanstalk-console)

PHPackages © 2026

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