5 abstract class Stats extends \Rsi\Fred\Worker\Job{
7 abstract protected function stats(
$id,$delta,
$time,$addr,$user_agent);
10 if($this->_worker->component(
'stats')->path)
11 foreach(glob($this->_worker->component(
'stats')->path .
'*' . $this->_worker->component(
'stats')->ext) as $filename)
try{
12 if($stats = \
Rsi\File::unserialize($filename))
foreach($stats[
'stats'] as $stat)
13 $this->
stats($stat[
'id'],$stat[
'delta'],$stat[
'time'],$stats[
'addr'],$stats[
'ua']);
14 \Rsi\File::unlink($filename);
17 $this->_worker->component(
'log')->error(
'Could not process stats file',[
'filename' => $filename,
'error' => $e->getMessage()]);
18 rename($filename,$filename .
'.error');
stats($id, $delta, $time, $addr, $user_agent)