Skip to content

Commit 077a5b2

Browse files
committed
updated readme.
1 parent 86597e9 commit 077a5b2

File tree

1 file changed

+0
-33
lines changed

1 file changed

+0
-33
lines changed

README.md

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,6 @@ $router->get('/api/data', $handler, 'rate_limit');
114114

115115
### Configuration Options
116116

117-
Rate limiting can be configured via array or environment variables:
118-
119117
```php
120118
// Array configuration
121119
$config = new RateLimitConfig([
@@ -127,13 +125,6 @@ $config = new RateLimitConfig([
127125
'redis_port' => 6379,
128126
'file_path' => 'cache/rate_limits'
129127
]);
130-
131-
// From settings/environment variables (flat structure)
132-
// RATE_LIMIT_ENABLED=true
133-
// RATE_LIMIT_STORAGE=redis
134-
// RATE_LIMIT_REQUESTS=100
135-
// RATE_LIMIT_WINDOW=3600
136-
$config = RateLimitConfig::fromSettings($settingsSource);
137128
```
138129

139130
### Storage Backends
@@ -172,30 +163,6 @@ $config = new RateLimitConfig([
172163
]);
173164
```
174165

175-
### Advanced Features
176-
177-
#### Key Strategies
178-
Control how rate limits are applied:
179-
180-
```php
181-
// Limit by IP address (default)
182-
$filter = new RateLimitFilter($config, 'ip');
183-
184-
// Limit by authenticated user
185-
$filter = new RateLimitFilter($config, 'user');
186-
187-
// Limit by IP + route combination
188-
$filter = new RateLimitFilter($config, 'route');
189-
190-
// Custom key generation
191-
class CustomRateLimitFilter extends RateLimitFilter {
192-
protected function getCustomKey(RouteMap $route): string {
193-
// Your custom logic here
194-
return $_SESSION['tenant_id'] ?? $this->getClientIp();
195-
}
196-
}
197-
```
198-
199166
#### Whitelisting and Blacklisting
200167

201168
```php

0 commit comments

Comments
 (0)