You are here

function pCache::saveFromCache in Visitors 7.2

Same name and namespace in other branches
  1. 7 pChart/class/pCache.class.php \pCache::saveFromCache()
1 call to pCache::saveFromCache()
pCache::autoOutput in pChart/class/pCache.class.php

File

pChart/class/pCache.class.php, line 238

Class

pCache

Code

function saveFromCache($ID, $Destination) {

  /* Get the raw picture from the cache */
  $Picture = $this
    ->getFromCache($ID);

  /* Do we have a hit? */
  if ($Picture == NULL) {
    return FALSE;
  }

  /* Flush the picture to a file */
  $Handle = fopen($Destination, "w");
  fwrite($Handle, $Picture);
  fclose($Handle);

  /* All went fine */
  return TRUE;
}