Req #16923 [Fbk->Ver]: Allow a setter to determine cache expiry

From: Date: Fri, 03 Sep 2010 13:02:41 +0000
Subject: Req #16923 [Fbk->Ver]: Allow a setter to determine cache expiry
References: 1  Groups: php.pear.bugs 
Request: Send a blank email to pear-bugs+get-4759@lists.php.net to get a copy of this message
Edit report at http://pear.php.net/bugs/bug.php?id=16923&edit=1 ID: 16923 Updated by: till@php.net Reported By: mlaak at kv dot ee Summary: Allow a setter to determine cache expiry -Status: Feedback +Status: Verified Type: Feature/Change Request Package: HTTP_Session2 Operating System: linux PHP Version: 5.1.1 -Roadmap Versions: +Roadmap Versions: 0.8.0 New Comment: -Status: Feedback +Status: Verified -Roadmap Versions: +Roadmap Versions: 0.8.0 Wait, people need a workaround in a class when the server time is broken? The fix is called NTP in this case. :D In all seriousness though - setTime(), getTime() is a good idea for unit testing. I'll see to it for the 0.8.0 release. @Daniel: I'll email you when it's in trunk so you can verify it to your liking. Previous Comments: ------------------------------------------------------------------------ [2010-09-03 12:27:56] doconnor -Status: Open +Status: Feedback -Package: HTTP_Session +Package: HTTP_Session2 Given HTTP_Session2 superceeds HTTP_Session, is this feature request still relevant? If not, we should close this. ------------------------------------------------------------------------ [2009-12-20 13:21:11] doconnor -Summary: Unvise use of memcache +Summary: Allow a setter to determine cache expiry I'd suggest implementing some kind of way to setTime() around here might not hurt - if not nothing else, just to make it more unit testable. ------------------------------------------------------------------------ [2009-12-18 10:37:11] mlaak I meant 0+ini_get('session.gc_maxlifetime') ------------------------------------------------------------------------ [2009-12-18 10:25:48] mlaak Description: ------------ In HTTP_Session_Container_Memcache:write the expire date is calculated as follows: time() + ini_get('session.gc_maxlifetime') Now when server clocks should be different (I had such a case lately), we get a bug that is very hard to detect. In http://www.php.net/manual/en/function.memcache-set.php expire: ..... You can also use Unix timestamp or a number of seconds starting from current time, but in the latter case the number of seconds may not exceed 2592000 (30 days). So if ini_get('session.gc_maxlifetime')<2592000 then it should be 0++ ini_get('session.gc_maxlifetime') to make use of memcache server time. ------------------------------------------------------------------------ -- Edit this bug report at http://pear.php.net/bugs/bug.php?id=16923&edit=1

« previous php.pear.bugs (#4759) next »