Download the PHP package wolfcode/php-cron without Composer
On this page you can find all versions of the php package wolfcode/php-cron. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download wolfcode/php-cron
More information about wolfcode/php-cron
Files in wolfcode/php-cron
Download wolfcode/php-cron
More information about wolfcode/php-cron
Files in wolfcode/php-cron
Vendor wolfcode
Package php-cron
Short Description PHP 8.2+ Cron scheduler with fluent API
License MIT
Package php-cron
Short Description PHP 8.2+ Cron scheduler with fluent API
License MIT
Please rate this library. Is it a good library?
Informations about the package php-cron
php-cron
中文文档
PHP 8.2+ task scheduler with a fluent API and full lifecycle management.
Features
- Cron expressions — standard 5-field or 6-field (with seconds); supports
*/n, ranges, lists, weekday/month names,@dailyaliases - Fluent API —
second(3),minute(5),hour(2),dailyAt('8:30'),weeklyOn('monday') - Constraints — time range
between(), environmentenvironments(), conditionwhen()/skip() - Lifecycle hooks —
before(),after(),onSuccess(),onFailure() - Overlap prevention —
withoutOverlapping()via file-based mutex - Timezone support — global per-daemon and per-task
- Three task types — Closure, shell command,
Class@method - Daemon mode — continuous loop with second precision, auto-fork to background
Requirements
| Extension | Purpose | Required |
|---|---|---|
ext-pcntl |
Process control: pcntl_fork() (background daemon), signal handling |
Optional — needed for daemon background mode |
ext-posix |
POSIX: posix_setsid() (new session), posix_kill() (stop daemon) |
Optional — needed for daemon start/stop |
ext-json |
Task info serialization (.tasks.json PID file) |
Optional — bundled with PHP by default |
ext-opcache |
opcache_reset() (periodic reset in long-running process) |
Optional — works fine without |
ext-pcntlandext-posixare CLI-only and unavailable in Web SAPI. Ifext-posixis missing,stopfalls back toexec("kill ...").
Installation
Quick Start
Timezone
Two levels:
- Global timezone — second argument of
Scheduler::run(). Affectsstarted_atin status output, alldate()calls, and every task's scheduling - Per-task timezone —
->timezone(). Overrides scheduling timezone for that task only; does NOT affectdate()
| Constant | Timezone |
|---|---|
Timezone::UTC |
UTC |
Timezone::ASIA_SHANGHAI |
China (Shanghai) |
Timezone::ASIA_HONG_KONG |
China (Hong Kong) |
Timezone::ASIA_TAIPEI |
China (Taipei) |
Timezone::ASIA_TOKYO |
Japan (Tokyo) |
Timezone::ASIA_SEOUL |
South Korea (Seoul) |
Timezone::ASIA_SINGAPORE |
Singapore |
Timezone::ASIA_BANGKOK |
Thailand (Bangkok) |
Timezone::ASIA_MOSCOW |
Russia (Moscow) |
Timezone::EUROPE_LONDON |
UK (London) |
Timezone::EUROPE_PARIS |
France (Paris) |
Timezone::EUROPE_BERLIN |
Germany (Berlin) |
Timezone::AMERICA_NEW_YORK |
US (New York / Eastern) |
Timezone::AMERICA_CHICAGO |
US (Chicago / Central) |
Timezone::AMERICA_LOS_ANGELES |
US (Los Angeles / Pacific) |
Timezone::AUSTRALIA_SYDNEY |
Australia (Sydney) |
Timezone::PACIFIC_AUCKLAND |
New Zealand (Auckland) |
API Reference
Frequency Methods (Parameter-based)
| Method | Description | Example cron |
|---|---|---|
second(3) |
Every N seconds | */3 * * * * * |
minute(5) |
Every N minutes | */5 * * * * |
hour(2) |
Every N hours | 0 */2 * * * |
day(3) |
Every N days | 0 0 */3 * * |
week(2) |
Every N weeks | 0 0 * * 0 + week filter |
month(6) |
Every N months | 0 0 1 */6 * |
Semantic Methods
| Method | Cron expression |
|---|---|
hourly() |
0 * * * * |
hourlyAt(30) |
30 * * * * |
daily() |
0 0 * * * |
dailyAt('8:30') |
30 8 * * * |
twiceDaily(1, 13) |
0 1,13 * * * |
weekly() |
0 0 * * 0 |
weeklyOn('monday', '9:00') |
0 9 * * 1 |
monthly() |
0 0 1 * * |
monthlyOn(15, '14:30') |
30 14 15 * * |
quarterly() |
0 0 1 1,4,7,10 * |
yearly() |
0 0 1 1 * |
weekdays() |
0 0 * * 1-5 |
weekends() |
0 0 * * 0,6 |
lastDayOfMonth() |
0 0 28-31 * * + filter |
Custom Expression
Constraints
Hooks
Others
License
MIT
All versions of php-cron with dependencies
PHP Build Version
Package Version
Requires
php Version
>=8.2
The package wolfcode/php-cron contains the following files
Loading the files please wait ...