IpHandler
in package
Uses
UtilsProvider
Handle IPs hashed correctly depending on settings.
Table of Contents
Constants
Properties
Methods
- getInstance() : mixed
- Get singleton instance.
- getPluginConstantPrefix() : string
- Get the prefix of this plugin so composer packages can dynamically build other constant values on it.
- isFlooding() : bool
- Checks the current IP if it is already persisted, it avoids to flood the API all x seconds.
- persistIp() : mixed
- Get persistable IP for database. It also respects IP settings.
- __construct() : mixed
- C'tor.
Constants
FLOODING_MAX_ENTRIES_IN_DEFINED_SECONDS
public
mixed
FLOODING_MAX_ENTRIES_IN_DEFINED_SECONDS
= 255
FLOODING_SECONDS
public
mixed
FLOODING_SECONDS
= 60
Properties
$me
Singleton instance.
private
static IpHandler
$me
= null
Methods
getInstance()
Get singleton instance.
public
static getInstance() : mixed
Tags
getPluginConstantPrefix()
Get the prefix of this plugin so composer packages can dynamically build other constant values on it.
public
getPluginConstantPrefix() : string
Tags
Return values
stringisFlooding()
Checks the current IP if it is already persisted, it avoids to flood the API all x seconds.
public
isFlooding() : bool
Return values
bool —Returns true if you are allowed to create a new consent
persistIp()
Get persistable IP for database. It also respects IP settings.
public
persistIp([string $ip = null ][, bool $saveIp = null ]) : mixed
If the IP is not stored, we need to truncate the last IP block so it is annonymous.
Parameters
- $ip : string = null
-
Default current IP
- $saveIp : bool = null
-
Determines if the return result should contain persitable
ipv4
andipv6
values, defaults to Consent > "Save IP" option
Tags
__construct()
C'tor.
private
__construct() : mixed