Home » Caching » Cache » Bug #3693
Missing $this
Details
| Submitted | 2005-03-03 19:56 UTC |
|---|---|
| From | cmoehrke at netviser dot de |
| Status | Bogus |
| Package | Cache |
| PHP Version | 5.0.3 |
| OS | Linux |
| Roadmaps | (Not assigned) |
Comments
[2005-03-03 19:56 UTC] cmoehrke at netviser dot de
Description:
------------
Calling cacheImageLink() results in a fatal error when image is already cached.
Reproduce code:
---------------
<?php
require_once('Cache/Graphics.php');
$text='Hallo Welt';
$width=100;
$height=50;
$img = imagecreate($width, $height);
$cache = new Cache_Graphics();
$cache->setCacheDir('cache');
$id = $cache->generateID($text.$width.$height.__FILE__,'png');
if (!($link=$cache->getImageLink($id,'png')))
{
if (false == $img)
{
die ("Konnte Bild nicht anlegen");
}
$bg_color = imagecolorallocate($img, 255, 255, 255);
$txt_color = imagecolorallocate($img, 200, 20, 20);
imagestring($img, 3, 5, 5, $text, $txt_color);
$link = $cache->cacheImageLink($id,&$img,'gif');
}
echo "<a href='$link[0]' />";
?>
Actual result:
--------------
Notice: unserialize() [function.unserialize]: Error at offset 0 of 3 bytes in /usr/local/php/pear/Cache/Container.php on line 406
Fatal error: Call to undefined function isExpired() in /usr/local/php/pear/Cache/Graphics.php on line 294
[2005-03-03 20:04 UTC] cmoehrke at netviser dot de
Sorry, my fault...