Closed Surt closed 11 years ago
Hello, I'm not sure I understand your problem?
Hi @Gregwar . I was triying to set the cache folder, using:
/**
* Change the caching directory
*/
public function setCacheDir($cacheDir)
{
$this->cacheDir = $cacheDir;
}
But I can't call it as static: Image::setCacheDir($afolder)
since it says I'm calling a non static method.
The cache directory will be created automatically if you're worried about it, you just have to let enough permissions to your web server to do it
yep, but, where is created? It will be great to add the possibility to set the cache dir on the class, as a static.
You mean you're trying to change the default cache directory?
<?php
class MyApplicationSpecificImage extends Gregwar\Image\Image
{
protected $cacheDir = 'my/custom/path/';
}
Yep, I will do that. Thanks @Gregwar ! keep the good work.
Sorry for bother, I was wondering if doing this, to get binary content of image from caché, is ok:
public function guessGet($quality = 80){
return $this->open($this->cacheFile('guess', $quality))->get();
}
You'd better use file_get_contents
, or readfile
here
will do :)
Maybe I should add a flag to get the binary data when calling cacheFile
, or a method to do that
It will be great to have it implemented.
You can now use cacheData()
to do that
hahaaha, Great! Thanks a lot @Gregwar
Hi, I was wondering if its possible to set the cache dir on the fly, without creating an instance. Actually, I don't know how to create a cache dir to activate it.