Maps the image cache directory to a URL so that we can generate img tags efficiently Default: 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.Syntax
# see example above Basic:Yes Advanced/Enterprise:Yes DynamicEdit:Yes [Version 2.4.8]
|