mirror of
https://github.com/Intervention/image.git
synced 2025-08-19 04:01:30 +02:00
changed callback handling in cache method
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user