Leaseweb / LswMemcacheBundle

Symfony bundle for Memcache Doctrine caching and session storage in the Web Debug Toolbar.
MIT License
202 stars 57 forks source link

doContains bars us to store 0 (zero) #81

Open kaczenski opened 8 years ago

kaczenski commented 8 years ago
    /**
     * {@inheritdoc}
     */
    protected function doContains($id)
    {
        return (bool) $this->memcache->get($this->prefix.$id);
    }

The boolean cast bars us to store data that is casted to false. We checked it is possible to save and fetch data like 0 (ZERO). But the doContains() method make us believe it is not saved.

mevdschee commented 8 years ago

It should either be "!==null" or "!==false" (I would have to consult the extension). Maybe you can do a PR?

mevdschee commented 7 years ago

Fixed in https://github.com/mevdschee/TqdMemcacheBundle/commit/a7d976547547c03892fa21297b90584412afdd37