File tree Expand file tree Collapse file tree 3 files changed +4
-4
lines changed
Expand file tree Collapse file tree 3 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ RUN php /bref/lib-copy/copy-dependencies.php /tmp/pdo_sqlsrv.so /tmp/extension-l
2525
2626FROM scratch
2727
28+ COPY --from=ext /opt/microsoft /opt/microsoft
2829COPY --from=ext /tmp/sqlsrv.so /opt/bref/extensions/sqlsrv.so
2930COPY --from=ext /tmp/pdo_sqlsrv.so /opt/bref/extensions/pdo_sqlsrv.so
3031COPY --from=ext /tmp/ext.ini /opt/bref/etc/php/conf.d/ext-sqlsrv.ini
Original file line number Diff line number Diff line change 11<?php
22
3- putenv ('ODBCSYSINI=/opt/microsoft/conf/ ' );
4-
53// This test is for sqlsrv.so
64if (!function_exists ($ func = 'sqlsrv_connect ' )) {
75 echo sprintf ('FAIL: Function "%s" does not exist. ' , $ func ).PHP_EOL ;
1715// This test attempts a connection, forcing MS odbc libraries to be loaded
1816if (!sqlsrv_connect ('localhost ' , ['LoginTimeout ' => 1 ])) {
1917 foreach (sqlsrv_errors () as $ error ) {
20- if ($ error ['SQLSTATE ' ] == '01000 ' ) {
21- echo sprintf ('FAIL: sqlsrv extension library not loaded. %s ' , $ error ['message ' ]).PHP_EOL ;
18+ if ($ error ['SQLSTATE ' ] === '01000 ' || $ error [ ' SQLSTATE ' ] === ' IM002 ' || $ error [ ' SQLSTATE ' ] === ' IMSSP ' ) {
19+ echo sprintf ('FAIL: %s ' , $ error ['message ' ]).PHP_EOL ;
2220 exit (1 );
2321 }
2422 }
Original file line number Diff line number Diff line change @@ -5,3 +5,4 @@ FROM bref/$TARGET_IMAGE AS ext
55FROM bref/php-$PHP_VERSION:2
66
77COPY --from=ext /opt /opt
8+ ENV ODBCSYSINI=/opt/microsoft/conf/
You can’t perform that action at this time.
0 commit comments