sinevia/php-library-scheduler

This package is not installable via Composer 1.x, please make sure you upgrade to Composer 2+. Read more about our Composer 1.x deprecation policy.

PHP Library Scheduler

v1.4.0 2020-08-05 05:27 UTC

This package is auto-updated.

Last update: 2021-11-05 08:53:17 UTC


README

Database driven scheduler.

Usage

Create a file called scheduler.php

<?php

error_reporting(E_ALL);
ini_set('display_errors', true);
ini_set('display_startup_errors', true);

require_once dirname(__DIR__) . '/vendor/autoload.php';

\Sinevia\Scheduler::configure(['pdo' => db()->getPdo()]);

(new \Sinevia\Scheduler)->run();

Add new entry in crontab

* * * * * php /var/www/your-project/cron/scheduler.php >> /dev/null 2>&1

Helpers

  • {DIR}

The {DIR} occurrence in a command will be substituted with the current project folder absolute path

For instance: php {DIR}/cron/mails-archive.php will be converted to php /var/www/your-project/cron/mails-archive.php

Screenshots

Screenshot.png