public function writeToCache($ID, Image $pChartObject)
    {
        /* Compute the paths */
        $TemporaryFile = tempnam($this->CacheFolder, "tmp_");
        $Database = $this->CacheFolder . "/" . $this->CacheDB;
        $Index = $this->CacheFolder . "/" . $this->CacheIndex;
        /* Flush the picture to a temporary file */
        imagepng($pChartObject->Picture, $TemporaryFile);

        /* Retrieve the files size */
        $PictureSize = filesize($TemporaryFile);
        $DBSize = filesize($Database);

        /* Save the index */
        $Handle = fopen($Index, "a");
        fwrite($Handle, $ID . "," . $DBSize . "," . $PictureSize . "," . time() . ",0\r\n");
        fclose($Handle);

        /* Get the picture raw contents */
        $Handle = fopen($TemporaryFile, "r");
        $Raw = fread($Handle, $PictureSize);
        fclose($Handle);

        /* Save the picture in the solid database file */
        $Handle = fopen($Database, "a");
        fwrite($Handle, $Raw);
        fclose($Handle);

        /* Remove temporary file */
        unlink($TemporaryFile);
    }
public function writeToCache($ID, Image $pChartObject)
    {
        /* Compute the paths */
        $TemporaryFile = tempnam($this->CacheFolder, "tmp_");
        $Database = $this->CacheFolder . "/" . $this->CacheDB;
        $Index = $this->CacheFolder . "/" . $this->CacheIndex;
        /* Flush the picture to a temporary file */
        imagepng($pChartObject->Picture, $TemporaryFile);

        /* Retrieve the files size */
        $PictureSize = filesize($TemporaryFile);
        $DBSize = filesize($Database);

        /* Save the index */
        $Handle = fopen($Index, "a");
        fwrite($Handle, $ID . "," . $DBSize . "," . $PictureSize . "," . time() . ",0\r\n");
        fclose($Handle);

        /* Get the picture raw contents */
        $Handle = fopen($TemporaryFile, "r");
        $Raw = fread($Handle, $PictureSize);
        fclose($Handle);

        /* Save the picture in the solid database file */
        $Handle = fopen($Database, "a");
        fwrite($Handle, $Raw);
        fclose($Handle);

        /* Remove temporary file */
        unlink($TemporaryFile);
    }
public function writeToCache ( $ ID , Image $ pChartObject ) { /* Compute the paths */ $ TemporaryFile = tempnam ( $ this -> CacheFolder , "tmp_" ) ; $ Database = $ this -> CacheFolder . "/" . $ this -> CacheDB ; $ Index = $ this -> CacheFolder . "/" . $ this -> CacheIndex ; /* Flush the picture to a temporary file */ imagepng ( $ pChartObject -> Picture , $ TemporaryFile ) ; /* Retrieve the files size */ $ PictureSize = filesize ( $ TemporaryFile ) ; $ DBSize = filesize ( $ Database ) ; /* Save the index */ $ Handle = fopen ( $ Index , "a" ) ; fwrite ( $ Handle , $ ID . "," . $ DBSize . "," . $ PictureSize . "," . time ( ) . ",0\r\n" ) ; fclose ( $ Handle ) ; /* Get the picture raw contents */ $ Handle = fopen ( $ TemporaryFile , "r" ) ; $ Raw = fread ( $ Handle , $ PictureSize ) ; fclose ( $ Handle ) ; /* Save the picture in the solid database file */ $ Handle = fopen ( $ Database , "a" ) ; fwrite ( $ Handle , $ Raw ) ; fclose ( $ Handle ) ; /* Remove temporary file */ unlink ( $ TemporaryFile ) ; }
Write the generated picture to the cache

@param string $ID
@param Image $pChartObject
Write the generated picture to the cache