1
0
mirror of https://github.com/Intervention/image.git synced 2025-09-02 18:32:56 +02:00

added parameters to cache method

This commit is contained in:
Oliver Vogel
2013-03-09 10:54:42 +01:00
parent 699c366bfe
commit 8536198892

View File

@@ -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);
} }
/** /**