I use modelsCache such way:
$di->setShared('modelsCache', function () {
$frontCache = new DataFrontend([
'lifetime' => 3600 * 24 * 7
]);
$redis = new \Phalcon\Cache\Backend\Redis($frontCache, [
'host' => $this->get('config')->redis->host,
'port' => $this->get('config')->redis->port,
'auth' => $this->get('config')->redis->password
]);
return $redis;
});
and I got error:
Fatal error: Class 'redis' not found in /home/www/apps/models/entities/Company/Company.php on line 421
This line is:
$company = Company::findFirst([
'cache' => 'company_cache_key'
]);
This code return true:
class_exists('\Phalcon\Cache\Backend\Redis');
I suspect there is problem with some Phalcon Framework class which handle Redis. But I have no idea how to fix it. Other libraries which use Redis work fines, generally Redis server works good. Any idea?