[Tickets #13085] Re: Use memcache instead of distributed hashtable in $conf[cache][driver]
noreply at bugs.horde.org
noreply at bugs.horde.org
Mon Mar 31 14:30:39 UTC 2014
DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.
Ticket URL: http://bugs.horde.org/ticket/13085
------------------------------------------------------------------------------
Ticket | 13085
Updated By | arjen+horde at de-korte.org
Summary | Use memcache instead of distributed hashtable in
| $conf[cache][driver]
Queue | Horde Framework Packages
Version | Git master
Type | Bug
State | Feedback
Priority | 1. Low
Milestone |
Patch |
Owners | Michael Slusarz
------------------------------------------------------------------------------
arjen+horde at de-korte.org (2014-03-31 14:30) wrote:
>> It is probably due to my limited command of the PHP language, but I
>> assumed that the below function would set $lifetime to '0' if the
>> parameter is not passed (similar to C++):
>
> No, you are correct in your logic, but this class is ONLY for
> memcache, not other cache drivers. As already stated, memcache
> doesn't use/need the lifetime parameter here so the default value of
> zero is irrelevant.
This is how *every* cache driver is defined:
/usr/share/php5/PEAR/Horde/Cache/Storage/Apc.php: public function
set($key, $data, $lifetime = 0)
/usr/share/php5/PEAR/Horde/Cache/Storage/Base.php: abstract public
function set($key, $data, $lifetime = 0);
/usr/share/php5/PEAR/Horde/Cache/Storage/Eaccelerator.php: public
function set($key, $data, $lifetime = 0)
/usr/share/php5/PEAR/Horde/Cache/Storage/File.php: public function
set($key, $data, $lifetime = 0)
/usr/share/php5/PEAR/Horde/Cache/Storage/Hashtable.php: public
function set($key, $data, $lifetime = 0)
/usr/share/php5/PEAR/Horde/Cache/Storage/Memcache.php: public
function set($key, $data, $lifetime = 0)
/usr/share/php5/PEAR/Horde/Cache/Storage/Memoryoverlay.php: public
function set($key, $data, $lifetime = 0)
/usr/share/php5/PEAR/Horde/Cache/Storage/Mock.php: public function
set($key, $data, $lifetime = 0)
/usr/share/php5/PEAR/Horde/Cache/Storage/Mongo.php: public function
set($key, $data, $lifetime = 0)
/usr/share/php5/PEAR/Horde/Cache/Storage/Null.php: public function
set($key, $data, $lifetime = 0)
/usr/share/php5/PEAR/Horde/Cache/Storage/Session.php: public
function set($key, $data, $lifetime = 0)
/usr/share/php5/PEAR/Horde/Cache/Storage/Sql.php: public function
set($key, $data, $lifetime = 0)
/usr/share/php5/PEAR/Horde/Cache/Storage/Stack.php: public function
set($key, $data, $lifetime = 0)
/usr/share/php5/PEAR/Horde/Cache/Storage/Xcache.php: public
function set($key, $data, $lifetime = 0)
So if the $lifetime argument is not set (like in
Horde_Service_Weather) *every* cache driver will default to a value of
'0' and the data that is put into the cache by Horde_Service_Weather
will not be GC'ed for *any* cache driver. This is the point I'm trying
to make.
More information about the bugs
mailing list