Skip to content
This repository was archived by the owner on Feb 7, 2019. It is now read-only.

dmamontov/phpcron

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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();

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages