mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-14 04:15:35 +08:00
Compare commits
4 Commits
2.8.2
...
1bbf83872f
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1bbf83872f | ||
|
|
fadb1ce6c9 | ||
|
|
58bf51e9c9 | ||
|
|
b60ea8e3d6 |
12
README-zh.md
12
README-zh.md
@@ -1,24 +1,24 @@
|
|||||||
# static-php-cli
|
# StaticPHP
|
||||||
|
|
||||||
[](README.md)
|
|
||||||
[](README-zh.md)
|
[](README-zh.md)
|
||||||
|
[](README.md)
|
||||||
[](https://github.com/crazywhalecc/static-php-cli/releases)
|
[](https://github.com/crazywhalecc/static-php-cli/releases)
|
||||||
[](https://github.com/crazywhalecc/static-php-cli/actions/workflows/tests.yml)
|
[](https://github.com/crazywhalecc/static-php-cli/actions/workflows/tests.yml)
|
||||||
[](https://github.com/crazywhalecc/static-php-cli/blob/main/LICENSE)
|
[](https://github.com/crazywhalecc/static-php-cli/blob/main/LICENSE)
|
||||||
|
|
||||||
**static-php-cli** 是一个用于构建静态、独立 PHP 运行时的强大工具,支持众多流行扩展。
|
**StaticPHP**(原名 **static-php-cli**)是一个用于构建静态、独立 PHP 运行时的强大工具,支持众多流行扩展。
|
||||||
|
|
||||||
## 特性
|
## 特性
|
||||||
|
|
||||||
- :elephant: **支持多 PHP 版本** - 支持 PHP 8.1, 8.2, 8.3, 8.4, 8.5
|
- :elephant: **支持多 PHP 版本** - 支持 PHP 8.1, 8.2, 8.3, 8.4, 8.5
|
||||||
- :handbag: **单文件 PHP 可执行文件** - 构建零依赖的独立 PHP
|
- :handbag: **单文件 PHP 可执行文件** - 构建零依赖的独立 PHP
|
||||||
- :hamburger: **phpmicro 集成** - 构建 **[phpmicro](https://github.com/dixyes/phpmicro)** 自解压可执行文件(将 PHP 二进制文件和源代码合并为一个文件)
|
- :hamburger: **phpmicro 集成** - 构建 **[phpmicro](https://github.com/static-php/phpmicro)** 自解压可执行文件(将 PHP 二进制文件和源代码合并为一个文件)
|
||||||
- :pill: **智能环境检查器** - 自动构建环境检查器,具备自动修复功能
|
- :pill: **智能环境检查器** - 自动构建环境检查器,具备自动修复功能
|
||||||
- :zap: **跨平台支持** - 支持 Linux、macOS、FreeBSD 和 Windows
|
- :zap: **跨平台支持** - 支持 Linux、macOS、FreeBSD 和 Windows
|
||||||
- :wrench: **可配置补丁** - 可自定义的源代码补丁系统
|
- :wrench: **可配置补丁** - 可自定义的源代码补丁系统
|
||||||
- :books: **智能依赖管理** - 自动处理构建依赖
|
- :books: **智能依赖管理** - 自动处理构建依赖
|
||||||
- 📦 **自包含工具** - 提供使用 [box](https://github.com/box-project/box) 构建的 `spc` 可执行文件
|
- 📦 **自包含工具** - 提供使用 [box](https://github.com/box-project/box) 构建的 `spc` 可执行文件
|
||||||
- :fire: **广泛的扩展支持** - 支持 75+ 流行 [扩展](https://static-php.dev/zh/guide/extensions.html)
|
- :fire: **广泛的扩展支持** - 支持 100+ 流行 [扩展](https://static-php.dev/zh/guide/extensions.html)
|
||||||
- :floppy_disk: **UPX 压缩** - 减小二进制文件大小 30-50%(仅 Linux/Windows)
|
- :floppy_disk: **UPX 压缩** - 减小二进制文件大小 30-50%(仅 Linux/Windows)
|
||||||
|
|
||||||
**单文件独立 php-cli:**
|
**单文件独立 php-cli:**
|
||||||
@@ -33,6 +33,8 @@
|
|||||||
|
|
||||||
### 1. 下载 spc 二进制文件
|
### 1. 下载 spc 二进制文件
|
||||||
|
|
||||||
|
`spc` 二进制文件是 StaticPHP 项目的 CLI 工具,打包为单个可执行文件。
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Linux x86_64
|
# Linux x86_64
|
||||||
curl -fsSL -o spc https://dl.static-php.dev/static-php-cli/spc-bin/nightly/spc-linux-x86_64
|
curl -fsSL -o spc https://dl.static-php.dev/static-php-cli/spc-bin/nightly/spc-linux-x86_64
|
||||||
|
|||||||
15
README.md
15
README.md
@@ -1,4 +1,4 @@
|
|||||||
# static-php-cli
|
# StaticPHP
|
||||||
|
|
||||||
[](README-zh.md)
|
[](README-zh.md)
|
||||||
[](README.md)
|
[](README.md)
|
||||||
@@ -6,14 +6,13 @@
|
|||||||
[](https://github.com/crazywhalecc/static-php-cli/actions/workflows/tests.yml)
|
[](https://github.com/crazywhalecc/static-php-cli/actions/workflows/tests.yml)
|
||||||
[](https://github.com/crazywhalecc/static-php-cli/blob/main/LICENSE)
|
[](https://github.com/crazywhalecc/static-php-cli/blob/main/LICENSE)
|
||||||
|
|
||||||
**static-php-cli** is a powerful tool designed for building static, standalone PHP runtime
|
**StaticPHP** (formerly **static-php-cli**) is a powerful tool designed for building static, standalone PHP runtime with popular extensions.
|
||||||
with popular extensions.
|
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
- :elephant: Support multiple PHP versions - PHP 8.1, 8.2, 8.3, 8.4, 8.5
|
- :elephant: Support multiple PHP versions - PHP 8.1, 8.2, 8.3, 8.4, 8.5
|
||||||
- :handbag: Build single-file PHP executable with zero dependencies
|
- :handbag: Build single-file PHP executable with zero dependencies
|
||||||
- :hamburger:Build **[phpmicro](https://github.com/dixyes/phpmicro)** self-extracting executables (combines PHP binary and source code into one file)
|
- :hamburger:Build **[phpmicro](https://github.com/static-php/phpmicro)** self-extracting executables (combines PHP binary and source code into one file)
|
||||||
- :pill: Automatic build environment checker with auto-fix capabilities
|
- :pill: Automatic build environment checker with auto-fix capabilities
|
||||||
- :zap: `Linux`, `macOS`, `FreeBSD`, `Windows` support
|
- :zap: `Linux`, `macOS`, `FreeBSD`, `Windows` support
|
||||||
- :wrench: Configurable source code patching
|
- :wrench: Configurable source code patching
|
||||||
@@ -34,6 +33,8 @@ with popular extensions.
|
|||||||
|
|
||||||
### 1. Download spc binary
|
### 1. Download spc binary
|
||||||
|
|
||||||
|
`spc` binary is StaticPHP CLI tool packaged as a single executable file.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# For Linux x86_64
|
# For Linux x86_64
|
||||||
curl -fsSL -o spc https://dl.static-php.dev/static-php-cli/spc-bin/nightly/spc-linux-x86_64
|
curl -fsSL -o spc https://dl.static-php.dev/static-php-cli/spc-bin/nightly/spc-linux-x86_64
|
||||||
@@ -53,7 +54,7 @@ For macOS and Linux, add execute permission first:
|
|||||||
chmod +x ./spc
|
chmod +x ./spc
|
||||||
```
|
```
|
||||||
|
|
||||||
### 2. Build Static PHP
|
### 2. Build standalone PHP binaries
|
||||||
|
|
||||||
First, create a `craft.yml` file and specify which extensions you want to include from [extension list](https://static-php.dev/en/guide/extensions.html) or [command generator](https://static-php.dev/en/guide/cli-generator.html):
|
First, create a `craft.yml` file and specify which extensions you want to include from [extension list](https://static-php.dev/en/guide/extensions.html) or [command generator](https://static-php.dev/en/guide/cli-generator.html):
|
||||||
|
|
||||||
@@ -79,7 +80,7 @@ Run command:
|
|||||||
./spc craft --debug
|
./spc craft --debug
|
||||||
```
|
```
|
||||||
|
|
||||||
### 3. Static PHP usage
|
### 3. Using the built binaries
|
||||||
|
|
||||||
Now you can copy binaries built by static-php-cli to another machine and run with no dependencies:
|
Now you can copy binaries built by static-php-cli to another machine and run with no dependencies:
|
||||||
|
|
||||||
@@ -105,7 +106,7 @@ see <https://static-php.dev> .
|
|||||||
|
|
||||||
If you don't want to build or want to test first, you can download example pre-compiled artifact from [Actions](https://github.com/static-php/static-php-cli-hosted/actions/workflows/build-php-bulk.yml), or from self-hosted server.
|
If you don't want to build or want to test first, you can download example pre-compiled artifact from [Actions](https://github.com/static-php/static-php-cli-hosted/actions/workflows/build-php-bulk.yml), or from self-hosted server.
|
||||||
|
|
||||||
Below are several precompiled static-php binaries with different extension combinations,
|
Below are several precompiled statically built php binaries with different extension combinations,
|
||||||
which can be downloaded directly according to your needs.
|
which can be downloaded directly according to your needs.
|
||||||
|
|
||||||
| Combination | Extension Count | OS | Comment |
|
| Combination | Extension Count | OS | Comment |
|
||||||
|
|||||||
@@ -358,6 +358,18 @@
|
|||||||
"liblz4"
|
"liblz4"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"maxminddb": {
|
||||||
|
"support": {
|
||||||
|
"BSD": "wip",
|
||||||
|
"Windows": "wip"
|
||||||
|
},
|
||||||
|
"type": "external",
|
||||||
|
"source": "ext-maxminddb",
|
||||||
|
"arg-type": "with",
|
||||||
|
"lib-depends": [
|
||||||
|
"libmaxminddb"
|
||||||
|
]
|
||||||
|
},
|
||||||
"mbregex": {
|
"mbregex": {
|
||||||
"type": "builtin",
|
"type": "builtin",
|
||||||
"arg-type": "custom",
|
"arg-type": "custom",
|
||||||
|
|||||||
@@ -506,6 +506,16 @@
|
|||||||
"liblz4.a"
|
"liblz4.a"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"libmaxminddb": {
|
||||||
|
"source": "libmaxminddb",
|
||||||
|
"static-libs-unix": [
|
||||||
|
"libmaxminddb.a"
|
||||||
|
],
|
||||||
|
"headers": [
|
||||||
|
"maxminddb.h",
|
||||||
|
"maxminddb_config.h"
|
||||||
|
]
|
||||||
|
},
|
||||||
"libmemcached": {
|
"libmemcached": {
|
||||||
"source": "libmemcached",
|
"source": "libmemcached",
|
||||||
"cpp-library": true,
|
"cpp-library": true,
|
||||||
|
|||||||
@@ -184,6 +184,15 @@
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"ext-maxminddb": {
|
||||||
|
"type": "url",
|
||||||
|
"url": "https://pecl.php.net/get/maxminddb",
|
||||||
|
"filename": "ext-maxminddb.tgz",
|
||||||
|
"license": {
|
||||||
|
"type": "file",
|
||||||
|
"path": "LICENSE"
|
||||||
|
}
|
||||||
|
},
|
||||||
"ext-memcache": {
|
"ext-memcache": {
|
||||||
"type": "url",
|
"type": "url",
|
||||||
"url": "https://pecl.php.net/get/memcache",
|
"url": "https://pecl.php.net/get/memcache",
|
||||||
@@ -641,6 +650,16 @@
|
|||||||
"path": "LICENSE"
|
"path": "LICENSE"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"libmaxminddb": {
|
||||||
|
"type": "ghrel",
|
||||||
|
"repo": "maxmind/libmaxminddb",
|
||||||
|
"match": "libmaxminddb-.+\\.tar\\.gz",
|
||||||
|
"prefer-stable": true,
|
||||||
|
"license": {
|
||||||
|
"type": "file",
|
||||||
|
"path": "LICENSE"
|
||||||
|
}
|
||||||
|
},
|
||||||
"libmemcached": {
|
"libmemcached": {
|
||||||
"type": "ghtagtar",
|
"type": "ghtagtar",
|
||||||
"repo": "awesomized/libmemcached",
|
"repo": "awesomized/libmemcached",
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import sidebarZh from "./sidebar.zh";
|
|||||||
|
|
||||||
// https://vitepress.dev/reference/site-config
|
// https://vitepress.dev/reference/site-config
|
||||||
export default {
|
export default {
|
||||||
title: "Static PHP",
|
title: "StaticPHP",
|
||||||
description: "Build single static PHP binary, with PHP project together, with popular extensions included.",
|
description: "Build single static PHP binary, with PHP project together, with popular extensions included.",
|
||||||
locales: {
|
locales: {
|
||||||
en: {
|
en: {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# Guide
|
# Guide
|
||||||
|
|
||||||
Static php cli is a tool used to build statically compiled PHP binaries,
|
StaticPHP is a tool used to build statically compiled PHP binaries,
|
||||||
currently supporting Linux and macOS systems.
|
currently supporting Linux and macOS systems.
|
||||||
|
|
||||||
In the guide section, you will learn how to use static php cli to build standalone PHP programs.
|
In the guide section, you will learn how to use static php cli to build standalone PHP programs.
|
||||||
@@ -15,11 +15,13 @@ The following is the architecture support situation, where :gear: represents sup
|
|||||||
:computer: represents support for local manual build, and empty represents temporarily not supported.
|
:computer: represents support for local manual build, and empty represents temporarily not supported.
|
||||||
|
|
||||||
| | x86_64 | aarch64 |
|
| | x86_64 | aarch64 |
|
||||||
|---------|-------------------|-------------------|
|
|---------|------------------------|------------------------|
|
||||||
| macOS | :gear: :computer: | :gear: :computer: |
|
| macOS | :gear: :computer: | :gear: :computer: |
|
||||||
| Linux | :gear: :computer: | :gear: :computer: |
|
| Linux | :gear: :computer: | :gear: :computer: |
|
||||||
| Windows | :gear: :computer: | |
|
| Windows | :gear: :computer: | |
|
||||||
| FreeBSD | :computer: | :computer: |
|
| FreeBSD | :computer: (:warning:) | :computer: (:warning:) |
|
||||||
|
|
||||||
|
> Due to lack of users and testing, FreeBSD is no longer supported in latest StaticPHP project.
|
||||||
|
|
||||||
Current supported PHP versions for compilation:
|
Current supported PHP versions for compilation:
|
||||||
|
|
||||||
@@ -30,16 +32,16 @@ Current supported PHP versions for compilation:
|
|||||||
> :x: Not supported
|
> :x: Not supported
|
||||||
|
|
||||||
| PHP Version | Status | Comment |
|
| PHP Version | Status | Comment |
|
||||||
|-------------|--------------------|-------------------------------------------------------------------------------------------------------------------------|
|
|-------------|--------------------|--------------------------------------------------------------------------------------------|
|
||||||
| 7.2 | :x: | |
|
| 7.2 | :x: | |
|
||||||
| 7.3 | :x: | phpmicro and many extensions do not support 7.3, 7.4 versions |
|
| 7.3 | :x: | phpmicro and many extensions do not support 7.3, 7.4 versions |
|
||||||
| 7.4 | :x: | phpmicro and many extensions do not support 7.3, 7.4 versions |
|
| 7.4 | :x: | phpmicro and many extensions do not support 7.3, 7.4 versions |
|
||||||
| 8.0 | :warning: | PHP official has stopped maintaining 8.0, we no longer handle 8.0 related backport support |
|
| 8.0 | :warning: | PHP official has stopped maintaining 8.0, we no longer handle 8.0 related backport support |
|
||||||
| 8.1 | :warning: | PHP official only provides security updates for 8.1, we no longer handle 8.1 related backport support after 8.5 release |
|
| 8.1 | :warning: | PHP official only provides security updates for 8.1 |
|
||||||
| 8.2 | :heavy_check_mark: | |
|
| 8.2 | :heavy_check_mark: | |
|
||||||
| 8.3 | :heavy_check_mark: | |
|
| 8.3 | :heavy_check_mark: | |
|
||||||
| 8.4 | :heavy_check_mark: | |
|
| 8.4 | :heavy_check_mark: | |
|
||||||
| 8.5 (beta) | :warning: | PHP 8.5 is currently in beta stage |
|
| 8.5 | :heavy_check_mark: | |
|
||||||
|
|
||||||
> This table shows the support status of static-php-cli for building corresponding versions, not the PHP official support status for that version.
|
> This table shows the support status of static-php-cli for building corresponding versions, not the PHP official support status for that version.
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
layout: home
|
layout: home
|
||||||
|
|
||||||
hero:
|
hero:
|
||||||
name: "Static PHP"
|
name: "StaticPHP"
|
||||||
tagline: "Build standalone PHP binary on Linux, macOS, FreeBSD, Windows, with PHP project together, with popular extensions included."
|
tagline: "Build standalone PHP binary on Linux, macOS, FreeBSD, Windows, with PHP project together, with popular extensions included."
|
||||||
image:
|
image:
|
||||||
src: /images/static-php_nobg.png
|
src: /images/static-php_nobg.png
|
||||||
@@ -14,9 +14,9 @@ hero:
|
|||||||
link: ./guide/
|
link: ./guide/
|
||||||
|
|
||||||
features:
|
features:
|
||||||
- title: Static CLI Binary
|
- title: Static PHP Binary
|
||||||
details: You can easily compile a standalone php binary for general use. Including CLI, FPM sapi.
|
details: You can easily compile a standalone php binary for general use. Including CLI, FPM sapi.
|
||||||
- title: Micro Self-Extracted Executable
|
- title: PHP micro Self-Extracted Executable
|
||||||
details: You can compile a self-extracted executable and build with your php source code.
|
details: You can compile a self-extracted executable and build with your php source code.
|
||||||
- title: Dependency Management
|
- title: Dependency Management
|
||||||
details: static-php-cli comes with dependency management and supports installation of different types of PHP extensions.
|
details: static-php-cli comes with dependency management and supports installation of different types of PHP extensions.
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
layout: home
|
layout: home
|
||||||
|
|
||||||
hero:
|
hero:
|
||||||
name: "Static PHP"
|
name: "StaticPHP"
|
||||||
tagline: "Build standalone PHP binary on Linux, macOS, FreeBSD, Windows, with PHP project together, with popular extensions included."
|
tagline: "Build standalone PHP binary on Linux, macOS, FreeBSD, Windows, with PHP project together, with popular extensions included."
|
||||||
image:
|
image:
|
||||||
src: /images/static-php_nobg.png
|
src: /images/static-php_nobg.png
|
||||||
|
|||||||
@@ -13,11 +13,13 @@ static-php-cli 是一个用于构建静态编译的 PHP 二进制的工具,目
|
|||||||
下面是架构支持情况,:gear: 代表支持 GitHub Action 构建,:computer: 代表支持本地构建,空 代表暂不支持。
|
下面是架构支持情况,:gear: 代表支持 GitHub Action 构建,:computer: 代表支持本地构建,空 代表暂不支持。
|
||||||
|
|
||||||
| | x86_64 | aarch64 |
|
| | x86_64 | aarch64 |
|
||||||
|---------|-------------------|-------------------|
|
|---------|------------------------|------------------------|
|
||||||
| macOS | :gear: :computer: | :gear: :computer: |
|
| macOS | :gear: :computer: | :gear: :computer: |
|
||||||
| Linux | :gear: :computer: | :gear: :computer: |
|
| Linux | :gear: :computer: | :gear: :computer: |
|
||||||
| Windows | :gear: :computer: | |
|
| Windows | :gear: :computer: | |
|
||||||
| FreeBSD | :computer: | :computer: |
|
| FreeBSD | :computer: (:warning:) | :computer: (:warning:) |
|
||||||
|
|
||||||
|
> 由于缺乏用户和测试,FreeBSD 在最新的 StaticPHP 项目中不再受支持。
|
||||||
|
|
||||||
当前支持编译的 PHP 版本:
|
当前支持编译的 PHP 版本:
|
||||||
|
|
||||||
@@ -28,16 +30,16 @@ static-php-cli 是一个用于构建静态编译的 PHP 二进制的工具,目
|
|||||||
> :x: 不支持
|
> :x: 不支持
|
||||||
|
|
||||||
| PHP Version | Status | Comment |
|
| PHP Version | Status | Comment |
|
||||||
|-------------|--------------------|---------------------------------------------------------|
|
|-------------|--------------------|----------------------------------------------|
|
||||||
| 7.2 | :x: | |
|
| 7.2 | :x: | |
|
||||||
| 7.3 | :x: | phpmicro 和许多扩展不支持 7.3、7.4 版本 |
|
| 7.3 | :x: | phpmicro 和许多扩展不支持 7.3、7.4 版本 |
|
||||||
| 7.4 | :x: | phpmicro 和许多扩展不支持 7.3、7.4 版本 |
|
| 7.4 | :x: | phpmicro 和许多扩展不支持 7.3、7.4 版本 |
|
||||||
| 8.0 | :warning: | PHP 官方已停止 8.0 的维护,我们不再处理 8.0 相关的 backport 支持 |
|
| 8.0 | :warning: | PHP 官方已停止 8.0 的维护,我们不再处理 8.0 相关的 backport 支持 |
|
||||||
| 8.1 | :warning: | PHP 官方仅对 8.1 提供安全更新,在 8.5 发布后我们不再处理 8.1 相关的 backport 支持 |
|
| 8.1 | :warning: | PHP 官方仅对 8.1 提供安全更新 |
|
||||||
| 8.2 | :heavy_check_mark: | |
|
| 8.2 | :heavy_check_mark: | |
|
||||||
| 8.3 | :heavy_check_mark: | |
|
| 8.3 | :heavy_check_mark: | |
|
||||||
| 8.4 | :heavy_check_mark: | |
|
| 8.4 | :heavy_check_mark: | |
|
||||||
| 8.5 (beta) | :warning: | PHP 8.5 目前处于 beta 阶段 |
|
| 8.5 | :heavy_check_mark: | |
|
||||||
|
|
||||||
> 这个表格的支持状态是 static-php-cli 对构建对应版本的支持情况,不是 PHP 官方对该版本的支持情况。
|
> 这个表格的支持状态是 static-php-cli 对构建对应版本的支持情况,不是 PHP 官方对该版本的支持情况。
|
||||||
|
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ use Symfony\Component\Console\Application;
|
|||||||
*/
|
*/
|
||||||
final class ConsoleApplication extends Application
|
final class ConsoleApplication extends Application
|
||||||
{
|
{
|
||||||
public const string VERSION = '2.7.7';
|
public const string VERSION = '2.7.8';
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
|
|||||||
26
src/SPC/builder/extension/maxminddb.php
Normal file
26
src/SPC/builder/extension/maxminddb.php
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace SPC\builder\extension;
|
||||||
|
|
||||||
|
use SPC\builder\Extension;
|
||||||
|
use SPC\util\CustomExt;
|
||||||
|
|
||||||
|
#[CustomExt('maxminddb')]
|
||||||
|
class maxminddb extends Extension
|
||||||
|
{
|
||||||
|
public function patchBeforeBuildconf(): bool
|
||||||
|
{
|
||||||
|
if (!is_link(SOURCE_PATH . '/php-src/ext/maxminddb')) {
|
||||||
|
$original = $this->source_dir;
|
||||||
|
if (PHP_OS_FAMILY === 'Windows') {
|
||||||
|
f_passthru('cd ' . SOURCE_PATH . '/php-src/ext && mklink /D maxminddb ' . $original . '\ext');
|
||||||
|
} else {
|
||||||
|
f_passthru('cd ' . SOURCE_PATH . '/php-src/ext && ln -s ' . $original . '/ext maxminddb');
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
12
src/SPC/builder/linux/library/libmaxminddb.php
Normal file
12
src/SPC/builder/linux/library/libmaxminddb.php
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace SPC\builder\linux\library;
|
||||||
|
|
||||||
|
class libmaxminddb extends LinuxLibraryBase
|
||||||
|
{
|
||||||
|
use \SPC\builder\unix\library\libmaxminddb;
|
||||||
|
|
||||||
|
public const NAME = 'libmaxminddb';
|
||||||
|
}
|
||||||
12
src/SPC/builder/macos/library/libmaxminddb.php
Normal file
12
src/SPC/builder/macos/library/libmaxminddb.php
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace SPC\builder\macos\library;
|
||||||
|
|
||||||
|
class libmaxminddb extends MacOSLibraryBase
|
||||||
|
{
|
||||||
|
use \SPC\builder\unix\library\libmaxminddb;
|
||||||
|
|
||||||
|
public const NAME = 'libmaxminddb';
|
||||||
|
}
|
||||||
20
src/SPC/builder/unix/library/libmaxminddb.php
Normal file
20
src/SPC/builder/unix/library/libmaxminddb.php
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace SPC\builder\unix\library;
|
||||||
|
|
||||||
|
use SPC\util\executor\UnixCMakeExecutor;
|
||||||
|
|
||||||
|
trait libmaxminddb
|
||||||
|
{
|
||||||
|
protected function build(): void
|
||||||
|
{
|
||||||
|
UnixCMakeExecutor::create($this)
|
||||||
|
->addConfigureArgs(
|
||||||
|
'-DBUILD_TESTING=OFF',
|
||||||
|
'-DMAXMINDDB_BUILD_BINARIES=OFF',
|
||||||
|
)
|
||||||
|
->build();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -13,11 +13,11 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
// test php version (8.1 ~ 8.4 available, multiple for matrix)
|
// test php version (8.1 ~ 8.4 available, multiple for matrix)
|
||||||
$test_php_version = [
|
$test_php_version = [
|
||||||
// '8.1',
|
'8.1',
|
||||||
// '8.2',
|
'8.2',
|
||||||
// '8.3',
|
'8.3',
|
||||||
'8.4',
|
'8.4',
|
||||||
// '8.5',
|
'8.5',
|
||||||
// 'git',
|
// 'git',
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -35,7 +35,7 @@ $test_os = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
// whether enable thread safe
|
// whether enable thread safe
|
||||||
$zts = true;
|
$zts = false;
|
||||||
|
|
||||||
$no_strip = false;
|
$no_strip = false;
|
||||||
|
|
||||||
@@ -50,7 +50,7 @@ $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' => 'curl',
|
'Linux', 'Darwin' => 'maxminddb',
|
||||||
'Windows' => 'bcmath',
|
'Windows' => 'bcmath',
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -62,7 +62,7 @@ $shared_extensions = match (PHP_OS_FAMILY) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// If you want to test lib-suggests for all extensions and libraries, set it to true.
|
// If you want to test lib-suggests for all extensions and libraries, set it to true.
|
||||||
$with_suggested_libs = true;
|
$with_suggested_libs = false;
|
||||||
|
|
||||||
// If you want to test extra libs for extensions, add them below (comma separated, example `libwebp,libavif`). Unnecessary, when $with_suggested_libs is true.
|
// If you want to test extra libs for extensions, add them below (comma separated, example `libwebp,libavif`). Unnecessary, when $with_suggested_libs is true.
|
||||||
$with_libs = match (PHP_OS_FAMILY) {
|
$with_libs = match (PHP_OS_FAMILY) {
|
||||||
@@ -74,7 +74,7 @@ $with_libs = match (PHP_OS_FAMILY) {
|
|||||||
// 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' => 'none',
|
'Linux', 'Darwin' => 'minimal',
|
||||||
'Windows' => 'none',
|
'Windows' => 'none',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user