Skip to content

Commit 37c1109

Browse files
committed
sfMemcacheCache: have to check metadata, if memcache returns false
1 parent 7ec7317 commit 37c1109

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

lib/cache/sfMemcacheCache.class.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,15 +92,21 @@ public function get($key, $default = null)
9292
{
9393
$value = $this->memcache->get($this->getOption('prefix').$key);
9494

95-
return false === $value ? $default : $value;
95+
return (false === $value && false === $this->getMetadata($key)) ? $default : $value;
9696
}
9797

9898
/**
9999
* @see sfCache
100100
*/
101101
public function has($key)
102102
{
103-
return !(false === $this->memcache->get($this->getOption('prefix').$key));
103+
if (false === $this->memcache->get($this->getOption('prefix') . $key))
104+
{
105+
// if there is metadata, $key exists with a false value
106+
return !(false === $this->getMetadata($key));
107+
}
108+
109+
return true;
104110
}
105111

106112
/**

0 commit comments

Comments
 (0)