mirror of
https://github.com/php-win-ext/php-sdk-binary-tools.git
synced 2026-03-24 09:02:12 +01:00
Compare commits
16 Commits
php-sdk-2.
...
php-sdk-2.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d584b2f1c5 | ||
|
|
5c7a304e77 | ||
|
|
b3fffba01c | ||
|
|
58a7bdcfa7 | ||
|
|
81aaa702b2 | ||
|
|
ccfc816560 | ||
|
|
cf6ded7cec | ||
|
|
c73ab2dc76 | ||
|
|
06e32545f5 | ||
|
|
b8bf87b831 | ||
|
|
70ed1c2418 | ||
|
|
8d1df4af8c | ||
|
|
7050077f31 | ||
|
|
94c9d6c97d | ||
|
|
2dab4068aa | ||
|
|
bbdc8dd597 |
27
README.md
27
README.md
@@ -8,14 +8,23 @@ The PHP SDK itself and the SDK own tools and code are licensed under the BSD 2-C
|
||||
|
||||
# Overview
|
||||
|
||||
The PHP SDK 2.0+ is compatible with PHP 7.0 and above. The compatibility with [older versions](http://windows.php.net/downloads/php-sdk/php-sdk-binary-tools-20110915.zip "php-sdk-binary-tools-20110915.zip") is kept, also available from the [legacy branch](https://github.com/Microsoft/php-sdk-binary-tools/tree/legacy). The toolset was significantly revamped. Newer tools are now available, better workflows are now possible. The toolset consists on a mix of the hand written scripts, selected MSYS2 parts and standalone programs.
|
||||
The toolset consists on a mix of the hand written scripts, selected MSYS2 parts and standalone programs. It supports any workflows, be it a custom, local or a CI build whatsoever.
|
||||
|
||||
The PHP SDK 2.2+ is compatible with PHP 7.2 and above.
|
||||
|
||||
The PHP SDK 2.1 is required to build PHP 7.1 or 7.0.
|
||||
|
||||
The legacy binary tools SDK is available from the [legacy branch](https://github.com/Microsoft/php-sdk-binary-tools/tree/legacy) and is suitable to build PHP 5.
|
||||
|
||||
# Requirements
|
||||
|
||||
- A 64-bit build host
|
||||
- `Visual C++ 2015` or `Visual C++ 2017` must be installed prior SDK usage (be sure to install the C++ dev, .NET dev and the Windows SDK components)
|
||||
- Windows 7 or later
|
||||
- `Visual C++ 2017` or `Visual C++ 2019` must be installed prior SDK usage. Required components
|
||||
- C++ dev
|
||||
- Windows SDK
|
||||
- .NET dev
|
||||
- if `Cygwin`, `MingW` or any other cross solution is installed, please read notes in the pitfalls section
|
||||
- The PHP SDK was successfully tested on Windows 7 or later, earlier versions might work but are not recommended
|
||||
|
||||
# Tools
|
||||
|
||||
@@ -31,8 +40,8 @@ The PHP SDK 2.0+ is compatible with PHP 7.0 and above. The compatibility with [o
|
||||
|
||||
## Other tools
|
||||
|
||||
- `bison` 3.2.4, `re2c` 1.1.1, `lemon`
|
||||
- `awk`, `gawk`, `sed`, `grep`
|
||||
- `bison` 3.3.2, `re2c` 1.1.1, `lemon`
|
||||
- `awk`, `gawk`, `sed`, `grep`, `jq`
|
||||
- `diff`, `diff3`, `patch`
|
||||
- `md5sum`, `sha1sum`, `sha224sum`, `sha256sum`, `sha384sum`, `sha512sum`
|
||||
- `7za`, `zip`, `unzip`, `unzipsfx`
|
||||
@@ -50,7 +59,7 @@ These are not included with the PHP SDK, but might be useful. While Visual C++ i
|
||||
|
||||
# Usage
|
||||
|
||||
The PHP SDK should be unzipped into the shortest possible path, preferrably somewhere near the drive root.
|
||||
The PHP SDK should be unzipped into the shortest possible path, preferably somewhere near the drive root.
|
||||
|
||||
Usually, the first step to start the PHP SDK is by invoking one of the suitable starter scripts. This automatically puts the console on the correct environment relevant for the desired PHP build configuration.
|
||||
|
||||
@@ -190,9 +199,9 @@ previously.
|
||||
- When fetching the binary SDK from git, git `core.autocrlf` configuration directive set to `false` is recommended.
|
||||
- Tools, based on MSYS2, only accept paths with forward slashes.
|
||||
- Both Visual C++ toolset and the Windows SDK components have to be installed for the PHP SDK to work properly.
|
||||
- The VC++ toolset is still requried, even if another compiler, fe. clang, is intended to be used.
|
||||
- The VC++ toolset is still required, even if another compiler, fe. clang, is intended to be used.
|
||||
- `task.exe` is not a console application, some systems might not propagate exit code except the batch is explicitly run from `cmd /c`, etc.
|
||||
- `7za` should be prefered over `unzip` and `zip` for compatibility reasons.
|
||||
- If you experince some strange crashes on MSYS2 tools, try the phpsdk_rebase_msys2 tool. MSYS2 tools might be have unstable
|
||||
- `7za` should be preferred over `unzip` and `zip` for compatibility reasons.
|
||||
- If you experience some strange crashes on MSYS2 tools, try the phpsdk_rebase_msys2 tool. MSYS2 tools might be have unstable
|
||||
on ASLR enabled systems.
|
||||
|
||||
|
||||
BIN
bin/jq.exe
Normal file
BIN
bin/jq.exe
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
bin/php/libcrypto-1_1-x64.dll
Normal file
BIN
bin/php/libcrypto-1_1-x64.dll
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
bin/php/libssl-1_1-x64.dll
Normal file
BIN
bin/php/libssl-1_1-x64.dll
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
bin/php/php.exe
BIN
bin/php/php.exe
Binary file not shown.
@@ -5,7 +5,7 @@ extension=php_sqlite3.dll
|
||||
extension=php_openssl.dll
|
||||
extension=php_mbstring.dll
|
||||
extension=php_mysqli.dll
|
||||
memory_limit=1G
|
||||
memory_limit=4G
|
||||
|
||||
error_reporting=-1
|
||||
display_errors=1
|
||||
|
||||
BIN
bin/php/php7.dll
BIN
bin/php/php7.dll
Binary file not shown.
@@ -128,7 +128,7 @@ try {
|
||||
/* The current CRT needs to match the config one. */
|
||||
$active_crt = getenv("PHP_SDK_VS");
|
||||
if (Config::getCurrentCrtName() != $active_crt && !$force) {
|
||||
throw new Exception("Active CRT '$active_crt' differs from the branch CRT '" . Config::getCurrentCrtName() . "'.");
|
||||
throw new Exception("Active CRT name '$active_crt' differs from the branch CRT name '" . Config::getCurrentCrtName() . "'.");
|
||||
}
|
||||
|
||||
$branch_data = Config::getCurrentBranchData();
|
||||
|
||||
@@ -130,19 +130,6 @@ abstract class PHP
|
||||
return true;
|
||||
}
|
||||
|
||||
public function is64bit() : bool
|
||||
{
|
||||
$cli = new CLI($this->conf, $this->scenario);
|
||||
|
||||
$out = shell_exec($cli->getExeFilename() . " -n -v");
|
||||
|
||||
if (preg_match(",x64,", $out, $m) > 0) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Need to cleanup it somewhere. */
|
||||
public function getIniFilename()
|
||||
{
|
||||
@@ -153,7 +140,7 @@ abstract class PHP
|
||||
$this->conf->buildTplVarName("php", "error_log") => $this->getRootDir() . DIRECTORY_SEPARATOR . "pgo_run_error.log",
|
||||
);
|
||||
|
||||
$k = $this->is64bit() ? "x64" : "x86";
|
||||
$k = SDKConfig::getCurrentArchName();
|
||||
$scenario_vars = (array)$this->conf->getSectionItem("php", "scenario", $this->scenario, "ini", $k);
|
||||
if ($scenario_vars) {
|
||||
foreach ($scenario_vars as $k => $v) {
|
||||
@@ -240,7 +227,7 @@ abstract class PHP
|
||||
return $this->getVersion() . "-"
|
||||
. SDKConfig::getCurrentCrtName() . "-"
|
||||
. ($this->isThreadSafe() ? "ts" : "nts") . "-"
|
||||
. ($this->is64bit() ? "x64" : "x86")
|
||||
. SDKConfig::getCurrentArchName()
|
||||
. "-" . substr(md5(uniqid()), 0, 8);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,20 +57,24 @@ class Config
|
||||
public static function getCurrentArchName() : string
|
||||
{/*{{{*/
|
||||
if (NULL === self::$currentArchName) {
|
||||
/* XXX this might be not true for other compilers! */
|
||||
passthru("where cl.exe >nul", $status);
|
||||
if ($status) {
|
||||
throw new Exception("Couldn't execute cl.exe.");
|
||||
}
|
||||
|
||||
exec("cl.exe /? 2>&1", $out);
|
||||
|
||||
if (preg_match(",x64,", $out[0])) {
|
||||
self::setCurrentArchName("x64");
|
||||
} elseif (preg_match(",x86,", $out[0])) {
|
||||
self::setCurrentArchName("x86");
|
||||
if (FALSE !== ($env = getenv('PHP_SDK_ARCH'))) {
|
||||
self::setCurrentArchName($env);
|
||||
} else {
|
||||
throw new Exception("Couldn't determine Arch.");
|
||||
/* XXX this might be not true for other compilers! */
|
||||
passthru("where cl.exe >nul", $status);
|
||||
if ($status) {
|
||||
throw new Exception("Couldn't execute cl.exe.");
|
||||
}
|
||||
|
||||
exec("cl.exe /? 2>&1", $out);
|
||||
|
||||
if (preg_match(",x64,", $out[0])) {
|
||||
self::setCurrentArchName("x64");
|
||||
} elseif (preg_match(",x86,", $out[0])) {
|
||||
self::setCurrentArchName("x86");
|
||||
} else {
|
||||
throw new Exception("Couldn't determine Arch.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -85,18 +89,22 @@ class Config
|
||||
public static function getCurrentCrtName() : ?string
|
||||
{/*{{{*/
|
||||
if (NULL === self::$currentCrtName) {
|
||||
$all_branches = Config::getKnownBranches();
|
||||
if (FALSE !== ($env = getenv('PHP_SDK_VS'))) {
|
||||
self::setCurrentCrtName($env);
|
||||
} else {
|
||||
$all_branches = Config::getKnownBranches();
|
||||
|
||||
if (!isset($all_branches[Config::getCurrentBranchName()])) {
|
||||
throw new Exception("Couldn't find any configuration for branch '" . Config::getCurrentBranchName() . "'");
|
||||
if (!isset($all_branches[Config::getCurrentBranchName()])) {
|
||||
throw new Exception("Couldn't find any configuration for branch '" . Config::getCurrentBranchName() . "'");
|
||||
}
|
||||
|
||||
$branch = $all_branches[Config::getCurrentBranchName()];
|
||||
if (count($branch) > 1) {
|
||||
throw new Exception("Multiple CRTs are available for this branch, please choose one from " . implode(",", array_keys($branch)));
|
||||
}
|
||||
|
||||
self::setCurrentCrtName(array_keys($branch)[0]);
|
||||
}
|
||||
|
||||
$branch = $all_branches[Config::getCurrentBranchName()];
|
||||
if (count($branch) > 1) {
|
||||
throw new Exception("Multiple CRTs are available for this branch, please choose one from " . implode(",", array_keys($branch)));
|
||||
}
|
||||
|
||||
self::setCurrentCrtName(array_keys($branch)[0]);
|
||||
}
|
||||
|
||||
return self::$currentCrtName;
|
||||
@@ -138,8 +146,7 @@ class Config
|
||||
$tmp = $fetcher->getByUri(self::$depsBaseUri . "/series/");
|
||||
if (false !== $tmp) {
|
||||
$data = array();
|
||||
if (preg_match_all(",/packages-(.+)-(vc\d+)-(x86|x64)-(stable|staging)\.txt,U", $tmp, $m, PREG_SET_ORDER)
|
||||
|| preg_match_all(",/packages-(.+)-(vs\d+)-(x86|x64)-(stable|staging)\.txt,U", $tmp, $m, PREG_SET_ORDER)) {
|
||||
if (preg_match_all(",/packages-(.+)-(v[cs]\d+)-(x86|x64)-(stable|staging)\.txt,U", $tmp, $m, PREG_SET_ORDER)) {
|
||||
foreach ($m as $b) {
|
||||
if (!isset($data[$b[1]])) {
|
||||
$data[$b[1]] = array();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"pgo01org_zip_url": "https://github.com/01org/php_pgo_training_scripts/archive/master.zip",
|
||||
"pgo01org_zip_url": "https://github.com/intel/php_pgo_training_scripts/archive/master.zip",
|
||||
"type": "web",
|
||||
"srv_http": "nginx",
|
||||
"srv_db": "mariadb"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"wp_cli_phar_url": "https://github.com/wp-cli/wp-cli/releases/download/v2.0.0/wp-cli-2.0.0.phar",
|
||||
"wptest_zip_url": "https://github.com/manovotny/wptest/archive/master.zip",
|
||||
"wptest_zip_url": "https://github.com/poststatus/wptest/archive/master.zip",
|
||||
"type": "web",
|
||||
"srv_http": "nginx",
|
||||
"srv_db": "mariadb"
|
||||
|
||||
Reference in New Issue
Block a user