avaibook/symfony-rate-limiter 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

avaibook/symfony-rate-limiter

最新稳定版本:4.4

Composer 安装命令:

composer require avaibook/symfony-rate-limiter

包简介

Sf4.4 compatibility patch of Symfony RateLimiter component, that provides a Token Bucket implementation to rate limit input and output in your application

README 文档

README

The Rate Limiter component provides a Token Bucket implementation to rate limit input and output in your application.

This is a fork of the original bundle that makes it compatible with Symfony <= 4.4.

This Component is experimental. Experimental features are not covered by Symfony's Backward Compatibility Promise.

Getting Started

$ composer require avaibook/symfony-rate-limiter 
use Symfony\Component\RateLimiter\Storage\InMemoryStorage; use Symfony\Component\RateLimiter\RateLimiterFactory; $factory = new RateLimiterFactory([ 'id' => 'login', 'policy' => 'token_bucket', 'limit' => 10, 'rate' => ['interval' => '15 minutes'], ], new InMemoryStorage()); $limiter = $factory->create(); // blocks until 1 token is free to use for this process $limiter->reserve(1)->wait(); // ... execute the code // only claims 1 token if it's free at this moment (useful if you plan to skip this process) if ($limiter->consume(1)->isAccepted()) { // ... execute the code }

Resources

统计信息

  • 总下载量: 16.5k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固