Contents
Login Register Wishes Forum About
Language Reference » pCache functions » isInCache
Help topics
Latest updates
4575d  replaceImageMapTitle
4575d  replaceImageMapValues
4575d  createFunctionSerie
4575d  setAbsicssaPosition
4575d  negateValues
Toolbox
  Download as PDF
  Print this page
  Share this page
  Create an account
  Feed the updates!
Google AdSense
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
isInCache($ID,$Verbose=FALSE)

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.

Sample script

 /* 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
)
Last updated on 08/24/2010 
by Jean-Damien 
Linked resources
Community comments
  No comments have been posted yet.
© Copyrights
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. 415 users have registered. This page has been rendered in 0,35 seconds. Wiki revision 1.37.