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:
parent
29ca49baa7
commit
f63b2a4dd5
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user