mirror of
https://github.com/Intervention/image.git
synced 2025-08-29 16:50:07 +02:00
added static cache() method
This commit is contained in:
@@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
namespace Intervention\Image;
|
namespace Intervention\Image;
|
||||||
|
|
||||||
|
use Closure;
|
||||||
|
|
||||||
class ImageManagerStatic
|
class ImageManagerStatic
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
@@ -54,4 +56,17 @@ class ImageManagerStatic
|
|||||||
{
|
{
|
||||||
return self::newInstance()->manager->canvas($width, $height, $background);
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user