mirror of
https://github.com/Intervention/image.git
synced 2025-09-02 02:12:37 +02:00
added parameters to cache method
This commit is contained in:
@@ -156,7 +156,7 @@ class Image
|
|||||||
* @param Closure $callback
|
* @param Closure $callback
|
||||||
* @return Image
|
* @return Image
|
||||||
*/
|
*/
|
||||||
public static function cache(Closure $callback = null)
|
public static function cache(Closure $callback = null, $lifetime = null, $returnObj = false)
|
||||||
{
|
{
|
||||||
if ( ! class_exists('\Intervention\Image\ImageCache')) {
|
if ( ! class_exists('\Intervention\Image\ImageCache')) {
|
||||||
throw new Exception('Please install package intervention/imagecache before running this function.');
|
throw new Exception('Please install package intervention/imagecache before running this function.');
|
||||||
@@ -166,7 +166,7 @@ class Image
|
|||||||
$image = new \Intervention\Image\ImageCache;
|
$image = new \Intervention\Image\ImageCache;
|
||||||
$image = is_callable($callback) ? $callback($image) : $image;
|
$image = is_callable($callback) ? $callback($image) : $image;
|
||||||
|
|
||||||
return $image->get();
|
return $image->get($lifetime, $returnObj);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user