Backend
Less than 1 minute
Backend
Abstract base class for rate limiter backends.
class Backend implements \Hazaar\Util\RateLimiter\BackendInterfaceProvides 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 $windowLengthcommit
Indicates whether the backend should commit changes on destruction.
protected bool $commitMethods
__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): voidParameters
| Parameter | Type | Description |
|---|---|---|
$windowLength | int | the window length in seconds |
commit
Enables commit mode for the backend.
public commit(): voidWhen enabled, changes will be committed on destruction.
Generated by Hazaar API Doc Generator on Tue, 21 Apr 2026 04:00:24 +0000