1. Go to this page and download the library: Download fet/laminas-rate-limiting library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
fet / laminas-rate-limiting example snippets
return [
// ... other modules ...
'Fet\\LaminasRateLimiting',
];
return [
'rate_limiting' => [
'enabled' => true, // indicates whether rate limiting is enabled
'max_requests' => 100, // max number of requests
'window' => 60, // time window in seconds
'routes' => [ // routes to apply rate limiting (wildcards allowed)
'home',
'api/*',
'admin/*',
],
],
];
use Acme\Storage\DatabaseStorage;
return [
'rate_limiting' => [
// ... other config options ...
'storage' => [
'name' => DatabaseStorage::class, // this will be loaded via service manager
'options' => [],
],
],
];
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.