Download the PHP package twinh/rate-limiter without Composer
On this page you can find all versions of the php package twinh/rate-limiter. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download twinh/rate-limiter
More information about twinh/rate-limiter
Files in twinh/rate-limiter
Download twinh/rate-limiter
More information about twinh/rate-limiter
Files in twinh/rate-limiter
Vendor twinh
Package rate-limiter
Short Description A flexible and scalable Rate Limiter, supporting various common strategies and storage methods.
License
Package rate-limiter
Short Description A flexible and scalable Rate Limiter, supporting various common strategies and storage methods.
License
Please rate this library. Is it a good library?
Informations about the package rate-limiter
PHP Rate Limiter
A flexible and scalable Rate Limiter, supporting various common strategies and storage methods.
Getting started
Feature
- ✨ Supports multiple strategies:
FixedWindow
,SlidingWindow
,LeakyBucket
, andTokenBucket
(not yet). - 🖥️ Compatible with
Redis
,Memory
, andDatabase
(not yet) storage methods. - 💪 Robust and scalable architecture with atomic operations for high traffic and large user bases.
- ⚙️ Flexible rate limit and window size configuration.
- 🚪 Clear API for attempting, getting remaining attempts, and clearing rate limits.
- 🌐 Supports global, and user-specific rate limits.
Install
Document
Initialize the FixedWindow Rate Limiter
Initialize the SlidingWindow Rate Limiter
Initialize the LeakyBucket Rate Limiter
Set Redis Storage
Attempts to execute a rate limited operation
Attempts to execute a rate limited operation with global scope
Attempts to execute a rate limited operation with client IP
Attempts to execute a rate limited operation with server IP
Get the remaining attempts
Clear the request limit
Extend more storages and rate limiters
Add Storage
- Create a new class that implements the
RateLimiter\Xxx\StorageInterface
interface of the rate limiter. - Implement the methods of the storage class.
- Create the rate limiter object with the new storage object.
Add Rate Limiter
- Create a new class that implements the
RateLimiter\RateLimiterInterface
. - Implement the methods of the rate limiter class.
- Create a
StorageInterface
for the rate limiter class. - Implement storage object.
Class Diagram
All versions of rate-limiter with dependencies
PHP Build Version
Package Version
Requires
php Version
>=8.0
ext-redis Version *
ext-redis Version *
The package twinh/rate-limiter contains the following files
Loading the files please wait ....