DBI
Less than 1 minute
DBI
Properties
dbi
private Adapter $dbiMethods
__construct
Constructs a new instance of the DBI rate limiter backend.
public __construct(array $options): voidInitializes the database adapter using the provided options.
Parameters
| Parameter | Type | Description |
|---|---|---|
$options | array | configuration options for the database adapter |
check
Checks the rate limit status for a given identifier.
public check(string $identifier): voidRetrieves the current rate limit information for the specified identifier, logs a check event in the 'rate_limit_log' table, and appends the event time to the log if the insertion is successful.
Parameters
| Parameter | Type | Description |
|---|---|---|
$identifier | string | the unique identifier to check the rate limit for |
get
Retrieves rate limiting information for a given identifier.
public get(string $identifier): voidThis method queries the 'rate_limit_log' table for entries associated with the specified identifier within the configured time window. It returns an array containing:
- 'log': An array of UNIX timestamps for each relevant event.
- 'last': The timestamp of the last event (default 0).
- 'result': A boolean indicating the result of the rate limit check (default false).
- 'last_result': A boolean indicating the result of the last rate limit check (default false).
Parameters
| Parameter | Type | Description |
|---|---|---|
$identifier | string | the unique identifier for which to retrieve rate limit data |
remove
public remove(string $identifier): voidParameters
| Parameter | Type | Description |
|---|---|---|
$identifier | string |
shutdown
public shutdown(): voidGenerated by Hazaar API Doc Generator on Sun, 01 Mar 2026 09:22:26 +0000