《分布式任务调度平台XXL-JOB》
文档地址:分布式任务调度平台XXL-JOB
下载源码,IDE maven 打包 启动,先启动 xxl-admin ,再启动 执行器项目
任务中心配置:
<?php
echo '开始执行';
$postJson='{"execute":"Top","data":[],"taskid":"45645"}';
$result=rawJson("http://woc.apib.com/crontab-del/activity-status",$postJson);
echo PHP_EOL;
print_r($result);
echo PHP_EOL;
function rawJson($url, $data_string)
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
//curl_setopt($ch, CURLOPT_HTTPHEADER, array(
//'X-AjaxPro-Method:ShowList',
//'Content-Type: application/json; charset=utf-8',
//'Content-Length: ' . strlen($data_string)
//));
//curl_setopt($ch, CURLOPT_POST, 1);
// curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
$data = curl_exec($ch);
curl_close($ch);
return $data;
}
?>