Skip to content

phpbook-sources/scheduler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

About Scheduler

  • A lightweight scheduler PHP library.
  • With WINDOWS this library use the Task Scheduler
  • With LINUX this library use the CRONTAB

Composer Install

composer require phpbook/scheduler

Scheduler Tasks Example

<?php

/********************************************
 * 
 *  Scheduler Tasks Example
 * 
 * ******************************************/

$taskName = 'Send Emails'; // task name

$taskCommand = 'php ' . __DIR__ . '/send-mails.php'; // or any another command to run whatever the location of the file

$intervalMinutes = 5; // interval in minutes

\PHPBook\Scheduler\Task::register($taskName, $taskCommand, $intervalMinutes); // register the task

\PHPBook\Scheduler\Task::register($taskName, $taskCommand, $intervalMinutes); // register or update the task

\PHPBook\Scheduler\Task::remove($taskName); // remove the task by the task name

?>

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages