PHP code example of ayhome / gm-cli
1. Go to this page and download the library: Download ayhome/gm-cli library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
ayhome / gm-cli example snippets
//每20分词执行一次,
$crontab = new \ayhome\cli\Ticker();
$crontab->When('0 0 */20 * * *')
->Then(function ($userParams)
{
echo 'crontab called';
return false;//return false if you want to cancle this cron.
}, $userParams);