Download the PHP package rafalmasiarek/dashboard-kit-addon-scheduler without Composer
On this page you can find all versions of the php package rafalmasiarek/dashboard-kit-addon-scheduler. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download rafalmasiarek/dashboard-kit-addon-scheduler
More information about rafalmasiarek/dashboard-kit-addon-scheduler
Files in rafalmasiarek/dashboard-kit-addon-scheduler
Package dashboard-kit-addon-scheduler
Short Description Scheduler addon for rafalmasiarek/dashboard-kit. Cron-expression task runner with queue+redirect anti-timeout, file/PDO state stores and /cron HTTP endpoints.
License BUSL-1.1
Informations about the package dashboard-kit-addon-scheduler
dashboard-kit-addon-scheduler
Cron-expression task scheduler addon for rafalmasiarek/dashboard-kit.
Auto-discovers tasks from module schedule definitions. Runs tasks via HTTP endpoints with a queue+redirect mechanism to avoid PHP execution timeouts on long-running jobs.
Requirements
- PHP 8.2+
rafalmasiarek/dashboard-kit: *
Installation
Quick start
Configuration
| Key | Default | Description |
|---|---|---|
endpoint |
true |
Register native HTTP endpoints (/scheduler/status, /scheduler/run, /scheduler/job) |
prefix |
'' |
URL prefix prepended to all endpoints (e.g. '/v1') |
token |
SCHEDULER_TOKEN env |
Bearer token required on GET /scheduler/run |
Config can be passed as the third argument to register() or via app.config['scheduler'] in Dashboard::create().
HTTP endpoints
| Endpoint | Auth | Description |
|---|---|---|
GET /scheduler/status |
none | Lists all tasks with last_run_at and is_due |
GET /scheduler/run |
Bearer token | Runs due tasks; queues long-running ones and redirects |
GET /scheduler/job |
queue token | Executes one step of a queued task (internal) |
Trigger from a system cron:
Response format
GET /scheduler/run and GET /scheduler/job return the same normalized shape whether the task ran directly or through a queue:
result.final is the task's own return value from its last run — never dropped, even when the task completed through several queued parts. Pass ?verbose=1 (or true/yes/on) to also get result.steps, one entry per run with its own started_at/finished_at/duration_ms/status/result/error.
By default every task uses Output\DefaultOutputPolicy. Register a task-specific policy to customize what result.final/result.steps contain:
A custom policy implements OutputPolicyInterface::buildResult(string $taskName, array $runs, array $options): array, or extends AbstractOutputPolicy and only implements buildStep(array $run): array to reuse the default final/steps structure.
Module schedule format
Add a schedule key to any module's module.php:
The global task ID will be notes.cleanup. Tasks appear in /scheduler/status.
Task definition keys
| Key | Required | Description |
|---|---|---|
id |
yes | Local task ID (prefixed with module slug for the global ID) |
cron |
yes | Cron expression (5-field, e.g. '*/5 * * * *') |
action |
yes | Factory action name. Built-in: 'callable' |
options |
no | Action-specific options. For callable: handler (PHP callable or 'Class@method') |
enabled |
no | false disables the task without removing it (default: true) |
allow_parallel |
no | Allow concurrent runs (default: false) |
Built-in cleanup task
__scheduler.cleanup runs daily at 03:15 and removes queue files older than 24 hours from storage/cron_queues/. It is registered automatically — no configuration needed.
Monitoring
The plugin provides MonitoringInterface and NoopMonitoring (default). To wire a custom implementation:
Or read from app.config (config lives alongside other scheduler settings):
MyMonitoring must implement rafalmasiarek\DashboardKitScheduler\MonitoringInterface:
All methods must swallow their own exceptions — monitoring must never break scheduling.
Disabling native endpoints
When endpoint: false, only Scheduler::class and QueueManager::class are registered in the container. Use this when building custom routes with your own auth (e.g. via dashboard-kit-addon-api token scopes).
License
Business Source License 1.1 — see LICENSE. For alternative licensing, contact us.
All versions of dashboard-kit-addon-scheduler with dependencies
rafalmasiarek/dashboard-kit Version >=5.0
dragonmantank/cron-expression Version ^3.3