In my project, I use incubator's Phalcon\Mvc\Model\MetaData\Redis to store metaDatas, but I found that the program cannot connect to remote redis server, problems like this:
[Tue, 16 Jun 15 08:25:02 +0200][ERROR] Could not connect to the Redisd server 127.0.0.1:6379
D:\wamp\www\wish_wall\vendor\phalcon\incubator\Library\Phalcon\Mvc\Model\MetaData\Redis.php(67): Phalcon\Cache\Backend\Redis->save('foo', 'bar') D:\wamp\www\wish_wall\vendor\phalcon\incubator\Library\Phalcon\Mvc\Model\MetaData\Base.php(80): Phalcon\Mvc\Model\MetaData\Redis->getCacheBackend() D:\wamp\www\wish_wall\vendor\phalcon\incubator\Library\Phalcon\Mvc\Model\MetaData\Redis.php(78): Phalcon\Mvc\Model\MetaData\Base->read('map-wenweipo\mo...')
internal function: Phalcon\Mvc\Model\MetaData->_initialize(Object(Wenweipo\Models\WishContent), NULL, NULL, NULL) internal function: Phalcon\Mvc\Model\MetaData->readColumnMapIndex(Object(Wenweipo\Models\WishContent), 1)
internal function: Phalcon\Mvc\Model\Query->_getExpression(Array, true) internal function: Phalcon\Mvc\Model\Query->_getExpression(Array, true) internal function: Phalcon\Mvc\Model\Query->_getExpression(Array, true)
D:\wamp\www\wish_wall\app\controllers\IndexController.php(41): Phalcon\Paginator\Adapter\QueryBuilder->getPaginate()
D:\wamp\www\wish_wall\public\index.php(32): Phalcon\Mvc\Application->handle() {main}
Then I follow the source of MetaData Redis ,found that it use Phalcon\Cache\Backend\Redis for Redis cache. But it's options are wrong:
protected function getCacheBackend()
{
if (null === $this->redis) {
$this->redis = new CacheBackend(
new CacheFrontend(array('lifetime' => $this->options['lifetime'])),
array(
'redis' => $this->options['redis'],
)
);
}
return $this->redis;
}
In version 2.0.x, Phalcon\Cache\Backend\Redis are integrated into framework, and it only support options like this:
//Create the Cache setting redis connection options $cache = new Phalcon\Cache\Backend\Redis($frontCache, array( 'host' => 'localhost', 'port' => 6379, 'auth' => 'foobared', 'persistent' => false ));
So what can I do now?