mirror of
https://github.com/danog/docker-php-extension-installer.git
synced 2024-12-02 17:38:21 +01:00
410fb2f142
Test: dba
30 lines
851 B
PHP
Executable File
30 lines
851 B
PHP
Executable File
#!/usr/bin/env php
|
|
<?php
|
|
|
|
set_error_handler(
|
|
static function ($errno, $errstr, $errfile, $errline) {
|
|
$msg = "Error {$errno}: {$errstr}\n";
|
|
if ($errfile) {
|
|
$msg .= "File: {$errfile}\n";
|
|
if ($errline) {
|
|
$msg .= "Line: {$errline}\n";
|
|
}
|
|
}
|
|
fwrite(STDERR, $msg);
|
|
exit(1);
|
|
},
|
|
-1
|
|
);
|
|
|
|
$requiredHandlers = array_map('strtolower', [
|
|
'db4',
|
|
]);
|
|
$supportedHandlers = array_map('strtolower', dba_handlers(false));
|
|
$missingHandlers = array_diff($requiredHandlers, $supportedHandlers);
|
|
if ($missingHandlers !== []) {
|
|
sort($missingHandlers);
|
|
fwrite(STDERR, "DBA does NOT support these handlers:\n- " . implode("\n- ", $missingHandlers) . "\n");
|
|
exit(1);
|
|
}
|
|
echo "DBA supports at least these handlers:\n- ", implode("\n- ", $requiredHandlers), "\n";
|