<?php /* * By: 落落 * To: GetVM.Com * URL: www.MyLuoLuo.Com */ set_time_limit(0); $fileName = "count.love"; $urls = array("http://my.XXXX.net/cron.php" ,"http://billing.XXXX.com/cron.php"); //如果文件不存在 if(!file_exists($fileName)) { CreateFile($fileName,0); exit(); } if (!is_readable($fileName)) { //文件不存在或者无法读取 die('File does not exist or could not be read!'); }else { $count = file_get_contents($fileName); $count++; //监控宝有两个节点同时访问,所以这里不是24 if($count>=48) { foreach ($urls as $key => $value) { file_get_contents($value); } $count=0; } echo"$count"; DeleteFile($fileName); CreateFile($fileName,$count); } //创建文件 function CreateFile($fileName,$value) { $fp = fopen($fileName, "w+"); fwrite($fp, $value); fclose($fp); } //删除文件 function DeleteFile($fileName) { @unlink($fileName); } ?>
以上就是利用监控宝来执行Whmcs的自动任务的内容,更多相关内容请关注PHP中文网(www.php.cn)!