Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Find out whether an extension is loaded
<?php extension_loaded(string $extension): bool
<?php 'prefix_indexes' => true,
'strict' => true,
'engine' => null,
'options' => extension_loaded('pdo_mysql') ? array_filter([
PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
]) : [],
],
<?php 'prefix_indexes' => true,
'strict' => true,
'engine' => null,
'options' => extension_loaded('pdo_mysql') ? array_filter([
PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
]) : [],
],
<?php Signals::resolveAvailabilityUsing(function () {
return $this->app->runningInConsole()
&& ! $this->app->runningUnitTests()
&& extension_loaded('pcntl');
});
}
<?php public function setUpRedis()
{
if (! extension_loaded('redis')) {
$this->markTestSkipped('The redis extension is not installed. Please install the extension to enable '.__CLASS__);
}
<?php protected function supportsAsyncSignals()
{
return extension_loaded('pcntl');
}
<?php {
$this->events->dispatch(new WorkerStopping($status, $options));
if (extension_loaded('posix')) {
posix_kill(getmypid(), SIGKILL);
}
<?php return tap(new Redis, function ($client) use ($config) {
if ($client instanceof RedisFacade) {
throw new LogicException(
extension_loaded('redis')
? 'Please remove or rename the Redis facade alias in your "app" configuration file in order to avoid collision with the PHP Redis extension.'
: 'Please make sure the PHP Redis extension is installed and enabled.'
);
<?php protected static function ensureIntlExtensionIsInstalled()
{
if (! extension_loaded('intl')) {
$method = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 2)[1]['function'];
throw new RuntimeException('The "intl" PHP extension is required to use the ['.$method.'] method.');
<?php $html = ini_set('html_errors', '1');
assert(is_string($html));
if (extension_loaded('xdebug')) {
ini_set('xdebug.var_display_max_depth', (string) $maxDepth);
}
<?php private static function getFallbackConnectionParams(): array
{
if (! extension_loaded('pdo_sqlite')) {
Assert::markTestSkipped('PDO SQLite extension is not loaded');
}
<?php $this->output->write($line);
});
} catch (ProcessSignaledException $e) {
if (extension_loaded('pcntl') && $e->getSignal() !== SIGINT) {
throw $e;
}
}
<?php public function isInstalled(): bool
{
return extension_loaded('swoole');
}
<?php private function getCommandClassName($name)
{
if (extension_loaded('mbstring')) {
$name = mb_strtoupper(mb_substr($name, 0, 1)) . mb_substr($name, 1);
} else {
$name = strtoupper(substr($name, 0, 1)) . substr($name, 1);
<?php protected function coreAvailable()
{
return (extension_loaded('gd') && function_exists('gd_info'));
}
<?php protected function coreAvailable()
{
return (extension_loaded('imagick') && class_exists('Imagick'));
}
}