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).

Onema
  • 7,331
  • 12
  • 66
  • 102

1 Answers1

1

Doctrine cache does not use the default basho client, but uses the php_riak extension. See more:

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

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

alpakyol
  • 2,402
  • 2
  • 29
  • 35
kasparp
  • 11
  • 1