docker-php-extension-installer/scripts/tests/sourceguardian
2021-09-28 12:27:17 +02:00

18 lines
594 B
PHP
Executable File

#!/usr/bin/env php
<?php
require_once __DIR__ . '/_bootstrap.php';
$rc = 0;
foreach ([false => 'PHP module', true => 'Zend extension'] as $type => $typeName) {
$extensions = get_loaded_extensions($type);
$extensionsLowerCase = array_map('strtolower', $extensions);
if (in_array('sourceguardian', $extensionsLowerCase, true)) {
fwrite(STDOUT, "The SourceGuardian {$typeName} is loaded.\n");
} else {
fwrite(STDERR, "The SourceGuardian {$typeName} is not loaded.\nLoaded extensions are: \n- " . implode("\n- ", $extensions));
$rc = 1;
}
}
exit($rc);