mirror of
https://github.com/mosbth/cimage.git
synced 2025-08-04 15:17:42 +02:00
* Cache-directory can now be readonly and serve all cached files, still failing when need to save files. #5
This commit is contained in:
@@ -296,8 +296,10 @@ class CImage
|
|||||||
$this->saveFolder = $dir;
|
$this->saveFolder = $dir;
|
||||||
$this->cacheFileName = $dir . '/' . $src;
|
$this->cacheFileName = $dir . '/' . $src;
|
||||||
|
|
||||||
|
/* Allow readonly cache
|
||||||
is_writable($this->saveFolder)
|
is_writable($this->saveFolder)
|
||||||
or $this->raiseError('Target directory is not writable.');
|
or $this->raiseError('Target directory is not writable.');
|
||||||
|
*/
|
||||||
|
|
||||||
// Sanitize filename
|
// Sanitize filename
|
||||||
$this->cacheFileName = preg_replace('/^a-zA-Z0-9\.-_/', '', $this->cacheFileName);
|
$this->cacheFileName = preg_replace('/^a-zA-Z0-9\.-_/', '', $this->cacheFileName);
|
||||||
@@ -1462,6 +1464,9 @@ class CImage
|
|||||||
$this->setTarget($src, $base);
|
$this->setTarget($src, $base);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
is_writable($this->saveFolder)
|
||||||
|
or $this->raiseError('Target directory is not writable.');
|
||||||
|
|
||||||
switch(strtolower($this->extension)) {
|
switch(strtolower($this->extension)) {
|
||||||
|
|
||||||
case 'jpeg':
|
case 'jpeg':
|
||||||
|
@@ -133,6 +133,7 @@ Revision history
|
|||||||
|
|
||||||
v0.5.x (latest)
|
v0.5.x (latest)
|
||||||
|
|
||||||
|
* Cache-directory can now be readonly and serve all cached files, still failing when need to save files. #5
|
||||||
* Cache now uses same file extension as original image #37.
|
* Cache now uses same file extension as original image #37.
|
||||||
* Can output image as json format using `json` #11.
|
* Can output image as json format using `json` #11.
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user