If you need background jobs in PHP but don’t want to deal with Redis, RabbitMQ, or heavy infrastructure, Cronark might be exactly what you’re looking for.
It’s a minimal, cron-driven job scheduler that works with plain PHP (8.1+) and your system’s cron; no external services required.
🤔 Why Use It?
Most job queues require extra setup and maintenance. That’s fine for large systems, but for small to mid-size projects? Overkill.
Cronark keeps it simple:
- No external dependencies
- No queue servers
- No background daemons
- Just PHP + cron
If your server can run cron, you’re good to go.
⚙️ Basic Usage
Install via Composer:
composer require nabeghe/cronark
Create a job:
class SendEmailsJob
{
public function __invoke()
{
echo "Sending emails...\n";
}
}
Register and run it in a worker:
$cronark = new \Nabeghe\Cronark\Cronark();
$cronark->addJob(SendEmailsJob::class, "email");
$cronark->start("email");
Add to crontab:
* * * * * php /path/to/worker.php
Done. Your job runs every minute.
🎯 When It Makes Sense
- Cronark is perfect if you:
- Are on shared hosting
- Want lightweight scheduling
- Prefer minimal infrastructure
- Need recurring background tasks
It’s not trying to replace enterprise queue systems; it’s built for simplicity and practicality.
If you like clean solutions with zero drama, this one’s worth checking out.
Top comments (0)