Download the PHP package tobento/app-rate-limiter without Composer
On this page you can find all versions of the php package tobento/app-rate-limiter. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download tobento/app-rate-limiter
More information about tobento/app-rate-limiter
Files in tobento/app-rate-limiter
Package app-rate-limiter
Short Description App rate limiter support.
License MIT
Homepage https://www.tobento.ch
Informations about the package app-rate-limiter
App Rate Limiter
Rate limiter support for the app using the Symfony - Rate Limiter component as default implementation.
Table of Contents
- Getting Started
- Requirements
- Documentation
- App
- Rate Limiter Boot
- Rate Limiter Config
- Basic Usage
- Using The Rate Limiter Creator
- Using The RateLimitRequests Middleware
- Available Rate Limiter Registries
- Factory
- Fixed Window
- Named
- No Limit
- Sliding Window
- Token Bucket
- Register Named Rate Limiters
- Events
- Credits
Getting Started
Add the latest version of the app rate limiter project running this command.
Requirements
- PHP 8.0 or greater
Documentation
App
Check out the App Skeleton if you are using the skeleton.
You may also check out the App to learn more about the app in general.
Rate Limiter Boot
The rate limiter boot does the following:
- installs and loads rate limiter config file
- implements rate limiter interfaces
Rate Limiter Config
The configuration for the rate limiter is located in the file at the default App Skeleton config location where you can specify named rate limiters for your application.
Basic Usage
Using The Rate Limiter Creator
After having App Http - Routing Boot as well in order to get HTTP and Routing support.
Check out the Available Rate Limiter Registries for its available limiter registries.
Using The RateLimitRequests Middleware
Use the middleware to rate limit routes easily.
Available Rate Limiter Registries
Factory
The registry may be used to create a rate limiter from any factory:
Fixed Window
The registry creates a Symfony fixed window rate limiter:
You may define a cache for the name (default) or (custom) in the App Cache - Config, otherwise the primary cache is used as default.
Named
The registry may be used to create a rate limiter from a named rate limiter:
Check out the Register Named Rate Limiters section to learn more about it.
No Limit
The registry creates a Symfony no limit rate limiter:
Sliding Window
The registry creates a Symfony sliding window rate limiter:
You may define a cache for the name (default) or (custom) in the App Cache - Config, otherwise the primary cache is used as default.
Token Bucket
The registry creates a Symfony token bucket rate limiter:
You may define a cache for the name (default) or (custom) in the App Cache - Config, otherwise the primary cache is used as default.
Register Named Rate Limiters
Register Named Rate Limiter via Config
You can register named rate limiters in the config file :
Register Named Rate Limiter via Boot
Events
Available Events
Event | Description |
---|---|
The event will dispatch after the attempts exceeded |
Supporting Events
Simply, install the App Event bundle.
Credits
- Tobias Strub
- All Contributors
- Seldaek Monolog
All versions of app-rate-limiter with dependencies
tobento/app Version ^1.0.7
tobento/app-migration Version ^1.0
tobento/app-http Version ^1.0 || ^1.1
tobento/app-cache Version ^1.0.1
symfony/rate-limiter Version ^6.0