src/PrivateStats.php
/**
     * Store the current visit information
     * @return bool Indicates whether storing was successful
     */
Store the current visit information
@return bool Indicates whether storing was successful
Store the current visit information @return bool Indicates whether storing was successful
public function registerVisit(): bool
    {
        foreach ($this->excludeIps as $excludeIp) {
            $regex = preg_quote($excludeIp);
            $regex = str_replace('\*', '.+', $regex);
            $regex = sprintf('/^%s$/', $regex);
            if (preg_match('/^'.$regex.'$/', Server::getRemoteAddress()) === 1) {
                return false;
            }
        }
        $visitInfo = new VisitInfo();
        $visitInfo->setCurrentValues();
        return $this->handler->write($visitInfo);
    }
public function registerVisit ( ) : bool { foreach ( $ this -> excludeIps as $ excludeIp ) { $ regex = preg_quote ( $ excludeIp ) ; $ regex = str_replace ( '\*' , '.+' , $ regex ) ; $ regex = sprintf ( '/^%s$/' , $ regex ) ; if ( preg_match ( '/^' . $ regex . '$/' , Server :: getRemoteAddress ( ) ) === 1 ) { return false ; } } $ visitInfo = new VisitInfo ( ) ; $ visitInfo -> setCurrentValues ( ) ; return $ this -> handler -> write ( $ visitInfo ) ; }
Store the current visit information
 @return bool Indicates whether storing was successful
Store the current visit information @return bool Indicates whether storing was successful
// Check if the current visit should be excluded // Create the regular expression, replace wildcard character // Store the current visit information