File: /home/httpd/html/chatfree24.com/public_html/admin/crons/cronFetchPerformers.php
<?php
/*
Usage:
/path/to/php cronFetchPerformers.php
/path/to/php cronFetchPerformers.php --site=4 (id number from URL in edit site in admin)
*/
ini_set('max_execution_time', 3600); //3600 seconds = 1 hour
ini_set('memory_limit','2048M');
include('../db.php');
include("../functions.camApis.php");
$options = getopt('',array("site::"));
if(is_array($options) && isset($options['site'])) {
$filterAnd .= " AND paysites.record_num = '".(int)$options['site']."'";
}
$result = dbQuery("SELECT * FROM paysites WHERE enabled = 1 $filterAnd",false);
foreach($result as $row) {
echo "Running ".$row['name']."...";
call_user_func($row['functionName'],$row['record_num'],$row['apiData'],$row['maxResults'],$row['parameters']);
echo "Done\n";
}
dbQuery("UPDATE status SET cron_last_run = NOW()");
exit("Finished!\n");