Skip to content

Commit 14caf07

Browse files
committed
Merge branch 'master' into compat5
* master: Back to dev Prepare 2.0.13 Upgrade vswhere Upgrade bundled PHP Unset some tmp vars Note on unattended build Check for Windows SDK 10.0 for VC14, too Pass nologo to vcvarsall.bat Unify EOL Ensure starter scripts keep the current directory Update version in readme Add comment Fix curl error handling
2 parents f74985c + 1684c7e commit 14caf07

15 files changed

+33
-12
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ It is not required to hold the source in the PHP SDK directory. It could be usef
6060

6161
- `git clone https://github.com/OSTC/php-sdk-binary-tools.git c:\php-sdk`
6262
- `cd c:\php-sdk`
63-
- `git checkout php-sdk-2.0.0` or later
63+
- `git checkout php-sdk-2.0.12` or later
6464
- invoke `phpsdk-vc15-x64.bat`
6565
- `phpsdk_buildtree phpmaster`
6666
- `git clone https://github.com/php/php-src.git && cd php-src`, or fetch a zipball
@@ -90,6 +90,8 @@ The starter scripts can be also easy integrated with the consoles other than sta
9090

9191
An elementary functionality to run unattended builds is included. See an example on how to setup a simple unattended build task in the doc directory.
9292

93+
Be aware, that starter scripts always start a new shell. Scripts intended to run as a task need to be passed with `-t` argument to a starter script.
94+
9395
# Upgrading
9496

9597
- backup phpsdk-local.bat
@@ -102,7 +104,7 @@ If the PHP SDK is kept as a git checkout, merely what is needed instead is to gi
102104

103105
# Extending
104106

105-
The SDK tools are based on the KISS principle and should be kept so. Basic tools are implemented as simple batch script. The minimalistic `PHP` is available for internal SDK purposes. It can be used, if more complexity is required. If you have an idea for some useful tool or workflow, please open a ticket or PR, so it can be discussed, implemented and added to the SDK. By contributing an implementation, you should also accept the SDK license.
107+
The SDK tools are based on the KISS principle and should be kept so. Basic tools are implemented as simple batch script. The minimalistic `PHP` is available for internal SDK purposes. It can be used, if more complexity is required. A suitable PHP binary is bound with the PHP SDK. If you have an idea for some useful tool or workflow, please open a ticket or PR, so it can be discussed, implemented and added to the SDK. By contributing an implementation, you should also accept the SDK license.
106108

107109
# Pitfalls
108110

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.0.13-dev
1+
2.0.14-dev

bin/php/ext/php_curl.dll

13 KB
Binary file not shown.

bin/php/ext/php_ftp.dll

512 Bytes
Binary file not shown.

bin/php/ext/php_mbstring.dll

512 Bytes
Binary file not shown.

bin/php/ext/php_mysqli.dll

1 KB
Binary file not shown.

bin/php/ext/php_openssl.dll

0 Bytes
Binary file not shown.

bin/php/ext/php_sqlite3.dll

0 Bytes
Binary file not shown.

bin/php/nghttp2.dll

0 Bytes
Binary file not shown.

bin/php/php.exe

512 Bytes
Binary file not shown.

bin/php/php7.dll

4.5 KB
Binary file not shown.

bin/phpsdk_setshell.bat

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,20 +98,35 @@ set TMPKEY=
9898

9999
if 15 gtr %PHP_SDK_VC_NUM% (
100100
rem get sdk dir
101+
rem if 10.0 is available, it's ok
102+
if /i "%PHP_SDK_OS_ARCH%"=="x64" (
103+
set TMPKEY=HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v10.0
104+
) else (
105+
set TMPKEY=HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v10.0
106+
)
107+
for /f "tokens=2*" %%a in ('reg query "!TMPKEY!" /v InstallationFolder') do (
108+
for /f "tokens=2*" %%c in ('reg query "!TMPKEY!" /v ProductVersion') do (
109+
if exist "%%bInclude\%%d.0\um\Windows.h" (
110+
goto got_sdk
111+
)
112+
)
113+
)
114+
115+
rem Otherwise 8.1 should be available anyway
101116
if /i "%PHP_SDK_OS_ARCH%"=="x64" (
102117
set TMPKEY=HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v8.1
103118
) else (
104119
set TMPKEY=HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v8.1
105120
)
106121
for /f "tokens=2*" %%a in ('reg query "!TMPKEY!" /v InstallationFolder') do (
107122
if exist "%%b\Include\um\Windows.h" (
108-
set PHP_SDK_WIN_SDK_DIR=%%b
123+
goto got_sdk
109124
)
110125
)
111-
if not defined PHP_SDK_WIN_SDK_DIR (
112-
echo Windows SDK not found.
113-
goto out_error;
114-
)
126+
127+
echo Windows SDK not found.
128+
goto out_error;
129+
:got_sdk
115130
set TMPKEY=
116131
)
117132

bin/vswhere.exe

6 KB
Binary file not shown.

lib/php/libsdk/SDK/FileOps.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ protected function download(string $url, string $dest = NULL) : ?string
134134

135135
$ret = curl_exec($ch);
136136
if (false === $ret) {
137-
$err = curl_error();
137+
$err = curl_error($ch);
138138
curl_close($ch);
139139
if ($dest) {
140140
fclose($fd);

phpsdk-starter.bat

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
setlocal enableextensions enabledelayedexpansion
44

5+
rem make sure we end up where we started (for VS2017)
6+
set "VSCMD_START_DIR=%CD%"
7+
set "__VSCMD_ARG_NO_LOGO=yes"
8+
59
rem this will be eventually overridden by phpsdk_setvars, but nothing wrong to use the same name here
610
set PHP_SDK_ROOT_PATH=%~dp0
711
set PHP_SDK_ROOT_PATH=%PHP_SDK_ROOT_PATH:~0,-1%
@@ -31,7 +35,7 @@ set ARCH=%ARCH: =%
3135
set PHP_SDK_RUN_FROM_ROOT=1
3236

3337

34-
title PHP SDK %CRT% %ARCH%
38+
title PHP SDK %CRT% %ARCH%
3539

3640
call %PHP_SDK_ROOT_PATH%\bin\phpsdk_setshell.bat %CRT% %ARCH%
3741

@@ -62,9 +66,9 @@ if "%TASK%" neq "" (
6266
)
6367

6468
if exist "%PHP_SDK_ROOT_PATH%\phpsdk-local.bat" (
65-
cmd /k "!PHP_SDK_VC_SHELL_CMD! && %PHP_SDK_ROOT_PATH%\bin\phpsdk_setvars.bat && %PHP_SDK_ROOT_PATH%\bin\phpsdk_dumpenv.bat && %PHP_SDK_ROOT_PATH%\phpsdk-local.bat && echo. && set prompt=$P$_$+$$$S"
69+
cmd /k "!PHP_SDK_VC_SHELL_CMD! && set __VSCMD_ARG_NO_LOGO=&& set VSCMD_START_DIR=&& %PHP_SDK_ROOT_PATH%\bin\phpsdk_setvars.bat && %PHP_SDK_ROOT_PATH%\bin\phpsdk_dumpenv.bat && %PHP_SDK_ROOT_PATH%\phpsdk-local.bat && echo. && set prompt=$P$_$+$$$S"
6670
) else (
67-
cmd /k "!PHP_SDK_VC_SHELL_CMD! && %PHP_SDK_ROOT_PATH%\bin\phpsdk_setvars.bat && %PHP_SDK_ROOT_PATH%\bin\phpsdk_dumpenv.bat && set prompt=$P$_$+$$$S"
71+
cmd /k "!PHP_SDK_VC_SHELL_CMD! && set __VSCMD_ARG_NO_LOGO=&& set VSCMD_START_DIR=&& %PHP_SDK_ROOT_PATH%\bin\phpsdk_setvars.bat && %PHP_SDK_ROOT_PATH%\bin\phpsdk_dumpenv.bat && set prompt=$P$_$+$$$S"
6872
)
6973

7074
exit /b !ERRORLEVEL!

0 commit comments

Comments
 (0)