From 8a7fb80c8d6d977f8ce82714c76c5483b3e86936 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C4=81rti=C5=86=C5=A1=20Lazd=C4=81ns?= Date: Tue, 14 Oct 2025 03:55:01 +0300 Subject: [PATCH 1/9] Rename variables --- build_scripts/php-fb-build-all.bat | 2 +- build_scripts/php-fb-build.bat | 4 ++-- build_scripts/php-fb-config.bat | 4 ++-- build_scripts/php-fb-sdk-build.bat | 8 ++++---- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/build_scripts/php-fb-build-all.bat b/build_scripts/php-fb-build-all.bat index c805f23..db8032f 100644 --- a/build_scripts/php-fb-build-all.bat +++ b/build_scripts/php-fb-build-all.bat @@ -7,4 +7,4 @@ call php-fb-build.bat 8.1 vs16 || exit /B %ERRORLEVEL% call php-fb-build.bat 8.2 vs16 || exit /B %ERRORLEVEL% call php-fb-build.bat 8.3 vs16 || exit /B %ERRORLEVEL% call php-fb-build.bat 8.4 vs17 || exit /B %ERRORLEVEL% -call php-fb-build.bat master vs17 || exit /B %ERRORLEVEL% +call php-fb-build.bat 8.5 vs17 || exit /B %ERRORLEVEL% diff --git a/build_scripts/php-fb-build.bat b/build_scripts/php-fb-build.bat index accc387..ce9a696 100644 --- a/build_scripts/php-fb-build.bat +++ b/build_scripts/php-fb-build.bat @@ -59,10 +59,10 @@ set pfb_build_root=php%pfb_php_vers%\%pfb_cpp_vers%\ set check_code="if(!function_exists('ibase_connect'))exit(1);" set TPATH=%PATH% -set PATH=%FB64_DIR%;%TPATH% +set PATH=%PFB_FB64_DIR%;%TPATH% "%pfb_build_root%x64\php-src\x64\Release_TS\php.exe" -dextension=.\php_interbase.dll -r %check_code% || goto :error "%pfb_build_root%x64\php-src\x64\Release\php.exe" -dextension=.\php_interbase.dll -r %check_code% || goto :error -set PATH=%FB32_DIR%;%TPATH% +set PATH=%PFB_FB32_DIR%;%TPATH% "%pfb_build_root%x86\php-src\Release_TS\php.exe" -dextension=.\php_interbase.dll -r %check_code% || goto :error "%pfb_build_root%x86\php-src\Release\php.exe" -dextension=.\php_interbase.dll -r %check_code% || goto :error set PATH=%TPATH% diff --git a/build_scripts/php-fb-config.bat b/build_scripts/php-fb-config.bat index c194371..076ace2 100644 --- a/build_scripts/php-fb-config.bat +++ b/build_scripts/php-fb-config.bat @@ -14,5 +14,5 @@ set PFB_VERS=3.0.1-%GIT_HASH% set PFB_OUTPUT_DIR=D:\php-firebird\releases\ @REM FB 32-bit and 64-bit libraries -set FB32_DIR=C:\Program Files\Firebird\Firebird_5_0-x86 -set FB64_DIR=C:\Program Files\Firebird\Firebird_5_0 +set PFB_FB32_DIR=C:\Program Files\Firebird\Firebird_5_0-x86 +set PFB_FB64_DIR=C:\Program Files\Firebird\Firebird_5_0 diff --git a/build_scripts/php-fb-sdk-build.bat b/build_scripts/php-fb-sdk-build.bat index 61c2b73..ef629b5 100644 --- a/build_scripts/php-fb-sdk-build.bat +++ b/build_scripts/php-fb-sdk-build.bat @@ -3,13 +3,13 @@ @REM Must be called under phpsdk--.bat @REM @REM Calling script should set variables: -@REM [pfb_nts] [pfb_x86] +@REM [pfb_nts] [pfb_x86] @REM @REM set pfb_php_vers=7.4 @REM set pfb_nts=1 if nts expected, 0 if ts @REM set pfb_x86=1 if linking to x86 fbclient, o if x64 @REM -@REM all set in php-fb-config.bat +@REM all set in php-fb-config.bat @REM goto :MAIN @@ -41,10 +41,10 @@ exit /B ) if "%pfb_x86%" gtr "0" ( - set with_interbase="shared,%FB32_DIR%" + set with_interbase="shared,%PFB_FB32_DIR%" set build_msg=%build_msg% x86 ) else ( - set with_interbase="shared,%FB64_DIR%" + set with_interbase="shared,%PFB_FB64_DIR%" set build_msg=%build_msg% x86_64 ) From 3eb5e4eea7155a1e14c47331151a3320e0434a26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C4=81rti=C5=86=C5=A1=20Lazd=C4=81ns?= Date: Tue, 14 Oct 2025 05:45:36 +0300 Subject: [PATCH 2/9] Fix pointers --- ibase_service.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ibase_service.c b/ibase_service.c index 69d4ae0..e58a34c 100644 --- a/ibase_service.c +++ b/ibase_service.c @@ -251,14 +251,14 @@ PHP_FUNCTION(ibase_service_attach) if(ulen > 0){ buf[p++] = isc_spb_user_name; buf[p++] = (char)ulen; - memcpy(&buf[p], &user, ulen); + memcpy(&buf[p], user, ulen); p += ulen; } if(plen > 0){ buf[p++] = isc_spb_password; buf[p++] = (char)plen; - memcpy(&buf[p], &pass, plen); + memcpy(&buf[p], pass, plen); p += plen; } From f76b7064283948a62e5cfd9142cbca1022fb5cd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C4=81rti=C5=86=C5=A1=20Lazd=C4=81ns?= Date: Tue, 14 Oct 2025 05:48:52 +0300 Subject: [PATCH 3/9] Allow null arguments for ibase_service_attach() --- ibase_service.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/ibase_service.c b/ibase_service.c index e58a34c..98f202d 100644 --- a/ibase_service.c +++ b/ibase_service.c @@ -210,20 +210,21 @@ PHP_FUNCTION(ibase_delete_user) } /* }}} */ -/* {{{ proto resource ibase_service_attach(string host, string dba_username, string dba_password) +/* {{{ proto resource ibase_service_attach([string host [, string dba_username [, string dba_password]]]) Connect to the service manager */ PHP_FUNCTION(ibase_service_attach) { size_t hlen = 0, ulen = 0, plen = 0; ibase_service *svm; - char buf[350], *host, *user, *pass; + char *host = NULL, *user = NULL, *pass = NULL; + char buf[350]; char loc[128] = "service_mgr"; isc_svc_handle handle = 0; unsigned short p = 0; RESET_ERRMSG; - if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS(), "|sss", + if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS(), "|s!s!s!", &host, &hlen, &user, &ulen, &pass, &plen)) { RETURN_FALSE; @@ -274,8 +275,8 @@ PHP_FUNCTION(ibase_service_attach) svm = (ibase_service*)emalloc(sizeof(ibase_service)); svm->handle = handle; - svm->hostname = estrdup(host); - svm->username = estrdup(user); + svm->hostname = hlen > 0 ? estrdup(host) : NULL; + svm->username = ulen > 0 ? estrdup(user) : NULL; RETVAL_RES(zend_register_resource(svm, le_service)); Z_TRY_ADDREF_P(return_value); From b66f21f01faf6a5ce426b4e05b2f25be0f55f365 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C4=81rti=C5=86=C5=A1=20Lazd=C4=81ns?= Date: Wed, 15 Oct 2025 10:12:51 +0300 Subject: [PATCH 4/9] Update windows build scripts --- build_scripts/README.md | 4 +- build_scripts/php-fb-build-all.bat | 16 ++--- build_scripts/php-fb-build.bat | 105 ++++++++++++++++++++--------- build_scripts/php-fb-sdk-build.bat | 10 +-- build_scripts/php-fb-sdk-init.bat | 15 ++--- 5 files changed, 96 insertions(+), 54 deletions(-) diff --git a/build_scripts/README.md b/build_scripts/README.md index 807d158..a90b342 100644 --- a/build_scripts/README.md +++ b/build_scripts/README.md @@ -16,10 +16,8 @@ Make sure ``git`` is in you PATH 2. Set up Firebird 32-bit and 64-bit installations or libraries. 3. Set up PHP-SDK according to https://wiki.php.net/internals/windows/stepbystepbuild_sdk_2 4. Clone php-firebird extension source somewhere. -4. Copy these build scripts to C:\php-sdk\ 5. Adjust php-fb-config.bat. - ``Note: PFB_SOURCE_DIR should point one level up. For example PFB_SOURCE_DIR=D:\php-firebird\ then your source should reside in D:\php-firebird\php-firebird\ `` -6. Run ``php-fb-build-all.bat`` to build for all PHP versions or run ``php-fb-build.bat 7.4 vc15`` to build for particular version. +6. cd into php-sdk and from there run ``\php-fb-build-all.bat`` to build for all PHP versions or run ``php-fb-build.bat 7.4 vc15`` to build for particular version. diff --git a/build_scripts/php-fb-build-all.bat b/build_scripts/php-fb-build-all.bat index db8032f..2620cf9 100644 --- a/build_scripts/php-fb-build-all.bat +++ b/build_scripts/php-fb-build-all.bat @@ -1,10 +1,10 @@ @echo off -call php-fb-build.bat 7.3 vc15 || exit /B %ERRORLEVEL% -call php-fb-build.bat 7.4 vc15 || exit /B %ERRORLEVEL% -call php-fb-build.bat 8.0 vs16 || exit /B %ERRORLEVEL% -call php-fb-build.bat 8.1 vs16 || exit /B %ERRORLEVEL% -call php-fb-build.bat 8.2 vs16 || exit /B %ERRORLEVEL% -call php-fb-build.bat 8.3 vs16 || exit /B %ERRORLEVEL% -call php-fb-build.bat 8.4 vs17 || exit /B %ERRORLEVEL% -call php-fb-build.bat 8.5 vs17 || exit /B %ERRORLEVEL% +call %~dp0php-fb-build.bat php-7.3.33 vc15 || exit %ERRORLEVEL% +call %~dp0php-fb-build.bat php-7.4.13 vc15 || exit %ERRORLEVEL% +call %~dp0php-fb-build.bat php-8.0.30 vs16 || exit %ERRORLEVEL% +call %~dp0php-fb-build.bat php-8.1.33 vs16 || exit %ERRORLEVEL% +call %~dp0php-fb-build.bat php-8.2.29 vs16 || exit %ERRORLEVEL% +call %~dp0php-fb-build.bat php-8.3.26 vs16 || exit %ERRORLEVEL% +call %~dp0php-fb-build.bat php-8.4.13 vs17 || exit %ERRORLEVEL% +call %~dp0php-fb-build.bat php-8.5.0RC2 vs17 || exit %ERRORLEVEL% diff --git a/build_scripts/php-fb-build.bat b/build_scripts/php-fb-build.bat index ce9a696..64a537f 100644 --- a/build_scripts/php-fb-build.bat +++ b/build_scripts/php-fb-build.bat @@ -1,7 +1,7 @@ @echo off @REM config ====================================================================================== -call php-fb-config.bat +call %~dp0php-fb-config.bat goto :MAIN @@ -15,17 +15,49 @@ goto :MAIN echo --------------------------------------------------------------------- exit /B +@REM usage ======================================================================================= :usage - call :log "Usage: %~nx0 php_vers cpp_vers" + call :log "Usage: %~nx0 php_tag cpp_vers" +exit /B + +@REM validate_build =============================================================================== +@REM validate_build :string :string :int +:validate_build +setlocal disabledelayedexpansion +set vb_php=%~1 +set vb_arch=%~2 +set vb_ts=%~3 + +set vb_check_code=^ +if(!extension_loaded('interbase')){ print \"Extension not loaded\n\"; exit(1); }^ +if('php-'.PHP_VERSION != '%pfb_php_tag%'){ printf(\"Version mismatch: expected '%pfb_php_tag%', but got '%%s' \n\", 'php-'.PHP_VERSION); exit(1); }^ +if((int)ZEND_THREAD_SAFE != %vb_ts%){ printf(\"Thread Safety mismatch: expected %vb_ts%, but got %%d \n\", ZEND_THREAD_SAFE); exit(1); }^ +if((PHP_INT_SIZE == 8 ? 'x64' : 'x86') != '%vb_arch%'){ printf(\"Architecture mismatch: expected '%vb_arch%', but got '%%s' \n\", (PHP_INT_SIZE == 8 ? 'x64' : 'x86')); exit(1); } + +if %vb_arch% EQU x86 ( + set vb_libs=%PFB_FB32_DIR% +) else ( + set vb_libs=%PFB_FB64_DIR% +) + +call :log "Validating %pfb_php_tag% %vb_arch% Thread Safety %vb_ts%" + +set vb_cmd=cmd /c set "PATH=%vb_libs%;%PATH%" %php_exe% -dextension=.\php_interbase.dll -r "%vb_check_code%" +%vb_cmd% || exit /B 1 + +echo Validated OK +echo --------------------------------------------------------------------- + exit /B :MAIN -set pfb_php_vers=%1 + +set pfb_php_tag=%1 set pfb_cpp_vers=%2 -if [%pfb_php_vers%] == [] ( +if [%pfb_php_tag%] == [] ( call :usage - echo pfb_php_vers varible not set + echo pfb_php_tag varible not set exit 1 ) @@ -35,39 +67,52 @@ if [%pfb_cpp_vers%] == [] ( exit 1 ) +@REM Convert php-8.4.13 -> 8.4 +for /f "tokens=2,3 delims=-." %%a in ("%pfb_php_tag%") do set pfb_php_vers=%%a.%%b + +if [%pfb_php_vers%] == [] ( + echo BUG: pfb_php_vers should be set at this point + exit 1 +) + set pfb_build_root=php%pfb_php_vers%\%pfb_cpp_vers%\ -(for %%a in (x86 x64) do ( - @REM check out or pull PHP version of interest - if exist %pfb_build_root%\%%a\php-src\.git\ ( - call :log "Checking out PHP-%pfb_php_vers% %%a" - git -C %pfb_build_root%\%%a\php-src pull || goto :error +(for %%a in (x64 x86) do ( + set pfb_arch=%%a + + if not exist %pfb_build_root%\%%a\php-src\.git\ ( + call :log "Cloning %pfb_php_tag% %%a" + call phpsdk-%pfb_cpp_vers%-%%a.bat -t %~dp0php-fb-sdk-init.bat || goto :error + ) + + if %%a EQU x86 ( + set php_exe_arch=%pfb_build_root%%%a\php-src\ ) else ( - call :log "Cloning PHP-%pfb_php_vers% %%a" - call phpsdk-%pfb_cpp_vers%-%%a.bat -t php-fb-sdk-init.bat || goto :error + set php_exe_arch=%pfb_build_root%%%a\php-src\x64\ ) - if %%a EQU x86 ( set pfb_x86=1 ) else ( set pfb_x86=0 ) + setlocal enabledelayedexpansion + (for %%t in (0 1) do ( + set pfb_ts=%%t + if %%t EQU 1 ( + set php_exe="!php_exe_arch!Release_TS\php.exe" + ) else ( + set php_exe="!php_exe_arch!Release\php.exe" + ) - (for %%n in (0 1) do ( - set pfb_nts=%%n - call phpsdk-%pfb_cpp_vers%-%%a.bat -t php-fb-sdk-build.bat || goto :error - )) -)) + if [!php_exe!] == [] ( + echo BUG: php_exe should be set at this point + exit 1 + ) -@REM check if ibase_connect() function exists in newly compiled extension -set check_code="if(!function_exists('ibase_connect'))exit(1);" + call phpsdk-%pfb_cpp_vers%-%%a.bat -t %~dp0php-fb-sdk-build.bat || goto :error -set TPATH=%PATH% -set PATH=%PFB_FB64_DIR%;%TPATH% -"%pfb_build_root%x64\php-src\x64\Release_TS\php.exe" -dextension=.\php_interbase.dll -r %check_code% || goto :error -"%pfb_build_root%x64\php-src\x64\Release\php.exe" -dextension=.\php_interbase.dll -r %check_code% || goto :error -set PATH=%PFB_FB32_DIR%;%TPATH% -"%pfb_build_root%x86\php-src\Release_TS\php.exe" -dextension=.\php_interbase.dll -r %check_code% || goto :error -"%pfb_build_root%x86\php-src\Release\php.exe" -dextension=.\php_interbase.dll -r %check_code% || goto :error -set PATH=%TPATH% + call :validate_build !php_exe! !pfb_arch! !pfb_ts! || goto :error + )) +)) -call :log "PHP %pfb_php_vers% build OK" +echo. +call :log "%pfb_php_tag% build OK" @REM copy compiled extension to target directory copy %pfb_build_root%x64\php-src\x64\Release_TS\php_interbase.dll %PFB_OUTPUT_DIR%php_interbase-%PFB_VERS%-%pfb_php_vers%-%pfb_cpp_vers%-x86_64.dll>nul @@ -78,6 +123,6 @@ copy %pfb_build_root%x86\php-src\Release\php_interbase.dll %PFB_OUTPUT_DIR%php_i exit /B 0 :error - call :log "PHP %pfb_php_vers% build FAILED" + call :log "%pfb_php_tag% build FAILED" exit /B 1 diff --git a/build_scripts/php-fb-sdk-build.bat b/build_scripts/php-fb-sdk-build.bat index ef629b5..c7bd254 100644 --- a/build_scripts/php-fb-sdk-build.bat +++ b/build_scripts/php-fb-sdk-build.bat @@ -3,11 +3,11 @@ @REM Must be called under phpsdk--.bat @REM @REM Calling script should set variables: -@REM [pfb_nts] [pfb_x86] +@REM [pfb_ts] [pfb_arch] @REM @REM set pfb_php_vers=7.4 -@REM set pfb_nts=1 if nts expected, 0 if ts -@REM set pfb_x86=1 if linking to x86 fbclient, o if x64 +@REM set pfb_ts=1 if thread safety enabled, 0 if not +@REM set pfb_arch=x86 to build agains 32-bit, otherwise 64-bit @REM @REM all set in php-fb-config.bat @REM @@ -32,7 +32,7 @@ exit /B set build_msg=Building PHP-%pfb_php_vers% - if "%pfb_nts%" gtr "0" ( + if "%pfb_nts%" gtr "0" ( set build_msg=%build_msg% non-TS set extra_args=--disable-zts ) else ( @@ -40,7 +40,7 @@ exit /B set extra_args= ) - if "%pfb_x86%" gtr "0" ( + if %pfb_arch% EQU x86 ( set with_interbase="shared,%PFB_FB32_DIR%" set build_msg=%build_msg% x86 ) else ( diff --git a/build_scripts/php-fb-sdk-init.bat b/build_scripts/php-fb-sdk-init.bat index f655a40..fe2d4be 100644 --- a/build_scripts/php-fb-sdk-init.bat +++ b/build_scripts/php-fb-sdk-init.bat @@ -2,24 +2,23 @@ @REM @REM Must be called under phpsdk--.bat @REM -@REM Calling script should set variables: +@REM Calling script should set variables: @REM -@REM set pfb_php_vers=7.4 +@REM Example: pfb_php_tag=7.4.13 +@REM Example: pfb_php_vers=7.4 if [%pfb_php_vers%] == [] ( echo pfb_php_vers varible not set exit 1 ) -@REM Handle current master branch -if "%pfb_php_vers%" == "master" ( - set pfb_git_args= -) else ( - set pfb_git_args=--branch PHP-%pfb_php_vers% +if [%pfb_php_tag%] == [] ( + echo pfb_php_tag varible not set + exit 1 ) call phpsdk_buildtree php%pfb_php_vers% -git clone --depth 1 %pfb_git_args% https://github.com/php/php-src.git +git clone --depth 1 --branch %pfb_php_tag% https://github.com/php/php-src.git cd php-src @REM Remove built-in extension From c1c509391673018222608fa94db0fe75fa48a16b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C4=81rti=C5=86=C5=A1=20Lazd=C4=81ns?= Date: Wed, 15 Oct 2025 13:43:18 +0300 Subject: [PATCH 5/9] Fix ts/nts check --- build_scripts/php-fb-sdk-build.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build_scripts/php-fb-sdk-build.bat b/build_scripts/php-fb-sdk-build.bat index c7bd254..e061645 100644 --- a/build_scripts/php-fb-sdk-build.bat +++ b/build_scripts/php-fb-sdk-build.bat @@ -32,7 +32,7 @@ exit /B set build_msg=Building PHP-%pfb_php_vers% - if "%pfb_nts%" gtr "0" ( + if "%pfb_ts%" gtr "0" ( set build_msg=%build_msg% non-TS set extra_args=--disable-zts ) else ( From afa509f4ff6afce64217418ae1eb1a3c657ad592 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C4=81rti=C5=86=C5=A1=20Lazd=C4=81ns?= Date: Wed, 15 Oct 2025 13:43:55 +0300 Subject: [PATCH 6/9] Make condition checking consistent --- build_scripts/php-fb-build.bat | 16 ++++++++-------- build_scripts/php-fb-sdk-build.bat | 4 ++-- build_scripts/php-fb-sdk-init.bat | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/build_scripts/php-fb-build.bat b/build_scripts/php-fb-build.bat index 64a537f..628585c 100644 --- a/build_scripts/php-fb-build.bat +++ b/build_scripts/php-fb-build.bat @@ -34,7 +34,7 @@ if('php-'.PHP_VERSION != '%pfb_php_tag%'){ printf(\"Version mismatch: expected ' if((int)ZEND_THREAD_SAFE != %vb_ts%){ printf(\"Thread Safety mismatch: expected %vb_ts%, but got %%d \n\", ZEND_THREAD_SAFE); exit(1); }^ if((PHP_INT_SIZE == 8 ? 'x64' : 'x86') != '%vb_arch%'){ printf(\"Architecture mismatch: expected '%vb_arch%', but got '%%s' \n\", (PHP_INT_SIZE == 8 ? 'x64' : 'x86')); exit(1); } -if %vb_arch% EQU x86 ( +if "%vb_arch%" == "x86" ( set vb_libs=%PFB_FB32_DIR% ) else ( set vb_libs=%PFB_FB64_DIR% @@ -55,13 +55,13 @@ exit /B set pfb_php_tag=%1 set pfb_cpp_vers=%2 -if [%pfb_php_tag%] == [] ( +if "%pfb_php_tag%" == "" ( call :usage echo pfb_php_tag varible not set exit 1 ) -if [%pfb_cpp_vers%] == [] ( +if "%pfb_cpp_vers%" == "" ( call :usage echo pfb_cpp_vers varible not set exit 1 @@ -70,7 +70,7 @@ if [%pfb_cpp_vers%] == [] ( @REM Convert php-8.4.13 -> 8.4 for /f "tokens=2,3 delims=-." %%a in ("%pfb_php_tag%") do set pfb_php_vers=%%a.%%b -if [%pfb_php_vers%] == [] ( +if "%pfb_php_vers%" == "" ( echo BUG: pfb_php_vers should be set at this point exit 1 ) @@ -80,12 +80,12 @@ set pfb_build_root=php%pfb_php_vers%\%pfb_cpp_vers%\ (for %%a in (x64 x86) do ( set pfb_arch=%%a - if not exist %pfb_build_root%\%%a\php-src\.git\ ( + if not exist "%pfb_build_root%\%%a\php-src\.git\" ( call :log "Cloning %pfb_php_tag% %%a" call phpsdk-%pfb_cpp_vers%-%%a.bat -t %~dp0php-fb-sdk-init.bat || goto :error ) - if %%a EQU x86 ( + if "%%a" == "x86" ( set php_exe_arch=%pfb_build_root%%%a\php-src\ ) else ( set php_exe_arch=%pfb_build_root%%%a\php-src\x64\ @@ -94,13 +94,13 @@ set pfb_build_root=php%pfb_php_vers%\%pfb_cpp_vers%\ setlocal enabledelayedexpansion (for %%t in (0 1) do ( set pfb_ts=%%t - if %%t EQU 1 ( + if "%%t" equ "1" ( set php_exe="!php_exe_arch!Release_TS\php.exe" ) else ( set php_exe="!php_exe_arch!Release\php.exe" ) - if [!php_exe!] == [] ( + if "!php_exe!" == "" ( echo BUG: php_exe should be set at this point exit 1 ) diff --git a/build_scripts/php-fb-sdk-build.bat b/build_scripts/php-fb-sdk-build.bat index e061645..14e3944 100644 --- a/build_scripts/php-fb-sdk-build.bat +++ b/build_scripts/php-fb-sdk-build.bat @@ -25,7 +25,7 @@ goto :MAIN exit /B :MAIN - if [%pfb_php_vers%] == [] ( + if "%pfb_php_vers%" == "" ( echo pfb_php_vers varible not set exit 1 ) @@ -40,7 +40,7 @@ exit /B set extra_args= ) - if %pfb_arch% EQU x86 ( + if "%pfb_arch%" == "x86" ( set with_interbase="shared,%PFB_FB32_DIR%" set build_msg=%build_msg% x86 ) else ( diff --git a/build_scripts/php-fb-sdk-init.bat b/build_scripts/php-fb-sdk-init.bat index fe2d4be..f840d9a 100644 --- a/build_scripts/php-fb-sdk-init.bat +++ b/build_scripts/php-fb-sdk-init.bat @@ -7,12 +7,12 @@ @REM Example: pfb_php_tag=7.4.13 @REM Example: pfb_php_vers=7.4 -if [%pfb_php_vers%] == [] ( +if "%pfb_php_vers%" == "" ( echo pfb_php_vers varible not set exit 1 ) -if [%pfb_php_tag%] == [] ( +if "%pfb_php_tag%" == "" ( echo pfb_php_tag varible not set exit 1 ) From dcd8eeda34c520a25ed6cf6d2de633c6de4e1426 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C4=81rti=C5=86=C5=A1=20Lazd=C4=81ns?= Date: Wed, 15 Oct 2025 13:45:03 +0300 Subject: [PATCH 7/9] Remove confustion x86 --- build_scripts/php-fb-build.bat | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build_scripts/php-fb-build.bat b/build_scripts/php-fb-build.bat index 628585c..b510c10 100644 --- a/build_scripts/php-fb-build.bat +++ b/build_scripts/php-fb-build.bat @@ -115,8 +115,8 @@ echo. call :log "%pfb_php_tag% build OK" @REM copy compiled extension to target directory -copy %pfb_build_root%x64\php-src\x64\Release_TS\php_interbase.dll %PFB_OUTPUT_DIR%php_interbase-%PFB_VERS%-%pfb_php_vers%-%pfb_cpp_vers%-x86_64.dll>nul -copy %pfb_build_root%x64\php-src\x64\Release\php_interbase.dll %PFB_OUTPUT_DIR%php_interbase-%PFB_VERS%-%pfb_php_vers%-%pfb_cpp_vers%-nts-x86_64.dll>nul +copy %pfb_build_root%x64\php-src\x64\Release_TS\php_interbase.dll %PFB_OUTPUT_DIR%php_interbase-%PFB_VERS%-%pfb_php_vers%-%pfb_cpp_vers%-x64.dll>nul +copy %pfb_build_root%x64\php-src\x64\Release\php_interbase.dll %PFB_OUTPUT_DIR%php_interbase-%PFB_VERS%-%pfb_php_vers%-%pfb_cpp_vers%-nts-x64.dll>nul copy %pfb_build_root%x86\php-src\Release_TS\php_interbase.dll %PFB_OUTPUT_DIR%php_interbase-%PFB_VERS%-%pfb_php_vers%-%pfb_cpp_vers%.dll>nul copy %pfb_build_root%x86\php-src\Release\php_interbase.dll %PFB_OUTPUT_DIR%php_interbase-%PFB_VERS%-%pfb_php_vers%-%pfb_cpp_vers%-nts.dll>nul From f8f15e1b72a366db24e97a4f60c301df6e22c839 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C4=81rti=C5=86=C5=A1=20Lazd=C4=81ns?= Date: Wed, 15 Oct 2025 14:05:07 +0300 Subject: [PATCH 8/9] Remove nul redirect --- build_scripts/php-fb-build.bat | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/build_scripts/php-fb-build.bat b/build_scripts/php-fb-build.bat index b510c10..58872d4 100644 --- a/build_scripts/php-fb-build.bat +++ b/build_scripts/php-fb-build.bat @@ -115,10 +115,10 @@ echo. call :log "%pfb_php_tag% build OK" @REM copy compiled extension to target directory -copy %pfb_build_root%x64\php-src\x64\Release_TS\php_interbase.dll %PFB_OUTPUT_DIR%php_interbase-%PFB_VERS%-%pfb_php_vers%-%pfb_cpp_vers%-x64.dll>nul -copy %pfb_build_root%x64\php-src\x64\Release\php_interbase.dll %PFB_OUTPUT_DIR%php_interbase-%PFB_VERS%-%pfb_php_vers%-%pfb_cpp_vers%-nts-x64.dll>nul -copy %pfb_build_root%x86\php-src\Release_TS\php_interbase.dll %PFB_OUTPUT_DIR%php_interbase-%PFB_VERS%-%pfb_php_vers%-%pfb_cpp_vers%.dll>nul -copy %pfb_build_root%x86\php-src\Release\php_interbase.dll %PFB_OUTPUT_DIR%php_interbase-%PFB_VERS%-%pfb_php_vers%-%pfb_cpp_vers%-nts.dll>nul +copy %pfb_build_root%x64\php-src\x64\Release_TS\php_interbase.dll %PFB_OUTPUT_DIR%php_interbase-%PFB_VERS%-%pfb_php_vers%-%pfb_cpp_vers%-x64.dll +copy %pfb_build_root%x64\php-src\x64\Release\php_interbase.dll %PFB_OUTPUT_DIR%php_interbase-%PFB_VERS%-%pfb_php_vers%-%pfb_cpp_vers%-nts-x64.dll +copy %pfb_build_root%x86\php-src\Release_TS\php_interbase.dll %PFB_OUTPUT_DIR%php_interbase-%PFB_VERS%-%pfb_php_vers%-%pfb_cpp_vers%.dll +copy %pfb_build_root%x86\php-src\Release\php_interbase.dll %PFB_OUTPUT_DIR%php_interbase-%PFB_VERS%-%pfb_php_vers%-%pfb_cpp_vers%-nts.dll exit /B 0 From 90c0d8828c4f294eff48c6d1c7cf9c2c349684b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C4=81rti=C5=86=C5=A1=20Lazd=C4=81ns?= Date: Wed, 15 Oct 2025 14:05:24 +0300 Subject: [PATCH 9/9] Update .gitignore --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 110ac07..c4d9372 100644 --- a/.gitignore +++ b/.gitignore @@ -71,3 +71,5 @@ tests/*.sh # coverage /coverage.info /reports +win_build_scripts +.vscode-win