PHPackages                             flexic/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. flexic/scheduler

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

flexic/scheduler
================

Provides an scheduler extension.

2.0.4(3y ago)118511GPL-3.0-or-laterPHPPHP ^8.1

Since Oct 9Pushed 3y ago1 watchersCompare

[ Source](https://github.com/flexicsystems/scheduler)[ Packagist](https://packagist.org/packages/flexic/scheduler)[ RSS](/packages/flexic-scheduler/feed)WikiDiscussions main Synced today

READMEChangelog (8)Dependencies (10)Versions (9)Used By (1)

🕧 PHP Scheduler
---------------

[](#-php-scheduler)

PHP Schedule is a simple library for scheduling tasks in PHP.
It is inspired by the [Laravel Scheduler](https://laravel.com/docs/scheduling) and [Symfony Messenger](https://symfony.com/doc/current/components/messenger.html).

---

### Installation

[](#installation)

Run

```
composer require flexic/scheduler
```

to install `flexic/scheduler`.

---

### Setup Events to schedule

[](#setup-events-to-schedule)

```
class MyScheduleEvent implements \Flexic\Scheduler\Interfaces\AbstractScheduleEventInterface
{
    public function __invoke(): void
    {
        // ... do something
    }

    public function configure(Flexic\Scheduler\Interfaces\ScheduleInterface $schedule): void
    {
        $schedule->cron('* * * * *');
    }
}
```

Schedule events are classes that implement the `ScheduleEventInterface`. Inside the `configure` method, you can use the `Schedule` object to define when the event should be scheduled to run.

### Setup Schedule Worker (Console Command)

[](#setup-schedule-worker-console-command)

Run

```
php bin/schedule ./path/to/event_config.php ./path/to/event_config_1.php
```

to start the schedule worker. Worker will automatically load all events from the given config files and run them.

#### Options

[](#options)

OptionDescriptionFormatDefaultlimitLimits the worker to the give number. Worker stops automatically if number if max Event runs exceeded.int-timeLimitWorker stops automatically after given time.int (seconds)-intervalLimitWorker stops automatically after give amount of intervals.int-memoryLimitWorker stops automatically if usage of memory exceeds the given limit.int (bytes)-parallelWorker runs events in parallel if set to true.booleanfalseparallelLimitLet worker run only defined amount of parallel runs at same time.int-### Setup Schedule Worker (own script)

[](#setup-schedule-worker-own-script)

```
# Options for worker
$options = [];
$events = [
    new MyScheduleEvent(),
];

$worker = new \Flexic\Scheduler\Worker(
    new Flexic\Scheduler\Configuration\WorkerConfiguration($options),
    $events,
    new \Symfony\Component\EventDispatcher\EventDispatcher(),
);

$worker->start();
```

### ScheduleEvent Factory

[](#scheduleevent-factory)

The `ScheduleEventInterface` is implemented to allow the usage of a factory to create the event. This is useful if you want to use a dependency injection container to create the event.

```
class MyScheduleEventFactory implements \Flexic\Scheduler\Interfaces\ScheduleEventFactoryInterface
{
    public function create(): array {
        return [
            new MyScheduleEvent('foo'),
            new MyScheduleEvent('bar'),
        ];
    }
}
```

### Schedule API

[](#schedule-api)

MethodDescriptioncron($expression)Schedule the event on a Cron expression.timezone($timezone)Set the timezone the expression should run in.minute($minute)Set minutes to cron expressionhour($hour)Set hours to cron expressionday($day)Set days to cron expressionmonth($month)Set months to cron expressiondayOfWeek($day)Set days of week to cron expressionbuilder()Return an instance of [`flexic/cron-builder`](https://github.com/flexicsystems/cron-builder).`cron()` method accepts string, or objects of type `CronBuilder` &amp; `Cron` of [`flexic/cron-builder`](https://github.com/flexicsystems/cron-builder).

Methods for tokens allows usage of Expressions from [`flexic/cron-builder`](https://github.com/flexicsystems/cron-builder).

### Worker API

[](#worker-api)

MethodDescriptionstart()Starts the worker.stop()Stops the worker.restart()Reinitialize and restarts the worker.update($configuration, $scheduleEvents)Update the worker and starts with new configuration.### Worker Lifecycle Events

[](#worker-lifecycle-events)

Event NameDescription**Worker Lifecycle**Flexic\\Scheduler\\Event\\Event\\Lifecycle\\&lt;EventName&gt;WorkerInitializedEventExecuted when worker is initialized.WorkerStartEventExecuted when worker is started.WorkerStopEventExecuted when worker is stopped.WorkerRestartEventExecuted when worker is restarted.WorkerUpdateEventExecuted everytime the worker is updated.**Run Lifecycle**Flexic\\Scheduler\\Event\\Event\\Run\\&lt;EventName&gt;WorkerRunStartEventExecuted everytime an event is started to process.WorkerRunEnvEventExecuted everytime an event is finished to process.**Interval Lifecycle**Flexic\\Scheduler\\Event\\Event\\Interval\\&lt;EventName&gt;WorkerIntervalStartEventExecuted everytime a interval is started.WorkerIntervalEndEventExecuted everytime a interval is finished.**Execution Lifecycle**Flexic\\Scheduler\\Event\\Event\\Execute\\&lt;EventName&gt;WorkerExecuteEventExecuted everytime an event is executed.WorkerExecuteSequentialEventExecuted everytime an event is executed sequentially.WorkerExecuteParallelStartEventExecuted everytime an event is executed parallel.WorkerExecuteParallelResumeEventExecuted everytime an parallel executed event is resumed.---

### License

[](#license)

This package is licensed using the GNU License.

Please have a look at [LICENSE.md](LICENSE.md).

---

[![Donate](https://camo.githubusercontent.com/b57c445af971e3e99c2d0ccdbf4fa7faa4358ba27fecc8f68459b30289f82eda/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f446f6e6174652d50617950616c2d626c75652e737667)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=Q98R2QXXMTUF6&source=url)

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity61

Established project with proven stability

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

Recently: every ~12 days

Total

8

Last Release

1201d ago

Major Versions

1.1.0 → 2.0.02023-01-28

### Community

Maintainers

![](https://www.gravatar.com/avatar/bee461f8192dd9177138458bcf9558257c572316ca6fed26b68d2f1e7efbb5be?d=identicon)[ThemePoint](/maintainers/ThemePoint)

---

Top Contributors

[![ThemePoint](https://avatars.githubusercontent.com/u/28843201?v=4)](https://github.com/ThemePoint "ThemePoint (128 commits)")

---

Tags

sheduler

###  Code Quality

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.7k38.9k](/packages/matomo-matomo)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.6M568](/packages/shopware-core)[shopware/platform

The Shopware e-commerce core

3.4k1.5M3](/packages/shopware-platform)[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.5k5.9M733](/packages/sylius-sylius)[oro/platform

Business Application Platform (BAP)

645143.5k114](/packages/oro-platform)[contao/core-bundle

Contao Open Source CMS

1231.6M2.8k](/packages/contao-core-bundle)

PHPackages © 2026

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