|
|
@ -15,6 +15,20 @@ class Sync{
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
static public function syncdata ($display = true) {
|
|
|
|
static public function syncdata ($display = true) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (function_exists('pcntl_fork')) {
|
|
|
|
|
|
|
|
$pid = pcntl_fork();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
$pidfile = '/tmp/ams_cron_pid';
|
|
|
|
|
|
|
|
if(isset($pid)) {
|
|
|
|
|
|
|
|
// We're the main process.
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
if(!file_exists($pidfile)) {
|
|
|
|
|
|
|
|
$pid = getmypid();
|
|
|
|
|
|
|
|
$file = fopen($pidfile, 'w');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fwrite($file, $pid);
|
|
|
|
|
|
|
|
fclose($file);
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
$dbl = new DBLayer("lib");
|
|
|
|
$dbl = new DBLayer("lib");
|
|
|
|
$statement = $dbl->executeWithoutParams("SELECT * FROM ams_querycache");
|
|
|
|
$statement = $dbl->executeWithoutParams("SELECT * FROM ams_querycache");
|
|
|
@ -66,6 +80,9 @@ class Sync{
|
|
|
|
print_r($e);
|
|
|
|
print_r($e);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
unlink($pidfile);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|