
Cronark: Lightweight Cron-Based Job Scheduling for PHP
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
Continue reading on Dev.to Webdev
Opens in a new tab



