Conversation
Just one question left ... The interface defines the methods "insert" and "update". In Couchbase you have "add" which will return an error if the data-set exists, "replace" which will only save the data if the data-set exists and "set" which will save the data whether the key already exists or not. I used "add" for "insert". Please write it down if that's wrong implemented. |
/** | ||
* @var \PHPUnit_Framework_MockObject_MockObject | ||
*/ | ||
private $couchbase; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use spaces for the indentation, not tabs
The DBALStorage uses a SQL Insert so it will also fail on existing keys: https://github.com/doctrine/KeyValueStore/blob/master/lib/Doctrine/KeyValueStore/Storage/DBALStorage.php#L78 and you should add a suggestion for |
|
||
protected function setUp() | ||
{ | ||
$this->couchbase = $this->getMockBuilder('\Couchbase') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you need to skip the test when the Couchbase class is not available instead of making it fail with an exception
The current implementation will just do nothing as you don't get a return-value ... The php-extension returns FALSE if insert or update fails - but I don't know how to handle it .. The current implementation for DBAL f.e. is quite loosy as well .. they all don't care if the functions fail. |
@SimonSimCity they are the storage, not a cache (except if you use the whole KeyValueStore as a cache) |
@stof: I know that ... but every implementation in here is build this way, that if an error occurs, f.e. during adding (key already exists ..), it's just ignored. |
@SimonSimCity thank you for the pull request, very much appreciated! |
Added a storage implementation for couchbase.
Or do you think that memcache would be enough, as it's a drop-in replacement?
http://www.couchbase.com/memcached