Download the PHP package wilbur-yu/hyperf-cache-ext without Composer

On this page you can find all versions of the php package wilbur-yu/hyperf-cache-ext. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package hyperf-cache-ext

说明

BETA

移植了 Laravel Cache 组件的 rate-limiter.

并对 \Psr\SimpleCache\CacheInterface 进行了补充. 增加了以下方法:

安装

配置

  1. 修改cache配置文件:

在服务启动时, 监听器会收集该命名限制器数组, 供在注解中使用 for 参数引用. 在注解切面执行时, 会将当前请求 \Hyperf\HttpServer\Contract\RequestInterface 实例注入到该命名闭包.

  1. 可捕获异常

使用

在控制器中使用

注解参数同配置文件, 优先级为注解>配置>默认.

  1. 在计数器注解中使用 for 时, max_attemptsdecay_minutes 不起作用.
  2. timeoutwait 参数, 适用于漏斗时间窗口

如果你的缓存驱动不是 redis, 只可以使用 CounterRateLimit 注解.

反之则可以使用 CounterRateLimitWithRedis/ConcurrencyRateLimiter/DurationRateLimiter 注解.

在其他地方使用限速时, 可以使用辅助函数

  1. counter_limiter()

使用方法同 Laravel中的 RateLimiter Facade, 可参考 Laravel 限流文档

  1. concurrency_limiter()

使用方法同 Laravel 中的 Redis::funnel 门面代理方法 可参考高级限流器: 限定并发请求访问上限

  1. duration_limiter()

使用方法同 Laravel 中的 Redis::throttle 门面代理方法 可参考高级限流器: 限定单位时间访问上限

感谢

Laravel Cache

Hyperf Rate-Limit


All versions of hyperf-cache-ext with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0
hyperf/cache Version ^3.0
hyperf/di Version ^3.0
hyperf/exception-handler Version ^3.0
hyperf/framework Version ^3.0
hyperf/http-server Version ^3.0
hyperf/redis Version ^3.0
hyperf/stringable Version ^3.0
hyperf/support Version ^3.0
hyperf/tappable Version ^3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package wilbur-yu/hyperf-cache-ext contains the following files

Loading the files please wait ....