如何在codeigniter中使用predis

时间:2017-07-18 10:01:07

标签: php codeigniter redis

我正在使用 #!/usr/bin/expect #Replace with remote username and remote ipaddress spawn /usr/bin/ssh -o StrictHostKeyChecking=no username@IPAddress #Replace with remote username and remote ipaddress expect "username@IPAddress's password: " #Provide remote system password send "urpassword\n" #add commands to be executed. Also possible to execute bash scripts expect "$ " {send "pwd\n"} # bash command expect "$ " {send "cd mytest\n"} expect "$ " {send "./first.sh\n"} # bash scripts expect "$ " {send "exit\n"} interact 框架。 我想在我的项目中使用codeigniter

为此我找到了这个库:

redis

我用作曲家安装了它。

现在我想用它:

https://packagist.org/packages/predis/predis

但我收到了这条消息:

  $client = new Predis\Client();

1 个答案:

答案 0 :(得分:0)

确保在$config['composer_autoload'] = true

中设置application/config/config.php

此外,CodeIgniter假定您已将compsoer安装到application目录中。如果您已将其安装在其他位置(例如,在项目的根目录中),则需要将$config['composer_autoload']设置为编写器供应商autoload.php文件的路径

例如

$config['composer_autoload'] = '/vendor/autoload.php';