CoolCMS API

ApiClientLimitResult
in package

FinalYes

Result of an application key limit check. For an exceeded limit it carries the window that caused it, `Retry-After` (seconds to the end of the window, at least 1) and whether this is the first refusal in the window; only that one is written to the auth log, so a flood does not flood the log too.

Table of Contents

Constants

WINDOW_IP  : string = 'ip_minute'
WINDOW_MINUTE  : string = 'client_minute'
WINDOW_SECOND  : string = 'client_second'
WINDOW_USER  : string = 'user_minute'

Properties

$allowed  : bool
$firstRefusal  : bool
$limit  : int
$retryAfter  : int
$window  : string|null

Methods

allowed()  : self
exceeded()  : self
__construct()  : mixed

Constants

Properties

Methods

exceeded()

public static exceeded(string $window, int $limit, int $retryAfter, bool $firstRefusal) : self
Parameters
$window : string
$limit : int
$retryAfter : int
$firstRefusal : bool
Return values
self

__construct()

private __construct(bool $allowed[, string|null $window = null ][, int $limit = 0 ][, int $retryAfter = 0 ][, bool $firstRefusal = false ]) : mixed
Parameters
$allowed : bool
$window : string|null = null
$limit : int = 0
$retryAfter : int = 0
$firstRefusal : bool = false
On this page

Search results