<?php require_once('pictod/pictod_ShowImageHandler.php');
$sih = new pictod_ShowImageHandler();
$conf = array( // Configuration of cache 'pictod_Cache' => array( 'contName' => 'simple', 'contConf' => array( 'cacheDir' => './cache', ), ),
// Configuration of Rules of displaying images // У каждой картинки могут быть свои правила! 'pictod_Ruler' => array( 'contName' => 'daily', 'contConf' => array( 'cacheDir' => './cache', ), ), // Configuration of image container 'pictod_ImageContainer' => array( 'contName' => 'simple', 'contConf' => array( 'images' => array( // If no imageID given, 'default' is used // For each imageID indicate the list of directories where images stored // Блокировать кэш при записи. Ждать пока не освободится! 'default' => array('./images1','./images2'), 'a1' => array('./images3'), ), ), ),
); $err = $sih->initialize($conf);
$imageID = @$_REQUEST['imageID']; $image = $sih->getImage($imageID); if (PEAR::isError($image)) { var_dump($image); exit; }
header("Expires: Mon, 26 Jul 1990 05:00:00 GMT"); // Date in the past header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // always modified header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 header("Cache-Control: no-store"); header('Pragma: no-cache'); header('Content-type: image/'.$image['type']); echo $image['data']; exit; ?>
|