19 $this->
component(
'event')->listen(\
Rsi\Fred::EVENT_HALT,[$this,
'flush']);
26 public function inc($id,$delta = 0){
27 if(($remote_addr = $this->
component(
'security')->remoteAddr)
28 ? \
Rsi\Http::inSubnet($this->ignoreAddr,$remote_addr)
29 : in_array(
null,$this->ignoreAddr)
31 $this->
component(
'log')->debug(__CLASS__ .
"::inc('$id',$delta)",__FILE__,__LINE__);
32 $this->_stats[] = [
'time' => time(),
'id' => $id,
'delta' => $delta];
38 if($this->path && $this->_stats){
40 $this->path . \
Rsi\Str::random() . $this->ext,
42 'addr' => $this->
component(
'security')->remoteAddr,
43 'ua' => $this->
component(
'client')->userAgent,
44 'stats' => $this->_stats