Back

Graphic Images
imageTmpDir
Directory to store temporary images and export excel/csv files Default: `'/tmp'` Important. This property is obsolete in phpLens 3.0. Caching The following properties are used together to enable image caching: imageCacheSecs: Number of seconds to cache image imageTmpDirURL: The URL to use from the web browser to read the directory and you have to modify the following constant in the file phplens/config/phplens.img.config.inc.php LENS_IMAGETMPDIR: the path to where the images are cached So suppose the web server root directory is /htdocs, and the images are in /htdocs/img, we set `$lens->imageTmpDirURL = '/img'; $lens->imageCacheSecs = 3600 * 24 * 30; // 30 days` And in phplens.img.config.inc.php define('LENS_IMAGETMPDIR','/htdocs/img'); Whenever we upload a new image to the server, the cached image file is also deleted automatically. Note: when cached images are generated, a .gif suffix is added to the filename even if the file uses some other format. This is to ensure that the images are cached by proxy servers. Compatibility Note For phpLens 2.8 and earlier, we do not use the phplens.img.config.inc.php file to store the location of the image directory. Instead you have to set the property imageTmpDir: The location of the image temporary directory on the server Then you have to modify the source code of phplens-img.php file, changing the hard-coded '/tmp' string with the correct path. File Naming for Temporary Images The file name algorithm since 2.4 is: '/lens_'.$this->id.'_'.md5(strlen($blob).$this->id.$this->keyTable.$key).'.gif'; where $blob is the actual image data, and $key is the primary key value, or false if not defined. Even if the file is not a gif, we append a gif to the end to ensure that proxy servers cache the file correctly. Normally browsers are able to auto-detect the image type correctly. Also see the imageTmpDirURL property. Basic:Yes Advanced/Enterprise:Yes DynamicEdit:No [Version 1.0]