0

I have been working with Doctrine Cache, and wanted to try the Riak provider:

// host: localhost, port: 8098
$client = new \Basho\Riak\Riak($app['host'], $app['port']); 
$bucket = $client->bucket('key_value');
$cacheProvider = new \Doctrine\Common\Cache\RiakCache($bucket);

In the code I created a client as described in the Basho official PHP Client for Riak (also see Taste of Riak: PHP), and passed the bucket as required by the Riak Cache Provider and got the following error:

PHP Catchable fatal error:  Argument 1 passed to 
Doctrine\\Common\\Cache\\RiakCache::__construct() 
must be an instance of Riak\\Bucket, 
instance of Basho\\Riak\\Bucket given.

This error message and the unit test for the Riak provider point to a different client, but the doctrine documentation here doesn't say anything about Riak.

I don't know if the provider used by the Doctrine Cache is an old version of the Official Riak PHP Client, if there is a problem with the code, or if the provider uses a different Riak Client Like the Doctrine riak-php which is experimental and has no documentation on how to install and use it (as far as I can tell).

4

1 回答 1

1

Doctrine 缓存不使用默认的 basho 客户端,而是使用php_riak扩展。看更多:

http://pecl.php.net/package/riak

https://github.com/php-riak/php_riak

于 2014-03-27T15:23:46.013 回答