Language Reference » pCache functions » isInCache
isInCache - Test if an object is already cached
This function allows you to check if an object is already in the cache. It can also returns detailled informations about the cached entry if any.
Calling this function
ID is the unique ID of the cached object.
Verbose if set to yes, this will returns some extended informations about the cached entry.
If Verbose is kept to FALSE, this function will either returns TRUE if the object is cached or FALSE if it‘s not present in the cahe. If Verbose is set to TRUE, this function will return an array containing :
DBPos : The position of the picture in the solid database.
PicSize : The size of the picture.
GeneratedTS : The timestamp when the object has been pushed to the cache.
Hits : The number of times the object has been pulled off the cache.
/* Include all the classes */ include("class/pData.class.php"); include("class/pCache.class.php"); /* Create your dataset object */ $myData = new pData(); /* Add data in your dataset */ $myData->addPoints(array(1,3,4,3,5)); /* Create the cache object */ $myCache = new pCache(); /* Compute the hash linked to the chart data */ $ID = $myCache->getHash($myData); /* Display the informations about the cached entry */ print_r($myCache->isInCache($ID,TRUE));This will returns an array :
Array ( [DBPos] => 0 [PicSize] => 7202 [GeneratedTS] => 1282652176 [Hits] => 4 )
Components used on this web site : Famfamfam icons has been made by Mark James, Rounded corners lite has been coded by Cameron Cooke and Tim Hutchison, SyntaxHighlighter has been written by Alex Gorbatchev. pChart and this web site have been created by Jean-Damien POGOLOTTI. This documentation contains 185 pages and 56 comments. 409 users have registered. This page has been rendered in 0,01 seconds. Wiki revision 1.37.