Search by

localzet / cron

localzet

Timer-based cron scheduling for Localzet Server with five- and six-field expressions.

Package info

github.com/localzet/Cron

pkg:composer/localzet/cron

Fund package maintenance!

localzet

Statistics

Installs: 19

Dependents: 1

Suggesters: 0

Stars: 21

Open Issues: 0

v2.0.0 2026-11-02 12:27 UTC

This package is auto-updated.

Last update: 2026-11-12 00:20:09 UTC


README

Русская документация

Timer-based cron scheduling for Localzet Server with five- and six-field expressions.

Status and compatibility

The parser supports five-field minute schedules and six-field second schedules. It aligns second-based rules to clock seconds and skips times that have already passed in the current minute. Calendar edge cases, timezone/DST behavior and missed-run recovery are outside the current scope.

The current branch targets Localzet Server 7.x. Published v1.x releases require Server ^4.5; this is the Server 7 release line.

Dependencies

  • php: ^8.1
  • localzet/server: ^7.0

Installation

composer require localzet/cron:^2.0

Use the 2.x release line with Server 7. The 1.x release line targets Server 4.

Usage

Register a task while bootstrapping an application that is already running under Localzet Server:

use localzet\Cron;

new Cron('*/15 * * * * *', static function (): void {
    refreshCache();
}, 'refresh-cache');

Five-field rules use minute precision. Six-field rules include seconds. Callbacks run on the Server event loop, so keep them non-blocking and hand long-running work to a queue or another process.

Development checks

composer validate --strict
composer install
composer dump-autoload --optimize --strict-psr
composer lint
composer test

Installation, lint and autoload checks do not establish end-to-end behavior or production readiness.

Historical usage notes need verification against the current API.

Author and license

Ivan Zorin (localzet), creator@localzet.com, https://www.localzet.com. Source: https://github.com/localzet/Cron. AGPL-3.0-or-later; LICENSE. Original copyright and third-party licenses remain applicable.

Authors · Contributing · Security