You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<?php
namespace app\facades;
use Intervention\Image\ImageManager;
use think\Facade;
/**
* @method static \Intervention\Image\Image make(mixed $data)
* @method static self configure(array $config)
* @method static \Intervention\Image\Image canvas(int $width, int $height, mixed $background = null)
* @method static \Intervention\Image\Image cache(\Closure $callback, int $lifetime = null, boolean $returnObj = false)
*/
class InterventionImage extends Facade {
protected static function getFacadeClass()
{
return InterventionImageSource::class;
}
}
class InterventionImageSource {
/**
* @var ImageManager
*/
private $man;
public function __construct()
{
$this->man = new ImageManager(['driver' => 'gd']); //you can change this driver use other driver
}
public function make($data)
{
return $this->man->make($data);
}
public function configure($data=[])
{
return $this->man->configure($data);
}
public function canvas(int $width, int $height, $background = null)
{
return $this->man->canvas($width,$height,$background);
}
public function cache(\Closure $callback, int $lifetime = null, $returnObj = false)
{
return $this->man->cache($callback,$lifetime,$returnObj);
}
}
The text was updated successfully, but these errors were encountered:
RubyKiss
changed the title
[suggess][thinkphp] thinkphp 6+ use it , the faceds class
[suggestion][thinkphp] thinkphp 6+ use it , the faceds class
Sep 13, 2023
RubyKiss
changed the title
[suggestion][thinkphp] thinkphp 6+ use it , the faceds class
[suggestion][thinkphp] thinkphp use it , the facade class
Sep 13, 2023
the class code
The text was updated successfully, but these errors were encountered: