Created
September 23, 2016 14:06
-
-
Save rakeshkumar125/cf5c52d28f7be2160f046577a844def7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if (PHP_SAPI === 'cli') { | |
require("cronLockHelperClass.php"); | |
if (($pid = cronHelper::lock()) !== FALSE) { | |
// here need to apply the logic | |
cronHelper::unlock(); | |
} else { | |
echo "cron already running..."; | |
} | |
} else { | |
die("Oops run from command line please..."); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment