extension_loaded
laravel/framework
Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Find out whether an extension is loaded
extension_loaded
(
string $extension
):
bool
try {
$process
->
run
(fn (
$type
,
$line
) =>
$this
->
output
->
write
(
$line
));
} catch (
ProcessSignaledException $e
) {
if (
extension_loaded
(
'pcntl'
) &&
$e
->
getSignal
() !==
SIGINT
) {
throw
$e
;
}
}
src/Illuminate/Foundation/Console/ShowModelCommand.php
public function
setUpRedis
()
{
if (!
extension_loaded
(
'redis'
)) {
$this
->
markTestSkipped
(
'The redis extension is not installed. Please install the extension to enable '
.
__CLASS__
);
}
src/Illuminate/Foundation/Testing/Concerns/InteractsWithRedis.php
protected function
supportsAsyncSignals
()
{
return
extension_loaded
(
'pcntl'
);
}
src/Illuminate/Queue/Worker.php
{
$this
->
events
->
dispatch
(new
WorkerStopping
(
$status
));
if (
extension_loaded
(
'posix'
)) {
posix_kill
(
getmypid
(),
SIGKILL
);
}
src/Illuminate/Queue/Worker.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.'
);
src/Illuminate/Redis/Connectors/PhpRedisConnector.php