PHP Classes
elePHPant
Icontem

PHP Cron Manager Class: Run scheduled tasks defined in a crontab file

Recommend this page to a friend!
  Info   View files Example   View files View files (12)   DownloadInstall with Composer Download .zip   Reputation   Support forum (3)   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2015-03-02 (3 years ago) RSS 2.0 feedStarStarStarStar 74%Total: 457 All time: 5,947 This week: 328Up
Version License PHP version Categories
slobel-php-cron 1.0.2BSD License5.1PHP 5, Unix, Console, Parsers
Description Author

This package can run scheduled tasks defined in a crontab file.

It can parse a file in the crontab format that defines the times and the command lines strings of programs that are scheduled to run regularly.

The package can start parallel processes to run the scheduled tasks when time comes.

  Performance   Level  
Name: Dmitry Mamontov <contact>
Classes: 12 packages by
Country: Russian Federation Russian Federation
Innovation award
Innovation award
Nominee: 4x

Details

PHPCron

PHPCron is a daemon to run tasks scheduled cron written in php, works similar to crontab

Requirements

  • PHP version 5.1 or higher.
  • Module installed "pcntl" and "posix".
  • All functions "pcntl" and "posix" removed from the directive "disable_functions".

Installation

Download the archive and extract.

wget https://github.com/dmamontov/crondaemon/archive/master.zip
unzip master.zip

or

git-clone https://github.com/dmamontov/crondaemon.git

Copy the folder "src" to the root of your project.

Entries cron

Create an entry in the file tasks/main.cron analogously to Example

/2  * php /var/www/data/public/cron/test.php test1
/5  * php /var/www/data/public/cron/test.php test2

More information about cron entry can be found here

Running the daemon

To start the daemon requires the console to run the script:

php /path/to/crondaemon.php parameter

or

/path/to/crondaemon parameter

Valid parameters

  • start [-f]
  • stop
  • restart
  • status
  • help

Connecting and starting the demon in your code

require_once 'lib/Autoloader.php';
Autoloader::register();
$cron = new CronDaemon($argv);
$cron->run();
  Files folder image Files  
File Role Description
Files folder imageexample (1 file)
Files folder imagesrc (2 files, 2 directories)
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files  /  example  
File Role Description
  Accessible without login Plain text file main.cron Data Auxiliary data

  Files folder image Files  /  src  
File Role Description
Files folder imageconfig (1 file)
Files folder imagelib (1 file, 2 directories)
  Accessible without login Plain text file phpcron Appl. Auxiliary data
  Accessible without login Plain text file phpcron.php Example Class source

  Files folder image Files  /  src  /  config  
File Role Description
  Accessible without login Plain text file settings.ini Data Auxiliary data

  Files folder image Files  /  src  /  lib  
File Role Description
Files folder imageclasses (4 files)
Files folder imageinterfaces (1 file)
  Plain text file Autoloader.php Class Class source

  Files folder image Files  /  src  /  lib  /  classes  
File Role Description
  Plain text file Entries.php Class Class source
  Plain text file PHPCron.php Class Class source
  Plain text file Process.php Class Class source
  Plain text file Tools.php Class Class source

  Files folder image Files  /  src  /  lib  /  interfaces  
File Role Description
  Plain text file PHPCronInterface.php Class Class source

 Version Control Unique User Downloads Download Rankings  
 100%
Total:457
This week:0
All time:5,947
This week:328Up
User Ratings User Comments (1)
 All time
Utility:95%StarStarStarStarStar
Consistency:90%StarStarStarStarStar
Documentation:95%StarStarStarStarStar
Examples:80%StarStarStarStarStar
Tests:-
Videos:-
Overall:74%StarStarStarStar
Rank:182
 
Please modify on symfony and prices would not be.
3 years ago (Vasiliy Trutov)
77%StarStarStarStar