Solar_Cache_Adapter::entry()
public
mixed
Solar_Cache_Adapter::entry
( string $key
)
Returns the adapter-specific name for the entry key.
Parameters
(string)
$key
: The entry ID.
Returns
(mixed) The adapter-specific name for the entry key.
Description
Returns the adapter-specific name for the entry key.
Cache adapters do not always use the identifier you specify for cache entries. For example, the [Solar_Cache_Adapter_File:HomePage file adapter] names the cache entries based on an MD5 hash of the entry ID. This method tells you what the adapter is using as the name for the cache entry.
<?php
// create a request object
$request = Solar_Registry::get('request');
// create an entry ID named for the current URI
$id = $request->server('REQUEST_URI');
// create a cache object
$cache = Solar::factory('Solar_Cache');
// find out what the underlying cache adapter uses as the entry name
$real_name = $cache->entry($id);