Req #17269 [Opn]: Extend Cache_Lite::lastModified() take a cache_id to return the age of an entry

From: Date: Wed, 09 Jun 2010 10:39:50 +0000
Subject: Req #17269 [Opn]: Extend Cache_Lite::lastModified() take a cache_id to return the age of an entry
References: 1  Groups: php.pear.bugs 
Request: Send a blank email to pear-bugs+get-3900@lists.php.net to get a copy of this message
Edit report at http://pear.php.net/bugs/bug.php?id=17269&edit=1 ID: 17269 Updated by: hm2k@php.net Reported By: john at stoffel dot org Summary: Extend Cache_Lite::lastModified() take a cache_id to return the age of an entry Status: Open Type: Feature/Change Request Package: Cache_Lite PHP Version: Irrelevant Roadmap Versions: New Comment: The documentation for lastModified() is lacking, so assuming it doesn't do this already (i've not checked), this feature should be added as standard. Previous Comments: ------------------------------------------------------------------------ [2010-03-25 21:17:16] tacker -PHP Version: 5.2.6 +PHP Version: Irrelevant ------------------------------------------------------------------------ [2010-03-25 20:25:10] l8gravely Description: ------------ Hi, I'd like to suggest that the Cache_Lite::lastModified() take a new arguement, which is the id of a cached object. The return value would be the same as currently defined, though if the id did not exist, it should return -1, or some other error code. This would allow me to pre-populate my web site with data which takes a long time to generate, and yet easily query the cache to see if I need to re-generate the output. Another thought would be to extend some of the other existing methods to take a datestring which they check the cache file age against. If the cache is older than the date string, return false (and clear that entry) otherwise just return the cached entry. This could be: Cache_Lite_Output::start( string $id , string $group = 'default' , boolean $doNotTestCacheValidity = false, int older = '0') where it checks if the age of the cached file is less than 'older' and returns False if true. ------------------------------------------------------------------------ -- Edit this bug report at http://pear.php.net/bugs/bug.php?id=17269&edit=1

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