Edit report at http://pear.php.net/bugs/bug.php?id=17269&edit=1

ID: 17269
Comment by: iannsp@gmail.com
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:

To get a file info you need both id and group information, so I suggest
added both as parameters to lasModified.
Your second request I believe is part off your logic and not part of the
get the age information and recreate the cache in a same method make
this method a lot specify
use lasModified method ( if the patch was accept) and then, if it has
invalid, recreate it.

Previous Comments:

[2010-06-09 10:39:50] hm2k

The documentation for lastModified() is lacking, so assuming it doesn't
do this already (i've not checked), this feature should be added as


[2010-03-25 21:17:16] tacker

-PHP Version: 5.2.6
+PHP Version: Irrelevant


[2010-03-25 20:25:10] l8gravely


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.


Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
postedAug 27, '11 at 3:29a
activeAug 27, '11 at 3:29a

1 user in discussion

Iannsp: 1 post



site design / logo © 2022 Grokbase