1. Go to this page and download the library: Download webman-tech/crontab-task 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/ */
webman-tech / crontab-task example snippets
namespace app\crontab\tasks;
use WebmanTech\CrontabTask\BaseTask;
class SampleTask extends BaseTask
{
/**
* @inheritDoc
*/
public function handle()
{
// 实际业务
echo date('Y-m-d H:i:s') . PHP_EOL;
}
}