mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-17 20:34:51 +08:00
deploy: 0dc463ef2adca7de6cf42ced7dd7183ac90ae200
This commit is contained in:
commit
5218cb639d
1
assets/app.DAnd8ZqT.js
Normal file
1
assets/app.DAnd8ZqT.js
Normal file
@ -0,0 +1 @@
|
||||
import{U as o,a7 as p,a8 as u,a9 as l,aa as c,ab as f,ac as d,ad as m,ae as h,af as g,ag as A,d as P,u as v,y,x as w,ah as C,ai as R,aj as b,ak as E}from"./chunks/framework.CszIUXhs.js";import{R as S}from"./chunks/theme.Yd2LEGgK.js";function i(e){if(e.extends){const a=i(e.extends);return{...a,...e,async enhanceApp(t){a.enhanceApp&&await a.enhanceApp(t),e.enhanceApp&&await e.enhanceApp(t)}}}return e}const s=i(S),T=P({name:"VitePressApp",setup(){const{site:e,lang:a,dir:t}=v();return y(()=>{w(()=>{document.documentElement.lang=a.value,document.documentElement.dir=t.value})}),e.value.router.prefetchLinks&&C(),R(),b(),s.setup&&s.setup(),()=>E(s.Layout)}});async function _(){globalThis.__VITEPRESS__=!0;const e=x(),a=j();a.provide(u,e);const t=l(e.route);return a.provide(c,t),a.component("Content",f),a.component("ClientOnly",d),Object.defineProperties(a.config.globalProperties,{$frontmatter:{get(){return t.frontmatter.value}},$params:{get(){return t.page.value.params}}}),s.enhanceApp&&await s.enhanceApp({app:a,router:e,siteData:m}),{app:a,router:e,data:t}}function j(){return h(T)}function x(){let e=o,a;return g(t=>{let n=A(t),r=null;return n&&(e&&(a=n),(e||a===n)&&(n=n.replace(/\.js$/,".lean.js")),r=import(n)),o&&(e=!1),r},s.NotFound)}o&&_().then(({app:e,router:a,data:t})=>{a.go().then(()=>{p(a.route,t.site),e.mount("#app")})});export{_ as createApp};
|
||||
2
assets/chunks/CliGenerator.Bj1S5l8x.js
Normal file
2
assets/chunks/CliGenerator.Bj1S5l8x.js
Normal file
File diff suppressed because one or more lines are too long
17
assets/chunks/framework.CszIUXhs.js
Normal file
17
assets/chunks/framework.CszIUXhs.js
Normal file
File diff suppressed because one or more lines are too long
1
assets/chunks/theme.Yd2LEGgK.js
Normal file
1
assets/chunks/theme.Yd2LEGgK.js
Normal file
File diff suppressed because one or more lines are too long
1
assets/en_contributing_index.md.0xRtVBv6.js
Normal file
1
assets/en_contributing_index.md.0xRtVBv6.js
Normal file
File diff suppressed because one or more lines are too long
1
assets/en_contributing_index.md.0xRtVBv6.lean.js
Normal file
1
assets/en_contributing_index.md.0xRtVBv6.lean.js
Normal file
@ -0,0 +1 @@
|
||||
import{_ as e,c as t,o,a1 as i}from"./chunks/framework.CszIUXhs.js";const f=JSON.parse('{"title":"Contributing","description":"","frontmatter":{},"headers":[],"relativePath":"en/contributing/index.md","filePath":"en/contributing/index.md"}'),n={name:"en/contributing/index.md"},a=i("",18),r=[a];function s(c,l,d,u,h,m){return o(),t("div",null,r)}const b=e(n,[["render",s]]);export{f as __pageData,b as default};
|
||||
29
assets/en_develop_doctor-module.md.M_P38WuA.js
Normal file
29
assets/en_develop_doctor-module.md.M_P38WuA.js
Normal file
@ -0,0 +1,29 @@
|
||||
import{_ as s,c as i,o as a,a1 as e}from"./chunks/framework.CszIUXhs.js";const g=JSON.parse('{"title":"Doctor module","description":"","frontmatter":{},"headers":[],"relativePath":"en/develop/doctor-module.md","filePath":"en/develop/doctor-module.md"}'),t={name:"en/develop/doctor-module.md"},h=e(`<h1 id="doctor-module" tabindex="-1">Doctor module <a class="header-anchor" href="#doctor-module" aria-label="Permalink to "Doctor module""></a></h1><p>The Doctor module is a relatively independent module used to check the system environment, which can be entered with the command <code>bin/spc doctor</code>, and the entry command class is in <code>DoctorCommand.php</code>.</p><p>The Doctor module is a checklist with a series of check items and automatic repair items. These items are stored in the <code>src/SPC/doctor/item/</code> directory, And two Attributes are used as check item tags and auto-fix item tags: <code>#[AsCheckItem]</code> and <code>#[AsFixItem]</code>.</p><p>Take the existing check item <code>if necessary tools are installed</code>, which is used to check whether the packages necessary for compilation are installed in the macOS system. The following is its source code:</p><div class="language-php vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">php</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">use</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> SPC\\doctor\\AsCheckItem</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">use</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> SPC\\doctor\\AsFixItem</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">use</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> SPC\\doctor\\CheckResult</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
|
||||
<span class="line"></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">#[</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">AsCheckItem</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'if necessary tools are installed'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">limit_os</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'Darwin'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">level</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">997</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)]</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">public</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> function</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> checkCliTools</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">()</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> ?</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">CheckResult</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">{</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> $missing </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> [];</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> foreach</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> (</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">self::</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">REQUIRED_COMMANDS</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> as</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> $cmd) {</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> if</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> (</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">$this</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">findCommand</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">($cmd) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">===</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> null</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) {</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> $missing[] </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> $cmd;</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> if</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> (</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">!</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">empty</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">($missing)) {</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> CheckResult</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">::</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">fail</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'missing system commands: '</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> .</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> implode</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">', '</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, $missing), </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'build-tools'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, [$missing]);</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> CheckResult</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">::</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">ok</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">();</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><p>The first parameter of the attribute is the name of the check item, and the following <code>limit_os</code> parameter restricts the check item to be triggered only under the specified system, and <code>level</code> is the priority of executing the check item, the larger the number, the higher the priority higher.</p><p>The <code>$this->findCommand()</code> method used in it is the method of <code>SPC\\builder\\traits\\UnixSystemUtilTrait</code>, the purpose is to find the location of the system command, and return NULL if it cannot be found.</p><p>Each check item method should return a <code>SPC\\doctor\\CheckResult</code>:</p><ul><li>When returning <code>CheckResult::fail()</code>, the first parameter is used to output the error prompt of the terminal, and the second parameter is the name of the repair item when this check item can be automatically repaired.</li><li>When <code>CheckResult::ok()</code> is returned, the check passed. You can also pass a parameter to return the check result, for example: <code>CheckResult::ok('OS supported')</code>.</li><li>When returning <code>CheckResult::fail()</code>, if the third parameter is included, the array of the third parameter will be used as the parameter of <code>AsFixItem</code>.</li></ul><p>The following is the method for automatically repairing items corresponding to this check item:</p><div class="language-php vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">php</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">#[</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">AsFixItem</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'build-tools'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)]</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">public</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> function</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> fixBuildTools</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">array</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> $missing)</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> bool</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">{</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> foreach</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> ($missing </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">as</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> $cmd) {</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> try</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
|
||||
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> shell</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">true</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">exec</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'brew install '</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> .</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> escapeshellarg</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">($cmd));</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> } </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">catch</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> (</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">RuntimeException</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) {</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> false</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> true</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><p><code>#[AsFixItem()]</code> first parameter is the name of the fix item, and this method must return True or False. When False is returned, the automatic repair failed and manual handling is required.</p><p>In the code here, <code>shell()->exec()</code> is the method of executing commands of the project, which is used to replace <code>exec()</code> and <code>system()</code>, and also provides debugging, obtaining execution status, entering directories, etc. characteristic.</p>`,13),n=[h];function l(k,p,r,d,o,c){return a(),i("div",null,n)}const y=s(t,[["render",l]]);export{g as __pageData,y as default};
|
||||
1
assets/en_develop_doctor-module.md.M_P38WuA.lean.js
Normal file
1
assets/en_develop_doctor-module.md.M_P38WuA.lean.js
Normal file
@ -0,0 +1 @@
|
||||
import{_ as s,c as i,o as a,a1 as e}from"./chunks/framework.CszIUXhs.js";const g=JSON.parse('{"title":"Doctor module","description":"","frontmatter":{},"headers":[],"relativePath":"en/develop/doctor-module.md","filePath":"en/develop/doctor-module.md"}'),t={name:"en/develop/doctor-module.md"},h=e("",13),n=[h];function l(k,p,r,d,o,c){return a(),i("div",null,n)}const y=s(t,[["render",l]]);export{g as __pageData,y as default};
|
||||
1
assets/en_develop_index.md.BqNiKnHj.js
Normal file
1
assets/en_develop_index.md.BqNiKnHj.js
Normal file
@ -0,0 +1 @@
|
||||
import{_ as e,c as t,o,a1 as n}from"./chunks/framework.CszIUXhs.js";const v=JSON.parse('{"title":"Start Developing","description":"","frontmatter":{},"headers":[],"relativePath":"en/develop/index.md","filePath":"en/develop/index.md"}'),i={name:"en/develop/index.md"},s=n('<h1 id="start-developing" tabindex="-1">Start Developing <a class="header-anchor" href="#start-developing" aria-label="Permalink to "Start Developing""></a></h1><p>Developing this project requires the installation and deployment of a PHP environment, as well as some extensions and Composer commonly used in PHP projects.</p><p>The development environment and running environment of the project are almost exactly the same. You can refer to the <strong>Manual Build</strong> section to install system PHP or use the pre-built static PHP of this project as the environment. I will not go into details here.</p><p>Regardless of its purpose, this project itself is actually a <code>php-cli</code> program. You can edit and develop it as a normal PHP project. At the same time, you need to understand the Shell languages of different systems.</p><p>The current purpose of this project is to compile statically compiled independent PHP, but the main part also includes compiling static versions of many dependent libraries, so you can reuse this set of compilation logic to build independent binary versions of other programs, such as Nginx, etc.</p><h2 id="environment-preparation" tabindex="-1">Environment preparation <a class="header-anchor" href="#environment-preparation" aria-label="Permalink to "Environment preparation""></a></h2><p>A PHP environment is required to develop this project. You can use the PHP that comes with the system, or you can use the static PHP built by this project.</p><p>Regardless of which PHP you use, in your development environment you need to install these extensions:</p><div class="language- vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>curl,dom,filter,mbstring,openssl,pcntl,phar,posix,sodium,tokenizer,xml,xmlwriter</span></span></code></pre></div><p>The static-php-cli project itself does not require so many extensions, but during the development process, you will use tools such as Composer and PHPUnit, which require these extensions.</p><blockquote><p>For micro self-executing binaries built by static-php-cli itself, only <code>pcntl,posix,mbstring,tokenizer,phar</code> is required.</p></blockquote><h2 id="start-development" tabindex="-1">Start development <a class="header-anchor" href="#start-development" aria-label="Permalink to "Start development""></a></h2><p>Continuing down to see the project structure documentation, you can learn how <code>static-php-cli</code> works.</p>',13),a=[s];function r(p,l,c,d,h,u){return o(),t("div",null,a)}const g=e(i,[["render",r]]);export{v as __pageData,g as default};
|
||||
1
assets/en_develop_index.md.BqNiKnHj.lean.js
Normal file
1
assets/en_develop_index.md.BqNiKnHj.lean.js
Normal file
@ -0,0 +1 @@
|
||||
import{_ as e,c as t,o,a1 as n}from"./chunks/framework.CszIUXhs.js";const v=JSON.parse('{"title":"Start Developing","description":"","frontmatter":{},"headers":[],"relativePath":"en/develop/index.md","filePath":"en/develop/index.md"}'),i={name:"en/develop/index.md"},s=n("",13),a=[s];function r(p,l,c,d,h,u){return o(),t("div",null,a)}const g=e(i,[["render",r]]);export{v as __pageData,g as default};
|
||||
105
assets/en_develop_source-module.md.CuG52-lh.js
Normal file
105
assets/en_develop_source-module.md.CuG52-lh.js
Normal file
@ -0,0 +1,105 @@
|
||||
import{_ as s,c as i,o as a,a1 as e}from"./chunks/framework.CszIUXhs.js";const u=JSON.parse('{"title":"Source module","description":"","frontmatter":{},"headers":[],"relativePath":"en/develop/source-module.md","filePath":"en/develop/source-module.md"}'),t={name:"en/develop/source-module.md"},n=e(`<h1 id="source-module" tabindex="-1">Source module <a class="header-anchor" href="#source-module" aria-label="Permalink to "Source module""></a></h1><p>The download source module of static-php-cli is a major module. It includes dependent libraries, external extensions, PHP source code download methods and file decompression methods. The download configuration file mainly involves the <code>source.json</code> and <code>pkg.json</code> file, which records the download method of all downloadable sources.</p><p>The main commands involved in the download function are <code>bin/spc download</code> and <code>bin/spc extract</code>. The <code>download</code> command is a downloader that downloads sources according to the configuration file, and the <code>extract</code> command is an extractor that extract sources from downloaded files.</p><p>Generally speaking, downloading sources may be slow because these sources come from various official websites, GitHub, and other different locations. At the same time, they also occupy a large space, so you can download the sources once and reuse them.</p><p>The configuration file of the downloader is <code>source.json</code>, which contains the download methods of all sources. You can add the source download methods you need, or modify the existing source download methods.</p><p>The download configuration structure of each source is as follows. The following is the source download configuration corresponding to the <code>libevent</code> extension:</p><div class="language-json vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">json</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">{</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "libevent"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: {</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "type"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"ghrel"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "repo"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"libevent/libevent"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "match"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"libevent.+</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">\\\\</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">.tar</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">\\\\</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">.gz"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "license"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: {</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "type"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"file"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "path"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"LICENSE"</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><p>The most important field here is <code>type</code>. Currently, the types it supports are:</p><ul><li><code>url</code>: Directly use URL to download, for example: <code>https://download.libsodium.org/libsodium/releases/libsodium-1.0.18.tar.gz</code>.</li><li><code>ghrel</code>: Use the GitHub Release API to download, download the artifacts uploaded from the latest version released by maintainers.</li><li><code>ghtar</code>: Use the GitHub Release API to download. Different from <code>ghrel</code>, <code>ghtar</code> is downloaded from the <code>source code (tar.gz)</code> in the latest Release of the project.</li><li><code>ghtagtar</code>: Use GitHub Release API to download. Compared with <code>ghtar</code>, <code>ghtagtar</code> can find the latest one from the <code>tags</code> list and download the source code in <code>tar.gz</code> format (because some projects only use <code>tag</code> release version).</li><li><code>bitbuckettag</code>: Download using BitBucket API, basically the same as <code>ghtagtar</code>, except this one applies to BitBucket.</li><li><code>git</code>: Clone the project directly from a Git address to download sources, applicable to any public Git repository.</li><li><code>filelist</code>: Use a crawler to crawl the Web download site that provides file index, and get the latest version of the file name and download it.</li><li><code>custom</code>: If none of the above download methods are satisfactory, you can write <code>custom</code>, create a new class under <code>src/SPC/store/source/</code>, extends <code>CustomSourceBase</code>, and write the download script yourself.</li></ul><h2 id="source-json-common-parameters" tabindex="-1">source.json Common parameters <a class="header-anchor" href="#source-json-common-parameters" aria-label="Permalink to "source.json Common parameters""></a></h2><p>Each source file in source.json has the following params:</p><ul><li><code>license</code>: the open source license of the source code, see <strong>Open Source License</strong> section below</li><li><code>type</code>: must be one of the types mentioned above</li><li><code>path</code> (optional): release the source code to the specified directory instead of <code>source/{name}</code></li></ul><div class="tip custom-block"><p class="custom-block-title">TIP</p><p>The <code>path</code> parameter in <code>source.json</code> can specify a relative or absolute path. When specified as a relative path, the path is based on <code>source/</code>.</p></div><h2 id="download-type-url" tabindex="-1">Download type - url <a class="header-anchor" href="#download-type-url" aria-label="Permalink to "Download type - url""></a></h2><p>URL type sources refer to downloading files directly from the URL.</p><p>The parameters included are:</p><ul><li><code>url</code>: The download address of the file, such as <code>https://example.com/file.tgz</code></li><li><code>filename</code> (optional): The file name saved to the local area. If not specified, the file name of the url will be used.</li></ul><p>Example (download the imagick extension and extract it to the extension storage path of the php source code):</p><div class="language-json vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">json</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">{</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "ext-imagick"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: {</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "type"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"url"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "url"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"https://pecl.php.net/get/imagick"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "path"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"php-src/ext/imagick"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "filename"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"imagick.tgz"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "license"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: {</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "type"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"file"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "path"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"LICENSE"</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><h2 id="download-type-ghrel" tabindex="-1">Download type - ghrel <a class="header-anchor" href="#download-type-ghrel" aria-label="Permalink to "Download type - ghrel""></a></h2><p>ghrel will download files from Assets uploaded in GitHub Release. First use the GitHub Release API to get the latest version, and then download the corresponding files according to the regular matching method.</p><p>The parameters included are:</p><ul><li><code>repo</code>: GitHub repository name</li><li><code>match</code>: regular expression matching Assets files</li><li><code>prefer-stable</code>: Whether to download stable versions first (default is <code>false</code>)</li></ul><p>Example (download the libsodium library, matching the libsodium-x.y.tar.gz file in Release):</p><div class="language-json vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">json</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">{</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "libsodium"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: {</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "type"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"ghrel"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "repo"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"jedisct1/libsodium"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "match"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"libsodium-</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">\\\\</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">d+(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">\\\\</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">.</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">\\\\</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">d+)*</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">\\\\</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">.tar</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">\\\\</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">.gz"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "license"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: {</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "type"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"file"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "path"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"LICENSE"</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><h2 id="download-type-ghtar" tabindex="-1">Download type - ghtar <a class="header-anchor" href="#download-type-ghtar" aria-label="Permalink to "Download type - ghtar""></a></h2><p>ghtar will download the file from the GitHub Release Tag. Unlike <code>ghrel</code>, <code>ghtar</code> will download the <code>source code (tar.gz)</code> from the latest Release of the project.</p><p>The parameters included are:</p><ul><li><code>repo</code>: GitHub repository name</li><li><code>prefer-stable</code>: Whether to download stable versions first (default is <code>false</code>)</li></ul><p>Example (brotli library):</p><div class="language-json vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">json</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">{</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "brotli"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: {</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "type"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"ghtar"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "repo"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"google/brotli"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "license"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: {</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "type"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"file"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "path"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"LICENSE"</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><h2 id="download-type-ghtagtar" tabindex="-1">Download type - ghtagtar <a class="header-anchor" href="#download-type-ghtagtar" aria-label="Permalink to "Download type - ghtagtar""></a></h2><p>Use the GitHub Release API to download. Compared with <code>ghtar</code>, <code>ghtagtar</code> can find the latest one from the <code>tags</code> list and download the source code in <code>tar.gz</code> format (because some projects only use the <code>tag</code> version).</p><p>The parameters included are:</p><ul><li><code>repo</code>: GitHub repository name</li><li><code>prefer-stable</code>: Whether to download stable versions first (default is <code>false</code>)</li></ul><p>Example (gmp library):</p><div class="language-json vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">json</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">{</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "gmp"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: {</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "type"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"ghtagtar"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "repo"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"alisw/GMP"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "license"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: {</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "type"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"text"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "text"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"EXAMPLE LICENSE"</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><h2 id="download-type-bitbuckettag" tabindex="-1">Download Type - bitbuckettag <a class="header-anchor" href="#download-type-bitbuckettag" aria-label="Permalink to "Download Type - bitbuckettag""></a></h2><p>Download using BitBucket API, basically the same as <code>ghtagtar</code>, except this one works with BitBucket.</p><p>The parameters included are:</p><ul><li><code>repo</code>: BitBucket repository name</li></ul><h2 id="download-type-git" tabindex="-1">Download type - git <a class="header-anchor" href="#download-type-git" aria-label="Permalink to "Download type - git""></a></h2><p>Clone the project directly from a Git address to download sources, applicable to any public Git repository.</p><p>The parameters included are:</p><ul><li><code>url</code>: Git link (HTTPS only)</li><li><code>rev</code>: branch name</li></ul><div class="language-json vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">json</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">{</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "imap"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: {</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "type"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"git"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "url"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"https://github.com/static-php/imap.git"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "rev"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"master"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "license"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: {</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "type"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"file"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "path"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"LICENSE"</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><h2 id="download-type-filelist" tabindex="-1">Download type - filelist <a class="header-anchor" href="#download-type-filelist" aria-label="Permalink to "Download type - filelist""></a></h2><p>Use a crawler to crawl a web download site that provides a file index and get the latest version of the file name and download it.</p><p>Note that this method is only applicable to static sites with page index functions such as mirror sites and GNU official websites.</p><p>The parameters included are:</p><ul><li><code>url</code>: The URL of the page to crawl the latest version of the file</li><li><code>regex</code>: regular expression matching file names and download links</li></ul><p>Example (download the libiconv library from the GNU official website):</p><div class="language-json vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">json</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">{</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "libiconv"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: {</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "type"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"filelist"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "url"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"https://ftp.gnu.org/gnu/libiconv/"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "regex"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"/href=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">\\"</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">(?<file>libiconv-(?<version>[^</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">\\"</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">]+)</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">\\\\</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">.tar</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">\\\\</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">.gz)</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">\\"</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">/"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "license"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: {</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "type"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"file"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "path"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"COPYING"</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><h2 id="download-type-custom" tabindex="-1">Download type - custom <a class="header-anchor" href="#download-type-custom" aria-label="Permalink to "Download type - custom""></a></h2><p>If the above downloading methods are not satisfactory, you can write <code>custom</code>, create a new class under <code>src/SPC/store/source/</code>, extends <code>CustomSourceBase</code>, and write the download script yourself.</p><p>I won’t go into details here, you can look at <code>src/SPC/store/source/PhpSource.php</code> or <code>src/SPC/store/source/PostgreSQLSource.php</code> as examples.</p><h2 id="pkg-json-general-parameters" tabindex="-1">pkg.json General parameters <a class="header-anchor" href="#pkg-json-general-parameters" aria-label="Permalink to "pkg.json General parameters""></a></h2><p>pkg.json stores non-source-code files, such as precompiled tools musl-toolchain and UPX. It includes:</p><ul><li><code>type</code>: The same type as <code>source.json</code> and different kinds of parameters.</li><li><code>extract</code> (optional): The path to decompress after downloading, the default is <code>pkgroot/{pkg_name}</code>.</li><li><code>extract-files</code> (optional): Extract only the specified files to the specified location after downloading.</li></ul><p>It should be noted that <code>pkg.json</code> does not involve compilation, modification and distribution of source code, so there is no <code>license</code> open source license field. And you cannot use the <code>extract</code> and <code>extract-files</code> parameters at the same time.</p><p>Example (download nasm locally and extract only program files to PHP SDK):</p><div class="language-json vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">json</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">{</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "nasm-x86_64-win"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: {</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "type"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"url"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "url"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"https://www.nasm.us/pub/nasm/releasebuilds/2.16.01/win64/nasm-2.16.01-win64.zip"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "extract-files"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: {</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "nasm-2.16.01/nasm.exe"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"{php_sdk_path}/bin/nasm.exe"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "nasm-2.16.01/ndisasm.exe"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"{php_sdk_path}/bin/ndisasm.exe"</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><p>The key name in <code>extract-files</code> is the file in the source folder, and the key value is the storage path. The storage path can use the following variables:</p><ul><li><code>{php_sdk_path}</code>: (Windows only) PHP SDK path</li><li><code>{pkg_root_path}</code>: <code>pkgroot/</code></li><li><code>{working_dir}</code>: current working directory</li><li><code>{download_path}</code>: download directory</li><li><code>{source_path}</code>: source code decompression directory</li></ul><p>When <code>extract-files</code> does not use variables and is a relative path, the directory of the relative path is <code>{working_dir}</code>.</p><h2 id="open-source-license" tabindex="-1">Open source license <a class="header-anchor" href="#open-source-license" aria-label="Permalink to "Open source license""></a></h2><p>For <code>source.json</code>, each source file should contain an open source license. The <code>license</code> field stores the open source license information.</p><p>Each <code>license</code> contains the following parameters:</p><ul><li><code>type</code>: <code>file</code> or <code>text</code></li><li><code>path</code>: the license file in the source code directory (required when <code>type</code> is <code>file</code>)</li><li><code>text</code>: License text (required when <code>type</code> is <code>text</code>)</li></ul><p>Example (yaml extension source code with LICENSE file):</p><div class="language-json vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">json</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">{</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "yaml"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: {</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "type"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"git"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "path"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"php-src/ext/yaml"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "rev"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"php7"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "url"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"https://github.com/php/pecl-file_formats-yaml"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "license"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: {</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "type"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"file"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "path"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"LICENSE"</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><p>When an open source project has multiple licenses, multiple files can be specified:</p><div class="language-json vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">json</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">{</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "libuv"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: {</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "type"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"ghtar"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "repo"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"libuv/libuv"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "license"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: [</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "type"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"file"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "path"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"LICENSE"</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "type"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"file"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "path"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"LICENSE-extra"</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> ]</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div>`,73),l=[n];function h(p,o,d,k,r,c){return a(),i("div",null,l)}const g=s(t,[["render",h]]);export{u as __pageData,g as default};
|
||||
1
assets/en_develop_source-module.md.CuG52-lh.lean.js
Normal file
1
assets/en_develop_source-module.md.CuG52-lh.lean.js
Normal file
@ -0,0 +1 @@
|
||||
import{_ as s,c as i,o as a,a1 as e}from"./chunks/framework.CszIUXhs.js";const u=JSON.parse('{"title":"Source module","description":"","frontmatter":{},"headers":[],"relativePath":"en/develop/source-module.md","filePath":"en/develop/source-module.md"}'),t={name:"en/develop/source-module.md"},n=e("",73),l=[n];function h(p,o,d,k,r,c){return a(),i("div",null,l)}const g=s(t,[["render",h]]);export{u as __pageData,g as default};
|
||||
10
assets/en_develop_structure.md.wZEZWbru.js
Normal file
10
assets/en_develop_structure.md.wZEZWbru.js
Normal file
File diff suppressed because one or more lines are too long
1
assets/en_develop_structure.md.wZEZWbru.lean.js
Normal file
1
assets/en_develop_structure.md.wZEZWbru.lean.js
Normal file
@ -0,0 +1 @@
|
||||
import{_ as e,c as o,o as t,a1 as c}from"./chunks/framework.CszIUXhs.js";const y=JSON.parse('{"title":"Introduction to project structure","description":"","frontmatter":{},"headers":[],"relativePath":"en/develop/structure.md","filePath":"en/develop/structure.md"}'),d={name:"en/develop/structure.md"},a=c("",50),r=[a];function i(s,n,p,l,h,m){return t(),o("div",null,r)}const b=e(d,[["render",i]]);export{y as __pageData,b as default};
|
||||
68
assets/en_develop_system-build-tools.md.Ds5Kgdf6.js
Normal file
68
assets/en_develop_system-build-tools.md.Ds5Kgdf6.js
Normal file
File diff suppressed because one or more lines are too long
1
assets/en_develop_system-build-tools.md.Ds5Kgdf6.lean.js
Normal file
1
assets/en_develop_system-build-tools.md.Ds5Kgdf6.lean.js
Normal file
@ -0,0 +1 @@
|
||||
import{_ as s,c as i,o as a,a1 as e}from"./chunks/framework.CszIUXhs.js";const g=JSON.parse('{"title":"Compilation Tools","description":"","frontmatter":{},"headers":[],"relativePath":"en/develop/system-build-tools.md","filePath":"en/develop/system-build-tools.md"}'),n={name:"en/develop/system-build-tools.md"},t=e("",50),l=[t];function o(p,h,c,r,k,d){return a(),i("div",null,l)}const E=s(n,[["render",o]]);export{g as __pageData,E as default};
|
||||
2
assets/en_faq_index.md.DM_hczmb.js
Normal file
2
assets/en_faq_index.md.DM_hczmb.js
Normal file
File diff suppressed because one or more lines are too long
1
assets/en_faq_index.md.DM_hczmb.lean.js
Normal file
1
assets/en_faq_index.md.DM_hczmb.lean.js
Normal file
@ -0,0 +1 @@
|
||||
import{_ as e,c as o,o as t,a1 as i}from"./chunks/framework.CszIUXhs.js";const f=JSON.parse('{"title":"FAQ","description":"","frontmatter":{},"headers":[],"relativePath":"en/faq/index.md","filePath":"en/faq/index.md"}'),a={name:"en/faq/index.md"},s=i("",24),n=[s];function r(c,l,d,p,h,u){return t(),o("div",null,n)}const y=e(a,[["render",r]]);export{f as __pageData,y as default};
|
||||
1
assets/en_guide_action-build.md.DqfXKtKF.js
Normal file
1
assets/en_guide_action-build.md.DqfXKtKF.js
Normal file
@ -0,0 +1 @@
|
||||
import{_ as e,c as t,o,a1 as i}from"./chunks/framework.CszIUXhs.js";const b=JSON.parse('{"title":"GitHub Action Build","description":"","frontmatter":{},"headers":[],"relativePath":"en/guide/action-build.md","filePath":"en/guide/action-build.md"}'),n={name:"en/guide/action-build.md"},a=i('<h1 id="github-action-build" tabindex="-1">GitHub Action Build <a class="header-anchor" href="#github-action-build" aria-label="Permalink to "GitHub Action Build""></a></h1><p>Action Build refers to compiling directly using GitHub Action.</p><p>If you don't want to compile it yourself, you can download the artifact from the existing Action in this project, or you can download it from a self-hosted server:<a href="https://dl.static-php.dev/static-php-cli/common/" target="_blank" rel="noreferrer">Enter</a>.</p><blockquote><p>Self-hosted binaries are also built from Actions: <a href="https://github.com/static-php/static-php-cli-hosted" target="_blank" rel="noreferrer">repo</a>. The extensions included are: bcmath,bz2,calendar,ctype,curl,dom,exif,fileinfo,filter,ftp,gd,gmp,iconv,xml,mbstring,mbregex,mysqlnd,openssl, pcntl,pdo,pdo_mysql,pdo_sqlite,phar,posix,redis,session,simplexml,soap,sockets,sqlite3,tokenizer,xmlwriter,xmlreader,zlib,zip</p></blockquote><h2 id="build-guide" tabindex="-1">Build Guide <a class="header-anchor" href="#build-guide" aria-label="Permalink to "Build Guide""></a></h2><p>Using GitHub Action makes it easy to build a statically compiled PHP and phpmicro, while also defining the extensions to compile.</p><ol><li>Fork project.</li><li>Go to the Actions of the project and select <code>CI</code>.</li><li>Select <code>Run workflow</code>, fill in the PHP version you want to compile, the target type, and the list of extensions. (extensions comma separated, e.g. <code>bcmath,curl,mbstring</code>)</li><li>After waiting for about a period of time, enter the corresponding task and get <code>Artifacts</code>.</li></ol><p>If you enable <code>debug</code>, all logs will be output at build time, including compiled logs, for troubleshooting.</p><blockquote><p>If you need to build in other environments, you can use <a href="./manual-build.html">manual build</a>.</p></blockquote><h2 id="extensions" tabindex="-1">Extensions <a class="header-anchor" href="#extensions" aria-label="Permalink to "Extensions""></a></h2><p>You can go to <a href="./extensions.html">extensions</a> check here to see if all the extensions you need currently support. and then go to <a href="./cli-generator.html">command generator</a> select the extension you need to compile, copy the extensions string to <code>extensions</code> option.</p>',11),l=[a];function s(r,c,d,u,p,h){return o(),t("div",null,l)}const f=e(n,[["render",s]]);export{b as __pageData,f as default};
|
||||
1
assets/en_guide_action-build.md.DqfXKtKF.lean.js
Normal file
1
assets/en_guide_action-build.md.DqfXKtKF.lean.js
Normal file
@ -0,0 +1 @@
|
||||
import{_ as e,c as t,o,a1 as i}from"./chunks/framework.CszIUXhs.js";const b=JSON.parse('{"title":"GitHub Action Build","description":"","frontmatter":{},"headers":[],"relativePath":"en/guide/action-build.md","filePath":"en/guide/action-build.md"}'),n={name:"en/guide/action-build.md"},a=i("",11),l=[a];function s(r,c,d,u,p,h){return o(),t("div",null,l)}const f=e(n,[["render",s]]);export{b as __pageData,f as default};
|
||||
23
assets/en_guide_build-on-windows.md.Bw1buXoR.js
Normal file
23
assets/en_guide_build-on-windows.md.Bw1buXoR.js
Normal file
File diff suppressed because one or more lines are too long
1
assets/en_guide_build-on-windows.md.Bw1buXoR.lean.js
Normal file
1
assets/en_guide_build-on-windows.md.Bw1buXoR.lean.js
Normal file
@ -0,0 +1 @@
|
||||
import{_ as e,c as i,o as s,a1 as a}from"./chunks/framework.CszIUXhs.js";const m=JSON.parse('{"title":"Build on Windows","description":"","frontmatter":{},"headers":[],"relativePath":"en/guide/build-on-windows.md","filePath":"en/guide/build-on-windows.md"}'),t={name:"en/guide/build-on-windows.md"},o=a("",62),l=[o];function n(p,d,h,r,c,u){return s(),i("div",null,l)}const b=e(t,[["render",n]]);export{m as __pageData,b as default};
|
||||
1
assets/en_guide_cli-generator.md.B6SIOY9P.js
Normal file
1
assets/en_guide_cli-generator.md.B6SIOY9P.js
Normal file
@ -0,0 +1 @@
|
||||
import{C as e}from"./chunks/CliGenerator.Bj1S5l8x.js";import{d as t,c as a,I as o,a1 as n,o as r}from"./chunks/framework.CszIUXhs.js";const i=n('<h1 id="cli-build-command-generator" tabindex="-1">CLI Build Command Generator <a class="header-anchor" href="#cli-build-command-generator" aria-label="Permalink to "CLI Build Command Generator""></a></h1><div class="tip custom-block"><p class="custom-block-title">TIP</p><p>The extensions selected below may contain extensions that are not supported by the selected operating system, which may cause compilation to fail. Please check <a href="./extensions.html">Supported Extensions</a> first.</p></div>',2),u=JSON.parse('{"title":"CLI Build Command Generator","description":"","frontmatter":{},"headers":[],"relativePath":"en/guide/cli-generator.md","filePath":"en/guide/cli-generator.md"}'),s={name:"en/guide/cli-generator.md"},h=t({...s,setup(c){return(l,d)=>(r(),a("div",null,[i,o(e,{lang:"en"})]))}});export{u as __pageData,h as default};
|
||||
1
assets/en_guide_cli-generator.md.B6SIOY9P.lean.js
Normal file
1
assets/en_guide_cli-generator.md.B6SIOY9P.lean.js
Normal file
@ -0,0 +1 @@
|
||||
import{C as e}from"./chunks/CliGenerator.Bj1S5l8x.js";import{d as t,c as a,I as o,a1 as n,o as r}from"./chunks/framework.CszIUXhs.js";const i=n('<h1 id="cli-build-command-generator" tabindex="-1">CLI Build Command Generator <a class="header-anchor" href="#cli-build-command-generator" aria-label="Permalink to "CLI Build Command Generator""></a></h1><div class="tip custom-block"><p class="custom-block-title">TIP</p><p>The extensions selected below may contain extensions that are not supported by the selected operating system, which may cause compilation to fail. Please check <a href="./extensions.html">Supported Extensions</a> first.</p></div>',2),u=JSON.parse('{"title":"CLI Build Command Generator","description":"","frontmatter":{},"headers":[],"relativePath":"en/guide/cli-generator.md","filePath":"en/guide/cli-generator.md"}'),s={name:"en/guide/cli-generator.md"},h=t({...s,setup(c){return(l,d)=>(r(),a("div",null,[i,o(e,{lang:"en"})]))}});export{u as __pageData,h as default};
|
||||
6
assets/en_guide_env-vars.md.XRLVeMgw.js
Normal file
6
assets/en_guide_env-vars.md.XRLVeMgw.js
Normal file
File diff suppressed because one or more lines are too long
1
assets/en_guide_env-vars.md.XRLVeMgw.lean.js
Normal file
1
assets/en_guide_env-vars.md.XRLVeMgw.lean.js
Normal file
@ -0,0 +1 @@
|
||||
import{_ as e,c as t,o as d,a1 as o}from"./chunks/framework.CszIUXhs.js";const b=JSON.parse('{"title":"Environment variables","description":"","frontmatter":{"aside":false},"headers":[],"relativePath":"en/guide/env-vars.md","filePath":"en/guide/env-vars.md"}'),a={name:"en/guide/env-vars.md"},r=o("",35),i=[r];function c(n,s,l,h,p,m){return d(),t("div",null,i)}const u=e(a,[["render",c]]);export{b as __pageData,u as default};
|
||||
1
assets/en_guide_extension-notes.md.CLQNfx2s.js
Normal file
1
assets/en_guide_extension-notes.md.CLQNfx2s.js
Normal file
File diff suppressed because one or more lines are too long
1
assets/en_guide_extension-notes.md.CLQNfx2s.lean.js
Normal file
1
assets/en_guide_extension-notes.md.CLQNfx2s.lean.js
Normal file
@ -0,0 +1 @@
|
||||
import{_ as e,c as o,o as a,a1 as t}from"./chunks/framework.CszIUXhs.js";const m=JSON.parse('{"title":"Extension Notes","description":"","frontmatter":{},"headers":[],"relativePath":"en/guide/extension-notes.md","filePath":"en/guide/extension-notes.md"}'),i={name:"en/guide/extension-notes.md"},l=t("",54),s=[l];function n(r,d,c,h,p,u){return a(),o("div",null,s)}const f=e(i,[["render",n]]);export{m as __pageData,f as default};
|
||||
1
assets/en_guide_extensions.md.DETBhSn0.js
Normal file
1
assets/en_guide_extensions.md.DETBhSn0.js
Normal file
File diff suppressed because one or more lines are too long
1
assets/en_guide_extensions.md.DETBhSn0.lean.js
Normal file
1
assets/en_guide_extensions.md.DETBhSn0.lean.js
Normal file
@ -0,0 +1 @@
|
||||
import{_ as t,c as d,o as e,a1 as s}from"./chunks/framework.CszIUXhs.js";const u=JSON.parse('{"title":"Extensions","description":"","frontmatter":{},"headers":[],"relativePath":"en/guide/extensions.md","filePath":"en/guide/extensions.md"}'),r={name:"en/guide/extensions.md"},y=s("",4),o=[y];function n(i,a,l,c,h,p){return e(),d("div",null,o)}const f=t(r,[["render",n]]);export{u as __pageData,f as default};
|
||||
1
assets/en_guide_index.md.DzPC1rL-.js
Normal file
1
assets/en_guide_index.md.DzPC1rL-.js
Normal file
@ -0,0 +1 @@
|
||||
import{_ as e,c as t,o,a1 as i}from"./chunks/framework.CszIUXhs.js";const b=JSON.parse('{"title":"Guide","description":"","frontmatter":{},"headers":[],"relativePath":"en/guide/index.md","filePath":"en/guide/index.md"}'),n={name:"en/guide/index.md"},r=i('<h1 id="guide" tabindex="-1">Guide <a class="header-anchor" href="#guide" aria-label="Permalink to "Guide""></a></h1><p>Static php cli is a tool used to build statically compiled PHP binaries, currently supporting Linux and macOS systems.</p><p>In the guide section, you will learn how to use static php cli to build standalone PHP programs.</p><ul><li><a href="./action-build.html">GitHub Action Build</a></li><li><a href="./manual-build.html">Manual Build</a></li><li><a href="./extensions.html">Supported Extensions</a></li></ul><div class="tip custom-block"><p class="custom-block-title">TIP</p><p>If you are a native English speaker, some corrections to the documentation are welcome.</p></div><h2 id="compilation-environment" tabindex="-1">Compilation Environment <a class="header-anchor" href="#compilation-environment" aria-label="Permalink to "Compilation Environment""></a></h2><p>The following is the architecture support situation, where ⚙️ represents support for GitHub Action build, 💻 represents support for local manual build, and empty represents temporarily not supported.</p><table tabindex="0"><thead><tr><th></th><th>x86_64</th><th>aarch64</th></tr></thead><tbody><tr><td>macOS</td><td>⚙️ 💻</td><td>⚙️ 💻</td></tr><tr><td>Linux</td><td>⚙️ 💻</td><td>⚙️ 💻</td></tr><tr><td>Windows</td><td>⚙️ 💻</td><td></td></tr><tr><td>FreeBSD</td><td>💻</td><td>💻</td></tr></tbody></table><p>Among them, Linux is currently only tested on Ubuntu, Debian, and Alpine distributions, and other distributions have not been tested, which cannot guarantee successful compilation. For untested distributions, local compilation can be done using methods such as Docker to avoid environmental issues.</p><p>There are two architectures for macOS: <code>x86_64</code> and <code>Arm</code>, but binaries compiled on one architecture cannot be directly used on the other architecture. Rosetta 2 cannot guarantee that programs compiled with <code>Arm</code> architecture can fully run on <code>x86_64</code> environment.</p><p>Windows currently only supports the x86_64 architecture, and does not support 32-bit x86 or arm64 architecture.</p><h2 id="supported-php-version" tabindex="-1">Supported PHP Version <a class="header-anchor" href="#supported-php-version" aria-label="Permalink to "Supported PHP Version""></a></h2><p>Currently, static php cli supports PHP versions 8.0 to 8.3, and theoretically supports PHP 7.4 and earlier versions. Simply select the earlier version when downloading. However, due to some extensions and special components that have stopped supporting earlier versions of PHP, static-php-cli will not explicitly support earlier versions. We recommend that you compile the latest PHP version possible for a better experience.</p>',13),a=[r];function s(d,l,c,p,u,h){return o(),t("div",null,a)}const _=e(n,[["render",s]]);export{b as __pageData,_ as default};
|
||||
1
assets/en_guide_index.md.DzPC1rL-.lean.js
Normal file
1
assets/en_guide_index.md.DzPC1rL-.lean.js
Normal file
@ -0,0 +1 @@
|
||||
import{_ as e,c as t,o,a1 as i}from"./chunks/framework.CszIUXhs.js";const b=JSON.parse('{"title":"Guide","description":"","frontmatter":{},"headers":[],"relativePath":"en/guide/index.md","filePath":"en/guide/index.md"}'),n={name:"en/guide/index.md"},r=i("",13),a=[r];function s(d,l,c,p,u,h){return o(),t("div",null,a)}const _=e(n,[["render",s]]);export{b as __pageData,_ as default};
|
||||
139
assets/en_guide_manual-build.md.CiZNh_BU.js
Normal file
139
assets/en_guide_manual-build.md.CiZNh_BU.js
Normal file
File diff suppressed because one or more lines are too long
1
assets/en_guide_manual-build.md.CiZNh_BU.lean.js
Normal file
1
assets/en_guide_manual-build.md.CiZNh_BU.lean.js
Normal file
@ -0,0 +1 @@
|
||||
import{_ as s,c as i,o as e,a1 as a}from"./chunks/framework.CszIUXhs.js";const g=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("",102),l=[t];function p(o,h,d,c,r,k){return e(),i("div",null,l)}const m=s(n,[["render",p]]);export{g as __pageData,m as default};
|
||||
1
assets/en_guide_troubleshooting.md.BZNNttUZ.js
Normal file
1
assets/en_guide_troubleshooting.md.BZNNttUZ.js
Normal file
@ -0,0 +1 @@
|
||||
import{_ as e,c as o,o as t,a1 as a}from"./chunks/framework.CszIUXhs.js";const f=JSON.parse('{"title":"Troubleshooting","description":"","frontmatter":{},"headers":[],"relativePath":"en/guide/troubleshooting.md","filePath":"en/guide/troubleshooting.md"}'),r={name:"en/guide/troubleshooting.md"},n=a('<h1 id="troubleshooting" tabindex="-1">Troubleshooting <a class="header-anchor" href="#troubleshooting" aria-label="Permalink to "Troubleshooting""></a></h1><p>Various failures may be encountered in the process of using static-php-cli, here will describe how to check the errors by yourself and report Issue.</p><h2 id="download-failure" tabindex="-1">Download Failure <a class="header-anchor" href="#download-failure" aria-label="Permalink to "Download Failure""></a></h2><p>Problems with downloading resources are one of the most common problems with spc. The main reason is that the addresses used for SPC download resources are generally the official website of the corresponding project or GitHub, etc., and these websites may occasionally go down and block IP addresses. Currently, version 2.0.0 has not added an automatic retry mechanism, so after encountering a download failure, you can try to call the download command multiple times. If you confirm that the address is indeed inaccessible, you can submit an Issue or PR to update the url or download type.</p><h2 id="doctor-can-t-fix-something" tabindex="-1">Doctor Can't Fix Something <a class="header-anchor" href="#doctor-can-t-fix-something" aria-label="Permalink to "Doctor Can't Fix Something""></a></h2><p>In most cases, the doctor module can automatically repair and install missing system environments, but there are also special circumstances where the automatic repair function cannot be used normally.</p><p>Due to system limitations (for example, software such as Visual Studio cannot be automatically installed under Windows), the automatic repair function cannot be used for some projects. When encountering a function that cannot be automatically repaired, if you encounter the words <code>Some check items can not be fixed</code>, it means that it cannot be automatically repaired. Please submit an issue according to the method displayed on the terminal or repair the environment yourself.</p><h2 id="compile-error" tabindex="-1">Compile Error <a class="header-anchor" href="#compile-error" aria-label="Permalink to "Compile Error""></a></h2><p>When you encounter a compilation error, if the <code>--debug</code> log is not enabled, please enable the debug log first, and then determine the command that reported the error. The error terminal output is very important for fixing compilation errors. When submitting an issue, please upload the last error fragment of the terminal log (or the entire terminal log output), and include the <code>spc</code> command and parameters used.</p>',9),i=[n];function s(l,c,d,u,h,m){return t(),o("div",null,i)}const b=e(r,[["render",s]]);export{f as __pageData,b as default};
|
||||
1
assets/en_guide_troubleshooting.md.BZNNttUZ.lean.js
Normal file
1
assets/en_guide_troubleshooting.md.BZNNttUZ.lean.js
Normal file
@ -0,0 +1 @@
|
||||
import{_ as e,c as o,o as t,a1 as a}from"./chunks/framework.CszIUXhs.js";const f=JSON.parse('{"title":"Troubleshooting","description":"","frontmatter":{},"headers":[],"relativePath":"en/guide/troubleshooting.md","filePath":"en/guide/troubleshooting.md"}'),r={name:"en/guide/troubleshooting.md"},n=a("",9),i=[n];function s(l,c,d,u,h,m){return t(),o("div",null,i)}const b=e(r,[["render",s]]);export{f as __pageData,b as default};
|
||||
1
assets/en_index.md.B7rqxnyF.js
Normal file
1
assets/en_index.md.B7rqxnyF.js
Normal file
@ -0,0 +1 @@
|
||||
import{_ as e,c as t,o as a}from"./chunks/framework.CszIUXhs.js";const u=JSON.parse('{"title":"","description":"","frontmatter":{"layout":"home","hero":{"name":"static-php-cli","tagline":"Build standalone PHP binary on Linux, macOS, FreeBSD, Windows, with PHP project together, with popular extensions included.","actions":[{"theme":"brand","text":"Guide","link":"./guide/"}]},"features":[{"title":"Static CLI Binary","details":"You can easily compile a standalone php binary for general use. Including CLI, FPM sapi."},{"title":"Micro Self-Extracted Executable","details":"You can compile a self-extracted executable and build with your php source code."},{"title":"Dependency Management","details":"static-php-cli comes with dependency management and supports installation of different types of PHP extensions."}]},"headers":[],"relativePath":"en/index.md","filePath":"en/index.md"}'),n={name:"en/index.md"};function i(o,s,c,d,r,l){return a(),t("div")}const m=e(n,[["render",i]]);export{u as __pageData,m as default};
|
||||
1
assets/en_index.md.B7rqxnyF.lean.js
Normal file
1
assets/en_index.md.B7rqxnyF.lean.js
Normal file
@ -0,0 +1 @@
|
||||
import{_ as e,c as t,o as a}from"./chunks/framework.CszIUXhs.js";const u=JSON.parse('{"title":"","description":"","frontmatter":{"layout":"home","hero":{"name":"static-php-cli","tagline":"Build standalone PHP binary on Linux, macOS, FreeBSD, Windows, with PHP project together, with popular extensions included.","actions":[{"theme":"brand","text":"Guide","link":"./guide/"}]},"features":[{"title":"Static CLI Binary","details":"You can easily compile a standalone php binary for general use. Including CLI, FPM sapi."},{"title":"Micro Self-Extracted Executable","details":"You can compile a self-extracted executable and build with your php source code."},{"title":"Dependency Management","details":"static-php-cli comes with dependency management and supports installation of different types of PHP extensions."}]},"headers":[],"relativePath":"en/index.md","filePath":"en/index.md"}'),n={name:"en/index.md"};function i(o,s,c,d,r,l){return a(),t("div")}const m=e(n,[["render",i]]);export{u as __pageData,m as default};
|
||||
1
assets/extension-notes.md.CYTuu5Xm.js
Normal file
1
assets/extension-notes.md.CYTuu5Xm.js
Normal file
@ -0,0 +1 @@
|
||||
import{_ as e,c as t,o as n}from"./chunks/framework.CszIUXhs.js";const m=JSON.parse('{"title":"","description":"","frontmatter":{},"headers":[],"relativePath":"extension-notes.md","filePath":"extension-notes.md"}'),o={name:"extension-notes.md"};function s(a,r,c,i,p,_){return n(),t("div")}const f=e(o,[["render",s]]);export{m as __pageData,f as default};
|
||||
1
assets/extension-notes.md.CYTuu5Xm.lean.js
Normal file
1
assets/extension-notes.md.CYTuu5Xm.lean.js
Normal file
@ -0,0 +1 @@
|
||||
import{_ as e,c as t,o as n}from"./chunks/framework.CszIUXhs.js";const m=JSON.parse('{"title":"","description":"","frontmatter":{},"headers":[],"relativePath":"extension-notes.md","filePath":"extension-notes.md"}'),o={name:"extension-notes.md"};function s(a,r,c,i,p,_){return n(),t("div")}const f=e(o,[["render",s]]);export{m as __pageData,f as default};
|
||||
1
assets/extensions.md.C4hBsrw7.js
Normal file
1
assets/extensions.md.C4hBsrw7.js
Normal file
File diff suppressed because one or more lines are too long
1
assets/extensions.md.C4hBsrw7.lean.js
Normal file
1
assets/extensions.md.C4hBsrw7.lean.js
Normal file
@ -0,0 +1 @@
|
||||
import{_ as t,c as d,o as e,a1 as s}from"./chunks/framework.CszIUXhs.js";const f=JSON.parse('{"title":"","description":"","frontmatter":{},"headers":[],"relativePath":"extensions.md","filePath":"extensions.md"}'),y={name:"extensions.md"},r=s("",1),o=[r];function n(a,l,i,h,m,p){return e(),d("div",null,o)}const c=t(y,[["render",n]]);export{f as __pageData,c as default};
|
||||
1
assets/index.md.DDaDbFm-.js
Normal file
1
assets/index.md.DDaDbFm-.js
Normal file
@ -0,0 +1 @@
|
||||
import{_ as e,c as t,o as a}from"./chunks/framework.CszIUXhs.js";const u=JSON.parse('{"title":"","description":"","frontmatter":{"layout":"home","hero":{"name":"static-php-cli","tagline":"Build standalone PHP binary on Linux, macOS, FreeBSD, Windows, with PHP project together, with popular extensions included.","actions":[{"theme":"brand","text":"Get Started","link":"/en/guide/"},{"theme":"alt","text":"中文文档","link":"/zh/"}]},"features":[{"title":"Static CLI Binary","details":"You can easily compile a standalone php binary for general use. Including CLI, FPM sapi."},{"title":"Micro Self-Extracted Executable","details":"You can compile a self-extracted executable and build with your php source code."},{"title":"Dependency Management","details":"static-php-cli comes with dependency management and supports installation of different types of PHP extensions."}]},"headers":[],"relativePath":"index.md","filePath":"index.md"}'),n={name:"index.md"};function i(o,s,c,r,d,l){return a(),t("div")}const m=e(n,[["render",i]]);export{u as __pageData,m as default};
|
||||
1
assets/index.md.DDaDbFm-.lean.js
Normal file
1
assets/index.md.DDaDbFm-.lean.js
Normal file
@ -0,0 +1 @@
|
||||
import{_ as e,c as t,o as a}from"./chunks/framework.CszIUXhs.js";const u=JSON.parse('{"title":"","description":"","frontmatter":{"layout":"home","hero":{"name":"static-php-cli","tagline":"Build standalone PHP binary on Linux, macOS, FreeBSD, Windows, with PHP project together, with popular extensions included.","actions":[{"theme":"brand","text":"Get Started","link":"/en/guide/"},{"theme":"alt","text":"中文文档","link":"/zh/"}]},"features":[{"title":"Static CLI Binary","details":"You can easily compile a standalone php binary for general use. Including CLI, FPM sapi."},{"title":"Micro Self-Extracted Executable","details":"You can compile a self-extracted executable and build with your php source code."},{"title":"Dependency Management","details":"static-php-cli comes with dependency management and supports installation of different types of PHP extensions."}]},"headers":[],"relativePath":"index.md","filePath":"index.md"}'),n={name:"index.md"};function i(o,s,c,r,d,l){return a(),t("div")}const m=e(n,[["render",i]]);export{u as __pageData,m as default};
|
||||
BIN
assets/inter-italic-cyrillic-ext.r48I6akx.woff2
Normal file
BIN
assets/inter-italic-cyrillic-ext.r48I6akx.woff2
Normal file
Binary file not shown.
BIN
assets/inter-italic-cyrillic.By2_1cv3.woff2
Normal file
BIN
assets/inter-italic-cyrillic.By2_1cv3.woff2
Normal file
Binary file not shown.
BIN
assets/inter-italic-greek-ext.1u6EdAuj.woff2
Normal file
BIN
assets/inter-italic-greek-ext.1u6EdAuj.woff2
Normal file
Binary file not shown.
BIN
assets/inter-italic-greek.DJ8dCoTZ.woff2
Normal file
BIN
assets/inter-italic-greek.DJ8dCoTZ.woff2
Normal file
Binary file not shown.
BIN
assets/inter-italic-latin-ext.CN1xVJS-.woff2
Normal file
BIN
assets/inter-italic-latin-ext.CN1xVJS-.woff2
Normal file
Binary file not shown.
BIN
assets/inter-italic-latin.C2AdPX0b.woff2
Normal file
BIN
assets/inter-italic-latin.C2AdPX0b.woff2
Normal file
Binary file not shown.
BIN
assets/inter-italic-vietnamese.BSbpV94h.woff2
Normal file
BIN
assets/inter-italic-vietnamese.BSbpV94h.woff2
Normal file
Binary file not shown.
BIN
assets/inter-roman-cyrillic-ext.BBPuwvHQ.woff2
Normal file
BIN
assets/inter-roman-cyrillic-ext.BBPuwvHQ.woff2
Normal file
Binary file not shown.
BIN
assets/inter-roman-cyrillic.C5lxZ8CY.woff2
Normal file
BIN
assets/inter-roman-cyrillic.C5lxZ8CY.woff2
Normal file
Binary file not shown.
BIN
assets/inter-roman-greek-ext.CqjqNYQ-.woff2
Normal file
BIN
assets/inter-roman-greek-ext.CqjqNYQ-.woff2
Normal file
Binary file not shown.
BIN
assets/inter-roman-greek.BBVDIX6e.woff2
Normal file
BIN
assets/inter-roman-greek.BBVDIX6e.woff2
Normal file
Binary file not shown.
BIN
assets/inter-roman-latin-ext.4ZJIpNVo.woff2
Normal file
BIN
assets/inter-roman-latin-ext.4ZJIpNVo.woff2
Normal file
Binary file not shown.
BIN
assets/inter-roman-latin.Di8DUHzh.woff2
Normal file
BIN
assets/inter-roman-latin.Di8DUHzh.woff2
Normal file
Binary file not shown.
BIN
assets/inter-roman-vietnamese.BjW4sHH5.woff2
Normal file
BIN
assets/inter-roman-vietnamese.BjW4sHH5.woff2
Normal file
Binary file not shown.
1
assets/style.BJI_MZVL.css
Normal file
1
assets/style.BJI_MZVL.css
Normal file
File diff suppressed because one or more lines are too long
1
assets/zh_contributing_index.md.BgLPhRbJ.js
Normal file
1
assets/zh_contributing_index.md.BgLPhRbJ.js
Normal file
@ -0,0 +1 @@
|
||||
import{_ as e,c as a,o,a1 as i}from"./chunks/framework.CszIUXhs.js";const _=JSON.parse('{"title":"贡献指南","description":"","frontmatter":{},"headers":[],"relativePath":"zh/contributing/index.md","filePath":"zh/contributing/index.md"}'),l={name:"zh/contributing/index.md"},t=i('<h1 id="贡献指南" tabindex="-1">贡献指南 <a class="header-anchor" href="#贡献指南" aria-label="Permalink to "贡献指南""></a></h1><p>感谢你能够看到这里,本项目非常欢迎你的贡献!</p><h2 id="贡献方法" tabindex="-1">贡献方法 <a class="header-anchor" href="#贡献方法" aria-label="Permalink to "贡献方法""></a></h2><p>如果你有代码或文档想要贡献,需要先了解以下内容。</p><ol><li>你要贡献什么类型的代码?(新扩展、修复 Bug、安全问题、项目框架优化、文档)</li><li>如果你贡献了新文件或新片段,你的代码是否经过 <code>php-cs-fixer</code> 和 <code>phpstan</code> 的检查?</li><li>在贡献代码前是否充分阅读了 <a href="./../develop/">开发指南</a>?</li></ol><p>如果你可以回答以上问题,并已经对代码做出了修改,可以及时在项目 GitHub 仓库发起 Pull Request。待代码审查完毕后,可根据建议修改代码,或直接合并到主分支。</p><h2 id="贡献类型" tabindex="-1">贡献类型 <a class="header-anchor" href="#贡献类型" aria-label="Permalink to "贡献类型""></a></h2><p>本项目主要用途是编译静态链接的 PHP 二进制,基于 <code>symfony/console</code> 编写了命令行处理功能。在开发之前,如果你对它不够熟悉, 可以先查看 <a href="https://symfony.com/doc/current/components/console.html" target="_blank" rel="noreferrer">symfony/console 文档</a>。</p><h3 id="安全问题" tabindex="-1">安全问题 <a class="header-anchor" href="#安全问题" aria-label="Permalink to "安全问题""></a></h3><p>因为本项目基本上是属于本地运行的 PHP 项目,一般来说不会存在远程攻击行为。但如果你发现了此类问题,请<strong>不要</strong>在 GitHub 仓库提交 PR 或 Issue, 你需要通过 <a href="mailto:admin@zhamao.me" target="_blank" rel="noreferrer">邮件</a> 的方式联系项目维护者(crazywhalecc)。</p><h3 id="修复-bug" tabindex="-1">修复 Bug <a class="header-anchor" href="#修复-bug" aria-label="Permalink to "修复 Bug""></a></h3><p>修复 Bug 一般不涉及项目结构和框架的修改,所以如果你可以定位到错误代码并直接修复它,请直接提交 PR。</p><h3 id="新扩展" tabindex="-1">新扩展 <a class="header-anchor" href="#新扩展" aria-label="Permalink to "新扩展""></a></h3><p>对于添加一个新扩展来说,你需要先了解一些本项目的基本结构,以及如何根据现有的逻辑添加新扩展。在本页的下一章节将会详细介绍。 总的来说,你需要:</p><ol><li>评估扩展是否可以内联编译到 PHP 中。</li><li>评估扩展的依赖库(如果有)是否可以静态编译。</li><li>写出扩展的依赖库在不同平台编译命令。</li><li>验证扩展及其依赖库能否与现有扩展和依赖库兼容。</li><li>验证扩展在 <code>cli</code>、<code>micro</code>、<code>fpm</code>、<code>embed</code> 几种 SAPI 中均正常工作。</li><li>编写文档,加入你的扩展。</li></ol><h3 id="项目框架优化" tabindex="-1">项目框架优化 <a class="header-anchor" href="#项目框架优化" aria-label="Permalink to "项目框架优化""></a></h3><p>如果你已经熟悉 <code>symfony/console</code> 的工作原理,并同时要对项目的框架进行一些修改或优化,请先了解以下事情:</p><ol><li>加入扩展不属于项目框架优化,但如果你在加入新的扩展时发现不得不优化框架,则需先对框架本身进行修改,然后再加入扩展。</li><li>对于一些大规模逻辑修改(例如涉及 LibraryBase、Extension 对象等的修改)时,建议先提交 Issue 或 Draft PR 进行讨论方案。</li><li>项目早期为纯中文开发项目,代码中存在一部分中文的注释。国际化项目后你可以提交 PR 将这些注释翻译为英语。</li><li>请不要在代码中提交包含较多无用的代码片段,例如大量未被使用的变量、方法、类、重复写了很多次的代码。</li></ol>',18),r=[t];function n(c,d,s,h,p,u){return o(),a("div",null,r)}const f=e(l,[["render",n]]);export{_ as __pageData,f as default};
|
||||
1
assets/zh_contributing_index.md.BgLPhRbJ.lean.js
Normal file
1
assets/zh_contributing_index.md.BgLPhRbJ.lean.js
Normal file
@ -0,0 +1 @@
|
||||
import{_ as e,c as a,o,a1 as i}from"./chunks/framework.CszIUXhs.js";const _=JSON.parse('{"title":"贡献指南","description":"","frontmatter":{},"headers":[],"relativePath":"zh/contributing/index.md","filePath":"zh/contributing/index.md"}'),l={name:"zh/contributing/index.md"},t=i("",18),r=[t];function n(c,d,s,h,p,u){return o(),a("div",null,r)}const f=e(l,[["render",n]]);export{_ as __pageData,f as default};
|
||||
29
assets/zh_develop_doctor-module.md.CPRdzud3.js
Normal file
29
assets/zh_develop_doctor-module.md.CPRdzud3.js
Normal file
@ -0,0 +1,29 @@
|
||||
import{_ as s,c as i,o as a,a1 as n}from"./chunks/framework.CszIUXhs.js";const g=JSON.parse('{"title":"Doctor 模块","description":"","frontmatter":{},"headers":[],"relativePath":"zh/develop/doctor-module.md","filePath":"zh/develop/doctor-module.md"}'),h={name:"zh/develop/doctor-module.md"},l=n(`<h1 id="doctor-模块" tabindex="-1">Doctor 模块 <a class="header-anchor" href="#doctor-模块" aria-label="Permalink to "Doctor 模块""></a></h1><p>Doctor 模块是一个较为独立的用于检查系统环境的模块,可使用命令 <code>bin/spc doctor</code> 进入,入口的命令类在 <code>DoctorCommand.php</code> 中。</p><p>Doctor 模块是一个检查单,里面有一系列的检查项目和自动修复项目。这些项目都存放在 <code>src/SPC/doctor/item/</code> 目录中, 并且使用了两种 Attribute 用作检查项标记和自动修复项目标记:<code>#[AsCheckItem]</code> 和 <code>#[AsFixItem]</code>。</p><p>以现有的检查项 <code>if necessary tools are installed</code>,它是用于检查编译必需的包是否安装在 macOS 系统内,下面是它的源码:</p><div class="language-php vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">php</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">use</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> SPC\\doctor\\AsCheckItem</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">use</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> SPC\\doctor\\AsFixItem</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">use</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> SPC\\doctor\\CheckResult</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
|
||||
<span class="line"></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">#[</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">AsCheckItem</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'if necessary tools are installed'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">limit_os</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'Darwin'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">level</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">997</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)]</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">public</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> function</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> checkCliTools</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">()</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> ?</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">CheckResult</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">{</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> $missing </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> [];</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> foreach</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> (</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">self::</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">REQUIRED_COMMANDS</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> as</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> $cmd) {</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> if</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> (</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">$this</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">findCommand</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">($cmd) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">===</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> null</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) {</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> $missing[] </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> $cmd;</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> if</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> (</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">!</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">empty</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">($missing)) {</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> CheckResult</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">::</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">fail</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'missing system commands: '</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> .</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> implode</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">', '</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, $missing), </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'build-tools'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, [$missing]);</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> CheckResult</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">::</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">ok</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">();</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><p>属性的第一个参数就是检查项目的名称,后面的 <code>limit_os</code> 参数是限制了该检查项仅在指定的系统下触发,<code>level</code> 是执行该检查项的优先级,数字越大,优先级越高。</p><p>里面用到的 <code>$this->findCommand()</code> 方法为 <code>SPC\\builder\\traits\\UnixSystemUtilTrait</code> 的方法,用途是查找系统命令所在位置,找不到时返回 NULL。</p><p>每个检查项的方法都应该返回一个 <code>SPC\\doctor\\CheckResult</code>:</p><ul><li>在返回 <code>CheckResult::fail()</code> 时,第一个参数用于输出终端的错误提示,第二个参数是在这个检查项可自动修复时的修复项目名称。</li><li>在返回 <code>CheckResult::ok()</code> 时,表明检查通过。你也可以传递一个参数,用于返回检查结果,例如:<code>CheckResult::ok('OS supported')</code>。</li><li>在返回 <code>CheckResult::fail()</code> 时,如果包含了第三个参数,第三个参数的数组将被当作 <code>AsFixItem</code> 的参数。</li></ul><p>下面是这个检查项对应的自动修复项的方法:</p><div class="language-php vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">php</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">#[</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">AsFixItem</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'build-tools'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)]</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">public</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> function</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> fixBuildTools</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">array</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> $missing)</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> bool</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">{</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> foreach</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> ($missing </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">as</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> $cmd) {</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> try</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
|
||||
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> shell</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">true</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">-></span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">exec</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'brew install '</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> .</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> escapeshellarg</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">($cmd));</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> } </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">catch</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> (</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">RuntimeException</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) {</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> false</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> true</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><p><code>#[AsFixItem()]</code> 属性传入的参数即修复项的名称,该方法必须返回 True 或 False。当返回 False 时,表明自动修复失败,需要手动处理。</p><p>此处的代码中 <code>shell()->exec()</code> 是项目的执行命令的方法,用于替代 <code>exec()</code>、<code>system()</code>,同时提供了 debug、获取执行状态、进入目录等特性。</p>`,13),k=[l];function t(p,e,d,E,r,c){return a(),i("div",null,k)}const y=s(h,[["render",t]]);export{g as __pageData,y as default};
|
||||
1
assets/zh_develop_doctor-module.md.CPRdzud3.lean.js
Normal file
1
assets/zh_develop_doctor-module.md.CPRdzud3.lean.js
Normal file
@ -0,0 +1 @@
|
||||
import{_ as s,c as i,o as a,a1 as n}from"./chunks/framework.CszIUXhs.js";const g=JSON.parse('{"title":"Doctor 模块","description":"","frontmatter":{},"headers":[],"relativePath":"zh/develop/doctor-module.md","filePath":"zh/develop/doctor-module.md"}'),h={name:"zh/develop/doctor-module.md"},l=n("",13),k=[l];function t(p,e,d,E,r,c){return a(),i("div",null,k)}const y=s(h,[["render",t]]);export{g as __pageData,y as default};
|
||||
1
assets/zh_develop_index.md.CISWAEXj.js
Normal file
1
assets/zh_develop_index.md.CISWAEXj.js
Normal file
@ -0,0 +1 @@
|
||||
import{_ as e,c as a,o as t,a1 as o}from"./chunks/framework.CszIUXhs.js";const m=JSON.parse('{"title":"开发简介","description":"","frontmatter":{},"headers":[],"relativePath":"zh/develop/index.md","filePath":"zh/develop/index.md"}'),p={name:"zh/develop/index.md"},i=o('<h1 id="开发简介" tabindex="-1">开发简介 <a class="header-anchor" href="#开发简介" aria-label="Permalink to "开发简介""></a></h1><p>开发本项目需要安装部署 PHP 环境,以及一些 PHP 项目常用的扩展和 Composer。</p><p>项目的开发环境和运行环境几乎完全一致,你可以参照 <strong>指南-本地构建</strong> 部分安装系统 PHP 或使用本项目预构建的静态 PHP 作为环境,这里不再赘述。</p><p>抛开用途,本项目本身其实就是一个 <code>php-cli</code> 程序,你可以将它当作一个正常的 PHP 项目进行编辑和开发,同时你需要了解不同系统的 Shell 命令行。</p><p>本项目目前的目的就是为了编译静态编译的独立 PHP,但主体部分也包含编译很多依赖库的静态版本,所以你可以复用这套编译逻辑,用于构建其他程序的独立二进制版本,例如 Nginx 等。</p><h2 id="环境准备" tabindex="-1">环境准备 <a class="header-anchor" href="#环境准备" aria-label="Permalink to "环境准备""></a></h2><p>开发本项目需要 PHP 环境。你可以使用系统自带的 PHP,也可以使用本项目构建的静态 PHP。</p><p>无论是使用哪种 PHP,在开发环境,你需要安装这些扩展:</p><div class="language- vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>curl,dom,filter,mbstring,openssl,pcntl,phar,posix,sodium,tokenizer,xml,xmlwriter</span></span></code></pre></div><p>static-php-cli 项目本身不需要这么多扩展,但在开发过程中,你会用到 Composer、PHPUnit 等工具,它们需要这些扩展。</p><blockquote><p>对于 static-php-cli 自身构建的 micro 自执行二进制,仅需要 <code>pcntl,posix,mbstring,tokenizer,phar</code>。</p></blockquote><h2 id="开始开发" tabindex="-1">开始开发 <a class="header-anchor" href="#开始开发" aria-label="Permalink to "开始开发""></a></h2><p>继续向下查看项目结构的文档,你可以从中了解 <code>static-php-cli</code> 是如何运作的。</p>',13),s=[i];function n(c,r,l,d,h,P){return t(),a("div",null,s)}const u=e(p,[["render",n]]);export{m as __pageData,u as default};
|
||||
1
assets/zh_develop_index.md.CISWAEXj.lean.js
Normal file
1
assets/zh_develop_index.md.CISWAEXj.lean.js
Normal file
@ -0,0 +1 @@
|
||||
import{_ as e,c as a,o as t,a1 as o}from"./chunks/framework.CszIUXhs.js";const m=JSON.parse('{"title":"开发简介","description":"","frontmatter":{},"headers":[],"relativePath":"zh/develop/index.md","filePath":"zh/develop/index.md"}'),p={name:"zh/develop/index.md"},i=o("",13),s=[i];function n(c,r,l,d,h,P){return t(),a("div",null,s)}const u=e(p,[["render",n]]);export{m as __pageData,u as default};
|
||||
105
assets/zh_develop_source-module.md.DMk5GAAn.js
Normal file
105
assets/zh_develop_source-module.md.DMk5GAAn.js
Normal file
@ -0,0 +1,105 @@
|
||||
import{_ as s,c as i,o as a,a1 as t}from"./chunks/framework.CszIUXhs.js";const g=JSON.parse('{"title":"资源模块","description":"","frontmatter":{},"headers":[],"relativePath":"zh/develop/source-module.md","filePath":"zh/develop/source-module.md"}'),n={name:"zh/develop/source-module.md"},l=t(`<h1 id="资源模块" tabindex="-1">资源模块 <a class="header-anchor" href="#资源模块" aria-label="Permalink to "资源模块""></a></h1><p>static-php-cli 的下载资源模块是一个主要的功能,它包含了所依赖的库、外部扩展、PHP 源码的下载方式和资源解压方式。 下载的配置文件主要涉及 <code>source.json</code> 和 <code>pkg.json</code> 文件,这个文件记录了所有可下载的资源的下载方式。</p><p>下载功能主要涉及的命令有 <code>bin/spc download</code> 和 <code>bin/spc extract</code>。其中 <code>download</code> 命令是一个下载器,它会根据配置文件下载资源; <code>extract</code> 命令是一个解压器,它会根据配置文件解压资源。</p><p>一般来说,下载资源可能会比较慢,因为这些资源来源于各个官网、GitHub 等不同位置,同时它们也占用了较大空间,所以你可以在一次下载资源后,可重复使用。</p><p>下载器的配置文件是 <code>source.json</code>,它包含了所有资源的下载方式,你可以在其中添加你需要的资源下载方式,也可以修改已有的资源下载方式。</p><p>每个资源的下载配置结构如下,下面是 <code>libevent</code> 扩展对应的资源下载配置:</p><div class="language-json vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">json</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">{</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "libevent"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: {</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "type"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"ghrel"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "repo"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"libevent/libevent"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "match"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"libevent.+</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">\\\\</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">.tar</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">\\\\</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">.gz"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "license"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: {</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "type"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"file"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "path"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"LICENSE"</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><p>这里最主要的字段是 <code>type</code>,目前它支持的类型有:</p><ul><li><code>url</code>: 直接使用 URL 下载,例如:<code>https://download.libsodium.org/libsodium/releases/libsodium-1.0.18.tar.gz</code>。</li><li><code>ghrel</code>: 使用 GitHub Release API 下载,即从 GitHub 项目发布的最新版本中上传的附件下载。</li><li><code>ghtar</code>: 使用 GitHub Release API 下载,与 <code>ghrel</code> 不同的是,<code>ghtar</code> 是从项目的最新 Release 中找 <code>source code (tar.gz)</code> 下载的。</li><li><code>ghtagtar</code>: 使用 GitHub Release API 下载,与 <code>ghtar</code> 相比,<code>ghtagtar</code> 可以从 <code>tags</code> 列表找最新的,并下载 <code>tar.gz</code> 格式的源码(因为有些项目只使用了 <code>tag</code> 发布版本)。</li><li><code>bitbuckettag</code>: 使用 BitBucket API 下载,基本和 <code>ghtagtar</code> 相同,只是这个适用于 BitBucket。</li><li><code>git</code>: 直接从一个 Git 地址克隆项目来下载资源,适用于任何公开 Git 仓库。</li><li><code>filelist</code>: 使用爬虫爬取提供文件索引的 Web 下载站点,并获取最新版本的文件名并下载。</li><li><code>custom</code>: 如果以上下载方式都不能满足,你可以编写 <code>custom</code> 后,在 <code>src/SPC/store/source/</code> 下新建一个类,并继承 <code>CustomSourceBase</code>,自己编写下载脚本。</li></ul><h2 id="source-json-通用参数" tabindex="-1">source.json 通用参数 <a class="header-anchor" href="#source-json-通用参数" aria-label="Permalink to "source.json 通用参数""></a></h2><p>source.json 中每个源文件拥有以下字段:</p><ul><li><code>license</code>: 源代码的开源许可证,见下方 <strong>开源许可证</strong> 章节</li><li><code>type</code>: 必须为上面提到的类型之一</li><li><code>path</code>(可选): 释放源码到指定目录而非 <code>source/{name}</code></li></ul><div class="tip custom-block"><p class="custom-block-title">TIP</p><p><code>source.json</code> 中的 <code>path</code> 参数可指定相对路径或绝对路径。当指定为相对路径时,路径基于 <code>source/</code>。</p></div><h2 id="下载类型-url" tabindex="-1">下载类型 - url <a class="header-anchor" href="#下载类型-url" aria-label="Permalink to "下载类型 - url""></a></h2><p>url 类型的资源指的是从 URL 直接下载文件。</p><p>包含的参数有:</p><ul><li><code>url</code>: 文件的下载地址,如 <code>https://example.com/file.tgz</code></li><li><code>filename</code>(可选): 保存到本地的文件名,如不指定,则使用 url 的文件名</li></ul><p>例子(下载 imagick 扩展,并解压缩到 php 源码的扩展存放路径):</p><div class="language-json vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">json</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">{</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "ext-imagick"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: {</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "type"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"url"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "url"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"https://pecl.php.net/get/imagick"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "path"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"php-src/ext/imagick"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "filename"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"imagick.tgz"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "license"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: {</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "type"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"file"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "path"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"LICENSE"</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><h2 id="下载类型-ghrel" tabindex="-1">下载类型 - ghrel <a class="header-anchor" href="#下载类型-ghrel" aria-label="Permalink to "下载类型 - ghrel""></a></h2><p>ghrel 会从 GitHub Release 中上传的 Assets 下载文件。首先使用 GitHub Release API 获取最新版本,然后根据正则匹配方式下载相应的文件。</p><p>包含的参数有:</p><ul><li><code>repo</code>: GitHub 仓库名称</li><li><code>match</code>: 匹配 Assets 文件的正则表达式</li><li><code>prefer-stable</code>: 是否优先下载稳定版本(默认为 <code>false</code>)</li></ul><p>例子(下载 libsodium 库,匹配 Release 中的 libsodium-x.y.tar.gz 文件):</p><div class="language-json vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">json</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">{</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "libsodium"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: {</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "type"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"ghrel"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "repo"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"jedisct1/libsodium"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "match"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"libsodium-</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">\\\\</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">d+(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">\\\\</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">.</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">\\\\</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">d+)*</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">\\\\</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">.tar</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">\\\\</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">.gz"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "license"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: {</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "type"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"file"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "path"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"LICENSE"</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><h2 id="下载类型-ghtar" tabindex="-1">下载类型 - ghtar <a class="header-anchor" href="#下载类型-ghtar" aria-label="Permalink to "下载类型 - ghtar""></a></h2><p>ghtar 会从 GitHub Release Tag 下载文件,与 <code>ghrel</code> 不同的是,<code>ghtar</code> 是从项目的最新 Release 中找 <code>source code (tar.gz)</code> 下载的。</p><p>包含的参数有:</p><ul><li><code>repo</code>: GitHub 仓库名称</li><li><code>prefer-stable</code>: 是否优先下载稳定版本(默认为 <code>false</code>)</li></ul><p>例子(brotli 库):</p><div class="language-json vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">json</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">{</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "brotli"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: {</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "type"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"ghtar"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "repo"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"google/brotli"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "license"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: {</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "type"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"file"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "path"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"LICENSE"</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><h2 id="下载类型-ghtagtar" tabindex="-1">下载类型 - ghtagtar <a class="header-anchor" href="#下载类型-ghtagtar" aria-label="Permalink to "下载类型 - ghtagtar""></a></h2><p>使用 GitHub Release API 下载,与 <code>ghtar</code> 相比,<code>ghtagtar</code> 可以从 <code>tags</code> 列表找最新的,并下载 <code>tar.gz</code> 格式的源码(因为有些项目只使用了 <code>tag</code> 发布版本)。</p><p>包含的参数有:</p><ul><li><code>repo</code>: GitHub 仓库名称</li><li><code>prefer-stable</code>: 是否优先下载稳定版本(默认为 <code>false</code>)</li></ul><p>例子(gmp 库):</p><div class="language-json vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">json</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">{</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "gmp"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: {</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "type"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"ghtagtar"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "repo"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"alisw/GMP"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "license"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: {</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "type"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"text"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "text"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"EXAMPLE LICENSE"</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><h2 id="下载类型-bitbuckettag" tabindex="-1">下载类型 - bitbuckettag <a class="header-anchor" href="#下载类型-bitbuckettag" aria-label="Permalink to "下载类型 - bitbuckettag""></a></h2><p>使用 BitBucket API 下载,基本和 <code>ghtagtar</code> 相同,只是这个适用于 BitBucket。</p><p>包含的参数有:</p><ul><li><code>repo</code>: BitBucket 仓库名称</li></ul><h2 id="下载类型-git" tabindex="-1">下载类型 - git <a class="header-anchor" href="#下载类型-git" aria-label="Permalink to "下载类型 - git""></a></h2><p>直接从一个 Git 地址克隆项目来下载资源,适用于任何公开 Git 仓库。</p><p>包含的参数有:</p><ul><li><code>url</code>: Git 链接(仅限 HTTPS)</li><li><code>rev</code>: 分支名称</li></ul><div class="language-json vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">json</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">{</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "imap"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: {</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "type"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"git"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "url"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"https://github.com/static-php/imap.git"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "rev"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"master"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "license"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: {</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "type"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"file"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "path"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"LICENSE"</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><h2 id="下载类型-filelist" tabindex="-1">下载类型 - filelist <a class="header-anchor" href="#下载类型-filelist" aria-label="Permalink to "下载类型 - filelist""></a></h2><p>使用爬虫爬取提供文件索引的 Web 下载站点,并获取最新版本的文件名并下载。</p><p>注意,该方法仅限于镜像站、GNU 官网等具有页面 index 功能的静态站点使用。</p><p>包含的参数有:</p><ul><li><code>url</code>: 要爬取文件最新版本的页面 URL</li><li><code>regex</code>: 匹配文件名及下载链接的正则表达式</li></ul><p>例子(从 GNU 官网下载 libiconv 库):</p><div class="language-json vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">json</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">{</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "libiconv"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: {</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "type"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"filelist"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "url"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"https://ftp.gnu.org/gnu/libiconv/"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "regex"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"/href=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">\\"</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">(?<file>libiconv-(?<version>[^</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">\\"</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">]+)</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">\\\\</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">.tar</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">\\\\</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">.gz)</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">\\"</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">/"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "license"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: {</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "type"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"file"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "path"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"COPYING"</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><h2 id="下载类型-custom" tabindex="-1">下载类型 - custom <a class="header-anchor" href="#下载类型-custom" aria-label="Permalink to "下载类型 - custom""></a></h2><p>如果以上下载方式都不能满足,你可以编写 <code>custom</code> 后,在 <code>src/SPC/store/source/</code> 下新建一个类,并继承 <code>CustomSourceBase</code>,自己编写下载脚本。</p><p>这里不再赘述,你可以查看 <code>src/SPC/store/source/PhpSource.php</code> 或 <code>src/SPC/store/source/PostgreSQLSource.php</code> 作为例子。</p><h2 id="pkg-json-通用参数" tabindex="-1">pkg.json 通用参数 <a class="header-anchor" href="#pkg-json-通用参数" aria-label="Permalink to "pkg.json 通用参数""></a></h2><p>pkg.json 存放的是非源码类型的文件资源,例如 musl-toolchain、UPX 等预编译的工具。它的使用包含:</p><ul><li><code>type</code>: 与 <code>source.json</code> 相同的类型及不同种类的参数。</li><li><code>extract</code>(可选): 下载后解压缩的路径,默认为 <code>pkgroot/{pkg_name}</code>。</li><li><code>extract-files</code>(可选): 下载后仅解压指定的文件到指定位置。</li></ul><p>需要注意的是,<code>pkg.json</code> 不涉及源代码的编译和修改分发,所以没有 <code>license</code> 开源许可证字段。并且你不能同时使用 <code>extract</code> 和 <code>extract-files</code> 参数。</p><p>例子(下载 nasm 到本地,并只提取程序文件到 PHP SDK):</p><div class="language-json vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">json</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">{</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "nasm-x86_64-win"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: {</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "type"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"url"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "url"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"https://www.nasm.us/pub/nasm/releasebuilds/2.16.01/win64/nasm-2.16.01-win64.zip"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "extract-files"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: {</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "nasm-2.16.01/nasm.exe"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"{php_sdk_path}/bin/nasm.exe"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "nasm-2.16.01/ndisasm.exe"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"{php_sdk_path}/bin/ndisasm.exe"</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><p><code>extract-files</code> 中的键名为源文件夹下的文件,键值为存放的路径。存放的路径可以使用以下变量:</p><ul><li><code>{php_sdk_path}</code>: (仅限 Windows)PHP SDK 路径</li><li><code>{pkg_root_path}</code>: <code>pkgroot/</code></li><li><code>{working_dir}</code>: 当前工作目录</li><li><code>{download_path}</code>: 下载目录</li><li><code>{source_path}</code>: 源码解压缩目录</li></ul><p>当 <code>extract-files</code> 不使用变量且为相对路径时,相对路径的目录为 <code>{working_dir}</code>。</p><h2 id="开源许可证" tabindex="-1">开源许可证 <a class="header-anchor" href="#开源许可证" aria-label="Permalink to "开源许可证""></a></h2><p>对于 <code>source.json</code> 而言,每个源文件都应包含开源许可证。<code>license</code> 字段存放了开源许可证的信息。</p><p>每个 <code>license</code> 包含的参数有:</p><ul><li><code>type</code>: <code>file</code> 或 <code>text</code></li><li><code>path</code>: 源代码目录中的许可证文件(当 <code>type</code> 为 <code>file</code> 时,此项必填)</li><li><code>text</code>: 许可证文本(当 <code>type</code> 为 <code>text</code> 时,此项必填)</li></ul><p>例子(yaml 扩展的源代码中带有 LICENSE 文件):</p><div class="language-json vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">json</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">{</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "yaml"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: {</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "type"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"git"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "path"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"php-src/ext/yaml"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "rev"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"php7"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "url"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"https://github.com/php/pecl-file_formats-yaml"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "license"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: {</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "type"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"file"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "path"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"LICENSE"</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><p>当开源项目拥有多个许可证时,可指定多个文件:</p><div class="language-json vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">json</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">{</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "libuv"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: {</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "type"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"ghtar"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "repo"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"libuv/libuv"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "license"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: [</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "type"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"file"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "path"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"LICENSE"</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "type"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"file"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "path"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"LICENSE-extra"</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> ]</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div>`,73),p=[l];function e(h,k,o,E,d,r){return a(),i("div",null,p)}const u=s(n,[["render",e]]);export{g as __pageData,u as default};
|
||||
1
assets/zh_develop_source-module.md.DMk5GAAn.lean.js
Normal file
1
assets/zh_develop_source-module.md.DMk5GAAn.lean.js
Normal file
@ -0,0 +1 @@
|
||||
import{_ as s,c as i,o as a,a1 as t}from"./chunks/framework.CszIUXhs.js";const g=JSON.parse('{"title":"资源模块","description":"","frontmatter":{},"headers":[],"relativePath":"zh/develop/source-module.md","filePath":"zh/develop/source-module.md"}'),n={name:"zh/develop/source-module.md"},l=t("",73),p=[l];function e(h,k,o,E,d,r){return a(),i("div",null,p)}const u=s(n,[["render",e]]);export{g as __pageData,u as default};
|
||||
10
assets/zh_develop_structure.md.DJyPDdQ4.js
Normal file
10
assets/zh_develop_structure.md.DJyPDdQ4.js
Normal file
File diff suppressed because one or more lines are too long
1
assets/zh_develop_structure.md.DJyPDdQ4.lean.js
Normal file
1
assets/zh_develop_structure.md.DJyPDdQ4.lean.js
Normal file
@ -0,0 +1 @@
|
||||
import{_ as e,c as o,o as c,a1 as d}from"./chunks/framework.CszIUXhs.js";const u=JSON.parse('{"title":"项目结构简介","description":"","frontmatter":{},"headers":[],"relativePath":"zh/develop/structure.md","filePath":"zh/develop/structure.md"}'),a={name:"zh/develop/structure.md"},t=d("",49),p=[t];function r(s,l,i,n,h,m){return c(),o("div",null,p)}const b=e(a,[["render",r]]);export{u as __pageData,b as default};
|
||||
67
assets/zh_develop_system-build-tools.md.DvA9SnOG.js
Normal file
67
assets/zh_develop_system-build-tools.md.DvA9SnOG.js
Normal file
File diff suppressed because one or more lines are too long
1
assets/zh_develop_system-build-tools.md.DvA9SnOG.lean.js
Normal file
1
assets/zh_develop_system-build-tools.md.DvA9SnOG.lean.js
Normal file
@ -0,0 +1 @@
|
||||
import{_ as s,c as i,o as a,a1 as l}from"./chunks/framework.CszIUXhs.js";const g=JSON.parse('{"title":"系统编译工具","description":"","frontmatter":{},"headers":[],"relativePath":"zh/develop/system-build-tools.md","filePath":"zh/develop/system-build-tools.md"}'),n={name:"zh/develop/system-build-tools.md"},p=l("",50),e=[p];function h(t,k,c,d,o,r){return a(),i("div",null,e)}const F=s(n,[["render",h]]);export{g as __pageData,F as default};
|
||||
2
assets/zh_faq_index.md.Bs3v_2I2.js
Normal file
2
assets/zh_faq_index.md.Bs3v_2I2.js
Normal file
@ -0,0 +1,2 @@
|
||||
import{_ as e,c as a,o,a1 as i}from"./chunks/framework.CszIUXhs.js";const m=JSON.parse('{"title":"常见问题","description":"","frontmatter":{},"headers":[],"relativePath":"zh/faq/index.md","filePath":"zh/faq/index.md"}'),s={name:"zh/faq/index.md"},c=i(`<h1 id="常见问题" tabindex="-1">常见问题 <a class="header-anchor" href="#常见问题" aria-label="Permalink to "常见问题""></a></h1><p>这里将会编写一些你容易遇到的问题。目前有很多,但是我需要花时间来整理一下。</p><h2 id="静态编译的-php-可以安装扩展吗" tabindex="-1">静态编译的 PHP 可以安装扩展吗 <a class="header-anchor" href="#静态编译的-php-可以安装扩展吗" aria-label="Permalink to "静态编译的 PHP 可以安装扩展吗""></a></h2><p>因为传统架构下的 PHP 安装扩展的原理是使用 <code>.so</code> 类型的动态链接的库方式安装新扩展,而使用本项目编译的静态链接的 PHP 无法<strong>直接</strong>使用动态链接库安装新扩展。</p><p>对于 macOS 平台来说,macOS 下的几乎所有二进制文件都无法真正纯静态链接,几乎所有二进制文件都会链接 macOS 的系统库:<code>/usr/lib/libresolv.9.dylib</code> 和 <code>/usr/lib/libSystem.B.dylib</code>。 所以在 macOS 系统下,在特定的编译条件下可以使用静态编译的 php 二进制文件,同时使用动态链接的扩展:</p><ol><li>使用 <code>--no-strip</code> 参数,将不会对二进制文件去除调试符号等信息,以供使用 <code>Xdebug</code> 等外部 Zend 扩展。</li><li>如果要编译某些 Zend 扩展,使用 Homebrew、MacPorts、源码编译的形式,在所在的操作系统安装一个普通版本的 PHP。</li><li>使用 <code>phpize && ./configure && make</code> 命令编译想要使用的扩展。</li><li>将扩展文件 <code>xxxx.so</code> 拷贝到外部,使用静态编译的 PHP 二进制,例如使用 Xdebug 扩展:<code>cd buildroot/bin/ && ./php -d "zend_extension=/path/to/xdebug.so"</code>。</li></ol><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-cli</span></span>
|
||||
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">bin/spc</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> build</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ffi</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --build-cli</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --no-strip</span></span></code></pre></div><p>对于 Linux 平台来说,目前的编译结果为纯静态链接的二进制文件,无法使用动态链接库安装新扩展。</p><h2 id="可以支持-oracle-数据库扩展吗" tabindex="-1">可以支持 Oracle 数据库扩展吗 <a class="header-anchor" href="#可以支持-oracle-数据库扩展吗" aria-label="Permalink to "可以支持 Oracle 数据库扩展吗""></a></h2><p>部分依赖库闭源的扩展,如 <code>oci8</code>、<code>sourceguardian</code> 等,它们没有提供纯静态编译的依赖库文件(<code>.a</code>),仅提供了动态依赖库文件(<code>.so</code>), 这些扩展无法使用源码的形式编译到 static-php-cli 中,所以本项目可能永远也不会支持这些扩展。不过,理论上你可以根据上面的问题在 macOS 下接入和使用这类扩展。</p><p>如果你对此类扩展有需求,或者大部分人都对这些闭源扩展使用有需求, 可以看看有关 <a href="https://github.com/crazywhalecc/static-php-cli/discussions/58" target="_blank" rel="noreferrer">standalone-php-cli</a> 的讨论。欢迎留言。</p><h2 id="支持-windows-吗" tabindex="-1">支持 Windows 吗 <a class="header-anchor" href="#支持-windows-吗" aria-label="Permalink to "支持 Windows 吗""></a></h2><p>该项目目前已支持 Windows,但支持的扩展数量较少,Windows 的支持并不完美,主要有以下几个问题:</p><ol><li>Windows 的编译流程与 *nix 不同,使用的工具链也不同,编译各个扩展的依赖库使用的编译工具也几乎完全不同。</li><li>Windows 版本的需求也会根据所有使用本项目的人的需求推进,如果有很多人需要,我会尽快支持相关扩展。</li></ol><h2 id="使用-micro-可以保护我的源码吗" tabindex="-1">使用 micro 可以保护我的源码吗 <a class="header-anchor" href="#使用-micro-可以保护我的源码吗" aria-label="Permalink to "使用 micro 可以保护我的源码吗""></a></h2><p>不可以。micro.sfx 本质上是将 php 和 php 代码结合为一个文件,没有 PHP 代码编译或加密的过程。 首先 php-src 是 PHP 代码的官方解释器,而且现在市面上还没有一个能兼容主流分支的 PHP 编译器。 之前我在网上看到有一个项目是 BPC(Binary PHP Compiler?)可以把 PHP 编译为二进制,但是限制也是很多很多。</p><p>加密保护代码的方向和编译也不是一回事,编译过后也可以通过逆向工程等方式拿到代码,真正保护还是通过加壳、加密代码等手段进行。</p><p>所以本项目(static-php-cli)、相关项目(lwmbs、swoole-cli)都是提供一个对 php-src 源码的便捷编译工具, 本项目和相关项目引用的 phpmicro 也仅仅是 PHP 的 sapi 接口封装,而不是 PHP 代码的编译工具。 PHP 代码的编译器是完全不同的项目,因此不会考虑额外的情况。如果你对加密感兴趣,可以考虑使用现有的加密技术,如 Swoole Compiler、Source Guardian 等。</p><h2 id="无法使用-ssl" tabindex="-1">无法使用 ssl <a class="header-anchor" href="#无法使用-ssl" aria-label="Permalink to "无法使用 ssl""></a></h2><p>使用 curl、pgsql 等 请求 HTTPS 网站或建立 SSL 连接时,可能存在 <code>error:80000002:system library::No such file or directory</code> 错误, 这个错误是由于静态编译的 PHP 未通过 <code>php.ini</code> 指定 <code>openssl.cafile</code> 导致的。</p><p>你可以在使用 PHP 前指定 <code>php.ini</code>,并在 INI 内添加 <code>openssl.cafile=/path/to/your-cert.pem</code> 来解决这个问题。</p><p>对于 Linux 系统,你可以从 curl 官方网站下载 <a href="https://curl.se/docs/caextract.html" target="_blank" rel="noreferrer">cacert.pem</a> 文件,也可以使用系统自带的证书文件。 有关不同发行版的证书位置,可参考 <a href="https://go.dev/src/crypto/x509/root_linux.go" target="_blank" rel="noreferrer">Go 标准库</a>。</p><blockquote><p>INI 配置 <code>openssl.cafile</code> 不可以使用 <code>ini_set()</code> 函数动态设置,因为 <code>openssl.cafile</code> 是一个 <code>PHP_INI_SYSTEM</code> 类型的配置,只能在 <code>php.ini</code> 文件中设置。</p></blockquote>`,23),l=[c];function r(t,p,d,n,h,u){return o(),a("div",null,l)}const b=e(s,[["render",r]]);export{m as __pageData,b as default};
|
||||
1
assets/zh_faq_index.md.Bs3v_2I2.lean.js
Normal file
1
assets/zh_faq_index.md.Bs3v_2I2.lean.js
Normal file
@ -0,0 +1 @@
|
||||
import{_ as e,c as a,o,a1 as i}from"./chunks/framework.CszIUXhs.js";const m=JSON.parse('{"title":"常见问题","description":"","frontmatter":{},"headers":[],"relativePath":"zh/faq/index.md","filePath":"zh/faq/index.md"}'),s={name:"zh/faq/index.md"},c=i("",23),l=[c];function r(t,p,d,n,h,u){return o(),a("div",null,l)}const b=e(s,[["render",r]]);export{m as __pageData,b as default};
|
||||
1
assets/zh_guide_action-build.md.BQOsJgGT.js
Normal file
1
assets/zh_guide_action-build.md.BQOsJgGT.js
Normal file
@ -0,0 +1 @@
|
||||
import{_ as t,c as e,o,a1 as a}from"./chunks/framework.CszIUXhs.js";const b=JSON.parse('{"title":"Action 构建","description":"","frontmatter":{},"headers":[],"relativePath":"zh/guide/action-build.md","filePath":"zh/guide/action-build.md"}'),i={name:"zh/guide/action-build.md"},c=a('<h1 id="action-构建" tabindex="-1">Action 构建 <a class="header-anchor" href="#action-构建" aria-label="Permalink to "Action 构建""></a></h1><p>Action 构建指的是直接使用 GitHub Action 进行编译。</p><p>如果你不想自行编译,可以从本项目现有的 Action 下载 Artifact,也可以从自托管的服务器下载:<a href="https://dl.static-php.dev/static-php-cli/common/" target="_blank" rel="noreferrer">进入</a></p><blockquote><p>自托管的二进制也是由 Action 构建而来,<a href="https://github.com/static-php/static-php-cli-hosted" target="_blank" rel="noreferrer">项目仓库地址</a>。</p></blockquote><h2 id="构建方法" tabindex="-1">构建方法 <a class="header-anchor" href="#构建方法" aria-label="Permalink to "构建方法""></a></h2><p>使用 GitHub Action 可以方便地构建一个静态编译的 PHP 和 phpmicro,同时可以自行定义要编译的扩展。</p><ol><li>Fork 本项目。</li><li>进入项目的 Actions,选择 CI 开头的 Workflow(根据你需要的操作系统选择)。</li><li>选择 <code>Run workflow</code>,填入你要编译的 PHP 版本、目标类型、扩展列表。(扩展列表使用英文逗号分割,例如 <code>bcmath,curl,mbstring</code>)</li><li>等待大约一段时间后,进入对应的任务中,获取 <code>Artifacts</code>。</li></ol><p>如果你选择了 <code>debug</code>,则会在构建时输出所有日志,包括编译的日志,以供排查错误。</p><blockquote><p>如果你需要在其他环境构建,可以使用 <a href="./manual-build.html">手动构建</a>。</p></blockquote><h2 id="扩展选择" tabindex="-1">扩展选择 <a class="header-anchor" href="#扩展选择" aria-label="Permalink to "扩展选择""></a></h2><p>你可以到 <a href="./extensions.html">扩展列表</a> 中查看目前你需要的扩展是否均支持, 然后到 <a href="./cli-generator.html">在线命令生成</a> 中选择你需要编译的扩展,复制扩展字符串到 Action 的 <code>extensions</code> 中,编译即可。</p>',11),r=[c];function n(l,d,h,s,p,u){return o(),e("div",null,r)}const f=t(i,[["render",n]]);export{b as __pageData,f as default};
|
||||
1
assets/zh_guide_action-build.md.BQOsJgGT.lean.js
Normal file
1
assets/zh_guide_action-build.md.BQOsJgGT.lean.js
Normal file
@ -0,0 +1 @@
|
||||
import{_ as t,c as e,o,a1 as a}from"./chunks/framework.CszIUXhs.js";const b=JSON.parse('{"title":"Action 构建","description":"","frontmatter":{},"headers":[],"relativePath":"zh/guide/action-build.md","filePath":"zh/guide/action-build.md"}'),i={name:"zh/guide/action-build.md"},c=a("",11),r=[c];function n(l,d,h,s,p,u){return o(),e("div",null,r)}const f=t(i,[["render",n]]);export{b as __pageData,f as default};
|
||||
22
assets/zh_guide_build-on-windows.md.C1RFP4Q6.js
Normal file
22
assets/zh_guide_build-on-windows.md.C1RFP4Q6.js
Normal file
File diff suppressed because one or more lines are too long
1
assets/zh_guide_build-on-windows.md.C1RFP4Q6.lean.js
Normal file
1
assets/zh_guide_build-on-windows.md.C1RFP4Q6.lean.js
Normal file
@ -0,0 +1 @@
|
||||
import{_ as i,c as s,o as a,a1 as e}from"./chunks/framework.CszIUXhs.js";const u=JSON.parse('{"title":"在 Windows 上构建","description":"","frontmatter":{},"headers":[],"relativePath":"zh/guide/build-on-windows.md","filePath":"zh/guide/build-on-windows.md"}'),l={name:"zh/guide/build-on-windows.md"},t=e("",64),p=[t];function n(h,o,d,c,r,k){return a(),s("div",null,p)}const g=i(l,[["render",n]]);export{u as __pageData,g as default};
|
||||
1
assets/zh_guide_cli-generator.md.CMA84kUR.js
Normal file
1
assets/zh_guide_cli-generator.md.CMA84kUR.js
Normal file
@ -0,0 +1 @@
|
||||
import{C as e}from"./chunks/CliGenerator.Bj1S5l8x.js";import{d as t,c as a,I as o,a1 as r,o as i}from"./chunks/framework.CszIUXhs.js";const c=r('<h1 id="cli-编译命令生成器" tabindex="-1">CLI 编译命令生成器 <a class="header-anchor" href="#cli-编译命令生成器" aria-label="Permalink to "CLI 编译命令生成器""></a></h1><div class="tip custom-block"><p class="custom-block-title">TIP</p><p>下面选择扩展可能包含所选操作系统不支持的扩展,这可能导致编译失败。请先查阅 <a href="./extensions.html">支持的扩展</a>。</p></div>',2),p=JSON.parse('{"title":"CLI 编译命令生成器","description":"","frontmatter":{},"headers":[],"relativePath":"zh/guide/cli-generator.md","filePath":"zh/guide/cli-generator.md"}'),s={name:"zh/guide/cli-generator.md"},_=t({...s,setup(l){return(n,d)=>(i(),a("div",null,[c,o(e,{lang:"zh"})]))}});export{p as __pageData,_ as default};
|
||||
1
assets/zh_guide_cli-generator.md.CMA84kUR.lean.js
Normal file
1
assets/zh_guide_cli-generator.md.CMA84kUR.lean.js
Normal file
@ -0,0 +1 @@
|
||||
import{C as e}from"./chunks/CliGenerator.Bj1S5l8x.js";import{d as t,c as a,I as o,a1 as r,o as i}from"./chunks/framework.CszIUXhs.js";const c=r('<h1 id="cli-编译命令生成器" tabindex="-1">CLI 编译命令生成器 <a class="header-anchor" href="#cli-编译命令生成器" aria-label="Permalink to "CLI 编译命令生成器""></a></h1><div class="tip custom-block"><p class="custom-block-title">TIP</p><p>下面选择扩展可能包含所选操作系统不支持的扩展,这可能导致编译失败。请先查阅 <a href="./extensions.html">支持的扩展</a>。</p></div>',2),p=JSON.parse('{"title":"CLI 编译命令生成器","description":"","frontmatter":{},"headers":[],"relativePath":"zh/guide/cli-generator.md","filePath":"zh/guide/cli-generator.md"}'),s={name:"zh/guide/cli-generator.md"},_=t({...s,setup(l){return(n,d)=>(i(),a("div",null,[c,o(e,{lang:"zh"})]))}});export{p as __pageData,_ as default};
|
||||
6
assets/zh_guide_env-vars.md.Dn5AS_wq.js
Normal file
6
assets/zh_guide_env-vars.md.Dn5AS_wq.js
Normal file
File diff suppressed because one or more lines are too long
1
assets/zh_guide_env-vars.md.Dn5AS_wq.lean.js
Normal file
1
assets/zh_guide_env-vars.md.Dn5AS_wq.lean.js
Normal file
@ -0,0 +1 @@
|
||||
import{_ as d,c as t,o as e,a1 as o}from"./chunks/framework.CszIUXhs.js";const C=JSON.parse('{"title":"环境变量列表","description":"","frontmatter":{"aside":false},"headers":[],"relativePath":"zh/guide/env-vars.md","filePath":"zh/guide/env-vars.md"}'),c={name:"zh/guide/env-vars.md"},a=o("",35),i=[a];function r(s,l,n,_,h,p){return e(),t("div",null,i)}const A=d(c,[["render",r]]);export{C as __pageData,A as default};
|
||||
1
assets/zh_guide_extension-notes.md.CfCgmU-D.js
Normal file
1
assets/zh_guide_extension-notes.md.CfCgmU-D.js
Normal file
File diff suppressed because one or more lines are too long
1
assets/zh_guide_extension-notes.md.CfCgmU-D.lean.js
Normal file
1
assets/zh_guide_extension-notes.md.CfCgmU-D.lean.js
Normal file
@ -0,0 +1 @@
|
||||
import{_ as e,c as o,o as l,a1 as a}from"./chunks/framework.CszIUXhs.js";const u=JSON.parse('{"title":"扩展注意事项","description":"","frontmatter":{},"headers":[],"relativePath":"zh/guide/extension-notes.md","filePath":"zh/guide/extension-notes.md"}'),s={name:"zh/guide/extension-notes.md"},i=a("",54),r=[i];function t(d,c,h,p,n,b){return l(),o("div",null,r)}const g=e(s,[["render",t]]);export{u as __pageData,g as default};
|
||||
1
assets/zh_guide_extensions.md.BkAzY34J.js
Normal file
1
assets/zh_guide_extensions.md.BkAzY34J.js
Normal file
File diff suppressed because one or more lines are too long
1
assets/zh_guide_extensions.md.BkAzY34J.lean.js
Normal file
1
assets/zh_guide_extensions.md.BkAzY34J.lean.js
Normal file
@ -0,0 +1 @@
|
||||
import{_ as t,c as d,o as e,a1 as s}from"./chunks/framework.CszIUXhs.js";const f=JSON.parse('{"title":"扩展列表","description":"","frontmatter":{},"headers":[],"relativePath":"zh/guide/extensions.md","filePath":"zh/guide/extensions.md"}'),r={name:"zh/guide/extensions.md"},y=s("",4),o=[y];function n(i,a,l,h,c,p){return e(),d("div",null,o)}const x=t(r,[["render",n]]);export{f as __pageData,x as default};
|
||||
1
assets/zh_guide_index.md.D0Jfo4Dz.js
Normal file
1
assets/zh_guide_index.md.D0Jfo4Dz.js
Normal file
@ -0,0 +1 @@
|
||||
import{_ as t,c as a,o as e,a1 as d}from"./chunks/framework.CszIUXhs.js";const m=JSON.parse('{"title":"指南","description":"","frontmatter":{},"headers":[],"relativePath":"zh/guide/index.md","filePath":"zh/guide/index.md"}'),i={name:"zh/guide/index.md"},r=d('<h1 id="指南" tabindex="-1">指南 <a class="header-anchor" href="#指南" aria-label="Permalink to "指南""></a></h1><p>static-php-cli 是一个用于构建静态编译的 PHP 二进制的工具,目前支持 Linux 和 macOS 系统。</p><p>在指南章节中,你将了解到如何使用 static-php-cli 构建独立的 php 程序。</p><ul><li><a href="./action-build.html">Action 构建</a></li><li><a href="./manual-build.html">本地构建</a></li><li><a href="./extensions.html">扩展列表</a></li></ul><h2 id="编译环境" tabindex="-1">编译环境 <a class="header-anchor" href="#编译环境" aria-label="Permalink to "编译环境""></a></h2><p>下面是架构支持情况,⚙️ 代表支持 GitHub Action 构建,💻 代表支持本地构建,空 代表暂不支持。</p><table tabindex="0"><thead><tr><th></th><th>x86_64</th><th>aarch64</th></tr></thead><tbody><tr><td>macOS</td><td>⚙️ 💻</td><td>⚙️ 💻</td></tr><tr><td>Linux</td><td>⚙️ 💻</td><td>⚙️ 💻</td></tr><tr><td>Windows</td><td>⚙️ 💻</td><td></td></tr><tr><td>FreeBSD</td><td>💻</td><td>💻</td></tr></tbody></table><p>其中,Linux 目前仅在 Ubuntu、Debian、Alpine 发行版测试通过,其他发行版未进行测试,不能保证编译成功。 对于未经过测试的发行版,可以使用 Docker 等方式本地编译,避免环境导致的问题。</p><p>macOS 下支持 x86_64 和 Arm 两种架构,但在其中一个架构上编译的二进制无法直接在另一个架构上使用。 Rosetta 2 不能保证 Arm 架构编译的程序可以完全运行在 x86_64 环境下。</p><p>Windows 目前只支持 x86_64 架构,不支持 32 位 x86、不支持 arm64 架构。</p><h2 id="php-支持版本" tabindex="-1">PHP 支持版本 <a class="header-anchor" href="#php-支持版本" aria-label="Permalink to "PHP 支持版本""></a></h2><p>目前,static-php-cli 对 PHP 7.4 ~ 8.3 版本是支持的,对于 PHP 7.4 及更早版本理论上支持,只需下载时选择早期版本即可。 但由于部分扩展和特殊组件已对早期版本的 PHP 停止了支持,所以 static-php-cli 不会明确支持早期版本。 我们推荐你编译尽可能新的 PHP 版本,以获得更好的体验。</p>',12),h=[r];function n(o,l,c,p,s,_){return e(),a("div",null,h)}const P=t(i,[["render",n]]);export{m as __pageData,P as default};
|
||||
1
assets/zh_guide_index.md.D0Jfo4Dz.lean.js
Normal file
1
assets/zh_guide_index.md.D0Jfo4Dz.lean.js
Normal file
@ -0,0 +1 @@
|
||||
import{_ as t,c as a,o as e,a1 as d}from"./chunks/framework.CszIUXhs.js";const m=JSON.parse('{"title":"指南","description":"","frontmatter":{},"headers":[],"relativePath":"zh/guide/index.md","filePath":"zh/guide/index.md"}'),i={name:"zh/guide/index.md"},r=d("",12),h=[r];function n(o,l,c,p,s,_){return e(),a("div",null,h)}const P=t(i,[["render",n]]);export{m as __pageData,P as default};
|
||||
134
assets/zh_guide_manual-build.md.C58zH3IF.js
Normal file
134
assets/zh_guide_manual-build.md.C58zH3IF.js
Normal file
File diff suppressed because one or more lines are too long
1
assets/zh_guide_manual-build.md.C58zH3IF.lean.js
Normal file
1
assets/zh_guide_manual-build.md.C58zH3IF.lean.js
Normal file
@ -0,0 +1 @@
|
||||
import{_ as s,c as i,o as a,a1 as n}from"./chunks/framework.CszIUXhs.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("",101),e=[l];function t(h,d,c,k,o,r){return a(),i("div",null,e)}const b=s(p,[["render",t]]);export{g as __pageData,b as default};
|
||||
1
assets/zh_guide_troubleshooting.md.CSXAWaMN.js
Normal file
1
assets/zh_guide_troubleshooting.md.CSXAWaMN.js
Normal file
@ -0,0 +1 @@
|
||||
import{_ as e,c as o,o as a,a1 as t}from"./chunks/framework.CszIUXhs.js";const b=JSON.parse('{"title":"故障排除","description":"","frontmatter":{},"headers":[],"relativePath":"zh/guide/troubleshooting.md","filePath":"zh/guide/troubleshooting.md"}'),r={name:"zh/guide/troubleshooting.md"},s=t('<h1 id="故障排除" tabindex="-1">故障排除 <a class="header-anchor" href="#故障排除" aria-label="Permalink to "故障排除""></a></h1><p>使用 static-php-cli 过程中可能会碰到各种各样的故障,这里将讲述如何自行查看错误并反馈 Issue。</p><h2 id="下载失败问题" tabindex="-1">下载失败问题 <a class="header-anchor" href="#下载失败问题" aria-label="Permalink to "下载失败问题""></a></h2><p>下载资源问题是 spc 最常见的问题之一。主要是由于 spc 下载资源使用的地址一般均为对应项目的官方网站或 GitHub 等,而这些网站可能偶尔会宕机、屏蔽 IP 地址。 目前 2.0.0 版本还没有加入自动重试机制,所以在遇到下载失败后,可以多次尝试调用下载命令。如果确认地址确实无法正常访问,可以提交 Issue 或 PR 更新地址。</p><h2 id="doctor-无法修复" tabindex="-1">doctor 无法修复 <a class="header-anchor" href="#doctor-无法修复" aria-label="Permalink to "doctor 无法修复""></a></h2><p>在绝大部分情况下,doctor 模块都可以对缺失的系统环境进行自动修复和安装,但也存在特殊的环境无法正常使用自动修复功能。</p><p>部分项目由于系统局限(如 Windows 下无法自动安装 Visual Studio 等软件),无法使用自动修复功能。 在遇到无法自动修复功能时,如果遇到 <code>Some check items can not be fixed</code> 字样,则表明无法自动修复,请根据终端显示的方法提交 Issue 或自行修复环境。</p><h2 id="编译错误" tabindex="-1">编译错误 <a class="header-anchor" href="#编译错误" aria-label="Permalink to "编译错误""></a></h2><p>遇到编译错误时,如果没有开启 <code>--debug</code> 日志,请先开启调试日志,然后确定报错的命令。 报错的终端输出对于修复编译错误非常重要,请在提交 Issue 时一并将终端日志的最后报错片段(或整个终端日志输出)上传,并且包含使用的 <code>spc</code> 命令和参数。</p>',9),c=[s];function i(d,n,h,l,u,_){return a(),o("div",null,c)}const m=e(r,[["render",i]]);export{b as __pageData,m as default};
|
||||
1
assets/zh_guide_troubleshooting.md.CSXAWaMN.lean.js
Normal file
1
assets/zh_guide_troubleshooting.md.CSXAWaMN.lean.js
Normal file
@ -0,0 +1 @@
|
||||
import{_ as e,c as o,o as a,a1 as t}from"./chunks/framework.CszIUXhs.js";const b=JSON.parse('{"title":"故障排除","description":"","frontmatter":{},"headers":[],"relativePath":"zh/guide/troubleshooting.md","filePath":"zh/guide/troubleshooting.md"}'),r={name:"zh/guide/troubleshooting.md"},s=t("",9),c=[s];function i(d,n,h,l,u,_){return a(),o("div",null,c)}const m=e(r,[["render",i]]);export{b as __pageData,m as default};
|
||||
1
assets/zh_index.md.Bu-me8xZ.js
Normal file
1
assets/zh_index.md.Bu-me8xZ.js
Normal file
@ -0,0 +1 @@
|
||||
import{_ as e,c as t,o as i}from"./chunks/framework.CszIUXhs.js";const m=JSON.parse('{"title":"","description":"","frontmatter":{"layout":"home","hero":{"name":"static-php-cli","tagline":"在 Linux、macOS、FreeBSD、Windows 上与 PHP 项目一起构建独立的 PHP 二进制文件,并包含流行的扩展。","actions":[{"theme":"brand","text":"指南","link":"./guide/"}]},"features":[{"title":"静态二进制","details":"您可以轻松地编译一个独立的 PHP 二进制文件以供嵌入程序使用。包括 cli、fpm、micro。"},{"title":"phpmicro 自执行二进制","details":"您可以使用 micro SAPI 编译一个自解压的可执行文件,并将 PHP 代码与二进制文件打包为一个文件。"},{"title":"依赖管理","details":"static-php-cli 附带依赖项管理,支持安装不同类型的 PHP 扩展和不同的依赖库。"}]},"headers":[],"relativePath":"zh/index.md","filePath":"zh/index.md"}'),a={name:"zh/index.md"};function n(c,o,r,s,d,l){return i(),t("div")}const h=e(a,[["render",n]]);export{m as __pageData,h as default};
|
||||
1
assets/zh_index.md.Bu-me8xZ.lean.js
Normal file
1
assets/zh_index.md.Bu-me8xZ.lean.js
Normal file
@ -0,0 +1 @@
|
||||
import{_ as e,c as t,o as i}from"./chunks/framework.CszIUXhs.js";const m=JSON.parse('{"title":"","description":"","frontmatter":{"layout":"home","hero":{"name":"static-php-cli","tagline":"在 Linux、macOS、FreeBSD、Windows 上与 PHP 项目一起构建独立的 PHP 二进制文件,并包含流行的扩展。","actions":[{"theme":"brand","text":"指南","link":"./guide/"}]},"features":[{"title":"静态二进制","details":"您可以轻松地编译一个独立的 PHP 二进制文件以供嵌入程序使用。包括 cli、fpm、micro。"},{"title":"phpmicro 自执行二进制","details":"您可以使用 micro SAPI 编译一个自解压的可执行文件,并将 PHP 代码与二进制文件打包为一个文件。"},{"title":"依赖管理","details":"static-php-cli 附带依赖项管理,支持安装不同类型的 PHP 扩展和不同的依赖库。"}]},"headers":[],"relativePath":"zh/index.md","filePath":"zh/index.md"}'),a={name:"zh/index.md"};function n(c,o,r,s,d,l){return i(),t("div")}const h=e(a,[["render",n]]);export{m as __pageData,h as default};
|
||||
24
en/contributing/index.html
Normal file
24
en/contributing/index.html
Normal file
File diff suppressed because one or more lines are too long
52
en/develop/doctor-module.html
Normal file
52
en/develop/doctor-module.html
Normal file
File diff suppressed because one or more lines are too long
24
en/develop/index.html
Normal file
24
en/develop/index.html
Normal file
File diff suppressed because one or more lines are too long
128
en/develop/source-module.html
Normal file
128
en/develop/source-module.html
Normal file
File diff suppressed because one or more lines are too long
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user