mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-18 04:44:53 +08:00
Merge branch 'main' into feat/xdebug-dynamic
This commit is contained in:
commit
371a588396
@ -426,6 +426,17 @@
|
|||||||
},
|
},
|
||||||
"notes": true
|
"notes": true
|
||||||
},
|
},
|
||||||
|
"odbc": {
|
||||||
|
"support": {
|
||||||
|
"BSD": "wip",
|
||||||
|
"Windows": "wip"
|
||||||
|
},
|
||||||
|
"type": "builtin",
|
||||||
|
"arg-type-unix": "custom",
|
||||||
|
"lib-depends-unix": [
|
||||||
|
"unixodbc"
|
||||||
|
]
|
||||||
|
},
|
||||||
"opcache": {
|
"opcache": {
|
||||||
"type": "builtin",
|
"type": "builtin",
|
||||||
"arg-type-unix": "custom"
|
"arg-type-unix": "custom"
|
||||||
@ -492,19 +503,36 @@
|
|||||||
"mysqlnd"
|
"mysqlnd"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"pdo_odbc": {
|
||||||
|
"support": {
|
||||||
|
"BSD": "wip"
|
||||||
|
},
|
||||||
|
"type": "builtin",
|
||||||
|
"arg-type": "custom",
|
||||||
|
"lib-depends-unix": [
|
||||||
|
"unixodbc"
|
||||||
|
],
|
||||||
|
"ext-depends": [
|
||||||
|
"pdo",
|
||||||
|
"odbc"
|
||||||
|
]
|
||||||
|
},
|
||||||
"pdo_pgsql": {
|
"pdo_pgsql": {
|
||||||
"support": {
|
"support": {
|
||||||
"Windows": "wip",
|
|
||||||
"BSD": "wip"
|
"BSD": "wip"
|
||||||
},
|
},
|
||||||
"type": "builtin",
|
"type": "builtin",
|
||||||
"arg-type": "with-prefix",
|
"arg-type": "with-prefix",
|
||||||
|
"arg-type-windows": "custom",
|
||||||
"ext-depends": [
|
"ext-depends": [
|
||||||
"pdo",
|
"pdo",
|
||||||
"pgsql"
|
"pgsql"
|
||||||
],
|
],
|
||||||
"lib-depends": [
|
"lib-depends-unix": [
|
||||||
"postgresql"
|
"postgresql"
|
||||||
|
],
|
||||||
|
"lib-depends-windows": [
|
||||||
|
"postgresql-win"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"pdo_sqlite": {
|
"pdo_sqlite": {
|
||||||
@ -535,14 +563,16 @@
|
|||||||
},
|
},
|
||||||
"pgsql": {
|
"pgsql": {
|
||||||
"support": {
|
"support": {
|
||||||
"Windows": "wip",
|
|
||||||
"BSD": "wip"
|
"BSD": "wip"
|
||||||
},
|
},
|
||||||
"notes": true,
|
"notes": true,
|
||||||
"type": "builtin",
|
"type": "builtin",
|
||||||
"arg-type": "custom",
|
"arg-type": "custom",
|
||||||
"lib-depends": [
|
"lib-depends-unix": [
|
||||||
"postgresql"
|
"postgresql"
|
||||||
|
],
|
||||||
|
"lib-depends-windows": [
|
||||||
|
"postgresql-win"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"phar": {
|
"phar": {
|
||||||
|
|||||||
@ -78,7 +78,6 @@
|
|||||||
"zlib"
|
"zlib"
|
||||||
],
|
],
|
||||||
"lib-depends-windows": [
|
"lib-depends-windows": [
|
||||||
"openssl",
|
|
||||||
"zlib",
|
"zlib",
|
||||||
"libssh2",
|
"libssh2",
|
||||||
"nghttp2"
|
"nghttp2"
|
||||||
@ -672,6 +671,14 @@
|
|||||||
"zstd"
|
"zstd"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"postgresql-win": {
|
||||||
|
"source": "postgresql-win",
|
||||||
|
"static-libs": [
|
||||||
|
"libpq.lib",
|
||||||
|
"libpgport.lib",
|
||||||
|
"libpgcommon.lib"
|
||||||
|
]
|
||||||
|
},
|
||||||
"pthreads4w": {
|
"pthreads4w": {
|
||||||
"source": "pthreads4w",
|
"source": "pthreads4w",
|
||||||
"static-libs-windows": [
|
"static-libs-windows": [
|
||||||
|
|||||||
@ -761,6 +761,14 @@
|
|||||||
"path": "COPYRIGHT"
|
"path": "COPYRIGHT"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"postgresql-win": {
|
||||||
|
"type": "url",
|
||||||
|
"url": "https://get.enterprisedb.com/postgresql/postgresql-16.8-1-windows-x64-binaries.zip",
|
||||||
|
"license": {
|
||||||
|
"type": "text",
|
||||||
|
"text": "PostgreSQL Database Management System\n(also known as Postgres, formerly as Postgres95)\n\nPortions Copyright (c) 1996-2025, The PostgreSQL Global Development Group\n\nPortions Copyright (c) 1994, The Regents of the University of California\n\nPermission to use, copy, modify, and distribute this software and its\ndocumentation for any purpose, without fee, and without a written\nagreement is hereby granted, provided that the above copyright notice\nand this paragraph and the following two paragraphs appear in all\ncopies.\n\nIN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY\nFOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES,\nINCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS\nDOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF\nTHE POSSIBILITY OF SUCH DAMAGE.\n\nTHE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,\nINCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS\nON AN \"AS IS\" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS\nTO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS."
|
||||||
|
}
|
||||||
|
},
|
||||||
"protobuf": {
|
"protobuf": {
|
||||||
"type": "url",
|
"type": "url",
|
||||||
"url": "https://pecl.php.net/get/protobuf",
|
"url": "https://pecl.php.net/get/protobuf",
|
||||||
|
|||||||
@ -32,7 +32,7 @@ use Symfony\Component\Console\Application;
|
|||||||
*/
|
*/
|
||||||
final class ConsoleApplication extends Application
|
final class ConsoleApplication extends Application
|
||||||
{
|
{
|
||||||
public const VERSION = '2.5.0';
|
public const VERSION = '2.5.1';
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
|
|||||||
17
src/SPC/builder/extension/odbc.php
Normal file
17
src/SPC/builder/extension/odbc.php
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace SPC\builder\extension;
|
||||||
|
|
||||||
|
use SPC\builder\Extension;
|
||||||
|
use SPC\util\CustomExt;
|
||||||
|
|
||||||
|
#[CustomExt('odbc')]
|
||||||
|
class odbc extends Extension
|
||||||
|
{
|
||||||
|
public function getUnixConfigureArg(): string
|
||||||
|
{
|
||||||
|
return '--with-unixODBC=' . BUILD_ROOT_PATH;
|
||||||
|
}
|
||||||
|
}
|
||||||
29
src/SPC/builder/extension/pdo_odbc.php
Normal file
29
src/SPC/builder/extension/pdo_odbc.php
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace SPC\builder\extension;
|
||||||
|
|
||||||
|
use SPC\builder\Extension;
|
||||||
|
use SPC\store\FileSystem;
|
||||||
|
use SPC\util\CustomExt;
|
||||||
|
|
||||||
|
#[CustomExt('pdo_odbc')]
|
||||||
|
class pdo_odbc extends Extension
|
||||||
|
{
|
||||||
|
public function patchBeforeBuildconf(): bool
|
||||||
|
{
|
||||||
|
FileSystem::replaceFileStr(SOURCE_PATH . '/php-src/ext/pdo_odbc/config.m4', 'PDO_ODBC_LDFLAGS="$pdo_odbc_def_ldflags', 'PDO_ODBC_LDFLAGS="-liconv $pdo_odbc_def_ldflags');
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getUnixConfigureArg(): string
|
||||||
|
{
|
||||||
|
return '--with-pdo-odbc=unixODBC,' . BUILD_ROOT_PATH;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getWindowsConfigureArg(): string
|
||||||
|
{
|
||||||
|
return '--with-pdo-odbc';
|
||||||
|
}
|
||||||
|
}
|
||||||
17
src/SPC/builder/extension/pdo_pgsql.php
Normal file
17
src/SPC/builder/extension/pdo_pgsql.php
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace SPC\builder\extension;
|
||||||
|
|
||||||
|
use SPC\builder\Extension;
|
||||||
|
use SPC\util\CustomExt;
|
||||||
|
|
||||||
|
#[CustomExt('pdo_pgsql')]
|
||||||
|
class pdo_pgsql extends Extension
|
||||||
|
{
|
||||||
|
public function getWindowsConfigureArg(): string
|
||||||
|
{
|
||||||
|
return '--with-pdo-pgsql=yes';
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -40,4 +40,16 @@ class pgsql extends Extension
|
|||||||
}
|
}
|
||||||
return '--with-pgsql=' . BUILD_ROOT_PATH;
|
return '--with-pgsql=' . BUILD_ROOT_PATH;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @throws WrongUsageException
|
||||||
|
* @throws RuntimeException
|
||||||
|
*/
|
||||||
|
public function getWindowsConfigureArg(): string
|
||||||
|
{
|
||||||
|
if ($this->builder->getPHPVersionID() >= 80400) {
|
||||||
|
return '--with-pgsql';
|
||||||
|
}
|
||||||
|
return '--with-pgsql=' . BUILD_ROOT_PATH;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -95,8 +95,9 @@ class WindowsBuilder extends BuilderBase
|
|||||||
|
|
||||||
if (($logo = $this->getOption('with-micro-logo')) !== null) {
|
if (($logo = $this->getOption('with-micro-logo')) !== null) {
|
||||||
// realpath
|
// realpath
|
||||||
$logo = realpath($logo);
|
// $logo = realpath($logo);
|
||||||
$micro_logo = '--enable-micro-logo=' . $logo . ' ';
|
$micro_logo = '--enable-micro-logo=' . $logo . ' ';
|
||||||
|
copy($logo, SOURCE_PATH . '\php-src\\' . $logo);
|
||||||
} else {
|
} else {
|
||||||
$micro_logo = '';
|
$micro_logo = '';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -37,6 +37,8 @@ class curl extends WindowsLibraryBase
|
|||||||
'-DBUILD_EXAMPLES=OFF ' . // disable examples
|
'-DBUILD_EXAMPLES=OFF ' . // disable examples
|
||||||
'-DUSE_LIBIDN2=OFF ' . // disable libidn2
|
'-DUSE_LIBIDN2=OFF ' . // disable libidn2
|
||||||
'-DCURL_USE_LIBPSL=OFF ' . // disable libpsl
|
'-DCURL_USE_LIBPSL=OFF ' . // disable libpsl
|
||||||
|
'-DCURL_USE_SCHANNEL=ON ' . // use Schannel instead of OpenSSL
|
||||||
|
'-DCURL_USE_OPENSSL=OFF ' . // disable openssl due to certificate issue
|
||||||
'-DCURL_ENABLE_SSL=ON ' .
|
'-DCURL_ENABLE_SSL=ON ' .
|
||||||
'-DUSE_NGHTTP2=ON ' . // enable nghttp2
|
'-DUSE_NGHTTP2=ON ' . // enable nghttp2
|
||||||
'-DCURL_USE_LIBSSH2=ON ' . // enable libssh2
|
'-DCURL_USE_LIBSSH2=ON ' . // enable libssh2
|
||||||
|
|||||||
27
src/SPC/builder/windows/library/postgresql_win.php
Normal file
27
src/SPC/builder/windows/library/postgresql_win.php
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace SPC\builder\windows\library;
|
||||||
|
|
||||||
|
class postgresql_win extends WindowsLibraryBase
|
||||||
|
{
|
||||||
|
public const NAME = 'postgresql-win';
|
||||||
|
|
||||||
|
protected function build(): void
|
||||||
|
{
|
||||||
|
copy($this->source_dir . '\pgsql\lib\libpq.lib', BUILD_LIB_PATH . '\libpq.lib');
|
||||||
|
copy($this->source_dir . '\pgsql\lib\libpgport.lib', BUILD_LIB_PATH . '\libpgport.lib');
|
||||||
|
copy($this->source_dir . '\pgsql\lib\libpgcommon.lib', BUILD_LIB_PATH . '\libpgcommon.lib');
|
||||||
|
|
||||||
|
// create libpq folder in buildroot/includes/libpq
|
||||||
|
if (!file_exists(BUILD_INCLUDE_PATH . '\libpq')) {
|
||||||
|
mkdir(BUILD_INCLUDE_PATH . '\libpq');
|
||||||
|
}
|
||||||
|
|
||||||
|
$headerFiles = ['libpq-fe.h', 'postgres_ext.h', 'pg_config_ext.h', 'libpq\libpq-fs.h'];
|
||||||
|
foreach ($headerFiles as $header) {
|
||||||
|
copy($this->source_dir . '\pgsql\include\\' . $header, BUILD_INCLUDE_PATH . '\\' . $header);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -3,3 +3,16 @@
|
|||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
assert(function_exists('curl_init'));
|
assert(function_exists('curl_init'));
|
||||||
|
assert(function_exists('curl_setopt'));
|
||||||
|
assert(function_exists('curl_exec'));
|
||||||
|
assert(function_exists('curl_close'));
|
||||||
|
$curl_version = curl_version();
|
||||||
|
if (stripos($curl_version['ssl_version'], 'schannel') !== false) {
|
||||||
|
$curl = curl_init();
|
||||||
|
curl_setopt($curl, CURLOPT_URL, 'https://example.com/');
|
||||||
|
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
|
||||||
|
curl_setopt($curl, CURLOPT_HEADER, 0);
|
||||||
|
$data = curl_exec($curl);
|
||||||
|
curl_close($curl);
|
||||||
|
assert($data !== false);
|
||||||
|
}
|
||||||
|
|||||||
@ -21,10 +21,10 @@ $test_php_version = [
|
|||||||
|
|
||||||
// test os (macos-13, macos-14, ubuntu-latest, windows-latest are available)
|
// test os (macos-13, macos-14, ubuntu-latest, windows-latest are available)
|
||||||
$test_os = [
|
$test_os = [
|
||||||
'macos-13',
|
// 'macos-13',
|
||||||
'macos-14',
|
// 'macos-14',
|
||||||
'ubuntu-latest',
|
'ubuntu-latest',
|
||||||
// 'windows-latest',
|
'windows-latest',
|
||||||
];
|
];
|
||||||
|
|
||||||
// whether enable thread safe
|
// whether enable thread safe
|
||||||
@ -40,21 +40,21 @@ $prefer_pre_built = false;
|
|||||||
|
|
||||||
// If you want to test your added extensions and libs, add below (comma separated, example `bcmath,openssl`).
|
// If you want to test your added extensions and libs, add below (comma separated, example `bcmath,openssl`).
|
||||||
$extensions = match (PHP_OS_FAMILY) {
|
$extensions = match (PHP_OS_FAMILY) {
|
||||||
'Linux', 'Darwin' => '',
|
'Linux', 'Darwin' => 'pgsql,pdo_pgsql',
|
||||||
'Windows' => 'bz2,ctype,curl,dom,filter,gd,iconv,mbstring,opcache,openssl,pdo,pdo_sqlite,phar,session,simplexml,sqlite3,tokenizer,xml,xmlwriter,yaml,zip,zlib',
|
'Windows' => 'pgsql,pdo_pgsql',
|
||||||
};
|
};
|
||||||
|
|
||||||
// If you want to test lib-suggests feature with extension, add them below (comma separated, example `libwebp,libavif`).
|
// If you want to test lib-suggests feature with extension, add them below (comma separated, example `libwebp,libavif`).
|
||||||
$with_libs = match (PHP_OS_FAMILY) {
|
$with_libs = match (PHP_OS_FAMILY) {
|
||||||
'Linux', 'Darwin' => 'mimalloc',
|
'Linux', 'Darwin' => '',
|
||||||
'Windows' => 'libjpeg,libavif,freetype,libwebp',
|
'Windows' => '',
|
||||||
};
|
};
|
||||||
|
|
||||||
// Please change your test base combination. We recommend testing with `common`.
|
// Please change your test base combination. We recommend testing with `common`.
|
||||||
// You can use `common`, `bulk`, `minimal` or `none`.
|
// You can use `common`, `bulk`, `minimal` or `none`.
|
||||||
// note: combination is only available for *nix platform. Windows must use `none` combination
|
// note: combination is only available for *nix platform. Windows must use `none` combination
|
||||||
$base_combination = match (PHP_OS_FAMILY) {
|
$base_combination = match (PHP_OS_FAMILY) {
|
||||||
'Linux', 'Darwin' => 'bulk',
|
'Linux', 'Darwin' => 'minimal',
|
||||||
'Windows' => 'none',
|
'Windows' => 'none',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user