Fix sqlsrv test script

pull/425/head
Michele Locati 2021-08-26 09:24:53 +02:00
parent 316febbb28
commit 69e11af307
No known key found for this signature in database
GPG Key ID: 98B7CE2E7234E28B
1 changed files with 3 additions and 0 deletions

View File

@ -29,11 +29,14 @@ sqlsrv_connect(
'PWD' => 'password', 'PWD' => 'password',
] ]
); );
$rc = 0;
$errors = sqlsrv_errors(SQLSRV_ERR_ALL); $errors = sqlsrv_errors(SQLSRV_ERR_ALL);
if (is_array($errors)) { if (is_array($errors)) {
foreach ($errors as $error) { foreach ($errors as $error) {
if (isset($error['message']) && stripos($error['message'], 'This extension requires the Microsoft ODBC Driver for SQL Server') !== false) { if (isset($error['message']) && stripos($error['message'], 'This extension requires the Microsoft ODBC Driver for SQL Server') !== false) {
fwrite(STDERR, trim($error['message']) . "\n"); fwrite(STDERR, trim($error['message']) . "\n");
$rc = 1;
} }
} }
} }
exit($rc);