On Thu, Sep 4, 2008 at 7:51 PM, Lepidosteus <[EMAIL PROTECTED]> wrote:
> I think you didn't get my question, maybe I didn't explain that well:
>
> When I use the core/file cache I give a lifetime to my cache records
> (it's in the zend_cache api), then it cleans it automagically when
> used if the lifetime is expired.
>
> What I want to know is if there is a way, when I successfully load a
> record, to know how much time it has left before it's "lifetime"
> expiration - not taking into account the fact that it could be
> manually blown away for one reason or another in the code.

Yes, you can.

The expire is set in what they call meta datas - each backend has a
getMetadatas() method. The $id should be the cache ID. So I guess this
is what you can query for.

This is just a guess from looking at the code, but try:

$backend = $cache->getBackend();
$meta = $backend->getMetadatas($id);
var_dump($meta);

Cheers,
Till

Reply via email to