Download the PHP package veasin/ff-redis without Composer

On this page you can find all versions of the php package veasin/ff-redis. 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 ff-redis

ff-redis

Redis connection pool, queue driver, and cache driver for ff framework (PHP 8.4+).


Connection Pool

按配置名管理 Redis 连接生命周期,支持惰性验证与自动重连。由 ff\resource\redis() 函数实现,被 ff\cache\redis() 和 ff\queue\redis() 驱动内部自动调用,也可直接使用。

连接通过 container("#redis.{name}") 配置。默认 $name = 'default',未配置时自动回退:

Redis 扩展不存在或连接失败时返回 null,不会抛异常。

惰性验证

通过 #resource.redis.ttl 设置验证间隔(秒),超时后自动执行 ping() 检测连接健康,断连时自动重建。默认 0 不验证。

自定义工厂

Swoole 协程版 Redis 或其他自定义实现:

配置项

容器 key 类型 说明
#redis.{name} array Redis 连接配置,支持 host、port、password、database、timeout、prefix
#resource.redis.ttl int 连接验证间隔秒数,默认 0 不验证
#resource/redis: callable 自定义 Redis 工厂,签名 fn(array $config): \Redis

Queue Driver

基于 Redis list 的队列驱动,生产使用 lPush + serialize,消费使用 brPop 阻塞弹出。

注册

ff-redis 的 bootstrap.php 已自动完成注册,安装后即可使用。

使用

独立使用

在 ext('queue', ...) 之外也可直接调用底层驱动:

timeout 为 brPop 阻塞等待秒数,0 表示永久阻塞。

配置

通过 container('#queue/redis') 配置:

容器 key 类型 说明
#queue/redis array 队列驱动配置:config、prefix、timeout、ttl

Cache Driver

签名与 apcu() 完全一致。底层使用 ff\resource\redis() 获取连接,无需单独配置连接。

CRUD

中间件工厂模式

与 cache() 编排函数配合使用:

配置

容器 key 类型 说明
#cache.redis array 默认缓存 Redis 连接配置
#cache.redis.{name} array 命名配置,支持 ttl、prefix

Ext Registration

ff-redis 自动在 bootstrap.php 中注册 ext 驱动(通过 composer.json 的 autoload.files 加载):

安装后即可通过 ext('queue', 'redis', ...) 和 ext('cache', 'redis', ...) 调用。

也支持直接 use function ff\queue\redis / use function ff\cache\redis 独立使用。


All versions of ff-redis with dependencies

PHP Build Version
Package Version
Requires php Version >=8.4
veasin/ff Version >=0.3.0
ext-redis Version *
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 veasin/ff-redis contains the following files

Loading the files please wait ...