-
Notifications
You must be signed in to change notification settings - Fork 0
Easy file locking system for your daily crons. Written in PHP
License
vladfr/php.cronlock
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
php.cronlock This class implements cronjob locking to prevent concurent processes from running. Locks are kept on the filesystem. Setup: You need to include config.php inside this directory in your cron job file. Usage: You need to wrap your entire cron job like this: if(lock::lock() !== FALSE){ //execute your job here lock::unlock(); } Use lock::getData() and lock::setData() to get and set persistent data for the lock pid. Data is saved only on a successful lock-unlock process. If you want to save it in other cases use lock::saveData(); If you want to delete all data associated with a lock pid, just set the pid, then call lock::delData();
About
Easy file locking system for your daily crons. Written in PHP
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published