mirror of
https://github.com/Intervention/image.git
synced 2025-01-29 17:57:50 +01:00
changed callback handling in cache method
This commit is contained in:
parent
4e252a3ffa
commit
e3f13700a9
@ -96,9 +96,13 @@ class ImageManager
|
||||
public function cache(Closure $callback, $lifetime = null, $returnObj = false)
|
||||
{
|
||||
if (class_exists('\Intervention\Image\ImageCache')) {
|
||||
// Create imagecache and run callback
|
||||
// create imagecache
|
||||
$imagecache = new ImageCache($this);
|
||||
$imagecache = is_callable($callback) ? $callback($imagecache) : $imagecache;
|
||||
|
||||
// run callback
|
||||
if (is_callable($callback)) {
|
||||
$callback($imagecache);
|
||||
}
|
||||
|
||||
return $imagecache->get($lifetime, $returnObj);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user