sinevia/php-library-scheduler

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

This package is auto-updated.

Last update: 2024-10-05 15:16:31 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