1
0
Fork 0
mirror of https://github.com/mlocati/docker-php-extension-installer synced 2025-05-09 00:22:40 +00:00

Add support for DB4 to DBA

Test: dba
This commit is contained in:
Michele Locati 2020-12-16 18:34:27 +01:00
parent 6bd11a1f74
commit 410fb2f142
No known key found for this signature in database
GPG key ID: 98B7CE2E7234E28B
2 changed files with 59 additions and 0 deletions

29
scripts/tests/dba Executable file
View file

@ -0,0 +1,29 @@
#!/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";