1
0
mirror of https://github.com/Intervention/image.git synced 2025-02-06 22:00:38 +01:00

added static cache() method

This commit is contained in:
Oliver Vogel 2014-05-23 21:03:46 +02:00
parent 29ca49baa7
commit f63b2a4dd5

View File

@ -2,6 +2,8 @@
namespace Intervention\Image;
use Closure;
class ImageManagerStatic
{
/**
@ -54,4 +56,17 @@ class ImageManagerStatic
{
return self::newInstance()->manager->canvas($width, $height, $background);
}
/**
* Create new cached image and run callback statically
*
* @param Closure $callback
* @param integer $lifetime
* @param boolean $returnObj
* @return mixed
*/
public static function cache(Closure $callback, $lifetime = null, $returnObj = false)
{
return self::newInstance()->manager->cache($callback, $lifetime, $returnObj);
}
}