Well, it's actually a Linux project, but ... Not-_-
Think of, you can take advantage of the timing of the monitoring of the characteristics of the visit, to perform Whmcs scheduled tasks.
However, the tangled place is coming ... Monitoring treasure the longest monitoring interval is 1 hours ...
So, this code is born ...
First, the analysis, if the monitoring treasure every 1 hours to access the specified URL, this requires a counter, and because the memory can not be resident, write SQL Trouble, so, the use of file storage.
24 hours a day, the monitoring treasure will visit 24 times, but the monitoring treasure will have two nodes simultaneously access, so 24*2=48.
Not familiar with PHP, so the concurrency problem is not considered here. Because of the file operations involved, it is not possible to have no permissions
Release the Code:
<?php */* URL:www.okss.net */set_time_limit (0); $fileName = "Count.love"; $urls = Array ("http://my.getvm.net/cron.php", "http://billing.getvm.com/cron.php"); If the file does not exist if (!file_exists ($fileName)) {CreateFile ($fileName, 0); Exit (); } if (!is_readable ($fileName)) {//file does not exist or cannot read die (' file does not exist or could not is read! '); }else {$count = file_get_contents ($fileName); $count + +; if ($count >=48) {//monitor treasure has two nodes simultaneous access, so this is not a 24-hour foreach ($urls as $key = + $value) { File_get_contents ($value); } $count = 0; } echo "$count"; DeleteFile ($fileName); CreateFile ($fileName, $count); }//Create File function CreateFile ($fileName, $value) {$fp = fopen ($fileName, "w+"); Fwrite ($fp, $value); Fclose ($FP); }//delete file function DeleteFile ($fileName) {@unlink ($fileName); }?>
Test it or it works. * ^^ *
Finally, how can I tell you that. The cloud products such as Bae and the DA,CP panel are all cron-supported.
PHP uses monitoring Polaris to perform WHMCS automatic tasks