26 public function inc($id,$delta = 0){
27 if(\
Rsi\Http::inSubnet($this->ignoreAddr,$this->
component(
'security')->remoteAddr))
return false;
28 $this->
component(
'log')->debug(__CLASS__ .
"::inc('$id',$delta)",__FILE__,__LINE__);
29 $this->_stats[] = [
'time' => time(),
'id' => $id,
'delta' => $delta];
35 if($this->path && $this->_stats){
37 $this->path . \
Rsi\Str::random() . $this->ext,
39 'addr' => $this->
component(
'security')->remoteAddr,
40 'ua' => $this->
component(
'client')->userAgent,
41 'stats' => $this->_stats
flush()
Flush statistics to disk.
$path
Path to flush (dump) the stats to.
inc($id, $delta=0)
Add a statistic.
$ignoreAddr
Addresses (subnets; CIDR notation) to ignore.
component($name)
Get a component (local or default).