Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Checks if the class has been defined
<?php class_exists(string $class, bool $autoload = true): bool
<?php $classnameLocal = sprintf('\Intervention\Image\%s\Commands\%sCommand', $drivername, ucfirst($name));
$classnameGlobal = sprintf('\Intervention\Image\Commands\%sCommand', ucfirst($name));
if (class_exists($classnameLocal)) {
return $classnameLocal;
} elseif (class_exists($classnameGlobal)) {
return $classnameGlobal;
<?php if (class_exists($classnameLocal)) {
return $classnameLocal;
} elseif (class_exists($classnameGlobal)) {
return $classnameGlobal;
}
<?php protected function getStream($data)
{
if (class_exists(\GuzzleHttp\Psr7\Utils::class)) {
return \GuzzleHttp\Psr7\Utils::streamFor($data); // guzzlehttp/psr7 >= 2.0
}
<?php public function cache(Closure $callback, $lifetime = null, $returnObj = false)
{
if (class_exists('Intervention\\Image\\ImageCache')) {
$imagecache = new ImageCache($this);
<?php $drivername = ucfirst($this->config['driver']);
$driverclass = sprintf('Intervention\\Image\\%s\\Driver', $drivername);
if (class_exists($driverclass)) {
return new $driverclass;
}
<?php $this->package('intervention/image');
if (class_exists('Intervention\\Image\\ImageCache')) {
$app = $this->app;
<?php $callback = $config->get("imagecache::templates.{$template}");
if (is_callable($callback) || class_exists($callback)) {
$content = $app['image']->cache(function ($image) use ($image_path, $callback) {
<?php return $callback($image->make($image_path));
break;
case class_exists($callback):
return $image->make($image_path)->filter(new $callback);
break;
}
<?php private function cacheIsInstalled()
{
return class_exists('Intervention\\Image\\ImageCache');
}
<?php protected function coreAvailable()
{
return (extension_loaded('imagick') && class_exists('Imagick'));
}
}
<?php $response->header('Content-Type', $mime);
$response->header('Content-Length', $length);
} elseif (class_exists('\Symfony\Component\HttpFoundation\Response')) {
$response = SymfonyResponse::create($data);
$response->headers->set('Content-Type', $mime);