Backend
Less than 1 minute
Backend
Abstract base class for rate limiter backends.
class Backend implements \Hazaar\Util\RateLimiter\Interface\BackendImplements: Hazaar\Util\RateLimiter\Interface\Backend
Provides common properties and methods for managing rate limiting windows and commit operations. Concrete backends should extend this class and implement shutdown logic.
Properties
windowLength
The length of the rate limiting window in seconds.
protected int $windowLengthType: int
commit
Indicates whether the backend should commit changes on destruction.
protected bool $commitType: bool
Methods
__destruct
Destructor for the rate limiter backend.
public __destruct(): voidIf commit is enabled, calls shutdown to persist changes.
setWindowLength
Sets the length of the rate limiting window.
public setWindowLength(int $windowLength): voidReturns: void
Parameters
| Parameter | Type | Description |
|---|---|---|
$windowLength | int | the window length in seconds |
commit
Enables commit mode for the backend.
public commit(): voidReturns: void
When enabled, changes will be committed on destruction.
Generated by Hazaar API Doc Generator on Fri, 04 Sep 2026 23:32:17 +0000