Skip to content

Loading…

DCOM-245: doContains method in MemcacheCache cache provider class returning wrong values #553

Open
doctrinebot opened this Issue · 3 comments

2 participants

@doctrinebot

Jira issue originally created by user teseo:

Method doContains in MemcacheCache cache provider class looks like this


    /****
     * {@inheritdoc}
     */
    protected function doContains($id)
    {
        return (bool) $this->memcache->get($id);
    }

In the case of an empty array stored, the result of casting an empty array is false but actually there's a value in cache with they key $id. As a matter of fact, when you take a look at MemcachedCache cache provider class, the doContains method looks like this:

    /****
     * {@inheritdoc}
     */
    protected function doContains($id)
    {
        return (false !== $this->memcached->get($id));
    }

Which is more accurate in terms of the existance of a value in cache for $id. I had to have a workaround with the above code to make it work with Memcache.

Is there any reason it is like that in MemcacheCache cache provider class and not in MemcachedCache cache provider class?

@doctrinebot

Comment created by @ocramius:

[~teseo] can you please open a PR for this? The fix seems trivial, but it just needs a test in order to merge.

@doctrinebot

Comment created by teseo:

Excuse me Marco, what is a PR? I'll be more than happy to do so.

@doctrinebot

Comment created by @ocramius:

[~teseo] pull request on github. If you don't then it may just be fixed in future as soon as someone picks it.

@doctrinebot doctrinebot added the Bug label
@beberlei beberlei was assigned by doctrinebot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.