mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-08 09:25:35 +08:00
deploy: 6b227d88ac
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import{_ as s,c as i,o as e,a1 as a}from"./chunks/framework.gjrnbxUT.js";const u=JSON.parse('{"title":"Build (Linux, macOS, FreeBSD)","description":"","frontmatter":{},"headers":[],"relativePath":"en/guide/manual-build.md","filePath":"en/guide/manual-build.md"}'),n={name:"en/guide/manual-build.md"},t=a(`<h1 id="build-linux-macos-freebsd" tabindex="-1">Build (Linux, macOS, FreeBSD) <a class="header-anchor" href="#build-linux-macos-freebsd" aria-label="Permalink to "Build (Linux, macOS, FreeBSD)""></a></h1><p>This section covers the build process for Linux, macOS, and FreeBSD. If you want to build on Windows, also need to read <a href="./build-on-windows.html">Build on Windows</a>.</p><h3 id="build-locally-using-spc-binary-recommended" tabindex="-1">Build locally (using SPC binary) (recommended) <a class="header-anchor" href="#build-locally-using-spc-binary-recommended" aria-label="Permalink to "Build locally (using SPC binary) (recommended)""></a></h3><p>This project provides a binary file of static-php-cli. You can directly download the binary file of the corresponding platform and then use it to build static PHP. Currently, the platforms supported by <code>spc</code> binary are Linux and macOS.</p><p>Here's how to download from self-hosted server:</p><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># Download from self-hosted nightly builds (sync with main branch)</span></span>
|
||||
import{_ as s,c as i,o as a,a1 as e}from"./chunks/framework.gjrnbxUT.js";const u=JSON.parse('{"title":"Build (Linux, macOS, FreeBSD)","description":"","frontmatter":{},"headers":[],"relativePath":"en/guide/manual-build.md","filePath":"en/guide/manual-build.md"}'),n={name:"en/guide/manual-build.md"},t=e(`<h1 id="build-linux-macos-freebsd" tabindex="-1">Build (Linux, macOS, FreeBSD) <a class="header-anchor" href="#build-linux-macos-freebsd" aria-label="Permalink to "Build (Linux, macOS, FreeBSD)""></a></h1><p>This section covers the build process for Linux, macOS, and FreeBSD. If you want to build on Windows, also need to read <a href="./build-on-windows.html">Build on Windows</a>.</p><h3 id="build-locally-using-spc-binary-recommended" tabindex="-1">Build locally (using SPC binary) (recommended) <a class="header-anchor" href="#build-locally-using-spc-binary-recommended" aria-label="Permalink to "Build locally (using SPC binary) (recommended)""></a></h3><p>This project provides a binary file of static-php-cli. You can directly download the binary file of the corresponding platform and then use it to build static PHP. Currently, the platforms supported by <code>spc</code> binary are Linux and macOS.</p><p>Here's how to download from self-hosted server:</p><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># Download from self-hosted nightly builds (sync with main branch)</span></span>
|
||||
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># For Linux x86_64</span></span>
|
||||
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">curl</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -fsSL</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -o</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> spc</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> https://dl.static-php.dev/static-php-cli/spc-bin/nightly/spc-linux-x86_64</span></span>
|
||||
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># For Linux aarch64</span></span>
|
||||
@@ -113,7 +113,23 @@ import{_ as s,c as i,o as e,a1 as a}from"./chunks/framework.gjrnbxUT.js";const u
|
||||
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">bin/spc</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> micro:combine</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> a.php</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -N</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> /path/to/your/custom.ini</span></span></code></pre></div><div class="warning custom-block"><p class="custom-block-title">WARNING</p><p>Note, please do not directly use the PHP source code or the <code>php.ini</code> file in the system-installed PHP, it is best to manually write an ini configuration file that you need, for example:</p><div class="language-ini vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ini</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">; custom.ini</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">curl.cainfo</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">=/path/to/your/cafile.pem</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">memory_limit</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">=1G</span></span></code></pre></div><p>The ini injection of this command is achieved by appending a special structure after micro.sfx, which is different from the function of inserting hard-coded INI during compilation.</p></div><p>If you want to package phar, just replace <code>a.php</code> with the packaged phar file. But please note that micro.sfx under phar needs extra attention to the path problem, see <a href="./../develop/structure.html#phar-application-directory-issue">Developing - Phar directory issue</a>.</p><h2 id="command-extract" tabindex="-1">Command - extract <a class="header-anchor" href="#command-extract" aria-label="Permalink to "Command - extract""></a></h2><p>Use the command <code>bin/spc extract</code> to unpack and copy the source code required for compilation, including php-src and the source code of various dependent libraries (you need to specify the name of the library to be unpacked).</p><p>For example, after we have downloaded sources, we want to distribute and execute the build process, manually unpack and copy the package to a specified location, and we can use commands.</p><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># Unzip the downloaded compressed package of php-src and libxml2, and store the decompressed source code in the source directory</span></span>
|
||||
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">bin/spc</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> extract</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> php-src,libxml2</span></span></code></pre></div><h2 id="dev-command-dev" tabindex="-1">Dev Command - dev <a class="header-anchor" href="#dev-command-dev" aria-label="Permalink to "Dev Command - dev""></a></h2><p>Debug commands refer to a collection of commands that can assist in outputting some information when you use static-php-cli to build PHP or modify and enhance the static-php-cli project itself.</p><ul><li><code>dev:extensions</code>: output all currently supported extension names, or output the specified extension information</li><li><code>dev:php-version</code>: output the currently compiled PHP version (by reading <code>php_version.h</code>)</li><li><code>dev:sort-config</code>: Sort the list of configuration files in the <code>config/</code> directory in alphabetical order</li><li><code>dev:lib-ver <lib-name></code>: Read the version from the source code of the dependency library (only available for specific dependency libraries)</li><li><code>dev:ext-ver <ext-name></code>: Read the corresponding version from the source code of the extension (only available for specific extensions)</li><li><code>dev:pack-lib <lib-name></code>: Package the specified library into a tar.gz file (maintainer only)</li><li><code>dev:gen-ext-docs</code>: Generate extension documentation (maintainer only)</li></ul><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># output all extensions information</span></span>
|
||||
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">bin/spc</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> extract</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> php-src,libxml2</span></span></code></pre></div><h2 id="command-dump-extensions" tabindex="-1">Command - dump-extensions <a class="header-anchor" href="#command-dump-extensions" aria-label="Permalink to "Command - dump-extensions""></a></h2><p>Use the command <code>bin/spc dump-extensions</code> to export required extensions of the current project.</p><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># Print the extension list of the project, pass in the root directory of the project containing composer.json</span></span>
|
||||
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">bin/spc</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> dump-extensions</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> /path/to/your/project/</span></span>
|
||||
<span class="line"></span>
|
||||
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># Print the extension list of the project, excluding development dependencies</span></span>
|
||||
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">bin/spc</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> dump-extensions</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> /path-to/tour/project/</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --no-dev</span></span>
|
||||
<span class="line"></span>
|
||||
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># Output in the extension list format acceptable to the spc command (comma separated)</span></span>
|
||||
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">bin/spc</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> dump-extensions</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> /path-to/tour/project/</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --format=text</span></span>
|
||||
<span class="line"></span>
|
||||
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># Output as a JSON list</span></span>
|
||||
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">bin/spc</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> dump-extensions</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> /path-to/tour/project/</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --format=json</span></span>
|
||||
<span class="line"></span>
|
||||
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># When the project does not have any extensions, output the specified extension combination instead of returning failure</span></span>
|
||||
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">bin/spc</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> dump-extensions</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> /path-to/your/project/</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --no-ext-output=mbstring,posix,pcntl,phar</span></span>
|
||||
<span class="line"></span>
|
||||
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># Do not exclude extensions not supported by spc when outputting</span></span>
|
||||
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">bin/spc</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> dump-extensions</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> /path/to/your/project/</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --no-spc-filter</span></span></code></pre></div><p>It should be noted that the project directory must contain the <code>vendor/installed.json</code> and <code>composer.lock</code> files, otherwise they cannot be found normally.</p><h2 id="dev-command-dev" tabindex="-1">Dev Command - dev <a class="header-anchor" href="#dev-command-dev" aria-label="Permalink to "Dev Command - dev""></a></h2><p>Debug commands refer to a collection of commands that can assist in outputting some information when you use static-php-cli to build PHP or modify and enhance the static-php-cli project itself.</p><ul><li><code>dev:extensions</code>: output all currently supported extension names, or output the specified extension information</li><li><code>dev:php-version</code>: output the currently compiled PHP version (by reading <code>php_version.h</code>)</li><li><code>dev:sort-config</code>: Sort the list of configuration files in the <code>config/</code> directory in alphabetical order</li><li><code>dev:lib-ver <lib-name></code>: Read the version from the source code of the dependency library (only available for specific dependency libraries)</li><li><code>dev:ext-ver <ext-name></code>: Read the corresponding version from the source code of the extension (only available for specific extensions)</li><li><code>dev:pack-lib <lib-name></code>: Package the specified library into a tar.gz file (maintainer only)</li><li><code>dev:gen-ext-docs</code>: Generate extension documentation (maintainer only)</li></ul><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># output all extensions information</span></span>
|
||||
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">bin/spc</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> dev:extensions</span></span>
|
||||
<span class="line"></span>
|
||||
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># Output the meta information of the specified extension</span></span>
|
||||
@@ -176,4 +192,4 @@ import{_ as s,c as i,o as e,a1 as a}from"./chunks/framework.gjrnbxUT.js";const u
|
||||
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">clang</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> embed.c</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> $(</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">bin/spc</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> spc-config</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> bcmath,zlib</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">-o</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> embed</span></span>
|
||||
<span class="line"></span>
|
||||
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">./embed</span></span>
|
||||
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># out: Hello world!</span></span></code></pre></div>`,119),l=[t];function p(o,h,d,c,r,k){return e(),i("div",null,l)}const F=s(n,[["render",p]]);export{u as __pageData,F as default};
|
||||
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># out: Hello world!</span></span></code></pre></div>`,123),l=[t];function p(o,h,d,c,r,k){return a(),i("div",null,l)}const F=s(n,[["render",p]]);export{u as __pageData,F as default};
|
||||
@@ -1 +1 @@
|
||||
import{_ as s,c as i,o as e,a1 as a}from"./chunks/framework.gjrnbxUT.js";const u=JSON.parse('{"title":"Build (Linux, macOS, FreeBSD)","description":"","frontmatter":{},"headers":[],"relativePath":"en/guide/manual-build.md","filePath":"en/guide/manual-build.md"}'),n={name:"en/guide/manual-build.md"},t=a("",119),l=[t];function p(o,h,d,c,r,k){return e(),i("div",null,l)}const F=s(n,[["render",p]]);export{u as __pageData,F as default};
|
||||
import{_ as s,c as i,o as a,a1 as e}from"./chunks/framework.gjrnbxUT.js";const u=JSON.parse('{"title":"Build (Linux, macOS, FreeBSD)","description":"","frontmatter":{},"headers":[],"relativePath":"en/guide/manual-build.md","filePath":"en/guide/manual-build.md"}'),n={name:"en/guide/manual-build.md"},t=e("",123),l=[t];function p(o,h,d,c,r,k){return a(),i("div",null,l)}const F=s(n,[["render",p]]);export{u as __pageData,F as default};
|
||||
File diff suppressed because one or more lines are too long
@@ -111,7 +111,23 @@ import{_ as s,c as i,o as a,a1 as n}from"./chunks/framework.gjrnbxUT.js";const g
|
||||
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">bin/spc</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> micro:combine</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> a.php</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -N</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> /path/to/your/custom.ini</span></span></code></pre></div><div class="warning custom-block"><p class="custom-block-title">WARNING</p><p>注意,请不要直接使用 PHP 源码或系统安装的 PHP 中的 <code>php.ini</code> 文件,最好手动编写一个自己需要的参数配置文件,例如:</p><div class="language-ini vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ini</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">; custom.ini</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">curl.cainfo</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">=/path/to/your/cafile.pem</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">memory_limit</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">=1G</span></span></code></pre></div><p>该命令的注入 ini 是通过在 micro.sfx 后追加一段特殊的结构来实现的,和编译时插入硬编码 INI 的功能不同。</p></div><p>如果要打包 phar,只需要将 <code>a.php</code> 替换为打包好的 phar 文件即可。但要注意,phar 下的 micro.sfx 需要额外注意路径问题,见 <a href="./../develop/structure.html#phar-应用目录问题">Developing - Phar 路径问题</a></p><h2 id="命令-extract-手动解压某个库" tabindex="-1">命令 extract - 手动解压某个库 <a class="header-anchor" href="#命令-extract-手动解压某个库" aria-label="Permalink to "命令 extract - 手动解压某个库""></a></h2><p>使用命令 <code>bin/spc extract</code> 可以解包和拷贝编译需要的源代码,包括 php-src 以及依赖的各种库的源码(需要自己指定要解包的库名)。</p><p>例如,我们在下载好资源后,想分布执行构建流程,手动解包和拷贝包到指定位置,可以使用命令。</p><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># 解压 php-src 和 libxml2 的下载压缩包,解压的源码存放在 source 目录</span></span>
|
||||
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">bin/spc</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> extract</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> php-src,libxml2</span></span></code></pre></div><h2 id="调试命令-dev-调试命令集合" tabindex="-1">调试命令 dev - 调试命令集合 <a class="header-anchor" href="#调试命令-dev-调试命令集合" aria-label="Permalink to "调试命令 dev - 调试命令集合""></a></h2><p>调试命令指的是你在使用 static-php-cli 构建 PHP 或改造、增强 static-php-cli 项目本身的时候,可以辅助输出一些信息的命令集合。</p><ul><li><code>dev:extensions</code>: 输出目前所有支持的扩展信息,或者输出指定的扩展信息</li><li><code>dev:php-version</code>: 输出当前编译的 PHP 版本(通过读取 <code>php_version.h</code> 实现)</li><li><code>dev:sort-config</code>: 对 <code>config/</code> 目录下的配置文件的列表按照字母表排序</li><li><code>dev:lib-ver <lib-name></code>: 从依赖库的源码中读取版本(仅特定依赖库可用)</li><li><code>dev:ext-ver <ext-name></code>: 从扩展的源码中读取对应版本(仅特定扩展可用)</li><li><code>dev:pack-lib <lib-name></code>: 打包指定的依赖库(仅发布者可用)</li><li><code>dev:gen-ext-docs</code>: 生成扩展文档(仅发布者可用)</li></ul><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># 输出所有扩展</span></span>
|
||||
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">bin/spc</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> extract</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> php-src,libxml2</span></span></code></pre></div><h2 id="命令-dump-extensions-导出项目扩展依赖" tabindex="-1">命令 dump-extensions - 导出项目扩展依赖 <a class="header-anchor" href="#命令-dump-extensions-导出项目扩展依赖" aria-label="Permalink to "命令 dump-extensions - 导出项目扩展依赖""></a></h2><p>使用命令 <code>bin/spc dump-extensions</code> 可以导出当前项目的扩展依赖。</p><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># 打印项目的扩展列表,传入项目包含composer.json的根目录</span></span>
|
||||
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">bin/spc</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> dump-extensions</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> /path/to/your/project/</span></span>
|
||||
<span class="line"></span>
|
||||
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># 打印项目的扩展列表,不包含开发依赖</span></span>
|
||||
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">bin/spc</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> dump-extensions</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> /path-to/tour/project/</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --no-dev</span></span>
|
||||
<span class="line"></span>
|
||||
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># 输出为 spc 命令可接受的扩展列表格式(逗号分割)</span></span>
|
||||
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">bin/spc</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> dump-extensions</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> /path-to/tour/project/</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --format=text</span></span>
|
||||
<span class="line"></span>
|
||||
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># 输出为 JSON 列表</span></span>
|
||||
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">bin/spc</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> dump-extensions</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> /path-to/tour/project/</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --format=json</span></span>
|
||||
<span class="line"></span>
|
||||
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># 当项目没有任何扩展时,输出指定扩展组合,而不是返回失败</span></span>
|
||||
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">bin/spc</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> dump-extensions</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> /path-to/your/project/</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --no-ext-output=mbstring,posix,pcntl,phar</span></span>
|
||||
<span class="line"></span>
|
||||
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># 输出时不排除 spc 不支持的扩展</span></span>
|
||||
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">bin/spc</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> dump-extensions</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> /path/to/your/project/</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --no-spc-filter</span></span></code></pre></div><p>需要注意的是,项目的目录下必须包含 <code>vendor/installed.json</code> 和 <code>composer.lock</code> 文件,否则无法正常获取。</p><h2 id="调试命令-dev-调试命令集合" tabindex="-1">调试命令 dev - 调试命令集合 <a class="header-anchor" href="#调试命令-dev-调试命令集合" aria-label="Permalink to "调试命令 dev - 调试命令集合""></a></h2><p>调试命令指的是你在使用 static-php-cli 构建 PHP 或改造、增强 static-php-cli 项目本身的时候,可以辅助输出一些信息的命令集合。</p><ul><li><code>dev:extensions</code>: 输出目前所有支持的扩展信息,或者输出指定的扩展信息</li><li><code>dev:php-version</code>: 输出当前编译的 PHP 版本(通过读取 <code>php_version.h</code> 实现)</li><li><code>dev:sort-config</code>: 对 <code>config/</code> 目录下的配置文件的列表按照字母表排序</li><li><code>dev:lib-ver <lib-name></code>: 从依赖库的源码中读取版本(仅特定依赖库可用)</li><li><code>dev:ext-ver <ext-name></code>: 从扩展的源码中读取对应版本(仅特定扩展可用)</li><li><code>dev:pack-lib <lib-name></code>: 打包指定的依赖库(仅发布者可用)</li><li><code>dev:gen-ext-docs</code>: 生成扩展文档(仅发布者可用)</li></ul><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># 输出所有扩展</span></span>
|
||||
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">bin/spc</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> dev:extensions</span></span>
|
||||
<span class="line"></span>
|
||||
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># 输出指定扩展的信息</span></span>
|
||||
@@ -170,4 +186,4 @@ import{_ as s,c as i,o as a,a1 as n}from"./chunks/framework.gjrnbxUT.js";const g
|
||||
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">clang</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> embed.c</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> $(</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">bin/spc</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> spc-config</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> bcmath,zlib</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">-o</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> embed</span></span>
|
||||
<span class="line"></span>
|
||||
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">./embed</span></span>
|
||||
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># out: Hello world!</span></span></code></pre></div>`,118),e=[l];function t(h,k,d,c,o,r){return a(),i("div",null,e)}const y=s(p,[["render",t]]);export{g as __pageData,y as default};
|
||||
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># out: Hello world!</span></span></code></pre></div>`,122),e=[l];function t(h,k,d,c,o,r){return a(),i("div",null,e)}const y=s(p,[["render",t]]);export{g as __pageData,y as default};
|
||||
@@ -1 +1 @@
|
||||
import{_ as s,c as i,o as a,a1 as n}from"./chunks/framework.gjrnbxUT.js";const g=JSON.parse('{"title":"本地构建(Linux、macOS、FreeBSD)","description":"","frontmatter":{},"headers":[],"relativePath":"zh/guide/manual-build.md","filePath":"zh/guide/manual-build.md"}'),p={name:"zh/guide/manual-build.md"},l=n("",118),e=[l];function t(h,k,d,c,o,r){return a(),i("div",null,e)}const y=s(p,[["render",t]]);export{g as __pageData,y as default};
|
||||
import{_ as s,c as i,o as a,a1 as n}from"./chunks/framework.gjrnbxUT.js";const g=JSON.parse('{"title":"本地构建(Linux、macOS、FreeBSD)","description":"","frontmatter":{},"headers":[],"relativePath":"zh/guide/manual-build.md","filePath":"zh/guide/manual-build.md"}'),p={name:"zh/guide/manual-build.md"},l=n("",122),e=[l];function t(h,k,d,c,o,r){return a(),i("div",null,e)}const y=s(p,[["render",t]]);export{g as __pageData,y as default};
|
||||
Reference in New Issue
Block a user