2

I am trying to get this package https://github.com/nrk/predis-async and the instructions says to do: composer require predis/predis-async. I tried downloading the options phpiredis extension but when I run composer it says:

 Problem 1
   - predis/predis-async v0.2.3 require ext-phireids * -> the requested PHP extension phpiredis is missing from your system

Do I need to add an extension to the php ini file (if so how do I do this)?

If that doesnt work the owner the github says "pass in ['phpiredis' => false] in the array of client options" how do I pass in options with composer?

4

1 回答 1

1

如果您想使用它,需要将扩展​​ ppiredis woudl 添加到 php.ini 以加载到 PHP 进程中。

但是 - 根据 predis-async composer 文件,该ext-phpiredis模块只是一个建议 - 所以 Composer 不需要它。但是,这仅适用于最新版本的代码 - 最后一个稳定版本,v0.2.3 明确要求它 - 这就是您所看到的。

我的建议是使用最新版本的代码,

# in the 'require' part of composer
"predis/predis-async": "dev-master",

如果您不希望代码在更新或部署时可能会从您下方更改,您还可以显式列出特定的 sha1-hash。

该最新代码已将扩展名移至建议。

客户端选项位于“Predis\Async\Client”构造函数(由您的 PHP 代码调用)中,这是一个数组,作为 Redis 服务器地址之后的第二个参数。

于 2015-07-20T22:11:27.240 回答