PHPackages                             riesenia/scheduler - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. riesenia/scheduler

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

riesenia/scheduler
==================

PHP class providing simple scheduling functionality

v2.1.0(3mo ago)05741MITPHPPHP ^7.2 || ^8.0CI passing

Since Feb 12Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/riesenia/scheduler)[ Packagist](https://packagist.org/packages/riesenia/scheduler)[ RSS](/packages/riesenia-scheduler/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (2)Versions (4)Used By (0)

Scheduler
=========

[](#scheduler)

PHP script providing basic scheduling functionality.

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

[](#installation)

Install the latest version using `composer require riesenia/scheduler`

Or add to your *composer.json* file as a requirement:

```
{
    "require": {
        "riesenia/scheduler": "~1.0"
    }
}
```

Usage
-----

[](#usage)

Constructor takes two parameters:

- items - array of integers - item IDs
- terms - array of *TermInterface*

```
use Riesenia\Scheduler\Scheduler;

$items = [1, 2];
$terms = [$term1, $term2, $term3, $term4];

$scheduler = new Scheduler($items, $terms);
```

### Adding terms and Items

[](#adding-terms-and-items)

Items and Terms can be also added separately. All added terms have to implement *TermInterface*.

```
$scheduler->addItem(3);
$scheduler->addTerm($term5);
```

### TermInterface

[](#terminterface)

Term is defined by its starting and ending date (*getFrom()* and *getTo()* methods). Moreover it can be locked to specific item by providing its ID in *getLockedId()* method.

### Scheduling

[](#scheduling)

Calling *schedule()* method distributes terms to items correctly. If this is not possible, scheduler throws *SchedulerException* with the information which terms overlap.

```
use Riesenia\Scheduler\SchedulerException;

try {
    $scheduler->schedule();

    // get all the terms with reassigned item IDs
    $scheduler->getTerms();
} catch (SchedulerException $e) {
    \var_dump($e->getConflictingTerms());
}
```

### External solver binary

[](#external-solver-binary)

For large inputs, the built-in PHP backtracking solver may be too slow. The package includes an optional Rust-based solver in the `solver/` directory that uses parallel search for significantly better performance.

Build the binary:

```
cd solver
cargo build --release
# binary will be at solver/target/release/scheduler-solver
```

Then point the scheduler to it:

```
$scheduler->setSolverBinary('/path/to/scheduler-solver');
```

The solver communicates via JSON over stdin/stdout and is fully compatible with the PHP solver — same input, same results.

### Timeout

[](#timeout)

Both the PHP and external solver support a timeout (in seconds). If the scheduler does not find a solution within the given time, it throws *SchedulerException*.

```
$scheduler->setTimeout(10);
```

When using the external solver, the timeout is passed in the JSON input and handled natively by the Rust binary — the process exits cleanly with a timeout status.

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance82

Actively maintained with recent releases

Popularity17

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity41

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 ~0 days

Total

3

Last Release

95d ago

Major Versions

v1.0.0 → v2.1.02026-02-13

PHP version history (2 changes)v2.0.0PHP ^7.2 || ^8.0

v1.0.0PHP &gt;=7.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/40c7ed7cfaebeddae57ac4a376c8f21df56dd2f38821b7ba92ea1312ef8020c8?d=identicon)[riesenia](/maintainers/riesenia)

---

Top Contributors

[![segy](https://avatars.githubusercontent.com/u/1355459?v=4)](https://github.com/segy "segy (22 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/riesenia-scheduler/health.svg)

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

###  Alternatives

[vesoft-inc/nebula-php

A nebula client for PHP

111.9k](/packages/vesoft-inc-nebula-php)

PHPackages © 2026

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