Closed Bogdaan closed 8 years ago
Hi, i have some issues with absolute paths
for example i have:
(filesystem) |- app - application logi |- www - web root dir |-- index.php - single php file |-- cache/ - image cache dir
When i use this code:
$img ->setCacheDir( $wwwDir.'/cache' ) ->html();
I found full path like:
(filesystem dirs)/../www/cache/e/8/d/4/5/e8d452e74e32d36c1ef10c4bc3d17ece1c695235.jpg
But actual (available) web path is:
/cache/e/8/d/4/5/e8d452e74e32d36c1ef10c4bc3d17ece1c695235.jpg
Therefore it is necessary to use own parent class with custum constructor and getFilename.
getFilename
// set $this->wwwDir in __constructor protected function getFilename($filename) { return str_replace($this->wwwDir, '', $filename); }
May be this functionality would be useful "out the box"?
Hello, this is the point of setActualCacheDir which is not documented here You can do a PR that explains this if you want :-)
setActualCacheDir
See https://github.com/Gregwar/Cache#cache-directory-and-actual-cache-directory
@Gregwar thanks
Hi, i have some issues with absolute paths
for example i have:
When i use this code:
I found full path like:
But actual (available) web path is:
Therefore it is necessary to use own parent class with custum constructor and
getFilename
.May be this functionality would be useful "out the box"?