2017 © Pedro Peláez
 

library scheduler

Command Scheduler.

image

mvaliolahi/scheduler

Command Scheduler.

  • Saturday, July 21, 2018
  • by mvaliolahi
  • Repository
  • 1 Watchers
  • 0 Stars
  • 39 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 11 Versions
  • 0 % Grown

The README.md

Command Scheduler

Latest Stable Version Total Downloads Build Status StyleCI PHP-Eye , (*1)

framework agnostic command scheduler that can be easily integrated with any project., (*2)

    $ composer require mvaliolahi/scheduler`
Usage
  1. create an instance of Scheduler then add some command and schedule them.

$scheduler = new Scheduler([ 'cwd' => 'project path | where commands can be run', 'command_prefix' => 'php specific-cli', 'cache' => 'an implementation from OverlappinCache Contract' ]); $scheduler->command('rm test.php -fr') ->hourly() ->when(function() { return true; // in this situation. }); $scheduler->start();

*tip: cache should not be instance., (*3)

  1. use a cron job to run the $scheduler->start() in a specific period of time.: * * * * * php /project/schedule:run >> /dev/null 2>&1

Tips: Scheduler can be configured using another params named timezone, this parameter apply an specific timezone to add commands but you can overwrite them using ->timezone() method., (*4)

Frequencies:
   ->everyMinute(); Run the command every minute
   ->everyFiveMinutes();    Run the command every five minutes
   ->everyTenMinutes(); Run the command every ten minutes
   ->everyFifteenMinutes(); Run the command every fifteen minutes
   ->everyThirtyMinutes();  Run the command every thirty minutes
   ->hourly();  Run the command every hour
   ->hourlyAt(17);  Run the command every hour at 17 mins past the hour
   ->daily();   Run the command every day at midnight
   ->dailyAt('13:00');  Run the command every day at 13:00
   ->twiceDaily(1, 13); Run the command daily at 1:00 & 13:00
   ->weekly();  Run the command every week
   ->monthly(); Run the command every month
   ->monthlyOn(4, '15:00'); Run the command every month on the 4th at 15:00
   ->quarterly();   Run the command every quarter
   ->yearly();  Run the command every year
   ->timezone('America/New_York');  Set the timezone
   ->weekdays();    Limit the command to weekdays
   ->sundays(); Limit the command to Sunday
   ->mondays(); Limit the command to Monday
   ->tuesdays();    Limit the command to Tuesday
   ->wednesdays();  Limit the command to Wednesday
   ->thursdays();   Limit the command to Thursday
   ->fridays(); Limit the command to Friday
   ->saturdays();   Limit the command to Saturday
   ->between($start, $end); Limit the command to run between start and end times
   ->when(Closure); Limit the command based on a truth test
Todo
- add specific class with specific method for trigger instead usual command to scheduler.

The Versions

21/07 2018

dev-master

9999999-dev https://mvaliolahi.ir

Command Scheduler.

  Sources   Download

The Requires

 

The Development Requires

by Meysam Valiolahi

scheduler schedule cron job schedule command scheduler

21/07 2018

dev-analysis-qMgAQ2

dev-analysis-qMgAQ2 https://mvaliolahi.ir

Command Scheduler.

  Sources   Download

The Requires

 

The Development Requires

by Meysam Valiolahi

scheduler schedule cron job schedule command scheduler

21/07 2018

dev-add-travis

dev-add-travis https://mvaliolahi.ir

Command Scheduler.

  Sources   Download

The Requires

 

The Development Requires

by Meysam Valiolahi

scheduler schedule cron job schedule command scheduler

10/02 2018

v0.0.6

0.0.6.0 https://mvaliolahi.ir

Command Scheduler.

  Sources   Download

The Requires

 

The Development Requires

by Meysam Valiolahi

scheduler schedule cron job schedule command scheduler

10/02 2018

dev-fix-cache-contract

dev-fix-cache-contract https://mvaliolahi.ir

Command Scheduler.

  Sources   Download

The Requires

 

The Development Requires

by Meysam Valiolahi

scheduler schedule cron job schedule command scheduler

10/02 2018

v0.0.5

0.0.5.0 https://mvaliolahi.ir

Command Scheduler.

  Sources   Download

The Requires

 

The Development Requires

by Meysam Valiolahi

scheduler schedule cron job schedule command scheduler

10/02 2018

dev-fix#1

dev-fix#1 https://mvaliolahi.ir

Command Scheduler.

  Sources   Download

The Requires

 

The Development Requires

by Meysam Valiolahi

scheduler schedule cron job schedule command scheduler

11/12 2017

v0.0.4

0.0.4.0 https://mvaliolahi.ir

Command Scheduler.

  Sources   Download

The Requires

 

The Development Requires

by Meysam Valiolahi

scheduler schedule cron job schedule command scheduler

11/12 2017

v0.0.3

0.0.3.0 https://mvaliolahi.ir

Command Scheduler.

  Sources   Download

The Requires

 

The Development Requires

by Meysam Valiolahi

scheduler schedule cron job schedule command scheduler

10/12 2017

v0.0.2

0.0.2.0 https://mvaliolahi.ir

Command Scheduler.

  Sources   Download

The Requires

 

The Development Requires

by Meysam Valiolahi

scheduler schedule cron job schedule command scheduler

10/12 2017

v0.0.1

0.0.1.0 https://mvaliolahi.ir

Command Scheduler.

  Sources   Download

The Requires

 

The Development Requires

by Meysam Valiolahi

scheduler schedule cron job schedule command scheduler