Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
91e53ec
Initial plan
Copilot Nov 17, 2025
fd3b8b2
Add rate-limit component with core algorithms and features
Copilot Nov 17, 2025
49a675b
Add tests and Chinese documentation for rate-limit component
Copilot Nov 17, 2025
7244451
Add usage examples for rate-limit component
Copilot Nov 17, 2025
ebfb282
删除示例文件:移除不再需要的速率限制示例服务、控制器和中间件
huangdijia Nov 18, 2025
692a228
修复:更新 getRedis 方法以使用 RedisFactory 获取 Redis 连接
huangdijia Nov 18, 2025
8726c64
清理:移除多余的空行以提高代码可读性
huangdijia Nov 18, 2025
4b9463d
修复:在 FixedWindowRateLimiter 中移除多余的参数,优化代码
huangdijia Nov 18, 2025
1c6a491
修复:将 RateLimiterFactory 中的参数名称从 connection 更改为 pool,以提高一致性
huangdijia Nov 18, 2025
59ec6b7
修复:将 RateLimit 中的算法参数类型更改为 Algorithm 枚举,以提高类型安全性;新增 Algorithm 枚举定义
huangdijia Nov 18, 2025
266f98c
修复:将 RateLimiterFactory 中的算法参数类型更改为 Algorithm 枚举,以提高类型安全性
huangdijia Nov 18, 2025
ba1aefd
修复:在各个速率限制算法中优化参数传递,增强类型安全性;更新 RateLimit 注解以使用 Algorithm 枚举
huangdijia Nov 18, 2025
4f911c2
修复:更新 RateLimit 注解中的 key 参数类型为 string|array,以支持更多灵活性;调整 RateLimitAspe…
huangdijia Nov 18, 2025
a9bc464
修复:在 RateLimitAspect 中添加响应代码参数,以增强速率限制异常的可定制性
huangdijia Nov 18, 2025
00626c7
修复:优化 RateLimitAspect 中的注解获取逻辑,移除对类注解的冗余检查
huangdijia Nov 18, 2025
4fb89f8
修复:更新 RateLimit 注解的属性目标,仅支持方法级别
huangdijia Nov 18, 2025
10e05e8
修复:在 RateLimiterFactory 中默认使用 'default' Redis 池;更新测试用例以使用 Algorithm 枚举
huangdijia Nov 18, 2025
b578553
修复:在 RateLimit 注解中添加 Redis 连接池参数,并更新 RateLimitAspect 以支持该参数
huangdijia Nov 18, 2025
df36a1a
修复:在 RateLimitMiddleware 中添加 Redis 连接池参数,以支持自定义连接池
huangdijia Nov 18, 2025
b22610c
修复:更新 RateLimiterFactoryTest 中的类引用,简化算法类的命名空间
huangdijia Nov 18, 2025
0f34d64
修复:在 composer.json 中添加 rate-limit 组件,更新文档以包含 closure-job 和 rate-limit…
huangdijia Nov 18, 2025
9c07602
Update docs and translate
huangdijia Nov 18, 2025
52ae787
修复:在 RateLimitAspect 中修正获取方法参数的方式,确保从正确的键中提取参数
huangdijia Nov 18, 2025
5ea3dc7
修复:在 README_CN.md 中更新限流算法的使用示例,改为使用常量引用算法类型;在 RateLimitAspect.php 中添加…
huangdijia Nov 18, 2025
9e3a2ee
修复:在 README.md 中更新限流算法的使用示例,改为使用常量引用算法类型
huangdijia Nov 18, 2025
748f7c4
修复:在 RateLimitAspect 中修正默认键的返回方式,确保方法签名作为默认键返回
huangdijia Nov 18, 2025
c440eda
修复:在 RateLimitAspect 中修正从方法参数获取键的方式,确保正确提取参数值
huangdijia Nov 18, 2025
d7dd9be
修复:在 RateLimitAspect 中添加对数组键的支持,将数组键合并为字符串
huangdijia Nov 18, 2025
29d561f
修复:在 RateLimitAspect 中修正获取方法参数的方式,确保正确处理参数数组
huangdijia Nov 18, 2025
52b22be
修复:在 RateLimitAspect 中修正数组键的处理方式,确保使用 array_values 以正确合并数组键
huangdijia Nov 18, 2025
020c06a
删除:移除限流组件的中文 README 文件
huangdijia Nov 18, 2025
6f67604
修复:在 composer.json 中添加对 hyperf/collection 的依赖
huangdijia Nov 18, 2025
a42b37c
Create README.md
huangdijia Nov 18, 2025
aff8e5a
修复:在 README 中更新限流注解的用户 ID 占位符,从 {user_id} 修改为 {userId}
huangdijia Nov 18, 2025
ae6f69a
修复:在 README 中移除示例代码的冗余部分,简化动态占位符的说明
huangdijia Nov 18, 2025
489488a
清理:移除 ConfigProvider 中不必要的依赖和发布配置
huangdijia Nov 18, 2025
d0abe58
修复:为 RateLimiterFactory 类中的 limiters 属性添加缺失的 PHPDoc 注释
huangdijia Nov 18, 2025
f83d3c7
修复:在 LuaScripts 中为 zadd 命令添加随机数以确保唯一性
huangdijia Nov 18, 2025
fd5cd6d
修复:在 LuaScripts 中为 zadd 命令添加随机数范围以确保唯一性
huangdijia Nov 18, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@
"friendsofhyperf/openai-client": "*",
"friendsofhyperf/pretty-console": "*",
"friendsofhyperf/purifier": "*",
"friendsofhyperf/rate-limit": "*",
"friendsofhyperf/recaptcha": "*",
"friendsofhyperf/redis-subscriber": "*",
"friendsofhyperf/sentry": "*",
Expand Down Expand Up @@ -206,6 +207,7 @@
"FriendsOfHyperf\\OpenAi\\": "src/openai-client/src/",
"FriendsOfHyperf\\PrettyConsole\\": "src/pretty-console/src/",
"FriendsOfHyperf\\Purifier\\": "src/purifier/src/",
"FriendsOfHyperf\\RateLimit\\": "src/rate-limit/src/",
"FriendsOfHyperf\\ReCaptcha\\": "src/recaptcha/src/",
"FriendsOfHyperf\\Redis\\Subscriber\\": "src/redis-subscriber/src/",
"FriendsOfHyperf\\Sentry\\": "src/sentry/src/",
Expand Down Expand Up @@ -286,6 +288,7 @@
"FriendsOfHyperf\\OpenAi\\ConfigProvider",
"FriendsOfHyperf\\PrettyConsole\\ConfigProvider",
"FriendsOfHyperf\\Purifier\\ConfigProvider",
"FriendsOfHyperf\\RateLimit\\ConfigProvider",
"FriendsOfHyperf\\ReCaptcha\\ConfigProvider",
"FriendsOfHyperf\\Sentry\\ConfigProvider",
"FriendsOfHyperf\\Support\\ConfigProvider",
Expand Down
56 changes: 30 additions & 26 deletions docs/en/guide/start/components.md

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions docs/zh-cn/guide/start/components.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
|--|--|--|--|
|[amqp-job](https://github.com/friendsofhyperf/amqp-job)|[![Latest Stable Version](https://poser.pugx.org/friendsofhyperf/amqp-job/v)](https://packagist.org/packages/friendsofhyperf/amqp-job)|[![Total Downloads](https://poser.pugx.org/friendsofhyperf/amqp-job/downloads)](https://packagist.org/packages/friendsofhyperf/amqp-job)|[![Monthly Downloads](https://poser.pugx.org/friendsofhyperf/amqp-job/d/monthly)](https://packagist.org/packages/friendsofhyperf/amqp-job)|
|[cache](https://github.com/friendsofhyperf/cache)|[![Latest Stable Version](https://poser.pugx.org/friendsofhyperf/cache/v)](https://packagist.org/packages/friendsofhyperf/cache)|[![Total Downloads](https://poser.pugx.org/friendsofhyperf/cache/downloads)](https://packagist.org/packages/friendsofhyperf/cache)|[![Monthly Downloads](https://poser.pugx.org/friendsofhyperf/cache/d/monthly)](https://packagist.org/packages/friendsofhyperf/cache)|
|[closure-job](https://github.com/friendsofhyperf/closure-job)|[![Latest Stable Version](https://poser.pugx.org/friendsofhyperf/closure-job/v)](https://packagist.org/packages/friendsofhyperf/closure-job)|[![Total Downloads](https://poser.pugx.org/friendsofhyperf/closure-job/downloads)](https://packagist.org/packages/friendsofhyperf/closure-job)|[![Monthly Downloads](https://poser.pugx.org/friendsofhyperf/closure-job/d/monthly)](https://packagist.org/packages/friendsofhyperf/closure-job)|
|[co-phpunit](https://github.com/friendsofhyperf/co-phpunit)|[![Latest Stable Version](https://poser.pugx.org/friendsofhyperf/co-phpunit/v)](https://packagist.org/packages/friendsofhyperf/co-phpunit)|[![Total Downloads](https://poser.pugx.org/friendsofhyperf/co-phpunit/downloads)](https://packagist.org/packages/friendsofhyperf/co-phpunit)|[![Monthly Downloads](https://poser.pugx.org/friendsofhyperf/co-phpunit/d/monthly)](https://packagist.org/packages/friendsofhyperf/co-phpunit)|
|[command-benchmark](https://github.com/friendsofhyperf/command-benchmark)|[![Latest Stable Version](https://poser.pugx.org/friendsofhyperf/command-benchmark/v)](https://packagist.org/packages/friendsofhyperf/command-benchmark)|[![Total Downloads](https://poser.pugx.org/friendsofhyperf/command-benchmark/downloads)](https://packagist.org/packages/friendsofhyperf/command-benchmark)|[![Monthly Downloads](https://poser.pugx.org/friendsofhyperf/command-benchmark/d/monthly)](https://packagist.org/packages/friendsofhyperf/command-benchmark)|
|[command-signals](https://github.com/friendsofhyperf/command-signals)|[![Latest Stable Version](https://poser.pugx.org/friendsofhyperf/command-signals/v)](https://packagist.org/packages/friendsofhyperf/command-signals)|[![Total Downloads](https://poser.pugx.org/friendsofhyperf/command-signals/downloads)](https://packagist.org/packages/friendsofhyperf/command-signals)|[![Monthly Downloads](https://poser.pugx.org/friendsofhyperf/command-signals/d/monthly)](https://packagist.org/packages/friendsofhyperf/command-signals)|
Expand Down Expand Up @@ -41,6 +42,7 @@
|[openai-client](https://github.com/friendsofhyperf/openai-client)|[![Latest Stable Version](https://poser.pugx.org/friendsofhyperf/openai-client/v)](https://packagist.org/packages/friendsofhyperf/openai-client)|[![Total Downloads](https://poser.pugx.org/friendsofhyperf/openai-client/downloads)](https://packagist.org/packages/friendsofhyperf/openai-client)|[![Monthly Downloads](https://poser.pugx.org/friendsofhyperf/openai-client/d/monthly)](https://packagist.org/packages/friendsofhyperf/openai-client)|
|[pretty-console](https://github.com/friendsofhyperf/pretty-console)|[![Latest Stable Version](https://poser.pugx.org/friendsofhyperf/pretty-console/v)](https://packagist.org/packages/friendsofhyperf/pretty-console)|[![Total Downloads](https://poser.pugx.org/friendsofhyperf/pretty-console/downloads)](https://packagist.org/packages/friendsofhyperf/pretty-console)|[![Monthly Downloads](https://poser.pugx.org/friendsofhyperf/pretty-console/d/monthly)](https://packagist.org/packages/friendsofhyperf/pretty-console)|
|[purifier](https://github.com/friendsofhyperf/purifier)|[![Latest Stable Version](https://poser.pugx.org/friendsofhyperf/purifier/v)](https://packagist.org/packages/friendsofhyperf/purifier)|[![Total Downloads](https://poser.pugx.org/friendsofhyperf/purifier/downloads)](https://packagist.org/packages/friendsofhyperf/purifier)|[![Monthly Downloads](https://poser.pugx.org/friendsofhyperf/purifier/d/monthly)](https://packagist.org/packages/friendsofhyperf/purifier)|
|[rate-limit](https://github.com/friendsofhyperf/rate-limit)|[![Latest Stable Version](https://poser.pugx.org/friendsofhyperf/rate-limit/v)](https://packagist.org/packages/friendsofhyperf/rate-limit)|[![Total Downloads](https://poser.pugx.org/friendsofhyperf/rate-limit/downloads)](https://packagist.org/packages/friendsofhyperf/rate-limit)|[![Monthly Downloads](https://poser.pugx.org/friendsofhyperf/rate-limit/d/monthly)](https://packagist.org/packages/friendsofhyperf/rate-limit)|
|[recaptcha](https://github.com/friendsofhyperf/recaptcha)|[![Latest Stable Version](https://poser.pugx.org/friendsofhyperf/recaptcha/v)](https://packagist.org/packages/friendsofhyperf/recaptcha)|[![Total Downloads](https://poser.pugx.org/friendsofhyperf/recaptcha/downloads)](https://packagist.org/packages/friendsofhyperf/recaptcha)|[![Monthly Downloads](https://poser.pugx.org/friendsofhyperf/recaptcha/d/monthly)](https://packagist.org/packages/friendsofhyperf/recaptcha)|
|[redis-subscriber](https://github.com/friendsofhyperf/redis-subscriber)|[![Latest Stable Version](https://poser.pugx.org/friendsofhyperf/redis-subscriber/v)](https://packagist.org/packages/friendsofhyperf/redis-subscriber)|[![Total Downloads](https://poser.pugx.org/friendsofhyperf/redis-subscriber/downloads)](https://packagist.org/packages/friendsofhyperf/redis-subscriber)|[![Monthly Downloads](https://poser.pugx.org/friendsofhyperf/redis-subscriber/d/monthly)](https://packagist.org/packages/friendsofhyperf/redis-subscriber)|
|[sentry](https://github.com/friendsofhyperf/sentry)|[![Latest Stable Version](https://poser.pugx.org/friendsofhyperf/sentry/v)](https://packagist.org/packages/friendsofhyperf/sentry)|[![Total Downloads](https://poser.pugx.org/friendsofhyperf/sentry/downloads)](https://packagist.org/packages/friendsofhyperf/sentry)|[![Monthly Downloads](https://poser.pugx.org/friendsofhyperf/sentry/d/monthly)](https://packagist.org/packages/friendsofhyperf/sentry)|
Expand Down
3 changes: 2 additions & 1 deletion docs/zh-hk/guide/start/components.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
|Repository|Stable Version|Total Downloads|Monthly Downloads|
|--|--|--|--|
|[amqp-job](https://github.com/friendsofhyperf/amqp-job)|[![Latest Stable Version](https://poser.pugx.org/friendsofhyperf/amqp-job/v)](https://packagist.org/packages/friendsofhyperf/amqp-job)|[![Total Downloads](https://poser.pugx.org/friendsofhyperf/amqp-job/downloads)](https://packagist.org/packages/friendsofhyperf/amqp-job)|[![Monthly Downloads](https://poser.pugx.org/friendsofhyperf/amqp-job/d/monthly)](https://packagist.org/packages/friendsofhyperf/amqp-job)|
|[async-queue-closure-job](https://github.com/friendsofhyperf/async-queue-closure-job)|[![Latest Stable Version](https://poser.pugx.org/friendsofhyperf/async-queue-closure-job/v)](https://packagist.org/packages/friendsofhyperf/async-queue-closure-job)|[![Total Downloads](https://poser.pugx.org/friendsofhyperf/async-queue-closure-job/downloads)](https://packagist.org/packages/friendsofhyperf/async-queue-closure-job)|[![Monthly Downloads](https://poser.pugx.org/friendsofhyperf/async-queue-closure-job/d/monthly)](https://packagist.org/packages/friendsofhyperf/async-queue-closure-job)|
|[cache](https://github.com/friendsofhyperf/cache)|[![Latest Stable Version](https://poser.pugx.org/friendsofhyperf/cache/v)](https://packagist.org/packages/friendsofhyperf/cache)|[![Total Downloads](https://poser.pugx.org/friendsofhyperf/cache/downloads)](https://packagist.org/packages/friendsofhyperf/cache)|[![Monthly Downloads](https://poser.pugx.org/friendsofhyperf/cache/d/monthly)](https://packagist.org/packages/friendsofhyperf/cache)|
|[closure-job](https://github.com/friendsofhyperf/closure-job)|[![Latest Stable Version](https://poser.pugx.org/friendsofhyperf/closure-job/v)](https://packagist.org/packages/friendsofhyperf/closure-job)|[![Total Downloads](https://poser.pugx.org/friendsofhyperf/closure-job/downloads)](https://packagist.org/packages/friendsofhyperf/closure-job)|[![Monthly Downloads](https://poser.pugx.org/friendsofhyperf/closure-job/d/monthly)](https://packagist.org/packages/friendsofhyperf/closure-job)|
|[co-phpunit](https://github.com/friendsofhyperf/co-phpunit)|[![Latest Stable Version](https://poser.pugx.org/friendsofhyperf/co-phpunit/v)](https://packagist.org/packages/friendsofhyperf/co-phpunit)|[![Total Downloads](https://poser.pugx.org/friendsofhyperf/co-phpunit/downloads)](https://packagist.org/packages/friendsofhyperf/co-phpunit)|[![Monthly Downloads](https://poser.pugx.org/friendsofhyperf/co-phpunit/d/monthly)](https://packagist.org/packages/friendsofhyperf/co-phpunit)|
|[command-benchmark](https://github.com/friendsofhyperf/command-benchmark)|[![Latest Stable Version](https://poser.pugx.org/friendsofhyperf/command-benchmark/v)](https://packagist.org/packages/friendsofhyperf/command-benchmark)|[![Total Downloads](https://poser.pugx.org/friendsofhyperf/command-benchmark/downloads)](https://packagist.org/packages/friendsofhyperf/command-benchmark)|[![Monthly Downloads](https://poser.pugx.org/friendsofhyperf/command-benchmark/d/monthly)](https://packagist.org/packages/friendsofhyperf/command-benchmark)|
|[command-signals](https://github.com/friendsofhyperf/command-signals)|[![Latest Stable Version](https://poser.pugx.org/friendsofhyperf/command-signals/v)](https://packagist.org/packages/friendsofhyperf/command-signals)|[![Total Downloads](https://poser.pugx.org/friendsofhyperf/command-signals/downloads)](https://packagist.org/packages/friendsofhyperf/command-signals)|[![Monthly Downloads](https://poser.pugx.org/friendsofhyperf/command-signals/d/monthly)](https://packagist.org/packages/friendsofhyperf/command-signals)|
Expand Down Expand Up @@ -42,6 +42,7 @@
|[openai-client](https://github.com/friendsofhyperf/openai-client)|[![Latest Stable Version](https://poser.pugx.org/friendsofhyperf/openai-client/v)](https://packagist.org/packages/friendsofhyperf/openai-client)|[![Total Downloads](https://poser.pugx.org/friendsofhyperf/openai-client/downloads)](https://packagist.org/packages/friendsofhyperf/openai-client)|[![Monthly Downloads](https://poser.pugx.org/friendsofhyperf/openai-client/d/monthly)](https://packagist.org/packages/friendsofhyperf/openai-client)|
|[pretty-console](https://github.com/friendsofhyperf/pretty-console)|[![Latest Stable Version](https://poser.pugx.org/friendsofhyperf/pretty-console/v)](https://packagist.org/packages/friendsofhyperf/pretty-console)|[![Total Downloads](https://poser.pugx.org/friendsofhyperf/pretty-console/downloads)](https://packagist.org/packages/friendsofhyperf/pretty-console)|[![Monthly Downloads](https://poser.pugx.org/friendsofhyperf/pretty-console/d/monthly)](https://packagist.org/packages/friendsofhyperf/pretty-console)|
|[purifier](https://github.com/friendsofhyperf/purifier)|[![Latest Stable Version](https://poser.pugx.org/friendsofhyperf/purifier/v)](https://packagist.org/packages/friendsofhyperf/purifier)|[![Total Downloads](https://poser.pugx.org/friendsofhyperf/purifier/downloads)](https://packagist.org/packages/friendsofhyperf/purifier)|[![Monthly Downloads](https://poser.pugx.org/friendsofhyperf/purifier/d/monthly)](https://packagist.org/packages/friendsofhyperf/purifier)|
|[rate-limit](https://github.com/friendsofhyperf/rate-limit)|[![Latest Stable Version](https://poser.pugx.org/friendsofhyperf/rate-limit/v)](https://packagist.org/packages/friendsofhyperf/rate-limit)|[![Total Downloads](https://poser.pugx.org/friendsofhyperf/rate-limit/downloads)](https://packagist.org/packages/friendsofhyperf/rate-limit)|[![Monthly Downloads](https://poser.pugx.org/friendsofhyperf/rate-limit/d/monthly)](https://packagist.org/packages/friendsofhyperf/rate-limit)|
|[recaptcha](https://github.com/friendsofhyperf/recaptcha)|[![Latest Stable Version](https://poser.pugx.org/friendsofhyperf/recaptcha/v)](https://packagist.org/packages/friendsofhyperf/recaptcha)|[![Total Downloads](https://poser.pugx.org/friendsofhyperf/recaptcha/downloads)](https://packagist.org/packages/friendsofhyperf/recaptcha)|[![Monthly Downloads](https://poser.pugx.org/friendsofhyperf/recaptcha/d/monthly)](https://packagist.org/packages/friendsofhyperf/recaptcha)|
|[redis-subscriber](https://github.com/friendsofhyperf/redis-subscriber)|[![Latest Stable Version](https://poser.pugx.org/friendsofhyperf/redis-subscriber/v)](https://packagist.org/packages/friendsofhyperf/redis-subscriber)|[![Total Downloads](https://poser.pugx.org/friendsofhyperf/redis-subscriber/downloads)](https://packagist.org/packages/friendsofhyperf/redis-subscriber)|[![Monthly Downloads](https://poser.pugx.org/friendsofhyperf/redis-subscriber/d/monthly)](https://packagist.org/packages/friendsofhyperf/redis-subscriber)|
|[sentry](https://github.com/friendsofhyperf/sentry)|[![Latest Stable Version](https://poser.pugx.org/friendsofhyperf/sentry/v)](https://packagist.org/packages/friendsofhyperf/sentry)|[![Total Downloads](https://poser.pugx.org/friendsofhyperf/sentry/downloads)](https://packagist.org/packages/friendsofhyperf/sentry)|[![Monthly Downloads](https://poser.pugx.org/friendsofhyperf/sentry/d/monthly)](https://packagist.org/packages/friendsofhyperf/sentry)|
Expand Down
Loading