Download the PHP package ipl/scheduler without Composer

On this page you can find all versions of the php package ipl/scheduler. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package scheduler

Icinga PHP Library - Tasks Scheduler

ipl-scheduler provides an event-loop-driven task scheduler for PHP. It runs tasks at regular intervals or once at a specific time, using an event-driven and promise-based model built on top of ReactPHP.

Tasks are plain PHP classes. Frequency is configured independently via cron expressions, one-off datetimes, or iCalendar recurrence rules. The scheduler emits lifecycle events so you can observe scheduling, execution, completion, failures, and expiration without coupling your tasks to the scheduler itself.

Installation

The recommended way to install this library is via Composer:

ipl/scheduler requires PHP 8.2 or later.

For production use, install the ext-ev PHP extension to improve event loop efficiency.

Key Abstractions

Class Description
Scheduler Manages tasks in the ReactPHP event loop
Cron Repeating frequency driven by a cron expression
RRule Repeating frequency driven by an iCalendar RRULE
OneOff Single-run frequency at an exact point in time

Usage

Implementing a Task

Implement the Task interface. Use the TaskProperties trait to satisfy the getName(), getUuid(), and getDescription() requirements without boilerplate.

Return resolve() or reject() when the result is already available synchronously. For background work such as async I/O, subprocess calls, or non-blocking HTTP requests, use a Deferred and settle it once the operation finishes:

Note: Always call either resolve() or reject() on every code path. A Deferred whose promise is never settled will silently prevent ON_TASK_DONE and ON_TASK_FAILED from firing.

Scheduling with a Cron Expression

Use Cron to run a task on a repeating schedule defined by a standard five-field cron expression:

Scheduling a One-Off Run

Use OneOff to run a task exactly once at a specific datetime:

Scheduling with an iCalendar Recurrence Rule

Use RRule for complex recurrence patterns. Pass a timezone string to align recurrences with a specific offset:

You can also construct an RRule directly from an RRULE string:

Listening to Lifecycle Events

The scheduler emits events at each stage of a task's lifecycle. Register listeners using on():

Available Events

Constant Triggered when
Scheduler::ON_TASK_SCHEDULED An operation is queued for future execution
Scheduler::ON_TASK_RUN An operation starts running
Scheduler::ON_TASK_DONE An operation completes successfully
Scheduler::ON_TASK_FAILED An operation throws or rejects
Scheduler::ON_TASK_EXPIRED A task has passed its configured end time
Scheduler::ON_TASK_CANCEL A task is removed while an operation is pending

Removing a Task

Call remove() to cancel a scheduled task at any time. Any pending operations are canceled and the ON_TASK_CANCEL event is emitted:

To remove all scheduled tasks at once:

Changelog

See CHANGELOG.md for a list of notable changes.

License

ipl/scheduler is licensed under the terms of the MIT License.


All versions of scheduler with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2
ext-json Version *
dragonmantank/cron-expression Version ^3
ipl/stdlib Version >=0.15.0
psr/log Version ^1
ramsey/uuid Version ^4.2.3
react/event-loop Version ^1.4
react/promise Version ^3.3
simshaun/recurr Version ^5
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package ipl/scheduler contains the following files

Loading the files please wait ...