diff --git a/404.html b/404.html index 1c43e142..b7924410 100644 --- a/404.html +++ b/404.html @@ -5,17 +5,18 @@ 404 | static-php-cli - - + + + - +
- + \ No newline at end of file diff --git a/assets/app.B4hLhYRx.js b/assets/app.B4hLhYRx.js new file mode 100644 index 00000000..59230b03 --- /dev/null +++ b/assets/app.B4hLhYRx.js @@ -0,0 +1 @@ +import{R as p}from"./chunks/theme.8dVMQbWa.js";import{C as o,a1 as i,a2 as u,a3 as c,a4 as l,a5 as f,a6 as d,a7 as m,a8 as h,a9 as g,aa as A,d as y,u as C,p as v,y as w,ab as P,ac as R,ad as b,ae as E}from"./chunks/framework.PeLcR_tw.js";function r(e){if(e.extends){const a=r(e.extends);return{...a,...e,async enhanceApp(t){a.enhanceApp&&await a.enhanceApp(t),e.enhanceApp&&await e.enhanceApp(t)}}}return e}const n=r(p),S=y({name:"VitePressApp",setup(){const{site:e,lang:a,dir:t}=C();return v(()=>{w(()=>{document.documentElement.lang=a.value,document.documentElement.dir=t.value})}),e.value.router.prefetchLinks&&P(),R(),b(),n.setup&&n.setup(),()=>E(n.Layout)}});async function T(){globalThis.__VITEPRESS__=!0;const e=L(),a=D();a.provide(u,e);const t=c(e.route);return a.provide(l,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}}}),n.enhanceApp&&await n.enhanceApp({app:a,router:e,siteData:m}),{app:a,router:e,data:t}}function D(){return A(S)}function L(){let e=o;return h(a=>{let t=g(a),s=null;return t&&(e&&(t=t.replace(/\.js$/,".lean.js")),s=import(t)),o&&(e=!1),s},n.NotFound)}o&&T().then(({app:e,router:a,data:t})=>{a.go(location.href,{initialLoad:!0}).then(()=>{i(a.route,t.site),e.mount("#app")})});export{T as createApp}; diff --git a/assets/app.D3H8Y1BO.js b/assets/app.D3H8Y1BO.js deleted file mode 100644 index 0c38034a..00000000 --- a/assets/app.D3H8Y1BO.js +++ /dev/null @@ -1 +0,0 @@ -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.gjrnbxUT.js";import{R as S}from"./chunks/theme.5IQMzWyn.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}; diff --git a/assets/chunks/CliGenerator.CaE8R34N.js b/assets/chunks/CliGenerator.CaE8R34N.js deleted file mode 100644 index 666df20d..00000000 --- a/assets/chunks/CliGenerator.CaE8R34N.js +++ /dev/null @@ -1,12 +0,0 @@ -import{d as ge,s as w,h as z,v as G,o as g,c as x,j as e,t as n,F as N,E as O,a2 as m,a3 as Z,a4 as J,e as I,a5 as f,a as xe,a6 as Q,p as me,l as he,_ as ye}from"./framework.gjrnbxUT.js";const ve={support:{BSD:"wip"},type:"external","arg-type":"custom",source:"amqp","lib-depends":["librabbitmq"],"ext-depends-windows":["openssl"]},fe={type:"external",source:"apcu"},ze={type:"external",source:"ast"},Se={type:"builtin"},De={type:"builtin","arg-type-unix":"with-prefix","arg-type-windows":"with","lib-depends":["bzip2"]},ke={type:"builtin"},Be={type:"builtin"},qe={notes:!0,type:"builtin","arg-type":"with","lib-depends":["curl"],"ext-depends-windows":["zlib","openssl"]},Ee={type:"builtin","arg-type":"custom","lib-suggests":["qdbm"]},_e={support:{BSD:"wip"},type:"external",source:"dio"},Ce={support:{BSD:"wip"},type:"builtin","arg-type":"custom","arg-type-windows":"with","lib-depends":["libxml2","zlib"],"ext-depends-windows":["xml"]},We={type:"external",source:"ext-ds"},Ie={support:{Windows:"wip",BSD:"wip",Darwin:"wip",Linux:"wip"},type:"wip"},Pe={type:"external",source:"ev","arg-type-windows":"with"},$e={support:{Windows:"wip",BSD:"wip"},notes:!0,type:"external",source:"ext-event","arg-type":"custom","lib-depends":["libevent"],"ext-depends":["openssl"],"ext-suggests":["sockets"]},Ue={type:"builtin"},Le={support:{Linux:"partial",BSD:"wip"},target:["static","shared"],notes:!0,"arg-type":"custom",type:"builtin","lib-depends-unix":["libffi"],"lib-depends-windows":["libffi-win"]},Ne={type:"builtin"},Oe={type:"builtin"},Ve={type:"builtin","lib-suggests":["openssl"]},Ae={support:{BSD:"wip"},notes:!0,type:"builtin","arg-type":"custom","arg-type-windows":"with","lib-depends":["zlib","libpng"],"ext-depends":["zlib"],"lib-suggests":["libavif","libwebp","libjpeg","freetype"]},je={support:{Windows:"wip",BSD:"wip"},type:"builtin","arg-type":"with-prefix","lib-depends":["gettext"]},Te={support:{Windows:"wip",BSD:"no",Linux:"no"},notes:!0,type:"external","arg-type":"custom",source:"ext-glfw","lib-depends":["glfw"],"lib-depends-windows":[]},Ge={support:{Windows:"wip",BSD:"wip"},type:"builtin","arg-type":"with-prefix","lib-depends":["gmp"]},Xe={support:{BSD:"wip"},type:"external",source:"ext-gmssl","lib-depends":["gmssl"]},Me={support:{Windows:"wip",BSD:"wip"},type:"external",source:"grpc","arg-type-unix":"custom","cpp-extension":!0,"lib-depends":["grpc"]},He={support:{BSD:"wip"},type:"builtin","arg-type":"with-prefix","arg-type-windows":"with","lib-depends-unix":["libiconv"],"lib-depends-windows":["libiconv-win"]},Re={support:{BSD:"wip"},type:"external",source:"igbinary","ext-suggests":["session","apcu"]},Fe={support:{Windows:"wip",BSD:"wip"},notes:!0,type:"external",source:"ext-imagick","arg-type":"custom","lib-depends":["imagemagick"]},Ze={support:{Windows:"wip",BSD:"wip"},notes:!0,type:"external",source:"ext-imap","arg-type":"custom","lib-depends":["imap"],"ext-suggests":["openssl"]},Qe={support:{Windows:"no",BSD:"wip",Darwin:"no"},type:"external",source:"inotify"},Ke={support:{Windows:"no",BSD:"wip"},type:"builtin","lib-depends":["icu"]},Ye={support:{Windows:"wip",BSD:"wip"},type:"builtin","arg-type":"with-prefix","lib-depends":["ldap"],"lib-suggests":["gmp","libsodium"],"ext-suggests":["openssl"]},Je={support:{Windows:"wip",BSD:"wip"},type:"external",source:"ext-lz4","arg-type":"custom","lib-depends":["liblz4"]},ei={support:{BSD:"wip"},type:"builtin","arg-type":"none","ext-depends":["xml"]},ii={type:"builtin","arg-type":"custom","ext-depends":["mbstring"],"lib-depends":["onig"]},si={type:"builtin","arg-type":"custom"},ti={type:"wip",support:{Windows:"no",BSD:"no",Darwin:"no",Linux:"no"},notes:!0},li={support:{Windows:"wip",BSD:"wip"},type:"external",source:"ext-memcache","arg-type":"custom","ext-depends":["zlib","session"]},ni={support:{Windows:"wip",BSD:"wip",Linux:"no"},type:"external",source:"memcached","arg-type":"custom","cpp-extension":!0,"lib-depends":["libmemcached"],"ext-depends":["session","zlib"]},oi={support:{BSD:"wip",Windows:"wip"},type:"external",source:"mongodb","arg-type":"custom","lib-suggests":["icu","openssl","zstd","zlib"]},ai={support:{BSD:"wip"},type:"external",source:"msgpack","arg-type-unix":"with","arg-type-win":"enable"},di={type:"builtin","arg-type":"with","ext-depends":["mysqlnd"]},pi={type:"builtin","arg-type-windows":"with","lib-depends":["zlib"]},ui={type:"wip",support:{Windows:"wip",BSD:"no",Darwin:"no",Linux:"no"},notes:!0},ci={support:{BSD:"wip",Windows:"wip"},type:"builtin","arg-type-unix":"custom","lib-depends-unix":["unixodbc"]},ri={type:"builtin","arg-type-unix":"custom"},bi={notes:!0,type:"builtin","arg-type":"custom","arg-type-windows":"with","lib-depends":["openssl","zlib"],"ext-depends":["zlib"]},wi={support:{BSD:"wip"},type:"external",source:"opentelemetry"},gi={support:{BSD:"wip"},notes:!0,type:"external",source:"parallel","arg-type-windows":"with","lib-depends-windows":["pthreads4w"]},xi={support:{Windows:"no"},type:"builtin","unix-only":!0},mi={type:"builtin"},hi={type:"builtin","arg-type":"with","ext-depends":["pdo","mysqlnd"]},yi={support:{BSD:"wip"},type:"builtin","arg-type":"custom","lib-depends-unix":["unixodbc"],"ext-depends":["pdo","odbc"]},vi={support:{BSD:"wip"},type:"builtin","arg-type":"with-prefix","arg-type-windows":"custom","ext-depends":["pdo","pgsql"],"lib-depends-unix":["postgresql"],"lib-depends-windows":["postgresql-win"]},fi={support:{BSD:"wip"},type:"builtin","arg-type":"with","ext-depends":["pdo","sqlite3"],"lib-depends":["sqlite"]},zi={support:{BSD:"wip"},type:"external",source:"pdo_sqlsrv","arg-type":"with","ext-depends":["pdo","sqlsrv"]},Si={support:{BSD:"wip"},notes:!0,type:"builtin","arg-type":"custom","lib-depends-unix":["postgresql"],"lib-depends-windows":["postgresql-win"]},Di={type:"builtin","ext-depends":["zlib"]},ki={support:{Windows:"no"},type:"builtin","unix-only":!0},Bi={support:{Windows:"wip",BSD:"wip"},type:"external",source:"protobuf"},qi={support:{BSD:"wip",Darwin:"partial"},notes:!0,type:"external",source:"rar","cpp-extension":!0},Ei={support:{BSD:"wip",Windows:"wip"},type:"external",source:"ext-rdkafka","arg-type":"custom","cpp-extension":!0,"lib-depends":["librdkafka"]},_i={support:{Windows:"wip",BSD:"wip"},type:"builtin","arg-type":"with-prefix","lib-depends":["readline"]},Ci={support:{BSD:"wip"},type:"external",source:"redis","arg-type":"custom","ext-suggests":["session","igbinary"],"lib-suggests-unix":["zstd","liblz4"]},Wi={type:"builtin"},Ii={type:"builtin"},Pi={type:"external",source:"ext-simdjson","cpp-extension":!0},$i={support:{BSD:"wip"},type:"builtin","arg-type":"custom","lib-depends":["libxml2"],"ext-depends-windows":["xml"]},Ui={support:{Windows:"wip",BSD:"wip"},type:"external",source:"ext-snappy","cpp-extension":!0,"arg-type":"custom","lib-depends":["snappy"],"ext-suggests":["apcu"]},Li={support:{BSD:"wip"},type:"builtin","arg-type":"custom","lib-depends":["libxml2"],"ext-depends-windows":["xml"]},Ni={type:"builtin"},Oi={support:{BSD:"wip"},type:"builtin","arg-type":"with","lib-depends":["libsodium"]},Vi={support:{BSD:"wip",Windows:"no"},notes:!0,type:"external",source:"spx","arg-type":"custom","lib-depends":["zlib"]},Ai={support:{BSD:"wip"},type:"builtin","arg-type":"with-prefix","arg-type-windows":"with","lib-depends":["sqlite"]},ji={support:{BSD:"wip"},type:"external",source:"sqlsrv","lib-depends-unix":["unixodbc"],"ext-depends-linux":["pcntl"],"cpp-extension":!0},Ti={support:{BSD:"wip"},type:"external",source:"ext-ssh2","arg-type":"with-prefix","arg-type-windows":"with","lib-depends":["libssh2"],"ext-depends-windows":["openssl","zlib"]},Gi={support:{Windows:"no",BSD:"wip"},target:["static"],notes:!0,type:"external",source:"swoole","arg-type":"custom","cpp-extension":!0,"unix-only":!0,"lib-depends":["libcares","brotli","nghttp2","zlib"],"ext-depends":["openssl","curl"],"ext-suggests":["swoole-hook-pgsql","swoole-hook-mysql","swoole-hook-sqlite"]},Xi={support:{BSD:"wip"},notes:!0,type:"external",source:"swow","arg-type":"custom","lib-suggests":["openssl","curl"],"ext-suggests":["openssl","curl"]},Mi={support:{Windows:"no",BSD:"wip"},type:"builtin","unix-only":!0},Hi={support:{Windows:"no",BSD:"wip"},type:"builtin","unix-only":!0},Ri={support:{BSD:"wip"},type:"builtin"},Fi={support:{Windows:"wip",BSD:"wip"},type:"builtin","arg-type":"with-prefix","lib-depends":["tidy"]},Zi={type:"builtin"},Qi={support:{Windows:"wip",BSD:"wip"},type:"external",source:"ext-uuid","arg-type":"with-prefix","lib-depends":["libuuid"]},Ki={support:{Windows:"wip",BSD:"wip"},type:"external",source:"ext-uv","arg-type":"with-prefix","lib-depends":["libuv"],"ext-depends":["sockets"]},Yi={type:"external",source:"xdebug",target:["shared"],support:{Windows:"wip",BSD:"no",Darwin:"partial",Linux:"partial"},notes:!0},Ji={support:{Windows:"wip",BSD:"wip"},notes:!0,type:"external",source:"xhprof","ext-depends":["ctype"]},es={support:{BSD:"wip"},type:"external",source:"xlswriter","arg-type":"custom","ext-depends":["zlib","zip"],"lib-suggests":["openssl"]},is={support:{BSD:"wip"},notes:!0,type:"builtin","arg-type":"custom","arg-type-windows":"with","lib-depends":["libxml2"],"ext-depends-windows":["iconv"]},ss={support:{BSD:"wip"},type:"builtin","arg-type":"custom","lib-depends":["libxml2"],"ext-depends-windows":["xml","dom"]},ts={support:{BSD:"wip"},type:"builtin","arg-type":"custom","lib-depends":["libxml2"],"ext-depends-windows":["xml"]},ls={support:{Windows:"wip",BSD:"wip"},type:"builtin","arg-type":"with-prefix","lib-depends":["libxslt"],"ext-depends":["xml","dom"]},ns={support:{BSD:"wip"},type:"external",source:"yac","arg-type-unix":"custom","ext-depends-unix":["igbinary"]},os={support:{BSD:"wip"},type:"external",source:"yaml","arg-type-unix":"with-prefix","arg-type-windows":"with","lib-depends":["libyaml"]},as={support:{BSD:"wip"},target:["static"],type:"builtin","arg-type":"with-prefix","arg-type-windows":"enable","lib-depends-unix":["libzip"],"ext-depends-windows":["zlib","bz2"],"lib-depends-windows":["libzip","zlib","bzip2","xz"]},ds={type:"builtin","arg-type":"custom","arg-type-windows":"enable","lib-depends":["zlib"]},ps={support:{Windows:"wip",BSD:"wip"},type:"external",source:"ext-zstd","arg-type":"custom","lib-depends":["zstd"]},us={amqp:ve,apcu:fe,ast:ze,bcmath:Se,bz2:De,calendar:ke,ctype:Be,curl:qe,dba:Ee,dio:_e,dom:Ce,ds:We,enchant:Ie,ev:Pe,event:$e,exif:Ue,ffi:Le,fileinfo:Ne,filter:Oe,ftp:Ve,gd:Ae,gettext:je,glfw:Te,gmp:Ge,gmssl:Xe,grpc:Me,iconv:He,igbinary:Re,imagick:Fe,imap:Ze,inotify:Qe,intl:Ke,ldap:Ye,lz4:Je,libxml:ei,mbregex:ii,mbstring:si,mcrypt:ti,memcache:li,memcached:ni,mongodb:oi,msgpack:ai,mysqli:di,mysqlnd:pi,oci8:ui,odbc:ci,opcache:ri,openssl:bi,opentelemetry:wi,parallel:gi,"password-argon2":{support:{Windows:"wip",BSD:"wip"},notes:!0,type:"builtin","arg-type":"with-prefix","lib-depends":["libargon2"]},pcntl:xi,pdo:mi,pdo_mysql:hi,pdo_odbc:yi,pdo_pgsql:vi,pdo_sqlite:fi,pdo_sqlsrv:zi,pgsql:Si,phar:Di,posix:ki,protobuf:Bi,rar:qi,rdkafka:Ei,readline:_i,redis:Ci,session:Wi,shmop:Ii,simdjson:Pi,simplexml:$i,snappy:Ui,soap:Li,sockets:Ni,sodium:Oi,spx:Vi,sqlite3:Ai,sqlsrv:ji,ssh2:Ti,swoole:Gi,"swoole-hook-mysql":{support:{Windows:"no",BSD:"wip"},notes:!0,type:"addon","arg-type":"custom","ext-depends":["mysqlnd","pdo","pdo_mysql"],"ext-suggests":["mysqli"]},"swoole-hook-pgsql":{support:{Windows:"no",BSD:"wip",Darwin:"partial"},notes:!0,type:"addon","arg-type":"custom","ext-depends":["pgsql","pdo"]},"swoole-hook-sqlite":{support:{Windows:"no",BSD:"wip"},notes:!0,type:"addon","arg-type":"custom","ext-depends":["sqlite3","pdo"]},swow:Xi,sysvmsg:Mi,sysvsem:Hi,sysvshm:Ri,tidy:Fi,tokenizer:Zi,uuid:Qi,uv:Ki,xdebug:Yi,xhprof:Ji,xlswriter:es,xml:is,xmlreader:ss,xmlwriter:ts,xsl:ls,yac:ns,yaml:os,zip:as,zlib:ds,zstd:ps},cs={type:"root",source:"php-src","lib-depends":["lib-base","micro"],"lib-suggests-linux":["libacl"]},rs={type:"target",source:"micro"},bs={source:"attr","static-libs-unix":["libattr.a"]},ws={source:"brotli","static-libs-unix":["libbrotlidec.a","libbrotlienc.a","libbrotlicommon.a"],"static-libs-windows":["brotlicommon.lib","brotlienc.lib","brotlidec.lib"],headers:["brotli"]},gs={source:"bzip2","static-libs-unix":["libbz2.a"],"static-libs-windows":["libbz2.lib","libbz2_a.lib"],headers:["bzlib.h"]},xs={source:"curl","static-libs-unix":["libcurl.a"],"static-libs-windows":["libcurl_a.lib"],headers:["curl"],"lib-depends-unix":["openssl","zlib"],"lib-depends-windows":["zlib","libssh2","nghttp2"],"lib-suggests-unix":["libssh2","brotli","nghttp2","nghttp3","ngtcp2","zstd","libcares"],"lib-suggests-windows":["brotli","zstd"],frameworks:["CoreFoundation","CoreServices","SystemConfiguration"]},ms={source:"freetype","static-libs-unix":["libfreetype.a"],"static-libs-windows":["libfreetype_a.lib"],"headers-unix":["freetype2/freetype/freetype.h","freetype2/ft2build.h"],"lib-depends":["zlib"],"lib-suggests":["libpng","bzip2","brotli"]},hs={source:"gettext","static-libs-unix":["libintl.a"],"lib-depends":["libiconv"],"lib-suggests":["ncurses","libxml2"],frameworks:["CoreFoundation"]},ys={source:"ext-glfw","static-libs-unix":["libglfw3.a"],frameworks:["CoreVideo","OpenGL","Cocoa","IOKit"]},vs={source:"gmp","static-libs-unix":["libgmp.a"],"static-libs-windows":["libgmp.lib"],headers:["gmp.h"]},fs={source:"gmssl","static-libs-unix":["libgmssl.a"],"static-libs-windows":["gmssl.lib"],frameworks:["Security"]},zs={source:"grpc","static-libs-unix":["libgrpc.a","libcares.a"],"lib-depends":["zlib","openssl"],frameworks:["CoreFoundation"]},Ss={source:"icu","cpp-library":!0,"static-libs-unix":["libicui18n.a","libicuio.a","libicuuc.a","libicudata.a"]},Ds={source:"imagemagick","static-libs-unix":["libMagick++-7.Q16HDRI.a","libMagickWand-7.Q16HDRI.a","libMagickCore-7.Q16HDRI.a"],"lib-depends":["zlib","libpng","libjpeg","libwebp","freetype","libtiff","libheif","bzip2"],"lib-suggests":["zstd","xz","libzip","libxml2"]},ks={source:"imap","static-libs-unix":["libc-client.a"],"lib-suggests":["openssl"]},Bs={source:"ldap","static-libs-unix":["liblber.a","libldap.a"],"lib-depends":["openssl","zlib","gmp","libsodium"]},qs={source:"libacl","static-libs-unix":["libacl.a"],"lib-depends":["attr"]},Es={source:"libaom","static-libs-unix":["libaom.a"],"cpp-library":!0},_s={source:"libargon2","static-libs-unix":["libargon2.a"]},Cs={source:"libavif","static-libs-unix":["libavif.a"],"static-libs-windows":["avif.lib"]},Ws={source:"libcares","static-libs-unix":["libcares.a"],"headers-unix":["ares.h","ares_dns.h","ares_nameser.h"]},Is={source:"libde265","static-libs-unix":["libde265.a"],"cpp-library":!0},Ps={source:"libevent","static-libs-unix":["libevent.a","libevent_core.a","libevent_extra.a","libevent_openssl.a"],"lib-depends":["openssl"]},$s={source:"libffi","static-libs-unix":["libffi.a"],"static-libs-windows":["libffi.lib"],"headers-unix":["ffi.h","ffitarget.h"],"headers-windows":["ffi.h","fficonfig.h","ffitarget.h"]},Us={source:"libheif","static-libs-unix":["libheif.a"],"lib-depends":["libde265","libwebp","libaom","zlib","brotli"]},Ls={source:"libiconv","static-libs-unix":["libiconv.a","libcharset.a"],headers:["iconv.h","libcharset.h","localcharset.h"]},Ns={source:"libjpeg","static-libs-unix":["libjpeg.a","libturbojpeg.a"],"static-libs-windows":["libjpeg_a.lib"],"lib-suggests-windows":["zlib"]},Os={source:"liblz4","static-libs-unix":["liblz4.a"]},Vs={source:"libmemcached","static-libs-unix":["libmemcached.a","libmemcachedutil.a"]},As={source:"libpng","static-libs-unix":["libpng16.a"],"static-libs-windows":["libpng16_static.lib","libpng_a.lib"],"headers-unix":["png.h","pngconf.h","pnglibconf.h"],"headers-windows":["png.h","pngconf.h"],"lib-depends":["zlib"]},js={source:"librabbitmq","static-libs-unix":["librabbitmq.a"],"static-libs-windows":["rabbitmq.4.lib"],"lib-depends":["openssl"]},Ts={source:"librdkafka","static-libs-unix":["librdkafka.a","librdkafka++.a","librdkafka-static.a"],"cpp-library":!0,"lib-suggests":["zstd"]},Gs={source:"libsodium","static-libs-unix":["libsodium.a"],"static-libs-windows":["libsodium.lib"]},Xs={source:"libssh2","static-libs-unix":["libssh2.a"],"static-libs-windows":["libssh2.lib"],headers:["libssh2.h","libssh2_publickey.h","libssh2_sftp.h"],"lib-depends":["openssl"],"lib-suggests":["zlib"]},Ms={source:"libtiff","static-libs-unix":["libtiff.a"],"lib-depends":["zlib","libjpeg"]},Hs={source:"libuuid","static-libs-unix":["libuuid.a"],headers:["uuid/uuid.h"]},Rs={source:"libuv","static-libs-unix":["libuv.a"]},Fs={source:"libwebp","static-libs-unix":["libwebp.a","libwebpdecoder.a","libwebpdemux.a","libwebpmux.a","libsharpyuv.a"],"static-libs-windows":["libwebp.lib","libwebpdecoder.lib","libwebpdemux.lib","libsharpyuv.lib"]},Zs={source:"libxml2","static-libs-unix":["libxml2.a"],"static-libs-windows":["libxml2s.lib","libxml2_a.lib"],headers:["libxml2"],"lib-depends-unix":["libiconv"],"lib-suggests-unix":["xz","icu","zlib"],"lib-depends-windows":["libiconv-win"],"lib-suggests-windows":["zlib"]},Qs={source:"libxslt","static-libs-unix":["libxslt.a","libexslt.a"],"lib-depends":["libxml2"]},Ks={source:"libyaml","static-libs-unix":["libyaml.a"],"static-libs-windows":["yaml.lib"],headers:["yaml.h"]},Ys={source:"libzip","static-libs-unix":["libzip.a"],"static-libs-windows":["zip.lib","libzip_a.lib"],headers:["zip.h","zipconf.h"],"lib-depends-unix":["zlib"],"lib-suggests-unix":["bzip2","xz","zstd","openssl"],"lib-depends-windows":["zlib","bzip2","xz"],"lib-suggests-windows":["zstd","openssl"]},Js={source:"mimalloc","static-libs-unix":["mimalloc.o"]},et={source:"ncurses","static-libs-unix":["libncurses.a"]},it={source:"nghttp2","static-libs-unix":["libnghttp2.a"],"static-libs-windows":["nghttp2.lib"],headers:["nghttp2"],"lib-depends":["zlib","openssl"],"lib-suggests":["libxml2","nghttp3","ngtcp2"]},st={source:"nghttp3","static-libs-unix":["libnghttp3.a"],"static-libs-windows":["nghttp3.lib"],headers:["nghttp3"],"lib-depends":["openssl"]},tt={source:"ngtcp2","static-libs-unix":["libngtcp2.a","libngtcp2_crypto_ossl.a"],"static-libs-windows":["ngtcp2.lib","ngtcp2_crypto_ossl.lib"],headers:["ngtcp2"],"lib-depends":["openssl"],"lib-suggests":["nghttp3","brotli"]},lt={source:"onig","static-libs-unix":["libonig.a"],"static-libs-windows":["onig.lib","onig_a.lib"],headers:["oniggnu.h","oniguruma.h"]},nt={source:"openssl","static-libs-unix":["libssl.a","libcrypto.a"],"static-libs-windows":["libssl.lib","libcrypto.lib"],headers:["openssl"],"lib-depends":["zlib"]},ot={source:"postgresql","static-libs-unix":["libpq.a","libpgport.a","libpgcommon.a"],"lib-depends":["libiconv","libxml2","openssl","zlib","readline"],"lib-suggests":["icu","libxslt","ldap","zstd"]},at={source:"pthreads4w","static-libs-windows":["libpthreadVC3.lib"]},dt={source:"qdbm","static-libs-unix":["libqdbm.a"],"static-libs-windows":["qdbm_a.lib"],"headers-windows":["depot.h"]},pt={source:"readline","static-libs-unix":["libreadline.a"],"lib-depends":["ncurses"]},ut={source:"snappy","static-libs-unix":["libsnappy.a"],"headers-unix":["snappy.h","snappy-c.h","snappy-sinksource.h","snappy-stubs-public.h"],"lib-depends":["zlib"]},ct={source:"sqlite","static-libs-unix":["libsqlite3.a"],"static-libs-windows":["libsqlite3_a.lib"],headers:["sqlite3.h","sqlite3ext.h"]},rt={source:"tidy","static-libs-unix":["libtidy.a"]},bt={source:"unixodbc","static-libs-unix":["libodbc.a","libodbccr.a","libodbcinst.a"],"lib-depends":["libiconv"]},wt={source:"xz","static-libs-unix":["liblzma.a"],"static-libs-windows":["lzma.lib","liblzma_a.lib"],"headers-unix":["lzma"],"headers-windows":["lzma","lzma.h"],"lib-depends-unix":["libiconv"]},gt={source:"zlib","static-libs-unix":["libz.a"],"static-libs-windows":["zlib_a.lib"],headers:["zlib.h","zconf.h"]},xt={source:"zstd","static-libs-unix":["libzstd.a"],"static-libs-windows":[["zstd.lib","zstd_static.lib"]],"headers-unix":["zdict.h","zstd.h","zstd_errors.h"],"headers-windows":["zstd.h","zstd_errors.h"]},mt={"lib-base":{type:"root","lib-depends-unix":["pkg-config"]},php:cs,micro:rs,"pkg-config":{type:"package",source:"pkg-config","bin-unix":["pkg-config"]},attr:bs,brotli:ws,bzip2:gs,curl:xs,freetype:ms,gettext:hs,glfw:ys,gmp:vs,gmssl:fs,grpc:zs,icu:Ss,imagemagick:Ds,imap:ks,ldap:Bs,libacl:qs,libaom:Es,libargon2:_s,libavif:Cs,libcares:Ws,libde265:Is,libevent:Ps,libffi:$s,"libffi-win":{source:"libffi-win","static-libs-windows":["libffi.lib"],"headers-windows":["ffi.h","ffitarget.h","fficonfig.h"]},libheif:Us,libiconv:Ls,"libiconv-win":{source:"libiconv-win","static-libs-windows":["libiconv.lib","libiconv_a.lib"]},libjpeg:Ns,liblz4:Os,libmemcached:Vs,libpng:As,librabbitmq:js,librdkafka:Ts,libsodium:Gs,libssh2:Xs,libtiff:Ms,libuuid:Hs,libuv:Rs,libwebp:Fs,libxml2:Zs,libxslt:Qs,libyaml:Ks,libzip:Ys,mimalloc:Js,ncurses:et,nghttp2:it,nghttp3:st,ngtcp2:tt,onig:lt,openssl:nt,postgresql:ot,"postgresql-win":{source:"postgresql-win","static-libs":["libpq.lib","libpgport.lib","libpgcommon.lib"]},pthreads4w:at,qdbm:dt,readline:pt,snappy:ut,sqlite:ct,tidy:rt,unixodbc:bt,xz:wt,zlib:gt,zstd:xt};function U(i,l,p,d){return i.os==="linux"?i[l][p][d+"-linux"]??i[l][p][d+"-unix"]??i[l][p][d]??[]:i.os==="macos"?i[l][p][d+"-macos"]??i[l][p][d+"-unix"]??i[l][p][d]??[]:i.os==="windows"?i[l][p][d+"-windows"]??i[l][p][d]??[]:[]}function ee(i,l){return U(i,"ext",l,"ext-depends")}function ht(i,l){return U(i,"ext",l,"ext-suggests")}function yt(i,l){return U(i,"ext",l,"lib-depends")}function vt(i,l){return U(i,"ext",l,"lib-suggests")}function ie(i,l){return U(i,"lib",l,"lib-depends")}function ft(i,l){return U(i,"lib",l,"lib-suggests")}function zt(i,l){const p=[],d=new Set,h=[];l.forEach(D=>{d.has(D)||kt(i,D,d,p)});const S=[];return p.forEach(D=>{l.indexOf(D)===-1&&h.push(D),[...yt(i,D),...vt(i,D)].forEach(a=>{S.indexOf(a)===-1&&S.push(a)})}),{exts:p,libs:St(i,S),notIncludedExts:h}}function St(i,l){const p=[],d=new Set;return l.forEach(h=>{d.has(h)||(console.log("before visited"),console.log(d),Dt(i,h,d,p),console.log("after visited"),console.log(d))}),p}function Dt(i,l,p,d){if(p.has(l))return;p.add(l),[...ie(i,l),...ft(i,l)].forEach(S=>{se(i,S,p,d)}),d.push(l)}function se(i,l,p,d){p.has(l)||(p.add(l),ie(i,l).forEach(h=>{se(i,h,p,d)}),d.push(l))}function te(i,l,p,d){p.has(p)||(p.add(l),ee(i,l).forEach(h=>{te(i,h,p,d)}),d.push(l))}function kt(i,l,p,d){if(p.has(l))return;p.add(l),[...ee(i,l),...ht(i,l)].forEach(S=>{te(i,S,p,d)}),d.push(l)}const B=i=>(me("data-v-9f8f76a1"),i=i(),he(),i),Bt={class:"option-line"},qt=["id","value","disabled"],Et=["for"],_t={class:"option-line"},Ct=B(()=>e("option",{value:"x86_64"},"x86_64",-1)),Wt=["disabled"],It={class:"box"},Pt=B(()=>e("br",null,null,-1)),$t={class:"ext-item"},Ut=["id","value","disabled"],Lt=["for"],Nt={style:{color:"orangered","font-weight":"bolder"}},Ot={class:"details custom-block",open:""},Vt={class:"box"},At={class:"ext-item"},jt=["id","value","disabled"],Tt=["for"],Gt={class:"tip custom-block"},Xt=B(()=>e("p",{class:"custom-block-title"},"TIP",-1)),Mt={class:"box"},Ht={class:"ext-item"},Rt=["id","value"],Ft=["for"],Zt={key:1,class:"warning custom-block"},Qt=B(()=>e("p",{class:"custom-block-title"},"WARNING",-1)),Kt={key:2,class:"warning custom-block"},Yt=B(()=>e("p",{class:"custom-block-title"},"WARNING",-1)),Jt={value:"native"},el={value:"spc"},il={key:0,value:"docker"},sl=["value"],tl={for:"debug-yes"},ll={for:"debug-no"},nl={for:"zts-yes"},ol={for:"zts-no"},al={for:"show-download-yes"},dl={for:"show-download-no"},pl={for:"pre-built-yes"},ul={for:"pre-built-no"},cl={key:0},rl={for:"upx-yes"},bl={for:"upx-no"},wl=["placeholder"],gl={key:3,class:"command-container"},xl={key:0,class:"command-preview"},ml=B(()=>e("br",null,null,-1)),hl={key:1},yl={class:"warning custom-block"},vl=B(()=>e("p",{class:"custom-block-title"},"WARNING",-1)),fl=B(()=>e("a",{href:"https://dl.static-php.dev/static-php-cli/spc-bin/nightly/spc-windows-x64.exe",target:"_blank"},"https://dl.static-php.dev/static-php-cli/spc-bin/nightly/spc-windows-x64.exe",-1)),zl={key:4,class:"command-container"},Sl={id:"download-ext-cmd",class:"command-preview"},Dl={key:5,class:"command-container"},kl={id:"download-all-cmd",class:"command-preview"},Bl={key:6,class:"command-container"},ql={id:"download-pkg-cmd",class:"command-preview"},El={class:"command-container"},_l={id:"build-cmd",class:"command-preview"},Cl={class:"command-container"},Wl=B(()=>e("b",null,"craft.yml",-1)),Il={id:"craft-cmd",class:"command-preview pre"},Pl={name:"CliGenerator"},$l=ge({...Pl,props:{lang:{type:String,default:"zh"}},setup(i){const l=w(us),p=z(()=>{const o=[];for(const[t,s]of Object.entries(l.value))D(t,c.value)&&o.push(t);return o}),d=w(mt),h=w([]),S=[{os:"linux",label:"Linux",disabled:!1},{os:"macos",label:"macOS",disabled:!1},{os:"windows",label:"Windows",disabled:!1}],D=(o,t)=>{var b,_;const r=new Map([["linux","Linux"],["macos","Darwin"],["windows","Windows"]]).get(t),u=((_=(b=l.value[o])==null?void 0:b.support)==null?void 0:_[r])??"yes";return u==="yes"||u==="partial"},K=["8.0","8.1","8.2","8.3","8.4"],a={zh:{selectExt:"选择扩展",buildTarget:"选择编译目标",buildOptions:"编译选项",buildEnvironment:"编译环境",buildEnvNative:"本地构建(Git 源码)",buildEnvSpc:"本地构建(独立 spc 二进制)",buildEnvDocker:"Alpine Docker 构建",useDebug:"是否开启调试输出",yes:"是",no:"否",resultShow:"结果展示",selectCommon:"选择常用扩展",selectNone:"全部取消选择",useZTS:"是否编译线程安全版",hardcodedINI:"硬编码 INI 选项",hardcodedINIPlacehoder:"如需要硬编码 ini,每行写一个,例如:memory_limit=2G",resultShowDownload:"是否展示仅下载对应扩展依赖的命令",downloadExtOnlyCommand:"只下载对应扩展的依赖包命令",downloadAllCommand:"下载所有依赖包命令",downloadUPXCommand:"下载 UPX 命令",compileCommand:"编译命令",downloadPhpVersion:"下载 PHP 版本",downloadSPCBinaryCommand:"下载 spc 二进制命令",selectedArch:"选择系统架构",selectedSystem:"选择操作系统",buildLibs:"要构建的库",depTips:"选择扩展后,不可选中的项目为必需的依赖,编译的依赖库列表中可选的为现有扩展和依赖库的可选依赖。选择可选依赖后,将生成 --with-libs 参数。",microUnavailable:"micro 不支持 PHP 7.4 及更早版本!",windowsSAPIUnavailable:"Windows 目前不支持 fpm、embed 构建!",useUPX:"是否开启 UPX 压缩(减小二进制体积)",windowsDownSPCWarning:"Windows 下请手动下载 spc.exe 二进制文件,解压到当前目录并重命名为 spc.exe!",usePreBuilt:"如果可能,下载预编译的依赖库(减少编译时间)"},en:{selectExt:"Select Extensions",buildTarget:"Build Target",buildOptions:"Build Options",buildEnvironment:"Build Environment",buildEnvNative:"Native build (Git source code)",buildEnvSpc:"Native build (standalone spc binary)",buildEnvDocker:"Alpine docker build",useDebug:"Enable debug message",yes:"Yes",no:"No",resultShow:"Result",selectCommon:"Select common extensions",selectNone:"Unselect all",useZTS:"Enable ZTS",hardcodedINI:"Hardcoded INI options",hardcodedINIPlacehoder:"If you need to hardcode ini, write one per line, for example: memory_limit=2G",resultShowDownload:"Download with corresponding extension dependencies",downloadExtOnlyCommand:"Download sources by extensions command",downloadAllCommand:"Download all sources command",downloadUPXCommand:"Download UPX command",compileCommand:"Compile command",downloadPhpVersion:"Download PHP version",downloadSPCBinaryCommand:"Download spc binary command",selectedArch:"Select build architecture",selectedSystem:"Select Build OS",buildLibs:"Select Dependencies",depTips:"After selecting the extensions, the unselectable items are essential dependencies. In the compiled dependencies list, optional dependencies consist of existing extensions and optional dependencies of libraries. Optional dependencies will be added in --with-libs parameter.",microUnavailable:"Micro does not support PHP 7.4 and earlier versions!",windowsSAPIUnavailable:"Windows does not support fpm and embed build!",useUPX:"Enable UPX compression (reduce binary size)",windowsDownSPCWarning:"Please download the binary file manually, extract it to the current directory and rename to spc.exe on Windows!",usePreBuilt:"Download pre-built dependencies if possible (reduce compile time)"}},le=["cli","fpm","micro","embed","all"],ne=()=>{y.value=["apcu","bcmath","calendar","ctype","curl","dba","dom","exif","filter","fileinfo","gd","iconv","intl","mbstring","mbregex","mysqli","mysqlnd","openssl","opcache","pcntl","pdo","pdo_mysql","pdo_sqlite","pdo_pgsql","pgsql","phar","posix","readline","redis","session","simplexml","sockets","sodium","sqlite3","tokenizer","xml","xmlreader","xmlwriter","xsl","zip","zlib"]},X=z(()=>y.value.join(",")),M=z(()=>{const o=q.value.filter(t=>V.value.indexOf(t)===-1);return o.length>0?' --with-libs="'+o.join(",")+'"':""}),y=w([]),q=w([]),H=w([]),V=w([]),v=w(["cli"]),A=w("spc"),P=w("8.2"),k=w(0),$=w(0),L=w(1),C=w(1),E=w(0),R=w(""),c=w("linux");G(c,()=>{c.value==="windows"&&(j.value="x86_64")});const j=w("x86_64"),T=z(()=>{switch(A.value){case"native":return"bin/spc";case"spc":return c.value==="windows"?".\\spc.exe":"./spc";case"docker":return"bin/spc-alpine-docker";default:return""}}),Y=w("--build-cli"),oe=z(()=>{const o=R.value.split(` -`);let t=[];return o.forEach(s=>{s.indexOf("=")>=1&&t.push(s)})," "+t.map(s=>'-I "'+s+'"').join(" ")}),W=w(""),F=(o,t)=>o.includes(W.value)?t===0?o.substring(0,o.indexOf(W.value)):t===1?W.value:o.substring(o.indexOf(W.value)+W.value.length):t===0?o:"",ae=o=>{let t;v.value.indexOf("all")!==-1&&o.target.value==="all"?v.value=["all"]:(t=v.value.indexOf("all"))!==-1&&o.target.value!=="all"&&v.value.splice(t,1),Y.value=v.value.map(s=>"--build-"+s).join(" ")},de=o=>{const t=new Set,s=r=>{let u=[];if(c.value==="linux"){if(u=l.value[r]["ext-depends-linux"]??l.value[r]["ext-depends-unix"]??l.value[r]["ext-depends"]??[],u.length===0)return}else if(c.value==="macos"){if(u=l.value[r]["ext-depends-macos"]??l.value[r]["ext-depends-unix"]??l.value[r]["ext-depends"]??[],u.length===0)return}else if(c.value==="windows"&&(u=l.value[r]["ext-depends-windows"]??l.value[r]["ext-depends"]??[],u.length===0))return;u.forEach(b=>{t.add(b),s(b)})};return o.forEach(r=>{s(r)}),Array.from(t)},pe=z(()=>`${T.value} download --all --with-php=${P.value}${C.value?" --prefer-pre-built":""}${k.value?" --debug":""}`),ue=z(()=>`${T.value} download --with-php=${P.value} --for-extensions "${X.value}"${C.value?" --prefer-pre-built":""}${k.value?" --debug":""}`),ce=z(()=>`${T.value} install-pkg upx${k.value?" --debug":""}`),re=z(()=>`${T.value} build ${Y.value} "${X.value}"${M.value}${k.value?" --debug":""}${$.value?" --enable-zts":""}${E.value?" --with-upx-pack":""}${oe.value}`),be=z(()=>{let o=`php-version: ${P.value} -`;return o+=`extensions: "${X.value}" -`,v.value.join(",")==="all"?o+="sapi: "+["cli","fpm","micro","embed"].join(",")+` -`:o+=`sapi: ${v.value.join(",")} -`,M.value&&(o+=`libs: ${M.value.replace('--with-libs="',"").replace('"',"").trim()} -`),k.value&&(o+=`debug: true -`),o+="{{position_hold}}",E.value&&(o+=` with-upx-pack: true -`),$.value&&(o+=` enable-zts: true -`),C.value&&(o+=` prefer-pre-built: true -`),o.endsWith("{{position_hold}}")?o=o.replace("{{position_hold}}",""):o=o.replace("{{position_hold}}",`build-options: -`),o}),we=o=>{const t=new Set,s=u=>{let b=[];if(c.value==="linux"){if(b=d.value[u]["lib-depends-linux"]??d.value[u]["lib-depends-unix"]??d.value[u]["lib-depends"]??[],b.length===0)return}else if(c.value==="macos"){if(b=d.value[u]["lib-depends-macos"]??d.value[u]["lib-depends-unix"]??d.value[u]["lib-depends"]??[],b.length===0)return}else if(c.value==="windows"&&(b=d.value[u]["lib-depends-windows"]??d.value[u]["lib-depends"]??[],b.length===0))return;b.forEach(_=>{t.add(_),s(_)})},r=u=>{let b=[];if(c.value==="linux"){if(b=l.value[u]["lib-depends-linux"]??l.value[u]["lib-depends-unix"]??l.value[u]["lib-depends"]??[],b.length===0)return}else if(c.value==="macos"){if(b=l.value[u]["lib-depends-macos"]??l.value[u]["lib-depends-unix"]??l.value[u]["lib-depends"]??[],b.length===0)return}else if(c.value==="windows"&&(b=l.value[u]["lib-depends-windows"]??l.value[u]["lib-depends"]??[],b.length===0))return;b.forEach(_=>{t.add(_),s(_)})};return o.forEach(u=>{r(u)}),Array.from(t)};return G(c,()=>y.value=[]),G(c,()=>E.value=0),G(y,o=>{H.value=de(o),H.value.forEach(s=>{y.value.indexOf(s)===-1&&y.value.push(s)}),y.value.sort(),console.log("检测到变化!"),console.log(o);const t=zt({ext:l.value,lib:d.value,os:c.value},y.value);h.value=t.libs.sort(),q.value=[],V.value=we(t.exts),V.value.forEach(s=>{q.value.indexOf(s)===-1&&q.value.push(s)})}),(o,t)=>(g(),x("div",null,[e("h2",null,n(a[i.lang].selectedSystem),1),e("div",Bt,[(g(),x(N,null,O(S,(s,r)=>e("span",{key:r,style:{"margin-right":"8px"}},[m(e("input",{type:"radio",id:"os-"+s.os,value:s.os,disabled:s.disabled===!0,"onUpdate:modelValue":t[0]||(t[0]=u=>c.value=u)},null,8,qt),[[f,c.value]]),e("label",{for:"os-"+s.os},n(s.label),9,Et)])),64))]),e("div",_t,[m(e("select",{"onUpdate:modelValue":t[1]||(t[1]=s=>j.value=s)},[Ct,e("option",{value:"aarch64",disabled:c.value==="windows"},"aarch64",8,Wt)],512),[[Z,j.value]])]),e("h2",null,n(a[i.lang].selectExt)+n(y.value.length>0?" ("+y.value.length+")":""),1),e("div",It,[m(e("input",{class:"input","onUpdate:modelValue":t[2]||(t[2]=s=>W.value=s),placeholder:"Highlight search..."},null,512),[[J,W.value]]),Pt,(g(!0),x(N,null,O(p.value,s=>(g(),x("div",$t,[e("span",null,[m(e("input",{type:"checkbox",id:s,value:s,"onUpdate:modelValue":t[3]||(t[3]=r=>y.value=r),disabled:H.value.indexOf(s)!==-1},null,8,Ut),[[Q,y.value]]),e("label",{for:s},[e("span",null,n(F(s,0)),1),e("span",Nt,n(F(s,1)),1),e("span",null,n(F(s,2)),1)],8,Lt)])]))),256))]),c.value!=="windows"?(g(),x("div",{key:0,class:"my-btn",onClick:ne},n(a[i.lang].selectCommon),1)):I("",!0),e("div",{class:"my-btn",onClick:t[4]||(t[4]=s=>y.value=[])},n(a[i.lang].selectNone),1),e("details",Ot,[e("summary",null,n(a[i.lang].buildLibs)+n(q.value.length>0?" ("+q.value.length+")":""),1),e("div",Vt,[(g(!0),x(N,null,O(h.value,(s,r)=>(g(),x("div",At,[m(e("input",{type:"checkbox",id:r,value:s,"onUpdate:modelValue":t[5]||(t[5]=u=>q.value=u),disabled:V.value.indexOf(s)!==-1},null,8,jt),[[Q,q.value]]),e("label",{for:r},n(s),9,Tt)]))),256))])]),e("div",Gt,[Xt,e("p",null,n(a[i.lang].depTips),1)]),e("h2",null,n(a[i.lang].buildTarget),1),e("div",Mt,[(g(),x(N,null,O(le,s=>e("div",Ht,[m(e("input",{type:"checkbox",id:"build_"+s,value:s,"onUpdate:modelValue":t[6]||(t[6]=r=>v.value=r),onChange:ae},null,40,Rt),[[Q,v.value]]),e("label",{for:"build_"+s},n(s),9,Ft)])),64))]),P.value==="7.4"&&(v.value.indexOf("micro")!==-1||v.value.indexOf("all")!==-1)?(g(),x("div",Zt,[Qt,e("p",null,n(a[i.lang].microUnavailable),1)])):I("",!0),c.value==="windows"&&(v.value.indexOf("fpm")!==-1||v.value.indexOf("embed")!==-1)?(g(),x("div",Kt,[Yt,e("p",null,n(a[i.lang].windowsSAPIUnavailable),1)])):I("",!0),e("h2",null,n(a[i.lang].buildOptions),1),e("table",null,[e("tr",null,[e("td",null,n(a[i.lang].buildEnvironment),1),e("td",null,[m(e("select",{"onUpdate:modelValue":t[7]||(t[7]=s=>A.value=s)},[e("option",Jt,n(a[i.lang].buildEnvNative),1),e("option",el,n(a[i.lang].buildEnvSpc),1),c.value!=="windows"?(g(),x("option",il,n(a[i.lang].buildEnvDocker),1)):I("",!0)],512),[[Z,A.value]])])]),e("tr",null,[e("td",null,n(a[i.lang].downloadPhpVersion),1),e("td",null,[m(e("select",{"onUpdate:modelValue":t[8]||(t[8]=s=>P.value=s)},[(g(),x(N,null,O(K,s=>e("option",{value:s},n(s),9,sl)),64))],512),[[Z,P.value]])])]),e("tr",null,[e("td",null,n(a[i.lang].useDebug),1),e("td",null,[m(e("input",{type:"radio",id:"debug-yes",value:1,"onUpdate:modelValue":t[9]||(t[9]=s=>k.value=s)},null,512),[[f,k.value]]),e("label",tl,n(a[i.lang].yes),1),m(e("input",{type:"radio",id:"debug-no",value:0,"onUpdate:modelValue":t[10]||(t[10]=s=>k.value=s)},null,512),[[f,k.value]]),e("label",ll,n(a[i.lang].no),1)])]),e("tr",null,[e("td",null,n(a[i.lang].useZTS),1),e("td",null,[m(e("input",{type:"radio",id:"zts-yes",value:1,"onUpdate:modelValue":t[11]||(t[11]=s=>$.value=s)},null,512),[[f,$.value]]),e("label",nl,n(a[i.lang].yes),1),m(e("input",{type:"radio",id:"zts-no",value:0,"onUpdate:modelValue":t[12]||(t[12]=s=>$.value=s)},null,512),[[f,$.value]]),e("label",ol,n(a[i.lang].no),1)])]),e("tr",null,[e("td",null,n(a[i.lang].resultShowDownload),1),e("td",null,[m(e("input",{type:"radio",id:"show-download-yes",value:1,"onUpdate:modelValue":t[13]||(t[13]=s=>L.value=s)},null,512),[[f,L.value]]),e("label",al,n(a[i.lang].yes),1),m(e("input",{type:"radio",id:"show-download-no",value:0,"onUpdate:modelValue":t[14]||(t[14]=s=>L.value=s)},null,512),[[f,L.value]]),e("label",dl,n(a[i.lang].no),1)])]),e("tr",null,[e("td",null,n(a[i.lang].usePreBuilt),1),e("td",null,[m(e("input",{type:"radio",id:"pre-built-yes",value:1,"onUpdate:modelValue":t[15]||(t[15]=s=>C.value=s)},null,512),[[f,C.value]]),e("label",pl,n(a[i.lang].yes),1),m(e("input",{type:"radio",id:"pre-built-no",value:0,"onUpdate:modelValue":t[16]||(t[16]=s=>C.value=s)},null,512),[[f,C.value]]),e("label",ul,n(a[i.lang].no),1)])]),c.value!=="macos"?(g(),x("tr",cl,[e("td",null,n(a[i.lang].useUPX),1),e("td",null,[m(e("input",{type:"radio",id:"upx-yes",value:1,"onUpdate:modelValue":t[17]||(t[17]=s=>E.value=s)},null,512),[[f,E.value]]),e("label",rl,n(a[i.lang].yes),1),m(e("input",{type:"radio",id:"upx-no",value:0,"onUpdate:modelValue":t[18]||(t[18]=s=>E.value=s)},null,512),[[f,E.value]]),e("label",bl,n(a[i.lang].no),1)])])):I("",!0)]),e("h2",null,n(a[i.lang].hardcodedINI),1),m(e("textarea",{class:"textarea",placeholder:a[i.lang].hardcodedINIPlacehoder,"onUpdate:modelValue":t[19]||(t[19]=s=>R.value=s),rows:"5"},null,8,wl),[[J,R.value]]),e("h2",null,n(a[i.lang].resultShow),1),A.value==="spc"?(g(),x("div",gl,[e("b",null,n(a[i.lang].downloadSPCBinaryCommand),1),c.value!=="windows"?(g(),x("div",xl,[xe(" curl -fsSL -o spc.tgz https://dl.static-php.dev/static-php-cli/spc-bin/nightly/spc-"+n(c.value)+"-"+n(j.value)+".tar.gz && tar -zxvf spc.tgz && rm spc.tgz",1),ml])):(g(),x("div",hl,[e("div",yl,[vl,e("p",null,n(a[i.lang].windowsDownSPCWarning),1),fl])]))])):I("",!0),L.value?(g(),x("div",zl,[e("b",null,n(a[i.lang].downloadExtOnlyCommand),1),e("div",Sl,n(ue.value),1)])):(g(),x("div",Dl,[e("b",null,n(a[i.lang].downloadAllCommand),1),e("div",kl,n(pe.value),1)])),E.value?(g(),x("div",Bl,[e("b",null,n(a[i.lang].downloadUPXCommand),1),e("div",ql,n(ce.value),1)])):I("",!0),e("div",El,[e("b",null,n(a[i.lang].compileCommand),1),e("div",_l,n(re.value),1)]),e("div",Cl,[Wl,e("div",Il,n(be.value),1)])]))}}),Ll=ye($l,[["__scopeId","data-v-9f8f76a1"]]);export{Ll as C}; diff --git a/assets/chunks/CliGenerator.D2FJpN3t.js b/assets/chunks/CliGenerator.D2FJpN3t.js new file mode 100644 index 00000000..ad268c7f --- /dev/null +++ b/assets/chunks/CliGenerator.D2FJpN3t.js @@ -0,0 +1,12 @@ +import{d as ge,x as w,h as z,z as G,c as g,o as x,j as e,e as C,ag as m,t as n,G as N,H as O,ah as f,ai as F,aj as Y,ak as Z,a as xe,_ as me}from"./framework.PeLcR_tw.js";const he={support:{BSD:"wip"},type:"external","arg-type":"custom",source:"amqp","lib-depends":["librabbitmq"],"ext-depends-windows":["openssl"]},ye={type:"external",source:"apcu"},ve={type:"external",source:"ast"},fe={type:"builtin"},ze={type:"external",source:"ext-brotli","arg-type":"enable","lib-depends":["brotli"]},Se={type:"builtin","arg-type-unix":"with-prefix","arg-type-windows":"with","lib-depends":["bzip2"]},De={type:"builtin"},ke={type:"builtin"},Be={notes:!0,type:"builtin","arg-type":"with","lib-depends":["curl"],"ext-depends-windows":["zlib","openssl"]},qe={type:"builtin","arg-type":"custom","lib-suggests":["qdbm"]},Ee={support:{BSD:"wip"},type:"external",source:"dio"},Ce={support:{BSD:"wip"},type:"builtin","arg-type":"custom","arg-type-windows":"with","lib-depends":["libxml2","zlib"],"ext-depends-windows":["xml"]},We={type:"external",source:"ext-ds"},Pe={support:{Windows:"wip",BSD:"wip",Darwin:"wip",Linux:"wip"},type:"wip"},Ie={type:"external",source:"ev","arg-type-windows":"with","ext-depends":["sockets"]},$e={support:{Windows:"wip",BSD:"wip"},notes:!0,type:"external",source:"ext-event","arg-type":"custom","lib-depends":["libevent"],"ext-depends":["openssl"],"ext-suggests":["sockets"]},Ue={type:"builtin"},Le={support:{Linux:"partial",BSD:"wip"},notes:!0,"arg-type":"custom",type:"builtin","lib-depends-unix":["libffi"],"lib-depends-windows":["libffi-win"]},Ne={type:"builtin"},Oe={type:"builtin"},Ve={type:"builtin","lib-suggests":["openssl"]},Ae={support:{BSD:"wip"},notes:!0,type:"builtin","arg-type":"custom","arg-type-windows":"with","lib-depends":["zlib","libpng"],"ext-depends":["zlib"],"lib-suggests":["libavif","libwebp","libjpeg","freetype"]},Te={support:{Windows:"wip",BSD:"wip"},type:"builtin","arg-type":"with-prefix","lib-depends":["gettext"]},je={support:{Windows:"wip",BSD:"no",Linux:"no"},notes:!0,type:"external","arg-type":"custom",source:"ext-glfw","lib-depends":["glfw"],"lib-depends-windows":[]},Ge={support:{Windows:"wip",BSD:"wip"},type:"builtin","arg-type":"with-prefix","lib-depends":["gmp"]},Xe={support:{BSD:"wip"},type:"external",source:"ext-gmssl","lib-depends":["gmssl"]},He={support:{Windows:"wip",BSD:"wip"},type:"external",source:"grpc","arg-type-unix":"custom","cpp-extension":!0,"lib-depends":["grpc"]},Me={support:{BSD:"wip"},type:"builtin","arg-type":"with-prefix","arg-type-windows":"with","lib-depends-unix":["libiconv"],"lib-depends-windows":["libiconv-win"]},_e={support:{BSD:"wip"},type:"external",source:"igbinary","ext-suggests":["session","apcu"]},Re={support:{Windows:"wip",BSD:"wip"},notes:!0,type:"external",source:"ext-imagick","arg-type":"custom","lib-depends":["imagemagick"]},Fe={support:{Windows:"wip",BSD:"wip"},notes:!0,type:"external",source:"ext-imap","arg-type":"custom","lib-depends":["imap"],"ext-suggests":["openssl"]},Ze={support:{Windows:"no",BSD:"wip",Darwin:"no"},type:"external",source:"inotify"},Qe={support:{Windows:"no",BSD:"wip"},type:"builtin","lib-depends":["icu"]},Ke={support:{Windows:"wip",BSD:"wip"},type:"builtin","arg-type":"with-prefix","lib-depends":["ldap"],"lib-suggests":["gmp","libsodium"],"ext-suggests":["openssl"]},Ye={support:{BSD:"wip"},type:"builtin","arg-type":"none",target:["static"]},Je={support:{Windows:"wip",BSD:"wip"},type:"external",source:"ext-lz4","arg-type":"custom","lib-depends":["liblz4"]},ei={type:"builtin","arg-type":"custom",target:["static"],"ext-depends":["mbstring"],"lib-depends":["onig"]},ii={type:"builtin","arg-type":"custom"},si={type:"wip",support:{Windows:"no",BSD:"no",Darwin:"no",Linux:"no"},notes:!0},ti={support:{Windows:"wip",BSD:"wip"},type:"external",source:"ext-memcache","arg-type":"custom","ext-depends":["zlib","session"],"build-with-php":!0},li={support:{Windows:"wip",BSD:"wip"},type:"external",source:"memcached","arg-type":"custom","cpp-extension":!0,"lib-depends":["libmemcached"],"lib-depends-unix":["libmemcached","fastlz"],"ext-depends":["session","zlib"]},ni={support:{BSD:"wip",Windows:"wip"},type:"external",source:"mongodb","arg-type":"custom","lib-suggests":["icu","openssl","zstd","zlib"],frameworks:["CoreFoundation","Security"]},oi={support:{BSD:"wip"},type:"external",source:"msgpack","arg-type-unix":"with","arg-type-win":"enable","ext-depends":["session"]},ai={type:"builtin","arg-type":"with","ext-depends":["mysqlnd"]},di={type:"builtin","arg-type-windows":"with","lib-depends":["zlib"]},ui={type:"wip",support:{Windows:"wip",BSD:"no",Darwin:"no",Linux:"no"},notes:!0},pi={support:{BSD:"wip",Windows:"wip"},type:"builtin","arg-type-unix":"custom","lib-depends-unix":["unixodbc"]},ri={type:"builtin","arg-type-unix":"custom","zend-extension":!0},ci={notes:!0,type:"builtin","arg-type":"custom","arg-type-windows":"with","lib-depends":["openssl","zlib"],"ext-depends":["zlib"]},bi={support:{BSD:"wip"},type:"external",source:"opentelemetry"},wi={support:{BSD:"wip"},notes:!0,type:"external",source:"parallel","arg-type-windows":"with","lib-depends-windows":["pthreads4w"]},gi={support:{Windows:"no"},type:"builtin","unix-only":!0},xi={type:"builtin"},mi={type:"builtin","arg-type":"with","ext-depends":["pdo","mysqlnd"]},hi={support:{BSD:"wip"},type:"builtin","arg-type":"custom","lib-depends-unix":["unixodbc"],"ext-depends":["pdo","odbc"]},yi={support:{BSD:"wip"},type:"builtin","arg-type":"with-prefix","arg-type-windows":"custom","ext-depends":["pdo","pgsql"],"lib-depends-unix":["postgresql"],"lib-depends-windows":["postgresql-win"]},vi={support:{BSD:"wip"},type:"builtin","arg-type":"with","ext-depends":["pdo","sqlite3"],"lib-depends":["sqlite"]},fi={support:{BSD:"wip"},type:"external",source:"pdo_sqlsrv","arg-type":"with","ext-depends":["pdo","sqlsrv"]},zi={support:{BSD:"wip"},notes:!0,type:"builtin","arg-type":"custom","lib-depends-unix":["postgresql"],"lib-depends-windows":["postgresql-win"]},Si={type:"builtin","ext-depends":["zlib"]},Di={support:{Windows:"no"},type:"builtin","unix-only":!0},ki={support:{Windows:"wip",BSD:"wip"},type:"external",source:"protobuf"},Bi={support:{BSD:"wip",Darwin:"partial"},notes:!0,type:"external",source:"rar","cpp-extension":!0},qi={support:{BSD:"wip",Windows:"wip"},type:"external",source:"ext-rdkafka","arg-type":"custom","cpp-extension":!0,"lib-depends":["librdkafka"]},Ei={support:{Windows:"wip",BSD:"wip"},type:"builtin","arg-type":"with-prefix","lib-depends":["readline"],target:["static"]},Ci={support:{BSD:"wip"},type:"external",source:"redis","arg-type":"custom","ext-suggests":["session","igbinary"],"lib-suggests-unix":["zstd","liblz4"]},Wi={type:"builtin","build-with-php":!0},Pi={type:"builtin","build-with-php":!0},Ii={type:"external",source:"ext-simdjson","cpp-extension":!0},$i={support:{BSD:"wip"},type:"builtin","arg-type":"custom","lib-depends":["libxml2"],"ext-depends-windows":["xml"],"build-with-php":!0},Ui={support:{Windows:"wip",BSD:"wip"},type:"external",source:"ext-snappy","cpp-extension":!0,"arg-type":"custom","lib-depends":["snappy"],"ext-suggests":["apcu"]},Li={support:{BSD:"wip"},type:"builtin","arg-type":"custom","lib-depends":["libxml2"],"ext-depends-windows":["xml"]},Ni={type:"builtin"},Oi={support:{BSD:"wip"},type:"builtin","arg-type":"with","lib-depends":["libsodium"]},Vi={support:{BSD:"wip",Windows:"no"},notes:!0,type:"external",source:"spx","arg-type":"custom","lib-depends":["zlib"]},Ai={support:{BSD:"wip"},type:"builtin","arg-type":"with-prefix","arg-type-windows":"with","lib-depends":["sqlite"]},Ti={support:{BSD:"wip"},type:"external",source:"sqlsrv","lib-depends-unix":["unixodbc"],"ext-depends-linux":["pcntl"],"cpp-extension":!0},ji={support:{BSD:"wip"},type:"external",source:"ext-ssh2","arg-type":"with-prefix","arg-type-windows":"with","lib-depends":["libssh2"],"ext-depends":["openssl","zlib"]},Gi={support:{Windows:"no",BSD:"wip"},notes:!0,type:"external",source:"swoole","arg-type":"custom","cpp-extension":!0,"unix-only":!0,"lib-depends":["libcares","brotli","nghttp2","zlib"],"ext-depends":["openssl","curl"],"ext-suggests":["swoole-hook-pgsql","swoole-hook-mysql","swoole-hook-sqlite"]},Xi={support:{BSD:"wip"},notes:!0,type:"external",source:"swow","arg-type":"custom","lib-suggests":["openssl","curl"],"ext-suggests":["openssl","curl"]},Hi={support:{Windows:"no",BSD:"wip"},type:"builtin","unix-only":!0},Mi={support:{Windows:"no",BSD:"wip"},type:"builtin","unix-only":!0},_i={support:{BSD:"wip"},type:"builtin"},Ri={support:{Windows:"wip",BSD:"wip"},type:"builtin","arg-type":"with-prefix","lib-depends":["tidy"]},Fi={type:"builtin","build-with-php":!0},Zi={support:{Windows:"wip",BSD:"wip"},type:"external",source:"ext-uuid","arg-type":"with-prefix","lib-depends":["libuuid"]},Qi={support:{Windows:"wip",BSD:"wip"},type:"external",source:"ext-uv","arg-type":"with-prefix","lib-depends":["libuv"],"ext-depends":["sockets"]},Ki={type:"external",source:"xdebug",target:["shared"],support:{Windows:"wip",BSD:"no",Darwin:"partial",Linux:"partial"},notes:!0,"zend-extension":!0},Yi={support:{Windows:"wip",BSD:"wip"},notes:!0,type:"external",source:"xhprof","ext-depends":["ctype"],"build-with-php":!0},Ji={support:{BSD:"wip"},type:"external",source:"xlswriter","arg-type":"custom","ext-depends":["zlib","zip"],"lib-suggests":["openssl"]},es={support:{BSD:"wip"},notes:!0,type:"builtin","arg-type":"custom","arg-type-windows":"with","lib-depends":["libxml2"],"ext-depends-windows":["iconv"],"build-with-php":!0},is={support:{BSD:"wip"},type:"builtin","arg-type":"custom","lib-depends":["libxml2"],"ext-depends-windows":["xml","dom"],"build-with-php":!0},ss={support:{BSD:"wip"},type:"builtin","arg-type":"custom","lib-depends":["libxml2"],"ext-depends-windows":["xml"],"build-with-php":!0},ts={support:{Windows:"wip",BSD:"wip"},type:"builtin","arg-type":"with-prefix","lib-depends":["libxslt"],"ext-depends":["xml","dom"]},ls={type:"external",source:"ext-xz","arg-type":"with","lib-depends":["xz"]},ns={support:{BSD:"wip"},type:"external",source:"yac","arg-type-unix":"custom","lib-depends-unix":["fastlz"],"ext-depends-unix":["igbinary"]},os={support:{BSD:"wip"},type:"external",source:"yaml","arg-type-unix":"with-prefix","arg-type-windows":"with","lib-depends":["libyaml"]},as={support:{BSD:"wip"},type:"builtin","arg-type":"with-prefix","arg-type-windows":"enable","lib-depends-unix":["libzip"],"ext-depends-windows":["zlib","bz2"],"lib-depends-windows":["libzip","zlib","bzip2","xz"]},ds={type:"builtin","arg-type":"custom","arg-type-windows":"enable","lib-depends":["zlib"],target:["static"]},us={support:{Windows:"wip",BSD:"wip"},type:"external",source:"ext-zstd","arg-type":"custom","lib-depends":["zstd"]},ps={amqp:he,apcu:ye,ast:ve,bcmath:fe,brotli:ze,bz2:Se,calendar:De,ctype:ke,curl:Be,dba:qe,dio:Ee,dom:Ce,ds:We,enchant:Pe,ev:Ie,event:$e,exif:Ue,ffi:Le,fileinfo:Ne,filter:Oe,ftp:Ve,gd:Ae,gettext:Te,glfw:je,gmp:Ge,gmssl:Xe,grpc:He,iconv:Me,igbinary:_e,imagick:Re,imap:Fe,inotify:Ze,intl:Qe,ldap:Ke,libxml:Ye,lz4:Je,mbregex:ei,mbstring:ii,mcrypt:si,memcache:ti,memcached:li,mongodb:ni,msgpack:oi,mysqli:ai,mysqlnd:di,oci8:ui,odbc:pi,opcache:ri,openssl:ci,opentelemetry:bi,parallel:wi,"password-argon2":{support:{Windows:"wip",BSD:"wip"},notes:!0,type:"builtin","arg-type":"with-prefix","lib-depends":["libargon2"]},pcntl:gi,pdo:xi,pdo_mysql:mi,pdo_odbc:hi,pdo_pgsql:yi,pdo_sqlite:vi,pdo_sqlsrv:fi,pgsql:zi,phar:Si,posix:Di,protobuf:ki,rar:Bi,rdkafka:qi,readline:Ei,redis:Ci,session:Wi,shmop:Pi,simdjson:Ii,simplexml:$i,snappy:Ui,soap:Li,sockets:Ni,sodium:Oi,spx:Vi,sqlite3:Ai,sqlsrv:Ti,ssh2:ji,swoole:Gi,"swoole-hook-mysql":{support:{Windows:"no",BSD:"wip"},notes:!0,type:"addon","arg-type":"custom","ext-depends":["mysqlnd","pdo","pdo_mysql"],"ext-suggests":["mysqli"]},"swoole-hook-pgsql":{support:{Windows:"no",BSD:"wip",Darwin:"partial"},notes:!0,type:"addon","arg-type":"custom","ext-depends":["pgsql","pdo"]},"swoole-hook-sqlite":{support:{Windows:"no",BSD:"wip"},notes:!0,type:"addon","arg-type":"custom","ext-depends":["sqlite3","pdo"]},swow:Xi,sysvmsg:Hi,sysvsem:Mi,sysvshm:_i,tidy:Ri,tokenizer:Fi,uuid:Zi,uv:Qi,xdebug:Ki,xhprof:Yi,xlswriter:Ji,xml:es,xmlreader:is,xmlwriter:ss,xsl:ts,xz:ls,yac:ns,yaml:os,zip:as,zlib:ds,zstd:us},rs={type:"root",source:"php-src","lib-depends":["lib-base","micro"],"lib-suggests-linux":["libacl"]},cs={type:"target",source:"micro"},bs={source:"attr","static-libs-unix":["libattr.a"]},ws={source:"brotli","static-libs-unix":["libbrotlidec.a","libbrotlienc.a","libbrotlicommon.a"],"static-libs-windows":["brotlicommon.lib","brotlienc.lib","brotlidec.lib"],headers:["brotli"]},gs={source:"bzip2","static-libs-unix":["libbz2.a"],"static-libs-windows":["libbz2.lib","libbz2_a.lib"],headers:["bzlib.h"]},xs={source:"curl","static-libs-unix":["libcurl.a"],"static-libs-windows":["libcurl_a.lib"],headers:["curl"],"lib-depends-unix":["openssl","zlib"],"lib-depends-windows":["zlib","libssh2","nghttp2"],"lib-suggests-unix":["libssh2","brotli","nghttp2","nghttp3","ngtcp2","zstd","libcares"],"lib-suggests-windows":["brotli","zstd"],frameworks:["CoreFoundation","CoreServices","SystemConfiguration"]},ms={source:"fastlz","static-libs-unix":["libfastlz.a"],headers:["fastlz/fastlz.h"]},hs={source:"freetype","static-libs-unix":["libfreetype.a"],"static-libs-windows":["libfreetype_a.lib"],"headers-unix":["freetype2/freetype/freetype.h","freetype2/ft2build.h"],"lib-depends":["zlib"],"lib-suggests":["libpng","bzip2","brotli"]},ys={source:"gettext","static-libs-unix":["libintl.a"],"lib-depends":["libiconv"],"lib-suggests":["ncurses","libxml2"],frameworks:["CoreFoundation"]},vs={source:"ext-glfw","static-libs-unix":["libglfw3.a"],frameworks:["CoreVideo","OpenGL","Cocoa","IOKit"]},fs={source:"gmp","static-libs-unix":["libgmp.a"],"static-libs-windows":["libgmp.lib"],headers:["gmp.h"]},zs={source:"gmssl","static-libs-unix":["libgmssl.a"],"static-libs-windows":["gmssl.lib"],frameworks:["Security"]},Ss={source:"grpc","static-libs-unix":["libgrpc.a","libcares.a"],"lib-depends":["zlib","openssl"],frameworks:["CoreFoundation"]},Ds={source:"icu","cpp-library":!0,"static-libs-unix":["libicui18n.a","libicuio.a","libicuuc.a","libicudata.a"]},ks={source:"imagemagick","static-libs-unix":["libMagick++-7.Q16HDRI.a","libMagickWand-7.Q16HDRI.a","libMagickCore-7.Q16HDRI.a"],"lib-depends":["zlib","libpng","libjpeg","libwebp","freetype","libtiff","libheif","bzip2"],"lib-suggests":["zstd","xz","libzip","libxml2"]},Bs={source:"imap","static-libs-unix":["libc-client.a"],"lib-suggests":["openssl"]},qs={source:"ldap","static-libs-unix":["libldap.a","liblber.a"],"lib-depends":["openssl","zlib","gmp","libsodium"]},Es={source:"libacl","static-libs-unix":["libacl.a"],"lib-depends":["attr"]},Cs={source:"libaom","static-libs-unix":["libaom.a"],"cpp-library":!0},Ws={source:"libargon2","static-libs-unix":["libargon2.a"]},Ps={source:"libavif","static-libs-unix":["libavif.a"],"static-libs-windows":["avif.lib"]},Is={source:"libcares","static-libs-unix":["libcares.a"],"headers-unix":["ares.h","ares_dns.h","ares_nameser.h"]},$s={source:"libde265","static-libs-unix":["libde265.a"],"cpp-library":!0},Us={source:"libevent","static-libs-unix":["libevent.a","libevent_core.a","libevent_extra.a","libevent_openssl.a"],"lib-depends":["openssl"]},Ls={source:"libffi","static-libs-unix":["libffi.a"],"static-libs-windows":["libffi.lib"],"headers-unix":["ffi.h","ffitarget.h"],"headers-windows":["ffi.h","fficonfig.h","ffitarget.h"]},Ns={source:"libheif","static-libs-unix":["libheif.a"],"lib-depends":["libde265","libwebp","libaom","zlib","brotli"]},Os={source:"libiconv","static-libs-unix":["libiconv.a","libcharset.a"],headers:["iconv.h","libcharset.h","localcharset.h"]},Vs={source:"libjpeg","static-libs-unix":["libjpeg.a","libturbojpeg.a"],"static-libs-windows":["libjpeg_a.lib"],"lib-suggests-windows":["zlib"]},As={source:"liblz4","static-libs-unix":["liblz4.a"]},Ts={source:"libmemcached","static-libs-unix":["libmemcached.a","libmemcachedprotocol.a","libmemcachedutil.a","libhashkit.a"]},js={source:"libpng","static-libs-unix":["libpng16.a"],"static-libs-windows":["libpng16_static.lib","libpng_a.lib"],"headers-unix":["png.h","pngconf.h","pnglibconf.h"],"headers-windows":["png.h","pngconf.h"],"lib-depends":["zlib"]},Gs={source:"librabbitmq","static-libs-unix":["librabbitmq.a"],"static-libs-windows":["rabbitmq.4.lib"],"lib-depends":["openssl"]},Xs={source:"librdkafka","static-libs-unix":["librdkafka.a","librdkafka++.a","librdkafka-static.a"],"cpp-library":!0,"lib-suggests":["zstd"]},Hs={source:"libsodium","static-libs-unix":["libsodium.a"],"static-libs-windows":["libsodium.lib"]},Ms={source:"libssh2","static-libs-unix":["libssh2.a"],"static-libs-windows":["libssh2.lib"],headers:["libssh2.h","libssh2_publickey.h","libssh2_sftp.h"],"lib-depends":["openssl"],"lib-suggests":["zlib"]},_s={source:"libtiff","static-libs-unix":["libtiff.a"],"lib-depends":["zlib","libjpeg"]},Rs={source:"libuuid","static-libs-unix":["libuuid.a"],headers:["uuid/uuid.h"]},Fs={source:"libuv","static-libs-unix":["libuv.a"]},Zs={source:"libwebp","static-libs-unix":["libwebp.a","libwebpdecoder.a","libwebpdemux.a","libwebpmux.a","libsharpyuv.a"],"static-libs-windows":["libwebp.lib","libwebpdecoder.lib","libwebpdemux.lib","libsharpyuv.lib"]},Qs={source:"libxml2","static-libs-unix":["libxml2.a"],"static-libs-windows":["libxml2s.lib","libxml2_a.lib"],headers:["libxml2"],"lib-depends-unix":["libiconv"],"lib-suggests-unix":["xz","icu","zlib"],"lib-depends-windows":["libiconv-win"],"lib-suggests-windows":["zlib"]},Ks={source:"libxslt","static-libs-unix":["libxslt.a","libexslt.a"],"lib-depends":["libxml2"]},Ys={source:"libyaml","static-libs-unix":["libyaml.a"],"static-libs-windows":["yaml.lib"],headers:["yaml.h"]},Js={source:"libzip","static-libs-unix":["libzip.a"],"static-libs-windows":["zip.lib","libzip_a.lib"],headers:["zip.h","zipconf.h"],"lib-depends-unix":["zlib"],"lib-suggests-unix":["bzip2","xz","zstd","openssl"],"lib-depends-windows":["zlib","bzip2","xz"],"lib-suggests-windows":["zstd","openssl"]},et={source:"mimalloc","static-libs-unix":["mimalloc.o"]},it={source:"ncurses","static-libs-unix":["libncurses.a"]},st={source:"nghttp2","static-libs-unix":["libnghttp2.a"],"static-libs-windows":["nghttp2.lib"],headers:["nghttp2"],"lib-depends":["zlib","openssl"],"lib-suggests":["libxml2","nghttp3","ngtcp2"]},tt={source:"nghttp3","static-libs-unix":["libnghttp3.a"],"static-libs-windows":["nghttp3.lib"],headers:["nghttp3"],"lib-depends":["openssl"]},lt={source:"ngtcp2","static-libs-unix":["libngtcp2.a","libngtcp2_crypto_ossl.a"],"static-libs-windows":["ngtcp2.lib","ngtcp2_crypto_ossl.lib"],headers:["ngtcp2"],"lib-depends":["openssl"],"lib-suggests":["nghttp3","brotli"]},nt={source:"onig","static-libs-unix":["libonig.a"],"static-libs-windows":["onig.lib","onig_a.lib"],headers:["oniggnu.h","oniguruma.h"]},ot={source:"openssl","static-libs-unix":["libssl.a","libcrypto.a"],"static-libs-windows":["libssl.lib","libcrypto.lib"],headers:["openssl"],"lib-depends":["zlib"]},at={source:"postgresql","static-libs-unix":["libpq.a","libpgport.a","libpgcommon.a"],"lib-depends":["libiconv","libxml2","openssl","zlib","readline"],"lib-suggests":["icu","libxslt","ldap","zstd"]},dt={source:"pthreads4w","static-libs-windows":["libpthreadVC3.lib"]},ut={source:"qdbm","static-libs-unix":["libqdbm.a"],"static-libs-windows":["qdbm_a.lib"],"headers-windows":["depot.h"]},pt={source:"readline","static-libs-unix":["libreadline.a"],"lib-depends":["ncurses"]},rt={source:"snappy","static-libs-unix":["libsnappy.a"],"headers-unix":["snappy.h","snappy-c.h","snappy-sinksource.h","snappy-stubs-public.h"],"lib-depends":["zlib"]},ct={source:"sqlite","static-libs-unix":["libsqlite3.a"],"static-libs-windows":["libsqlite3_a.lib"],headers:["sqlite3.h","sqlite3ext.h"]},bt={source:"tidy","static-libs-unix":["libtidy.a"]},wt={source:"unixodbc","static-libs-unix":["libodbc.a","libodbccr.a","libodbcinst.a"],"lib-depends":["libiconv"]},gt={source:"xz","static-libs-unix":["liblzma.a"],"static-libs-windows":["lzma.lib","liblzma_a.lib"],"headers-unix":["lzma"],"headers-windows":["lzma","lzma.h"],"lib-depends-unix":["libiconv"]},xt={source:"zlib","static-libs-unix":["libz.a"],"static-libs-windows":["zlib_a.lib"],headers:["zlib.h","zconf.h"]},mt={source:"zstd","static-libs-unix":["libzstd.a"],"static-libs-windows":[["zstd.lib","zstd_static.lib"]],"headers-unix":["zdict.h","zstd.h","zstd_errors.h"],"headers-windows":["zstd.h","zstd_errors.h"]},ht={"lib-base":{type:"root","lib-depends-unix":["pkg-config"]},php:rs,micro:cs,"pkg-config":{type:"package",source:"pkg-config","bin-unix":["pkg-config"]},attr:bs,brotli:ws,bzip2:gs,curl:xs,fastlz:ms,freetype:hs,gettext:ys,glfw:vs,gmp:fs,gmssl:zs,grpc:Ss,icu:Ds,imagemagick:ks,imap:Bs,ldap:qs,libacl:Es,libaom:Cs,libargon2:Ws,libavif:Ps,libcares:Is,libde265:$s,libevent:Us,libffi:Ls,"libffi-win":{source:"libffi-win","static-libs-windows":["libffi.lib"],"headers-windows":["ffi.h","ffitarget.h","fficonfig.h"]},libheif:Ns,libiconv:Os,"libiconv-win":{source:"libiconv-win","static-libs-windows":["libiconv.lib","libiconv_a.lib"]},libjpeg:Vs,liblz4:As,libmemcached:Ts,libpng:js,librabbitmq:Gs,librdkafka:Xs,libsodium:Hs,libssh2:Ms,libtiff:_s,libuuid:Rs,libuv:Fs,libwebp:Zs,libxml2:Qs,libxslt:Ks,libyaml:Ys,libzip:Js,mimalloc:et,ncurses:it,nghttp2:st,nghttp3:tt,ngtcp2:lt,onig:nt,openssl:ot,postgresql:at,"postgresql-win":{source:"postgresql-win","static-libs":["libpq.lib","libpgport.lib","libpgcommon.lib"]},pthreads4w:dt,qdbm:ut,readline:pt,snappy:rt,sqlite:ct,tidy:bt,unixodbc:wt,xz:gt,zlib:xt,zstd:mt};function U(i,l,u,d){return i.os==="linux"?i[l][u][d+"-linux"]??i[l][u][d+"-unix"]??i[l][u][d]??[]:i.os==="macos"?i[l][u][d+"-macos"]??i[l][u][d+"-unix"]??i[l][u][d]??[]:i.os==="windows"?i[l][u][d+"-windows"]??i[l][u][d]??[]:[]}function J(i,l){return U(i,"ext",l,"ext-depends")}function yt(i,l){return U(i,"ext",l,"ext-suggests")}function vt(i,l){return U(i,"ext",l,"lib-depends")}function ft(i,l){return U(i,"ext",l,"lib-suggests")}function ee(i,l){return U(i,"lib",l,"lib-depends")}function zt(i,l){return U(i,"lib",l,"lib-suggests")}function St(i,l){const u=[],d=new Set,h=[];l.forEach(D=>{d.has(D)||Bt(i,D,d,u)});const S=[];return u.forEach(D=>{l.indexOf(D)===-1&&h.push(D),[...vt(i,D),...ft(i,D)].forEach(o=>{S.indexOf(o)===-1&&S.push(o)})}),{exts:u,libs:Dt(i,S),notIncludedExts:h}}function Dt(i,l){const u=[],d=new Set;return l.forEach(h=>{d.has(h)||(console.log("before visited"),console.log(d),kt(i,h,d,u),console.log("after visited"),console.log(d))}),u}function kt(i,l,u,d){if(u.has(l))return;u.add(l),[...ee(i,l),...zt(i,l)].forEach(S=>{ie(i,S,u,d)}),d.push(l)}function ie(i,l,u,d){u.has(l)||(u.add(l),ee(i,l).forEach(h=>{ie(i,h,u,d)}),d.push(l))}function se(i,l,u,d){u.has(u)||(u.add(l),J(i,l).forEach(h=>{se(i,h,u,d)}),d.push(l))}function Bt(i,l,u,d){if(u.has(l))return;u.add(l),[...J(i,l),...yt(i,l)].forEach(S=>{se(i,S,u,d)}),d.push(l)}const qt={class:"option-line"},Et=["id","value","disabled"],Ct=["for"],Wt={class:"option-line"},Pt=["disabled"],It={class:"box"},$t={class:"ext-item"},Ut=["id","value","disabled"],Lt=["for"],Nt={style:{color:"orangered","font-weight":"bolder"}},Ot={class:"details custom-block",open:""},Vt={class:"box"},At={class:"ext-item"},Tt=["id","value","disabled"],jt=["for"],Gt={class:"tip custom-block"},Xt={class:"box"},Ht={class:"ext-item"},Mt=["id","value"],_t=["for"],Rt={key:2,class:"warning custom-block"},Ft={key:3,class:"warning custom-block"},Zt={value:"native"},Qt={value:"spc"},Kt={key:0,value:"docker"},Yt=["value"],Jt={for:"debug-yes"},el={for:"debug-no"},il={for:"zts-yes"},sl={for:"zts-no"},tl={for:"show-download-yes"},ll={for:"show-download-no"},nl={for:"pre-built-yes"},ol={for:"pre-built-no"},al={key:0},dl={for:"upx-yes"},ul={for:"upx-no"},pl=["placeholder"],rl={key:4,class:"command-container"},cl={key:0,class:"command-preview"},bl={key:1},wl={class:"warning custom-block"},gl={key:5,class:"command-container"},xl={id:"download-ext-cmd",class:"command-preview"},ml={key:6,class:"command-container"},hl={id:"download-all-cmd",class:"command-preview"},yl={key:7,class:"command-container"},vl={id:"download-pkg-cmd",class:"command-preview"},fl={class:"command-container"},zl={id:"build-cmd",class:"command-preview"},Sl={class:"command-container"},Dl={id:"craft-cmd",class:"command-preview pre"},kl={name:"CliGenerator"},Bl=ge({...kl,props:{lang:{type:String,default:"zh"}},setup(i){const l=w(ps),u=z(()=>{const a=[];for(const[s,t]of Object.entries(l.value))D(s,r.value)&&a.push(s);return a}),d=w(ht),h=w([]),S=[{os:"linux",label:"Linux",disabled:!1},{os:"macos",label:"macOS",disabled:!1},{os:"windows",label:"Windows",disabled:!1}],D=(a,s)=>{var b,E;const c=new Map([["linux","Linux"],["macos","Darwin"],["windows","Windows"]]).get(s),p=((E=(b=l.value[a])==null?void 0:b.support)==null?void 0:E[c])??"yes";return p==="yes"||p==="partial"},Q=["8.0","8.1","8.2","8.3","8.4"],o={zh:{selectExt:"选择扩展",buildTarget:"选择编译目标",buildOptions:"编译选项",buildEnvironment:"编译环境",buildEnvNative:"本地构建(Git 源码)",buildEnvSpc:"本地构建(独立 spc 二进制)",buildEnvDocker:"Alpine Docker 构建",useDebug:"是否开启调试输出",yes:"是",no:"否",resultShow:"结果展示",selectCommon:"选择常用扩展",selectAll:"选择全部",selectNone:"全部取消选择",useZTS:"是否编译线程安全版",hardcodedINI:"硬编码 INI 选项",hardcodedINIPlacehoder:"如需要硬编码 ini,每行写一个,例如:memory_limit=2G",resultShowDownload:"是否展示仅下载对应扩展依赖的命令",downloadExtOnlyCommand:"只下载对应扩展的依赖包命令",downloadAllCommand:"下载所有依赖包命令",downloadUPXCommand:"下载 UPX 命令",compileCommand:"编译命令",downloadPhpVersion:"下载 PHP 版本",downloadSPCBinaryCommand:"下载 spc 二进制命令",selectedArch:"选择系统架构",selectedSystem:"选择操作系统",buildLibs:"要构建的库",depTips:"选择扩展后,不可选中的项目为必需的依赖,编译的依赖库列表中可选的为现有扩展和依赖库的可选依赖。选择可选依赖后,将生成 --with-libs 参数。",depTips2:"无法同时构建所有扩展,因为有些扩展之间相互冲突。请根据需要选择扩展。",microUnavailable:"micro 不支持 PHP 7.4 及更早版本!",windowsSAPIUnavailable:"Windows 目前不支持 fpm、embed 构建!",useUPX:"是否开启 UPX 压缩(减小二进制体积)",windowsDownSPCWarning:"Windows 下请手动下载 spc.exe 二进制文件,解压到当前目录并重命名为 spc.exe!",usePreBuilt:"如果可能,下载预编译的依赖库(减少编译时间)"},en:{selectExt:"Select Extensions",buildTarget:"Build Target",buildOptions:"Build Options",buildEnvironment:"Build Environment",buildEnvNative:"Native build (Git source code)",buildEnvSpc:"Native build (standalone spc binary)",buildEnvDocker:"Alpine docker build",useDebug:"Enable debug message",yes:"Yes",no:"No",resultShow:"Result",selectCommon:"Select common extensions",selectAll:"Select all",selectNone:"Unselect all",useZTS:"Enable ZTS",hardcodedINI:"Hardcoded INI options",hardcodedINIPlacehoder:"If you need to hardcode ini, write one per line, for example: memory_limit=2G",resultShowDownload:"Download with corresponding extension dependencies",downloadExtOnlyCommand:"Download sources by extensions command",downloadAllCommand:"Download all sources command",downloadUPXCommand:"Download UPX command",compileCommand:"Compile command",downloadPhpVersion:"Download PHP version",downloadSPCBinaryCommand:"Download spc binary command",selectedArch:"Select build architecture",selectedSystem:"Select Build OS",buildLibs:"Select Dependencies",depTips:"After selecting the extensions, the unselectable items are essential dependencies. In the compiled dependencies list, optional dependencies consist of existing extensions and optional dependencies of libraries. Optional dependencies will be added in --with-libs parameter.",depTips2:"It is not possible to build all extensions at the same time, as some extensions conflict with each other. Please select the extensions you need.",microUnavailable:"Micro does not support PHP 7.4 and earlier versions!",windowsSAPIUnavailable:"Windows does not support fpm and embed build!",useUPX:"Enable UPX compression (reduce binary size)",windowsDownSPCWarning:"Please download the binary file manually, extract it to the current directory and rename to spc.exe on Windows!",usePreBuilt:"Download pre-built dependencies if possible (reduce compile time)"}},te=["cli","fpm","micro","embed","all"],le=()=>{y.value=["apcu","bcmath","calendar","ctype","curl","dba","dom","exif","filter","fileinfo","gd","iconv","intl","mbstring","mbregex","mysqli","mysqlnd","openssl","opcache","pcntl","pdo","pdo_mysql","pdo_sqlite","pdo_pgsql","pgsql","phar","posix","readline","redis","session","simplexml","sockets","sodium","sqlite3","tokenizer","xml","xmlreader","xmlwriter","xsl","zip","zlib"]},ne=()=>{y.value=u.value},X=z(()=>y.value.join(",")),H=z(()=>{const a=B.value.filter(s=>V.value.indexOf(s)===-1);return a.length>0?' --with-libs="'+a.join(",")+'"':""}),y=w([]),B=w([]),M=w([]),V=w([]),v=w(["cli"]),A=w("spc"),I=w("8.4"),k=w(0),$=w(0),L=w(1),W=w(1),q=w(0),_=w(""),r=w("linux");G(r,()=>{r.value==="windows"&&(T.value="x86_64")});const T=w("x86_64"),j=z(()=>{switch(A.value){case"native":return"bin/spc";case"spc":return r.value==="windows"?".\\spc.exe":"./spc";case"docker":return"bin/spc-alpine-docker";default:return""}}),K=w("--build-cli"),oe=z(()=>{const a=_.value.split(` +`);let s=[];return a.forEach(t=>{t.indexOf("=")>=1&&s.push(t)})," "+s.map(t=>'-I "'+t+'"').join(" ")}),P=w(""),R=(a,s)=>a.includes(P.value)?s===0?a.substring(0,a.indexOf(P.value)):s===1?P.value:a.substring(a.indexOf(P.value)+P.value.length):s===0?a:"",ae=a=>{let s;v.value.indexOf("all")!==-1&&a.target.value==="all"?v.value=["all"]:(s=v.value.indexOf("all"))!==-1&&a.target.value!=="all"&&v.value.splice(s,1),K.value=v.value.map(t=>"--build-"+t).join(" ")},de=a=>{const s=new Set,t=c=>{let p=[];if(r.value==="linux"){if(p=l.value[c]["ext-depends-linux"]??l.value[c]["ext-depends-unix"]??l.value[c]["ext-depends"]??[],p.length===0)return}else if(r.value==="macos"){if(p=l.value[c]["ext-depends-macos"]??l.value[c]["ext-depends-unix"]??l.value[c]["ext-depends"]??[],p.length===0)return}else if(r.value==="windows"&&(p=l.value[c]["ext-depends-windows"]??l.value[c]["ext-depends"]??[],p.length===0))return;p.forEach(b=>{s.add(b),t(b)})};return a.forEach(c=>{t(c)}),Array.from(s)},ue=z(()=>`${j.value} download --all --with-php=${I.value}${W.value?" --prefer-pre-built":""}${k.value?" --debug":""}`),pe=z(()=>`${j.value} download --with-php=${I.value} --for-extensions "${X.value}"${W.value?" --prefer-pre-built":""}${k.value?" --debug":""}`),re=z(()=>`${j.value} install-pkg upx${k.value?" --debug":""}`),ce=z(()=>`${j.value} build ${K.value} "${X.value}"${H.value}${k.value?" --debug":""}${$.value?" --enable-zts":""}${q.value?" --with-upx-pack":""}${oe.value}`),be=z(()=>{let a=`php-version: ${I.value} +`;return a+=`extensions: "${X.value}" +`,v.value.join(",")==="all"?a+="sapi: "+["cli","fpm","micro","embed"].join(",")+` +`:a+=`sapi: ${v.value.join(",")} +`,H.value&&(a+=`libs: ${H.value.replace('--with-libs="',"").replace('"',"").trim()} +`),k.value&&(a+=`debug: true +`),a+="{{position_hold}}",q.value&&(a+=` with-upx-pack: true +`),$.value&&(a+=` enable-zts: true +`),W.value&&(a+=` prefer-pre-built: true +`),a.endsWith("{{position_hold}}")?a=a.replace("{{position_hold}}",""):a=a.replace("{{position_hold}}",`build-options: +`),a}),we=a=>{const s=new Set,t=p=>{let b=[];if(r.value==="linux"){if(b=d.value[p]["lib-depends-linux"]??d.value[p]["lib-depends-unix"]??d.value[p]["lib-depends"]??[],b.length===0)return}else if(r.value==="macos"){if(b=d.value[p]["lib-depends-macos"]??d.value[p]["lib-depends-unix"]??d.value[p]["lib-depends"]??[],b.length===0)return}else if(r.value==="windows"&&(b=d.value[p]["lib-depends-windows"]??d.value[p]["lib-depends"]??[],b.length===0))return;b.forEach(E=>{s.add(E),t(E)})},c=p=>{let b=[];if(r.value==="linux"){if(b=l.value[p]["lib-depends-linux"]??l.value[p]["lib-depends-unix"]??l.value[p]["lib-depends"]??[],b.length===0)return}else if(r.value==="macos"){if(b=l.value[p]["lib-depends-macos"]??l.value[p]["lib-depends-unix"]??l.value[p]["lib-depends"]??[],b.length===0)return}else if(r.value==="windows"&&(b=l.value[p]["lib-depends-windows"]??l.value[p]["lib-depends"]??[],b.length===0))return;b.forEach(E=>{s.add(E),t(E)})};return a.forEach(p=>{c(p)}),Array.from(s)};return G(r,()=>y.value=[]),G(r,()=>q.value=0),G(y,a=>{M.value=de(a),M.value.forEach(t=>{y.value.indexOf(t)===-1&&y.value.push(t)}),y.value.sort(),console.log("检测到变化!"),console.log(a);const s=St({ext:l.value,lib:d.value,os:r.value},y.value);h.value=s.libs.sort(),B.value=[],V.value=we(s.exts),V.value.forEach(t=>{B.value.indexOf(t)===-1&&B.value.push(t)})}),(a,s)=>(x(),g("div",null,[e("h2",null,n(o[i.lang].selectedSystem),1),e("div",qt,[(x(),g(N,null,O(S,(t,c)=>e("span",{key:c,style:{"margin-right":"8px"}},[m(e("input",{type:"radio",id:"os-"+t.os,value:t.os,disabled:t.disabled===!0,"onUpdate:modelValue":s[0]||(s[0]=p=>r.value=p)},null,8,Et),[[f,r.value]]),e("label",{for:"os-"+t.os},n(t.label),9,Ct)])),64))]),e("div",Wt,[m(e("select",{"onUpdate:modelValue":s[1]||(s[1]=t=>T.value=t)},[s[20]||(s[20]=e("option",{value:"x86_64"},"x86_64",-1)),e("option",{value:"aarch64",disabled:r.value==="windows"},"aarch64",8,Pt)],512),[[F,T.value]])]),e("h2",null,n(o[i.lang].selectExt)+n(y.value.length>0?" ("+y.value.length+")":""),1),e("div",It,[m(e("input",{class:"input","onUpdate:modelValue":s[2]||(s[2]=t=>P.value=t),placeholder:"Highlight search..."},null,512),[[Y,P.value]]),s[21]||(s[21]=e("br",null,null,-1)),(x(!0),g(N,null,O(u.value,t=>(x(),g("div",$t,[e("span",null,[m(e("input",{type:"checkbox",id:t,value:t,"onUpdate:modelValue":s[3]||(s[3]=c=>y.value=c),disabled:M.value.indexOf(t)!==-1},null,8,Ut),[[Z,y.value]]),e("label",{for:t},[e("span",null,n(R(t,0)),1),e("span",Nt,n(R(t,1)),1),e("span",null,n(R(t,2)),1)],8,Lt)])]))),256))]),r.value!=="windows"?(x(),g("div",{key:0,class:"my-btn",onClick:le},n(o[i.lang].selectCommon),1)):C("",!0),r.value!=="windows"?(x(),g("div",{key:1,class:"my-btn",onClick:ne},n(o[i.lang].selectAll),1)):C("",!0),e("div",{class:"my-btn",onClick:s[4]||(s[4]=t=>y.value=[])},n(o[i.lang].selectNone),1),e("details",Ot,[e("summary",null,n(o[i.lang].buildLibs)+n(B.value.length>0?" ("+B.value.length+")":""),1),e("div",Vt,[(x(!0),g(N,null,O(h.value,(t,c)=>(x(),g("div",At,[m(e("input",{type:"checkbox",id:c,value:t,"onUpdate:modelValue":s[5]||(s[5]=p=>B.value=p),disabled:V.value.indexOf(t)!==-1},null,8,Tt),[[Z,B.value]]),e("label",{for:c},n(t),9,jt)]))),256))])]),e("div",Gt,[s[22]||(s[22]=e("p",{class:"custom-block-title"},"TIP",-1)),e("p",null,n(o[i.lang].depTips),1),e("p",null,n(o[i.lang].depTips2),1)]),e("h2",null,n(o[i.lang].buildTarget),1),e("div",Xt,[(x(),g(N,null,O(te,t=>e("div",Ht,[m(e("input",{type:"checkbox",id:"build_"+t,value:t,"onUpdate:modelValue":s[6]||(s[6]=c=>v.value=c),onChange:ae},null,40,Mt),[[Z,v.value]]),e("label",{for:"build_"+t},n(t),9,_t)])),64))]),I.value==="7.4"&&(v.value.indexOf("micro")!==-1||v.value.indexOf("all")!==-1)?(x(),g("div",Rt,[s[23]||(s[23]=e("p",{class:"custom-block-title"},"WARNING",-1)),e("p",null,n(o[i.lang].microUnavailable),1)])):C("",!0),r.value==="windows"&&(v.value.indexOf("fpm")!==-1||v.value.indexOf("embed")!==-1)?(x(),g("div",Ft,[s[24]||(s[24]=e("p",{class:"custom-block-title"},"WARNING",-1)),e("p",null,n(o[i.lang].windowsSAPIUnavailable),1)])):C("",!0),e("h2",null,n(o[i.lang].buildOptions),1),e("table",null,[e("tr",null,[e("td",null,n(o[i.lang].buildEnvironment),1),e("td",null,[m(e("select",{"onUpdate:modelValue":s[7]||(s[7]=t=>A.value=t)},[e("option",Zt,n(o[i.lang].buildEnvNative),1),e("option",Qt,n(o[i.lang].buildEnvSpc),1),r.value!=="windows"?(x(),g("option",Kt,n(o[i.lang].buildEnvDocker),1)):C("",!0)],512),[[F,A.value]])])]),e("tr",null,[e("td",null,n(o[i.lang].downloadPhpVersion),1),e("td",null,[m(e("select",{"onUpdate:modelValue":s[8]||(s[8]=t=>I.value=t)},[(x(),g(N,null,O(Q,t=>e("option",{value:t},n(t),9,Yt)),64))],512),[[F,I.value]])])]),e("tr",null,[e("td",null,n(o[i.lang].useDebug),1),e("td",null,[m(e("input",{type:"radio",id:"debug-yes",value:1,"onUpdate:modelValue":s[9]||(s[9]=t=>k.value=t)},null,512),[[f,k.value]]),e("label",Jt,n(o[i.lang].yes),1),m(e("input",{type:"radio",id:"debug-no",value:0,"onUpdate:modelValue":s[10]||(s[10]=t=>k.value=t)},null,512),[[f,k.value]]),e("label",el,n(o[i.lang].no),1)])]),e("tr",null,[e("td",null,n(o[i.lang].useZTS),1),e("td",null,[m(e("input",{type:"radio",id:"zts-yes",value:1,"onUpdate:modelValue":s[11]||(s[11]=t=>$.value=t)},null,512),[[f,$.value]]),e("label",il,n(o[i.lang].yes),1),m(e("input",{type:"radio",id:"zts-no",value:0,"onUpdate:modelValue":s[12]||(s[12]=t=>$.value=t)},null,512),[[f,$.value]]),e("label",sl,n(o[i.lang].no),1)])]),e("tr",null,[e("td",null,n(o[i.lang].resultShowDownload),1),e("td",null,[m(e("input",{type:"radio",id:"show-download-yes",value:1,"onUpdate:modelValue":s[13]||(s[13]=t=>L.value=t)},null,512),[[f,L.value]]),e("label",tl,n(o[i.lang].yes),1),m(e("input",{type:"radio",id:"show-download-no",value:0,"onUpdate:modelValue":s[14]||(s[14]=t=>L.value=t)},null,512),[[f,L.value]]),e("label",ll,n(o[i.lang].no),1)])]),e("tr",null,[e("td",null,n(o[i.lang].usePreBuilt),1),e("td",null,[m(e("input",{type:"radio",id:"pre-built-yes",value:1,"onUpdate:modelValue":s[15]||(s[15]=t=>W.value=t)},null,512),[[f,W.value]]),e("label",nl,n(o[i.lang].yes),1),m(e("input",{type:"radio",id:"pre-built-no",value:0,"onUpdate:modelValue":s[16]||(s[16]=t=>W.value=t)},null,512),[[f,W.value]]),e("label",ol,n(o[i.lang].no),1)])]),r.value!=="macos"?(x(),g("tr",al,[e("td",null,n(o[i.lang].useUPX),1),e("td",null,[m(e("input",{type:"radio",id:"upx-yes",value:1,"onUpdate:modelValue":s[17]||(s[17]=t=>q.value=t)},null,512),[[f,q.value]]),e("label",dl,n(o[i.lang].yes),1),m(e("input",{type:"radio",id:"upx-no",value:0,"onUpdate:modelValue":s[18]||(s[18]=t=>q.value=t)},null,512),[[f,q.value]]),e("label",ul,n(o[i.lang].no),1)])])):C("",!0)]),e("h2",null,n(o[i.lang].hardcodedINI),1),m(e("textarea",{class:"textarea",placeholder:o[i.lang].hardcodedINIPlacehoder,"onUpdate:modelValue":s[19]||(s[19]=t=>_.value=t),rows:"5"},null,8,pl),[[Y,_.value]]),e("h2",null,n(o[i.lang].resultShow),1),A.value==="spc"?(x(),g("div",rl,[e("b",null,n(o[i.lang].downloadSPCBinaryCommand),1),r.value!=="windows"?(x(),g("div",cl,[xe(" curl -fsSL -o spc.tgz https://dl.static-php.dev/static-php-cli/spc-bin/nightly/spc-"+n(r.value)+"-"+n(T.value)+".tar.gz && tar -zxvf spc.tgz && rm spc.tgz",1),s[25]||(s[25]=e("br",null,null,-1))])):(x(),g("div",bl,[e("div",wl,[s[26]||(s[26]=e("p",{class:"custom-block-title"},"WARNING",-1)),e("p",null,n(o[i.lang].windowsDownSPCWarning),1),s[27]||(s[27]=e("a",{href:"https://dl.static-php.dev/static-php-cli/spc-bin/nightly/spc-windows-x64.exe",target:"_blank"},"https://dl.static-php.dev/static-php-cli/spc-bin/nightly/spc-windows-x64.exe",-1))])]))])):C("",!0),L.value?(x(),g("div",gl,[e("b",null,n(o[i.lang].downloadExtOnlyCommand),1),e("div",xl,n(pe.value),1)])):(x(),g("div",ml,[e("b",null,n(o[i.lang].downloadAllCommand),1),e("div",hl,n(ue.value),1)])),q.value?(x(),g("div",yl,[e("b",null,n(o[i.lang].downloadUPXCommand),1),e("div",vl,n(re.value),1)])):C("",!0),e("div",fl,[e("b",null,n(o[i.lang].compileCommand),1),e("div",zl,n(ce.value),1)]),e("div",Sl,[s[28]||(s[28]=e("b",null,"craft.yml",-1)),e("div",Dl,n(be.value),1)])]))}}),El=me(Bl,[["__scopeId","data-v-520722c6"]]);export{El as C}; diff --git a/assets/chunks/SearchTable.B9T2e1C1.js b/assets/chunks/SearchTable.B9T2e1C1.js new file mode 100644 index 00000000..9337d699 --- /dev/null +++ b/assets/chunks/SearchTable.B9T2e1C1.js @@ -0,0 +1 @@ +import{x as d,c as p,o as i,j as t,e as z,ag as W,aj as v,G as q,H as k,t as n}from"./framework.PeLcR_tw.js";const _={support:{BSD:"wip"},type:"external","arg-type":"custom",source:"amqp","lib-depends":["librabbitmq"],"ext-depends-windows":["openssl"]},L={type:"external",source:"apcu"},j={type:"external",source:"ast"},F={type:"builtin"},C={type:"external",source:"ext-brotli","arg-type":"enable","lib-depends":["brotli"]},N={type:"builtin","arg-type-unix":"with-prefix","arg-type-windows":"with","lib-depends":["bzip2"]},O={type:"builtin"},T={type:"builtin"},V={notes:!0,type:"builtin","arg-type":"with","lib-depends":["curl"],"ext-depends-windows":["zlib","openssl"]},E={type:"builtin","arg-type":"custom","lib-suggests":["qdbm"]},I={support:{BSD:"wip"},type:"external",source:"dio"},G={support:{BSD:"wip"},type:"builtin","arg-type":"custom","arg-type-windows":"with","lib-depends":["libxml2","zlib"],"ext-depends-windows":["xml"]},H={type:"external",source:"ext-ds"},M={support:{Windows:"wip",BSD:"wip",Darwin:"wip",Linux:"wip"},type:"wip"},U={type:"external",source:"ev","arg-type-windows":"with","ext-depends":["sockets"]},A={support:{Windows:"wip",BSD:"wip"},notes:!0,type:"external",source:"ext-event","arg-type":"custom","lib-depends":["libevent"],"ext-depends":["openssl"],"ext-suggests":["sockets"]},J={type:"builtin"},K={support:{Linux:"partial",BSD:"wip"},notes:!0,"arg-type":"custom",type:"builtin","lib-depends-unix":["libffi"],"lib-depends-windows":["libffi-win"]},P={type:"builtin"},Q={type:"builtin"},R={type:"builtin","lib-suggests":["openssl"]},X={support:{BSD:"wip"},notes:!0,type:"builtin","arg-type":"custom","arg-type-windows":"with","lib-depends":["zlib","libpng"],"ext-depends":["zlib"],"lib-suggests":["libavif","libwebp","libjpeg","freetype"]},Y={support:{Windows:"wip",BSD:"wip"},type:"builtin","arg-type":"with-prefix","lib-depends":["gettext"]},Z={support:{Windows:"wip",BSD:"no",Linux:"no"},notes:!0,type:"external","arg-type":"custom",source:"ext-glfw","lib-depends":["glfw"],"lib-depends-windows":[]},$={support:{Windows:"wip",BSD:"wip"},type:"builtin","arg-type":"with-prefix","lib-depends":["gmp"]},ee={support:{BSD:"wip"},type:"external",source:"ext-gmssl","lib-depends":["gmssl"]},te={support:{Windows:"wip",BSD:"wip"},type:"external",source:"grpc","arg-type-unix":"custom","cpp-extension":!0,"lib-depends":["grpc"]},se={support:{BSD:"wip"},type:"builtin","arg-type":"with-prefix","arg-type-windows":"with","lib-depends-unix":["libiconv"],"lib-depends-windows":["libiconv-win"]},pe={support:{BSD:"wip"},type:"external",source:"igbinary","ext-suggests":["session","apcu"]},ie={support:{Windows:"wip",BSD:"wip"},notes:!0,type:"external",source:"ext-imagick","arg-type":"custom","lib-depends":["imagemagick"]},ne={support:{Windows:"wip",BSD:"wip"},notes:!0,type:"external",source:"ext-imap","arg-type":"custom","lib-depends":["imap"],"ext-suggests":["openssl"]},oe={support:{Windows:"no",BSD:"wip",Darwin:"no"},type:"external",source:"inotify"},re={support:{Windows:"no",BSD:"wip"},type:"builtin","lib-depends":["icu"]},le={support:{Windows:"wip",BSD:"wip"},type:"builtin","arg-type":"with-prefix","lib-depends":["ldap"],"lib-suggests":["gmp","libsodium"],"ext-suggests":["openssl"]},ue={support:{BSD:"wip"},type:"builtin","arg-type":"none",target:["static"]},de={support:{Windows:"wip",BSD:"wip"},type:"external",source:"ext-lz4","arg-type":"custom","lib-depends":["liblz4"]},ae={type:"builtin","arg-type":"custom",target:["static"],"ext-depends":["mbstring"],"lib-depends":["onig"]},we={type:"builtin","arg-type":"custom"},ce={type:"wip",support:{Windows:"no",BSD:"no",Darwin:"no",Linux:"no"},notes:!0},ye={support:{Windows:"wip",BSD:"wip"},type:"external",source:"ext-memcache","arg-type":"custom","ext-depends":["zlib","session"],"build-with-php":!0},be={support:{Windows:"wip",BSD:"wip"},type:"external",source:"memcached","arg-type":"custom","cpp-extension":!0,"lib-depends":["libmemcached"],"lib-depends-unix":["libmemcached","fastlz"],"ext-depends":["session","zlib"]},xe={support:{BSD:"wip",Windows:"wip"},type:"external",source:"mongodb","arg-type":"custom","lib-suggests":["icu","openssl","zstd","zlib"],frameworks:["CoreFoundation","Security"]},ge={support:{BSD:"wip"},type:"external",source:"msgpack","arg-type-unix":"with","arg-type-win":"enable","ext-depends":["session"]},me={type:"builtin","arg-type":"with","ext-depends":["mysqlnd"]},he={type:"builtin","arg-type-windows":"with","lib-depends":["zlib"]},De={type:"wip",support:{Windows:"wip",BSD:"no",Darwin:"no",Linux:"no"},notes:!0},Se={support:{BSD:"wip",Windows:"wip"},type:"builtin","arg-type-unix":"custom","lib-depends-unix":["unixodbc"]},Be={type:"builtin","arg-type-unix":"custom","zend-extension":!0},fe={notes:!0,type:"builtin","arg-type":"custom","arg-type-windows":"with","lib-depends":["openssl","zlib"],"ext-depends":["zlib"]},ze={support:{BSD:"wip"},type:"external",source:"opentelemetry"},We={support:{BSD:"wip"},notes:!0,type:"external",source:"parallel","arg-type-windows":"with","lib-depends-windows":["pthreads4w"]},ve={support:{Windows:"no"},type:"builtin","unix-only":!0},qe={type:"builtin"},ke={type:"builtin","arg-type":"with","ext-depends":["pdo","mysqlnd"]},_e={support:{BSD:"wip"},type:"builtin","arg-type":"custom","lib-depends-unix":["unixodbc"],"ext-depends":["pdo","odbc"]},Le={support:{BSD:"wip"},type:"builtin","arg-type":"with-prefix","arg-type-windows":"custom","ext-depends":["pdo","pgsql"],"lib-depends-unix":["postgresql"],"lib-depends-windows":["postgresql-win"]},je={support:{BSD:"wip"},type:"builtin","arg-type":"with","ext-depends":["pdo","sqlite3"],"lib-depends":["sqlite"]},Fe={support:{BSD:"wip"},type:"external",source:"pdo_sqlsrv","arg-type":"with","ext-depends":["pdo","sqlsrv"]},Ce={support:{BSD:"wip"},notes:!0,type:"builtin","arg-type":"custom","lib-depends-unix":["postgresql"],"lib-depends-windows":["postgresql-win"]},Ne={type:"builtin","ext-depends":["zlib"]},Oe={support:{Windows:"no"},type:"builtin","unix-only":!0},Te={support:{Windows:"wip",BSD:"wip"},type:"external",source:"protobuf"},Ve={support:{BSD:"wip",Darwin:"partial"},notes:!0,type:"external",source:"rar","cpp-extension":!0},Ee={support:{BSD:"wip",Windows:"wip"},type:"external",source:"ext-rdkafka","arg-type":"custom","cpp-extension":!0,"lib-depends":["librdkafka"]},Ie={support:{Windows:"wip",BSD:"wip"},type:"builtin","arg-type":"with-prefix","lib-depends":["readline"],target:["static"]},Ge={support:{BSD:"wip"},type:"external",source:"redis","arg-type":"custom","ext-suggests":["session","igbinary"],"lib-suggests-unix":["zstd","liblz4"]},He={type:"builtin","build-with-php":!0},Me={type:"builtin","build-with-php":!0},Ue={type:"external",source:"ext-simdjson","cpp-extension":!0},Ae={support:{BSD:"wip"},type:"builtin","arg-type":"custom","lib-depends":["libxml2"],"ext-depends-windows":["xml"],"build-with-php":!0},Je={support:{Windows:"wip",BSD:"wip"},type:"external",source:"ext-snappy","cpp-extension":!0,"arg-type":"custom","lib-depends":["snappy"],"ext-suggests":["apcu"]},Ke={support:{BSD:"wip"},type:"builtin","arg-type":"custom","lib-depends":["libxml2"],"ext-depends-windows":["xml"]},Pe={type:"builtin"},Qe={support:{BSD:"wip"},type:"builtin","arg-type":"with","lib-depends":["libsodium"]},Re={support:{BSD:"wip",Windows:"no"},notes:!0,type:"external",source:"spx","arg-type":"custom","lib-depends":["zlib"]},Xe={support:{BSD:"wip"},type:"builtin","arg-type":"with-prefix","arg-type-windows":"with","lib-depends":["sqlite"]},Ye={support:{BSD:"wip"},type:"external",source:"sqlsrv","lib-depends-unix":["unixodbc"],"ext-depends-linux":["pcntl"],"cpp-extension":!0},Ze={support:{BSD:"wip"},type:"external",source:"ext-ssh2","arg-type":"with-prefix","arg-type-windows":"with","lib-depends":["libssh2"],"ext-depends":["openssl","zlib"]},$e={support:{Windows:"no",BSD:"wip"},notes:!0,type:"external",source:"swoole","arg-type":"custom","cpp-extension":!0,"unix-only":!0,"lib-depends":["libcares","brotli","nghttp2","zlib"],"ext-depends":["openssl","curl"],"ext-suggests":["swoole-hook-pgsql","swoole-hook-mysql","swoole-hook-sqlite"]},et={support:{BSD:"wip"},notes:!0,type:"external",source:"swow","arg-type":"custom","lib-suggests":["openssl","curl"],"ext-suggests":["openssl","curl"]},tt={support:{Windows:"no",BSD:"wip"},type:"builtin","unix-only":!0},st={support:{Windows:"no",BSD:"wip"},type:"builtin","unix-only":!0},pt={support:{BSD:"wip"},type:"builtin"},it={support:{Windows:"wip",BSD:"wip"},type:"builtin","arg-type":"with-prefix","lib-depends":["tidy"]},nt={type:"builtin","build-with-php":!0},ot={support:{Windows:"wip",BSD:"wip"},type:"external",source:"ext-uuid","arg-type":"with-prefix","lib-depends":["libuuid"]},rt={support:{Windows:"wip",BSD:"wip"},type:"external",source:"ext-uv","arg-type":"with-prefix","lib-depends":["libuv"],"ext-depends":["sockets"]},lt={type:"external",source:"xdebug",target:["shared"],support:{Windows:"wip",BSD:"no",Darwin:"partial",Linux:"partial"},notes:!0,"zend-extension":!0},ut={support:{Windows:"wip",BSD:"wip"},notes:!0,type:"external",source:"xhprof","ext-depends":["ctype"],"build-with-php":!0},dt={support:{BSD:"wip"},type:"external",source:"xlswriter","arg-type":"custom","ext-depends":["zlib","zip"],"lib-suggests":["openssl"]},at={support:{BSD:"wip"},notes:!0,type:"builtin","arg-type":"custom","arg-type-windows":"with","lib-depends":["libxml2"],"ext-depends-windows":["iconv"],"build-with-php":!0},wt={support:{BSD:"wip"},type:"builtin","arg-type":"custom","lib-depends":["libxml2"],"ext-depends-windows":["xml","dom"],"build-with-php":!0},ct={support:{BSD:"wip"},type:"builtin","arg-type":"custom","lib-depends":["libxml2"],"ext-depends-windows":["xml"],"build-with-php":!0},yt={support:{Windows:"wip",BSD:"wip"},type:"builtin","arg-type":"with-prefix","lib-depends":["libxslt"],"ext-depends":["xml","dom"]},bt={type:"external",source:"ext-xz","arg-type":"with","lib-depends":["xz"]},xt={support:{BSD:"wip"},type:"external",source:"yac","arg-type-unix":"custom","lib-depends-unix":["fastlz"],"ext-depends-unix":["igbinary"]},gt={support:{BSD:"wip"},type:"external",source:"yaml","arg-type-unix":"with-prefix","arg-type-windows":"with","lib-depends":["libyaml"]},mt={support:{BSD:"wip"},type:"builtin","arg-type":"with-prefix","arg-type-windows":"enable","lib-depends-unix":["libzip"],"ext-depends-windows":["zlib","bz2"],"lib-depends-windows":["libzip","zlib","bzip2","xz"]},ht={type:"builtin","arg-type":"custom","arg-type-windows":"enable","lib-depends":["zlib"],target:["static"]},Dt={support:{Windows:"wip",BSD:"wip"},type:"external",source:"ext-zstd","arg-type":"custom","lib-depends":["zstd"]},St={amqp:_,apcu:L,ast:j,bcmath:F,brotli:C,bz2:N,calendar:O,ctype:T,curl:V,dba:E,dio:I,dom:G,ds:H,enchant:M,ev:U,event:A,exif:J,ffi:K,fileinfo:P,filter:Q,ftp:R,gd:X,gettext:Y,glfw:Z,gmp:$,gmssl:ee,grpc:te,iconv:se,igbinary:pe,imagick:ie,imap:ne,inotify:oe,intl:re,ldap:le,libxml:ue,lz4:de,mbregex:ae,mbstring:we,mcrypt:ce,memcache:ye,memcached:be,mongodb:xe,msgpack:ge,mysqli:me,mysqlnd:he,oci8:De,odbc:Se,opcache:Be,openssl:fe,opentelemetry:ze,parallel:We,"password-argon2":{support:{Windows:"wip",BSD:"wip"},notes:!0,type:"builtin","arg-type":"with-prefix","lib-depends":["libargon2"]},pcntl:ve,pdo:qe,pdo_mysql:ke,pdo_odbc:_e,pdo_pgsql:Le,pdo_sqlite:je,pdo_sqlsrv:Fe,pgsql:Ce,phar:Ne,posix:Oe,protobuf:Te,rar:Ve,rdkafka:Ee,readline:Ie,redis:Ge,session:He,shmop:Me,simdjson:Ue,simplexml:Ae,snappy:Je,soap:Ke,sockets:Pe,sodium:Qe,spx:Re,sqlite3:Xe,sqlsrv:Ye,ssh2:Ze,swoole:$e,"swoole-hook-mysql":{support:{Windows:"no",BSD:"wip"},notes:!0,type:"addon","arg-type":"custom","ext-depends":["mysqlnd","pdo","pdo_mysql"],"ext-suggests":["mysqli"]},"swoole-hook-pgsql":{support:{Windows:"no",BSD:"wip",Darwin:"partial"},notes:!0,type:"addon","arg-type":"custom","ext-depends":["pgsql","pdo"]},"swoole-hook-sqlite":{support:{Windows:"no",BSD:"wip"},notes:!0,type:"addon","arg-type":"custom","ext-depends":["sqlite3","pdo"]},swow:et,sysvmsg:tt,sysvsem:st,sysvshm:pt,tidy:it,tokenizer:nt,uuid:ot,uv:rt,xdebug:lt,xhprof:ut,xlswriter:dt,xml:at,xmlreader:wt,xmlwriter:ct,xsl:yt,xz:bt,yac:xt,yaml:gt,zip:mt,zlib:ht,zstd:Dt},Bt={class:"DocSearch-SearchBar",style:{padding:"0"}},ft={class:"DocSearch-Form searchinput"},zt={key:0},Wt={key:1},vt=["href"],qt={key:0,style:{margin:"0 4px 20px 4px",color:"var(--vp-c-text-2)","font-size":"14px"}},kt={name:"SearchTable"},jt=Object.assign(kt,{setup(_t){var a,w,c,y,b,x,g,m,h,D,S,B;const o=d([]);for(const[u,e]of Object.entries(St))o.value.push({name:u,linux:((a=e.support)==null?void 0:a.Linux)===void 0?"yes":((w=e.support)==null?void 0:w.Linux)==="wip"?"":(c=e.support)==null?void 0:c.Linux,macos:((y=e.support)==null?void 0:y.Darwin)===void 0?"yes":((b=e.support)==null?void 0:b.Darwin)==="wip"?"":(x=e.support)==null?void 0:x.Darwin,freebsd:((g=e.support)==null?void 0:g.BSD)===void 0?"yes":((m=e.support)==null?void 0:m.BSD)==="wip"?"":(h=e.support)==null?void 0:h.BSD,windows:((D=e.support)==null?void 0:D.Windows)===void 0?"yes":((S=e.support)==null?void 0:S.Windows)==="wip"?"":(B=e.support)==null?void 0:B.Windows,notes:e.notes===!0});const r=d(o.value),l=d(""),f=()=>{if(l.value===""){r.value=o.value;return}r.value=o.value.filter(u=>u.name.toLowerCase().includes(l.value.toLowerCase()))};return(u,e)=>(i(),p("div",null,[t("header",Bt,[t("form",ft,[W(t("input",{class:"DocSearch-Input","onUpdate:modelValue":e[0]||(e[0]=s=>l.value=s),placeholder:"Filter name...",onInput:f},null,544),[[v,l.value]])])]),t("table",null,[e[1]||(e[1]=t("thead",null,[t("tr",null,[t("th",null,"Extension Name"),t("th",null,"Linux"),t("th",null,"macOS"),t("th",null,"FreeBSD"),t("th",null,"Windows")])],-1)),t("tbody",null,[(i(!0),p(q,null,k(r.value,s=>(i(),p("tr",null,[s.notes?(i(),p("td",Wt,[t("a",{href:"./extension-notes.html#"+s.name},n(s.name),9,vt)])):(i(),p("td",zt,n(s.name),1)),t("td",null,n(s.linux),1),t("td",null,n(s.macos),1),t("td",null,n(s.freebsd),1),t("td",null,n(s.windows),1)]))),256))])]),r.value.length===0?(i(),p("div",qt," No result, please try another keyword. ")):z("",!0)]))}});export{jt as _}; diff --git a/assets/chunks/SearchTable.CnJN64_Q.js b/assets/chunks/SearchTable.CnJN64_Q.js deleted file mode 100644 index a30536f7..00000000 --- a/assets/chunks/SearchTable.CnJN64_Q.js +++ /dev/null @@ -1 +0,0 @@ -import{s as u,o as p,c as i,j as e,a2 as v,a4 as q,F as z,E as W,t as n,e as _}from"./framework.gjrnbxUT.js";const k={support:{BSD:"wip"},type:"external","arg-type":"custom",source:"amqp","lib-depends":["librabbitmq"],"ext-depends-windows":["openssl"]},L={type:"external",source:"apcu"},j={type:"external",source:"ast"},F={type:"builtin"},N={type:"builtin","arg-type-unix":"with-prefix","arg-type-windows":"with","lib-depends":["bzip2"]},C={type:"builtin"},E={type:"builtin"},O={notes:!0,type:"builtin","arg-type":"with","lib-depends":["curl"],"ext-depends-windows":["zlib","openssl"]},T={type:"builtin","arg-type":"custom","lib-suggests":["qdbm"]},V={support:{BSD:"wip"},type:"external",source:"dio"},I={support:{BSD:"wip"},type:"builtin","arg-type":"custom","arg-type-windows":"with","lib-depends":["libxml2","zlib"],"ext-depends-windows":["xml"]},M={type:"external",source:"ext-ds"},U={support:{Windows:"wip",BSD:"wip",Darwin:"wip",Linux:"wip"},type:"wip"},A={type:"external",source:"ev","arg-type-windows":"with"},G={support:{Windows:"wip",BSD:"wip"},notes:!0,type:"external",source:"ext-event","arg-type":"custom","lib-depends":["libevent"],"ext-depends":["openssl"],"ext-suggests":["sockets"]},H={type:"builtin"},J={support:{Linux:"partial",BSD:"wip"},target:["static","shared"],notes:!0,"arg-type":"custom",type:"builtin","lib-depends-unix":["libffi"],"lib-depends-windows":["libffi-win"]},K={type:"builtin"},P={type:"builtin"},Q={type:"builtin","lib-suggests":["openssl"]},R={support:{BSD:"wip"},notes:!0,type:"builtin","arg-type":"custom","arg-type-windows":"with","lib-depends":["zlib","libpng"],"ext-depends":["zlib"],"lib-suggests":["libavif","libwebp","libjpeg","freetype"]},X={support:{Windows:"wip",BSD:"wip"},type:"builtin","arg-type":"with-prefix","lib-depends":["gettext"]},Y={support:{Windows:"wip",BSD:"no",Linux:"no"},notes:!0,type:"external","arg-type":"custom",source:"ext-glfw","lib-depends":["glfw"],"lib-depends-windows":[]},Z={support:{Windows:"wip",BSD:"wip"},type:"builtin","arg-type":"with-prefix","lib-depends":["gmp"]},$={support:{BSD:"wip"},type:"external",source:"ext-gmssl","lib-depends":["gmssl"]},ee={support:{Windows:"wip",BSD:"wip"},type:"external",source:"grpc","arg-type-unix":"custom","cpp-extension":!0,"lib-depends":["grpc"]},te={support:{BSD:"wip"},type:"builtin","arg-type":"with-prefix","arg-type-windows":"with","lib-depends-unix":["libiconv"],"lib-depends-windows":["libiconv-win"]},se={support:{BSD:"wip"},type:"external",source:"igbinary","ext-suggests":["session","apcu"]},pe={support:{Windows:"wip",BSD:"wip"},notes:!0,type:"external",source:"ext-imagick","arg-type":"custom","lib-depends":["imagemagick"]},ie={support:{Windows:"wip",BSD:"wip"},notes:!0,type:"external",source:"ext-imap","arg-type":"custom","lib-depends":["imap"],"ext-suggests":["openssl"]},ne={support:{Windows:"no",BSD:"wip",Darwin:"no"},type:"external",source:"inotify"},oe={support:{Windows:"no",BSD:"wip"},type:"builtin","lib-depends":["icu"]},re={support:{Windows:"wip",BSD:"wip"},type:"builtin","arg-type":"with-prefix","lib-depends":["ldap"],"lib-suggests":["gmp","libsodium"],"ext-suggests":["openssl"]},le={support:{Windows:"wip",BSD:"wip"},type:"external",source:"ext-lz4","arg-type":"custom","lib-depends":["liblz4"]},de={support:{BSD:"wip"},type:"builtin","arg-type":"none","ext-depends":["xml"]},ue={type:"builtin","arg-type":"custom","ext-depends":["mbstring"],"lib-depends":["onig"]},ae={type:"builtin","arg-type":"custom"},ce={type:"wip",support:{Windows:"no",BSD:"no",Darwin:"no",Linux:"no"},notes:!0},we={support:{Windows:"wip",BSD:"wip"},type:"external",source:"ext-memcache","arg-type":"custom","ext-depends":["zlib","session"]},ye={support:{Windows:"wip",BSD:"wip",Linux:"no"},type:"external",source:"memcached","arg-type":"custom","cpp-extension":!0,"lib-depends":["libmemcached"],"ext-depends":["session","zlib"]},be={support:{BSD:"wip",Windows:"wip"},type:"external",source:"mongodb","arg-type":"custom","lib-suggests":["icu","openssl","zstd","zlib"]},xe={support:{BSD:"wip"},type:"external",source:"msgpack","arg-type-unix":"with","arg-type-win":"enable"},ge={type:"builtin","arg-type":"with","ext-depends":["mysqlnd"]},me={type:"builtin","arg-type-windows":"with","lib-depends":["zlib"]},he={type:"wip",support:{Windows:"wip",BSD:"no",Darwin:"no",Linux:"no"},notes:!0},De={support:{BSD:"wip",Windows:"wip"},type:"builtin","arg-type-unix":"custom","lib-depends-unix":["unixodbc"]},Se={type:"builtin","arg-type-unix":"custom"},Be={notes:!0,type:"builtin","arg-type":"custom","arg-type-windows":"with","lib-depends":["openssl","zlib"],"ext-depends":["zlib"]},fe={support:{BSD:"wip"},type:"external",source:"opentelemetry"},ve={support:{BSD:"wip"},notes:!0,type:"external",source:"parallel","arg-type-windows":"with","lib-depends-windows":["pthreads4w"]},qe={support:{Windows:"no"},type:"builtin","unix-only":!0},ze={type:"builtin"},We={type:"builtin","arg-type":"with","ext-depends":["pdo","mysqlnd"]},_e={support:{BSD:"wip"},type:"builtin","arg-type":"custom","lib-depends-unix":["unixodbc"],"ext-depends":["pdo","odbc"]},ke={support:{BSD:"wip"},type:"builtin","arg-type":"with-prefix","arg-type-windows":"custom","ext-depends":["pdo","pgsql"],"lib-depends-unix":["postgresql"],"lib-depends-windows":["postgresql-win"]},Le={support:{BSD:"wip"},type:"builtin","arg-type":"with","ext-depends":["pdo","sqlite3"],"lib-depends":["sqlite"]},je={support:{BSD:"wip"},type:"external",source:"pdo_sqlsrv","arg-type":"with","ext-depends":["pdo","sqlsrv"]},Fe={support:{BSD:"wip"},notes:!0,type:"builtin","arg-type":"custom","lib-depends-unix":["postgresql"],"lib-depends-windows":["postgresql-win"]},Ne={type:"builtin","ext-depends":["zlib"]},Ce={support:{Windows:"no"},type:"builtin","unix-only":!0},Ee={support:{Windows:"wip",BSD:"wip"},type:"external",source:"protobuf"},Oe={support:{BSD:"wip",Darwin:"partial"},notes:!0,type:"external",source:"rar","cpp-extension":!0},Te={support:{BSD:"wip",Windows:"wip"},type:"external",source:"ext-rdkafka","arg-type":"custom","cpp-extension":!0,"lib-depends":["librdkafka"]},Ve={support:{Windows:"wip",BSD:"wip"},type:"builtin","arg-type":"with-prefix","lib-depends":["readline"]},Ie={support:{BSD:"wip"},type:"external",source:"redis","arg-type":"custom","ext-suggests":["session","igbinary"],"lib-suggests-unix":["zstd","liblz4"]},Me={type:"builtin"},Ue={type:"builtin"},Ae={type:"external",source:"ext-simdjson","cpp-extension":!0},Ge={support:{BSD:"wip"},type:"builtin","arg-type":"custom","lib-depends":["libxml2"],"ext-depends-windows":["xml"]},He={support:{Windows:"wip",BSD:"wip"},type:"external",source:"ext-snappy","cpp-extension":!0,"arg-type":"custom","lib-depends":["snappy"],"ext-suggests":["apcu"]},Je={support:{BSD:"wip"},type:"builtin","arg-type":"custom","lib-depends":["libxml2"],"ext-depends-windows":["xml"]},Ke={type:"builtin"},Pe={support:{BSD:"wip"},type:"builtin","arg-type":"with","lib-depends":["libsodium"]},Qe={support:{BSD:"wip",Windows:"no"},notes:!0,type:"external",source:"spx","arg-type":"custom","lib-depends":["zlib"]},Re={support:{BSD:"wip"},type:"builtin","arg-type":"with-prefix","arg-type-windows":"with","lib-depends":["sqlite"]},Xe={support:{BSD:"wip"},type:"external",source:"sqlsrv","lib-depends-unix":["unixodbc"],"ext-depends-linux":["pcntl"],"cpp-extension":!0},Ye={support:{BSD:"wip"},type:"external",source:"ext-ssh2","arg-type":"with-prefix","arg-type-windows":"with","lib-depends":["libssh2"],"ext-depends-windows":["openssl","zlib"]},Ze={support:{Windows:"no",BSD:"wip"},target:["static"],notes:!0,type:"external",source:"swoole","arg-type":"custom","cpp-extension":!0,"unix-only":!0,"lib-depends":["libcares","brotli","nghttp2","zlib"],"ext-depends":["openssl","curl"],"ext-suggests":["swoole-hook-pgsql","swoole-hook-mysql","swoole-hook-sqlite"]},$e={support:{BSD:"wip"},notes:!0,type:"external",source:"swow","arg-type":"custom","lib-suggests":["openssl","curl"],"ext-suggests":["openssl","curl"]},et={support:{Windows:"no",BSD:"wip"},type:"builtin","unix-only":!0},tt={support:{Windows:"no",BSD:"wip"},type:"builtin","unix-only":!0},st={support:{BSD:"wip"},type:"builtin"},pt={support:{Windows:"wip",BSD:"wip"},type:"builtin","arg-type":"with-prefix","lib-depends":["tidy"]},it={type:"builtin"},nt={support:{Windows:"wip",BSD:"wip"},type:"external",source:"ext-uuid","arg-type":"with-prefix","lib-depends":["libuuid"]},ot={support:{Windows:"wip",BSD:"wip"},type:"external",source:"ext-uv","arg-type":"with-prefix","lib-depends":["libuv"],"ext-depends":["sockets"]},rt={type:"external",source:"xdebug",target:["shared"],support:{Windows:"wip",BSD:"no",Darwin:"partial",Linux:"partial"},notes:!0},lt={support:{Windows:"wip",BSD:"wip"},notes:!0,type:"external",source:"xhprof","ext-depends":["ctype"]},dt={support:{BSD:"wip"},type:"external",source:"xlswriter","arg-type":"custom","ext-depends":["zlib","zip"],"lib-suggests":["openssl"]},ut={support:{BSD:"wip"},notes:!0,type:"builtin","arg-type":"custom","arg-type-windows":"with","lib-depends":["libxml2"],"ext-depends-windows":["iconv"]},at={support:{BSD:"wip"},type:"builtin","arg-type":"custom","lib-depends":["libxml2"],"ext-depends-windows":["xml","dom"]},ct={support:{BSD:"wip"},type:"builtin","arg-type":"custom","lib-depends":["libxml2"],"ext-depends-windows":["xml"]},wt={support:{Windows:"wip",BSD:"wip"},type:"builtin","arg-type":"with-prefix","lib-depends":["libxslt"],"ext-depends":["xml","dom"]},yt={support:{BSD:"wip"},type:"external",source:"yac","arg-type-unix":"custom","ext-depends-unix":["igbinary"]},bt={support:{BSD:"wip"},type:"external",source:"yaml","arg-type-unix":"with-prefix","arg-type-windows":"with","lib-depends":["libyaml"]},xt={support:{BSD:"wip"},target:["static"],type:"builtin","arg-type":"with-prefix","arg-type-windows":"enable","lib-depends-unix":["libzip"],"ext-depends-windows":["zlib","bz2"],"lib-depends-windows":["libzip","zlib","bzip2","xz"]},gt={type:"builtin","arg-type":"custom","arg-type-windows":"enable","lib-depends":["zlib"]},mt={support:{Windows:"wip",BSD:"wip"},type:"external",source:"ext-zstd","arg-type":"custom","lib-depends":["zstd"]},ht={amqp:k,apcu:L,ast:j,bcmath:F,bz2:N,calendar:C,ctype:E,curl:O,dba:T,dio:V,dom:I,ds:M,enchant:U,ev:A,event:G,exif:H,ffi:J,fileinfo:K,filter:P,ftp:Q,gd:R,gettext:X,glfw:Y,gmp:Z,gmssl:$,grpc:ee,iconv:te,igbinary:se,imagick:pe,imap:ie,inotify:ne,intl:oe,ldap:re,lz4:le,libxml:de,mbregex:ue,mbstring:ae,mcrypt:ce,memcache:we,memcached:ye,mongodb:be,msgpack:xe,mysqli:ge,mysqlnd:me,oci8:he,odbc:De,opcache:Se,openssl:Be,opentelemetry:fe,parallel:ve,"password-argon2":{support:{Windows:"wip",BSD:"wip"},notes:!0,type:"builtin","arg-type":"with-prefix","lib-depends":["libargon2"]},pcntl:qe,pdo:ze,pdo_mysql:We,pdo_odbc:_e,pdo_pgsql:ke,pdo_sqlite:Le,pdo_sqlsrv:je,pgsql:Fe,phar:Ne,posix:Ce,protobuf:Ee,rar:Oe,rdkafka:Te,readline:Ve,redis:Ie,session:Me,shmop:Ue,simdjson:Ae,simplexml:Ge,snappy:He,soap:Je,sockets:Ke,sodium:Pe,spx:Qe,sqlite3:Re,sqlsrv:Xe,ssh2:Ye,swoole:Ze,"swoole-hook-mysql":{support:{Windows:"no",BSD:"wip"},notes:!0,type:"addon","arg-type":"custom","ext-depends":["mysqlnd","pdo","pdo_mysql"],"ext-suggests":["mysqli"]},"swoole-hook-pgsql":{support:{Windows:"no",BSD:"wip",Darwin:"partial"},notes:!0,type:"addon","arg-type":"custom","ext-depends":["pgsql","pdo"]},"swoole-hook-sqlite":{support:{Windows:"no",BSD:"wip"},notes:!0,type:"addon","arg-type":"custom","ext-depends":["sqlite3","pdo"]},swow:$e,sysvmsg:et,sysvsem:tt,sysvshm:st,tidy:pt,tokenizer:it,uuid:nt,uv:ot,xdebug:rt,xhprof:lt,xlswriter:dt,xml:ut,xmlreader:at,xmlwriter:ct,xsl:wt,yac:yt,yaml:bt,zip:xt,zlib:gt,zstd:mt},Dt={class:"DocSearch-SearchBar",style:{padding:"0"}},St={class:"DocSearch-Form searchinput"},Bt=e("thead",null,[e("tr",null,[e("th",null,"Extension Name"),e("th",null,"Linux"),e("th",null,"macOS"),e("th",null,"FreeBSD"),e("th",null,"Windows")])],-1),ft={key:0},vt={key:1},qt=["href"],zt={key:0,style:{margin:"0 4px 20px 4px",color:"var(--vp-c-text-2)","font-size":"14px"}},Wt={name:"SearchTable"},Lt=Object.assign(Wt,{setup(_t){var a,c,w,y,b,x,g,m,h,D,S,B;const o=u([]);for(const[d,t]of Object.entries(ht))o.value.push({name:d,linux:((a=t.support)==null?void 0:a.Linux)===void 0?"yes":((c=t.support)==null?void 0:c.Linux)==="wip"?"":(w=t.support)==null?void 0:w.Linux,macos:((y=t.support)==null?void 0:y.Darwin)===void 0?"yes":((b=t.support)==null?void 0:b.Darwin)==="wip"?"":(x=t.support)==null?void 0:x.Darwin,freebsd:((g=t.support)==null?void 0:g.BSD)===void 0?"yes":((m=t.support)==null?void 0:m.BSD)==="wip"?"":(h=t.support)==null?void 0:h.BSD,windows:((D=t.support)==null?void 0:D.Windows)===void 0?"yes":((S=t.support)==null?void 0:S.Windows)==="wip"?"":(B=t.support)==null?void 0:B.Windows,notes:t.notes===!0});const r=u(o.value),l=u(""),f=()=>{if(l.value===""){r.value=o.value;return}r.value=o.value.filter(d=>d.name.toLowerCase().includes(l.value.toLowerCase()))};return(d,t)=>(p(),i("div",null,[e("header",Dt,[e("form",St,[v(e("input",{class:"DocSearch-Input","onUpdate:modelValue":t[0]||(t[0]=s=>l.value=s),placeholder:"Filter name...",onInput:f},null,544),[[q,l.value]])])]),e("table",null,[Bt,e("tbody",null,[(p(!0),i(z,null,W(r.value,s=>(p(),i("tr",null,[s.notes?(p(),i("td",vt,[e("a",{href:"./extension-notes.html#"+s.name},n(s.name),9,qt)])):(p(),i("td",ft,n(s.name),1)),e("td",null,n(s.linux),1),e("td",null,n(s.macos),1),e("td",null,n(s.freebsd),1),e("td",null,n(s.windows),1)]))),256))])]),r.value.length===0?(p(),i("div",zt," No result, please try another keyword. ")):_("",!0)]))}});export{Lt as _}; diff --git a/assets/chunks/framework.PeLcR_tw.js b/assets/chunks/framework.PeLcR_tw.js new file mode 100644 index 00000000..b5654e5f --- /dev/null +++ b/assets/chunks/framework.PeLcR_tw.js @@ -0,0 +1,18 @@ +/** +* @vue/shared v3.5.16 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**//*! #__NO_SIDE_EFFECTS__ */function Vs(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const ne={},It=[],Ke=()=>{},Ko=()=>!1,rn=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),ks=e=>e.startsWith("onUpdate:"),de=Object.assign,Us=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},Bo=Object.prototype.hasOwnProperty,Z=(e,t)=>Bo.call(e,t),k=Array.isArray,Pt=e=>on(e)==="[object Map]",Ht=e=>on(e)==="[object Set]",fr=e=>on(e)==="[object Date]",X=e=>typeof e=="function",le=e=>typeof e=="string",$e=e=>typeof e=="symbol",te=e=>e!==null&&typeof e=="object",ri=e=>(te(e)||X(e))&&X(e.then)&&X(e.catch),ii=Object.prototype.toString,on=e=>ii.call(e),qo=e=>on(e).slice(8,-1),oi=e=>on(e)==="[object Object]",Ws=e=>le(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,Lt=Vs(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),jn=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},Go=/-(\w)/g,De=jn(e=>e.replace(Go,(t,n)=>n?n.toUpperCase():"")),Xo=/\B([A-Z])/g,ft=jn(e=>e.replace(Xo,"-$1").toLowerCase()),Vn=jn(e=>e.charAt(0).toUpperCase()+e.slice(1)),Tn=jn(e=>e?`on${Vn(e)}`:""),ot=(e,t)=>!Object.is(e,t),En=(e,...t)=>{for(let n=0;n{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:s,value:n})},Mn=e=>{const t=parseFloat(e);return isNaN(t)?e:t},Yo=e=>{const t=le(e)?Number(e):NaN;return isNaN(t)?e:t};let ur;const kn=()=>ur||(ur=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Ks(e){if(k(e)){const t={};for(let n=0;n{if(n){const s=n.split(zo);s.length>1&&(t[s[0].trim()]=s[1].trim())}}),t}function Bs(e){let t="";if(le(e))t=e;else if(k(e))for(let n=0;nEt(n,t))}const ai=e=>!!(e&&e.__v_isRef===!0),sl=e=>le(e)?e:e==null?"":k(e)||te(e)&&(e.toString===ii||!X(e.toString))?ai(e)?sl(e.value):JSON.stringify(e,fi,2):String(e),fi=(e,t)=>ai(t)?fi(e,t.value):Pt(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[s,r],i)=>(n[rs(s,i)+" =>"]=r,n),{})}:Ht(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>rs(n))}:$e(t)?rs(t):te(t)&&!k(t)&&!oi(t)?String(t):t,rs=(e,t="")=>{var n;return $e(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};/** +* @vue/reactivity v3.5.16 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/let ye;class rl{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=ye,!t&&ye&&(this.index=(ye.scopes||(ye.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,n;if(this.scopes)for(t=0,n=this.scopes.length;t0&&--this._on===0&&(ye=this.prevScope,this.prevScope=void 0)}stop(t){if(this._active){this._active=!1;let n,s;for(n=0,s=this.effects.length;n0)return;if(Bt){let t=Bt;for(Bt=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;Kt;){let t=Kt;for(Kt=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(s){e||(e=s)}t=n}}if(e)throw e}function gi(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function mi(e){let t,n=e.depsTail,s=n;for(;s;){const r=s.prevDep;s.version===-1?(s===n&&(n=r),Ys(s),ol(s)):t=s,s.dep.activeLink=s.prevActiveLink,s.prevActiveLink=void 0,s=r}e.deps=t,e.depsTail=n}function Es(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(yi(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function yi(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Yt)||(e.globalVersion=Yt,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Es(e))))return;e.flags|=2;const t=e.dep,n=re,s=He;re=e,He=!0;try{gi(e);const r=e.fn(e._value);(t.version===0||ot(r,e._value))&&(e.flags|=128,e._value=r,t.version++)}catch(r){throw t.version++,r}finally{re=n,He=s,mi(e),e.flags&=-3}}function Ys(e,t=!1){const{dep:n,prevSub:s,nextSub:r}=e;if(s&&(s.nextSub=r,e.prevSub=void 0),r&&(r.prevSub=s,e.nextSub=void 0),n.subs===e&&(n.subs=s,!s&&n.computed)){n.computed.flags&=-5;for(let i=n.computed.deps;i;i=i.nextDep)Ys(i,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function ol(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let He=!0;const vi=[];function ze(){vi.push(He),He=!1}function Qe(){const e=vi.pop();He=e===void 0?!0:e}function dr(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=re;re=void 0;try{t()}finally{re=n}}}let Yt=0;class ll{constructor(t,n){this.sub=t,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class Un{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0}track(t){if(!re||!He||re===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==re)n=this.activeLink=new ll(re,this),re.deps?(n.prevDep=re.depsTail,re.depsTail.nextDep=n,re.depsTail=n):re.deps=re.depsTail=n,_i(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const s=n.nextDep;s.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=s),n.prevDep=re.depsTail,n.nextDep=void 0,re.depsTail.nextDep=n,re.depsTail=n,re.deps===n&&(re.deps=s)}return n}trigger(t){this.version++,Yt++,this.notify(t)}notify(t){Gs();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{Xs()}}}function _i(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let s=t.deps;s;s=s.nextDep)_i(s)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const In=new WeakMap,yt=Symbol(""),Cs=Symbol(""),Jt=Symbol("");function _e(e,t,n){if(He&&re){let s=In.get(e);s||In.set(e,s=new Map);let r=s.get(n);r||(s.set(n,r=new Un),r.map=s,r.key=n),r.track()}}function Xe(e,t,n,s,r,i){const o=In.get(e);if(!o){Yt++;return}const l=c=>{c&&c.trigger()};if(Gs(),t==="clear")o.forEach(l);else{const c=k(e),f=c&&Ws(n);if(c&&n==="length"){const a=Number(s);o.forEach((h,y)=>{(y==="length"||y===Jt||!$e(y)&&y>=a)&&l(h)})}else switch((n!==void 0||o.has(void 0))&&l(o.get(n)),f&&l(o.get(Jt)),t){case"add":c?f&&l(o.get("length")):(l(o.get(yt)),Pt(e)&&l(o.get(Cs)));break;case"delete":c||(l(o.get(yt)),Pt(e)&&l(o.get(Cs)));break;case"set":Pt(e)&&l(o.get(yt));break}}Xs()}function cl(e,t){const n=In.get(e);return n&&n.get(t)}function Rt(e){const t=Q(e);return t===e?t:(_e(t,"iterate",Jt),Ie(e)?t:t.map(he))}function Wn(e){return _e(e=Q(e),"iterate",Jt),e}const al={__proto__:null,[Symbol.iterator](){return os(this,Symbol.iterator,he)},concat(...e){return Rt(this).concat(...e.map(t=>k(t)?Rt(t):t))},entries(){return os(this,"entries",e=>(e[1]=he(e[1]),e))},every(e,t){return Be(this,"every",e,t,void 0,arguments)},filter(e,t){return Be(this,"filter",e,t,n=>n.map(he),arguments)},find(e,t){return Be(this,"find",e,t,he,arguments)},findIndex(e,t){return Be(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return Be(this,"findLast",e,t,he,arguments)},findLastIndex(e,t){return Be(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return Be(this,"forEach",e,t,void 0,arguments)},includes(...e){return ls(this,"includes",e)},indexOf(...e){return ls(this,"indexOf",e)},join(e){return Rt(this).join(e)},lastIndexOf(...e){return ls(this,"lastIndexOf",e)},map(e,t){return Be(this,"map",e,t,void 0,arguments)},pop(){return kt(this,"pop")},push(...e){return kt(this,"push",e)},reduce(e,...t){return hr(this,"reduce",e,t)},reduceRight(e,...t){return hr(this,"reduceRight",e,t)},shift(){return kt(this,"shift")},some(e,t){return Be(this,"some",e,t,void 0,arguments)},splice(...e){return kt(this,"splice",e)},toReversed(){return Rt(this).toReversed()},toSorted(e){return Rt(this).toSorted(e)},toSpliced(...e){return Rt(this).toSpliced(...e)},unshift(...e){return kt(this,"unshift",e)},values(){return os(this,"values",he)}};function os(e,t,n){const s=Wn(e),r=s[t]();return s!==e&&!Ie(e)&&(r._next=r.next,r.next=()=>{const i=r._next();return i.value&&(i.value=n(i.value)),i}),r}const fl=Array.prototype;function Be(e,t,n,s,r,i){const o=Wn(e),l=o!==e&&!Ie(e),c=o[t];if(c!==fl[t]){const h=c.apply(e,i);return l?he(h):h}let f=n;o!==e&&(l?f=function(h,y){return n.call(this,he(h),y,e)}:n.length>2&&(f=function(h,y){return n.call(this,h,y,e)}));const a=c.call(o,f,s);return l&&r?r(a):a}function hr(e,t,n,s){const r=Wn(e);let i=n;return r!==e&&(Ie(e)?n.length>3&&(i=function(o,l,c){return n.call(this,o,l,c,e)}):i=function(o,l,c){return n.call(this,o,he(l),c,e)}),r[t](i,...s)}function ls(e,t,n){const s=Q(e);_e(s,"iterate",Jt);const r=s[t](...n);return(r===-1||r===!1)&&Js(n[0])?(n[0]=Q(n[0]),s[t](...n)):r}function kt(e,t,n=[]){ze(),Gs();const s=Q(e)[t].apply(e,n);return Xs(),Qe(),s}const ul=Vs("__proto__,__v_isRef,__isVue"),bi=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter($e));function dl(e){$e(e)||(e=String(e));const t=Q(this);return _e(t,"has",e),t.hasOwnProperty(e)}class wi{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,s){if(n==="__v_skip")return t.__v_skip;const r=this._isReadonly,i=this._isShallow;if(n==="__v_isReactive")return!r;if(n==="__v_isReadonly")return r;if(n==="__v_isShallow")return i;if(n==="__v_raw")return s===(r?i?Ai:Ci:i?Ei:Ti).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(s)?t:void 0;const o=k(t);if(!r){let c;if(o&&(c=al[n]))return c;if(n==="hasOwnProperty")return dl}const l=Reflect.get(t,n,fe(t)?t:s);return($e(n)?bi.has(n):ul(n))||(r||_e(t,"get",n),i)?l:fe(l)?o&&Ws(n)?l:l.value:te(l)?r?Bn(l):Dt(l):l}}class Si extends wi{constructor(t=!1){super(!1,t)}set(t,n,s,r){let i=t[n];if(!this._isShallow){const c=lt(i);if(!Ie(s)&&!lt(s)&&(i=Q(i),s=Q(s)),!k(t)&&fe(i)&&!fe(s))return c?!1:(i.value=s,!0)}const o=k(t)&&Ws(n)?Number(n)e,hn=e=>Reflect.getPrototypeOf(e);function yl(e,t,n){return function(...s){const r=this.__v_raw,i=Q(r),o=Pt(i),l=e==="entries"||e===Symbol.iterator&&o,c=e==="keys"&&o,f=r[e](...s),a=n?As:t?Pn:he;return!t&&_e(i,"iterate",c?Cs:yt),{next(){const{value:h,done:y}=f.next();return y?{value:h,done:y}:{value:l?[a(h[0]),a(h[1])]:a(h),done:y}},[Symbol.iterator](){return this}}}}function pn(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function vl(e,t){const n={get(r){const i=this.__v_raw,o=Q(i),l=Q(r);e||(ot(r,l)&&_e(o,"get",r),_e(o,"get",l));const{has:c}=hn(o),f=t?As:e?Pn:he;if(c.call(o,r))return f(i.get(r));if(c.call(o,l))return f(i.get(l));i!==o&&i.get(r)},get size(){const r=this.__v_raw;return!e&&_e(Q(r),"iterate",yt),Reflect.get(r,"size",r)},has(r){const i=this.__v_raw,o=Q(i),l=Q(r);return e||(ot(r,l)&&_e(o,"has",r),_e(o,"has",l)),r===l?i.has(r):i.has(r)||i.has(l)},forEach(r,i){const o=this,l=o.__v_raw,c=Q(l),f=t?As:e?Pn:he;return!e&&_e(c,"iterate",yt),l.forEach((a,h)=>r.call(i,f(a),f(h),o))}};return de(n,e?{add:pn("add"),set:pn("set"),delete:pn("delete"),clear:pn("clear")}:{add(r){!t&&!Ie(r)&&!lt(r)&&(r=Q(r));const i=Q(this);return hn(i).has.call(i,r)||(i.add(r),Xe(i,"add",r,r)),this},set(r,i){!t&&!Ie(i)&&!lt(i)&&(i=Q(i));const o=Q(this),{has:l,get:c}=hn(o);let f=l.call(o,r);f||(r=Q(r),f=l.call(o,r));const a=c.call(o,r);return o.set(r,i),f?ot(i,a)&&Xe(o,"set",r,i):Xe(o,"add",r,i),this},delete(r){const i=Q(this),{has:o,get:l}=hn(i);let c=o.call(i,r);c||(r=Q(r),c=o.call(i,r)),l&&l.call(i,r);const f=i.delete(r);return c&&Xe(i,"delete",r,void 0),f},clear(){const r=Q(this),i=r.size!==0,o=r.clear();return i&&Xe(r,"clear",void 0,void 0),o}}),["keys","values","entries",Symbol.iterator].forEach(r=>{n[r]=yl(r,e,t)}),n}function Kn(e,t){const n=vl(e,t);return(s,r,i)=>r==="__v_isReactive"?!e:r==="__v_isReadonly"?e:r==="__v_raw"?s:Reflect.get(Z(n,r)&&r in s?n:s,r,i)}const _l={get:Kn(!1,!1)},bl={get:Kn(!1,!0)},wl={get:Kn(!0,!1)},Sl={get:Kn(!0,!0)},Ti=new WeakMap,Ei=new WeakMap,Ci=new WeakMap,Ai=new WeakMap;function xl(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Tl(e){return e.__v_skip||!Object.isExtensible(e)?0:xl(qo(e))}function Dt(e){return lt(e)?e:qn(e,!1,hl,_l,Ti)}function El(e){return qn(e,!1,gl,bl,Ei)}function Bn(e){return qn(e,!0,pl,wl,Ci)}function Of(e){return qn(e,!0,ml,Sl,Ai)}function qn(e,t,n,s,r){if(!te(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const i=Tl(e);if(i===0)return e;const o=r.get(e);if(o)return o;const l=new Proxy(e,i===2?s:n);return r.set(e,l),l}function vt(e){return lt(e)?vt(e.__v_raw):!!(e&&e.__v_isReactive)}function lt(e){return!!(e&&e.__v_isReadonly)}function Ie(e){return!!(e&&e.__v_isShallow)}function Js(e){return e?!!e.__v_raw:!1}function Q(e){const t=e&&e.__v_raw;return t?Q(t):e}function Cn(e){return!Z(e,"__v_skip")&&Object.isExtensible(e)&&li(e,"__v_skip",!0),e}const he=e=>te(e)?Dt(e):e,Pn=e=>te(e)?Bn(e):e;function fe(e){return e?e.__v_isRef===!0:!1}function _t(e){return Ri(e,!1)}function Pe(e){return Ri(e,!0)}function Ri(e,t){return fe(e)?e:new Cl(e,t)}class Cl{constructor(t,n){this.dep=new Un,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:Q(t),this._value=n?t:he(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,s=this.__v_isShallow||Ie(t)||lt(t);t=s?t:Q(t),ot(t,n)&&(this._rawValue=t,this._value=s?t:he(t),this.dep.trigger())}}function zs(e){return fe(e)?e.value:e}function ce(e){return X(e)?e():zs(e)}const Al={get:(e,t,n)=>t==="__v_raw"?e:zs(Reflect.get(e,t,n)),set:(e,t,n,s)=>{const r=e[t];return fe(r)&&!fe(n)?(r.value=n,!0):Reflect.set(e,t,n,s)}};function Oi(e){return vt(e)?e:new Proxy(e,Al)}class Rl{constructor(t){this.__v_isRef=!0,this._value=void 0;const n=this.dep=new Un,{get:s,set:r}=t(n.track.bind(n),n.trigger.bind(n));this._get=s,this._set=r}get value(){return this._value=this._get()}set value(t){this._set(t)}}function Ol(e){return new Rl(e)}class Ml{constructor(t,n,s){this._object=t,this._key=n,this._defaultValue=s,this.__v_isRef=!0,this._value=void 0}get value(){const t=this._object[this._key];return this._value=t===void 0?this._defaultValue:t}set value(t){this._object[this._key]=t}get dep(){return cl(Q(this._object),this._key)}}class Il{constructor(t){this._getter=t,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function Pl(e,t,n){return fe(e)?e:X(e)?new Il(e):te(e)&&arguments.length>1?Ll(e,t,n):_t(e)}function Ll(e,t,n){const s=e[t];return fe(s)?s:new Ml(e,t,n)}class Nl{constructor(t,n,s){this.fn=t,this.setter=n,this._value=void 0,this.dep=new Un(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Yt-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=s}notify(){if(this.flags|=16,!(this.flags&8)&&re!==this)return pi(this,!0),!0}get value(){const t=this.dep.track();return yi(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function Dl(e,t,n=!1){let s,r;return X(e)?s=e:(s=e.get,r=e.set),new Nl(s,r,n)}const gn={},Ln=new WeakMap;let gt;function Fl(e,t=!1,n=gt){if(n){let s=Ln.get(n);s||Ln.set(n,s=[]),s.push(e)}}function Hl(e,t,n=ne){const{immediate:s,deep:r,once:i,scheduler:o,augmentJob:l,call:c}=n,f=g=>r?g:Ie(g)||r===!1||r===0?Ye(g,1):Ye(g);let a,h,y,v,R=!1,L=!1;if(fe(e)?(h=()=>e.value,R=Ie(e)):vt(e)?(h=()=>f(e),R=!0):k(e)?(L=!0,R=e.some(g=>vt(g)||Ie(g)),h=()=>e.map(g=>{if(fe(g))return g.value;if(vt(g))return f(g);if(X(g))return c?c(g,2):g()})):X(e)?t?h=c?()=>c(e,2):e:h=()=>{if(y){ze();try{y()}finally{Qe()}}const g=gt;gt=a;try{return c?c(e,3,[v]):e(v)}finally{gt=g}}:h=Ke,t&&r){const g=h,O=r===!0?1/0:r;h=()=>Ye(g(),O)}const q=ui(),F=()=>{a.stop(),q&&q.active&&Us(q.effects,a)};if(i&&t){const g=t;t=(...O)=>{g(...O),F()}}let B=L?new Array(e.length).fill(gn):gn;const p=g=>{if(!(!(a.flags&1)||!a.dirty&&!g))if(t){const O=a.run();if(r||R||(L?O.some((U,C)=>ot(U,B[C])):ot(O,B))){y&&y();const U=gt;gt=a;try{const C=[O,B===gn?void 0:L&&B[0]===gn?[]:B,v];B=O,c?c(t,3,C):t(...C)}finally{gt=U}}}else a.run()};return l&&l(p),a=new di(h),a.scheduler=o?()=>o(p,!1):p,v=g=>Fl(g,!1,a),y=a.onStop=()=>{const g=Ln.get(a);if(g){if(c)c(g,4);else for(const O of g)O();Ln.delete(a)}},t?s?p(!0):B=a.run():o?o(p.bind(null,!0),!0):a.run(),F.pause=a.pause.bind(a),F.resume=a.resume.bind(a),F.stop=F,F}function Ye(e,t=1/0,n){if(t<=0||!te(e)||e.__v_skip||(n=n||new Set,n.has(e)))return e;if(n.add(e),t--,fe(e))Ye(e.value,t,n);else if(k(e))for(let s=0;s{Ye(s,t,n)});else if(oi(e)){for(const s in e)Ye(e[s],t,n);for(const s of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,s)&&Ye(e[s],t,n)}return e}/** +* @vue/runtime-core v3.5.16 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/function ln(e,t,n,s){try{return s?e(...s):e()}catch(r){Gn(r,t,n)}}function je(e,t,n,s){if(X(e)){const r=ln(e,t,n,s);return r&&ri(r)&&r.catch(i=>{Gn(i,t,n)}),r}if(k(e)){const r=[];for(let i=0;i>>1,r=we[s],i=zt(r);i=zt(n)?we.push(e):we.splice(jl(t),0,e),e.flags|=1,Ii()}}function Ii(){Nn||(Nn=Mi.then(Pi))}function Vl(e){k(e)?Nt.push(...e):st&&e.id===-1?st.splice(Mt+1,0,e):e.flags&1||(Nt.push(e),e.flags|=1),Ii()}function pr(e,t,n=Ue+1){for(;nzt(n)-zt(s));if(Nt.length=0,st){st.push(...t);return}for(st=t,Mt=0;Mte.id==null?e.flags&2?-1:1/0:e.id;function Pi(e){try{for(Ue=0;Ue{s._d&&Cr(-1);const i=Fn(t);let o;try{o=e(...r)}finally{Fn(i),s._d&&Cr(1)}return o};return s._n=!0,s._c=!0,s._d=!0,s}function Mf(e,t){if(ae===null)return e;const n=Zn(ae),s=e.dirs||(e.dirs=[]);for(let r=0;re.__isTeleport,rt=Symbol("_leaveCb"),mn=Symbol("_enterCb");function Wl(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return $t(()=>{e.isMounted=!0}),Wi(()=>{e.isUnmounting=!0}),e}const Re=[Function,Array],Di={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Re,onEnter:Re,onAfterEnter:Re,onEnterCancelled:Re,onBeforeLeave:Re,onLeave:Re,onAfterLeave:Re,onLeaveCancelled:Re,onBeforeAppear:Re,onAppear:Re,onAfterAppear:Re,onAppearCancelled:Re},Fi=e=>{const t=e.subTree;return t.component?Fi(t.component):t},Kl={name:"BaseTransition",props:Di,setup(e,{slots:t}){const n=an(),s=Wl();return()=>{const r=t.default&&ji(t.default(),!0);if(!r||!r.length)return;const i=Hi(r),o=Q(e),{mode:l}=o;if(s.isLeaving)return cs(i);const c=gr(i);if(!c)return cs(i);let f=Rs(c,o,s,n,h=>f=h);c.type!==pe&&Qt(c,f);let a=n.subTree&&gr(n.subTree);if(a&&a.type!==pe&&!mt(c,a)&&Fi(n).type!==pe){let h=Rs(a,o,s,n);if(Qt(a,h),l==="out-in"&&c.type!==pe)return s.isLeaving=!0,h.afterLeave=()=>{s.isLeaving=!1,n.job.flags&8||n.update(),delete h.afterLeave,a=void 0},cs(i);l==="in-out"&&c.type!==pe?h.delayLeave=(y,v,R)=>{const L=$i(s,a);L[String(a.key)]=a,y[rt]=()=>{v(),y[rt]=void 0,delete f.delayedLeave,a=void 0},f.delayedLeave=()=>{R(),delete f.delayedLeave,a=void 0}}:a=void 0}else a&&(a=void 0);return i}}};function Hi(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==pe){t=n;break}}return t}const Bl=Kl;function $i(e,t){const{leavingVNodes:n}=e;let s=n.get(t.type);return s||(s=Object.create(null),n.set(t.type,s)),s}function Rs(e,t,n,s,r){const{appear:i,mode:o,persisted:l=!1,onBeforeEnter:c,onEnter:f,onAfterEnter:a,onEnterCancelled:h,onBeforeLeave:y,onLeave:v,onAfterLeave:R,onLeaveCancelled:L,onBeforeAppear:q,onAppear:F,onAfterAppear:B,onAppearCancelled:p}=t,g=String(e.key),O=$i(n,e),U=(T,M)=>{T&&je(T,s,9,M)},C=(T,M)=>{const V=M[1];U(T,M),k(T)?T.every(w=>w.length<=1)&&V():T.length<=1&&V()},K={mode:o,persisted:l,beforeEnter(T){let M=c;if(!n.isMounted)if(i)M=q||c;else return;T[rt]&&T[rt](!0);const V=O[g];V&&mt(e,V)&&V.el[rt]&&V.el[rt](),U(M,[T])},enter(T){let M=f,V=a,w=h;if(!n.isMounted)if(i)M=F||f,V=B||a,w=p||h;else return;let H=!1;const N=T[mn]=J=>{H||(H=!0,J?U(w,[T]):U(V,[T]),K.delayedLeave&&K.delayedLeave(),T[mn]=void 0)};M?C(M,[T,N]):N()},leave(T,M){const V=String(e.key);if(T[mn]&&T[mn](!0),n.isUnmounting)return M();U(y,[T]);let w=!1;const H=T[rt]=N=>{w||(w=!0,M(),N?U(L,[T]):U(R,[T]),T[rt]=void 0,O[V]===e&&delete O[V])};O[V]=e,v?C(v,[T,H]):H()},clone(T){const M=Rs(T,t,n,s,r);return r&&r(M),M}};return K}function cs(e){if(Xn(e))return e=ct(e),e.children=null,e}function gr(e){if(!Xn(e))return Ni(e.type)&&e.children?Hi(e.children):e;if(e.component)return e.component.subTree;const{shapeFlag:t,children:n}=e;if(n){if(t&16)return n[0];if(t&32&&X(n.default))return n.default()}}function Qt(e,t){e.shapeFlag&6&&e.component?(e.transition=t,Qt(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function ji(e,t=!1,n){let s=[],r=0;for(let i=0;i1)for(let i=0;iZt(R,t&&(k(t)?t[L]:t),n,s,r));return}if(bt(s)&&!r){s.shapeFlag&512&&s.type.__asyncResolved&&s.component.subTree.component&&Zt(e,t,n,s.component.subTree);return}const i=s.shapeFlag&4?Zn(s.component):s.el,o=r?null:i,{i:l,r:c}=e,f=t&&t.r,a=l.refs===ne?l.refs={}:l.refs,h=l.setupState,y=Q(h),v=h===ne?()=>!1:R=>Z(y,R);if(f!=null&&f!==c&&(le(f)?(a[f]=null,v(f)&&(h[f]=null)):fe(f)&&(f.value=null)),X(c))ln(c,l,12,[o,a]);else{const R=le(c),L=fe(c);if(R||L){const q=()=>{if(e.f){const F=R?v(c)?h[c]:a[c]:c.value;r?k(F)&&Us(F,i):k(F)?F.includes(i)||F.push(i):R?(a[c]=[i],v(c)&&(h[c]=a[c])):(c.value=[i],e.k&&(a[e.k]=c.value))}else R?(a[c]=o,v(c)&&(h[c]=o)):L&&(c.value=o,e.k&&(a[e.k]=o))};o?(q.id=-1,Ce(q,n)):q()}}}let mr=!1;const Ot=()=>{mr||(console.error("Hydration completed but contains mismatches."),mr=!0)},ql=e=>e.namespaceURI.includes("svg")&&e.tagName!=="foreignObject",Gl=e=>e.namespaceURI.includes("MathML"),yn=e=>{if(e.nodeType===1){if(ql(e))return"svg";if(Gl(e))return"mathml"}},vn=e=>e.nodeType===8;function Xl(e){const{mt:t,p:n,o:{patchProp:s,createText:r,nextSibling:i,parentNode:o,remove:l,insert:c,createComment:f}}=e,a=(p,g)=>{if(!g.hasChildNodes()){n(null,p,g),Dn(),g._vnode=p;return}h(g.firstChild,p,null,null,null),Dn(),g._vnode=p},h=(p,g,O,U,C,K=!1)=>{K=K||!!g.dynamicChildren;const T=vn(p)&&p.data==="[",M=()=>L(p,g,O,U,C,T),{type:V,ref:w,shapeFlag:H,patchFlag:N}=g;let J=p.nodeType;g.el=p,N===-2&&(K=!1,g.dynamicChildren=null);let D=null;switch(V){case xt:J!==3?g.children===""?(c(g.el=r(""),o(p),p),D=p):D=M():(p.data!==g.children&&(Ot(),p.data=g.children),D=i(p));break;case pe:B(p)?(D=i(p),F(g.el=p.content.firstChild,p,O)):J!==8||T?D=M():D=i(p);break;case Gt:if(T&&(p=i(p),J=p.nodeType),J===1||J===3){D=p;const Y=!g.children.length;for(let $=0;${K=K||!!g.dynamicChildren;const{type:T,props:M,patchFlag:V,shapeFlag:w,dirs:H,transition:N}=g,J=T==="input"||T==="option";if(J||V!==-1){H&&We(g,null,O,"created");let D=!1;if(B(p)){D=oo(null,N)&&O&&O.vnode.props&&O.vnode.props.appear;const $=p.content.firstChild;if(D){const oe=$.getAttribute("class");oe&&($.$cls=oe),N.beforeEnter($)}F($,p,O),g.el=p=$}if(w&16&&!(M&&(M.innerHTML||M.textContent))){let $=v(p.firstChild,g,p,O,U,C,K);for(;$;){_n(p,1)||Ot();const oe=$;$=$.nextSibling,l(oe)}}else if(w&8){let $=g.children;$[0]===` +`&&(p.tagName==="PRE"||p.tagName==="TEXTAREA")&&($=$.slice(1)),p.textContent!==$&&(_n(p,0)||Ot(),p.textContent=g.children)}if(M){if(J||!K||V&48){const $=p.tagName.includes("-");for(const oe in M)(J&&(oe.endsWith("value")||oe==="indeterminate")||rn(oe)&&!Lt(oe)||oe[0]==="."||$)&&s(p,oe,null,M[oe],void 0,O)}else if(M.onClick)s(p,"onClick",null,M.onClick,void 0,O);else if(V&4&&vt(M.style))for(const $ in M.style)M.style[$]}let Y;(Y=M&&M.onVnodeBeforeMount)&&Oe(Y,O,g),H&&We(g,null,O,"beforeMount"),((Y=M&&M.onVnodeMounted)||H||D)&&go(()=>{Y&&Oe(Y,O,g),D&&N.enter(p),H&&We(g,null,O,"mounted")},U)}return p.nextSibling},v=(p,g,O,U,C,K,T)=>{T=T||!!g.dynamicChildren;const M=g.children,V=M.length;for(let w=0;w{const{slotScopeIds:T}=g;T&&(C=C?C.concat(T):T);const M=o(p),V=v(i(p),g,M,O,U,C,K);return V&&vn(V)&&V.data==="]"?i(g.anchor=V):(Ot(),c(g.anchor=f("]"),M,V),V)},L=(p,g,O,U,C,K)=>{if(_n(p.parentElement,1)||Ot(),g.el=null,K){const V=q(p);for(;;){const w=i(p);if(w&&w!==V)l(w);else break}}const T=i(p),M=o(p);return l(p),n(null,g,M,T,O,U,yn(M),C),O&&(O.vnode.el=g.el,ho(O,g.el)),T},q=(p,g="[",O="]")=>{let U=0;for(;p;)if(p=i(p),p&&vn(p)&&(p.data===g&&U++,p.data===O)){if(U===0)return i(p);U--}return p},F=(p,g,O)=>{const U=g.parentNode;U&&U.replaceChild(p,g);let C=O;for(;C;)C.vnode.el===g&&(C.vnode.el=C.subTree.el=p),C=C.parent},B=p=>p.nodeType===1&&p.tagName==="TEMPLATE";return[a,h]}const yr="data-allow-mismatch",Yl={0:"text",1:"children",2:"class",3:"style",4:"attribute"};function _n(e,t){if(t===0||t===1)for(;e&&!e.hasAttribute(yr);)e=e.parentElement;const n=e&&e.getAttribute(yr);if(n==null)return!1;if(n==="")return!0;{const s=n.split(",");return t===0&&s.includes("children")?!0:n.split(",").includes(Yl[t])}}kn().requestIdleCallback;kn().cancelIdleCallback;const bt=e=>!!e.type.__asyncLoader,Xn=e=>e.type.__isKeepAlive;function Jl(e,t){Ui(e,"a",t)}function zl(e,t){Ui(e,"da",t)}function Ui(e,t,n=ue){const s=e.__wdc||(e.__wdc=()=>{let r=n;for(;r;){if(r.isDeactivated)return;r=r.parent}return e()});if(Yn(t,s,n),n){let r=n.parent;for(;r&&r.parent;)Xn(r.parent.vnode)&&Ql(s,t,n,r),r=r.parent}}function Ql(e,t,n,s){const r=Yn(t,e,s,!0);Jn(()=>{Us(s[t],r)},n)}function Yn(e,t,n=ue,s=!1){if(n){const r=n[e]||(n[e]=[]),i=t.__weh||(t.__weh=(...o)=>{ze();const l=fn(n),c=je(t,n,e,o);return l(),Qe(),c});return s?r.unshift(i):r.push(i),i}}const tt=e=>(t,n=ue)=>{(!nn||e==="sp")&&Yn(e,(...s)=>t(...s),n)},Zl=tt("bm"),$t=tt("m"),ec=tt("bu"),tc=tt("u"),Wi=tt("bum"),Jn=tt("um"),nc=tt("sp"),sc=tt("rtg"),rc=tt("rtc");function ic(e,t=ue){Yn("ec",e,t)}const Ki="components";function If(e,t){return qi(Ki,e,!0,t)||e}const Bi=Symbol.for("v-ndc");function Pf(e){return le(e)?qi(Ki,e,!1)||e:e||Bi}function qi(e,t,n=!0,s=!1){const r=ae||ue;if(r){const i=r.type;{const l=Wc(i,!1);if(l&&(l===t||l===De(t)||l===Vn(De(t))))return i}const o=vr(r[e]||i[e],t)||vr(r.appContext[e],t);return!o&&s?i:o}}function vr(e,t){return e&&(e[t]||e[De(t)]||e[Vn(De(t))])}function Lf(e,t,n,s){let r;const i=n,o=k(e);if(o||le(e)){const l=o&&vt(e);let c=!1,f=!1;l&&(c=!Ie(e),f=lt(e),e=Wn(e)),r=new Array(e.length);for(let a=0,h=e.length;at(l,c,void 0,i));else{const l=Object.keys(e);r=new Array(l.length);for(let c=0,f=l.length;ctn(t)?!(t.type===pe||t.type===Se&&!Gi(t.children)):!0)?e:null}function Df(e,t){const n={};for(const s in e)n[/[A-Z]/.test(s)?`on:${s}`:Tn(s)]=e[s];return n}const Os=e=>e?bo(e)?Zn(e):Os(e.parent):null,qt=de(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>Os(e.parent),$root:e=>Os(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>Yi(e),$forceUpdate:e=>e.f||(e.f=()=>{Qs(e.update)}),$nextTick:e=>e.n||(e.n=cn.bind(e.proxy)),$watch:e=>Ac.bind(e)}),as=(e,t)=>e!==ne&&!e.__isScriptSetup&&Z(e,t),oc={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:s,data:r,props:i,accessCache:o,type:l,appContext:c}=e;let f;if(t[0]!=="$"){const v=o[t];if(v!==void 0)switch(v){case 1:return s[t];case 2:return r[t];case 4:return n[t];case 3:return i[t]}else{if(as(s,t))return o[t]=1,s[t];if(r!==ne&&Z(r,t))return o[t]=2,r[t];if((f=e.propsOptions[0])&&Z(f,t))return o[t]=3,i[t];if(n!==ne&&Z(n,t))return o[t]=4,n[t];Ms&&(o[t]=0)}}const a=qt[t];let h,y;if(a)return t==="$attrs"&&_e(e.attrs,"get",""),a(e);if((h=l.__cssModules)&&(h=h[t]))return h;if(n!==ne&&Z(n,t))return o[t]=4,n[t];if(y=c.config.globalProperties,Z(y,t))return y[t]},set({_:e},t,n){const{data:s,setupState:r,ctx:i}=e;return as(r,t)?(r[t]=n,!0):s!==ne&&Z(s,t)?(s[t]=n,!0):Z(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(i[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:s,appContext:r,propsOptions:i}},o){let l;return!!n[o]||e!==ne&&Z(e,o)||as(t,o)||(l=i[0])&&Z(l,o)||Z(s,o)||Z(qt,o)||Z(r.config.globalProperties,o)},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:Z(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function Ff(){return lc().slots}function lc(){const e=an();return e.setupContext||(e.setupContext=So(e))}function _r(e){return k(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let Ms=!0;function cc(e){const t=Yi(e),n=e.proxy,s=e.ctx;Ms=!1,t.beforeCreate&&br(t.beforeCreate,e,"bc");const{data:r,computed:i,methods:o,watch:l,provide:c,inject:f,created:a,beforeMount:h,mounted:y,beforeUpdate:v,updated:R,activated:L,deactivated:q,beforeDestroy:F,beforeUnmount:B,destroyed:p,unmounted:g,render:O,renderTracked:U,renderTriggered:C,errorCaptured:K,serverPrefetch:T,expose:M,inheritAttrs:V,components:w,directives:H,filters:N}=t;if(f&&ac(f,s,null),o)for(const Y in o){const $=o[Y];X($)&&(s[Y]=$.bind(n))}if(r){const Y=r.call(n,n);te(Y)&&(e.data=Dt(Y))}if(Ms=!0,i)for(const Y in i){const $=i[Y],oe=X($)?$.bind(n,n):X($.get)?$.get.bind(n,n):Ke,un=!X($)&&X($.set)?$.set.bind(n):Ke,ut=ie({get:oe,set:un});Object.defineProperty(s,Y,{enumerable:!0,configurable:!0,get:()=>ut.value,set:Ve=>ut.value=Ve})}if(l)for(const Y in l)Xi(l[Y],s,n,Y);if(c){const Y=X(c)?c.call(n):c;Reflect.ownKeys(Y).forEach($=>{gc($,Y[$])})}a&&br(a,e,"c");function D(Y,$){k($)?$.forEach(oe=>Y(oe.bind(n))):$&&Y($.bind(n))}if(D(Zl,h),D($t,y),D(ec,v),D(tc,R),D(Jl,L),D(zl,q),D(ic,K),D(rc,U),D(sc,C),D(Wi,B),D(Jn,g),D(nc,T),k(M))if(M.length){const Y=e.exposed||(e.exposed={});M.forEach($=>{Object.defineProperty(Y,$,{get:()=>n[$],set:oe=>n[$]=oe})})}else e.exposed||(e.exposed={});O&&e.render===Ke&&(e.render=O),V!=null&&(e.inheritAttrs=V),w&&(e.components=w),H&&(e.directives=H),T&&ki(e)}function ac(e,t,n=Ke){k(e)&&(e=Is(e));for(const s in e){const r=e[s];let i;te(r)?"default"in r?i=St(r.from||s,r.default,!0):i=St(r.from||s):i=St(r),fe(i)?Object.defineProperty(t,s,{enumerable:!0,configurable:!0,get:()=>i.value,set:o=>i.value=o}):t[s]=i}}function br(e,t,n){je(k(e)?e.map(s=>s.bind(t.proxy)):e.bind(t.proxy),t,n)}function Xi(e,t,n,s){let r=s.includes(".")?fo(n,s):()=>n[s];if(le(e)){const i=t[e];X(i)&&Le(r,i)}else if(X(e))Le(r,e.bind(n));else if(te(e))if(k(e))e.forEach(i=>Xi(i,t,n,s));else{const i=X(e.handler)?e.handler.bind(n):t[e.handler];X(i)&&Le(r,i,e)}}function Yi(e){const t=e.type,{mixins:n,extends:s}=t,{mixins:r,optionsCache:i,config:{optionMergeStrategies:o}}=e.appContext,l=i.get(t);let c;return l?c=l:!r.length&&!n&&!s?c=t:(c={},r.length&&r.forEach(f=>Hn(c,f,o,!0)),Hn(c,t,o)),te(t)&&i.set(t,c),c}function Hn(e,t,n,s=!1){const{mixins:r,extends:i}=t;i&&Hn(e,i,n,!0),r&&r.forEach(o=>Hn(e,o,n,!0));for(const o in t)if(!(s&&o==="expose")){const l=fc[o]||n&&n[o];e[o]=l?l(e[o],t[o]):t[o]}return e}const fc={data:wr,props:Sr,emits:Sr,methods:Wt,computed:Wt,beforeCreate:be,created:be,beforeMount:be,mounted:be,beforeUpdate:be,updated:be,beforeDestroy:be,beforeUnmount:be,destroyed:be,unmounted:be,activated:be,deactivated:be,errorCaptured:be,serverPrefetch:be,components:Wt,directives:Wt,watch:dc,provide:wr,inject:uc};function wr(e,t){return t?e?function(){return de(X(e)?e.call(this,this):e,X(t)?t.call(this,this):t)}:t:e}function uc(e,t){return Wt(Is(e),Is(t))}function Is(e){if(k(e)){const t={};for(let n=0;n1)return n&&X(t)?t.call(s&&s.proxy):t}}function zi(){return!!(ue||ae||wt)}const Qi={},Zi=()=>Object.create(Qi),eo=e=>Object.getPrototypeOf(e)===Qi;function mc(e,t,n,s=!1){const r={},i=Zi();e.propsDefaults=Object.create(null),to(e,t,r,i);for(const o in e.propsOptions[0])o in r||(r[o]=void 0);n?e.props=s?r:El(r):e.type.props?e.props=r:e.props=i,e.attrs=i}function yc(e,t,n,s){const{props:r,attrs:i,vnode:{patchFlag:o}}=e,l=Q(r),[c]=e.propsOptions;let f=!1;if((s||o>0)&&!(o&16)){if(o&8){const a=e.vnode.dynamicProps;for(let h=0;h{c=!0;const[y,v]=no(h,t,!0);de(o,y),v&&l.push(...v)};!n&&t.mixins.length&&t.mixins.forEach(a),e.extends&&a(e.extends),e.mixins&&e.mixins.forEach(a)}if(!i&&!c)return te(e)&&s.set(e,It),It;if(k(i))for(let a=0;ae[0]==="_"||e==="$stable",er=e=>k(e)?e.map(Me):[Me(e)],_c=(e,t,n)=>{if(t._n)return t;const s=kl((...r)=>er(t(...r)),n);return s._c=!1,s},so=(e,t,n)=>{const s=e._ctx;for(const r in e){if(Zs(r))continue;const i=e[r];if(X(i))t[r]=_c(r,i,s);else if(i!=null){const o=er(i);t[r]=()=>o}}},ro=(e,t)=>{const n=er(t);e.slots.default=()=>n},io=(e,t,n)=>{for(const s in t)(n||!Zs(s))&&(e[s]=t[s])},bc=(e,t,n)=>{const s=e.slots=Zi();if(e.vnode.shapeFlag&32){const r=t._;r?(io(s,t,n),n&&li(s,"_",r,!0)):so(t,s)}else t&&ro(e,t)},wc=(e,t,n)=>{const{vnode:s,slots:r}=e;let i=!0,o=ne;if(s.shapeFlag&32){const l=t._;l?n&&l===1?i=!1:io(r,t,n):(i=!t.$stable,so(t,r)),o=t}else t&&(ro(e,t),o={default:1});if(i)for(const l in r)!Zs(l)&&o[l]==null&&delete r[l]},Ce=go;function Sc(e){return xc(e,Xl)}function xc(e,t){const n=kn();n.__VUE__=!0;const{insert:s,remove:r,patchProp:i,createElement:o,createText:l,createComment:c,setText:f,setElementText:a,parentNode:h,nextSibling:y,setScopeId:v=Ke,insertStaticContent:R}=e,L=(u,d,m,S=null,_=null,b=null,I=void 0,A=null,E=!!d.dynamicChildren)=>{if(u===d)return;u&&!mt(u,d)&&(S=dn(u),Ve(u,_,b,!0),u=null),d.patchFlag===-2&&(E=!1,d.dynamicChildren=null);const{type:x,ref:W,shapeFlag:P}=d;switch(x){case xt:q(u,d,m,S);break;case pe:F(u,d,m,S);break;case Gt:u==null&&B(d,m,S,I);break;case Se:w(u,d,m,S,_,b,I,A,E);break;default:P&1?O(u,d,m,S,_,b,I,A,E):P&6?H(u,d,m,S,_,b,I,A,E):(P&64||P&128)&&x.process(u,d,m,S,_,b,I,A,E,At)}W!=null&&_&&Zt(W,u&&u.ref,b,d||u,!d)},q=(u,d,m,S)=>{if(u==null)s(d.el=l(d.children),m,S);else{const _=d.el=u.el;d.children!==u.children&&f(_,d.children)}},F=(u,d,m,S)=>{u==null?s(d.el=c(d.children||""),m,S):d.el=u.el},B=(u,d,m,S)=>{[u.el,u.anchor]=R(u.children,d,m,S,u.el,u.anchor)},p=({el:u,anchor:d},m,S)=>{let _;for(;u&&u!==d;)_=y(u),s(u,m,S),u=_;s(d,m,S)},g=({el:u,anchor:d})=>{let m;for(;u&&u!==d;)m=y(u),r(u),u=m;r(d)},O=(u,d,m,S,_,b,I,A,E)=>{d.type==="svg"?I="svg":d.type==="math"&&(I="mathml"),u==null?U(d,m,S,_,b,I,A,E):T(u,d,_,b,I,A,E)},U=(u,d,m,S,_,b,I,A)=>{let E,x;const{props:W,shapeFlag:P,transition:j,dirs:G}=u;if(E=u.el=o(u.type,b,W&&W.is,W),P&8?a(E,u.children):P&16&&K(u.children,E,null,S,_,fs(u,b),I,A),G&&We(u,null,S,"created"),C(E,u,u.scopeId,I,S),W){for(const se in W)se!=="value"&&!Lt(se)&&i(E,se,null,W[se],b,S);"value"in W&&i(E,"value",null,W.value,b),(x=W.onVnodeBeforeMount)&&Oe(x,S,u)}G&&We(u,null,S,"beforeMount");const z=oo(_,j);z&&j.beforeEnter(E),s(E,d,m),((x=W&&W.onVnodeMounted)||z||G)&&Ce(()=>{x&&Oe(x,S,u),z&&j.enter(E),G&&We(u,null,S,"mounted")},_)},C=(u,d,m,S,_)=>{if(m&&v(u,m),S)for(let b=0;b{for(let x=E;x{const A=d.el=u.el;let{patchFlag:E,dynamicChildren:x,dirs:W}=d;E|=u.patchFlag&16;const P=u.props||ne,j=d.props||ne;let G;if(m&&dt(m,!1),(G=j.onVnodeBeforeUpdate)&&Oe(G,m,d,u),W&&We(d,u,m,"beforeUpdate"),m&&dt(m,!0),(P.innerHTML&&j.innerHTML==null||P.textContent&&j.textContent==null)&&a(A,""),x?M(u.dynamicChildren,x,A,m,S,fs(d,_),b):I||$(u,d,A,null,m,S,fs(d,_),b,!1),E>0){if(E&16)V(A,P,j,m,_);else if(E&2&&P.class!==j.class&&i(A,"class",null,j.class,_),E&4&&i(A,"style",P.style,j.style,_),E&8){const z=d.dynamicProps;for(let se=0;se{G&&Oe(G,m,d,u),W&&We(d,u,m,"updated")},S)},M=(u,d,m,S,_,b,I)=>{for(let A=0;A{if(d!==m){if(d!==ne)for(const b in d)!Lt(b)&&!(b in m)&&i(u,b,d[b],null,_,S);for(const b in m){if(Lt(b))continue;const I=m[b],A=d[b];I!==A&&b!=="value"&&i(u,b,A,I,_,S)}"value"in m&&i(u,"value",d.value,m.value,_)}},w=(u,d,m,S,_,b,I,A,E)=>{const x=d.el=u?u.el:l(""),W=d.anchor=u?u.anchor:l("");let{patchFlag:P,dynamicChildren:j,slotScopeIds:G}=d;G&&(A=A?A.concat(G):G),u==null?(s(x,m,S),s(W,m,S),K(d.children||[],m,W,_,b,I,A,E)):P>0&&P&64&&j&&u.dynamicChildren?(M(u.dynamicChildren,j,m,_,b,I,A),(d.key!=null||_&&d===_.subTree)&&lo(u,d,!0)):$(u,d,m,W,_,b,I,A,E)},H=(u,d,m,S,_,b,I,A,E)=>{d.slotScopeIds=A,u==null?d.shapeFlag&512?_.ctx.activate(d,m,S,I,E):N(d,m,S,_,b,I,E):J(u,d,E)},N=(u,d,m,S,_,b,I)=>{const A=u.component=jc(u,S,_);if(Xn(u)&&(A.ctx.renderer=At),Vc(A,!1,I),A.asyncDep){if(_&&_.registerDep(A,D,I),!u.el){const E=A.subTree=ge(pe);F(null,E,d,m)}}else D(A,u,d,m,_,b,I)},J=(u,d,m)=>{const S=d.component=u.component;if(Pc(u,d,m))if(S.asyncDep&&!S.asyncResolved){Y(S,d,m);return}else S.next=d,S.update();else d.el=u.el,S.vnode=d},D=(u,d,m,S,_,b,I)=>{const A=()=>{if(u.isMounted){let{next:P,bu:j,u:G,parent:z,vnode:se}=u;{const Te=co(u);if(Te){P&&(P.el=se.el,Y(u,P,I)),Te.asyncDep.then(()=>{u.isUnmounted||A()});return}}let ee=P,xe;dt(u,!1),P?(P.el=se.el,Y(u,P,I)):P=se,j&&En(j),(xe=P.props&&P.props.onVnodeBeforeUpdate)&&Oe(xe,z,P,se),dt(u,!0);const me=us(u),Fe=u.subTree;u.subTree=me,L(Fe,me,h(Fe.el),dn(Fe),u,_,b),P.el=me.el,ee===null&&ho(u,me.el),G&&Ce(G,_),(xe=P.props&&P.props.onVnodeUpdated)&&Ce(()=>Oe(xe,z,P,se),_)}else{let P;const{el:j,props:G}=d,{bm:z,m:se,parent:ee,root:xe,type:me}=u,Fe=bt(d);if(dt(u,!1),z&&En(z),!Fe&&(P=G&&G.onVnodeBeforeMount)&&Oe(P,ee,d),dt(u,!0),j&&ss){const Te=()=>{u.subTree=us(u),ss(j,u.subTree,u,_,null)};Fe&&me.__asyncHydrate?me.__asyncHydrate(j,u,Te):Te()}else{xe.ce&&xe.ce._injectChildStyle(me);const Te=u.subTree=us(u);L(null,Te,m,S,u,_,b),d.el=Te.el}if(se&&Ce(se,_),!Fe&&(P=G&&G.onVnodeMounted)){const Te=d;Ce(()=>Oe(P,ee,Te),_)}(d.shapeFlag&256||ee&&bt(ee.vnode)&&ee.vnode.shapeFlag&256)&&u.a&&Ce(u.a,_),u.isMounted=!0,d=m=S=null}};u.scope.on();const E=u.effect=new di(A);u.scope.off();const x=u.update=E.run.bind(E),W=u.job=E.runIfDirty.bind(E);W.i=u,W.id=u.uid,E.scheduler=()=>Qs(W),dt(u,!0),x()},Y=(u,d,m)=>{d.component=u;const S=u.vnode.props;u.vnode=d,u.next=null,yc(u,d.props,S,m),wc(u,d.children,m),ze(),pr(u),Qe()},$=(u,d,m,S,_,b,I,A,E=!1)=>{const x=u&&u.children,W=u?u.shapeFlag:0,P=d.children,{patchFlag:j,shapeFlag:G}=d;if(j>0){if(j&128){un(x,P,m,S,_,b,I,A,E);return}else if(j&256){oe(x,P,m,S,_,b,I,A,E);return}}G&8?(W&16&&jt(x,_,b),P!==x&&a(m,P)):W&16?G&16?un(x,P,m,S,_,b,I,A,E):jt(x,_,b,!0):(W&8&&a(m,""),G&16&&K(P,m,S,_,b,I,A,E))},oe=(u,d,m,S,_,b,I,A,E)=>{u=u||It,d=d||It;const x=u.length,W=d.length,P=Math.min(x,W);let j;for(j=0;jW?jt(u,_,b,!0,!1,P):K(d,m,S,_,b,I,A,E,P)},un=(u,d,m,S,_,b,I,A,E)=>{let x=0;const W=d.length;let P=u.length-1,j=W-1;for(;x<=P&&x<=j;){const G=u[x],z=d[x]=E?it(d[x]):Me(d[x]);if(mt(G,z))L(G,z,m,null,_,b,I,A,E);else break;x++}for(;x<=P&&x<=j;){const G=u[P],z=d[j]=E?it(d[j]):Me(d[j]);if(mt(G,z))L(G,z,m,null,_,b,I,A,E);else break;P--,j--}if(x>P){if(x<=j){const G=j+1,z=Gj)for(;x<=P;)Ve(u[x],_,b,!0),x++;else{const G=x,z=x,se=new Map;for(x=z;x<=j;x++){const Ee=d[x]=E?it(d[x]):Me(d[x]);Ee.key!=null&&se.set(Ee.key,x)}let ee,xe=0;const me=j-z+1;let Fe=!1,Te=0;const Vt=new Array(me);for(x=0;x=me){Ve(Ee,_,b,!0);continue}let ke;if(Ee.key!=null)ke=se.get(Ee.key);else for(ee=z;ee<=j;ee++)if(Vt[ee-z]===0&&mt(Ee,d[ee])){ke=ee;break}ke===void 0?Ve(Ee,_,b,!0):(Vt[ke-z]=x+1,ke>=Te?Te=ke:Fe=!0,L(Ee,d[ke],m,null,_,b,I,A,E),xe++)}const cr=Fe?Tc(Vt):It;for(ee=cr.length-1,x=me-1;x>=0;x--){const Ee=z+x,ke=d[Ee],ar=Ee+1{const{el:b,type:I,transition:A,children:E,shapeFlag:x}=u;if(x&6){ut(u.component.subTree,d,m,S);return}if(x&128){u.suspense.move(d,m,S);return}if(x&64){I.move(u,d,m,At);return}if(I===Se){s(b,d,m);for(let P=0;PA.enter(b),_);else{const{leave:P,delayLeave:j,afterLeave:G}=A,z=()=>{u.ctx.isUnmounted?r(b):s(b,d,m)},se=()=>{P(b,()=>{z(),G&&G()})};j?j(b,z,se):se()}else s(b,d,m)},Ve=(u,d,m,S=!1,_=!1)=>{const{type:b,props:I,ref:A,children:E,dynamicChildren:x,shapeFlag:W,patchFlag:P,dirs:j,cacheIndex:G}=u;if(P===-2&&(_=!1),A!=null&&(ze(),Zt(A,null,m,u,!0),Qe()),G!=null&&(d.renderCache[G]=void 0),W&256){d.ctx.deactivate(u);return}const z=W&1&&j,se=!bt(u);let ee;if(se&&(ee=I&&I.onVnodeBeforeUnmount)&&Oe(ee,d,u),W&6)Wo(u.component,m,S);else{if(W&128){u.suspense.unmount(m,S);return}z&&We(u,null,d,"beforeUnmount"),W&64?u.type.remove(u,d,m,At,S):x&&!x.hasOnce&&(b!==Se||P>0&&P&64)?jt(x,d,m,!1,!0):(b===Se&&P&384||!_&&W&16)&&jt(E,d,m),S&&or(u)}(se&&(ee=I&&I.onVnodeUnmounted)||z)&&Ce(()=>{ee&&Oe(ee,d,u),z&&We(u,null,d,"unmounted")},m)},or=u=>{const{type:d,el:m,anchor:S,transition:_}=u;if(d===Se){Uo(m,S);return}if(d===Gt){g(u);return}const b=()=>{r(m),_&&!_.persisted&&_.afterLeave&&_.afterLeave()};if(u.shapeFlag&1&&_&&!_.persisted){const{leave:I,delayLeave:A}=_,E=()=>I(m,b);A?A(u.el,b,E):E()}else b()},Uo=(u,d)=>{let m;for(;u!==d;)m=y(u),r(u),u=m;r(d)},Wo=(u,d,m)=>{const{bum:S,scope:_,job:b,subTree:I,um:A,m:E,a:x,parent:W,slots:{__:P}}=u;Tr(E),Tr(x),S&&En(S),W&&k(P)&&P.forEach(j=>{W.renderCache[j]=void 0}),_.stop(),b&&(b.flags|=8,Ve(I,u,d,m)),A&&Ce(A,d),Ce(()=>{u.isUnmounted=!0},d),d&&d.pendingBranch&&!d.isUnmounted&&u.asyncDep&&!u.asyncResolved&&u.suspenseId===d.pendingId&&(d.deps--,d.deps===0&&d.resolve())},jt=(u,d,m,S=!1,_=!1,b=0)=>{for(let I=b;I{if(u.shapeFlag&6)return dn(u.component.subTree);if(u.shapeFlag&128)return u.suspense.next();const d=y(u.anchor||u.el),m=d&&d[Ul];return m?y(m):d};let ts=!1;const lr=(u,d,m)=>{u==null?d._vnode&&Ve(d._vnode,null,null,!0):L(d._vnode||null,u,d,null,null,null,m),d._vnode=u,ts||(ts=!0,pr(),Dn(),ts=!1)},At={p:L,um:Ve,m:ut,r:or,mt:N,mc:K,pc:$,pbc:M,n:dn,o:e};let ns,ss;return t&&([ns,ss]=t(At)),{render:lr,hydrate:ns,createApp:pc(lr,ns)}}function fs({type:e,props:t},n){return n==="svg"&&e==="foreignObject"||n==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function dt({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function oo(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function lo(e,t,n=!1){const s=e.children,r=t.children;if(k(s)&&k(r))for(let i=0;i>1,e[n[l]]0&&(t[s]=n[i-1]),n[i]=s)}}for(i=n.length,o=n[i-1];i-- >0;)n[i]=o,o=t[o];return n}function co(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:co(t)}function Tr(e){if(e)for(let t=0;tSt(Ec);function ao(e,t){return zn(e,null,t)}function Hf(e,t){return zn(e,null,{flush:"post"})}function Le(e,t,n){return zn(e,t,n)}function zn(e,t,n=ne){const{immediate:s,deep:r,flush:i,once:o}=n,l=de({},n),c=t&&s||!t&&i!=="post";let f;if(nn){if(i==="sync"){const v=Cc();f=v.__watcherHandles||(v.__watcherHandles=[])}else if(!c){const v=()=>{};return v.stop=Ke,v.resume=Ke,v.pause=Ke,v}}const a=ue;l.call=(v,R,L)=>je(v,a,R,L);let h=!1;i==="post"?l.scheduler=v=>{Ce(v,a&&a.suspense)}:i!=="sync"&&(h=!0,l.scheduler=(v,R)=>{R?v():Qs(v)}),l.augmentJob=v=>{t&&(v.flags|=4),h&&(v.flags|=2,a&&(v.id=a.uid,v.i=a))};const y=Hl(e,t,l);return nn&&(f?f.push(y):c&&y()),y}function Ac(e,t,n){const s=this.proxy,r=le(e)?e.includes(".")?fo(s,e):()=>s[e]:e.bind(s,s);let i;X(t)?i=t:(i=t.handler,n=t);const o=fn(this),l=zn(r,i.bind(s),n);return o(),l}function fo(e,t){const n=t.split(".");return()=>{let s=e;for(let r=0;rt==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${De(t)}Modifiers`]||e[`${ft(t)}Modifiers`];function Oc(e,t,...n){if(e.isUnmounted)return;const s=e.vnode.props||ne;let r=n;const i=t.startsWith("update:"),o=i&&Rc(s,t.slice(7));o&&(o.trim&&(r=n.map(a=>le(a)?a.trim():a)),o.number&&(r=n.map(Mn)));let l,c=s[l=Tn(t)]||s[l=Tn(De(t))];!c&&i&&(c=s[l=Tn(ft(t))]),c&&je(c,e,6,r);const f=s[l+"Once"];if(f){if(!e.emitted)e.emitted={};else if(e.emitted[l])return;e.emitted[l]=!0,je(f,e,6,r)}}function uo(e,t,n=!1){const s=t.emitsCache,r=s.get(e);if(r!==void 0)return r;const i=e.emits;let o={},l=!1;if(!X(e)){const c=f=>{const a=uo(f,t,!0);a&&(l=!0,de(o,a))};!n&&t.mixins.length&&t.mixins.forEach(c),e.extends&&c(e.extends),e.mixins&&e.mixins.forEach(c)}return!i&&!l?(te(e)&&s.set(e,null),null):(k(i)?i.forEach(c=>o[c]=null):de(o,i),te(e)&&s.set(e,o),o)}function Qn(e,t){return!e||!rn(t)?!1:(t=t.slice(2).replace(/Once$/,""),Z(e,t[0].toLowerCase()+t.slice(1))||Z(e,ft(t))||Z(e,t))}function us(e){const{type:t,vnode:n,proxy:s,withProxy:r,propsOptions:[i],slots:o,attrs:l,emit:c,render:f,renderCache:a,props:h,data:y,setupState:v,ctx:R,inheritAttrs:L}=e,q=Fn(e);let F,B;try{if(n.shapeFlag&4){const g=r||s,O=g;F=Me(f.call(O,g,a,h,v,y,R)),B=l}else{const g=t;F=Me(g.length>1?g(h,{attrs:l,slots:o,emit:c}):g(h,null)),B=t.props?l:Mc(l)}}catch(g){Xt.length=0,Gn(g,e,1),F=ge(pe)}let p=F;if(B&&L!==!1){const g=Object.keys(B),{shapeFlag:O}=p;g.length&&O&7&&(i&&g.some(ks)&&(B=Ic(B,i)),p=ct(p,B,!1,!0))}return n.dirs&&(p=ct(p,null,!1,!0),p.dirs=p.dirs?p.dirs.concat(n.dirs):n.dirs),n.transition&&Qt(p,n.transition),F=p,Fn(q),F}const Mc=e=>{let t;for(const n in e)(n==="class"||n==="style"||rn(n))&&((t||(t={}))[n]=e[n]);return t},Ic=(e,t)=>{const n={};for(const s in e)(!ks(s)||!(s.slice(9)in t))&&(n[s]=e[s]);return n};function Pc(e,t,n){const{props:s,children:r,component:i}=e,{props:o,children:l,patchFlag:c}=t,f=i.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&c>=0){if(c&1024)return!0;if(c&16)return s?Er(s,o,f):!!o;if(c&8){const a=t.dynamicProps;for(let h=0;he.__isSuspense;function go(e,t){t&&t.pendingBranch?k(e)?t.effects.push(...e):t.effects.push(e):Vl(e)}const Se=Symbol.for("v-fgt"),xt=Symbol.for("v-txt"),pe=Symbol.for("v-cmt"),Gt=Symbol.for("v-stc"),Xt=[];let Ae=null;function Ls(e=!1){Xt.push(Ae=e?null:[])}function Lc(){Xt.pop(),Ae=Xt[Xt.length-1]||null}let en=1;function Cr(e,t=!1){en+=e,e<0&&Ae&&t&&(Ae.hasOnce=!0)}function mo(e){return e.dynamicChildren=en>0?Ae||It:null,Lc(),en>0&&Ae&&Ae.push(e),e}function $f(e,t,n,s,r,i){return mo(vo(e,t,n,s,r,i,!0))}function Ns(e,t,n,s,r){return mo(ge(e,t,n,s,r,!0))}function tn(e){return e?e.__v_isVNode===!0:!1}function mt(e,t){return e.type===t.type&&e.key===t.key}const yo=({key:e})=>e??null,An=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?le(e)||fe(e)||X(e)?{i:ae,r:e,k:t,f:!!n}:e:null);function vo(e,t=null,n=null,s=0,r=null,i=e===Se?0:1,o=!1,l=!1){const c={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&yo(t),ref:t&&An(t),scopeId:Li,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:i,patchFlag:s,dynamicProps:r,dynamicChildren:null,appContext:null,ctx:ae};return l?(tr(c,n),i&128&&e.normalize(c)):n&&(c.shapeFlag|=le(n)?8:16),en>0&&!o&&Ae&&(c.patchFlag>0||i&6)&&c.patchFlag!==32&&Ae.push(c),c}const ge=Nc;function Nc(e,t=null,n=null,s=0,r=null,i=!1){if((!e||e===Bi)&&(e=pe),tn(e)){const l=ct(e,t,!0);return n&&tr(l,n),en>0&&!i&&Ae&&(l.shapeFlag&6?Ae[Ae.indexOf(e)]=l:Ae.push(l)),l.patchFlag=-2,l}if(Kc(e)&&(e=e.__vccOpts),t){t=Dc(t);let{class:l,style:c}=t;l&&!le(l)&&(t.class=Bs(l)),te(c)&&(Js(c)&&!k(c)&&(c=de({},c)),t.style=Ks(c))}const o=le(e)?1:po(e)?128:Ni(e)?64:te(e)?4:X(e)?2:0;return vo(e,t,n,s,r,o,i,!0)}function Dc(e){return e?Js(e)||eo(e)?de({},e):e:null}function ct(e,t,n=!1,s=!1){const{props:r,ref:i,patchFlag:o,children:l,transition:c}=e,f=t?Fc(r||{},t):r,a={__v_isVNode:!0,__v_skip:!0,type:e.type,props:f,key:f&&yo(f),ref:t&&t.ref?n&&i?k(i)?i.concat(An(t)):[i,An(t)]:An(t):i,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:l,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Se?o===-1?16:o|16:o,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:c,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&ct(e.ssContent),ssFallback:e.ssFallback&&ct(e.ssFallback),el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return c&&s&&Qt(a,c.clone(a)),a}function _o(e=" ",t=0){return ge(xt,null,e,t)}function jf(e,t){const n=ge(Gt,null,e);return n.staticCount=t,n}function Vf(e="",t=!1){return t?(Ls(),Ns(pe,null,e)):ge(pe,null,e)}function Me(e){return e==null||typeof e=="boolean"?ge(pe):k(e)?ge(Se,null,e.slice()):tn(e)?it(e):ge(xt,null,String(e))}function it(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:ct(e)}function tr(e,t){let n=0;const{shapeFlag:s}=e;if(t==null)t=null;else if(k(t))n=16;else if(typeof t=="object")if(s&65){const r=t.default;r&&(r._c&&(r._d=!1),tr(e,r()),r._c&&(r._d=!0));return}else{n=32;const r=t._;!r&&!eo(t)?t._ctx=ae:r===3&&ae&&(ae.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else X(t)?(t={default:t,_ctx:ae},n=32):(t=String(t),s&64?(n=16,t=[_o(t)]):n=8);e.children=t,e.shapeFlag|=n}function Fc(...e){const t={};for(let n=0;nue||ae;let $n,Ds;{const e=kn(),t=(n,s)=>{let r;return(r=e[n])||(r=e[n]=[]),r.push(s),i=>{r.length>1?r.forEach(o=>o(i)):r[0](i)}};$n=t("__VUE_INSTANCE_SETTERS__",n=>ue=n),Ds=t("__VUE_SSR_SETTERS__",n=>nn=n)}const fn=e=>{const t=ue;return $n(e),e.scope.on(),()=>{e.scope.off(),$n(t)}},Ar=()=>{ue&&ue.scope.off(),$n(null)};function bo(e){return e.vnode.shapeFlag&4}let nn=!1;function Vc(e,t=!1,n=!1){t&&Ds(t);const{props:s,children:r}=e.vnode,i=bo(e);mc(e,s,i,t),bc(e,r,n||t);const o=i?kc(e,t):void 0;return t&&Ds(!1),o}function kc(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,oc);const{setup:s}=n;if(s){ze();const r=e.setupContext=s.length>1?So(e):null,i=fn(e),o=ln(s,e,0,[e.props,r]),l=ri(o);if(Qe(),i(),(l||e.sp)&&!bt(e)&&ki(e),l){if(o.then(Ar,Ar),t)return o.then(c=>{Rr(e,c)}).catch(c=>{Gn(c,e,0)});e.asyncDep=o}else Rr(e,o)}else wo(e)}function Rr(e,t,n){X(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:te(t)&&(e.setupState=Oi(t)),wo(e)}function wo(e,t,n){const s=e.type;e.render||(e.render=s.render||Ke);{const r=fn(e);ze();try{cc(e)}finally{Qe(),r()}}}const Uc={get(e,t){return _e(e,"get",""),e[t]}};function So(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,Uc),slots:e.slots,emit:e.emit,expose:t}}function Zn(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(Oi(Cn(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in qt)return qt[n](e)},has(t,n){return n in t||n in qt}})):e.proxy}function Wc(e,t=!0){return X(e)?e.displayName||e.name:e.name||t&&e.__name}function Kc(e){return X(e)&&"__vccOpts"in e}const ie=(e,t)=>Dl(e,t,nn);function Fs(e,t,n){const s=arguments.length;return s===2?te(t)&&!k(t)?tn(t)?ge(e,null,[t]):ge(e,t):ge(e,null,t):(s>3?n=Array.prototype.slice.call(arguments,2):s===3&&tn(n)&&(n=[n]),ge(e,t,n))}const Bc="3.5.16";/** +* @vue/runtime-dom v3.5.16 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/let Hs;const Or=typeof window<"u"&&window.trustedTypes;if(Or)try{Hs=Or.createPolicy("vue",{createHTML:e=>e})}catch{}const xo=Hs?e=>Hs.createHTML(e):e=>e,qc="http://www.w3.org/2000/svg",Gc="http://www.w3.org/1998/Math/MathML",Ge=typeof document<"u"?document:null,Mr=Ge&&Ge.createElement("template"),Xc={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,s)=>{const r=t==="svg"?Ge.createElementNS(qc,e):t==="mathml"?Ge.createElementNS(Gc,e):n?Ge.createElement(e,{is:n}):Ge.createElement(e);return e==="select"&&s&&s.multiple!=null&&r.setAttribute("multiple",s.multiple),r},createText:e=>Ge.createTextNode(e),createComment:e=>Ge.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Ge.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,s,r,i){const o=n?n.previousSibling:t.lastChild;if(r&&(r===i||r.nextSibling))for(;t.insertBefore(r.cloneNode(!0),n),!(r===i||!(r=r.nextSibling)););else{Mr.innerHTML=xo(s==="svg"?`${e}`:s==="mathml"?`${e}`:e);const l=Mr.content;if(s==="svg"||s==="mathml"){const c=l.firstChild;for(;c.firstChild;)l.appendChild(c.firstChild);l.removeChild(c)}t.insertBefore(l,n)}return[o?o.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},nt="transition",Ut="animation",sn=Symbol("_vtc"),To={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},Yc=de({},Di,To),Jc=e=>(e.displayName="Transition",e.props=Yc,e),kf=Jc((e,{slots:t})=>Fs(Bl,zc(e),t)),ht=(e,t=[])=>{k(e)?e.forEach(n=>n(...t)):e&&e(...t)},Ir=e=>e?k(e)?e.some(t=>t.length>1):e.length>1:!1;function zc(e){const t={};for(const w in e)w in To||(t[w]=e[w]);if(e.css===!1)return t;const{name:n="v",type:s,duration:r,enterFromClass:i=`${n}-enter-from`,enterActiveClass:o=`${n}-enter-active`,enterToClass:l=`${n}-enter-to`,appearFromClass:c=i,appearActiveClass:f=o,appearToClass:a=l,leaveFromClass:h=`${n}-leave-from`,leaveActiveClass:y=`${n}-leave-active`,leaveToClass:v=`${n}-leave-to`}=e,R=Qc(r),L=R&&R[0],q=R&&R[1],{onBeforeEnter:F,onEnter:B,onEnterCancelled:p,onLeave:g,onLeaveCancelled:O,onBeforeAppear:U=F,onAppear:C=B,onAppearCancelled:K=p}=t,T=(w,H,N,J)=>{w._enterCancelled=J,pt(w,H?a:l),pt(w,H?f:o),N&&N()},M=(w,H)=>{w._isLeaving=!1,pt(w,h),pt(w,v),pt(w,y),H&&H()},V=w=>(H,N)=>{const J=w?C:B,D=()=>T(H,w,N);ht(J,[H,D]),Pr(()=>{pt(H,w?c:i),qe(H,w?a:l),Ir(J)||Lr(H,s,L,D)})};return de(t,{onBeforeEnter(w){ht(F,[w]),qe(w,i),qe(w,o)},onBeforeAppear(w){ht(U,[w]),qe(w,c),qe(w,f)},onEnter:V(!1),onAppear:V(!0),onLeave(w,H){w._isLeaving=!0;const N=()=>M(w,H);qe(w,h),w._enterCancelled?(qe(w,y),Fr()):(Fr(),qe(w,y)),Pr(()=>{w._isLeaving&&(pt(w,h),qe(w,v),Ir(g)||Lr(w,s,q,N))}),ht(g,[w,N])},onEnterCancelled(w){T(w,!1,void 0,!0),ht(p,[w])},onAppearCancelled(w){T(w,!0,void 0,!0),ht(K,[w])},onLeaveCancelled(w){M(w),ht(O,[w])}})}function Qc(e){if(e==null)return null;if(te(e))return[ds(e.enter),ds(e.leave)];{const t=ds(e);return[t,t]}}function ds(e){return Yo(e)}function qe(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[sn]||(e[sn]=new Set)).add(t)}function pt(e,t){t.split(/\s+/).forEach(s=>s&&e.classList.remove(s));const n=e[sn];n&&(n.delete(t),n.size||(e[sn]=void 0))}function Pr(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let Zc=0;function Lr(e,t,n,s){const r=e._endId=++Zc,i=()=>{r===e._endId&&s()};if(n!=null)return setTimeout(i,n);const{type:o,timeout:l,propCount:c}=ea(e,t);if(!o)return s();const f=o+"end";let a=0;const h=()=>{e.removeEventListener(f,y),i()},y=v=>{v.target===e&&++a>=c&&h()};setTimeout(()=>{a(n[R]||"").split(", "),r=s(`${nt}Delay`),i=s(`${nt}Duration`),o=Nr(r,i),l=s(`${Ut}Delay`),c=s(`${Ut}Duration`),f=Nr(l,c);let a=null,h=0,y=0;t===nt?o>0&&(a=nt,h=o,y=i.length):t===Ut?f>0&&(a=Ut,h=f,y=c.length):(h=Math.max(o,f),a=h>0?o>f?nt:Ut:null,y=a?a===nt?i.length:c.length:0);const v=a===nt&&/\b(transform|all)(,|$)/.test(s(`${nt}Property`).toString());return{type:a,timeout:h,propCount:y,hasTransform:v}}function Nr(e,t){for(;e.lengthDr(n)+Dr(e[s])))}function Dr(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function Fr(){return document.body.offsetHeight}function ta(e,t,n){const s=e[sn];s&&(t=(t?[t,...s]:[...s]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const Hr=Symbol("_vod"),na=Symbol("_vsh"),sa=Symbol(""),ra=/(^|;)\s*display\s*:/;function ia(e,t,n){const s=e.style,r=le(n);let i=!1;if(n&&!r){if(t)if(le(t))for(const o of t.split(";")){const l=o.slice(0,o.indexOf(":")).trim();n[l]==null&&Rn(s,l,"")}else for(const o in t)n[o]==null&&Rn(s,o,"");for(const o in n)o==="display"&&(i=!0),Rn(s,o,n[o])}else if(r){if(t!==n){const o=s[sa];o&&(n+=";"+o),s.cssText=n,i=ra.test(n)}}else t&&e.removeAttribute("style");Hr in e&&(e[Hr]=i?s.display:"",e[na]&&(s.display="none"))}const $r=/\s*!important$/;function Rn(e,t,n){if(k(n))n.forEach(s=>Rn(e,t,s));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const s=oa(e,t);$r.test(n)?e.setProperty(ft(s),n.replace($r,""),"important"):e[s]=n}}const jr=["Webkit","Moz","ms"],hs={};function oa(e,t){const n=hs[t];if(n)return n;let s=De(t);if(s!=="filter"&&s in e)return hs[t]=s;s=Vn(s);for(let r=0;rps||(fa.then(()=>ps=0),ps=Date.now());function da(e,t){const n=s=>{if(!s._vts)s._vts=Date.now();else if(s._vts<=n.attached)return;je(ha(s,n.value),t,5,[s])};return n.value=e,n.attached=ua(),n}function ha(e,t){if(k(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(s=>r=>!r._stopped&&s&&s(r))}else return t}const Br=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,pa=(e,t,n,s,r,i)=>{const o=r==="svg";t==="class"?ta(e,s,o):t==="style"?ia(e,n,s):rn(t)?ks(t)||ca(e,t,n,s,i):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):ga(e,t,s,o))?(Ur(e,t,s),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&kr(e,t,s,o,i,t!=="value")):e._isVueCE&&(/[A-Z]/.test(t)||!le(s))?Ur(e,De(t),s,i,t):(t==="true-value"?e._trueValue=s:t==="false-value"&&(e._falseValue=s),kr(e,t,s,o))};function ga(e,t,n,s){if(s)return!!(t==="innerHTML"||t==="textContent"||t in e&&Br(t)&&X(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const r=e.tagName;if(r==="IMG"||r==="VIDEO"||r==="CANVAS"||r==="SOURCE")return!1}return Br(t)&&le(n)?!1:t in e}const at=e=>{const t=e.props["onUpdate:modelValue"]||!1;return k(t)?n=>En(t,n):t};function ma(e){e.target.composing=!0}function qr(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Ne=Symbol("_assign"),Uf={created(e,{modifiers:{lazy:t,trim:n,number:s}},r){e[Ne]=at(r);const i=s||r.props&&r.props.type==="number";Je(e,t?"change":"input",o=>{if(o.target.composing)return;let l=e.value;n&&(l=l.trim()),i&&(l=Mn(l)),e[Ne](l)}),n&&Je(e,"change",()=>{e.value=e.value.trim()}),t||(Je(e,"compositionstart",ma),Je(e,"compositionend",qr),Je(e,"change",qr))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:s,trim:r,number:i}},o){if(e[Ne]=at(o),e.composing)return;const l=(i||e.type==="number")&&!/^0\d/.test(e.value)?Mn(e.value):e.value,c=t??"";l!==c&&(document.activeElement===e&&e.type!=="range"&&(s&&t===n||r&&e.value.trim()===c)||(e.value=c))}},Wf={deep:!0,created(e,t,n){e[Ne]=at(n),Je(e,"change",()=>{const s=e._modelValue,r=Ft(e),i=e.checked,o=e[Ne];if(k(s)){const l=qs(s,r),c=l!==-1;if(i&&!c)o(s.concat(r));else if(!i&&c){const f=[...s];f.splice(l,1),o(f)}}else if(Ht(s)){const l=new Set(s);i?l.add(r):l.delete(r),o(l)}else o(Eo(e,i))})},mounted:Gr,beforeUpdate(e,t,n){e[Ne]=at(n),Gr(e,t,n)}};function Gr(e,{value:t,oldValue:n},s){e._modelValue=t;let r;if(k(t))r=qs(t,s.props.value)>-1;else if(Ht(t))r=t.has(s.props.value);else{if(t===n)return;r=Et(t,Eo(e,!0))}e.checked!==r&&(e.checked=r)}const Kf={created(e,{value:t},n){e.checked=Et(t,n.props.value),e[Ne]=at(n),Je(e,"change",()=>{e[Ne](Ft(e))})},beforeUpdate(e,{value:t,oldValue:n},s){e[Ne]=at(s),t!==n&&(e.checked=Et(t,s.props.value))}},Bf={deep:!0,created(e,{value:t,modifiers:{number:n}},s){const r=Ht(t);Je(e,"change",()=>{const i=Array.prototype.filter.call(e.options,o=>o.selected).map(o=>n?Mn(Ft(o)):Ft(o));e[Ne](e.multiple?r?new Set(i):i:i[0]),e._assigning=!0,cn(()=>{e._assigning=!1})}),e[Ne]=at(s)},mounted(e,{value:t}){Xr(e,t)},beforeUpdate(e,t,n){e[Ne]=at(n)},updated(e,{value:t}){e._assigning||Xr(e,t)}};function Xr(e,t){const n=e.multiple,s=k(t);if(!(n&&!s&&!Ht(t))){for(let r=0,i=e.options.length;rString(f)===String(l)):o.selected=qs(t,l)>-1}else o.selected=t.has(l);else if(Et(Ft(o),t)){e.selectedIndex!==r&&(e.selectedIndex=r);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function Ft(e){return"_value"in e?e._value:e.value}function Eo(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const ya=["ctrl","shift","alt","meta"],va={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>ya.some(n=>e[`${n}Key`]&&!t.includes(n))},qf=(e,t)=>{const n=e._withMods||(e._withMods={}),s=t.join(".");return n[s]||(n[s]=(r,...i)=>{for(let o=0;o{const n=e._withKeys||(e._withKeys={}),s=t.join(".");return n[s]||(n[s]=r=>{if(!("key"in r))return;const i=ft(r.key);if(t.some(o=>o===i||_a[o]===i))return e(r)})},ba=de({patchProp:pa},Xc);let gs,Yr=!1;function wa(){return gs=Yr?gs:Sc(ba),Yr=!0,gs}const Xf=(...e)=>{const t=wa().createApp(...e),{mount:n}=t;return t.mount=s=>{const r=xa(s);if(r)return n(r,!0,Sa(r))},t};function Sa(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function xa(e){return le(e)?document.querySelector(e):e}const Yf=(e,t)=>{const n=e.__vccOpts||e;for(const[s,r]of t)n[s]=r;return n},Ta=window.__VP_SITE_DATA__;function Co(e){return ui()?(il(e),!0):!1}const ms=new WeakMap,Ea=(...e)=>{var t;const n=e[0],s=(t=an())==null?void 0:t.proxy;if(s==null&&!zi())throw new Error("injectLocal must be called in setup");return s&&ms.has(s)&&n in ms.get(s)?ms.get(s)[n]:St(...e)},Ao=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Ca=Object.prototype.toString,Aa=e=>Ca.call(e)==="[object Object]",Ct=()=>{},Jr=Ra();function Ra(){var e,t;return Ao&&((e=window==null?void 0:window.navigator)==null?void 0:e.userAgent)&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||((t=window==null?void 0:window.navigator)==null?void 0:t.maxTouchPoints)>2&&/iPad|Macintosh/.test(window==null?void 0:window.navigator.userAgent))}function nr(...e){if(e.length!==1)return Pl(...e);const t=e[0];return typeof t=="function"?Bn(Ol(()=>({get:t,set:Ct}))):_t(t)}function sr(e,t){function n(...s){return new Promise((r,i)=>{Promise.resolve(e(()=>t.apply(this,s),{fn:t,thisArg:this,args:s})).then(r).catch(i)})}return n}const Ro=e=>e();function Oa(e,t={}){let n,s,r=Ct;const i=c=>{clearTimeout(c),r(),r=Ct};let o;return c=>{const f=ce(e),a=ce(t.maxWait);return n&&i(n),f<=0||a!==void 0&&a<=0?(s&&(i(s),s=null),Promise.resolve(c())):new Promise((h,y)=>{r=t.rejectOnCancel?y:h,o=c,a&&!s&&(s=setTimeout(()=>{n&&i(n),s=null,h(o())},a)),n=setTimeout(()=>{s&&i(s),s=null,h(c())},f)})}}function Ma(...e){let t=0,n,s=!0,r=Ct,i,o,l,c,f;!fe(e[0])&&typeof e[0]=="object"?{delay:o,trailing:l=!0,leading:c=!0,rejectOnCancel:f=!1}=e[0]:[o,l=!0,c=!0,f=!1]=e;const a=()=>{n&&(clearTimeout(n),n=void 0,r(),r=Ct)};return y=>{const v=ce(o),R=Date.now()-t,L=()=>i=y();return a(),v<=0?(t=Date.now(),L()):(R>v&&(c||!s)?(t=Date.now(),L()):l&&(i=new Promise((q,F)=>{r=f?F:q,n=setTimeout(()=>{t=Date.now(),s=!0,q(L()),a()},Math.max(0,v-R))})),!c&&!n&&(n=setTimeout(()=>s=!0,v)),s=!1,i)}}function Ia(e=Ro,t={}){const{initialState:n="active"}=t,s=nr(n==="active");function r(){s.value=!1}function i(){s.value=!0}const o=(...l)=>{s.value&&e(...l)};return{isActive:Bn(s),pause:r,resume:i,eventFilter:o}}function zr(e){return e.endsWith("rem")?Number.parseFloat(e)*16:Number.parseFloat(e)}function ys(e){return Array.isArray(e)?e:[e]}function Oo(e){return an()}function Pa(e,t=200,n={}){return sr(Oa(t,n),e)}function La(e,t=200,n=!1,s=!0,r=!1){return sr(Ma(t,n,s,r),e)}function Na(e,t,n={}){const{eventFilter:s=Ro,...r}=n;return Le(e,sr(s,t),r)}function Da(e,t,n={}){const{eventFilter:s,initialState:r="active",...i}=n,{eventFilter:o,pause:l,resume:c,isActive:f}=Ia(s,{initialState:r});return{stop:Na(e,t,{...i,eventFilter:o}),pause:l,resume:c,isActive:f}}function es(e,t=!0,n){Oo()?$t(e,n):t?e():cn(e)}function Fa(e,t){Oo()&&Jn(e,t)}function Ha(e,t,n){return Le(e,t,{...n,immediate:!0})}const Ze=Ao?window:void 0;function rr(e){var t;const n=ce(e);return(t=n==null?void 0:n.$el)!=null?t:n}function et(...e){const t=[],n=()=>{t.forEach(l=>l()),t.length=0},s=(l,c,f,a)=>(l.addEventListener(c,f,a),()=>l.removeEventListener(c,f,a)),r=ie(()=>{const l=ys(ce(e[0])).filter(c=>c!=null);return l.every(c=>typeof c!="string")?l:void 0}),i=Ha(()=>{var l,c;return[(c=(l=r.value)==null?void 0:l.map(f=>rr(f)))!=null?c:[Ze].filter(f=>f!=null),ys(ce(r.value?e[1]:e[0])),ys(zs(r.value?e[2]:e[1])),ce(r.value?e[3]:e[2])]},([l,c,f,a])=>{if(n(),!(l!=null&&l.length)||!(c!=null&&c.length)||!(f!=null&&f.length))return;const h=Aa(a)?{...a}:a;t.push(...l.flatMap(y=>c.flatMap(v=>f.map(R=>s(y,v,R,h)))))},{flush:"post"}),o=()=>{i(),n()};return Co(n),o}function $a(){const e=Pe(!1),t=an();return t&&$t(()=>{e.value=!0},t),e}function ja(e){const t=$a();return ie(()=>(t.value,!!e()))}function Va(e){return typeof e=="function"?e:typeof e=="string"?t=>t.key===e:Array.isArray(e)?t=>e.includes(t.key):()=>!0}function Jf(...e){let t,n,s={};e.length===3?(t=e[0],n=e[1],s=e[2]):e.length===2?typeof e[1]=="object"?(t=!0,n=e[0],s=e[1]):(t=e[0],n=e[1]):(t=!0,n=e[0]);const{target:r=Ze,eventName:i="keydown",passive:o=!1,dedupe:l=!1}=s,c=Va(t);return et(r,i,a=>{a.repeat&&ce(l)||c(a)&&n(a)},o)}const ka=Symbol("vueuse-ssr-width");function Ua(){const e=zi()?Ea(ka,null):null;return typeof e=="number"?e:void 0}function Mo(e,t={}){const{window:n=Ze,ssrWidth:s=Ua()}=t,r=ja(()=>n&&"matchMedia"in n&&typeof n.matchMedia=="function"),i=Pe(typeof s=="number"),o=Pe(),l=Pe(!1),c=f=>{l.value=f.matches};return ao(()=>{if(i.value){i.value=!r.value;const f=ce(e).split(",");l.value=f.some(a=>{const h=a.includes("not all"),y=a.match(/\(\s*min-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/),v=a.match(/\(\s*max-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/);let R=!!(y||v);return y&&R&&(R=s>=zr(y[1])),v&&R&&(R=s<=zr(v[1])),h?!R:R});return}r.value&&(o.value=n.matchMedia(ce(e)),l.value=o.value.matches)}),et(o,"change",c,{passive:!0}),ie(()=>l.value)}const bn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},wn="__vueuse_ssr_handlers__",Wa=Ka();function Ka(){return wn in bn||(bn[wn]=bn[wn]||{}),bn[wn]}function Io(e,t){return Wa[e]||t}function Po(e){return Mo("(prefers-color-scheme: dark)",e)}function Ba(e){return e==null?"any":e instanceof Set?"set":e instanceof Map?"map":e instanceof Date?"date":typeof e=="boolean"?"boolean":typeof e=="string"?"string":typeof e=="object"?"object":Number.isNaN(e)?"any":"number"}const qa={boolean:{read:e=>e==="true",write:e=>String(e)},object:{read:e=>JSON.parse(e),write:e=>JSON.stringify(e)},number:{read:e=>Number.parseFloat(e),write:e=>String(e)},any:{read:e=>e,write:e=>String(e)},string:{read:e=>e,write:e=>String(e)},map:{read:e=>new Map(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e.entries()))},set:{read:e=>new Set(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e))},date:{read:e=>new Date(e),write:e=>e.toISOString()}},Qr="vueuse-storage";function Ga(e,t,n,s={}){var r;const{flush:i="pre",deep:o=!0,listenToStorageChanges:l=!0,writeDefaults:c=!0,mergeDefaults:f=!1,shallow:a,window:h=Ze,eventFilter:y,onError:v=N=>{console.error(N)},initOnMounted:R}=s,L=(a?Pe:_t)(typeof t=="function"?t():t),q=ie(()=>ce(e));if(!n)try{n=Io("getDefaultStorage",()=>{var N;return(N=Ze)==null?void 0:N.localStorage})()}catch(N){v(N)}if(!n)return L;const F=ce(t),B=Ba(F),p=(r=s.serializer)!=null?r:qa[B],{pause:g,resume:O}=Da(L,()=>M(L.value),{flush:i,deep:o,eventFilter:y});Le(q,()=>w(),{flush:i});let U=!1;const C=N=>{R&&!U||w(N)},K=N=>{R&&!U||H(N)};h&&l&&(n instanceof Storage?et(h,"storage",C,{passive:!0}):et(h,Qr,K)),R?es(()=>{U=!0,w()}):w();function T(N,J){if(h){const D={key:q.value,oldValue:N,newValue:J,storageArea:n};h.dispatchEvent(n instanceof Storage?new StorageEvent("storage",D):new CustomEvent(Qr,{detail:D}))}}function M(N){try{const J=n.getItem(q.value);if(N==null)T(J,null),n.removeItem(q.value);else{const D=p.write(N);J!==D&&(n.setItem(q.value,D),T(J,D))}}catch(J){v(J)}}function V(N){const J=N?N.newValue:n.getItem(q.value);if(J==null)return c&&F!=null&&n.setItem(q.value,p.write(F)),F;if(!N&&f){const D=p.read(J);return typeof f=="function"?f(D,F):B==="object"&&!Array.isArray(D)?{...F,...D}:D}else return typeof J!="string"?J:p.read(J)}function w(N){if(!(N&&N.storageArea!==n)){if(N&&N.key==null){L.value=F;return}if(!(N&&N.key!==q.value)){g();try{(N==null?void 0:N.newValue)!==p.write(L.value)&&(L.value=V(N))}catch(J){v(J)}finally{N?cn(O):O()}}}}function H(N){w(N.detail)}return L}const Xa="*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}";function Ya(e={}){const{selector:t="html",attribute:n="class",initialValue:s="auto",window:r=Ze,storage:i,storageKey:o="vueuse-color-scheme",listenToStorageChanges:l=!0,storageRef:c,emitAuto:f,disableTransition:a=!0}=e,h={auto:"",light:"light",dark:"dark",...e.modes||{}},y=Po({window:r}),v=ie(()=>y.value?"dark":"light"),R=c||(o==null?nr(s):Ga(o,s,i,{window:r,listenToStorageChanges:l})),L=ie(()=>R.value==="auto"?v.value:R.value),q=Io("updateHTMLAttrs",(g,O,U)=>{const C=typeof g=="string"?r==null?void 0:r.document.querySelector(g):rr(g);if(!C)return;const K=new Set,T=new Set;let M=null;if(O==="class"){const w=U.split(/\s/g);Object.values(h).flatMap(H=>(H||"").split(/\s/g)).filter(Boolean).forEach(H=>{w.includes(H)?K.add(H):T.add(H)})}else M={key:O,value:U};if(K.size===0&&T.size===0&&M===null)return;let V;a&&(V=r.document.createElement("style"),V.appendChild(document.createTextNode(Xa)),r.document.head.appendChild(V));for(const w of K)C.classList.add(w);for(const w of T)C.classList.remove(w);M&&C.setAttribute(M.key,M.value),a&&(r.getComputedStyle(V).opacity,document.head.removeChild(V))});function F(g){var O;q(t,n,(O=h[g])!=null?O:g)}function B(g){e.onChanged?e.onChanged(g,F):F(g)}Le(L,B,{flush:"post",immediate:!0}),es(()=>B(L.value));const p=ie({get(){return f?R.value:L.value},set(g){R.value=g}});return Object.assign(p,{store:R,system:v,state:L})}function Ja(e={}){const{valueDark:t="dark",valueLight:n=""}=e,s=Ya({...e,onChanged:(o,l)=>{var c;e.onChanged?(c=e.onChanged)==null||c.call(e,o==="dark",l,o):l(o)},modes:{dark:t,light:n}}),r=ie(()=>s.system.value);return ie({get(){return s.value==="dark"},set(o){const l=o?"dark":"light";r.value===l?s.value="auto":s.value=l}})}function vs(e){return typeof Window<"u"&&e instanceof Window?e.document.documentElement:typeof Document<"u"&&e instanceof Document?e.documentElement:e}const Zr=1;function za(e,t={}){const{throttle:n=0,idle:s=200,onStop:r=Ct,onScroll:i=Ct,offset:o={left:0,right:0,top:0,bottom:0},eventListenerOptions:l={capture:!1,passive:!0},behavior:c="auto",window:f=Ze,onError:a=C=>{console.error(C)}}=t,h=Pe(0),y=Pe(0),v=ie({get(){return h.value},set(C){L(C,void 0)}}),R=ie({get(){return y.value},set(C){L(void 0,C)}});function L(C,K){var T,M,V,w;if(!f)return;const H=ce(e);if(!H)return;(V=H instanceof Document?f.document.body:H)==null||V.scrollTo({top:(T=ce(K))!=null?T:R.value,left:(M=ce(C))!=null?M:v.value,behavior:ce(c)});const N=((w=H==null?void 0:H.document)==null?void 0:w.documentElement)||(H==null?void 0:H.documentElement)||H;v!=null&&(h.value=N.scrollLeft),R!=null&&(y.value=N.scrollTop)}const q=Pe(!1),F=Dt({left:!0,right:!1,top:!0,bottom:!1}),B=Dt({left:!1,right:!1,top:!1,bottom:!1}),p=C=>{q.value&&(q.value=!1,B.left=!1,B.right=!1,B.top=!1,B.bottom=!1,r(C))},g=Pa(p,n+s),O=C=>{var K;if(!f)return;const T=((K=C==null?void 0:C.document)==null?void 0:K.documentElement)||(C==null?void 0:C.documentElement)||rr(C),{display:M,flexDirection:V,direction:w}=getComputedStyle(T),H=w==="rtl"?-1:1,N=T.scrollLeft;B.left=Nh.value;const J=Math.abs(N*H)<=(o.left||0),D=Math.abs(N*H)+T.clientWidth>=T.scrollWidth-(o.right||0)-Zr;M==="flex"&&V==="row-reverse"?(F.left=D,F.right=J):(F.left=J,F.right=D),h.value=N;let Y=T.scrollTop;C===f.document&&!Y&&(Y=f.document.body.scrollTop),B.top=Yy.value;const $=Math.abs(Y)<=(o.top||0),oe=Math.abs(Y)+T.clientHeight>=T.scrollHeight-(o.bottom||0)-Zr;M==="flex"&&V==="column-reverse"?(F.top=oe,F.bottom=$):(F.top=$,F.bottom=oe),y.value=Y},U=C=>{var K;if(!f)return;const T=(K=C.target.documentElement)!=null?K:C.target;O(T),q.value=!0,g(C),i(C)};return et(e,"scroll",n?La(U,n,!0,!1):U,l),es(()=>{try{const C=ce(e);if(!C)return;O(C)}catch(C){a(C)}}),et(e,"scrollend",p,l),{x:v,y:R,isScrolling:q,arrivedState:F,directions:B,measure(){const C=ce(e);f&&C&&O(C)}}}function Lo(e){const t=window.getComputedStyle(e);if(t.overflowX==="scroll"||t.overflowY==="scroll"||t.overflowX==="auto"&&e.clientWidth1?!0:(t.preventDefault&&t.preventDefault(),!1)}const _s=new WeakMap;function zf(e,t=!1){const n=Pe(t);let s=null,r="";Le(nr(e),l=>{const c=vs(ce(l));if(c){const f=c;if(_s.get(f)||_s.set(f,f.style.overflow),f.style.overflow!=="hidden"&&(r=f.style.overflow),f.style.overflow==="hidden")return n.value=!0;if(n.value)return f.style.overflow="hidden"}},{immediate:!0});const i=()=>{const l=vs(ce(e));!l||n.value||(Jr&&(s=et(l,"touchmove",c=>{Qa(c)},{passive:!1})),l.style.overflow="hidden",n.value=!0)},o=()=>{const l=vs(ce(e));!l||!n.value||(Jr&&(s==null||s()),l.style.overflow=r,_s.delete(l),n.value=!1)};return Co(o),ie({get(){return n.value},set(l){l?i():o()}})}function Qf(e={}){const{window:t=Ze,...n}=e;return za(t,n)}function Zf(e={}){const{window:t=Ze,initialWidth:n=Number.POSITIVE_INFINITY,initialHeight:s=Number.POSITIVE_INFINITY,listenOrientation:r=!0,includeScrollbar:i=!0,type:o="inner"}=e,l=Pe(n),c=Pe(s),f=()=>{if(t)if(o==="outer")l.value=t.outerWidth,c.value=t.outerHeight;else if(o==="visual"&&t.visualViewport){const{width:h,height:y,scale:v}=t.visualViewport;l.value=Math.round(h*v),c.value=Math.round(y*v)}else i?(l.value=t.innerWidth,c.value=t.innerHeight):(l.value=t.document.documentElement.clientWidth,c.value=t.document.documentElement.clientHeight)};f(),es(f);const a={passive:!0};if(et("resize",f,a),t&&o==="visual"&&t.visualViewport&&et(t.visualViewport,"resize",f,a),r){const h=Mo("(orientation: portrait)");Le(h,()=>f())}return{width:l,height:c}}const bs={};var ws={};const No=/^(?:[a-z]+:|\/\/)/i,Za="vitepress-theme-appearance",Do=Symbol("stack-view:unpack"),ef=/#.*$/,tf=/[?#].*$/,nf=/(?:(^|\/)index)?\.(?:md|html)$/,ve=typeof document<"u",Fo={relativePath:"404.md",filePath:"",title:"404",description:"Not Found",headers:[],frontmatter:{sidebar:!1,layout:"page"},lastUpdated:0,isNotFound:!0};function sf(e,t,n=!1){if(t===void 0)return!1;if(e=ei(`/${e}`),n)return new RegExp(t).test(e);if(ei(t)!==e)return!1;const s=t.match(ef);return s?(ve?location.hash:"")===s[0]:!0}function ei(e){return decodeURI(e).replace(tf,"").replace(nf,"$1")}function rf(e){return No.test(e)}function of(e,t){return Object.keys((e==null?void 0:e.locales)||{}).find(n=>n!=="root"&&!rf(n)&&sf(t,`^/${n}/`,!0))||"root"}function lf(e,t){const n=of(e,t),{label:s,link:r,...i}=e.locales[n]??{};Object.assign(i,{localeIndex:n});const o=df(e,t),l={head:$o(e.head??[],i.head??[],...o.map(c=>c.head??[]).reverse())};return ir(l,...o,i,e)}function Ho(e,t){const n=t.title||e.title,s=t.titleTemplate??e.titleTemplate;if(typeof s=="string"&&s.includes(":title"))return s.replace(/:title/g,n);const r=cf(e.title,s);return n===r.slice(3)?n:`${n}${r}`}function cf(e,t){return t===!1?"":t===!0||t===void 0?` | ${e}`:e===t?"":` | ${t}`}function $o(...e){const t=[],n=new Map;for(const s of e)for(const r of s){const[i,o]=r,l=Object.entries(o)[0];if(i!=="meta"||!l){t.push(r);continue}const c=`${l[0]}=${l[1]}`,f=n.get(c);f!=null?t[f]=r:(n.set(c,t.length),t.push(r))}return t}const af=/[\u0000-\u001F"#$&*+,:;<=>?[\]^`{|}\u007F]/g,ff=/^[a-z]:/i;function ti(e){const t=ff.exec(e),n=t?t[0]:"";return n+e.slice(n.length).replace(af,"_").replace(/(^|\/)_+(?=[^/]*$)/,"$1")}const Ss=new Set;function uf(e){if(Ss.size===0){const n=typeof process=="object"&&(ws==null?void 0:ws.VITE_EXTRA_EXTENSIONS)||(bs==null?void 0:bs.VITE_EXTRA_EXTENSIONS)||"";("3g2,3gp,aac,ai,apng,au,avif,bin,bmp,cer,class,conf,crl,css,csv,dll,doc,eps,epub,exe,gif,gz,ics,ief,jar,jpe,jpeg,jpg,js,json,jsonld,m4a,man,mid,midi,mjs,mov,mp2,mp3,mp4,mpe,mpeg,mpg,mpp,oga,ogg,ogv,ogx,opus,otf,p10,p7c,p7m,p7s,pdf,png,ps,qt,roff,rtf,rtx,ser,svg,t,tif,tiff,tr,ts,tsv,ttf,txt,vtt,wav,weba,webm,webp,woff,woff2,xhtml,xml,yaml,yml,zip"+(n&&typeof n=="string"?","+n:"")).split(",").forEach(s=>Ss.add(s))}const t=e.split(".").pop();return t==null||!Ss.has(t.toLowerCase())}function df({additionalConfig:e},t){if(e===void 0)return[];if(typeof e=="function")return e(t);const n=[],s=t.split("/").slice(0,-1);for(;s.length;){const r=`/${s.join("/")}/`;n.push(e[r]),s.pop()}return n.push(e["/"]),n.filter(r=>r!==void 0)}function ir(...e){const t=e.filter(r=>hf(r));if(t.length<=1)return e[0];const n=new Set(t.flatMap(r=>Reflect.ownKeys(r))),s=[...n];return new Proxy({},{get(r,i){return i===Do?t:ir(...t.map(o=>o[i]).filter(o=>o!==void 0))},set(){throw new Error("StackView is read-only and cannot be mutated.")},has(r,i){return n.has(i)},ownKeys(){return s},getOwnPropertyDescriptor(r,i){for(const o of t){const l=Object.getOwnPropertyDescriptor(o,i);if(l)return l}}})}ir.unpack=function(e){return e==null?void 0:e[Do]};function hf(e){return Object.prototype.toString.call(e)==="[object Object]"}const pf=Symbol(),Tt=Pe(Ta);function eu(e){const t=ie(()=>lf(Tt.value,e.data.relativePath)),n=t.value.appearance,s=n==="force-dark"?_t(!0):n==="force-auto"?Po():n?Ja({storageKey:Za,initialValue:()=>n==="dark"?"dark":"auto",...typeof n=="object"?n:{}}):_t(!1),r=_t(ve?location.hash:"");return ve&&window.addEventListener("hashchange",()=>{r.value=location.hash}),Le(()=>e.data,()=>{r.value=ve?location.hash:""}),{site:t,theme:ie(()=>t.value.themeConfig),page:ie(()=>e.data),frontmatter:ie(()=>e.data.frontmatter),params:ie(()=>e.data.params),lang:ie(()=>t.value.lang),dir:ie(()=>e.data.frontmatter.dir||t.value.dir),localeIndex:ie(()=>t.value.localeIndex||"root"),title:ie(()=>Ho(t.value,e.data)),description:ie(()=>e.data.description||t.value.description),isDark:s,hash:ie(()=>r.value)}}function gf(){const e=St(pf);if(!e)throw new Error("vitepress data not properly injected in app");return e}function mf(e,t){return`${e}${t}`.replace(/\/+/g,"/")}function ni(e){return No.test(e)||!e.startsWith("/")?e:mf(Tt.value.base,e)}function yf(e){let t=e.replace(/\.html$/,"");if(t=decodeURIComponent(t),t=t.replace(/\/$/,"/index"),ve){const n="/";t=ti(t.slice(n.length).replace(/\//g,"_")||"index")+".md";let s=__VP_HASH_MAP__[t.toLowerCase()];if(s||(t=t.endsWith("_index.md")?t.slice(0,-9)+".md":t.slice(0,-3)+"_index.md",s=__VP_HASH_MAP__[t.toLowerCase()]),!s)return null;t=`${n}assets/${t}.${s}.js`}else t=`./${ti(t.slice(1).replace(/\//g,"_"))}.md.js`;return t}let On=[];function tu(e){On.push(e),Fa(()=>{On=On.filter(t=>t!==e)})}function vf(){let e=Tt.value.scrollOffset,t=0,n=24;if(typeof e=="object"&&"padding"in e&&(n=e.padding,e=e.selector),typeof e=="number")t=e;else if(typeof e=="string")t=si(e,n);else if(Array.isArray(e))for(const s of e){const r=si(s,n);if(r){t=r;break}}return t}function si(e,t){const n=document.querySelector(e);if(!n)return 0;const s=n.getBoundingClientRect().bottom;return s<0?0:s+t}const _f=Symbol(),jo="http://a.com",bf=()=>({path:"/",hash:"",query:"",component:null,data:Fo});function nu(e,t){const n=Dt(bf()),s={route:n,async go(l,c){var f,a;l=js(l),await((f=s.onBeforeRouteChange)==null?void 0:f.call(s,l))!==!1&&((!ve||await Sf(l,c))&&await i(l),o(),await((a=s.onAfterRouteChange)==null?void 0:a.call(s,l)))}};let r=null;async function i(l,c=0,f=!1){var y,v;if(await((y=s.onBeforePageLoad)==null?void 0:y.call(s,l))===!1)return;const a=new URL(l,jo),h=r=a.pathname;try{let R=await e(h);if(!R)throw new Error(`Page not found: ${h}`);if(r===h){r=null;const{default:L,__pageData:q}=R;if(!L)throw new Error(`Invalid route component: ${L}`);await((v=s.onAfterPageLoad)==null?void 0:v.call(s,l)),n.path=ve?h:ni(h),n.component=Cn(L),n.data=Cn(q),o(a),ve&&cn(()=>{let F=Tt.value.base+q.relativePath.replace(/(?:(^|\/)index)?\.md$/,"$1");return!Tt.value.cleanUrls&&!F.endsWith("/")&&(F+=".html"),F!==a.pathname&&(a.pathname=F,l=F+a.search+a.hash,history.replaceState({},"",l)),$s(a.hash,!1,c)})}}catch(R){if(!/fetch|Page not found/.test(R.message)&&!/^\/404(\.html|\/)?$/.test(l)&&console.error(R),!f)try{const L=await fetch(Tt.value.base+"hashmap.json");window.__VP_HASH_MAP__=await L.json(),await i(l,c,!0);return}catch{}if(r===h){r=null,n.path=ve?h:ni(h),n.component=t?Cn(t):null;const L=ve?h.replace(/(^|\/)$/,"$1index").replace(/(\.html)?$/,".md").replace(/^\//,""):"404.md";n.data={...Fo,relativePath:L},o(a)}}}function o(l=ve?location:{search:"",hash:""}){n.query=l.search,n.hash=decodeURIComponent(l.hash)}return ve&&(history.state===null&&history.replaceState({},""),window.addEventListener("click",l=>{if(l.defaultPrevented||!(l.target instanceof Element)||l.target.closest("button")||l.button!==0||l.ctrlKey||l.shiftKey||l.altKey||l.metaKey)return;const c=l.target.closest("a");if(!c||c.closest(".vp-raw")||c.hasAttribute("download")||c.hasAttribute("target"))return;const f=c.getAttribute("href")??(c instanceof SVGAElement?c.getAttribute("xlink:href"):null);if(f==null)return;const{href:a,origin:h,pathname:y}=new URL(f,c.baseURI),v=new URL(location.href);h===v.origin&&uf(y)&&(l.preventDefault(),s.go(a,{smoothScroll:c.classList.contains("header-anchor")}))},{capture:!0}),window.addEventListener("popstate",async l=>{var f;if(l.state===null)return;const c=js(location.href);await i(c,l.state&&l.state.scrollPosition||0),o(),await((f=s.onAfterRouteChange)==null?void 0:f.call(s,c))}),window.addEventListener("hashchange",l=>{l.preventDefault(),o()})),s}function wf(){const e=St(_f);if(!e)throw new Error("useRouter() is called without provider.");return e}function Vo(){return wf().route}function $s(e,t=!1,n=0){if(!e||n){window.scrollTo(0,n);return}let s=null;try{s=document.getElementById(decodeURIComponent(e).slice(1))}catch(r){console.warn(r)}if(s){let r=function(){!t||Math.abs(o-window.scrollY)>window.innerHeight?window.scrollTo(0,o):window.scrollTo({left:0,top:o,behavior:"smooth"})};const i=parseInt(window.getComputedStyle(s).paddingTop,10),o=window.scrollY+s.getBoundingClientRect().top-vf()+i;requestAnimationFrame(r)}}function js(e){const t=new URL(e,jo);return t.pathname=t.pathname.replace(/(^|\/)index(\.html)?$/,"$1"),Tt.value.cleanUrls?t.pathname=t.pathname.replace(/\.html$/,""):!t.pathname.endsWith("/")&&!t.pathname.endsWith(".html")&&(t.pathname+=".html"),t.pathname+t.search+t.hash}async function Sf(e,{smoothScroll:t=!1,initialLoad:n=!1}={}){const s=js(location.href),r=new URL(e,location.origin),i=new URL(s,location.origin);if(e===s){if(!n)return $s(r.hash,t),!1}else if(history.replaceState({scrollPosition:window.scrollY},""),history.pushState({},"",e),r.pathname===i.pathname)return r.hash!==i.hash&&(window.dispatchEvent(new HashChangeEvent("hashchange",{oldURL:i.href,newURL:r.href})),$s(r.hash,t)),!1;return!0}const Sn=()=>On.forEach(e=>e()),su=Vi({name:"VitePressContent",props:{as:{type:[Object,String],default:"div"}},setup(e){const t=Vo(),{frontmatter:n,site:s}=gf();return Le(n,Sn,{deep:!0,flush:"post"}),()=>Fs(e.as,s.value.contentProps??{style:{position:"relative"}},[t.component?Fs(t.component,{onVnodeMounted:Sn,onVnodeUpdated:Sn,onVnodeUnmounted:Sn}):"404 Page Not Found"])}}),ru=Vi({setup(e,{slots:t}){const n=_t(!1);return $t(()=>{n.value=!0}),()=>n.value&&t.default?t.default():null}});function iu(){ve&&window.addEventListener("click",e=>{var n;const t=e.target;if(t.matches(".vp-code-group input")){const s=(n=t.parentElement)==null?void 0:n.parentElement;if(!s)return;const r=Array.from(s.querySelectorAll("input")).indexOf(t);if(r<0)return;const i=s.querySelector(".blocks");if(!i)return;const o=Array.from(i.children).find(f=>f.classList.contains("active"));if(!o)return;const l=i.children[r];if(!l||o===l)return;o.classList.remove("active"),l.classList.add("active");const c=s==null?void 0:s.querySelector(`label[for="${t.id}"]`);c==null||c.scrollIntoView({block:"nearest"})}})}function ou(){if(ve){const e=new WeakMap;window.addEventListener("click",t=>{var s;const n=t.target;if(n.matches('div[class*="language-"] > button.copy')){const r=n.parentElement,i=(s=n.nextElementSibling)==null?void 0:s.nextElementSibling;if(!r||!i)return;const o=/language-(shellscript|shell|bash|sh|zsh)/.test(r.className),l=[".vp-copy-ignore",".diff.remove"],c=i.cloneNode(!0);c.querySelectorAll(l.join(",")).forEach(a=>a.remove());let f=c.textContent||"";o&&(f=f.replace(/^ *(\$|>) /gm,"").trim()),xf(f).then(()=>{n.classList.add("copied"),clearTimeout(e.get(n));const a=setTimeout(()=>{n.classList.remove("copied"),n.blur(),e.delete(n)},2e3);e.set(n,a)})}})}}async function xf(e){try{return navigator.clipboard.writeText(e)}catch{const t=document.createElement("textarea"),n=document.activeElement;t.value=e,t.setAttribute("readonly",""),t.style.contain="strict",t.style.position="absolute",t.style.left="-9999px",t.style.fontSize="12pt";const s=document.getSelection(),r=s?s.rangeCount>0&&s.getRangeAt(0):null;document.body.appendChild(t),t.select(),t.selectionStart=0,t.selectionEnd=e.length,document.execCommand("copy"),document.body.removeChild(t),r&&(s.removeAllRanges(),s.addRange(r)),n&&n.focus()}}function lu(e,t){let n=!0,s=[];const r=i=>{if(n){n=!1,i.forEach(l=>{const c=xs(l);for(const f of document.head.children)if(f.isEqualNode(c)){s.push(f);return}});return}const o=i.map(xs);s.forEach((l,c)=>{const f=o.findIndex(a=>a==null?void 0:a.isEqualNode(l??null));f!==-1?delete o[f]:(l==null||l.remove(),delete s[c])}),o.forEach(l=>l&&document.head.appendChild(l)),s=[...s,...o].filter(Boolean)};ao(()=>{const i=e.data,o=t.value,l=i&&i.description,c=i&&i.frontmatter.head||[],f=Ho(o,i);f!==document.title&&(document.title=f);const a=l||o.description;let h=document.querySelector("meta[name=description]");h?h.getAttribute("content")!==a&&h.setAttribute("content",a):xs(["meta",{name:"description",content:a}]),r($o(o.head,Ef(c)))})}function xs([e,t,n]){const s=document.createElement(e);for(const r in t)s.setAttribute(r,t[r]);return n&&(s.innerHTML=n),e==="script"&&t.async==null&&(s.async=!1),s}function Tf(e){return e[0]==="meta"&&e[1]&&e[1].name==="description"}function Ef(e){return e.filter(t=>!Tf(t))}const Ts=new Set,ko=()=>document.createElement("link"),Cf=e=>{const t=ko();t.rel="prefetch",t.href=e,document.head.appendChild(t)},Af=e=>{const t=new XMLHttpRequest;t.open("GET",e,t.withCredentials=!0),t.send()};let xn;const Rf=ve&&(xn=ko())&&xn.relList&&xn.relList.supports&&xn.relList.supports("prefetch")?Cf:Af;function cu(){if(!ve||!window.IntersectionObserver)return;let e;if((e=navigator.connection)&&(e.saveData||/2g/.test(e.effectiveType)))return;const t=window.requestIdleCallback||setTimeout;let n=null;const s=()=>{n&&n.disconnect(),n=new IntersectionObserver(i=>{i.forEach(o=>{if(o.isIntersecting){const l=o.target;n.unobserve(l);const{pathname:c}=l;if(!Ts.has(c)){Ts.add(c);const f=yf(c);f&&Rf(f)}}})}),t(()=>{document.querySelectorAll("#app a").forEach(i=>{const{hostname:o,pathname:l}=new URL(i.href instanceof SVGAnimatedString?i.href.animVal:i.href,i.baseURI),c=l.match(/\.\w+$/);c&&c[0]!==".html"||i.target!=="_blank"&&o===location.hostname&&(l!==location.pathname?n.observe(i):Ts.add(l))})})};$t(s);const r=Vo();Le(()=>r.path,s),Jn(()=>{n&&n.disconnect()})}export{qf as $,Hf as A,Pe as B,ve as C,Vo as D,Of as E,tu as F,Se as G,Lf as H,If as I,ge as J,Pf as K,No as L,Fc as M,St as N,Zf as O,Ks as P,Jf as Q,cn as R,Qf as S,kf as T,Bn as U,zf as V,gc as W,Df as X,Gf as Y,Wi as Z,Yf as _,_o as a,Ff as a0,lu as a1,_f as a2,eu as a3,pf as a4,su as a5,ru as a6,Tt as a7,nu as a8,yf as a9,Xf as aa,cu as ab,ou as ac,iu as ad,Fs as ae,jf as af,Mf as ag,Kf as ah,Bf as ai,Uf as aj,Wf as ak,Ns as b,$f as c,Vi as d,Vf as e,uf as f,ni as g,ie as h,rf as i,vo as j,zs as k,sf as l,Mo as m,Bs as n,Ls as o,$t as p,tc as q,Nf as r,Jn as s,sl as t,gf as u,vf as v,kl as w,_t as x,ao as y,Le as z}; diff --git a/assets/chunks/framework.gjrnbxUT.js b/assets/chunks/framework.gjrnbxUT.js deleted file mode 100644 index 29aefcfe..00000000 --- a/assets/chunks/framework.gjrnbxUT.js +++ /dev/null @@ -1,17 +0,0 @@ -/** -* @vue/shared v3.4.31 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**//*! #__NO_SIDE_EFFECTS__ */function bs(e,t){const n=new Set(e.split(","));return s=>n.has(s)}const te={},bt=[],Se=()=>{},xo=()=>!1,Wt=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),vs=e=>e.startsWith("onUpdate:"),ie=Object.assign,ws=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},To=Object.prototype.hasOwnProperty,Y=(e,t)=>To.call(e,t),$=Array.isArray,vt=e=>qt(e)==="[object Map]",Ot=e=>qt(e)==="[object Set]",qs=e=>qt(e)==="[object Date]",K=e=>typeof e=="function",re=e=>typeof e=="string",Fe=e=>typeof e=="symbol",Z=e=>e!==null&&typeof e=="object",Wr=e=>(Z(e)||K(e))&&K(e.then)&&K(e.catch),qr=Object.prototype.toString,qt=e=>qr.call(e),Ao=e=>qt(e).slice(8,-1),Gr=e=>qt(e)==="[object Object]",Es=e=>re(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,wt=bs(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Tn=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},Oo=/-(\w)/g,$e=Tn(e=>e.replace(Oo,(t,n)=>n?n.toUpperCase():"")),Ro=/\B([A-Z])/g,gt=Tn(e=>e.replace(Ro,"-$1").toLowerCase()),An=Tn(e=>e.charAt(0).toUpperCase()+e.slice(1)),fn=Tn(e=>e?`on${An(e)}`:""),et=(e,t)=>!Object.is(e,t),un=(e,...t)=>{for(let n=0;n{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:s,value:n})},mn=e=>{const t=parseFloat(e);return isNaN(t)?e:t},Io=e=>{const t=re(e)?Number(e):NaN;return isNaN(t)?e:t};let Gs;const Xr=()=>Gs||(Gs=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Cs(e){if($(e)){const t={};for(let n=0;n{if(n){const s=n.split(Mo);s.length>1&&(t[s[0].trim()]=s[1].trim())}}),t}function Ss(e){let t="";if(re(e))t=e;else if($(e))for(let n=0;npt(n,t))}const Jr=e=>!!(e&&e.__v_isRef===!0),jo=e=>re(e)?e:e==null?"":$(e)||Z(e)&&(e.toString===qr||!K(e.toString))?Jr(e)?jo(e.value):JSON.stringify(e,Qr,2):String(e),Qr=(e,t)=>Jr(t)?Qr(e,t.value):vt(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[s,r],i)=>(n[Kn(s,i)+" =>"]=r,n),{})}:Ot(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>Kn(n))}:Fe(t)?Kn(t):Z(t)&&!$(t)&&!Gr(t)?String(t):t,Kn=(e,t="")=>{var n;return Fe(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};/** -* @vue/reactivity v3.4.31 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**/let we;class Vo{constructor(t=!1){this.detached=t,this._active=!0,this.effects=[],this.cleanups=[],this.parent=we,!t&&we&&(this.index=(we.scopes||(we.scopes=[])).push(this)-1)}get active(){return this._active}run(t){if(this._active){const n=we;try{return we=this,t()}finally{we=n}}}on(){we=this}off(){we=this.parent}stop(t){if(this._active){let n,s;for(n=0,s=this.effects.length;n=4))break}this._dirtyLevel===1&&(this._dirtyLevel=0),rt()}return this._dirtyLevel>=4}set dirty(t){this._dirtyLevel=t?4:0}run(){if(this._dirtyLevel=0,!this.active)return this.fn();let t=Je,n=ut;try{return Je=!0,ut=this,this._runnings++,zs(this),this.fn()}finally{Xs(this),this._runnings--,ut=n,Je=t}}stop(){this.active&&(zs(this),Xs(this),this.onStop&&this.onStop(),this.active=!1)}}function ko(e){return e.value}function zs(e){e._trackId++,e._depsLength=0}function Xs(e){if(e.deps.length>e._depsLength){for(let t=e._depsLength;t{const n=new Map;return n.cleanup=e,n.computed=t,n},yn=new WeakMap,dt=Symbol(""),fs=Symbol("");function be(e,t,n){if(Je&&ut){let s=yn.get(e);s||yn.set(e,s=new Map);let r=s.get(n);r||s.set(n,r=ri(()=>s.delete(n))),ni(ut,r)}}function Ue(e,t,n,s,r,i){const o=yn.get(e);if(!o)return;let l=[];if(t==="clear")l=[...o.values()];else if(n==="length"&&$(e)){const c=Number(s);o.forEach((f,d)=>{(d==="length"||!Fe(d)&&d>=c)&&l.push(f)})}else switch(n!==void 0&&l.push(o.get(n)),t){case"add":$(e)?Es(n)&&l.push(o.get("length")):(l.push(o.get(dt)),vt(e)&&l.push(o.get(fs)));break;case"delete":$(e)||(l.push(o.get(dt)),vt(e)&&l.push(o.get(fs)));break;case"set":vt(e)&&l.push(o.get(dt));break}As();for(const c of l)c&&si(c,4);Os()}function Bo(e,t){const n=yn.get(e);return n&&n.get(t)}const Ko=bs("__proto__,__v_isRef,__isVue"),ii=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(Fe)),Ys=Wo();function Wo(){const e={};return["includes","indexOf","lastIndexOf"].forEach(t=>{e[t]=function(...n){const s=J(this);for(let i=0,o=this.length;i{e[t]=function(...n){st(),As();const s=J(this)[t].apply(this,n);return Os(),rt(),s}}),e}function qo(e){Fe(e)||(e=String(e));const t=J(this);return be(t,"has",e),t.hasOwnProperty(e)}class oi{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,s){const r=this._isReadonly,i=this._isShallow;if(n==="__v_isReactive")return!r;if(n==="__v_isReadonly")return r;if(n==="__v_isShallow")return i;if(n==="__v_raw")return s===(r?i?il:fi:i?ai:ci).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(s)?t:void 0;const o=$(t);if(!r){if(o&&Y(Ys,n))return Reflect.get(Ys,n,s);if(n==="hasOwnProperty")return qo}const l=Reflect.get(t,n,s);return(Fe(n)?ii.has(n):Ko(n))||(r||be(t,"get",n),i)?l:pe(l)?o&&Es(n)?l:l.value:Z(l)?r?In(l):Rn(l):l}}class li extends oi{constructor(t=!1){super(!1,t)}set(t,n,s,r){let i=t[n];if(!this._isShallow){const c=Vt(i);if(!_n(s)&&!Vt(s)&&(i=J(i),s=J(s)),!$(t)&&pe(i)&&!pe(s))return c?!1:(i.value=s,!0)}const o=$(t)&&Es(n)?Number(n)e,On=e=>Reflect.getPrototypeOf(e);function Jt(e,t,n=!1,s=!1){e=e.__v_raw;const r=J(e),i=J(t);n||(et(t,i)&&be(r,"get",t),be(r,"get",i));const{has:o}=On(r),l=s?Rs:n?Ms:Dt;if(o.call(r,t))return l(e.get(t));if(o.call(r,i))return l(e.get(i));e!==r&&e.get(t)}function Qt(e,t=!1){const n=this.__v_raw,s=J(n),r=J(e);return t||(et(e,r)&&be(s,"has",e),be(s,"has",r)),e===r?n.has(e):n.has(e)||n.has(r)}function Zt(e,t=!1){return e=e.__v_raw,!t&&be(J(e),"iterate",dt),Reflect.get(e,"size",e)}function Js(e){e=J(e);const t=J(this);return On(t).has.call(t,e)||(t.add(e),Ue(t,"add",e,e)),this}function Qs(e,t){t=J(t);const n=J(this),{has:s,get:r}=On(n);let i=s.call(n,e);i||(e=J(e),i=s.call(n,e));const o=r.call(n,e);return n.set(e,t),i?et(t,o)&&Ue(n,"set",e,t):Ue(n,"add",e,t),this}function Zs(e){const t=J(this),{has:n,get:s}=On(t);let r=n.call(t,e);r||(e=J(e),r=n.call(t,e)),s&&s.call(t,e);const i=t.delete(e);return r&&Ue(t,"delete",e,void 0),i}function er(){const e=J(this),t=e.size!==0,n=e.clear();return t&&Ue(e,"clear",void 0,void 0),n}function en(e,t){return function(s,r){const i=this,o=i.__v_raw,l=J(o),c=t?Rs:e?Ms:Dt;return!e&&be(l,"iterate",dt),o.forEach((f,d)=>s.call(r,c(f),c(d),i))}}function tn(e,t,n){return function(...s){const r=this.__v_raw,i=J(r),o=vt(i),l=e==="entries"||e===Symbol.iterator&&o,c=e==="keys"&&o,f=r[e](...s),d=n?Rs:t?Ms:Dt;return!t&&be(i,"iterate",c?fs:dt),{next(){const{value:h,done:b}=f.next();return b?{value:h,done:b}:{value:l?[d(h[0]),d(h[1])]:d(h),done:b}},[Symbol.iterator](){return this}}}}function Ke(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function Jo(){const e={get(i){return Jt(this,i)},get size(){return Zt(this)},has:Qt,add:Js,set:Qs,delete:Zs,clear:er,forEach:en(!1,!1)},t={get(i){return Jt(this,i,!1,!0)},get size(){return Zt(this)},has:Qt,add:Js,set:Qs,delete:Zs,clear:er,forEach:en(!1,!0)},n={get(i){return Jt(this,i,!0)},get size(){return Zt(this,!0)},has(i){return Qt.call(this,i,!0)},add:Ke("add"),set:Ke("set"),delete:Ke("delete"),clear:Ke("clear"),forEach:en(!0,!1)},s={get(i){return Jt(this,i,!0,!0)},get size(){return Zt(this,!0)},has(i){return Qt.call(this,i,!0)},add:Ke("add"),set:Ke("set"),delete:Ke("delete"),clear:Ke("clear"),forEach:en(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach(i=>{e[i]=tn(i,!1,!1),n[i]=tn(i,!0,!1),t[i]=tn(i,!1,!0),s[i]=tn(i,!0,!0)}),[e,n,t,s]}const[Qo,Zo,el,tl]=Jo();function Is(e,t){const n=t?e?tl:el:e?Zo:Qo;return(s,r,i)=>r==="__v_isReactive"?!e:r==="__v_isReadonly"?e:r==="__v_raw"?s:Reflect.get(Y(n,r)&&r in s?n:s,r,i)}const nl={get:Is(!1,!1)},sl={get:Is(!1,!0)},rl={get:Is(!0,!1)};const ci=new WeakMap,ai=new WeakMap,fi=new WeakMap,il=new WeakMap;function ol(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function ll(e){return e.__v_skip||!Object.isExtensible(e)?0:ol(Ao(e))}function Rn(e){return Vt(e)?e:Ls(e,!1,zo,nl,ci)}function cl(e){return Ls(e,!1,Yo,sl,ai)}function In(e){return Ls(e,!0,Xo,rl,fi)}function Ls(e,t,n,s,r){if(!Z(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const i=r.get(e);if(i)return i;const o=ll(e);if(o===0)return e;const l=new Proxy(e,o===2?s:n);return r.set(e,l),l}function Pt(e){return Vt(e)?Pt(e.__v_raw):!!(e&&e.__v_isReactive)}function Vt(e){return!!(e&&e.__v_isReadonly)}function _n(e){return!!(e&&e.__v_isShallow)}function ui(e){return e?!!e.__v_raw:!1}function J(e){const t=e&&e.__v_raw;return t?J(t):e}function dn(e){return Object.isExtensible(e)&&zr(e,"__v_skip",!0),e}const Dt=e=>Z(e)?Rn(e):e,Ms=e=>Z(e)?In(e):e;class di{constructor(t,n,s,r){this.getter=t,this._setter=n,this.dep=void 0,this.__v_isRef=!0,this.__v_isReadonly=!1,this.effect=new Ts(()=>t(this._value),()=>Nt(this,this.effect._dirtyLevel===2?2:3)),this.effect.computed=this,this.effect.active=this._cacheable=!r,this.__v_isReadonly=s}get value(){const t=J(this);return(!t._cacheable||t.effect.dirty)&&et(t._value,t._value=t.effect.run())&&Nt(t,4),Ps(t),t.effect._dirtyLevel>=2&&Nt(t,2),t._value}set value(t){this._setter(t)}get _dirty(){return this.effect.dirty}set _dirty(t){this.effect.dirty=t}}function al(e,t,n=!1){let s,r;const i=K(e);return i?(s=e,r=Se):(s=e.get,r=e.set),new di(s,r,i||!r,n)}function Ps(e){var t;Je&&ut&&(e=J(e),ni(ut,(t=e.dep)!=null?t:e.dep=ri(()=>e.dep=void 0,e instanceof di?e:void 0)))}function Nt(e,t=4,n,s){e=J(e);const r=e.dep;r&&si(r,t)}function pe(e){return!!(e&&e.__v_isRef===!0)}function fe(e){return pi(e,!1)}function hi(e){return pi(e,!0)}function pi(e,t){return pe(e)?e:new fl(e,t)}class fl{constructor(t,n){this.__v_isShallow=n,this.dep=void 0,this.__v_isRef=!0,this._rawValue=n?t:J(t),this._value=n?t:Dt(t)}get value(){return Ps(this),this._value}set value(t){const n=this.__v_isShallow||_n(t)||Vt(t);t=n?t:J(t),et(t,this._rawValue)&&(this._rawValue,this._rawValue=t,this._value=n?t:Dt(t),Nt(this,4))}}function gi(e){return pe(e)?e.value:e}const ul={get:(e,t,n)=>gi(Reflect.get(e,t,n)),set:(e,t,n,s)=>{const r=e[t];return pe(r)&&!pe(n)?(r.value=n,!0):Reflect.set(e,t,n,s)}};function mi(e){return Pt(e)?e:new Proxy(e,ul)}class dl{constructor(t){this.dep=void 0,this.__v_isRef=!0;const{get:n,set:s}=t(()=>Ps(this),()=>Nt(this));this._get=n,this._set=s}get value(){return this._get()}set value(t){this._set(t)}}function hl(e){return new dl(e)}class pl{constructor(t,n,s){this._object=t,this._key=n,this._defaultValue=s,this.__v_isRef=!0}get value(){const t=this._object[this._key];return t===void 0?this._defaultValue:t}set value(t){this._object[this._key]=t}get dep(){return Bo(J(this._object),this._key)}}class gl{constructor(t){this._getter=t,this.__v_isRef=!0,this.__v_isReadonly=!0}get value(){return this._getter()}}function ml(e,t,n){return pe(e)?e:K(e)?new gl(e):Z(e)&&arguments.length>1?yl(e,t,n):fe(e)}function yl(e,t,n){const s=e[t];return pe(s)?s:new pl(e,t,n)}/** -* @vue/runtime-core v3.4.31 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**/function Qe(e,t,n,s){try{return s?e(...s):e()}catch(r){Ln(r,t,n)}}function xe(e,t,n,s){if(K(e)){const r=Qe(e,t,n,s);return r&&Wr(r)&&r.catch(i=>{Ln(i,t,n)}),r}if($(e)){const r=[];for(let i=0;i>>1,r=he[s],i=kt(r);iPe&&he.splice(t,1)}function wl(e){$(e)?Et.push(...e):(!Ge||!Ge.includes(e,e.allowRecurse?at+1:at))&&Et.push(e),_i()}function tr(e,t,n=Ut?Pe+1:0){for(;nkt(n)-kt(s));if(Et.length=0,Ge){Ge.push(...t);return}for(Ge=t,at=0;ate.id==null?1/0:e.id,El=(e,t)=>{const n=kt(e)-kt(t);if(n===0){if(e.pre&&!t.pre)return-1;if(t.pre&&!e.pre)return 1}return n};function bi(e){us=!1,Ut=!0,he.sort(El);try{for(Pe=0;Pere(T)?T.trim():T)),h&&(r=n.map(mn))}let l,c=s[l=fn(t)]||s[l=fn($e(t))];!c&&i&&(c=s[l=fn(gt(t))]),c&&xe(c,e,6,r);const f=s[l+"Once"];if(f){if(!e.emitted)e.emitted={};else if(e.emitted[l])return;e.emitted[l]=!0,xe(f,e,6,r)}}function vi(e,t,n=!1){const s=t.emitsCache,r=s.get(e);if(r!==void 0)return r;const i=e.emits;let o={},l=!1;if(!K(e)){const c=f=>{const d=vi(f,t,!0);d&&(l=!0,ie(o,d))};!n&&t.mixins.length&&t.mixins.forEach(c),e.extends&&c(e.extends),e.mixins&&e.mixins.forEach(c)}return!i&&!l?(Z(e)&&s.set(e,null),null):($(i)?i.forEach(c=>o[c]=null):ie(o,i),Z(e)&&s.set(e,o),o)}function Mn(e,t){return!e||!Wt(t)?!1:(t=t.slice(2).replace(/Once$/,""),Y(e,t[0].toLowerCase()+t.slice(1))||Y(e,gt(t))||Y(e,t))}let ce=null,Pn=null;function vn(e){const t=ce;return ce=e,Pn=e&&e.type.__scopeId||null,t}function ef(e){Pn=e}function tf(){Pn=null}function Sl(e,t=ce,n){if(!t||e._n)return e;const s=(...r)=>{s._d&&gr(-1);const i=vn(t);let o;try{o=e(...r)}finally{vn(i),s._d&&gr(1)}return o};return s._n=!0,s._c=!0,s._d=!0,s}function Wn(e){const{type:t,vnode:n,proxy:s,withProxy:r,propsOptions:[i],slots:o,attrs:l,emit:c,render:f,renderCache:d,props:h,data:b,setupState:T,ctx:M,inheritAttrs:P}=e,k=vn(e);let G,z;try{if(n.shapeFlag&4){const m=r||s,L=m;G=Oe(f.call(L,m,d,h,T,b,M)),z=l}else{const m=t;G=Oe(m.length>1?m(h,{attrs:l,slots:o,emit:c}):m(h,null)),z=t.props?l:xl(l)}}catch(m){jt.length=0,Ln(m,e,1),G=ue(me)}let g=G;if(z&&P!==!1){const m=Object.keys(z),{shapeFlag:L}=g;m.length&&L&7&&(i&&m.some(vs)&&(z=Tl(z,i)),g=tt(g,z,!1,!0))}return n.dirs&&(g=tt(g,null,!1,!0),g.dirs=g.dirs?g.dirs.concat(n.dirs):n.dirs),n.transition&&(g.transition=n.transition),G=g,vn(k),G}const xl=e=>{let t;for(const n in e)(n==="class"||n==="style"||Wt(n))&&((t||(t={}))[n]=e[n]);return t},Tl=(e,t)=>{const n={};for(const s in e)(!vs(s)||!(s.slice(9)in t))&&(n[s]=e[s]);return n};function Al(e,t,n){const{props:s,children:r,component:i}=e,{props:o,children:l,patchFlag:c}=t,f=i.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&c>=0){if(c&1024)return!0;if(c&16)return s?nr(s,o,f):!!o;if(c&8){const d=t.dynamicProps;for(let h=0;he.__isSuspense;function Si(e,t){t&&t.pendingBranch?$(e)?t.effects.push(...e):t.effects.push(e):wl(e)}function Nn(e,t,n=ae,s=!1){if(n){const r=n[e]||(n[e]=[]),i=t.__weh||(t.__weh=(...o)=>{st();const l=zt(n),c=xe(t,n,e,o);return l(),rt(),c});return s?r.unshift(i):r.push(i),i}}const Be=e=>(t,n=ae)=>{(!Vn||e==="sp")&&Nn(e,(...s)=>t(...s),n)},Il=Be("bm"),Rt=Be("m"),Ll=Be("bu"),Ml=Be("u"),xi=Be("bum"),Fn=Be("um"),Pl=Be("sp"),Nl=Be("rtg"),Fl=Be("rtc");function $l(e,t=ae){Nn("ec",e,t)}function rf(e,t){if(ce===null)return e;const n=Dn(ce),s=e.dirs||(e.dirs=[]);for(let r=0;rt(o,l,void 0,i));else{const o=Object.keys(e);r=new Array(o.length);for(let l=0,c=o.length;l!!e.type.__asyncLoader;function lf(e,t,n={},s,r){if(ce.isCE||ce.parent&&Ct(ce.parent)&&ce.parent.isCE)return t!=="default"&&(n.name=t),ue("slot",n,s&&s());let i=e[t];i&&i._c&&(i._d=!1),zi();const o=i&&Ai(i(n)),l=Yi(_e,{key:n.key||o&&o.key||`_${t}`},o||(s?s():[]),o&&e._===1?64:-2);return!r&&l.scopeId&&(l.slotScopeIds=[l.scopeId+"-s"]),i&&i._c&&(i._d=!0),l}function Ai(e){return e.some(t=>Sn(t)?!(t.type===me||t.type===_e&&!Ai(t.children)):!0)?e:null}function cf(e,t){const n={};for(const s in e)n[/[A-Z]/.test(s)?`on:${s}`:fn(s)]=e[s];return n}const ds=e=>e?eo(e)?Dn(e):ds(e.parent):null,Ft=ie(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>ds(e.parent),$root:e=>ds(e.root),$emit:e=>e.emit,$options:e=>$s(e),$forceUpdate:e=>e.f||(e.f=()=>{e.effect.dirty=!0,Fs(e.update)}),$nextTick:e=>e.n||(e.n=Gt.bind(e.proxy)),$watch:e=>oc.bind(e)}),qn=(e,t)=>e!==te&&!e.__isScriptSetup&&Y(e,t),Hl={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:s,data:r,props:i,accessCache:o,type:l,appContext:c}=e;let f;if(t[0]!=="$"){const T=o[t];if(T!==void 0)switch(T){case 1:return s[t];case 2:return r[t];case 4:return n[t];case 3:return i[t]}else{if(qn(s,t))return o[t]=1,s[t];if(r!==te&&Y(r,t))return o[t]=2,r[t];if((f=e.propsOptions[0])&&Y(f,t))return o[t]=3,i[t];if(n!==te&&Y(n,t))return o[t]=4,n[t];hs&&(o[t]=0)}}const d=Ft[t];let h,b;if(d)return t==="$attrs"&&be(e.attrs,"get",""),d(e);if((h=l.__cssModules)&&(h=h[t]))return h;if(n!==te&&Y(n,t))return o[t]=4,n[t];if(b=c.config.globalProperties,Y(b,t))return b[t]},set({_:e},t,n){const{data:s,setupState:r,ctx:i}=e;return qn(r,t)?(r[t]=n,!0):s!==te&&Y(s,t)?(s[t]=n,!0):Y(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(i[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:s,appContext:r,propsOptions:i}},o){let l;return!!n[o]||e!==te&&Y(e,o)||qn(t,o)||(l=i[0])&&Y(l,o)||Y(s,o)||Y(Ft,o)||Y(r.config.globalProperties,o)},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:Y(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function af(){return jl().slots}function jl(){const e=jn();return e.setupContext||(e.setupContext=no(e))}function rr(e){return $(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let hs=!0;function Vl(e){const t=$s(e),n=e.proxy,s=e.ctx;hs=!1,t.beforeCreate&&ir(t.beforeCreate,e,"bc");const{data:r,computed:i,methods:o,watch:l,provide:c,inject:f,created:d,beforeMount:h,mounted:b,beforeUpdate:T,updated:M,activated:P,deactivated:k,beforeDestroy:G,beforeUnmount:z,destroyed:g,unmounted:m,render:L,renderTracked:O,renderTriggered:U,errorCaptured:D,serverPrefetch:I,expose:w,inheritAttrs:N,components:S,directives:W,filters:ne}=t;if(f&&Dl(f,s,null),o)for(const X in o){const H=o[X];K(H)&&(s[X]=H.bind(n))}if(r){const X=r.call(n,n);Z(X)&&(e.data=Rn(X))}if(hs=!0,i)for(const X in i){const H=i[X],He=K(H)?H.bind(n,n):K(H.get)?H.get.bind(n,n):Se,Xt=!K(H)&&K(H.set)?H.set.bind(n):Se,it=se({get:He,set:Xt});Object.defineProperty(s,X,{enumerable:!0,configurable:!0,get:()=>it.value,set:Ie=>it.value=Ie})}if(l)for(const X in l)Oi(l[X],s,n,X);if(c){const X=K(c)?c.call(n):c;Reflect.ownKeys(X).forEach(H=>{ql(H,X[H])})}d&&ir(d,e,"c");function j(X,H){$(H)?H.forEach(He=>X(He.bind(n))):H&&X(H.bind(n))}if(j(Il,h),j(Rt,b),j(Ll,T),j(Ml,M),j(lc,P),j(cc,k),j($l,D),j(Fl,O),j(Nl,U),j(xi,z),j(Fn,m),j(Pl,I),$(w))if(w.length){const X=e.exposed||(e.exposed={});w.forEach(H=>{Object.defineProperty(X,H,{get:()=>n[H],set:He=>n[H]=He})})}else e.exposed||(e.exposed={});L&&e.render===Se&&(e.render=L),N!=null&&(e.inheritAttrs=N),S&&(e.components=S),W&&(e.directives=W)}function Dl(e,t,n=Se){$(e)&&(e=ps(e));for(const s in e){const r=e[s];let i;Z(r)?"default"in r?i=St(r.from||s,r.default,!0):i=St(r.from||s):i=St(r),pe(i)?Object.defineProperty(t,s,{enumerable:!0,configurable:!0,get:()=>i.value,set:o=>i.value=o}):t[s]=i}}function ir(e,t,n){xe($(e)?e.map(s=>s.bind(t.proxy)):e.bind(t.proxy),t,n)}function Oi(e,t,n,s){const r=s.includes(".")?ki(n,s):()=>n[s];if(re(e)){const i=t[e];K(i)&&Ne(r,i)}else if(K(e))Ne(r,e.bind(n));else if(Z(e))if($(e))e.forEach(i=>Oi(i,t,n,s));else{const i=K(e.handler)?e.handler.bind(n):t[e.handler];K(i)&&Ne(r,i,e)}}function $s(e){const t=e.type,{mixins:n,extends:s}=t,{mixins:r,optionsCache:i,config:{optionMergeStrategies:o}}=e.appContext,l=i.get(t);let c;return l?c=l:!r.length&&!n&&!s?c=t:(c={},r.length&&r.forEach(f=>wn(c,f,o,!0)),wn(c,t,o)),Z(t)&&i.set(t,c),c}function wn(e,t,n,s=!1){const{mixins:r,extends:i}=t;i&&wn(e,i,n,!0),r&&r.forEach(o=>wn(e,o,n,!0));for(const o in t)if(!(s&&o==="expose")){const l=Ul[o]||n&&n[o];e[o]=l?l(e[o],t[o]):t[o]}return e}const Ul={data:or,props:lr,emits:lr,methods:Mt,computed:Mt,beforeCreate:ge,created:ge,beforeMount:ge,mounted:ge,beforeUpdate:ge,updated:ge,beforeDestroy:ge,beforeUnmount:ge,destroyed:ge,unmounted:ge,activated:ge,deactivated:ge,errorCaptured:ge,serverPrefetch:ge,components:Mt,directives:Mt,watch:Bl,provide:or,inject:kl};function or(e,t){return t?e?function(){return ie(K(e)?e.call(this,this):e,K(t)?t.call(this,this):t)}:t:e}function kl(e,t){return Mt(ps(e),ps(t))}function ps(e){if($(e)){const t={};for(let n=0;n1)return n&&K(t)?t.call(s&&s.proxy):t}}const Ii={},Li=()=>Object.create(Ii),Mi=e=>Object.getPrototypeOf(e)===Ii;function Gl(e,t,n,s=!1){const r={},i=Li();e.propsDefaults=Object.create(null),Pi(e,t,r,i);for(const o in e.propsOptions[0])o in r||(r[o]=void 0);n?e.props=s?r:cl(r):e.type.props?e.props=r:e.props=i,e.attrs=i}function zl(e,t,n,s){const{props:r,attrs:i,vnode:{patchFlag:o}}=e,l=J(r),[c]=e.propsOptions;let f=!1;if((s||o>0)&&!(o&16)){if(o&8){const d=e.vnode.dynamicProps;for(let h=0;h{c=!0;const[b,T]=Ni(h,t,!0);ie(o,b),T&&l.push(...T)};!n&&t.mixins.length&&t.mixins.forEach(d),e.extends&&d(e.extends),e.mixins&&e.mixins.forEach(d)}if(!i&&!c)return Z(e)&&s.set(e,bt),bt;if($(i))for(let d=0;d-1,T[1]=P<0||M-1||Y(T,"default"))&&l.push(h)}}}const f=[o,l];return Z(e)&&s.set(e,f),f}function cr(e){return e[0]!=="$"&&!wt(e)}function ar(e){return e===null?"null":typeof e=="function"?e.name||"":typeof e=="object"&&e.constructor&&e.constructor.name||""}function fr(e,t){return ar(e)===ar(t)}function ur(e,t){return $(t)?t.findIndex(n=>fr(n,e)):K(t)&&fr(t,e)?0:-1}const Fi=e=>e[0]==="_"||e==="$stable",Hs=e=>$(e)?e.map(Oe):[Oe(e)],Xl=(e,t,n)=>{if(t._n)return t;const s=Sl((...r)=>Hs(t(...r)),n);return s._c=!1,s},$i=(e,t,n)=>{const s=e._ctx;for(const r in e){if(Fi(r))continue;const i=e[r];if(K(i))t[r]=Xl(r,i,s);else if(i!=null){const o=Hs(i);t[r]=()=>o}}},Hi=(e,t)=>{const n=Hs(t);e.slots.default=()=>n},Yl=(e,t)=>{const n=e.slots=Li();if(e.vnode.shapeFlag&32){const s=t._;s?(ie(n,t),zr(n,"_",s,!0)):$i(t,n)}else t&&Hi(e,t)},Jl=(e,t,n)=>{const{vnode:s,slots:r}=e;let i=!0,o=te;if(s.shapeFlag&32){const l=t._;l?n&&l===1?i=!1:(ie(r,t),!n&&l===1&&delete r._):(i=!t.$stable,$i(t,r)),o=t}else t&&(Hi(e,t),o={default:1});if(i)for(const l in r)!Fi(l)&&o[l]==null&&delete r[l]};function En(e,t,n,s,r=!1){if($(e)){e.forEach((b,T)=>En(b,t&&($(t)?t[T]:t),n,s,r));return}if(Ct(s)&&!r)return;const i=s.shapeFlag&4?Dn(s.component):s.el,o=r?null:i,{i:l,r:c}=e,f=t&&t.r,d=l.refs===te?l.refs={}:l.refs,h=l.setupState;if(f!=null&&f!==c&&(re(f)?(d[f]=null,Y(h,f)&&(h[f]=null)):pe(f)&&(f.value=null)),K(c))Qe(c,l,12,[o,d]);else{const b=re(c),T=pe(c);if(b||T){const M=()=>{if(e.f){const P=b?Y(h,c)?h[c]:d[c]:c.value;r?$(P)&&ws(P,i):$(P)?P.includes(i)||P.push(i):b?(d[c]=[i],Y(h,c)&&(h[c]=d[c])):(c.value=[i],e.k&&(d[e.k]=c.value))}else b?(d[c]=o,Y(h,c)&&(h[c]=o)):T&&(c.value=o,e.k&&(d[e.k]=o))};o?(M.id=-1,ye(M,n)):M()}}}let dr=!1;const _t=()=>{dr||(console.error("Hydration completed but contains mismatches."),dr=!0)},Ql=e=>e.namespaceURI.includes("svg")&&e.tagName!=="foreignObject",Zl=e=>e.namespaceURI.includes("MathML"),nn=e=>{if(Ql(e))return"svg";if(Zl(e))return"mathml"},sn=e=>e.nodeType===8;function ec(e){const{mt:t,p:n,o:{patchProp:s,createText:r,nextSibling:i,parentNode:o,remove:l,insert:c,createComment:f}}=e,d=(g,m)=>{if(!m.hasChildNodes()){n(null,g,m),bn(),m._vnode=g;return}h(m.firstChild,g,null,null,null),bn(),m._vnode=g},h=(g,m,L,O,U,D=!1)=>{D=D||!!m.dynamicChildren;const I=sn(g)&&g.data==="[",w=()=>P(g,m,L,O,U,I),{type:N,ref:S,shapeFlag:W,patchFlag:ne}=m;let oe=g.nodeType;m.el=g,ne===-2&&(D=!1,m.dynamicChildren=null);let j=null;switch(N){case xt:oe!==3?m.children===""?(c(m.el=r(""),o(g),g),j=g):j=w():(g.data!==m.children&&(_t(),g.data=m.children),j=i(g));break;case me:z(g)?(j=i(g),G(m.el=g.content.firstChild,g,L)):oe!==8||I?j=w():j=i(g);break;case Ht:if(I&&(g=i(g),oe=g.nodeType),oe===1||oe===3){j=g;const X=!m.children.length;for(let H=0;H{D=D||!!m.dynamicChildren;const{type:I,props:w,patchFlag:N,shapeFlag:S,dirs:W,transition:ne}=m,oe=I==="input"||I==="option";if(oe||N!==-1){W&&Me(m,null,L,"created");let j=!1;if(z(g)){j=ji(O,ne)&&L&&L.vnode.props&&L.vnode.props.appear;const H=g.content.firstChild;j&&ne.beforeEnter(H),G(H,g,L),m.el=g=H}if(S&16&&!(w&&(w.innerHTML||w.textContent))){let H=T(g.firstChild,m,g,L,O,U,D);for(;H;){_t();const He=H;H=H.nextSibling,l(He)}}else S&8&&g.textContent!==m.children&&(_t(),g.textContent=m.children);if(w)if(oe||!D||N&48)for(const H in w)(oe&&(H.endsWith("value")||H==="indeterminate")||Wt(H)&&!wt(H)||H[0]===".")&&s(g,H,null,w[H],void 0,void 0,L);else w.onClick&&s(g,"onClick",null,w.onClick,void 0,void 0,L);let X;(X=w&&w.onVnodeBeforeMount)&&Ce(X,L,m),W&&Me(m,null,L,"beforeMount"),((X=w&&w.onVnodeMounted)||W||j)&&Si(()=>{X&&Ce(X,L,m),j&&ne.enter(g),W&&Me(m,null,L,"mounted")},O)}return g.nextSibling},T=(g,m,L,O,U,D,I)=>{I=I||!!m.dynamicChildren;const w=m.children,N=w.length;for(let S=0;S{const{slotScopeIds:I}=m;I&&(U=U?U.concat(I):I);const w=o(g),N=T(i(g),m,w,L,O,U,D);return N&&sn(N)&&N.data==="]"?i(m.anchor=N):(_t(),c(m.anchor=f("]"),w,N),N)},P=(g,m,L,O,U,D)=>{if(_t(),m.el=null,D){const N=k(g);for(;;){const S=i(g);if(S&&S!==N)l(S);else break}}const I=i(g),w=o(g);return l(g),n(null,m,w,I,L,O,nn(w),U),I},k=(g,m="[",L="]")=>{let O=0;for(;g;)if(g=i(g),g&&sn(g)&&(g.data===m&&O++,g.data===L)){if(O===0)return i(g);O--}return g},G=(g,m,L)=>{const O=m.parentNode;O&&O.replaceChild(g,m);let U=L;for(;U;)U.vnode.el===m&&(U.vnode.el=U.subTree.el=g),U=U.parent},z=g=>g.nodeType===1&&g.tagName.toLowerCase()==="template";return[d,h]}const ye=Si;function tc(e){return nc(e,ec)}function nc(e,t){const n=Xr();n.__VUE__=!0;const{insert:s,remove:r,patchProp:i,createElement:o,createText:l,createComment:c,setText:f,setElementText:d,parentNode:h,nextSibling:b,setScopeId:T=Se,insertStaticContent:M}=e,P=(a,u,p,y=null,_=null,C=null,A=void 0,E=null,x=!!u.dynamicChildren)=>{if(a===u)return;a&&!ft(a,u)&&(y=Yt(a),Ie(a,_,C,!0),a=null),u.patchFlag===-2&&(x=!1,u.dynamicChildren=null);const{type:v,ref:R,shapeFlag:V}=u;switch(v){case xt:k(a,u,p,y);break;case me:G(a,u,p,y);break;case Ht:a==null&&z(u,p,y,A);break;case _e:S(a,u,p,y,_,C,A,E,x);break;default:V&1?L(a,u,p,y,_,C,A,E,x):V&6?W(a,u,p,y,_,C,A,E,x):(V&64||V&128)&&v.process(a,u,p,y,_,C,A,E,x,mt)}R!=null&&_&&En(R,a&&a.ref,C,u||a,!u)},k=(a,u,p,y)=>{if(a==null)s(u.el=l(u.children),p,y);else{const _=u.el=a.el;u.children!==a.children&&f(_,u.children)}},G=(a,u,p,y)=>{a==null?s(u.el=c(u.children||""),p,y):u.el=a.el},z=(a,u,p,y)=>{[a.el,a.anchor]=M(a.children,u,p,y,a.el,a.anchor)},g=({el:a,anchor:u},p,y)=>{let _;for(;a&&a!==u;)_=b(a),s(a,p,y),a=_;s(u,p,y)},m=({el:a,anchor:u})=>{let p;for(;a&&a!==u;)p=b(a),r(a),a=p;r(u)},L=(a,u,p,y,_,C,A,E,x)=>{u.type==="svg"?A="svg":u.type==="math"&&(A="mathml"),a==null?O(u,p,y,_,C,A,E,x):I(a,u,_,C,A,E,x)},O=(a,u,p,y,_,C,A,E)=>{let x,v;const{props:R,shapeFlag:V,transition:F,dirs:B}=a;if(x=a.el=o(a.type,C,R&&R.is,R),V&8?d(x,a.children):V&16&&D(a.children,x,null,y,_,Gn(a,C),A,E),B&&Me(a,null,y,"created"),U(x,a,a.scopeId,A,y),R){for(const ee in R)ee!=="value"&&!wt(ee)&&i(x,ee,null,R[ee],C,a.children,y,_,je);"value"in R&&i(x,"value",null,R.value,C),(v=R.onVnodeBeforeMount)&&Ce(v,y,a)}B&&Me(a,null,y,"beforeMount");const q=ji(_,F);q&&F.beforeEnter(x),s(x,u,p),((v=R&&R.onVnodeMounted)||q||B)&&ye(()=>{v&&Ce(v,y,a),q&&F.enter(x),B&&Me(a,null,y,"mounted")},_)},U=(a,u,p,y,_)=>{if(p&&T(a,p),y)for(let C=0;C{for(let v=x;v{const E=u.el=a.el;let{patchFlag:x,dynamicChildren:v,dirs:R}=u;x|=a.patchFlag&16;const V=a.props||te,F=u.props||te;let B;if(p&&ot(p,!1),(B=F.onVnodeBeforeUpdate)&&Ce(B,p,u,a),R&&Me(u,a,p,"beforeUpdate"),p&&ot(p,!0),v?w(a.dynamicChildren,v,E,p,y,Gn(u,_),C):A||H(a,u,E,null,p,y,Gn(u,_),C,!1),x>0){if(x&16)N(E,u,V,F,p,y,_);else if(x&2&&V.class!==F.class&&i(E,"class",null,F.class,_),x&4&&i(E,"style",V.style,F.style,_),x&8){const q=u.dynamicProps;for(let ee=0;ee{B&&Ce(B,p,u,a),R&&Me(u,a,p,"updated")},y)},w=(a,u,p,y,_,C,A)=>{for(let E=0;E{if(p!==y){if(p!==te)for(const E in p)!wt(E)&&!(E in y)&&i(a,E,p[E],null,A,u.children,_,C,je);for(const E in y){if(wt(E))continue;const x=y[E],v=p[E];x!==v&&E!=="value"&&i(a,E,v,x,A,u.children,_,C,je)}"value"in y&&i(a,"value",p.value,y.value,A)}},S=(a,u,p,y,_,C,A,E,x)=>{const v=u.el=a?a.el:l(""),R=u.anchor=a?a.anchor:l("");let{patchFlag:V,dynamicChildren:F,slotScopeIds:B}=u;B&&(E=E?E.concat(B):B),a==null?(s(v,p,y),s(R,p,y),D(u.children||[],p,R,_,C,A,E,x)):V>0&&V&64&&F&&a.dynamicChildren?(w(a.dynamicChildren,F,p,_,C,A,E),(u.key!=null||_&&u===_.subTree)&&Vi(a,u,!0)):H(a,u,p,R,_,C,A,E,x)},W=(a,u,p,y,_,C,A,E,x)=>{u.slotScopeIds=E,a==null?u.shapeFlag&512?_.ctx.activate(u,p,y,A,x):ne(u,p,y,_,C,A,x):oe(a,u,x)},ne=(a,u,p,y,_,C,A)=>{const E=a.component=vc(a,y,_);if(Hn(a)&&(E.ctx.renderer=mt),wc(E),E.asyncDep){if(_&&_.registerDep(E,j,A),!a.el){const x=E.subTree=ue(me);G(null,x,u,p)}}else j(E,a,u,p,_,C,A)},oe=(a,u,p)=>{const y=u.component=a.component;if(Al(a,u,p))if(y.asyncDep&&!y.asyncResolved){X(y,u,p);return}else y.next=u,vl(y.update),y.effect.dirty=!0,y.update();else u.el=a.el,y.vnode=u},j=(a,u,p,y,_,C,A)=>{const E=()=>{if(a.isMounted){let{next:R,bu:V,u:F,parent:B,vnode:q}=a;{const yt=Di(a);if(yt){R&&(R.el=q.el,X(a,R,A)),yt.asyncDep.then(()=>{a.isUnmounted||E()});return}}let ee=R,Q;ot(a,!1),R?(R.el=q.el,X(a,R,A)):R=q,V&&un(V),(Q=R.props&&R.props.onVnodeBeforeUpdate)&&Ce(Q,B,R,q),ot(a,!0);const le=Wn(a),Ae=a.subTree;a.subTree=le,P(Ae,le,h(Ae.el),Yt(Ae),a,_,C),R.el=le.el,ee===null&&Ol(a,le.el),F&&ye(F,_),(Q=R.props&&R.props.onVnodeUpdated)&&ye(()=>Ce(Q,B,R,q),_)}else{let R;const{el:V,props:F}=u,{bm:B,m:q,parent:ee}=a,Q=Ct(u);if(ot(a,!1),B&&un(B),!Q&&(R=F&&F.onVnodeBeforeMount)&&Ce(R,ee,u),ot(a,!0),V&&Bn){const le=()=>{a.subTree=Wn(a),Bn(V,a.subTree,a,_,null)};Q?u.type.__asyncLoader().then(()=>!a.isUnmounted&&le()):le()}else{const le=a.subTree=Wn(a);P(null,le,p,y,a,_,C),u.el=le.el}if(q&&ye(q,_),!Q&&(R=F&&F.onVnodeMounted)){const le=u;ye(()=>Ce(R,ee,le),_)}(u.shapeFlag&256||ee&&Ct(ee.vnode)&&ee.vnode.shapeFlag&256)&&a.a&&ye(a.a,_),a.isMounted=!0,u=p=y=null}},x=a.effect=new Ts(E,Se,()=>Fs(v),a.scope),v=a.update=()=>{x.dirty&&x.run()};v.id=a.uid,ot(a,!0),v()},X=(a,u,p)=>{u.component=a;const y=a.vnode.props;a.vnode=u,a.next=null,zl(a,u.props,y,p),Jl(a,u.children,p),st(),tr(a),rt()},H=(a,u,p,y,_,C,A,E,x=!1)=>{const v=a&&a.children,R=a?a.shapeFlag:0,V=u.children,{patchFlag:F,shapeFlag:B}=u;if(F>0){if(F&128){Xt(v,V,p,y,_,C,A,E,x);return}else if(F&256){He(v,V,p,y,_,C,A,E,x);return}}B&8?(R&16&&je(v,_,C),V!==v&&d(p,V)):R&16?B&16?Xt(v,V,p,y,_,C,A,E,x):je(v,_,C,!0):(R&8&&d(p,""),B&16&&D(V,p,y,_,C,A,E,x))},He=(a,u,p,y,_,C,A,E,x)=>{a=a||bt,u=u||bt;const v=a.length,R=u.length,V=Math.min(v,R);let F;for(F=0;FR?je(a,_,C,!0,!1,V):D(u,p,y,_,C,A,E,x,V)},Xt=(a,u,p,y,_,C,A,E,x)=>{let v=0;const R=u.length;let V=a.length-1,F=R-1;for(;v<=V&&v<=F;){const B=a[v],q=u[v]=x?Xe(u[v]):Oe(u[v]);if(ft(B,q))P(B,q,p,null,_,C,A,E,x);else break;v++}for(;v<=V&&v<=F;){const B=a[V],q=u[F]=x?Xe(u[F]):Oe(u[F]);if(ft(B,q))P(B,q,p,null,_,C,A,E,x);else break;V--,F--}if(v>V){if(v<=F){const B=F+1,q=BF)for(;v<=V;)Ie(a[v],_,C,!0),v++;else{const B=v,q=v,ee=new Map;for(v=q;v<=F;v++){const ve=u[v]=x?Xe(u[v]):Oe(u[v]);ve.key!=null&&ee.set(ve.key,v)}let Q,le=0;const Ae=F-q+1;let yt=!1,Bs=0;const It=new Array(Ae);for(v=0;v=Ae){Ie(ve,_,C,!0);continue}let Le;if(ve.key!=null)Le=ee.get(ve.key);else for(Q=q;Q<=F;Q++)if(It[Q-q]===0&&ft(ve,u[Q])){Le=Q;break}Le===void 0?Ie(ve,_,C,!0):(It[Le-q]=v+1,Le>=Bs?Bs=Le:yt=!0,P(ve,u[Le],p,null,_,C,A,E,x),le++)}const Ks=yt?sc(It):bt;for(Q=Ks.length-1,v=Ae-1;v>=0;v--){const ve=q+v,Le=u[ve],Ws=ve+1{const{el:C,type:A,transition:E,children:x,shapeFlag:v}=a;if(v&6){it(a.component.subTree,u,p,y);return}if(v&128){a.suspense.move(u,p,y);return}if(v&64){A.move(a,u,p,mt);return}if(A===_e){s(C,u,p);for(let V=0;VE.enter(C),_);else{const{leave:V,delayLeave:F,afterLeave:B}=E,q=()=>s(C,u,p),ee=()=>{V(C,()=>{q(),B&&B()})};F?F(C,q,ee):ee()}else s(C,u,p)},Ie=(a,u,p,y=!1,_=!1)=>{const{type:C,props:A,ref:E,children:x,dynamicChildren:v,shapeFlag:R,patchFlag:V,dirs:F,memoIndex:B}=a;if(V===-2&&(_=!1),E!=null&&En(E,null,p,a,!0),B!=null&&(u.renderCache[B]=void 0),R&256){u.ctx.deactivate(a);return}const q=R&1&&F,ee=!Ct(a);let Q;if(ee&&(Q=A&&A.onVnodeBeforeUnmount)&&Ce(Q,u,a),R&6)So(a.component,p,y);else{if(R&128){a.suspense.unmount(p,y);return}q&&Me(a,null,u,"beforeUnmount"),R&64?a.type.remove(a,u,p,mt,y):v&&(C!==_e||V>0&&V&64)?je(v,u,p,!1,!0):(C===_e&&V&384||!_&&R&16)&&je(x,u,p),y&&Us(a)}(ee&&(Q=A&&A.onVnodeUnmounted)||q)&&ye(()=>{Q&&Ce(Q,u,a),q&&Me(a,null,u,"unmounted")},p)},Us=a=>{const{type:u,el:p,anchor:y,transition:_}=a;if(u===_e){Co(p,y);return}if(u===Ht){m(a);return}const C=()=>{r(p),_&&!_.persisted&&_.afterLeave&&_.afterLeave()};if(a.shapeFlag&1&&_&&!_.persisted){const{leave:A,delayLeave:E}=_,x=()=>A(p,C);E?E(a.el,C,x):x()}else C()},Co=(a,u)=>{let p;for(;a!==u;)p=b(a),r(a),a=p;r(u)},So=(a,u,p)=>{const{bum:y,scope:_,update:C,subTree:A,um:E,m:x,a:v}=a;hr(x),hr(v),y&&un(y),_.stop(),C&&(C.active=!1,Ie(A,a,u,p)),E&&ye(E,u),ye(()=>{a.isUnmounted=!0},u),u&&u.pendingBranch&&!u.isUnmounted&&a.asyncDep&&!a.asyncResolved&&a.suspenseId===u.pendingId&&(u.deps--,u.deps===0&&u.resolve())},je=(a,u,p,y=!1,_=!1,C=0)=>{for(let A=C;Aa.shapeFlag&6?Yt(a.component.subTree):a.shapeFlag&128?a.suspense.next():b(a.anchor||a.el);let Un=!1;const ks=(a,u,p)=>{a==null?u._vnode&&Ie(u._vnode,null,null,!0):P(u._vnode||null,a,u,null,null,null,p),Un||(Un=!0,tr(),bn(),Un=!1),u._vnode=a},mt={p:P,um:Ie,m:it,r:Us,mt:ne,mc:D,pc:H,pbc:w,n:Yt,o:e};let kn,Bn;return t&&([kn,Bn]=t(mt)),{render:ks,hydrate:kn,createApp:Wl(ks,kn)}}function Gn({type:e,props:t},n){return n==="svg"&&e==="foreignObject"||n==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function ot({effect:e,update:t},n){e.allowRecurse=t.allowRecurse=n}function ji(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function Vi(e,t,n=!1){const s=e.children,r=t.children;if($(s)&&$(r))for(let i=0;i>1,e[n[l]]0&&(t[s]=n[i-1]),n[i]=s)}}for(i=n.length,o=n[i-1];i-- >0;)n[i]=o,o=t[o];return n}function Di(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:Di(t)}function hr(e){if(e)for(let t=0;tSt(rc);function Ui(e,t){return $n(e,null,t)}function ff(e,t){return $n(e,null,{flush:"post"})}const rn={};function Ne(e,t,n){return $n(e,t,n)}function $n(e,t,{immediate:n,deep:s,flush:r,once:i,onTrack:o,onTrigger:l}=te){if(t&&i){const O=t;t=(...U)=>{O(...U),L()}}const c=ae,f=O=>s===!0?O:Ye(O,s===!1?1:void 0);let d,h=!1,b=!1;if(pe(e)?(d=()=>e.value,h=_n(e)):Pt(e)?(d=()=>f(e),h=!0):$(e)?(b=!0,h=e.some(O=>Pt(O)||_n(O)),d=()=>e.map(O=>{if(pe(O))return O.value;if(Pt(O))return f(O);if(K(O))return Qe(O,c,2)})):K(e)?t?d=()=>Qe(e,c,2):d=()=>(T&&T(),xe(e,c,3,[M])):d=Se,t&&s){const O=d;d=()=>Ye(O())}let T,M=O=>{T=g.onStop=()=>{Qe(O,c,4),T=g.onStop=void 0}},P;if(Vn)if(M=Se,t?n&&xe(t,c,3,[d(),b?[]:void 0,M]):d(),r==="sync"){const O=ic();P=O.__watcherHandles||(O.__watcherHandles=[])}else return Se;let k=b?new Array(e.length).fill(rn):rn;const G=()=>{if(!(!g.active||!g.dirty))if(t){const O=g.run();(s||h||(b?O.some((U,D)=>et(U,k[D])):et(O,k)))&&(T&&T(),xe(t,c,3,[O,k===rn?void 0:b&&k[0]===rn?[]:k,M]),k=O)}else g.run()};G.allowRecurse=!!t;let z;r==="sync"?z=G:r==="post"?z=()=>ye(G,c&&c.suspense):(G.pre=!0,c&&(G.id=c.uid),z=()=>Fs(G));const g=new Ts(d,Se,z),m=Zr(),L=()=>{g.stop(),m&&ws(m.effects,g)};return t?n?G():k=g.run():r==="post"?ye(g.run.bind(g),c&&c.suspense):g.run(),P&&P.push(L),L}function oc(e,t,n){const s=this.proxy,r=re(e)?e.includes(".")?ki(s,e):()=>s[e]:e.bind(s,s);let i;K(t)?i=t:(i=t.handler,n=t);const o=zt(this),l=$n(r,i.bind(s),n);return o(),l}function ki(e,t){const n=t.split(".");return()=>{let s=e;for(let r=0;r{Ye(s,t,n)});else if(Gr(e)){for(const s in e)Ye(e[s],t,n);for(const s of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,s)&&Ye(e[s],t,n)}return e}const Hn=e=>e.type.__isKeepAlive;function lc(e,t){Bi(e,"a",t)}function cc(e,t){Bi(e,"da",t)}function Bi(e,t,n=ae){const s=e.__wdc||(e.__wdc=()=>{let r=n;for(;r;){if(r.isDeactivated)return;r=r.parent}return e()});if(Nn(t,s,n),n){let r=n.parent;for(;r&&r.parent;)Hn(r.parent.vnode)&&ac(s,t,n,r),r=r.parent}}function ac(e,t,n,s){const r=Nn(t,e,s,!0);Fn(()=>{ws(s[t],r)},n)}const ze=Symbol("_leaveCb"),on=Symbol("_enterCb");function fc(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return Rt(()=>{e.isMounted=!0}),xi(()=>{e.isUnmounting=!0}),e}const Ee=[Function,Array],Ki={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Ee,onEnter:Ee,onAfterEnter:Ee,onEnterCancelled:Ee,onBeforeLeave:Ee,onLeave:Ee,onAfterLeave:Ee,onLeaveCancelled:Ee,onBeforeAppear:Ee,onAppear:Ee,onAfterAppear:Ee,onAppearCancelled:Ee},Wi=e=>{const t=e.subTree;return t.component?Wi(t.component):t},uc={name:"BaseTransition",props:Ki,setup(e,{slots:t}){const n=jn(),s=fc();return()=>{const r=t.default&&Gi(t.default(),!0);if(!r||!r.length)return;let i=r[0];if(r.length>1){for(const b of r)if(b.type!==me){i=b;break}}const o=J(e),{mode:l}=o;if(s.isLeaving)return zn(i);const c=pr(i);if(!c)return zn(i);let f=ms(c,o,s,n,b=>f=b);Cn(c,f);const d=n.subTree,h=d&&pr(d);if(h&&h.type!==me&&!ft(c,h)&&Wi(n).type!==me){const b=ms(h,o,s,n);if(Cn(h,b),l==="out-in"&&c.type!==me)return s.isLeaving=!0,b.afterLeave=()=>{s.isLeaving=!1,n.update.active!==!1&&(n.effect.dirty=!0,n.update())},zn(i);l==="in-out"&&c.type!==me&&(b.delayLeave=(T,M,P)=>{const k=qi(s,h);k[String(h.key)]=h,T[ze]=()=>{M(),T[ze]=void 0,delete f.delayedLeave},f.delayedLeave=P})}return i}}},dc=uc;function qi(e,t){const{leavingVNodes:n}=e;let s=n.get(t.type);return s||(s=Object.create(null),n.set(t.type,s)),s}function ms(e,t,n,s,r){const{appear:i,mode:o,persisted:l=!1,onBeforeEnter:c,onEnter:f,onAfterEnter:d,onEnterCancelled:h,onBeforeLeave:b,onLeave:T,onAfterLeave:M,onLeaveCancelled:P,onBeforeAppear:k,onAppear:G,onAfterAppear:z,onAppearCancelled:g}=t,m=String(e.key),L=qi(n,e),O=(I,w)=>{I&&xe(I,s,9,w)},U=(I,w)=>{const N=w[1];O(I,w),$(I)?I.every(S=>S.length<=1)&&N():I.length<=1&&N()},D={mode:o,persisted:l,beforeEnter(I){let w=c;if(!n.isMounted)if(i)w=k||c;else return;I[ze]&&I[ze](!0);const N=L[m];N&&ft(e,N)&&N.el[ze]&&N.el[ze](),O(w,[I])},enter(I){let w=f,N=d,S=h;if(!n.isMounted)if(i)w=G||f,N=z||d,S=g||h;else return;let W=!1;const ne=I[on]=oe=>{W||(W=!0,oe?O(S,[I]):O(N,[I]),D.delayedLeave&&D.delayedLeave(),I[on]=void 0)};w?U(w,[I,ne]):ne()},leave(I,w){const N=String(e.key);if(I[on]&&I[on](!0),n.isUnmounting)return w();O(b,[I]);let S=!1;const W=I[ze]=ne=>{S||(S=!0,w(),ne?O(P,[I]):O(M,[I]),I[ze]=void 0,L[N]===e&&delete L[N])};L[N]=e,T?U(T,[I,W]):W()},clone(I){const w=ms(I,t,n,s,r);return r&&r(w),w}};return D}function zn(e){if(Hn(e))return e=tt(e),e.children=null,e}function pr(e){if(!Hn(e))return e;const{shapeFlag:t,children:n}=e;if(n){if(t&16)return n[0];if(t&32&&K(n.default))return n.default()}}function Cn(e,t){e.shapeFlag&6&&e.component?Cn(e.component.subTree,t):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function Gi(e,t=!1,n){let s=[],r=0;for(let i=0;i1)for(let i=0;ie.__isTeleport,_e=Symbol.for("v-fgt"),xt=Symbol.for("v-txt"),me=Symbol.for("v-cmt"),Ht=Symbol.for("v-stc"),jt=[];let Re=null;function zi(e=!1){jt.push(Re=e?null:[])}function pc(){jt.pop(),Re=jt[jt.length-1]||null}let Bt=1;function gr(e){Bt+=e}function Xi(e){return e.dynamicChildren=Bt>0?Re||bt:null,pc(),Bt>0&&Re&&Re.push(e),e}function uf(e,t,n,s,r,i){return Xi(Qi(e,t,n,s,r,i,!0))}function Yi(e,t,n,s,r){return Xi(ue(e,t,n,s,r,!0))}function Sn(e){return e?e.__v_isVNode===!0:!1}function ft(e,t){return e.type===t.type&&e.key===t.key}const Ji=({key:e})=>e??null,hn=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?re(e)||pe(e)||K(e)?{i:ce,r:e,k:t,f:!!n}:e:null);function Qi(e,t=null,n=null,s=0,r=null,i=e===_e?0:1,o=!1,l=!1){const c={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Ji(t),ref:t&&hn(t),scopeId:Pn,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetAnchor:null,staticCount:0,shapeFlag:i,patchFlag:s,dynamicProps:r,dynamicChildren:null,appContext:null,ctx:ce};return l?(js(c,n),i&128&&e.normalize(c)):n&&(c.shapeFlag|=re(n)?8:16),Bt>0&&!o&&Re&&(c.patchFlag>0||i&6)&&c.patchFlag!==32&&Re.push(c),c}const ue=gc;function gc(e,t=null,n=null,s=0,r=null,i=!1){if((!e||e===Ei)&&(e=me),Sn(e)){const l=tt(e,t,!0);return n&&js(l,n),Bt>0&&!i&&Re&&(l.shapeFlag&6?Re[Re.indexOf(e)]=l:Re.push(l)),l.patchFlag=-2,l}if(xc(e)&&(e=e.__vccOpts),t){t=mc(t);let{class:l,style:c}=t;l&&!re(l)&&(t.class=Ss(l)),Z(c)&&(ui(c)&&!$(c)&&(c=ie({},c)),t.style=Cs(c))}const o=re(e)?1:Rl(e)?128:hc(e)?64:Z(e)?4:K(e)?2:0;return Qi(e,t,n,s,r,o,i,!0)}function mc(e){return e?ui(e)||Mi(e)?ie({},e):e:null}function tt(e,t,n=!1,s=!1){const{props:r,ref:i,patchFlag:o,children:l,transition:c}=e,f=t?yc(r||{},t):r,d={__v_isVNode:!0,__v_skip:!0,type:e.type,props:f,key:f&&Ji(f),ref:t&&t.ref?n&&i?$(i)?i.concat(hn(t)):[i,hn(t)]:hn(t):i,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:l,target:e.target,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==_e?o===-1?16:o|16:o,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:c,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&tt(e.ssContent),ssFallback:e.ssFallback&&tt(e.ssFallback),el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return c&&s&&Cn(d,c.clone(d)),d}function Zi(e=" ",t=0){return ue(xt,null,e,t)}function df(e,t){const n=ue(Ht,null,e);return n.staticCount=t,n}function hf(e="",t=!1){return t?(zi(),Yi(me,null,e)):ue(me,null,e)}function Oe(e){return e==null||typeof e=="boolean"?ue(me):$(e)?ue(_e,null,e.slice()):typeof e=="object"?Xe(e):ue(xt,null,String(e))}function Xe(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:tt(e)}function js(e,t){let n=0;const{shapeFlag:s}=e;if(t==null)t=null;else if($(t))n=16;else if(typeof t=="object")if(s&65){const r=t.default;r&&(r._c&&(r._d=!1),js(e,r()),r._c&&(r._d=!0));return}else{n=32;const r=t._;!r&&!Mi(t)?t._ctx=ce:r===3&&ce&&(ce.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else K(t)?(t={default:t,_ctx:ce},n=32):(t=String(t),s&64?(n=16,t=[Zi(t)]):n=8);e.children=t,e.shapeFlag|=n}function yc(...e){const t={};for(let n=0;nae||ce;let xn,ys;{const e=Xr(),t=(n,s)=>{let r;return(r=e[n])||(r=e[n]=[]),r.push(s),i=>{r.length>1?r.forEach(o=>o(i)):r[0](i)}};xn=t("__VUE_INSTANCE_SETTERS__",n=>ae=n),ys=t("__VUE_SSR_SETTERS__",n=>Vn=n)}const zt=e=>{const t=ae;return xn(e),e.scope.on(),()=>{e.scope.off(),xn(t)}},mr=()=>{ae&&ae.scope.off(),xn(null)};function eo(e){return e.vnode.shapeFlag&4}let Vn=!1;function wc(e,t=!1){t&&ys(t);const{props:n,children:s}=e.vnode,r=eo(e);Gl(e,n,r,t),Yl(e,s);const i=r?Ec(e,t):void 0;return t&&ys(!1),i}function Ec(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,Hl);const{setup:s}=n;if(s){const r=e.setupContext=s.length>1?no(e):null,i=zt(e);st();const o=Qe(s,e,0,[e.props,r]);if(rt(),i(),Wr(o)){if(o.then(mr,mr),t)return o.then(l=>{yr(e,l,t)}).catch(l=>{Ln(l,e,0)});e.asyncDep=o}else yr(e,o,t)}else to(e,t)}function yr(e,t,n){K(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:Z(t)&&(e.setupState=mi(t)),to(e,n)}let _r;function to(e,t,n){const s=e.type;if(!e.render){if(!t&&_r&&!s.render){const r=s.template||$s(e).template;if(r){const{isCustomElement:i,compilerOptions:o}=e.appContext.config,{delimiters:l,compilerOptions:c}=s,f=ie(ie({isCustomElement:i,delimiters:l},o),c);s.render=_r(r,f)}}e.render=s.render||Se}{const r=zt(e);st();try{Vl(e)}finally{rt(),r()}}}const Cc={get(e,t){return be(e,"get",""),e[t]}};function no(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,Cc),slots:e.slots,emit:e.emit,expose:t}}function Dn(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(mi(dn(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Ft)return Ft[n](e)},has(t,n){return n in t||n in Ft}})):e.proxy}function Sc(e,t=!0){return K(e)?e.displayName||e.name:e.name||t&&e.__name}function xc(e){return K(e)&&"__vccOpts"in e}const se=(e,t)=>al(e,t,Vn);function _s(e,t,n){const s=arguments.length;return s===2?Z(t)&&!$(t)?Sn(t)?ue(e,null,[t]):ue(e,t):ue(e,null,t):(s>3?n=Array.prototype.slice.call(arguments,2):s===3&&Sn(n)&&(n=[n]),ue(e,t,n))}const Tc="3.4.31";/** -* @vue/runtime-dom v3.4.31 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**/const Ac="http://www.w3.org/2000/svg",Oc="http://www.w3.org/1998/Math/MathML",Ve=typeof document<"u"?document:null,br=Ve&&Ve.createElement("template"),Rc={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,s)=>{const r=t==="svg"?Ve.createElementNS(Ac,e):t==="mathml"?Ve.createElementNS(Oc,e):n?Ve.createElement(e,{is:n}):Ve.createElement(e);return e==="select"&&s&&s.multiple!=null&&r.setAttribute("multiple",s.multiple),r},createText:e=>Ve.createTextNode(e),createComment:e=>Ve.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Ve.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,s,r,i){const o=n?n.previousSibling:t.lastChild;if(r&&(r===i||r.nextSibling))for(;t.insertBefore(r.cloneNode(!0),n),!(r===i||!(r=r.nextSibling)););else{br.innerHTML=s==="svg"?`${e}`:s==="mathml"?`${e}`:e;const l=br.content;if(s==="svg"||s==="mathml"){const c=l.firstChild;for(;c.firstChild;)l.appendChild(c.firstChild);l.removeChild(c)}t.insertBefore(l,n)}return[o?o.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},We="transition",Lt="animation",Kt=Symbol("_vtc"),so=(e,{slots:t})=>_s(dc,Ic(e),t);so.displayName="Transition";const ro={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String};so.props=ie({},Ki,ro);const lt=(e,t=[])=>{$(e)?e.forEach(n=>n(...t)):e&&e(...t)},vr=e=>e?$(e)?e.some(t=>t.length>1):e.length>1:!1;function Ic(e){const t={};for(const S in e)S in ro||(t[S]=e[S]);if(e.css===!1)return t;const{name:n="v",type:s,duration:r,enterFromClass:i=`${n}-enter-from`,enterActiveClass:o=`${n}-enter-active`,enterToClass:l=`${n}-enter-to`,appearFromClass:c=i,appearActiveClass:f=o,appearToClass:d=l,leaveFromClass:h=`${n}-leave-from`,leaveActiveClass:b=`${n}-leave-active`,leaveToClass:T=`${n}-leave-to`}=e,M=Lc(r),P=M&&M[0],k=M&&M[1],{onBeforeEnter:G,onEnter:z,onEnterCancelled:g,onLeave:m,onLeaveCancelled:L,onBeforeAppear:O=G,onAppear:U=z,onAppearCancelled:D=g}=t,I=(S,W,ne)=>{ct(S,W?d:l),ct(S,W?f:o),ne&&ne()},w=(S,W)=>{S._isLeaving=!1,ct(S,h),ct(S,T),ct(S,b),W&&W()},N=S=>(W,ne)=>{const oe=S?U:z,j=()=>I(W,S,ne);lt(oe,[W,j]),wr(()=>{ct(W,S?c:i),qe(W,S?d:l),vr(oe)||Er(W,s,P,j)})};return ie(t,{onBeforeEnter(S){lt(G,[S]),qe(S,i),qe(S,o)},onBeforeAppear(S){lt(O,[S]),qe(S,c),qe(S,f)},onEnter:N(!1),onAppear:N(!0),onLeave(S,W){S._isLeaving=!0;const ne=()=>w(S,W);qe(S,h),qe(S,b),Nc(),wr(()=>{S._isLeaving&&(ct(S,h),qe(S,T),vr(m)||Er(S,s,k,ne))}),lt(m,[S,ne])},onEnterCancelled(S){I(S,!1),lt(g,[S])},onAppearCancelled(S){I(S,!0),lt(D,[S])},onLeaveCancelled(S){w(S),lt(L,[S])}})}function Lc(e){if(e==null)return null;if(Z(e))return[Xn(e.enter),Xn(e.leave)];{const t=Xn(e);return[t,t]}}function Xn(e){return Io(e)}function qe(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[Kt]||(e[Kt]=new Set)).add(t)}function ct(e,t){t.split(/\s+/).forEach(s=>s&&e.classList.remove(s));const n=e[Kt];n&&(n.delete(t),n.size||(e[Kt]=void 0))}function wr(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let Mc=0;function Er(e,t,n,s){const r=e._endId=++Mc,i=()=>{r===e._endId&&s()};if(n)return setTimeout(i,n);const{type:o,timeout:l,propCount:c}=Pc(e,t);if(!o)return s();const f=o+"end";let d=0;const h=()=>{e.removeEventListener(f,b),i()},b=T=>{T.target===e&&++d>=c&&h()};setTimeout(()=>{d(n[M]||"").split(", "),r=s(`${We}Delay`),i=s(`${We}Duration`),o=Cr(r,i),l=s(`${Lt}Delay`),c=s(`${Lt}Duration`),f=Cr(l,c);let d=null,h=0,b=0;t===We?o>0&&(d=We,h=o,b=i.length):t===Lt?f>0&&(d=Lt,h=f,b=c.length):(h=Math.max(o,f),d=h>0?o>f?We:Lt:null,b=d?d===We?i.length:c.length:0);const T=d===We&&/\b(transform|all)(,|$)/.test(s(`${We}Property`).toString());return{type:d,timeout:h,propCount:b,hasTransform:T}}function Cr(e,t){for(;e.lengthSr(n)+Sr(e[s])))}function Sr(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function Nc(){return document.body.offsetHeight}function Fc(e,t,n){const s=e[Kt];s&&(t=(t?[t,...s]:[...s]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const xr=Symbol("_vod"),$c=Symbol("_vsh"),Hc=Symbol(""),jc=/(^|;)\s*display\s*:/;function Vc(e,t,n){const s=e.style,r=re(n);let i=!1;if(n&&!r){if(t)if(re(t))for(const o of t.split(";")){const l=o.slice(0,o.indexOf(":")).trim();n[l]==null&&pn(s,l,"")}else for(const o in t)n[o]==null&&pn(s,o,"");for(const o in n)o==="display"&&(i=!0),pn(s,o,n[o])}else if(r){if(t!==n){const o=s[Hc];o&&(n+=";"+o),s.cssText=n,i=jc.test(n)}}else t&&e.removeAttribute("style");xr in e&&(e[xr]=i?s.display:"",e[$c]&&(s.display="none"))}const Tr=/\s*!important$/;function pn(e,t,n){if($(n))n.forEach(s=>pn(e,t,s));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const s=Dc(e,t);Tr.test(n)?e.setProperty(gt(s),n.replace(Tr,""),"important"):e[s]=n}}const Ar=["Webkit","Moz","ms"],Yn={};function Dc(e,t){const n=Yn[t];if(n)return n;let s=$e(t);if(s!=="filter"&&s in e)return Yn[t]=s;s=An(s);for(let r=0;rJn||(Wc.then(()=>Jn=0),Jn=Date.now());function Gc(e,t){const n=s=>{if(!s._vts)s._vts=Date.now();else if(s._vts<=n.attached)return;xe(zc(s,n.value),t,5,[s])};return n.value=e,n.attached=qc(),n}function zc(e,t){if($(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(s=>r=>!r._stopped&&s&&s(r))}else return t}const Mr=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,Xc=(e,t,n,s,r,i,o,l,c)=>{const f=r==="svg";t==="class"?Fc(e,s,f):t==="style"?Vc(e,n,s):Wt(t)?vs(t)||Bc(e,t,n,s,o):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):Yc(e,t,s,f))?(Uc(e,t,s,i,o,l,c),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&Rr(e,t,s,f,o,t!=="value")):(t==="true-value"?e._trueValue=s:t==="false-value"&&(e._falseValue=s),Rr(e,t,s,f))};function Yc(e,t,n,s){if(s)return!!(t==="innerHTML"||t==="textContent"||t in e&&Mr(t)&&K(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const r=e.tagName;if(r==="IMG"||r==="VIDEO"||r==="CANVAS"||r==="SOURCE")return!1}return Mr(t)&&re(n)?!1:t in e}const nt=e=>{const t=e.props["onUpdate:modelValue"]||!1;return $(t)?n=>un(t,n):t};function Jc(e){e.target.composing=!0}function Pr(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Te=Symbol("_assign"),pf={created(e,{modifiers:{lazy:t,trim:n,number:s}},r){e[Te]=nt(r);const i=s||r.props&&r.props.type==="number";De(e,t?"change":"input",o=>{if(o.target.composing)return;let l=e.value;n&&(l=l.trim()),i&&(l=mn(l)),e[Te](l)}),n&&De(e,"change",()=>{e.value=e.value.trim()}),t||(De(e,"compositionstart",Jc),De(e,"compositionend",Pr),De(e,"change",Pr))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:s,trim:r,number:i}},o){if(e[Te]=nt(o),e.composing)return;const l=(i||e.type==="number")&&!/^0\d/.test(e.value)?mn(e.value):e.value,c=t??"";l!==c&&(document.activeElement===e&&e.type!=="range"&&(s&&t===n||r&&e.value.trim()===c)||(e.value=c))}},gf={deep:!0,created(e,t,n){e[Te]=nt(n),De(e,"change",()=>{const s=e._modelValue,r=Tt(e),i=e.checked,o=e[Te];if($(s)){const l=xs(s,r),c=l!==-1;if(i&&!c)o(s.concat(r));else if(!i&&c){const f=[...s];f.splice(l,1),o(f)}}else if(Ot(s)){const l=new Set(s);i?l.add(r):l.delete(r),o(l)}else o(io(e,i))})},mounted:Nr,beforeUpdate(e,t,n){e[Te]=nt(n),Nr(e,t,n)}};function Nr(e,{value:t,oldValue:n},s){e._modelValue=t,$(t)?e.checked=xs(t,s.props.value)>-1:Ot(t)?e.checked=t.has(s.props.value):t!==n&&(e.checked=pt(t,io(e,!0)))}const mf={created(e,{value:t},n){e.checked=pt(t,n.props.value),e[Te]=nt(n),De(e,"change",()=>{e[Te](Tt(e))})},beforeUpdate(e,{value:t,oldValue:n},s){e[Te]=nt(s),t!==n&&(e.checked=pt(t,s.props.value))}},yf={deep:!0,created(e,{value:t,modifiers:{number:n}},s){const r=Ot(t);De(e,"change",()=>{const i=Array.prototype.filter.call(e.options,o=>o.selected).map(o=>n?mn(Tt(o)):Tt(o));e[Te](e.multiple?r?new Set(i):i:i[0]),e._assigning=!0,Gt(()=>{e._assigning=!1})}),e[Te]=nt(s)},mounted(e,{value:t,modifiers:{number:n}}){Fr(e,t)},beforeUpdate(e,t,n){e[Te]=nt(n)},updated(e,{value:t,modifiers:{number:n}}){e._assigning||Fr(e,t)}};function Fr(e,t,n){const s=e.multiple,r=$(t);if(!(s&&!r&&!Ot(t))){for(let i=0,o=e.options.length;iString(d)===String(c)):l.selected=xs(t,c)>-1}else l.selected=t.has(c);else if(pt(Tt(l),t)){e.selectedIndex!==i&&(e.selectedIndex=i);return}}!s&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function Tt(e){return"_value"in e?e._value:e.value}function io(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const Qc=["ctrl","shift","alt","meta"],Zc={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>Qc.some(n=>e[`${n}Key`]&&!t.includes(n))},_f=(e,t)=>{const n=e._withMods||(e._withMods={}),s=t.join(".");return n[s]||(n[s]=(r,...i)=>{for(let o=0;o{const n=e._withKeys||(e._withKeys={}),s=t.join(".");return n[s]||(n[s]=r=>{if(!("key"in r))return;const i=gt(r.key);if(t.some(o=>o===i||ea[o]===i))return e(r)})},ta=ie({patchProp:Xc},Rc);let Qn,$r=!1;function na(){return Qn=$r?Qn:tc(ta),$r=!0,Qn}const vf=(...e)=>{const t=na().createApp(...e),{mount:n}=t;return t.mount=s=>{const r=ra(s);if(r)return n(r,!0,sa(r))},t};function sa(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function ra(e){return re(e)?document.querySelector(e):e}const wf=(e,t)=>{const n=e.__vccOpts||e;for(const[s,r]of t)n[s]=r;return n},ia="modulepreload",oa=function(e){return"/"+e},Hr={},Ef=function(t,n,s){let r=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const i=document.querySelector("meta[property=csp-nonce]"),o=(i==null?void 0:i.nonce)||(i==null?void 0:i.getAttribute("nonce"));r=Promise.all(n.map(l=>{if(l=oa(l),l in Hr)return;Hr[l]=!0;const c=l.endsWith(".css"),f=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${f}`))return;const d=document.createElement("link");if(d.rel=c?"stylesheet":ia,c||(d.as="script",d.crossOrigin=""),d.href=l,o&&d.setAttribute("nonce",o),document.head.appendChild(d),c)return new Promise((h,b)=>{d.addEventListener("load",h),d.addEventListener("error",()=>b(new Error(`Unable to preload CSS for ${l}`)))})}))}return r.then(()=>t()).catch(i=>{const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=i,window.dispatchEvent(o),!o.defaultPrevented)throw i})},la=window.__VP_SITE_DATA__;function Vs(e){return Zr()?(Uo(e),!0):!1}function Ze(e){return typeof e=="function"?e():gi(e)}const oo=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const ca=Object.prototype.toString,aa=e=>ca.call(e)==="[object Object]",lo=()=>{},jr=fa();function fa(){var e,t;return oo&&((e=window==null?void 0:window.navigator)==null?void 0:e.userAgent)&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||((t=window==null?void 0:window.navigator)==null?void 0:t.maxTouchPoints)>2&&/iPad|Macintosh/.test(window==null?void 0:window.navigator.userAgent))}function ua(e,t){function n(...s){return new Promise((r,i)=>{Promise.resolve(e(()=>t.apply(this,s),{fn:t,thisArg:this,args:s})).then(r).catch(i)})}return n}const co=e=>e();function da(e=co){const t=fe(!0);function n(){t.value=!1}function s(){t.value=!0}const r=(...i)=>{t.value&&e(...i)};return{isActive:In(t),pause:n,resume:s,eventFilter:r}}function ha(e){return jn()}function ao(...e){if(e.length!==1)return ml(...e);const t=e[0];return typeof t=="function"?In(hl(()=>({get:t,set:lo}))):fe(t)}function pa(e,t,n={}){const{eventFilter:s=co,...r}=n;return Ne(e,ua(s,t),r)}function ga(e,t,n={}){const{eventFilter:s,...r}=n,{eventFilter:i,pause:o,resume:l,isActive:c}=da(s);return{stop:pa(e,t,{...r,eventFilter:i}),pause:o,resume:l,isActive:c}}function Ds(e,t=!0,n){ha()?Rt(e,n):t?e():Gt(e)}function fo(e){var t;const n=Ze(e);return(t=n==null?void 0:n.$el)!=null?t:n}const ke=oo?window:void 0;function At(...e){let t,n,s,r;if(typeof e[0]=="string"||Array.isArray(e[0])?([n,s,r]=e,t=ke):[t,n,s,r]=e,!t)return lo;Array.isArray(n)||(n=[n]),Array.isArray(s)||(s=[s]);const i=[],o=()=>{i.forEach(d=>d()),i.length=0},l=(d,h,b,T)=>(d.addEventListener(h,b,T),()=>d.removeEventListener(h,b,T)),c=Ne(()=>[fo(t),Ze(r)],([d,h])=>{if(o(),!d)return;const b=aa(h)?{...h}:h;i.push(...n.flatMap(T=>s.map(M=>l(d,T,M,b))))},{immediate:!0,flush:"post"}),f=()=>{c(),o()};return Vs(f),f}function ma(e){return typeof e=="function"?e:typeof e=="string"?t=>t.key===e:Array.isArray(e)?t=>e.includes(t.key):()=>!0}function Cf(...e){let t,n,s={};e.length===3?(t=e[0],n=e[1],s=e[2]):e.length===2?typeof e[1]=="object"?(t=!0,n=e[0],s=e[1]):(t=e[0],n=e[1]):(t=!0,n=e[0]);const{target:r=ke,eventName:i="keydown",passive:o=!1,dedupe:l=!1}=s,c=ma(t);return At(r,i,d=>{d.repeat&&Ze(l)||c(d)&&n(d)},o)}function ya(){const e=fe(!1),t=jn();return t&&Rt(()=>{e.value=!0},t),e}function _a(e){const t=ya();return se(()=>(t.value,!!e()))}function uo(e,t={}){const{window:n=ke}=t,s=_a(()=>n&&"matchMedia"in n&&typeof n.matchMedia=="function");let r;const i=fe(!1),o=f=>{i.value=f.matches},l=()=>{r&&("removeEventListener"in r?r.removeEventListener("change",o):r.removeListener(o))},c=Ui(()=>{s.value&&(l(),r=n.matchMedia(Ze(e)),"addEventListener"in r?r.addEventListener("change",o):r.addListener(o),i.value=r.matches)});return Vs(()=>{c(),l(),r=void 0}),i}const ln=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},cn="__vueuse_ssr_handlers__",ba=va();function va(){return cn in ln||(ln[cn]=ln[cn]||{}),ln[cn]}function ho(e,t){return ba[e]||t}function wa(e){return e==null?"any":e instanceof Set?"set":e instanceof Map?"map":e instanceof Date?"date":typeof e=="boolean"?"boolean":typeof e=="string"?"string":typeof e=="object"?"object":Number.isNaN(e)?"any":"number"}const Ea={boolean:{read:e=>e==="true",write:e=>String(e)},object:{read:e=>JSON.parse(e),write:e=>JSON.stringify(e)},number:{read:e=>Number.parseFloat(e),write:e=>String(e)},any:{read:e=>e,write:e=>String(e)},string:{read:e=>e,write:e=>String(e)},map:{read:e=>new Map(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e.entries()))},set:{read:e=>new Set(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e))},date:{read:e=>new Date(e),write:e=>e.toISOString()}},Vr="vueuse-storage";function Ca(e,t,n,s={}){var r;const{flush:i="pre",deep:o=!0,listenToStorageChanges:l=!0,writeDefaults:c=!0,mergeDefaults:f=!1,shallow:d,window:h=ke,eventFilter:b,onError:T=w=>{console.error(w)},initOnMounted:M}=s,P=(d?hi:fe)(typeof t=="function"?t():t);if(!n)try{n=ho("getDefaultStorage",()=>{var w;return(w=ke)==null?void 0:w.localStorage})()}catch(w){T(w)}if(!n)return P;const k=Ze(t),G=wa(k),z=(r=s.serializer)!=null?r:Ea[G],{pause:g,resume:m}=ga(P,()=>O(P.value),{flush:i,deep:o,eventFilter:b});h&&l&&Ds(()=>{At(h,"storage",D),At(h,Vr,I),M&&D()}),M||D();function L(w,N){h&&h.dispatchEvent(new CustomEvent(Vr,{detail:{key:e,oldValue:w,newValue:N,storageArea:n}}))}function O(w){try{const N=n.getItem(e);if(w==null)L(N,null),n.removeItem(e);else{const S=z.write(w);N!==S&&(n.setItem(e,S),L(N,S))}}catch(N){T(N)}}function U(w){const N=w?w.newValue:n.getItem(e);if(N==null)return c&&k!=null&&n.setItem(e,z.write(k)),k;if(!w&&f){const S=z.read(N);return typeof f=="function"?f(S,k):G==="object"&&!Array.isArray(S)?{...k,...S}:S}else return typeof N!="string"?N:z.read(N)}function D(w){if(!(w&&w.storageArea!==n)){if(w&&w.key==null){P.value=k;return}if(!(w&&w.key!==e)){g();try{(w==null?void 0:w.newValue)!==z.write(P.value)&&(P.value=U(w))}catch(N){T(N)}finally{w?Gt(m):m()}}}}function I(w){D(w.detail)}return P}function po(e){return uo("(prefers-color-scheme: dark)",e)}function Sa(e={}){const{selector:t="html",attribute:n="class",initialValue:s="auto",window:r=ke,storage:i,storageKey:o="vueuse-color-scheme",listenToStorageChanges:l=!0,storageRef:c,emitAuto:f,disableTransition:d=!0}=e,h={auto:"",light:"light",dark:"dark",...e.modes||{}},b=po({window:r}),T=se(()=>b.value?"dark":"light"),M=c||(o==null?ao(s):Ca(o,s,i,{window:r,listenToStorageChanges:l})),P=se(()=>M.value==="auto"?T.value:M.value),k=ho("updateHTMLAttrs",(m,L,O)=>{const U=typeof m=="string"?r==null?void 0:r.document.querySelector(m):fo(m);if(!U)return;let D;if(d&&(D=r.document.createElement("style"),D.appendChild(document.createTextNode("*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),r.document.head.appendChild(D)),L==="class"){const I=O.split(/\s/g);Object.values(h).flatMap(w=>(w||"").split(/\s/g)).filter(Boolean).forEach(w=>{I.includes(w)?U.classList.add(w):U.classList.remove(w)})}else U.setAttribute(L,O);d&&(r.getComputedStyle(D).opacity,document.head.removeChild(D))});function G(m){var L;k(t,n,(L=h[m])!=null?L:m)}function z(m){e.onChanged?e.onChanged(m,G):G(m)}Ne(P,z,{flush:"post",immediate:!0}),Ds(()=>z(P.value));const g=se({get(){return f?M.value:P.value},set(m){M.value=m}});try{return Object.assign(g,{store:M,system:T,state:P})}catch{return g}}function xa(e={}){const{valueDark:t="dark",valueLight:n="",window:s=ke}=e,r=Sa({...e,onChanged:(l,c)=>{var f;e.onChanged?(f=e.onChanged)==null||f.call(e,l==="dark",c,l):c(l)},modes:{dark:t,light:n}}),i=se(()=>r.system?r.system.value:po({window:s}).value?"dark":"light");return se({get(){return r.value==="dark"},set(l){const c=l?"dark":"light";i.value===c?r.value="auto":r.value=c}})}function Zn(e){return typeof Window<"u"&&e instanceof Window?e.document.documentElement:typeof Document<"u"&&e instanceof Document?e.documentElement:e}function go(e){const t=window.getComputedStyle(e);if(t.overflowX==="scroll"||t.overflowY==="scroll"||t.overflowX==="auto"&&e.clientWidth1?!0:(t.preventDefault&&t.preventDefault(),!1)}const es=new WeakMap;function Sf(e,t=!1){const n=fe(t);let s=null,r="";Ne(ao(e),l=>{const c=Zn(Ze(l));if(c){const f=c;if(es.get(f)||es.set(f,f.style.overflow),f.style.overflow!=="hidden"&&(r=f.style.overflow),f.style.overflow==="hidden")return n.value=!0;if(n.value)return f.style.overflow="hidden"}},{immediate:!0});const i=()=>{const l=Zn(Ze(e));!l||n.value||(jr&&(s=At(l,"touchmove",c=>{Ta(c)},{passive:!1})),l.style.overflow="hidden",n.value=!0)},o=()=>{const l=Zn(Ze(e));!l||!n.value||(jr&&(s==null||s()),l.style.overflow=r,es.delete(l),n.value=!1)};return Vs(o),se({get(){return n.value},set(l){l?i():o()}})}function xf(e={}){const{window:t=ke,behavior:n="auto"}=e;if(!t)return{x:fe(0),y:fe(0)};const s=fe(t.scrollX),r=fe(t.scrollY),i=se({get(){return s.value},set(l){scrollTo({left:l,behavior:n})}}),o=se({get(){return r.value},set(l){scrollTo({top:l,behavior:n})}});return At(t,"scroll",()=>{s.value=t.scrollX,r.value=t.scrollY},{capture:!1,passive:!0}),{x:i,y:o}}function Tf(e={}){const{window:t=ke,initialWidth:n=Number.POSITIVE_INFINITY,initialHeight:s=Number.POSITIVE_INFINITY,listenOrientation:r=!0,includeScrollbar:i=!0}=e,o=fe(n),l=fe(s),c=()=>{t&&(i?(o.value=t.innerWidth,l.value=t.innerHeight):(o.value=t.document.documentElement.clientWidth,l.value=t.document.documentElement.clientHeight))};if(c(),Ds(c),At("resize",c,{passive:!0}),r){const f=uo("(orientation: portrait)");Ne(f,()=>c())}return{width:o,height:l}}var ts={BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1},ns={};const mo=/^(?:[a-z]+:|\/\/)/i,Aa="vitepress-theme-appearance",Oa=/#.*$/,Ra=/[?#].*$/,Ia=/(?:(^|\/)index)?\.(?:md|html)$/,de=typeof document<"u",yo={relativePath:"404.md",filePath:"",title:"404",description:"Not Found",headers:[],frontmatter:{sidebar:!1,layout:"page"},lastUpdated:0,isNotFound:!0};function La(e,t,n=!1){if(t===void 0)return!1;if(e=Dr(`/${e}`),n)return new RegExp(t).test(e);if(Dr(t)!==e)return!1;const s=t.match(Oa);return s?(de?location.hash:"")===s[0]:!0}function Dr(e){return decodeURI(e).replace(Ra,"").replace(Ia,"$1")}function Ma(e){return mo.test(e)}function Pa(e,t){return Object.keys((e==null?void 0:e.locales)||{}).find(n=>n!=="root"&&!Ma(n)&&La(t,`/${n}/`,!0))||"root"}function Na(e,t){var s,r,i,o,l,c,f;const n=Pa(e,t);return Object.assign({},e,{localeIndex:n,lang:((s=e.locales[n])==null?void 0:s.lang)??e.lang,dir:((r=e.locales[n])==null?void 0:r.dir)??e.dir,title:((i=e.locales[n])==null?void 0:i.title)??e.title,titleTemplate:((o=e.locales[n])==null?void 0:o.titleTemplate)??e.titleTemplate,description:((l=e.locales[n])==null?void 0:l.description)??e.description,head:bo(e.head,((c=e.locales[n])==null?void 0:c.head)??[]),themeConfig:{...e.themeConfig,...(f=e.locales[n])==null?void 0:f.themeConfig}})}function _o(e,t){const n=t.title||e.title,s=t.titleTemplate??e.titleTemplate;if(typeof s=="string"&&s.includes(":title"))return s.replace(/:title/g,n);const r=Fa(e.title,s);return n===r.slice(3)?n:`${n}${r}`}function Fa(e,t){return t===!1?"":t===!0||t===void 0?` | ${e}`:e===t?"":` | ${t}`}function $a(e,t){const[n,s]=t;if(n!=="meta")return!1;const r=Object.entries(s)[0];return r==null?!1:e.some(([i,o])=>i===n&&o[r[0]]===r[1])}function bo(e,t){return[...e.filter(n=>!$a(t,n)),...t]}const Ha=/[\u0000-\u001F"#$&*+,:;<=>?[\]^`{|}\u007F]/g,ja=/^[a-z]:/i;function Ur(e){const t=ja.exec(e),n=t?t[0]:"";return n+e.slice(n.length).replace(Ha,"_").replace(/(^|\/)_+(?=[^/]*$)/,"$1")}const ss=new Set;function Va(e){if(ss.size===0){const n=typeof process=="object"&&(ns==null?void 0:ns.VITE_EXTRA_EXTENSIONS)||(ts==null?void 0:ts.VITE_EXTRA_EXTENSIONS)||"";("3g2,3gp,aac,ai,apng,au,avif,bin,bmp,cer,class,conf,crl,css,csv,dll,doc,eps,epub,exe,gif,gz,ics,ief,jar,jpe,jpeg,jpg,js,json,jsonld,m4a,man,mid,midi,mjs,mov,mp2,mp3,mp4,mpe,mpeg,mpg,mpp,oga,ogg,ogv,ogx,opus,otf,p10,p7c,p7m,p7s,pdf,png,ps,qt,roff,rtf,rtx,ser,svg,t,tif,tiff,tr,ts,tsv,ttf,txt,vtt,wav,weba,webm,webp,woff,woff2,xhtml,xml,yaml,yml,zip"+(n&&typeof n=="string"?","+n:"")).split(",").forEach(s=>ss.add(s))}const t=e.split(".").pop();return t==null||!ss.has(t.toLowerCase())}const Da=Symbol(),ht=hi(la);function Af(e){const t=se(()=>Na(ht.value,e.data.relativePath)),n=t.value.appearance,s=n==="force-dark"?fe(!0):n?xa({storageKey:Aa,initialValue:()=>typeof n=="string"?n:"auto",...typeof n=="object"?n:{}}):fe(!1),r=fe(de?location.hash:"");return de&&window.addEventListener("hashchange",()=>{r.value=location.hash}),Ne(()=>e.data,()=>{r.value=de?location.hash:""}),{site:t,theme:se(()=>t.value.themeConfig),page:se(()=>e.data),frontmatter:se(()=>e.data.frontmatter),params:se(()=>e.data.params),lang:se(()=>t.value.lang),dir:se(()=>e.data.frontmatter.dir||t.value.dir),localeIndex:se(()=>t.value.localeIndex||"root"),title:se(()=>_o(t.value,e.data)),description:se(()=>e.data.description||t.value.description),isDark:s,hash:se(()=>r.value)}}function Ua(){const e=St(Da);if(!e)throw new Error("vitepress data not properly injected in app");return e}function ka(e,t){return`${e}${t}`.replace(/\/+/g,"/")}function kr(e){return mo.test(e)||!e.startsWith("/")?e:ka(ht.value.base,e)}function Ba(e){let t=e.replace(/\.html$/,"");if(t=decodeURIComponent(t),t=t.replace(/\/$/,"/index"),de){const n="/";t=Ur(t.slice(n.length).replace(/\//g,"_")||"index")+".md";let s=__VP_HASH_MAP__[t.toLowerCase()];if(s||(t=t.endsWith("_index.md")?t.slice(0,-9)+".md":t.slice(0,-3)+"_index.md",s=__VP_HASH_MAP__[t.toLowerCase()]),!s)return null;t=`${n}assets/${t}.${s}.js`}else t=`./${Ur(t.slice(1).replace(/\//g,"_"))}.md.js`;return t}let gn=[];function Of(e){gn.push(e),Fn(()=>{gn=gn.filter(t=>t!==e)})}function Ka(){let e=ht.value.scrollOffset,t=0,n=24;if(typeof e=="object"&&"padding"in e&&(n=e.padding,e=e.selector),typeof e=="number")t=e;else if(typeof e=="string")t=Br(e,n);else if(Array.isArray(e))for(const s of e){const r=Br(s,n);if(r){t=r;break}}return t}function Br(e,t){const n=document.querySelector(e);if(!n)return 0;const s=n.getBoundingClientRect().bottom;return s<0?0:s+t}const Wa=Symbol(),vo="http://a.com",qa=()=>({path:"/",component:null,data:yo});function Rf(e,t){const n=Rn(qa()),s={route:n,go:r};async function r(l=de?location.href:"/"){var c,f;l=rs(l),await((c=s.onBeforeRouteChange)==null?void 0:c.call(s,l))!==!1&&(de&&l!==rs(location.href)&&(history.replaceState({scrollPosition:window.scrollY},""),history.pushState({},"",l)),await o(l),await((f=s.onAfterRouteChanged)==null?void 0:f.call(s,l)))}let i=null;async function o(l,c=0,f=!1){var b;if(await((b=s.onBeforePageLoad)==null?void 0:b.call(s,l))===!1)return;const d=new URL(l,vo),h=i=d.pathname;try{let T=await e(h);if(!T)throw new Error(`Page not found: ${h}`);if(i===h){i=null;const{default:M,__pageData:P}=T;if(!M)throw new Error(`Invalid route component: ${M}`);n.path=de?h:kr(h),n.component=dn(M),n.data=dn(P),de&&Gt(()=>{let k=ht.value.base+P.relativePath.replace(/(?:(^|\/)index)?\.md$/,"$1");if(!ht.value.cleanUrls&&!k.endsWith("/")&&(k+=".html"),k!==d.pathname&&(d.pathname=k,l=k+d.search+d.hash,history.replaceState({},"",l)),d.hash&&!c){let G=null;try{G=document.getElementById(decodeURIComponent(d.hash).slice(1))}catch(z){console.warn(z)}if(G){Kr(G,d.hash);return}}window.scrollTo(0,c)})}}catch(T){if(!/fetch|Page not found/.test(T.message)&&!/^\/404(\.html|\/)?$/.test(l)&&console.error(T),!f)try{const M=await fetch(ht.value.base+"hashmap.json");window.__VP_HASH_MAP__=await M.json(),await o(l,c,!0);return}catch{}if(i===h){i=null,n.path=de?h:kr(h),n.component=t?dn(t):null;const M=de?h.replace(/(^|\/)$/,"$1index").replace(/(\.html)?$/,".md").replace(/^\//,""):"404.md";n.data={...yo,relativePath:M}}}}return de&&(history.state===null&&history.replaceState({},""),window.addEventListener("click",l=>{if(l.target.closest("button"))return;const f=l.target.closest("a");if(f&&!f.closest(".vp-raw")&&(f instanceof SVGElement||!f.download)){const{target:d}=f,{href:h,origin:b,pathname:T,hash:M,search:P}=new URL(f.href instanceof SVGAnimatedString?f.href.animVal:f.href,f.baseURI),k=new URL(location.href);!l.ctrlKey&&!l.shiftKey&&!l.altKey&&!l.metaKey&&!d&&b===k.origin&&Va(T)&&(l.preventDefault(),T===k.pathname&&P===k.search?(M!==k.hash&&(history.pushState({},"",h),window.dispatchEvent(new HashChangeEvent("hashchange",{oldURL:k.href,newURL:h}))),M?Kr(f,M,f.classList.contains("header-anchor")):window.scrollTo(0,0)):r(h))}},{capture:!0}),window.addEventListener("popstate",async l=>{var c;l.state!==null&&(await o(rs(location.href),l.state&&l.state.scrollPosition||0),(c=s.onAfterRouteChanged)==null||c.call(s,location.href))}),window.addEventListener("hashchange",l=>{l.preventDefault()})),s}function Ga(){const e=St(Wa);if(!e)throw new Error("useRouter() is called without provider.");return e}function wo(){return Ga().route}function Kr(e,t,n=!1){let s=null;try{s=e.classList.contains("header-anchor")?e:document.getElementById(decodeURIComponent(t).slice(1))}catch(r){console.warn(r)}if(s){let r=function(){!n||Math.abs(o-window.scrollY)>window.innerHeight?window.scrollTo(0,o):window.scrollTo({left:0,top:o,behavior:"smooth"})};const i=parseInt(window.getComputedStyle(s).paddingTop,10),o=window.scrollY+s.getBoundingClientRect().top-Ka()+i;requestAnimationFrame(r)}}function rs(e){const t=new URL(e,vo);return t.pathname=t.pathname.replace(/(^|\/)index(\.html)?$/,"$1"),ht.value.cleanUrls?t.pathname=t.pathname.replace(/\.html$/,""):!t.pathname.endsWith("/")&&!t.pathname.endsWith(".html")&&(t.pathname+=".html"),t.pathname+t.search+t.hash}const is=()=>gn.forEach(e=>e()),If=Ti({name:"VitePressContent",props:{as:{type:[Object,String],default:"div"}},setup(e){const t=wo(),{site:n}=Ua();return()=>_s(e.as,n.value.contentProps??{style:{position:"relative"}},[t.component?_s(t.component,{onVnodeMounted:is,onVnodeUpdated:is,onVnodeUnmounted:is}):"404 Page Not Found"])}}),Lf=Ti({setup(e,{slots:t}){const n=fe(!1);return Rt(()=>{n.value=!0}),()=>n.value&&t.default?t.default():null}});function Mf(){de&&window.addEventListener("click",e=>{var n;const t=e.target;if(t.matches(".vp-code-group input")){const s=(n=t.parentElement)==null?void 0:n.parentElement;if(!s)return;const r=Array.from(s.querySelectorAll("input")).indexOf(t);if(r<0)return;const i=s.querySelector(".blocks");if(!i)return;const o=Array.from(i.children).find(f=>f.classList.contains("active"));if(!o)return;const l=i.children[r];if(!l||o===l)return;o.classList.remove("active"),l.classList.add("active");const c=s==null?void 0:s.querySelector(`label[for="${t.id}"]`);c==null||c.scrollIntoView({block:"nearest"})}})}function Pf(){if(de){const e=new WeakMap;window.addEventListener("click",t=>{var s;const n=t.target;if(n.matches('div[class*="language-"] > button.copy')){const r=n.parentElement,i=(s=n.nextElementSibling)==null?void 0:s.nextElementSibling;if(!r||!i)return;const o=/language-(shellscript|shell|bash|sh|zsh)/.test(r.className),l=[".vp-copy-ignore",".diff.remove"],c=i.cloneNode(!0);c.querySelectorAll(l.join(",")).forEach(d=>d.remove());let f=c.textContent||"";o&&(f=f.replace(/^ *(\$|>) /gm,"").trim()),za(f).then(()=>{n.classList.add("copied"),clearTimeout(e.get(n));const d=setTimeout(()=>{n.classList.remove("copied"),n.blur(),e.delete(n)},2e3);e.set(n,d)})}})}}async function za(e){try{return navigator.clipboard.writeText(e)}catch{const t=document.createElement("textarea"),n=document.activeElement;t.value=e,t.setAttribute("readonly",""),t.style.contain="strict",t.style.position="absolute",t.style.left="-9999px",t.style.fontSize="12pt";const s=document.getSelection(),r=s?s.rangeCount>0&&s.getRangeAt(0):null;document.body.appendChild(t),t.select(),t.selectionStart=0,t.selectionEnd=e.length,document.execCommand("copy"),document.body.removeChild(t),r&&(s.removeAllRanges(),s.addRange(r)),n&&n.focus()}}function Nf(e,t){let n=!0,s=[];const r=i=>{if(n){n=!1,i.forEach(l=>{const c=os(l);for(const f of document.head.children)if(f.isEqualNode(c)){s.push(f);return}});return}const o=i.map(os);s.forEach((l,c)=>{const f=o.findIndex(d=>d==null?void 0:d.isEqualNode(l??null));f!==-1?delete o[f]:(l==null||l.remove(),delete s[c])}),o.forEach(l=>l&&document.head.appendChild(l)),s=[...s,...o].filter(Boolean)};Ui(()=>{const i=e.data,o=t.value,l=i&&i.description,c=i&&i.frontmatter.head||[],f=_o(o,i);f!==document.title&&(document.title=f);const d=l||o.description;let h=document.querySelector("meta[name=description]");h?h.getAttribute("content")!==d&&h.setAttribute("content",d):os(["meta",{name:"description",content:d}]),r(bo(o.head,Ya(c)))})}function os([e,t,n]){const s=document.createElement(e);for(const r in t)s.setAttribute(r,t[r]);return n&&(s.innerHTML=n),e==="script"&&!t.async&&(s.async=!1),s}function Xa(e){return e[0]==="meta"&&e[1]&&e[1].name==="description"}function Ya(e){return e.filter(t=>!Xa(t))}const ls=new Set,Eo=()=>document.createElement("link"),Ja=e=>{const t=Eo();t.rel="prefetch",t.href=e,document.head.appendChild(t)},Qa=e=>{const t=new XMLHttpRequest;t.open("GET",e,t.withCredentials=!0),t.send()};let an;const Za=de&&(an=Eo())&&an.relList&&an.relList.supports&&an.relList.supports("prefetch")?Ja:Qa;function Ff(){if(!de||!window.IntersectionObserver)return;let e;if((e=navigator.connection)&&(e.saveData||/2g/.test(e.effectiveType)))return;const t=window.requestIdleCallback||setTimeout;let n=null;const s=()=>{n&&n.disconnect(),n=new IntersectionObserver(i=>{i.forEach(o=>{if(o.isIntersecting){const l=o.target;n.unobserve(l);const{pathname:c}=l;if(!ls.has(c)){ls.add(c);const f=Ba(c);f&&Za(f)}}})}),t(()=>{document.querySelectorAll("#app a").forEach(i=>{const{hostname:o,pathname:l}=new URL(i.href instanceof SVGAnimatedString?i.href.animVal:i.href,i.baseURI),c=l.match(/\.\w+$/);c&&c[0]!==".html"||i.target!=="_blank"&&o===location.hostname&&(l!==location.pathname?n.observe(i):ls.add(l))})})};Rt(s);const r=wo();Ne(()=>r.path,s),Fn(()=>{n&&n.disconnect()})}export{_f as $,ff as A,Ml as B,Ka as C,nf as D,of as E,_e as F,hi as G,Of as H,ue as I,sf as J,mo as K,wo as L,yc as M,St as N,Tf as O,Cs as P,Cf as Q,Gt as R,xf as S,so as T,de as U,In as V,Sf as W,ql as X,bf as Y,cf as Z,wf as _,Zi as a,af as a0,df as a1,rf as a2,yf as a3,pf as a4,mf as a5,gf as a6,Nf as a7,Wa as a8,Af as a9,Da as aa,If as ab,Lf as ac,ht as ad,vf as ae,Rf as af,Ba as ag,Ff as ah,Pf as ai,Mf as aj,_s as ak,Ef as al,Yi as b,uf as c,Ti as d,hf as e,Va as f,kr as g,se as h,Ma as i,Qi as j,gi as k,tf as l,La as m,Ss as n,zi as o,ef as p,uo as q,lf as r,fe as s,jo as t,Ua as u,Ne as v,Sl as w,Ui as x,Rt as y,Fn as z}; diff --git a/assets/chunks/theme.5IQMzWyn.js b/assets/chunks/theme.5IQMzWyn.js deleted file mode 100644 index e6cccdf8..00000000 --- a/assets/chunks/theme.5IQMzWyn.js +++ /dev/null @@ -1 +0,0 @@ -import{d as _,o as a,c,r as l,n as w,a as D,t as I,b,w as v,e as f,T as de,_ as k,u as ge,i as Ue,f as Ge,g as ve,h as $,j as p,k as r,p as C,l as H,m as z,q as ie,s as T,v as j,x as J,y as R,z as pe,A as ye,B as je,C as ze,D as q,F as M,E,G as Pe,H as ee,I as m,J as K,K as Le,L as te,M as X,N as oe,O as qe,P as Ve,Q as We,R as Ke,S as Se,U as Y,V as Re,W as Ie,X as Te,Y as Je,Z as Ye,$ as Qe,a0 as Xe}from"./framework.gjrnbxUT.js";const Ze=_({__name:"VPBadge",props:{text:{},type:{default:"tip"}},setup(o){return(e,t)=>(a(),c("span",{class:w(["VPBadge",e.type])},[l(e.$slots,"default",{},()=>[D(I(e.text),1)])],2))}}),xe={key:0,class:"VPBackdrop"},et=_({__name:"VPBackdrop",props:{show:{type:Boolean}},setup(o){return(e,t)=>(a(),b(de,{name:"fade"},{default:v(()=>[e.show?(a(),c("div",xe)):f("",!0)]),_:1}))}}),tt=k(et,[["__scopeId","data-v-c79a1216"]]),L=ge;function ot(o,e){let t,n=!1;return()=>{t&&clearTimeout(t),n?t=setTimeout(o,e):(o(),(n=!0)&&setTimeout(()=>n=!1,e))}}function le(o){return/^\//.test(o)?o:`/${o}`}function he(o){const{pathname:e,search:t,hash:n,protocol:s}=new URL(o,"http://a.com");if(Ue(o)||o.startsWith("#")||!s.startsWith("http")||!Ge(e))return o;const{site:i}=L(),u=e.endsWith("/")||e.endsWith(".html")?o:o.replace(/(?:(^\.+)\/)?.*$/,`$1${e.replace(/(\.md)?$/,i.value.cleanUrls?"":".html")}${t}${n}`);return ve(u)}function Q({correspondingLink:o=!1}={}){const{site:e,localeIndex:t,page:n,theme:s,hash:i}=L(),u=$(()=>{var d,g;return{label:(d=e.value.locales[t.value])==null?void 0:d.label,link:((g=e.value.locales[t.value])==null?void 0:g.link)||(t.value==="root"?"/":`/${t.value}/`)}});return{localeLinks:$(()=>Object.entries(e.value.locales).flatMap(([d,g])=>u.value.label===g.label?[]:{text:g.label,link:st(g.link||(d==="root"?"/":`/${d}/`),s.value.i18nRouting!==!1&&o,n.value.relativePath.slice(u.value.link.length-1),!e.value.cleanUrls)+i.value})),currentLang:u}}function st(o,e,t,n){return e?o.replace(/\/$/,"")+le(t.replace(/(^|\/)index\.md$/,"$1").replace(/\.md$/,n?".html":"")):o}const nt=o=>(C("data-v-d6be1790"),o=o(),H(),o),at={class:"NotFound"},rt={class:"code"},it={class:"title"},lt=nt(()=>p("div",{class:"divider"},null,-1)),ct={class:"quote"},ut={class:"action"},dt=["href","aria-label"],vt=_({__name:"NotFound",setup(o){const{theme:e}=L(),{currentLang:t}=Q();return(n,s)=>{var i,u,h,d,g;return a(),c("div",at,[p("p",rt,I(((i=r(e).notFound)==null?void 0:i.code)??"404"),1),p("h1",it,I(((u=r(e).notFound)==null?void 0:u.title)??"PAGE NOT FOUND"),1),lt,p("blockquote",ct,I(((h=r(e).notFound)==null?void 0:h.quote)??"But if you don't change your direction, and if you keep looking, you may end up where you are heading."),1),p("div",ut,[p("a",{class:"link",href:r(ve)(r(t).link),"aria-label":((d=r(e).notFound)==null?void 0:d.linkLabel)??"go to home"},I(((g=r(e).notFound)==null?void 0:g.linkText)??"Take me home"),9,dt)])])}}}),pt=k(vt,[["__scopeId","data-v-d6be1790"]]);function we(o,e){if(Array.isArray(o))return Z(o);if(o==null)return[];e=le(e);const t=Object.keys(o).sort((s,i)=>i.split("/").length-s.split("/").length).find(s=>e.startsWith(le(s))),n=t?o[t]:[];return Array.isArray(n)?Z(n):Z(n.items,n.base)}function ht(o){const e=[];let t=0;for(const n in o){const s=o[n];if(s.items){t=e.push(s);continue}e[t]||e.push({items:[]}),e[t].items.push(s)}return e}function ft(o){const e=[];function t(n){for(const s of n)s.text&&s.link&&e.push({text:s.text,link:s.link,docFooterText:s.docFooterText}),s.items&&t(s.items)}return t(o),e}function ce(o,e){return Array.isArray(e)?e.some(t=>ce(o,t)):z(o,e.link)?!0:e.items?ce(o,e.items):!1}function Z(o,e){return[...o].map(t=>{const n={...t},s=n.base||e;return s&&n.link&&(n.link=s+n.link),n.items&&(n.items=Z(n.items,s)),n})}function O(){const{frontmatter:o,page:e,theme:t}=L(),n=ie("(min-width: 960px)"),s=T(!1),i=$(()=>{const B=t.value.sidebar,S=e.value.relativePath;return B?we(B,S):[]}),u=T(i.value);j(i,(B,S)=>{JSON.stringify(B)!==JSON.stringify(S)&&(u.value=i.value)});const h=$(()=>o.value.sidebar!==!1&&u.value.length>0&&o.value.layout!=="home"),d=$(()=>g?o.value.aside==null?t.value.aside==="left":o.value.aside==="left":!1),g=$(()=>o.value.layout==="home"?!1:o.value.aside!=null?!!o.value.aside:t.value.aside!==!1),P=$(()=>h.value&&n.value),y=$(()=>h.value?ht(u.value):[]);function V(){s.value=!0}function N(){s.value=!1}function A(){s.value?N():V()}return{isOpen:s,sidebar:u,sidebarGroups:y,hasSidebar:h,hasAside:g,leftAside:d,isSidebarEnabled:P,open:V,close:N,toggle:A}}function _t(o,e){let t;J(()=>{t=o.value?document.activeElement:void 0}),R(()=>{window.addEventListener("keyup",n)}),pe(()=>{window.removeEventListener("keyup",n)});function n(s){s.key==="Escape"&&o.value&&(e(),t==null||t.focus())}}function mt(o){const{page:e,hash:t}=L(),n=T(!1),s=$(()=>o.value.collapsed!=null),i=$(()=>!!o.value.link),u=T(!1),h=()=>{u.value=z(e.value.relativePath,o.value.link)};j([e,o,t],h),R(h);const d=$(()=>u.value?!0:o.value.items?ce(e.value.relativePath,o.value.items):!1),g=$(()=>!!(o.value.items&&o.value.items.length));J(()=>{n.value=!!(s.value&&o.value.collapsed)}),ye(()=>{(u.value||d.value)&&(n.value=!1)});function P(){s.value&&(n.value=!n.value)}return{collapsed:n,collapsible:s,isLink:i,isActiveLink:u,hasActiveLink:d,hasChildren:g,toggle:P}}function kt(){const{hasSidebar:o}=O(),e=ie("(min-width: 960px)"),t=ie("(min-width: 1280px)");return{isAsideEnabled:$(()=>!t.value&&!e.value?!1:o.value?t.value:e.value)}}const ue=[];function Ne(o){return typeof o.outline=="object"&&!Array.isArray(o.outline)&&o.outline.label||o.outlineTitle||"On this page"}function fe(o){const e=[...document.querySelectorAll(".VPDoc :where(h1,h2,h3,h4,h5,h6)")].filter(t=>t.id&&t.hasChildNodes()).map(t=>{const n=Number(t.tagName[1]);return{element:t,title:bt(t),link:"#"+t.id,level:n}});return $t(e,o)}function bt(o){let e="";for(const t of o.childNodes)if(t.nodeType===1){if(t.classList.contains("VPBadge")||t.classList.contains("header-anchor")||t.classList.contains("ignore-header"))continue;e+=t.textContent}else t.nodeType===3&&(e+=t.textContent);return e.trim()}function $t(o,e){if(e===!1)return[];const t=(typeof e=="object"&&!Array.isArray(e)?e.level:e)||2,[n,s]=typeof t=="number"?[t,t]:t==="deep"?[2,6]:t;o=o.filter(u=>u.level>=n&&u.level<=s),ue.length=0;for(const{element:u,link:h}of o)ue.push({element:u,link:h});const i=[];e:for(let u=0;u=0;d--){const g=o[d];if(g.level{requestAnimationFrame(i),window.addEventListener("scroll",n)}),je(()=>{u(location.hash)}),pe(()=>{window.removeEventListener("scroll",n)});function i(){if(!t.value)return;const h=window.scrollY,d=window.innerHeight,g=document.body.offsetHeight,P=Math.abs(h+d-g)<1,y=ue.map(({element:N,link:A})=>({link:A,top:yt(N)})).filter(({top:N})=>!Number.isNaN(N)).sort((N,A)=>N.top-A.top);if(!y.length){u(null);return}if(h<1){u(null);return}if(P){u(y[y.length-1].link);return}let V=null;for(const{link:N,top:A}of y){if(A>h+ze()+4)break;V=N}u(V)}function u(h){s&&s.classList.remove("active"),h==null?s=null:s=o.value.querySelector(`a[href="${decodeURIComponent(h)}"]`);const d=s;d?(d.classList.add("active"),e.value.style.top=d.offsetTop+39+"px",e.value.style.opacity="1"):(e.value.style.top="33px",e.value.style.opacity="0")}}function yt(o){let e=0;for(;o!==document.body;){if(o===null)return NaN;e+=o.offsetTop,o=o.offsetParent}return e}const Pt=["href","title"],Lt=_({__name:"VPDocOutlineItem",props:{headers:{},root:{type:Boolean}},setup(o){function e({target:t}){const n=t.href.split("#")[1],s=document.getElementById(decodeURIComponent(n));s==null||s.focus({preventScroll:!0})}return(t,n)=>{const s=q("VPDocOutlineItem",!0);return a(),c("ul",{class:w(["VPDocOutlineItem",t.root?"root":"nested"])},[(a(!0),c(M,null,E(t.headers,({children:i,link:u,title:h})=>(a(),c("li",null,[p("a",{class:"outline-link",href:u,onClick:e,title:h},I(h),9,Pt),i!=null&&i.length?(a(),b(s,{key:0,headers:i},null,8,["headers"])):f("",!0)]))),256))],2)}}}),Me=k(Lt,[["__scopeId","data-v-b933a997"]]),Vt={class:"content"},St={"aria-level":"2",class:"outline-title",id:"doc-outline-aria-label",role:"heading"},It=_({__name:"VPDocAsideOutline",setup(o){const{frontmatter:e,theme:t}=L(),n=Pe([]);ee(()=>{n.value=fe(e.value.outline??t.value.outline)});const s=T(),i=T();return gt(s,i),(u,h)=>(a(),c("nav",{"aria-labelledby":"doc-outline-aria-label",class:w(["VPDocAsideOutline",{"has-outline":n.value.length>0}]),ref_key:"container",ref:s},[p("div",Vt,[p("div",{class:"outline-marker",ref_key:"marker",ref:i},null,512),p("div",St,I(r(Ne)(r(t))),1),m(Me,{headers:n.value,root:!0},null,8,["headers"])])],2))}}),Tt=k(It,[["__scopeId","data-v-a5bbad30"]]),wt={class:"VPDocAsideCarbonAds"},Nt=_({__name:"VPDocAsideCarbonAds",props:{carbonAds:{}},setup(o){const e=()=>null;return(t,n)=>(a(),c("div",wt,[m(r(e),{"carbon-ads":t.carbonAds},null,8,["carbon-ads"])]))}}),Mt=o=>(C("data-v-3f215769"),o=o(),H(),o),At={class:"VPDocAside"},Bt=Mt(()=>p("div",{class:"spacer"},null,-1)),Ct=_({__name:"VPDocAside",setup(o){const{theme:e}=L();return(t,n)=>(a(),c("div",At,[l(t.$slots,"aside-top",{},void 0,!0),l(t.$slots,"aside-outline-before",{},void 0,!0),m(Tt),l(t.$slots,"aside-outline-after",{},void 0,!0),Bt,l(t.$slots,"aside-ads-before",{},void 0,!0),r(e).carbonAds?(a(),b(Nt,{key:0,"carbon-ads":r(e).carbonAds},null,8,["carbon-ads"])):f("",!0),l(t.$slots,"aside-ads-after",{},void 0,!0),l(t.$slots,"aside-bottom",{},void 0,!0)]))}}),Ht=k(Ct,[["__scopeId","data-v-3f215769"]]);function Et(){const{theme:o,page:e}=L();return $(()=>{const{text:t="Edit this page",pattern:n=""}=o.value.editLink||{};let s;return typeof n=="function"?s=n(e.value):s=n.replace(/:path/g,e.value.filePath),{url:s,text:t}})}function Ft(){const{page:o,theme:e,frontmatter:t}=L();return $(()=>{var g,P,y,V,N,A,B,S;const n=we(e.value.sidebar,o.value.relativePath),s=ft(n),i=Dt(s,U=>U.link.replace(/[?#].*$/,"")),u=i.findIndex(U=>z(o.value.relativePath,U.link)),h=((g=e.value.docFooter)==null?void 0:g.prev)===!1&&!t.value.prev||t.value.prev===!1,d=((P=e.value.docFooter)==null?void 0:P.next)===!1&&!t.value.next||t.value.next===!1;return{prev:h?void 0:{text:(typeof t.value.prev=="string"?t.value.prev:typeof t.value.prev=="object"?t.value.prev.text:void 0)??((y=i[u-1])==null?void 0:y.docFooterText)??((V=i[u-1])==null?void 0:V.text),link:(typeof t.value.prev=="object"?t.value.prev.link:void 0)??((N=i[u-1])==null?void 0:N.link)},next:d?void 0:{text:(typeof t.value.next=="string"?t.value.next:typeof t.value.next=="object"?t.value.next.text:void 0)??((A=i[u+1])==null?void 0:A.docFooterText)??((B=i[u+1])==null?void 0:B.text),link:(typeof t.value.next=="object"?t.value.next.link:void 0)??((S=i[u+1])==null?void 0:S.link)}}})}function Dt(o,e){const t=new Set;return o.filter(n=>{const s=e(n);return t.has(s)?!1:t.add(s)})}const F=_({__name:"VPLink",props:{tag:{},href:{},noIcon:{type:Boolean},target:{},rel:{}},setup(o){const e=o,t=$(()=>e.tag??(e.href?"a":"span")),n=$(()=>e.href&&Le.test(e.href)||e.target==="_blank");return(s,i)=>(a(),b(K(t.value),{class:w(["VPLink",{link:s.href,"vp-external-link-icon":n.value,"no-icon":s.noIcon}]),href:s.href?r(he)(s.href):void 0,target:s.target??(n.value?"_blank":void 0),rel:s.rel??(n.value?"noreferrer":void 0)},{default:v(()=>[l(s.$slots,"default")]),_:3},8,["class","href","target","rel"]))}}),Ot={class:"VPLastUpdated"},Ut=["datetime"],Gt=_({__name:"VPDocFooterLastUpdated",setup(o){const{theme:e,page:t,frontmatter:n,lang:s}=L(),i=$(()=>new Date(n.value.lastUpdated??t.value.lastUpdated)),u=$(()=>i.value.toISOString()),h=T("");return R(()=>{J(()=>{var d,g,P;h.value=new Intl.DateTimeFormat((g=(d=e.value.lastUpdated)==null?void 0:d.formatOptions)!=null&&g.forceLocale?s.value:void 0,((P=e.value.lastUpdated)==null?void 0:P.formatOptions)??{dateStyle:"short",timeStyle:"short"}).format(i.value)})}),(d,g)=>{var P;return a(),c("p",Ot,[D(I(((P=r(e).lastUpdated)==null?void 0:P.text)||r(e).lastUpdatedText||"Last updated")+": ",1),p("time",{datetime:u.value},I(h.value),9,Ut)])}}}),jt=k(Gt,[["__scopeId","data-v-7e05ebdb"]]),Ae=o=>(C("data-v-d4a0bba5"),o=o(),H(),o),zt={key:0,class:"VPDocFooter"},qt={key:0,class:"edit-info"},Wt={key:0,class:"edit-link"},Kt=Ae(()=>p("span",{class:"vpi-square-pen edit-link-icon"},null,-1)),Rt={key:1,class:"last-updated"},Jt={key:1,class:"prev-next","aria-labelledby":"doc-footer-aria-label"},Yt=Ae(()=>p("span",{class:"visually-hidden",id:"doc-footer-aria-label"},"Pager",-1)),Qt={class:"pager"},Xt=["innerHTML"],Zt=["innerHTML"],xt={class:"pager"},eo=["innerHTML"],to=["innerHTML"],oo=_({__name:"VPDocFooter",setup(o){const{theme:e,page:t,frontmatter:n}=L(),s=Et(),i=Ft(),u=$(()=>e.value.editLink&&n.value.editLink!==!1),h=$(()=>t.value.lastUpdated&&n.value.lastUpdated!==!1),d=$(()=>u.value||h.value||i.value.prev||i.value.next);return(g,P)=>{var y,V,N,A;return d.value?(a(),c("footer",zt,[l(g.$slots,"doc-footer-before",{},void 0,!0),u.value||h.value?(a(),c("div",qt,[u.value?(a(),c("div",Wt,[m(F,{class:"edit-link-button",href:r(s).url,"no-icon":!0},{default:v(()=>[Kt,D(" "+I(r(s).text),1)]),_:1},8,["href"])])):f("",!0),h.value?(a(),c("div",Rt,[m(jt)])):f("",!0)])):f("",!0),(y=r(i).prev)!=null&&y.link||(V=r(i).next)!=null&&V.link?(a(),c("nav",Jt,[Yt,p("div",Qt,[(N=r(i).prev)!=null&&N.link?(a(),b(F,{key:0,class:"pager-link prev",href:r(i).prev.link},{default:v(()=>{var B;return[p("span",{class:"desc",innerHTML:((B=r(e).docFooter)==null?void 0:B.prev)||"Previous page"},null,8,Xt),p("span",{class:"title",innerHTML:r(i).prev.text},null,8,Zt)]}),_:1},8,["href"])):f("",!0)]),p("div",xt,[(A=r(i).next)!=null&&A.link?(a(),b(F,{key:0,class:"pager-link next",href:r(i).next.link},{default:v(()=>{var B;return[p("span",{class:"desc",innerHTML:((B=r(e).docFooter)==null?void 0:B.next)||"Next page"},null,8,eo),p("span",{class:"title",innerHTML:r(i).next.text},null,8,to)]}),_:1},8,["href"])):f("",!0)])])):f("",!0)])):f("",!0)}}}),so=k(oo,[["__scopeId","data-v-d4a0bba5"]]),no=o=>(C("data-v-39a288b8"),o=o(),H(),o),ao={class:"container"},ro=no(()=>p("div",{class:"aside-curtain"},null,-1)),io={class:"aside-container"},lo={class:"aside-content"},co={class:"content"},uo={class:"content-container"},vo={class:"main"},po=_({__name:"VPDoc",setup(o){const{theme:e}=L(),t=te(),{hasSidebar:n,hasAside:s,leftAside:i}=O(),u=$(()=>t.path.replace(/[./]+/g,"_").replace(/_html$/,""));return(h,d)=>{const g=q("Content");return a(),c("div",{class:w(["VPDoc",{"has-sidebar":r(n),"has-aside":r(s)}])},[l(h.$slots,"doc-top",{},void 0,!0),p("div",ao,[r(s)?(a(),c("div",{key:0,class:w(["aside",{"left-aside":r(i)}])},[ro,p("div",io,[p("div",lo,[m(Ht,null,{"aside-top":v(()=>[l(h.$slots,"aside-top",{},void 0,!0)]),"aside-bottom":v(()=>[l(h.$slots,"aside-bottom",{},void 0,!0)]),"aside-outline-before":v(()=>[l(h.$slots,"aside-outline-before",{},void 0,!0)]),"aside-outline-after":v(()=>[l(h.$slots,"aside-outline-after",{},void 0,!0)]),"aside-ads-before":v(()=>[l(h.$slots,"aside-ads-before",{},void 0,!0)]),"aside-ads-after":v(()=>[l(h.$slots,"aside-ads-after",{},void 0,!0)]),_:3})])])],2)):f("",!0),p("div",co,[p("div",uo,[l(h.$slots,"doc-before",{},void 0,!0),p("main",vo,[m(g,{class:w(["vp-doc",[u.value,r(e).externalLinkIcon&&"external-link-icon-enabled"]])},null,8,["class"])]),m(so,null,{"doc-footer-before":v(()=>[l(h.$slots,"doc-footer-before",{},void 0,!0)]),_:3}),l(h.$slots,"doc-after",{},void 0,!0)])])]),l(h.$slots,"doc-bottom",{},void 0,!0)],2)}}}),ho=k(po,[["__scopeId","data-v-39a288b8"]]),fo=_({__name:"VPButton",props:{tag:{},size:{default:"medium"},theme:{default:"brand"},text:{},href:{},target:{},rel:{}},setup(o){const e=o,t=$(()=>e.href&&Le.test(e.href)),n=$(()=>e.tag||e.href?"a":"button");return(s,i)=>(a(),b(K(n.value),{class:w(["VPButton",[s.size,s.theme]]),href:s.href?r(he)(s.href):void 0,target:e.target??(t.value?"_blank":void 0),rel:e.rel??(t.value?"noreferrer":void 0)},{default:v(()=>[D(I(s.text),1)]),_:1},8,["class","href","target","rel"]))}}),_o=k(fo,[["__scopeId","data-v-cad61b99"]]),mo=["src","alt"],ko=_({inheritAttrs:!1,__name:"VPImage",props:{image:{},alt:{}},setup(o){return(e,t)=>{const n=q("VPImage",!0);return e.image?(a(),c(M,{key:0},[typeof e.image=="string"||"src"in e.image?(a(),c("img",X({key:0,class:"VPImage"},typeof e.image=="string"?e.$attrs:{...e.image,...e.$attrs},{src:r(ve)(typeof e.image=="string"?e.image:e.image.src),alt:e.alt??(typeof e.image=="string"?"":e.image.alt||"")}),null,16,mo)):(a(),c(M,{key:1},[m(n,X({class:"dark",image:e.image.dark,alt:e.image.alt},e.$attrs),null,16,["image","alt"]),m(n,X({class:"light",image:e.image.light,alt:e.image.alt},e.$attrs),null,16,["image","alt"])],64))],64)):f("",!0)}}}),x=k(ko,[["__scopeId","data-v-8426fc1a"]]),bo=o=>(C("data-v-303bb580"),o=o(),H(),o),$o={class:"container"},go={class:"main"},yo={key:0,class:"name"},Po=["innerHTML"],Lo=["innerHTML"],Vo=["innerHTML"],So={key:0,class:"actions"},Io={key:0,class:"image"},To={class:"image-container"},wo=bo(()=>p("div",{class:"image-bg"},null,-1)),No=_({__name:"VPHero",props:{name:{},text:{},tagline:{},image:{},actions:{}},setup(o){const e=oe("hero-image-slot-exists");return(t,n)=>(a(),c("div",{class:w(["VPHero",{"has-image":t.image||r(e)}])},[p("div",$o,[p("div",go,[l(t.$slots,"home-hero-info-before",{},void 0,!0),l(t.$slots,"home-hero-info",{},()=>[t.name?(a(),c("h1",yo,[p("span",{innerHTML:t.name,class:"clip"},null,8,Po)])):f("",!0),t.text?(a(),c("p",{key:1,innerHTML:t.text,class:"text"},null,8,Lo)):f("",!0),t.tagline?(a(),c("p",{key:2,innerHTML:t.tagline,class:"tagline"},null,8,Vo)):f("",!0)],!0),l(t.$slots,"home-hero-info-after",{},void 0,!0),t.actions?(a(),c("div",So,[(a(!0),c(M,null,E(t.actions,s=>(a(),c("div",{key:s.link,class:"action"},[m(_o,{tag:"a",size:"medium",theme:s.theme,text:s.text,href:s.link,target:s.target,rel:s.rel},null,8,["theme","text","href","target","rel"])]))),128))])):f("",!0),l(t.$slots,"home-hero-actions-after",{},void 0,!0)]),t.image||r(e)?(a(),c("div",Io,[p("div",To,[wo,l(t.$slots,"home-hero-image",{},()=>[t.image?(a(),b(x,{key:0,class:"image-src",image:t.image},null,8,["image"])):f("",!0)],!0)])])):f("",!0)])],2))}}),Mo=k(No,[["__scopeId","data-v-303bb580"]]),Ao=_({__name:"VPHomeHero",setup(o){const{frontmatter:e}=L();return(t,n)=>r(e).hero?(a(),b(Mo,{key:0,class:"VPHomeHero",name:r(e).hero.name,text:r(e).hero.text,tagline:r(e).hero.tagline,image:r(e).hero.image,actions:r(e).hero.actions},{"home-hero-info-before":v(()=>[l(t.$slots,"home-hero-info-before")]),"home-hero-info":v(()=>[l(t.$slots,"home-hero-info")]),"home-hero-info-after":v(()=>[l(t.$slots,"home-hero-info-after")]),"home-hero-actions-after":v(()=>[l(t.$slots,"home-hero-actions-after")]),"home-hero-image":v(()=>[l(t.$slots,"home-hero-image")]),_:3},8,["name","text","tagline","image","actions"])):f("",!0)}}),Bo=o=>(C("data-v-a3976bdc"),o=o(),H(),o),Co={class:"box"},Ho={key:0,class:"icon"},Eo=["innerHTML"],Fo=["innerHTML"],Do=["innerHTML"],Oo={key:4,class:"link-text"},Uo={class:"link-text-value"},Go=Bo(()=>p("span",{class:"vpi-arrow-right link-text-icon"},null,-1)),jo=_({__name:"VPFeature",props:{icon:{},title:{},details:{},link:{},linkText:{},rel:{},target:{}},setup(o){return(e,t)=>(a(),b(F,{class:"VPFeature",href:e.link,rel:e.rel,target:e.target,"no-icon":!0,tag:e.link?"a":"div"},{default:v(()=>[p("article",Co,[typeof e.icon=="object"&&e.icon.wrap?(a(),c("div",Ho,[m(x,{image:e.icon,alt:e.icon.alt,height:e.icon.height||48,width:e.icon.width||48},null,8,["image","alt","height","width"])])):typeof e.icon=="object"?(a(),b(x,{key:1,image:e.icon,alt:e.icon.alt,height:e.icon.height||48,width:e.icon.width||48},null,8,["image","alt","height","width"])):e.icon?(a(),c("div",{key:2,class:"icon",innerHTML:e.icon},null,8,Eo)):f("",!0),p("h2",{class:"title",innerHTML:e.title},null,8,Fo),e.details?(a(),c("p",{key:3,class:"details",innerHTML:e.details},null,8,Do)):f("",!0),e.linkText?(a(),c("div",Oo,[p("p",Uo,[D(I(e.linkText)+" ",1),Go])])):f("",!0)])]),_:1},8,["href","rel","target","tag"]))}}),zo=k(jo,[["__scopeId","data-v-a3976bdc"]]),qo={key:0,class:"VPFeatures"},Wo={class:"container"},Ko={class:"items"},Ro=_({__name:"VPFeatures",props:{features:{}},setup(o){const e=o,t=$(()=>{const n=e.features.length;if(n){if(n===2)return"grid-2";if(n===3)return"grid-3";if(n%3===0)return"grid-6";if(n>3)return"grid-4"}else return});return(n,s)=>n.features?(a(),c("div",qo,[p("div",Wo,[p("div",Ko,[(a(!0),c(M,null,E(n.features,i=>(a(),c("div",{key:i.title,class:w(["item",[t.value]])},[m(zo,{icon:i.icon,title:i.title,details:i.details,link:i.link,"link-text":i.linkText,rel:i.rel,target:i.target},null,8,["icon","title","details","link","link-text","rel","target"])],2))),128))])])])):f("",!0)}}),Jo=k(Ro,[["__scopeId","data-v-a6181336"]]),Yo=_({__name:"VPHomeFeatures",setup(o){const{frontmatter:e}=L();return(t,n)=>r(e).features?(a(),b(Jo,{key:0,class:"VPHomeFeatures",features:r(e).features},null,8,["features"])):f("",!0)}}),Qo=_({__name:"VPHomeContent",setup(o){const{width:e}=qe({initialWidth:0,includeScrollbar:!1});return(t,n)=>(a(),c("div",{class:"vp-doc container",style:Ve(r(e)?{"--vp-offset":`calc(50% - ${r(e)/2}px)`}:{})},[l(t.$slots,"default",{},void 0,!0)],4))}}),Xo=k(Qo,[["__scopeId","data-v-8e2d4988"]]),Zo={class:"VPHome"},xo=_({__name:"VPHome",setup(o){const{frontmatter:e}=L();return(t,n)=>{const s=q("Content");return a(),c("div",Zo,[l(t.$slots,"home-hero-before",{},void 0,!0),m(Ao,null,{"home-hero-info-before":v(()=>[l(t.$slots,"home-hero-info-before",{},void 0,!0)]),"home-hero-info":v(()=>[l(t.$slots,"home-hero-info",{},void 0,!0)]),"home-hero-info-after":v(()=>[l(t.$slots,"home-hero-info-after",{},void 0,!0)]),"home-hero-actions-after":v(()=>[l(t.$slots,"home-hero-actions-after",{},void 0,!0)]),"home-hero-image":v(()=>[l(t.$slots,"home-hero-image",{},void 0,!0)]),_:3}),l(t.$slots,"home-hero-after",{},void 0,!0),l(t.$slots,"home-features-before",{},void 0,!0),m(Yo),l(t.$slots,"home-features-after",{},void 0,!0),r(e).markdownStyles!==!1?(a(),b(Xo,{key:0},{default:v(()=>[m(s)]),_:1})):(a(),b(s,{key:1}))])}}}),es=k(xo,[["__scopeId","data-v-686f80a6"]]),ts={},os={class:"VPPage"};function ss(o,e){const t=q("Content");return a(),c("div",os,[l(o.$slots,"page-top"),m(t),l(o.$slots,"page-bottom")])}const ns=k(ts,[["render",ss]]),as=_({__name:"VPContent",setup(o){const{page:e,frontmatter:t}=L(),{hasSidebar:n}=O();return(s,i)=>(a(),c("div",{class:w(["VPContent",{"has-sidebar":r(n),"is-home":r(t).layout==="home"}]),id:"VPContent"},[r(e).isNotFound?l(s.$slots,"not-found",{key:0},()=>[m(pt)],!0):r(t).layout==="page"?(a(),b(ns,{key:1},{"page-top":v(()=>[l(s.$slots,"page-top",{},void 0,!0)]),"page-bottom":v(()=>[l(s.$slots,"page-bottom",{},void 0,!0)]),_:3})):r(t).layout==="home"?(a(),b(es,{key:2},{"home-hero-before":v(()=>[l(s.$slots,"home-hero-before",{},void 0,!0)]),"home-hero-info-before":v(()=>[l(s.$slots,"home-hero-info-before",{},void 0,!0)]),"home-hero-info":v(()=>[l(s.$slots,"home-hero-info",{},void 0,!0)]),"home-hero-info-after":v(()=>[l(s.$slots,"home-hero-info-after",{},void 0,!0)]),"home-hero-actions-after":v(()=>[l(s.$slots,"home-hero-actions-after",{},void 0,!0)]),"home-hero-image":v(()=>[l(s.$slots,"home-hero-image",{},void 0,!0)]),"home-hero-after":v(()=>[l(s.$slots,"home-hero-after",{},void 0,!0)]),"home-features-before":v(()=>[l(s.$slots,"home-features-before",{},void 0,!0)]),"home-features-after":v(()=>[l(s.$slots,"home-features-after",{},void 0,!0)]),_:3})):r(t).layout&&r(t).layout!=="doc"?(a(),b(K(r(t).layout),{key:3})):(a(),b(ho,{key:4},{"doc-top":v(()=>[l(s.$slots,"doc-top",{},void 0,!0)]),"doc-bottom":v(()=>[l(s.$slots,"doc-bottom",{},void 0,!0)]),"doc-footer-before":v(()=>[l(s.$slots,"doc-footer-before",{},void 0,!0)]),"doc-before":v(()=>[l(s.$slots,"doc-before",{},void 0,!0)]),"doc-after":v(()=>[l(s.$slots,"doc-after",{},void 0,!0)]),"aside-top":v(()=>[l(s.$slots,"aside-top",{},void 0,!0)]),"aside-outline-before":v(()=>[l(s.$slots,"aside-outline-before",{},void 0,!0)]),"aside-outline-after":v(()=>[l(s.$slots,"aside-outline-after",{},void 0,!0)]),"aside-ads-before":v(()=>[l(s.$slots,"aside-ads-before",{},void 0,!0)]),"aside-ads-after":v(()=>[l(s.$slots,"aside-ads-after",{},void 0,!0)]),"aside-bottom":v(()=>[l(s.$slots,"aside-bottom",{},void 0,!0)]),_:3}))],2))}}),rs=k(as,[["__scopeId","data-v-1428d186"]]),is={class:"container"},ls=["innerHTML"],cs=["innerHTML"],us=_({__name:"VPFooter",setup(o){const{theme:e,frontmatter:t}=L(),{hasSidebar:n}=O();return(s,i)=>r(e).footer&&r(t).footer!==!1?(a(),c("footer",{key:0,class:w(["VPFooter",{"has-sidebar":r(n)}])},[p("div",is,[r(e).footer.message?(a(),c("p",{key:0,class:"message",innerHTML:r(e).footer.message},null,8,ls)):f("",!0),r(e).footer.copyright?(a(),c("p",{key:1,class:"copyright",innerHTML:r(e).footer.copyright},null,8,cs)):f("",!0)])],2)):f("",!0)}}),ds=k(us,[["__scopeId","data-v-e315a0ad"]]);function vs(){const{theme:o,frontmatter:e}=L(),t=Pe([]),n=$(()=>t.value.length>0);return ee(()=>{t.value=fe(e.value.outline??o.value.outline)}),{headers:t,hasLocalNav:n}}const ps=o=>(C("data-v-17a5e62e"),o=o(),H(),o),hs={class:"menu-text"},fs=ps(()=>p("span",{class:"vpi-chevron-right icon"},null,-1)),_s={class:"header"},ms={class:"outline"},ks=_({__name:"VPLocalNavOutlineDropdown",props:{headers:{},navHeight:{}},setup(o){const e=o,{theme:t}=L(),n=T(!1),s=T(0),i=T(),u=T();function h(y){var V;(V=i.value)!=null&&V.contains(y.target)||(n.value=!1)}j(n,y=>{if(y){document.addEventListener("click",h);return}document.removeEventListener("click",h)}),We("Escape",()=>{n.value=!1}),ee(()=>{n.value=!1});function d(){n.value=!n.value,s.value=window.innerHeight+Math.min(window.scrollY-e.navHeight,0)}function g(y){y.target.classList.contains("outline-link")&&(u.value&&(u.value.style.transition="none"),Ke(()=>{n.value=!1}))}function P(){n.value=!1,window.scrollTo({top:0,left:0,behavior:"smooth"})}return(y,V)=>(a(),c("div",{class:"VPLocalNavOutlineDropdown",style:Ve({"--vp-vh":s.value+"px"}),ref_key:"main",ref:i},[y.headers.length>0?(a(),c("button",{key:0,onClick:d,class:w({open:n.value})},[p("span",hs,I(r(Ne)(r(t))),1),fs],2)):(a(),c("button",{key:1,onClick:P},I(r(t).returnToTopLabel||"Return to top"),1)),m(de,{name:"flyout"},{default:v(()=>[n.value?(a(),c("div",{key:0,ref_key:"items",ref:u,class:"items",onClick:g},[p("div",_s,[p("a",{class:"top-link",href:"#",onClick:P},I(r(t).returnToTopLabel||"Return to top"),1)]),p("div",ms,[m(Me,{headers:y.headers},null,8,["headers"])])],512)):f("",!0)]),_:1})],4))}}),bs=k(ks,[["__scopeId","data-v-17a5e62e"]]),$s=o=>(C("data-v-a6f0e41e"),o=o(),H(),o),gs={class:"container"},ys=["aria-expanded"],Ps=$s(()=>p("span",{class:"vpi-align-left menu-icon"},null,-1)),Ls={class:"menu-text"},Vs=_({__name:"VPLocalNav",props:{open:{type:Boolean}},emits:["open-menu"],setup(o){const{theme:e,frontmatter:t}=L(),{hasSidebar:n}=O(),{headers:s}=vs(),{y:i}=Se(),u=T(0);R(()=>{u.value=parseInt(getComputedStyle(document.documentElement).getPropertyValue("--vp-nav-height"))}),ee(()=>{s.value=fe(t.value.outline??e.value.outline)});const h=$(()=>s.value.length===0),d=$(()=>h.value&&!n.value),g=$(()=>({VPLocalNav:!0,"has-sidebar":n.value,empty:h.value,fixed:d.value}));return(P,y)=>r(t).layout!=="home"&&(!d.value||r(i)>=u.value)?(a(),c("div",{key:0,class:w(g.value)},[p("div",gs,[r(n)?(a(),c("button",{key:0,class:"menu","aria-expanded":P.open,"aria-controls":"VPSidebarNav",onClick:y[0]||(y[0]=V=>P.$emit("open-menu"))},[Ps,p("span",Ls,I(r(e).sidebarMenuLabel||"Menu"),1)],8,ys)):f("",!0),m(bs,{headers:r(s),navHeight:u.value},null,8,["headers","navHeight"])])],2)):f("",!0)}}),Ss=k(Vs,[["__scopeId","data-v-a6f0e41e"]]);function Is(){const o=T(!1);function e(){o.value=!0,window.addEventListener("resize",s)}function t(){o.value=!1,window.removeEventListener("resize",s)}function n(){o.value?t():e()}function s(){window.outerWidth>=768&&t()}const i=te();return j(()=>i.path,t),{isScreenOpen:o,openScreen:e,closeScreen:t,toggleScreen:n}}const Ts={},ws={class:"VPSwitch",type:"button",role:"switch"},Ns={class:"check"},Ms={key:0,class:"icon"};function As(o,e){return a(),c("button",ws,[p("span",Ns,[o.$slots.default?(a(),c("span",Ms,[l(o.$slots,"default",{},void 0,!0)])):f("",!0)])])}const Bs=k(Ts,[["render",As],["__scopeId","data-v-1d5665e3"]]),Be=o=>(C("data-v-d1f28634"),o=o(),H(),o),Cs=Be(()=>p("span",{class:"vpi-sun sun"},null,-1)),Hs=Be(()=>p("span",{class:"vpi-moon moon"},null,-1)),Es=_({__name:"VPSwitchAppearance",setup(o){const{isDark:e,theme:t}=L(),n=oe("toggle-appearance",()=>{e.value=!e.value}),s=$(()=>e.value?t.value.lightModeSwitchTitle||"Switch to light theme":t.value.darkModeSwitchTitle||"Switch to dark theme");return(i,u)=>(a(),b(Bs,{title:s.value,class:"VPSwitchAppearance","aria-checked":r(e),onClick:r(n)},{default:v(()=>[Cs,Hs]),_:1},8,["title","aria-checked","onClick"]))}}),_e=k(Es,[["__scopeId","data-v-d1f28634"]]),Fs={key:0,class:"VPNavBarAppearance"},Ds=_({__name:"VPNavBarAppearance",setup(o){const{site:e}=L();return(t,n)=>r(e).appearance&&r(e).appearance!=="force-dark"?(a(),c("div",Fs,[m(_e)])):f("",!0)}}),Os=k(Ds,[["__scopeId","data-v-e6aabb21"]]),me=T();let Ce=!1,re=0;function Us(o){const e=T(!1);if(Y){!Ce&&Gs(),re++;const t=j(me,n=>{var s,i,u;n===o.el.value||(s=o.el.value)!=null&&s.contains(n)?(e.value=!0,(i=o.onFocus)==null||i.call(o)):(e.value=!1,(u=o.onBlur)==null||u.call(o))});pe(()=>{t(),re--,re||js()})}return Re(e)}function Gs(){document.addEventListener("focusin",He),Ce=!0,me.value=document.activeElement}function js(){document.removeEventListener("focusin",He)}function He(){me.value=document.activeElement}const zs={class:"VPMenuLink"},qs=_({__name:"VPMenuLink",props:{item:{}},setup(o){const{page:e}=L();return(t,n)=>(a(),c("div",zs,[m(F,{class:w({active:r(z)(r(e).relativePath,t.item.activeMatch||t.item.link,!!t.item.activeMatch)}),href:t.item.link,target:t.item.target,rel:t.item.rel},{default:v(()=>[D(I(t.item.text),1)]),_:1},8,["class","href","target","rel"])]))}}),se=k(qs,[["__scopeId","data-v-43f1e123"]]),Ws={class:"VPMenuGroup"},Ks={key:0,class:"title"},Rs=_({__name:"VPMenuGroup",props:{text:{},items:{}},setup(o){return(e,t)=>(a(),c("div",Ws,[e.text?(a(),c("p",Ks,I(e.text),1)):f("",!0),(a(!0),c(M,null,E(e.items,n=>(a(),c(M,null,["link"in n?(a(),b(se,{key:0,item:n},null,8,["item"])):f("",!0)],64))),256))]))}}),Js=k(Rs,[["__scopeId","data-v-69e747b5"]]),Ys={class:"VPMenu"},Qs={key:0,class:"items"},Xs=_({__name:"VPMenu",props:{items:{}},setup(o){return(e,t)=>(a(),c("div",Ys,[e.items?(a(),c("div",Qs,[(a(!0),c(M,null,E(e.items,n=>(a(),c(M,{key:n.text},["link"in n?(a(),b(se,{key:0,item:n},null,8,["item"])):(a(),b(Js,{key:1,text:n.text,items:n.items},null,8,["text","items"]))],64))),128))])):f("",!0),l(e.$slots,"default",{},void 0,!0)]))}}),Zs=k(Xs,[["__scopeId","data-v-e7ea1737"]]),xs=o=>(C("data-v-b6c34ac9"),o=o(),H(),o),en=["aria-expanded","aria-label"],tn={key:0,class:"text"},on=["innerHTML"],sn=xs(()=>p("span",{class:"vpi-chevron-down text-icon"},null,-1)),nn={key:1,class:"vpi-more-horizontal icon"},an={class:"menu"},rn=_({__name:"VPFlyout",props:{icon:{},button:{},label:{},items:{}},setup(o){const e=T(!1),t=T();Us({el:t,onBlur:n});function n(){e.value=!1}return(s,i)=>(a(),c("div",{class:"VPFlyout",ref_key:"el",ref:t,onMouseenter:i[1]||(i[1]=u=>e.value=!0),onMouseleave:i[2]||(i[2]=u=>e.value=!1)},[p("button",{type:"button",class:"button","aria-haspopup":"true","aria-expanded":e.value,"aria-label":s.label,onClick:i[0]||(i[0]=u=>e.value=!e.value)},[s.button||s.icon?(a(),c("span",tn,[s.icon?(a(),c("span",{key:0,class:w([s.icon,"option-icon"])},null,2)):f("",!0),s.button?(a(),c("span",{key:1,innerHTML:s.button},null,8,on)):f("",!0),sn])):(a(),c("span",nn))],8,en),p("div",an,[m(Zs,{items:s.items},{default:v(()=>[l(s.$slots,"default",{},void 0,!0)]),_:3},8,["items"])])],544))}}),ke=k(rn,[["__scopeId","data-v-b6c34ac9"]]),ln=["href","aria-label","innerHTML"],cn=_({__name:"VPSocialLink",props:{icon:{},link:{},ariaLabel:{}},setup(o){const e=o,t=$(()=>typeof e.icon=="object"?e.icon.svg:``);return(n,s)=>(a(),c("a",{class:"VPSocialLink no-icon",href:n.link,"aria-label":n.ariaLabel??(typeof n.icon=="string"?n.icon:""),target:"_blank",rel:"noopener",innerHTML:t.value},null,8,ln))}}),un=k(cn,[["__scopeId","data-v-eee4e7cb"]]),dn={class:"VPSocialLinks"},vn=_({__name:"VPSocialLinks",props:{links:{}},setup(o){return(e,t)=>(a(),c("div",dn,[(a(!0),c(M,null,E(e.links,({link:n,icon:s,ariaLabel:i})=>(a(),b(un,{key:n,icon:s,link:n,ariaLabel:i},null,8,["icon","link","ariaLabel"]))),128))]))}}),be=k(vn,[["__scopeId","data-v-7bc22406"]]),pn={key:0,class:"group translations"},hn={class:"trans-title"},fn={key:1,class:"group"},_n={class:"item appearance"},mn={class:"label"},kn={class:"appearance-action"},bn={key:2,class:"group"},$n={class:"item social-links"},gn=_({__name:"VPNavBarExtra",setup(o){const{site:e,theme:t}=L(),{localeLinks:n,currentLang:s}=Q({correspondingLink:!0}),i=$(()=>n.value.length&&s.value.label||e.value.appearance||t.value.socialLinks);return(u,h)=>i.value?(a(),b(ke,{key:0,class:"VPNavBarExtra",label:"extra navigation"},{default:v(()=>[r(n).length&&r(s).label?(a(),c("div",pn,[p("p",hn,I(r(s).label),1),(a(!0),c(M,null,E(r(n),d=>(a(),b(se,{key:d.link,item:d},null,8,["item"]))),128))])):f("",!0),r(e).appearance&&r(e).appearance!=="force-dark"?(a(),c("div",fn,[p("div",_n,[p("p",mn,I(r(t).darkModeSwitchLabel||"Appearance"),1),p("div",kn,[m(_e)])])])):f("",!0),r(t).socialLinks?(a(),c("div",bn,[p("div",$n,[m(be,{class:"social-links-list",links:r(t).socialLinks},null,8,["links"])])])):f("",!0)]),_:1})):f("",!0)}}),yn=k(gn,[["__scopeId","data-v-d0bd9dde"]]),Pn=o=>(C("data-v-e5dd9c1c"),o=o(),H(),o),Ln=["aria-expanded"],Vn=Pn(()=>p("span",{class:"container"},[p("span",{class:"top"}),p("span",{class:"middle"}),p("span",{class:"bottom"})],-1)),Sn=[Vn],In=_({__name:"VPNavBarHamburger",props:{active:{type:Boolean}},emits:["click"],setup(o){return(e,t)=>(a(),c("button",{type:"button",class:w(["VPNavBarHamburger",{active:e.active}]),"aria-label":"mobile navigation","aria-expanded":e.active,"aria-controls":"VPNavScreen",onClick:t[0]||(t[0]=n=>e.$emit("click"))},Sn,10,Ln))}}),Tn=k(In,[["__scopeId","data-v-e5dd9c1c"]]),wn=["innerHTML"],Nn=_({__name:"VPNavBarMenuLink",props:{item:{}},setup(o){const{page:e}=L();return(t,n)=>(a(),b(F,{class:w({VPNavBarMenuLink:!0,active:r(z)(r(e).relativePath,t.item.activeMatch||t.item.link,!!t.item.activeMatch)}),href:t.item.link,noIcon:t.item.noIcon,target:t.item.target,rel:t.item.rel,tabindex:"0"},{default:v(()=>[p("span",{innerHTML:t.item.text},null,8,wn)]),_:1},8,["class","href","noIcon","target","rel"]))}}),Mn=k(Nn,[["__scopeId","data-v-9c663999"]]),An=_({__name:"VPNavBarMenuGroup",props:{item:{}},setup(o){const e=o,{page:t}=L(),n=i=>"link"in i?z(t.value.relativePath,i.link,!!e.item.activeMatch):i.items.some(n),s=$(()=>n(e.item));return(i,u)=>(a(),b(ke,{class:w({VPNavBarMenuGroup:!0,active:r(z)(r(t).relativePath,i.item.activeMatch,!!i.item.activeMatch)||s.value}),button:i.item.text,items:i.item.items},null,8,["class","button","items"]))}}),Bn=o=>(C("data-v-7f418b0f"),o=o(),H(),o),Cn={key:0,"aria-labelledby":"main-nav-aria-label",class:"VPNavBarMenu"},Hn=Bn(()=>p("span",{id:"main-nav-aria-label",class:"visually-hidden"},"Main Navigation",-1)),En=_({__name:"VPNavBarMenu",setup(o){const{theme:e}=L();return(t,n)=>r(e).nav?(a(),c("nav",Cn,[Hn,(a(!0),c(M,null,E(r(e).nav,s=>(a(),c(M,{key:s.text},["link"in s?(a(),b(Mn,{key:0,item:s},null,8,["item"])):(a(),b(An,{key:1,item:s},null,8,["item"]))],64))),128))])):f("",!0)}}),Fn=k(En,[["__scopeId","data-v-7f418b0f"]]);function Dn(o){const{localeIndex:e,theme:t}=L();function n(s){var A,B,S;const i=s.split("."),u=(A=t.value.search)==null?void 0:A.options,h=u&&typeof u=="object",d=h&&((S=(B=u.locales)==null?void 0:B[e.value])==null?void 0:S.translations)||null,g=h&&u.translations||null;let P=d,y=g,V=o;const N=i.pop();for(const U of i){let G=null;const W=V==null?void 0:V[U];W&&(G=V=W);const ne=y==null?void 0:y[U];ne&&(G=y=ne);const ae=P==null?void 0:P[U];ae&&(G=P=ae),W||(V=G),ne||(y=G),ae||(P=G)}return(P==null?void 0:P[N])??(y==null?void 0:y[N])??(V==null?void 0:V[N])??""}return n}const On=["aria-label"],Un={class:"DocSearch-Button-Container"},Gn=p("span",{class:"vp-icon DocSearch-Search-Icon"},null,-1),jn={class:"DocSearch-Button-Placeholder"},zn=p("span",{class:"DocSearch-Button-Keys"},[p("kbd",{class:"DocSearch-Button-Key"}),p("kbd",{class:"DocSearch-Button-Key"},"K")],-1),$e=_({__name:"VPNavBarSearchButton",setup(o){const t=Dn({button:{buttonText:"Search",buttonAriaLabel:"Search"}});return(n,s)=>(a(),c("button",{type:"button",class:"DocSearch DocSearch-Button","aria-label":r(t)("button.buttonAriaLabel")},[p("span",Un,[Gn,p("span",jn,I(r(t)("button.buttonText")),1)]),zn],8,On))}}),qn={class:"VPNavBarSearch"},Wn={id:"local-search"},Kn={key:1,id:"docsearch"},Rn=_({__name:"VPNavBarSearch",setup(o){const e=()=>null,t=()=>null,{theme:n}=L(),s=T(!1),i=T(!1);R(()=>{});function u(){s.value||(s.value=!0,setTimeout(h,16))}function h(){const P=new Event("keydown");P.key="k",P.metaKey=!0,window.dispatchEvent(P),setTimeout(()=>{document.querySelector(".DocSearch-Modal")||h()},16)}const d=T(!1),g="";return(P,y)=>{var V;return a(),c("div",qn,[r(g)==="local"?(a(),c(M,{key:0},[d.value?(a(),b(r(e),{key:0,onClose:y[0]||(y[0]=N=>d.value=!1)})):f("",!0),p("div",Wn,[m($e,{onClick:y[1]||(y[1]=N=>d.value=!0)})])],64)):r(g)==="algolia"?(a(),c(M,{key:1},[s.value?(a(),b(r(t),{key:0,algolia:((V=r(n).search)==null?void 0:V.options)??r(n).algolia,onVnodeBeforeMount:y[2]||(y[2]=N=>i.value=!0)},null,8,["algolia"])):f("",!0),i.value?f("",!0):(a(),c("div",Kn,[m($e,{onClick:u})]))],64)):f("",!0)])}}}),Jn=_({__name:"VPNavBarSocialLinks",setup(o){const{theme:e}=L();return(t,n)=>r(e).socialLinks?(a(),b(be,{key:0,class:"VPNavBarSocialLinks",links:r(e).socialLinks},null,8,["links"])):f("",!0)}}),Yn=k(Jn,[["__scopeId","data-v-0394ad82"]]),Qn=["href","rel","target"],Xn={key:1},Zn={key:2},xn=_({__name:"VPNavBarTitle",setup(o){const{site:e,theme:t}=L(),{hasSidebar:n}=O(),{currentLang:s}=Q(),i=$(()=>{var d;return typeof t.value.logoLink=="string"?t.value.logoLink:(d=t.value.logoLink)==null?void 0:d.link}),u=$(()=>{var d;return typeof t.value.logoLink=="string"||(d=t.value.logoLink)==null?void 0:d.rel}),h=$(()=>{var d;return typeof t.value.logoLink=="string"||(d=t.value.logoLink)==null?void 0:d.target});return(d,g)=>(a(),c("div",{class:w(["VPNavBarTitle",{"has-sidebar":r(n)}])},[p("a",{class:"title",href:i.value??r(he)(r(s).link),rel:u.value,target:h.value},[l(d.$slots,"nav-bar-title-before",{},void 0,!0),r(t).logo?(a(),b(x,{key:0,class:"logo",image:r(t).logo},null,8,["image"])):f("",!0),r(t).siteTitle?(a(),c("span",Xn,I(r(t).siteTitle),1)):r(t).siteTitle===void 0?(a(),c("span",Zn,I(r(e).title),1)):f("",!0),l(d.$slots,"nav-bar-title-after",{},void 0,!0)],8,Qn)],2))}}),ea=k(xn,[["__scopeId","data-v-ab179fa1"]]),ta={class:"items"},oa={class:"title"},sa=_({__name:"VPNavBarTranslations",setup(o){const{theme:e}=L(),{localeLinks:t,currentLang:n}=Q({correspondingLink:!0});return(s,i)=>r(t).length&&r(n).label?(a(),b(ke,{key:0,class:"VPNavBarTranslations",icon:"vpi-languages",label:r(e).langMenuLabel||"Change language"},{default:v(()=>[p("div",ta,[p("p",oa,I(r(n).label),1),(a(!0),c(M,null,E(r(t),u=>(a(),b(se,{key:u.link,item:u},null,8,["item"]))),128))])]),_:1},8,["label"])):f("",!0)}}),na=k(sa,[["__scopeId","data-v-88af2de4"]]),aa=o=>(C("data-v-ccf7ddec"),o=o(),H(),o),ra={class:"wrapper"},ia={class:"container"},la={class:"title"},ca={class:"content"},ua={class:"content-body"},da=aa(()=>p("div",{class:"divider"},[p("div",{class:"divider-line"})],-1)),va=_({__name:"VPNavBar",props:{isScreenOpen:{type:Boolean}},emits:["toggle-screen"],setup(o){const{y:e}=Se(),{hasSidebar:t}=O(),{frontmatter:n}=L(),s=T({});return ye(()=>{s.value={"has-sidebar":t.value,home:n.value.layout==="home",top:e.value===0}}),(i,u)=>(a(),c("div",{class:w(["VPNavBar",s.value])},[p("div",ra,[p("div",ia,[p("div",la,[m(ea,null,{"nav-bar-title-before":v(()=>[l(i.$slots,"nav-bar-title-before",{},void 0,!0)]),"nav-bar-title-after":v(()=>[l(i.$slots,"nav-bar-title-after",{},void 0,!0)]),_:3})]),p("div",ca,[p("div",ua,[l(i.$slots,"nav-bar-content-before",{},void 0,!0),m(Rn,{class:"search"}),m(Fn,{class:"menu"}),m(na,{class:"translations"}),m(Os,{class:"appearance"}),m(Yn,{class:"social-links"}),m(yn,{class:"extra"}),l(i.$slots,"nav-bar-content-after",{},void 0,!0),m(Tn,{class:"hamburger",active:i.isScreenOpen,onClick:u[0]||(u[0]=h=>i.$emit("toggle-screen"))},null,8,["active"])])])])]),da],2))}}),pa=k(va,[["__scopeId","data-v-ccf7ddec"]]),ha={key:0,class:"VPNavScreenAppearance"},fa={class:"text"},_a=_({__name:"VPNavScreenAppearance",setup(o){const{site:e,theme:t}=L();return(n,s)=>r(e).appearance&&r(e).appearance!=="force-dark"?(a(),c("div",ha,[p("p",fa,I(r(t).darkModeSwitchLabel||"Appearance"),1),m(_e)])):f("",!0)}}),ma=k(_a,[["__scopeId","data-v-2d7af913"]]),ka=_({__name:"VPNavScreenMenuLink",props:{item:{}},setup(o){const e=oe("close-screen");return(t,n)=>(a(),b(F,{class:"VPNavScreenMenuLink",href:t.item.link,target:t.item.target,rel:t.item.rel,onClick:r(e),innerHTML:t.item.text},null,8,["href","target","rel","onClick","innerHTML"]))}}),ba=k(ka,[["__scopeId","data-v-7f31e1f6"]]),$a=_({__name:"VPNavScreenMenuGroupLink",props:{item:{}},setup(o){const e=oe("close-screen");return(t,n)=>(a(),b(F,{class:"VPNavScreenMenuGroupLink",href:t.item.link,target:t.item.target,rel:t.item.rel,onClick:r(e)},{default:v(()=>[D(I(t.item.text),1)]),_:1},8,["href","target","rel","onClick"]))}}),Ee=k($a,[["__scopeId","data-v-19976ae1"]]),ga={class:"VPNavScreenMenuGroupSection"},ya={key:0,class:"title"},Pa=_({__name:"VPNavScreenMenuGroupSection",props:{text:{},items:{}},setup(o){return(e,t)=>(a(),c("div",ga,[e.text?(a(),c("p",ya,I(e.text),1)):f("",!0),(a(!0),c(M,null,E(e.items,n=>(a(),b(Ee,{key:n.text,item:n},null,8,["item"]))),128))]))}}),La=k(Pa,[["__scopeId","data-v-8133b170"]]),Va=o=>(C("data-v-ff6087d4"),o=o(),H(),o),Sa=["aria-controls","aria-expanded"],Ia=["innerHTML"],Ta=Va(()=>p("span",{class:"vpi-plus button-icon"},null,-1)),wa=["id"],Na={key:1,class:"group"},Ma=_({__name:"VPNavScreenMenuGroup",props:{text:{},items:{}},setup(o){const e=o,t=T(!1),n=$(()=>`NavScreenGroup-${e.text.replace(" ","-").toLowerCase()}`);function s(){t.value=!t.value}return(i,u)=>(a(),c("div",{class:w(["VPNavScreenMenuGroup",{open:t.value}])},[p("button",{class:"button","aria-controls":n.value,"aria-expanded":t.value,onClick:s},[p("span",{class:"button-text",innerHTML:i.text},null,8,Ia),Ta],8,Sa),p("div",{id:n.value,class:"items"},[(a(!0),c(M,null,E(i.items,h=>(a(),c(M,{key:h.text},["link"in h?(a(),c("div",{key:h.text,class:"item"},[m(Ee,{item:h},null,8,["item"])])):(a(),c("div",Na,[m(La,{text:h.text,items:h.items},null,8,["text","items"])]))],64))),128))],8,wa)],2))}}),Aa=k(Ma,[["__scopeId","data-v-ff6087d4"]]),Ba={key:0,class:"VPNavScreenMenu"},Ca=_({__name:"VPNavScreenMenu",setup(o){const{theme:e}=L();return(t,n)=>r(e).nav?(a(),c("nav",Ba,[(a(!0),c(M,null,E(r(e).nav,s=>(a(),c(M,{key:s.text},["link"in s?(a(),b(ba,{key:0,item:s},null,8,["item"])):(a(),b(Aa,{key:1,text:s.text||"",items:s.items},null,8,["text","items"]))],64))),128))])):f("",!0)}}),Ha=_({__name:"VPNavScreenSocialLinks",setup(o){const{theme:e}=L();return(t,n)=>r(e).socialLinks?(a(),b(be,{key:0,class:"VPNavScreenSocialLinks",links:r(e).socialLinks},null,8,["links"])):f("",!0)}}),Fe=o=>(C("data-v-858fe1a4"),o=o(),H(),o),Ea=Fe(()=>p("span",{class:"vpi-languages icon lang"},null,-1)),Fa=Fe(()=>p("span",{class:"vpi-chevron-down icon chevron"},null,-1)),Da={class:"list"},Oa=_({__name:"VPNavScreenTranslations",setup(o){const{localeLinks:e,currentLang:t}=Q({correspondingLink:!0}),n=T(!1);function s(){n.value=!n.value}return(i,u)=>r(e).length&&r(t).label?(a(),c("div",{key:0,class:w(["VPNavScreenTranslations",{open:n.value}])},[p("button",{class:"title",onClick:s},[Ea,D(" "+I(r(t).label)+" ",1),Fa]),p("ul",Da,[(a(!0),c(M,null,E(r(e),h=>(a(),c("li",{key:h.link,class:"item"},[m(F,{class:"link",href:h.link},{default:v(()=>[D(I(h.text),1)]),_:2},1032,["href"])]))),128))])],2)):f("",!0)}}),Ua=k(Oa,[["__scopeId","data-v-858fe1a4"]]),Ga={class:"container"},ja=_({__name:"VPNavScreen",props:{open:{type:Boolean}},setup(o){const e=T(null),t=Ie(Y?document.body:null);return(n,s)=>(a(),b(de,{name:"fade",onEnter:s[0]||(s[0]=i=>t.value=!0),onAfterLeave:s[1]||(s[1]=i=>t.value=!1)},{default:v(()=>[n.open?(a(),c("div",{key:0,class:"VPNavScreen",ref_key:"screen",ref:e,id:"VPNavScreen"},[p("div",Ga,[l(n.$slots,"nav-screen-content-before",{},void 0,!0),m(Ca,{class:"menu"}),m(Ua,{class:"translations"}),m(ma,{class:"appearance"}),m(Ha,{class:"social-links"}),l(n.$slots,"nav-screen-content-after",{},void 0,!0)])],512)):f("",!0)]),_:3}))}}),za=k(ja,[["__scopeId","data-v-cc5739dd"]]),qa={key:0,class:"VPNav"},Wa=_({__name:"VPNav",setup(o){const{isScreenOpen:e,closeScreen:t,toggleScreen:n}=Is(),{frontmatter:s}=L(),i=$(()=>s.value.navbar!==!1);return Te("close-screen",t),J(()=>{Y&&document.documentElement.classList.toggle("hide-nav",!i.value)}),(u,h)=>i.value?(a(),c("header",qa,[m(pa,{"is-screen-open":r(e),onToggleScreen:r(n)},{"nav-bar-title-before":v(()=>[l(u.$slots,"nav-bar-title-before",{},void 0,!0)]),"nav-bar-title-after":v(()=>[l(u.$slots,"nav-bar-title-after",{},void 0,!0)]),"nav-bar-content-before":v(()=>[l(u.$slots,"nav-bar-content-before",{},void 0,!0)]),"nav-bar-content-after":v(()=>[l(u.$slots,"nav-bar-content-after",{},void 0,!0)]),_:3},8,["is-screen-open","onToggleScreen"]),m(za,{open:r(e)},{"nav-screen-content-before":v(()=>[l(u.$slots,"nav-screen-content-before",{},void 0,!0)]),"nav-screen-content-after":v(()=>[l(u.$slots,"nav-screen-content-after",{},void 0,!0)]),_:3},8,["open"])])):f("",!0)}}),Ka=k(Wa,[["__scopeId","data-v-ae24b3ad"]]),De=o=>(C("data-v-b8d55f3b"),o=o(),H(),o),Ra=["role","tabindex"],Ja=De(()=>p("div",{class:"indicator"},null,-1)),Ya=De(()=>p("span",{class:"vpi-chevron-right caret-icon"},null,-1)),Qa=[Ya],Xa={key:1,class:"items"},Za=_({__name:"VPSidebarItem",props:{item:{},depth:{}},setup(o){const e=o,{collapsed:t,collapsible:n,isLink:s,isActiveLink:i,hasActiveLink:u,hasChildren:h,toggle:d}=mt($(()=>e.item)),g=$(()=>h.value?"section":"div"),P=$(()=>s.value?"a":"div"),y=$(()=>h.value?e.depth+2===7?"p":`h${e.depth+2}`:"p"),V=$(()=>s.value?void 0:"button"),N=$(()=>[[`level-${e.depth}`],{collapsible:n.value},{collapsed:t.value},{"is-link":s.value},{"is-active":i.value},{"has-active":u.value}]);function A(S){"key"in S&&S.key!=="Enter"||!e.item.link&&d()}function B(){e.item.link&&d()}return(S,U)=>{const G=q("VPSidebarItem",!0);return a(),b(K(g.value),{class:w(["VPSidebarItem",N.value])},{default:v(()=>[S.item.text?(a(),c("div",X({key:0,class:"item",role:V.value},Ye(S.item.items?{click:A,keydown:A}:{},!0),{tabindex:S.item.items&&0}),[Ja,S.item.link?(a(),b(F,{key:0,tag:P.value,class:"link",href:S.item.link,rel:S.item.rel,target:S.item.target},{default:v(()=>[(a(),b(K(y.value),{class:"text",innerHTML:S.item.text},null,8,["innerHTML"]))]),_:1},8,["tag","href","rel","target"])):(a(),b(K(y.value),{key:1,class:"text",innerHTML:S.item.text},null,8,["innerHTML"])),S.item.collapsed!=null&&S.item.items&&S.item.items.length?(a(),c("div",{key:2,class:"caret",role:"button","aria-label":"toggle section",onClick:B,onKeydown:Je(B,["enter"]),tabindex:"0"},Qa,32)):f("",!0)],16,Ra)):f("",!0),S.item.items&&S.item.items.length?(a(),c("div",Xa,[S.depth<5?(a(!0),c(M,{key:0},E(S.item.items,W=>(a(),b(G,{key:W.text,item:W,depth:S.depth+1},null,8,["item","depth"]))),128)):f("",!0)])):f("",!0)]),_:1},8,["class"])}}}),xa=k(Za,[["__scopeId","data-v-b8d55f3b"]]),Oe=o=>(C("data-v-575e6a36"),o=o(),H(),o),er=Oe(()=>p("div",{class:"curtain"},null,-1)),tr={class:"nav",id:"VPSidebarNav","aria-labelledby":"sidebar-aria-label",tabindex:"-1"},or=Oe(()=>p("span",{class:"visually-hidden",id:"sidebar-aria-label"}," Sidebar Navigation ",-1)),sr=_({__name:"VPSidebar",props:{open:{type:Boolean}},setup(o){const{sidebarGroups:e,hasSidebar:t}=O(),n=o,s=T(null),i=Ie(Y?document.body:null);return j([n,s],()=>{var u;n.open?(i.value=!0,(u=s.value)==null||u.focus()):i.value=!1},{immediate:!0,flush:"post"}),(u,h)=>r(t)?(a(),c("aside",{key:0,class:w(["VPSidebar",{open:u.open}]),ref_key:"navEl",ref:s,onClick:h[0]||(h[0]=Qe(()=>{},["stop"]))},[er,p("nav",tr,[or,l(u.$slots,"sidebar-nav-before",{},void 0,!0),(a(!0),c(M,null,E(r(e),d=>(a(),c("div",{key:d.text,class:"group"},[m(xa,{item:d,depth:0},null,8,["item"])]))),128)),l(u.$slots,"sidebar-nav-after",{},void 0,!0)])],2)):f("",!0)}}),nr=k(sr,[["__scopeId","data-v-575e6a36"]]),ar=_({__name:"VPSkipLink",setup(o){const e=te(),t=T();j(()=>e.path,()=>t.value.focus());function n({target:s}){const i=document.getElementById(decodeURIComponent(s.hash).slice(1));if(i){const u=()=>{i.removeAttribute("tabindex"),i.removeEventListener("blur",u)};i.setAttribute("tabindex","-1"),i.addEventListener("blur",u),i.focus(),window.scrollTo(0,0)}}return(s,i)=>(a(),c(M,null,[p("span",{ref_key:"backToTop",ref:t,tabindex:"-1"},null,512),p("a",{href:"#VPContent",class:"VPSkipLink visually-hidden",onClick:n}," Skip to content ")],64))}}),rr=k(ar,[["__scopeId","data-v-0f60ec36"]]),ir=_({__name:"Layout",setup(o){const{isOpen:e,open:t,close:n}=O(),s=te();j(()=>s.path,n),_t(e,n);const{frontmatter:i}=L(),u=Xe(),h=$(()=>!!u["home-hero-image"]);return Te("hero-image-slot-exists",h),(d,g)=>{const P=q("Content");return r(i).layout!==!1?(a(),c("div",{key:0,class:w(["Layout",r(i).pageClass])},[l(d.$slots,"layout-top",{},void 0,!0),m(rr),m(tt,{class:"backdrop",show:r(e),onClick:r(n)},null,8,["show","onClick"]),m(Ka,null,{"nav-bar-title-before":v(()=>[l(d.$slots,"nav-bar-title-before",{},void 0,!0)]),"nav-bar-title-after":v(()=>[l(d.$slots,"nav-bar-title-after",{},void 0,!0)]),"nav-bar-content-before":v(()=>[l(d.$slots,"nav-bar-content-before",{},void 0,!0)]),"nav-bar-content-after":v(()=>[l(d.$slots,"nav-bar-content-after",{},void 0,!0)]),"nav-screen-content-before":v(()=>[l(d.$slots,"nav-screen-content-before",{},void 0,!0)]),"nav-screen-content-after":v(()=>[l(d.$slots,"nav-screen-content-after",{},void 0,!0)]),_:3}),m(Ss,{open:r(e),onOpenMenu:r(t)},null,8,["open","onOpenMenu"]),m(nr,{open:r(e)},{"sidebar-nav-before":v(()=>[l(d.$slots,"sidebar-nav-before",{},void 0,!0)]),"sidebar-nav-after":v(()=>[l(d.$slots,"sidebar-nav-after",{},void 0,!0)]),_:3},8,["open"]),m(rs,null,{"page-top":v(()=>[l(d.$slots,"page-top",{},void 0,!0)]),"page-bottom":v(()=>[l(d.$slots,"page-bottom",{},void 0,!0)]),"not-found":v(()=>[l(d.$slots,"not-found",{},void 0,!0)]),"home-hero-before":v(()=>[l(d.$slots,"home-hero-before",{},void 0,!0)]),"home-hero-info-before":v(()=>[l(d.$slots,"home-hero-info-before",{},void 0,!0)]),"home-hero-info":v(()=>[l(d.$slots,"home-hero-info",{},void 0,!0)]),"home-hero-info-after":v(()=>[l(d.$slots,"home-hero-info-after",{},void 0,!0)]),"home-hero-actions-after":v(()=>[l(d.$slots,"home-hero-actions-after",{},void 0,!0)]),"home-hero-image":v(()=>[l(d.$slots,"home-hero-image",{},void 0,!0)]),"home-hero-after":v(()=>[l(d.$slots,"home-hero-after",{},void 0,!0)]),"home-features-before":v(()=>[l(d.$slots,"home-features-before",{},void 0,!0)]),"home-features-after":v(()=>[l(d.$slots,"home-features-after",{},void 0,!0)]),"doc-footer-before":v(()=>[l(d.$slots,"doc-footer-before",{},void 0,!0)]),"doc-before":v(()=>[l(d.$slots,"doc-before",{},void 0,!0)]),"doc-after":v(()=>[l(d.$slots,"doc-after",{},void 0,!0)]),"doc-top":v(()=>[l(d.$slots,"doc-top",{},void 0,!0)]),"doc-bottom":v(()=>[l(d.$slots,"doc-bottom",{},void 0,!0)]),"aside-top":v(()=>[l(d.$slots,"aside-top",{},void 0,!0)]),"aside-bottom":v(()=>[l(d.$slots,"aside-bottom",{},void 0,!0)]),"aside-outline-before":v(()=>[l(d.$slots,"aside-outline-before",{},void 0,!0)]),"aside-outline-after":v(()=>[l(d.$slots,"aside-outline-after",{},void 0,!0)]),"aside-ads-before":v(()=>[l(d.$slots,"aside-ads-before",{},void 0,!0)]),"aside-ads-after":v(()=>[l(d.$slots,"aside-ads-after",{},void 0,!0)]),_:3}),m(ds),l(d.$slots,"layout-bottom",{},void 0,!0)],2)):(a(),b(P,{key:1}))}}}),lr=k(ir,[["__scopeId","data-v-5d98c3a5"]]),cr={Layout:lr,enhanceApp:({app:o})=>{o.component("Badge",Ze)}},dr={...cr,setup(){const{lang:o}=ge();J(()=>{Y&&(document.cookie=`nf_lang=${o.value}; expires=Mon, 1 Jan 2024 00:00:00 UTC; path=/`)})}};export{dr as R}; diff --git a/assets/chunks/theme.8dVMQbWa.js b/assets/chunks/theme.8dVMQbWa.js new file mode 100644 index 00000000..ee870acb --- /dev/null +++ b/assets/chunks/theme.8dVMQbWa.js @@ -0,0 +1 @@ +import{d as m,c as d,r as u,n as T,o as a,a as z,t as N,b as k,w as p,T as de,e as h,_ as b,u as Le,i as De,f as Oe,g as ve,h as g,j as v,k as i,l as W,m as $e,p as j,q as Ge,s as pe,v as Ue,x as V,y as Q,z as D,A as fe,B as he,C as J,D as ee,E as ye,F as Ve,G as M,H as B,I as q,J as _,K as E,L as Se,M as U,N as te,O as je,P as Te,Q as ze,R as Ne,S as we,U as We,V as Me,W as Ie,X as qe,Y as Re,Z as Ke,$ as Je,a0 as Ye}from"./framework.PeLcR_tw.js";const Qe=m({__name:"VPBadge",props:{text:{},type:{default:"tip"}},setup(o){return(e,t)=>(a(),d("span",{class:T(["VPBadge",e.type])},[u(e.$slots,"default",{},()=>[z(N(e.text),1)])],2))}}),Xe={key:0,class:"VPBackdrop"},Ze=m({__name:"VPBackdrop",props:{show:{type:Boolean}},setup(o){return(e,t)=>(a(),k(de,{name:"fade"},{default:p(()=>[e.show?(a(),d("div",Xe)):h("",!0)]),_:1}))}}),xe=b(Ze,[["__scopeId","data-v-c79a1216"]]),L=Le;function et(o,e){let t,n=!1;return()=>{t&&clearTimeout(t),n?t=setTimeout(o,e):(o(),(n=!0)&&setTimeout(()=>n=!1,e))}}function re(o){return o.startsWith("/")?o:`/${o}`}function me(o){const{pathname:e,search:t,hash:n,protocol:s}=new URL(o,"http://a.com");if(De(o)||o.startsWith("#")||!s.startsWith("http")||!Oe(e))return o;const{site:r}=L(),c=e.endsWith("/")||e.endsWith(".html")?o:o.replace(/(?:(^\.+)\/)?.*$/,`$1${e.replace(/(\.md)?$/,r.value.cleanUrls?"":".html")}${t}${n}`);return ve(c)}function X({correspondingLink:o=!1}={}){const{site:e,localeIndex:t,page:n,theme:s,hash:r}=L(),c=g(()=>{var f,$;return{label:(f=e.value.locales[t.value])==null?void 0:f.label,link:(($=e.value.locales[t.value])==null?void 0:$.link)||(t.value==="root"?"/":`/${t.value}/`)}});return{localeLinks:g(()=>Object.entries(e.value.locales).flatMap(([f,$])=>c.value.label===$.label?[]:{text:$.label,link:tt($.link||(f==="root"?"/":`/${f}/`),s.value.i18nRouting!==!1&&o,n.value.relativePath.slice(c.value.link.length-1),!e.value.cleanUrls)+r.value})),currentLang:c}}function tt(o,e,t,n){return e?o.replace(/\/$/,"")+re(t.replace(/(^|\/)index\.md$/,"$1").replace(/\.md$/,n?".html":"")):o}const nt={class:"NotFound"},st={class:"code"},ot={class:"title"},at={class:"quote"},rt={class:"action"},it=["href","aria-label"],lt=m({__name:"NotFound",setup(o){const{theme:e}=L(),{currentLang:t}=X();return(n,s)=>{var r,c,l,f,$,P;return a(),d("div",nt,[v("p",st,N(((r=i(e).notFound)==null?void 0:r.code)??"404"),1),v("h1",ot,N(((c=i(e).notFound)==null?void 0:c.title)??"PAGE NOT FOUND"),1),s[0]||(s[0]=v("div",{class:"divider"},null,-1)),v("blockquote",at,N(((l=i(e).notFound)==null?void 0:l.quote)??"But if you don't change your direction, and if you keep looking, you may end up where you are heading."),1),v("div",rt,[v("a",{class:"link",href:i(ve)(((f=i(e).notFound)==null?void 0:f.link)??i(t).link),"aria-label":(($=i(e).notFound)==null?void 0:$.linkLabel)??"go to home"},N(((P=i(e).notFound)==null?void 0:P.linkText)??"Take me home"),9,it)])])}}}),ct=b(lt,[["__scopeId","data-v-829df670"]]);function He(o,e){if(Array.isArray(o))return Z(o);if(o==null)return[];e=re(e);const t=Object.keys(o).sort((s,r)=>r.split("/").length-s.split("/").length).find(s=>e.startsWith(re(s))),n=t?o[t]:[];return Array.isArray(n)?Z(n):Z(n.items,n.base)}function ut(o){const e=[];let t=0;for(const n in o){const s=o[n];if(s.items){t=e.push(s);continue}e[t]||e.push({items:[]}),e[t].items.push(s)}return e}function dt(o){const e=[];function t(n){for(const s of n)s.text&&s.link&&e.push({text:s.text,link:s.link,docFooterText:s.docFooterText}),s.items&&t(s.items)}return t(o),e}function ie(o,e){return Array.isArray(e)?e.some(t=>ie(o,t)):W(o,e.link)?!0:e.items?ie(o,e.items):!1}function Z(o,e){return[...o].map(t=>{const n={...t},s=n.base||e;return s&&n.link&&(n.link=s+n.link),n.items&&(n.items=Z(n.items,s)),n})}function vt(){const{hasSidebar:o}=O(),e=$e("(min-width: 960px)"),t=$e("(min-width: 1280px)");return{isAsideEnabled:g(()=>!t.value&&!e.value?!1:o.value?t.value:e.value)}}const pt=/\b(?:VPBadge|header-anchor|footnote-ref|ignore-header)\b/,le=[];function Be(o){return typeof o.outline=="object"&&!Array.isArray(o.outline)&&o.outline.label||o.outlineTitle||"On this page"}function ft(o){const e=[...document.querySelectorAll(".VPDoc :where(h1,h2,h3,h4,h5,h6)")].filter(t=>t.id&&t.hasChildNodes()).map(t=>{const n=Number(t.tagName[1]);return{element:t,title:ht(t),link:"#"+t.id,level:n}});return mt(e,o)}function ht(o){let e="";for(const t of o.childNodes)if(t.nodeType===1){if(pt.test(t.className))continue;e+=t.textContent}else t.nodeType===3&&(e+=t.textContent);return e.trim()}function mt(o,e){if(e===!1)return[];const t=(typeof e=="object"&&!Array.isArray(e)?e.level:e)||2,[n,s]=typeof t=="number"?[t,t]:t==="deep"?[2,6]:t;return bt(o,n,s)}function _t(o,e){const{isAsideEnabled:t}=vt(),n=et(r,100);let s=null;j(()=>{requestAnimationFrame(r),window.addEventListener("scroll",n)}),Ge(()=>{c(location.hash)}),pe(()=>{window.removeEventListener("scroll",n)});function r(){if(!t.value)return;const l=window.scrollY,f=window.innerHeight,$=document.body.offsetHeight,P=Math.abs(l+f-$)<1,y=le.map(({element:I,link:H})=>({link:H,top:kt(I)})).filter(({top:I})=>!Number.isNaN(I)).sort((I,H)=>I.top-H.top);if(!y.length){c(null);return}if(l<1){c(null);return}if(P){c(y[y.length-1].link);return}let S=null;for(const{link:I,top:H}of y){if(H>l+Ue()+4)break;S=I}c(S)}function c(l){s&&s.classList.remove("active"),l==null?s=null:s=o.value.querySelector(`a[href="${decodeURIComponent(l)}"]`);const f=s;f?(f.classList.add("active"),e.value.style.top=f.offsetTop+39+"px",e.value.style.opacity="1"):(e.value.style.top="33px",e.value.style.opacity="0")}}function kt(o){let e=0;for(;o!==document.body;){if(o===null)return NaN;e+=o.offsetTop,o=o.offsetParent}return e}function bt(o,e,t){le.length=0;const n=[],s=[];return o.forEach(r=>{const c={...r,children:[]};let l=s[s.length-1];for(;l&&l.level>=c.level;)s.pop(),l=s[s.length-1];if(c.element.classList.contains("ignore-header")||l&&"shouldIgnore"in l){s.push({level:c.level,shouldIgnore:!0});return}c.level>t||c.level{e=K.value?document.activeElement:void 0}),j(()=>{window.addEventListener("keyup",t)}),pe(()=>{window.removeEventListener("keyup",t)});function t(n){n.key==="Escape"&&K.value&&(o(),e==null||e.focus())}}function $t(){function o(){K.value=!0}function e(){K.value=!1}function t(){K.value?e():o()}return{isOpen:K,open:o,close:e,toggle:t}}function yt(o){const{page:e,hash:t}=L(),n=V(!1),s=g(()=>o.value.collapsed!=null),r=g(()=>!!o.value.link),c=V(!1),l=()=>{c.value=W(e.value.relativePath,o.value.link)};D([e,o,t],l),j(l);const f=g(()=>c.value?!0:o.value.items?ie(e.value.relativePath,o.value.items):!1),$=g(()=>!!(o.value.items&&o.value.items.length));Q(()=>{n.value=!!(s.value&&o.value.collapsed)}),fe(()=>{(c.value||f.value)&&(n.value=!1)});function P(){s.value&&(n.value=!n.value)}return{collapsed:n,collapsible:s,isLink:r,isActiveLink:c,hasActiveLink:f,hasChildren:$,toggle:P}}const ce=he([]),Y=he([]),ue=he(!1);function O(){const{frontmatter:o,theme:e}=L(),t=g(()=>!!(o.value.isHome??o.value.layout==="home")),n=g(()=>o.value.sidebar!==!1&&Y.value.length>0&&!t.value),s=g(()=>n.value&&ue.value),r=g(()=>n.value?ut(Y.value):[]),c=g(()=>t.value?!1:o.value.aside!=null?!!o.value.aside:e.value.aside!==!1),l=g(()=>c.value?o.value.aside==null?e.value.aside==="left":o.value.aside==="left":!1),f=g(()=>ce.value.length>0);return{isHome:t,sidebar:ye(Y),sidebarGroups:r,hasSidebar:n,isSidebarEnabled:s,hasAside:c,leftAside:l,headers:ye(ce),hasLocalNav:f}}function Pt({closeSidebar:o}){const{frontmatter:e,page:t,theme:n}=L();D(()=>[t.value.relativePath,n.value.sidebar],([r,c])=>{const l=c?He(c,r):[];JSON.stringify(l)!==JSON.stringify(Y.value)&&(Y.value=l)},{immediate:!0,deep:!0,flush:"sync"}),Ve(()=>{ce.value=ft(e.value.outline??n.value.outline)}),J&&(ue.value=window.innerWidth>=960,window.addEventListener("resize",()=>{ue.value=window.innerWidth>=960},{passive:!0}));const s=ee();D(()=>s.path,o),gt(o)}const Lt=["href","title"],Vt=m({__name:"VPDocOutlineItem",props:{headers:{},root:{type:Boolean}},setup(o){function e({target:t}){const n=t.href.split("#")[1],s=document.getElementById(decodeURIComponent(n));s==null||s.focus({preventScroll:!0})}return(t,n)=>{const s=q("VPDocOutlineItem",!0);return a(),d("ul",{class:T(["VPDocOutlineItem",t.root?"root":"nested"])},[(a(!0),d(M,null,B(t.headers,({children:r,link:c,title:l})=>(a(),d("li",null,[v("a",{class:"outline-link",href:c,onClick:e,title:l},N(l),9,Lt),r!=null&&r.length?(a(),k(s,{key:0,headers:r},null,8,["headers"])):h("",!0)]))),256))],2)}}}),Ae=b(Vt,[["__scopeId","data-v-2d0bdf9b"]]),St={class:"content"},Tt={"aria-level":"2",class:"outline-title",id:"doc-outline-aria-label",role:"heading"},Nt=m({__name:"VPDocAsideOutline",setup(o){const{theme:e}=L(),t=V(),n=V(),{headers:s,hasLocalNav:r}=O();return _t(t,n),(c,l)=>(a(),d("nav",{"aria-labelledby":"doc-outline-aria-label",class:T(["VPDocAsideOutline",{"has-outline":i(r)}]),ref_key:"container",ref:t},[v("div",St,[v("div",{class:"outline-marker",ref_key:"marker",ref:n},null,512),v("div",Tt,N(i(Be)(i(e))),1),_(Ae,{headers:i(s),root:!0},null,8,["headers"])])],2))}}),wt=b(Nt,[["__scopeId","data-v-60d5052e"]]),Mt={class:"VPDocAsideCarbonAds"},It=m({__name:"VPDocAsideCarbonAds",props:{carbonAds:{}},setup(o){const e=()=>null;return(t,n)=>(a(),d("div",Mt,[_(i(e),{"carbon-ads":t.carbonAds},null,8,["carbon-ads"])]))}}),Ht={class:"VPDocAside"},Bt=m({__name:"VPDocAside",setup(o){const{theme:e}=L();return(t,n)=>(a(),d("div",Ht,[u(t.$slots,"aside-top",{},void 0,!0),u(t.$slots,"aside-outline-before",{},void 0,!0),_(wt),u(t.$slots,"aside-outline-after",{},void 0,!0),n[0]||(n[0]=v("div",{class:"spacer"},null,-1)),u(t.$slots,"aside-ads-before",{},void 0,!0),i(e).carbonAds?(a(),k(It,{key:0,"carbon-ads":i(e).carbonAds},null,8,["carbon-ads"])):h("",!0),u(t.$slots,"aside-ads-after",{},void 0,!0),u(t.$slots,"aside-bottom",{},void 0,!0)]))}}),At=b(Bt,[["__scopeId","data-v-3f215769"]]);function Ct(){const{theme:o,page:e}=L();return g(()=>{const{text:t="Edit this page",pattern:n=""}=o.value.editLink||{};let s;return typeof n=="function"?s=n(e.value):s=n.replace(/:path/g,e.value.filePath),{url:s,text:t}})}function Et(){const{page:o,theme:e,frontmatter:t}=L();return g(()=>{var $,P,y,S,I,H,A,w;const n=He(e.value.sidebar,o.value.relativePath),s=dt(n),r=Ft(s,C=>C.link.replace(/[?#].*$/,"")),c=r.findIndex(C=>W(o.value.relativePath,C.link)),l=(($=e.value.docFooter)==null?void 0:$.prev)===!1&&!t.value.prev||t.value.prev===!1,f=((P=e.value.docFooter)==null?void 0:P.next)===!1&&!t.value.next||t.value.next===!1;return{prev:l?void 0:{text:(typeof t.value.prev=="string"?t.value.prev:typeof t.value.prev=="object"?t.value.prev.text:void 0)??((y=r[c-1])==null?void 0:y.docFooterText)??((S=r[c-1])==null?void 0:S.text),link:(typeof t.value.prev=="object"?t.value.prev.link:void 0)??((I=r[c-1])==null?void 0:I.link)},next:f?void 0:{text:(typeof t.value.next=="string"?t.value.next:typeof t.value.next=="object"?t.value.next.text:void 0)??((H=r[c+1])==null?void 0:H.docFooterText)??((A=r[c+1])==null?void 0:A.text),link:(typeof t.value.next=="object"?t.value.next.link:void 0)??((w=r[c+1])==null?void 0:w.link)}}})}function Ft(o,e){const t=new Set;return o.filter(n=>{const s=e(n);return t.has(s)?!1:t.add(s)})}const F=m({__name:"VPLink",props:{tag:{},href:{},noIcon:{type:Boolean},target:{},rel:{}},setup(o){const e=o,t=g(()=>e.tag??(e.href?"a":"span")),n=g(()=>e.href&&Se.test(e.href)||e.target==="_blank");return(s,r)=>(a(),k(E(t.value),{class:T(["VPLink",{link:s.href,"vp-external-link-icon":n.value,"no-icon":s.noIcon}]),href:s.href?i(me)(s.href):void 0,target:s.target??(n.value?"_blank":void 0),rel:s.rel??(n.value?"noreferrer":void 0)},{default:p(()=>[u(s.$slots,"default")]),_:3},8,["class","href","target","rel"]))}}),Dt={class:"VPLastUpdated"},Ot=["datetime"],Gt=m({__name:"VPDocFooterLastUpdated",setup(o){const{theme:e,page:t,lang:n}=L(),s=g(()=>new Date(t.value.lastUpdated)),r=g(()=>s.value.toISOString()),c=V("");return j(()=>{Q(()=>{var l,f,$;c.value=new Intl.DateTimeFormat((f=(l=e.value.lastUpdated)==null?void 0:l.formatOptions)!=null&&f.forceLocale?n.value:void 0,(($=e.value.lastUpdated)==null?void 0:$.formatOptions)??{dateStyle:"short",timeStyle:"short"}).format(s.value)})}),(l,f)=>{var $;return a(),d("p",Dt,[z(N((($=i(e).lastUpdated)==null?void 0:$.text)||i(e).lastUpdatedText||"Last updated")+": ",1),v("time",{datetime:r.value},N(c.value),9,Ot)])}}}),Ut=b(Gt,[["__scopeId","data-v-e98dd255"]]),jt={key:0,class:"VPDocFooter"},zt={key:0,class:"edit-info"},Wt={key:0,class:"edit-link"},qt={key:1,class:"last-updated"},Rt={key:1,class:"prev-next","aria-labelledby":"doc-footer-aria-label"},Kt={class:"pager"},Jt=["innerHTML"],Yt=["innerHTML"],Qt={class:"pager"},Xt=["innerHTML"],Zt=["innerHTML"],xt=m({__name:"VPDocFooter",setup(o){const{theme:e,page:t,frontmatter:n}=L(),s=Ct(),r=Et(),c=g(()=>e.value.editLink&&n.value.editLink!==!1),l=g(()=>t.value.lastUpdated),f=g(()=>c.value||l.value||r.value.prev||r.value.next);return($,P)=>{var y,S,I,H;return f.value?(a(),d("footer",jt,[u($.$slots,"doc-footer-before",{},void 0,!0),c.value||l.value?(a(),d("div",zt,[c.value?(a(),d("div",Wt,[_(F,{class:"edit-link-button",href:i(s).url,"no-icon":!0},{default:p(()=>[P[0]||(P[0]=v("span",{class:"vpi-square-pen edit-link-icon"},null,-1)),z(" "+N(i(s).text),1)]),_:1,__:[0]},8,["href"])])):h("",!0),l.value?(a(),d("div",qt,[_(Ut)])):h("",!0)])):h("",!0),(y=i(r).prev)!=null&&y.link||(S=i(r).next)!=null&&S.link?(a(),d("nav",Rt,[P[1]||(P[1]=v("span",{class:"visually-hidden",id:"doc-footer-aria-label"},"Pager",-1)),v("div",Kt,[(I=i(r).prev)!=null&&I.link?(a(),k(F,{key:0,class:"pager-link prev",href:i(r).prev.link},{default:p(()=>{var A;return[v("span",{class:"desc",innerHTML:((A=i(e).docFooter)==null?void 0:A.prev)||"Previous page"},null,8,Jt),v("span",{class:"title",innerHTML:i(r).prev.text},null,8,Yt)]}),_:1},8,["href"])):h("",!0)]),v("div",Qt,[(H=i(r).next)!=null&&H.link?(a(),k(F,{key:0,class:"pager-link next",href:i(r).next.link},{default:p(()=>{var A;return[v("span",{class:"desc",innerHTML:((A=i(e).docFooter)==null?void 0:A.next)||"Next page"},null,8,Xt),v("span",{class:"title",innerHTML:i(r).next.text},null,8,Zt)]}),_:1},8,["href"])):h("",!0)])])):h("",!0)])):h("",!0)}}}),en=b(xt,[["__scopeId","data-v-e257564d"]]),tn={class:"container"},nn={class:"aside-container"},sn={class:"aside-content"},on={class:"content"},an={class:"content-container"},rn={class:"main"},ln=m({__name:"VPDoc",setup(o){const{theme:e}=L(),t=ee(),{hasSidebar:n,hasAside:s,leftAside:r}=O(),c=g(()=>t.path.replace(/[./]+/g,"_").replace(/_html$/,""));return(l,f)=>{const $=q("Content");return a(),d("div",{class:T(["VPDoc",{"has-sidebar":i(n),"has-aside":i(s)}])},[u(l.$slots,"doc-top",{},void 0,!0),v("div",tn,[i(s)?(a(),d("div",{key:0,class:T(["aside",{"left-aside":i(r)}])},[f[0]||(f[0]=v("div",{class:"aside-curtain"},null,-1)),v("div",nn,[v("div",sn,[_(At,null,{"aside-top":p(()=>[u(l.$slots,"aside-top",{},void 0,!0)]),"aside-bottom":p(()=>[u(l.$slots,"aside-bottom",{},void 0,!0)]),"aside-outline-before":p(()=>[u(l.$slots,"aside-outline-before",{},void 0,!0)]),"aside-outline-after":p(()=>[u(l.$slots,"aside-outline-after",{},void 0,!0)]),"aside-ads-before":p(()=>[u(l.$slots,"aside-ads-before",{},void 0,!0)]),"aside-ads-after":p(()=>[u(l.$slots,"aside-ads-after",{},void 0,!0)]),_:3})])])],2)):h("",!0),v("div",on,[v("div",an,[u(l.$slots,"doc-before",{},void 0,!0),v("main",rn,[_($,{class:T(["vp-doc",[c.value,i(e).externalLinkIcon&&"external-link-icon-enabled"]])},null,8,["class"])]),_(en,null,{"doc-footer-before":p(()=>[u(l.$slots,"doc-footer-before",{},void 0,!0)]),_:3}),u(l.$slots,"doc-after",{},void 0,!0)])])]),u(l.$slots,"doc-bottom",{},void 0,!0)],2)}}}),cn=b(ln,[["__scopeId","data-v-7011f0d8"]]),un=m({__name:"VPButton",props:{tag:{},size:{default:"medium"},theme:{default:"brand"},text:{},href:{},target:{},rel:{}},setup(o){const e=o,t=g(()=>e.href&&Se.test(e.href)),n=g(()=>e.tag||(e.href?"a":"button"));return(s,r)=>(a(),k(E(n.value),{class:T(["VPButton",[s.size,s.theme]]),href:s.href?i(me)(s.href):void 0,target:e.target??(t.value?"_blank":void 0),rel:e.rel??(t.value?"noreferrer":void 0)},{default:p(()=>[u(s.$slots,"default",{},()=>[z(N(s.text),1)],!0)]),_:3},8,["class","href","target","rel"]))}}),dn=b(un,[["__scopeId","data-v-01bff58b"]]),vn=["src","alt"],pn=m({inheritAttrs:!1,__name:"VPImage",props:{image:{},alt:{}},setup(o){return(e,t)=>{const n=q("VPImage",!0);return e.image?(a(),d(M,{key:0},[typeof e.image=="string"||"src"in e.image?(a(),d("img",U({key:0,class:"VPImage"},typeof e.image=="string"?e.$attrs:{...e.image,...e.$attrs},{src:i(ve)(typeof e.image=="string"?e.image:e.image.src),alt:e.alt??(typeof e.image=="string"?"":e.image.alt||"")}),null,16,vn)):(a(),d(M,{key:1},[_(n,U({class:"dark",image:e.image.dark,alt:e.image.alt},e.$attrs),null,16,["image","alt"]),_(n,U({class:"light",image:e.image.light,alt:e.image.alt},e.$attrs),null,16,["image","alt"])],64))],64)):h("",!0)}}}),x=b(pn,[["__scopeId","data-v-8426fc1a"]]),fn={class:"container"},hn={class:"main"},mn={class:"heading"},_n=["innerHTML"],kn=["innerHTML"],bn=["innerHTML"],gn={key:0,class:"actions"},$n={key:0,class:"image"},yn={class:"image-container"},Pn=m({__name:"VPHero",props:{name:{},text:{},tagline:{},image:{},actions:{}},setup(o){const e=te("hero-image-slot-exists");return(t,n)=>(a(),d("div",{class:T(["VPHero",{"has-image":t.image||i(e)}])},[v("div",fn,[v("div",hn,[u(t.$slots,"home-hero-info-before",{},void 0,!0),u(t.$slots,"home-hero-info",{},()=>[v("h1",mn,[t.name?(a(),d("span",{key:0,innerHTML:t.name,class:"name clip"},null,8,_n)):h("",!0),t.text?(a(),d("span",{key:1,innerHTML:t.text,class:"text"},null,8,kn)):h("",!0)]),t.tagline?(a(),d("p",{key:0,innerHTML:t.tagline,class:"tagline"},null,8,bn)):h("",!0)],!0),u(t.$slots,"home-hero-info-after",{},void 0,!0),t.actions?(a(),d("div",gn,[(a(!0),d(M,null,B(t.actions,s=>(a(),d("div",{key:s.link,class:"action"},[_(dn,{tag:"a",size:"medium",theme:s.theme,text:s.text,href:s.link,target:s.target,rel:s.rel},null,8,["theme","text","href","target","rel"])]))),128))])):h("",!0),u(t.$slots,"home-hero-actions-after",{},void 0,!0)]),t.image||i(e)?(a(),d("div",$n,[v("div",yn,[n[0]||(n[0]=v("div",{class:"image-bg"},null,-1)),u(t.$slots,"home-hero-image",{},()=>[t.image?(a(),k(x,{key:0,class:"image-src",image:t.image},null,8,["image"])):h("",!0)],!0)])])):h("",!0)])],2))}}),Ln=b(Pn,[["__scopeId","data-v-f930dc11"]]),Vn=m({__name:"VPHomeHero",setup(o){const{frontmatter:e}=L();return(t,n)=>i(e).hero?(a(),k(Ln,{key:0,class:"VPHomeHero",name:i(e).hero.name,text:i(e).hero.text,tagline:i(e).hero.tagline,image:i(e).hero.image,actions:i(e).hero.actions},{"home-hero-info-before":p(()=>[u(t.$slots,"home-hero-info-before")]),"home-hero-info":p(()=>[u(t.$slots,"home-hero-info")]),"home-hero-info-after":p(()=>[u(t.$slots,"home-hero-info-after")]),"home-hero-actions-after":p(()=>[u(t.$slots,"home-hero-actions-after")]),"home-hero-image":p(()=>[u(t.$slots,"home-hero-image")]),_:3},8,["name","text","tagline","image","actions"])):h("",!0)}}),Sn={class:"box"},Tn={key:0,class:"icon"},Nn=["innerHTML"],wn=["innerHTML"],Mn=["innerHTML"],In={key:4,class:"link-text"},Hn={class:"link-text-value"},Bn=m({__name:"VPFeature",props:{icon:{},title:{},details:{},link:{},linkText:{},rel:{},target:{}},setup(o){return(e,t)=>(a(),k(F,{class:"VPFeature",href:e.link,rel:e.rel,target:e.target,"no-icon":!0,tag:e.link?"a":"div"},{default:p(()=>[v("article",Sn,[typeof e.icon=="object"&&e.icon.wrap?(a(),d("div",Tn,[_(x,{image:e.icon,alt:e.icon.alt,height:e.icon.height||48,width:e.icon.width||48},null,8,["image","alt","height","width"])])):typeof e.icon=="object"?(a(),k(x,{key:1,image:e.icon,alt:e.icon.alt,height:e.icon.height||48,width:e.icon.width||48},null,8,["image","alt","height","width"])):e.icon?(a(),d("div",{key:2,class:"icon",innerHTML:e.icon},null,8,Nn)):h("",!0),v("h2",{class:"title",innerHTML:e.title},null,8,wn),e.details?(a(),d("p",{key:3,class:"details",innerHTML:e.details},null,8,Mn)):h("",!0),e.linkText?(a(),d("div",In,[v("p",Hn,[z(N(e.linkText)+" ",1),t[0]||(t[0]=v("span",{class:"vpi-arrow-right link-text-icon"},null,-1))])])):h("",!0)])]),_:1},8,["href","rel","target","tag"]))}}),An=b(Bn,[["__scopeId","data-v-5219619b"]]),Cn={key:0,class:"VPFeatures"},En={class:"container"},Fn={class:"items"},Dn=m({__name:"VPFeatures",props:{features:{}},setup(o){const e=o,t=g(()=>{const n=e.features.length;if(n){if(n===2)return"grid-2";if(n===3)return"grid-3";if(n%3===0)return"grid-6";if(n>3)return"grid-4"}else return});return(n,s)=>n.features?(a(),d("div",Cn,[v("div",En,[v("div",Fn,[(a(!0),d(M,null,B(n.features,r=>(a(),d("div",{key:r.title,class:T(["item",[t.value]])},[_(An,{icon:r.icon,title:r.title,details:r.details,link:r.link,"link-text":r.linkText,rel:r.rel,target:r.target},null,8,["icon","title","details","link","link-text","rel","target"])],2))),128))])])])):h("",!0)}}),On=b(Dn,[["__scopeId","data-v-a6181336"]]),Gn=m({__name:"VPHomeFeatures",setup(o){const{frontmatter:e}=L();return(t,n)=>i(e).features?(a(),k(On,{key:0,class:"VPHomeFeatures",features:i(e).features},null,8,["features"])):h("",!0)}}),Un=m({__name:"VPHomeContent",setup(o){const{width:e}=je({initialWidth:0,includeScrollbar:!1});return(t,n)=>(a(),d("div",{class:"vp-doc container",style:Te(i(e)?{"--vp-offset":`calc(50% - ${i(e)/2}px)`}:{})},[u(t.$slots,"default",{},void 0,!0)],4))}}),jn=b(Un,[["__scopeId","data-v-8e2d4988"]]),zn=m({__name:"VPHome",setup(o){const{frontmatter:e,theme:t}=L();return(n,s)=>{const r=q("Content");return a(),d("div",{class:T(["VPHome",{"external-link-icon-enabled":i(t).externalLinkIcon}])},[u(n.$slots,"home-hero-before",{},void 0,!0),_(Vn,null,{"home-hero-info-before":p(()=>[u(n.$slots,"home-hero-info-before",{},void 0,!0)]),"home-hero-info":p(()=>[u(n.$slots,"home-hero-info",{},void 0,!0)]),"home-hero-info-after":p(()=>[u(n.$slots,"home-hero-info-after",{},void 0,!0)]),"home-hero-actions-after":p(()=>[u(n.$slots,"home-hero-actions-after",{},void 0,!0)]),"home-hero-image":p(()=>[u(n.$slots,"home-hero-image",{},void 0,!0)]),_:3}),u(n.$slots,"home-hero-after",{},void 0,!0),u(n.$slots,"home-features-before",{},void 0,!0),_(Gn),u(n.$slots,"home-features-after",{},void 0,!0),i(e).markdownStyles!==!1?(a(),k(jn,{key:0},{default:p(()=>[_(r)]),_:1})):(a(),k(r,{key:1}))],2)}}}),Wn=b(zn,[["__scopeId","data-v-8b561e3d"]]),qn={},Rn={class:"VPPage"};function Kn(o,e){const t=q("Content");return a(),d("div",Rn,[u(o.$slots,"page-top"),_(t),u(o.$slots,"page-bottom")])}const Jn=b(qn,[["render",Kn]]),Yn=m({__name:"VPContent",setup(o){const{page:e,frontmatter:t}=L(),{isHome:n,hasSidebar:s}=O();return(r,c)=>(a(),d("div",{class:T(["VPContent",{"has-sidebar":i(s),"is-home":i(n)}]),id:"VPContent"},[i(e).isNotFound?u(r.$slots,"not-found",{key:0},()=>[_(ct)],!0):i(t).layout==="page"?(a(),k(Jn,{key:1},{"page-top":p(()=>[u(r.$slots,"page-top",{},void 0,!0)]),"page-bottom":p(()=>[u(r.$slots,"page-bottom",{},void 0,!0)]),_:3})):i(t).layout==="home"?(a(),k(Wn,{key:2},{"home-hero-before":p(()=>[u(r.$slots,"home-hero-before",{},void 0,!0)]),"home-hero-info-before":p(()=>[u(r.$slots,"home-hero-info-before",{},void 0,!0)]),"home-hero-info":p(()=>[u(r.$slots,"home-hero-info",{},void 0,!0)]),"home-hero-info-after":p(()=>[u(r.$slots,"home-hero-info-after",{},void 0,!0)]),"home-hero-actions-after":p(()=>[u(r.$slots,"home-hero-actions-after",{},void 0,!0)]),"home-hero-image":p(()=>[u(r.$slots,"home-hero-image",{},void 0,!0)]),"home-hero-after":p(()=>[u(r.$slots,"home-hero-after",{},void 0,!0)]),"home-features-before":p(()=>[u(r.$slots,"home-features-before",{},void 0,!0)]),"home-features-after":p(()=>[u(r.$slots,"home-features-after",{},void 0,!0)]),_:3})):i(t).layout&&i(t).layout!=="doc"?(a(),k(E(i(t).layout),{key:3})):(a(),k(cn,{key:4},{"doc-top":p(()=>[u(r.$slots,"doc-top",{},void 0,!0)]),"doc-bottom":p(()=>[u(r.$slots,"doc-bottom",{},void 0,!0)]),"doc-footer-before":p(()=>[u(r.$slots,"doc-footer-before",{},void 0,!0)]),"doc-before":p(()=>[u(r.$slots,"doc-before",{},void 0,!0)]),"doc-after":p(()=>[u(r.$slots,"doc-after",{},void 0,!0)]),"aside-top":p(()=>[u(r.$slots,"aside-top",{},void 0,!0)]),"aside-outline-before":p(()=>[u(r.$slots,"aside-outline-before",{},void 0,!0)]),"aside-outline-after":p(()=>[u(r.$slots,"aside-outline-after",{},void 0,!0)]),"aside-ads-before":p(()=>[u(r.$slots,"aside-ads-before",{},void 0,!0)]),"aside-ads-after":p(()=>[u(r.$slots,"aside-ads-after",{},void 0,!0)]),"aside-bottom":p(()=>[u(r.$slots,"aside-bottom",{},void 0,!0)]),_:3}))],2))}}),Qn=b(Yn,[["__scopeId","data-v-aff0b8d7"]]),Xn={class:"container"},Zn=["innerHTML"],xn=["innerHTML"],es=m({__name:"VPFooter",setup(o){const{theme:e,frontmatter:t}=L(),{hasSidebar:n}=O();return(s,r)=>i(e).footer&&i(t).footer!==!1?(a(),d("footer",{key:0,class:T(["VPFooter",{"has-sidebar":i(n)}])},[v("div",Xn,[i(e).footer.message?(a(),d("p",{key:0,class:"message",innerHTML:i(e).footer.message},null,8,Zn)):h("",!0),i(e).footer.copyright?(a(),d("p",{key:1,class:"copyright",innerHTML:i(e).footer.copyright},null,8,xn)):h("",!0)])],2)):h("",!0)}}),ts=b(es,[["__scopeId","data-v-c3855bb3"]]),ns={class:"menu-text"},ss={class:"header"},os={class:"outline"},as=m({__name:"VPLocalNavOutlineDropdown",props:{headers:{},navHeight:{}},setup(o){const e=o,{theme:t}=L(),n=V(!1),s=V(0),r=V(),c=V();function l(y){var S;(S=r.value)!=null&&S.contains(y.target)||(n.value=!1)}D(n,y=>{if(y){document.addEventListener("click",l);return}document.removeEventListener("click",l)}),ze("Escape",()=>{n.value=!1}),Ve(()=>{n.value=!1});function f(){n.value=!n.value,s.value=window.innerHeight+Math.min(window.scrollY-e.navHeight,0)}function $(y){y.target.classList.contains("outline-link")&&(c.value&&(c.value.style.transition="none"),Ne(()=>{n.value=!1}))}function P(){n.value=!1,window.scrollTo({top:0,left:0,behavior:"smooth"})}return(y,S)=>(a(),d("div",{class:"VPLocalNavOutlineDropdown",style:Te({"--vp-vh":s.value+"px"}),ref_key:"main",ref:r},[y.headers.length>0?(a(),d("button",{key:0,onClick:f,class:T({open:n.value})},[v("span",ns,N(i(Be)(i(t))),1),S[0]||(S[0]=v("span",{class:"vpi-chevron-right icon"},null,-1))],2)):(a(),d("button",{key:1,onClick:P},N(i(t).returnToTopLabel||"Return to top"),1)),_(de,{name:"flyout"},{default:p(()=>[n.value?(a(),d("div",{key:0,ref_key:"items",ref:c,class:"items",onClick:$},[v("div",ss,[v("a",{class:"top-link",href:"#",onClick:P},N(i(t).returnToTopLabel||"Return to top"),1)]),v("div",os,[_(Ae,{headers:y.headers},null,8,["headers"])])],512)):h("",!0)]),_:1})],4))}}),rs=b(as,[["__scopeId","data-v-5fabb9ca"]]),is={class:"container"},ls=["aria-expanded"],cs={class:"menu-text"},us=m({__name:"VPLocalNav",props:{open:{type:Boolean}},emits:["open-menu"],setup(o){const{theme:e}=L(),{isHome:t,hasSidebar:n,headers:s,hasLocalNav:r}=O(),{y:c}=we(),l=V(0);j(()=>{l.value=parseInt(getComputedStyle(document.documentElement).getPropertyValue("--vp-nav-height"))});const f=g(()=>({VPLocalNav:!0,"has-sidebar":n.value,empty:!r.value,fixed:!r.value&&!n.value}));return($,P)=>!i(t)&&(i(r)||i(n)||i(c)>=l.value)?(a(),d("div",{key:0,class:T(f.value)},[v("div",is,[i(n)?(a(),d("button",{key:0,class:"menu","aria-expanded":$.open,"aria-controls":"VPSidebarNav",onClick:P[0]||(P[0]=y=>$.$emit("open-menu"))},[P[1]||(P[1]=v("span",{class:"vpi-align-left menu-icon"},null,-1)),v("span",cs,N(i(e).sidebarMenuLabel||"Menu"),1)],8,ls)):h("",!0),_(rs,{headers:i(s),navHeight:l.value},null,8,["headers","navHeight"])])],2)):h("",!0)}}),ds=b(us,[["__scopeId","data-v-e30e5487"]]);function vs(){const o=V(!1);function e(){o.value=!0,window.addEventListener("resize",s)}function t(){o.value=!1,window.removeEventListener("resize",s)}function n(){o.value?t():e()}function s(){window.outerWidth>=768&&t()}const r=ee();return D(()=>r.path,t),{isScreenOpen:o,openScreen:e,closeScreen:t,toggleScreen:n}}const ps={},fs={class:"VPSwitch",type:"button",role:"switch"},hs={class:"check"},ms={key:0,class:"icon"};function _s(o,e){return a(),d("button",fs,[v("span",hs,[o.$slots.default?(a(),d("span",ms,[u(o.$slots,"default",{},void 0,!0)])):h("",!0)])])}const ks=b(ps,[["render",_s],["__scopeId","data-v-1d5665e3"]]),bs=m({__name:"VPSwitchAppearance",setup(o){const{isDark:e,theme:t}=L(),n=te("toggle-appearance",()=>{e.value=!e.value}),s=V("");return fe(()=>{s.value=e.value?t.value.lightModeSwitchTitle||"Switch to light theme":t.value.darkModeSwitchTitle||"Switch to dark theme"}),(r,c)=>(a(),k(ks,{title:s.value,class:"VPSwitchAppearance","aria-checked":i(e),onClick:i(n)},{default:p(()=>c[0]||(c[0]=[v("span",{class:"vpi-sun sun"},null,-1),v("span",{class:"vpi-moon moon"},null,-1)])),_:1,__:[0]},8,["title","aria-checked","onClick"]))}}),_e=b(bs,[["__scopeId","data-v-5337faa4"]]),gs={key:0,class:"VPNavBarAppearance"},$s=m({__name:"VPNavBarAppearance",setup(o){const{site:e}=L();return(t,n)=>i(e).appearance&&i(e).appearance!=="force-dark"&&i(e).appearance!=="force-auto"?(a(),d("div",gs,[_(_e)])):h("",!0)}}),ys=b($s,[["__scopeId","data-v-6c893767"]]),ke=V();let Ce=!1,ae=0;function Ps(o){const e=V(!1);if(J){!Ce&&Ls(),ae++;const t=D(ke,n=>{var s,r,c;n===o.el.value||(s=o.el.value)!=null&&s.contains(n)?(e.value=!0,(r=o.onFocus)==null||r.call(o)):(e.value=!1,(c=o.onBlur)==null||c.call(o))});pe(()=>{t(),ae--,ae||Vs()})}return We(e)}function Ls(){document.addEventListener("focusin",Ee),Ce=!0,ke.value=document.activeElement}function Vs(){document.removeEventListener("focusin",Ee)}function Ee(){ke.value=document.activeElement}const Ss={class:"VPMenuLink"},Ts=["innerHTML"],Ns=m({__name:"VPMenuLink",props:{item:{}},setup(o){const{page:e}=L();return(t,n)=>(a(),d("div",Ss,[_(F,{class:T({active:i(W)(i(e).relativePath,t.item.activeMatch||t.item.link,!!t.item.activeMatch)}),href:t.item.link,target:t.item.target,rel:t.item.rel,"no-icon":t.item.noIcon},{default:p(()=>[v("span",{innerHTML:t.item.text},null,8,Ts)]),_:1},8,["class","href","target","rel","no-icon"])]))}}),ne=b(Ns,[["__scopeId","data-v-35975db6"]]),ws={class:"VPMenuGroup"},Ms={key:0,class:"title"},Is=m({__name:"VPMenuGroup",props:{text:{},items:{}},setup(o){return(e,t)=>(a(),d("div",ws,[e.text?(a(),d("p",Ms,N(e.text),1)):h("",!0),(a(!0),d(M,null,B(e.items,n=>(a(),d(M,null,["link"in n?(a(),k(ne,{key:0,item:n},null,8,["item"])):h("",!0)],64))),256))]))}}),Hs=b(Is,[["__scopeId","data-v-74489cb8"]]),Bs={class:"VPMenu"},As={key:0,class:"items"},Cs=m({__name:"VPMenu",props:{items:{}},setup(o){return(e,t)=>(a(),d("div",Bs,[e.items?(a(),d("div",As,[(a(!0),d(M,null,B(e.items,n=>(a(),d(M,{key:JSON.stringify(n)},["link"in n?(a(),k(ne,{key:0,item:n},null,8,["item"])):"component"in n?(a(),k(E(n.component),U({key:1,ref_for:!0},n.props),null,16)):(a(),k(Hs,{key:2,text:n.text,items:n.items},null,8,["text","items"]))],64))),128))])):h("",!0),u(e.$slots,"default",{},void 0,!0)]))}}),Es=b(Cs,[["__scopeId","data-v-c9afd7f1"]]),Fs=["aria-expanded","aria-label"],Ds={key:0,class:"text"},Os=["innerHTML"],Gs={key:1,class:"vpi-more-horizontal icon"},Us={class:"menu"},js=m({__name:"VPFlyout",props:{icon:{},button:{},label:{},items:{}},setup(o){const e=V(!1),t=V();Ps({el:t,onBlur:n});function n(){e.value=!1}return(s,r)=>(a(),d("div",{class:"VPFlyout",ref_key:"el",ref:t,onMouseenter:r[1]||(r[1]=c=>e.value=!0),onMouseleave:r[2]||(r[2]=c=>e.value=!1)},[v("button",{type:"button",class:"button","aria-haspopup":"true","aria-expanded":e.value,"aria-label":s.label,onClick:r[0]||(r[0]=c=>e.value=!e.value)},[s.button||s.icon?(a(),d("span",Ds,[s.icon?(a(),d("span",{key:0,class:T([s.icon,"option-icon"])},null,2)):h("",!0),s.button?(a(),d("span",{key:1,innerHTML:s.button},null,8,Os)):h("",!0),r[3]||(r[3]=v("span",{class:"vpi-chevron-down text-icon"},null,-1))])):(a(),d("span",Gs))],8,Fs),v("div",Us,[_(Es,{items:s.items},{default:p(()=>[u(s.$slots,"default",{},void 0,!0)]),_:3},8,["items"])])],544))}}),be=b(js,[["__scopeId","data-v-3ab3deac"]]),zs=["href","aria-label","innerHTML"],Ws=m({__name:"VPSocialLink",props:{icon:{},link:{},ariaLabel:{}},setup(o){const e=o,t=V();j(async()=>{var r;await Ne();const s=(r=t.value)==null?void 0:r.children[0];s instanceof HTMLElement&&s.className.startsWith("vpi-social-")&&(getComputedStyle(s).maskImage||getComputedStyle(s).webkitMaskImage)==="none"&&s.style.setProperty("--icon",`url('https://api.iconify.design/simple-icons/${e.icon}.svg')`)});const n=g(()=>typeof e.icon=="object"?e.icon.svg:``);return(s,r)=>(a(),d("a",{ref_key:"el",ref:t,class:"VPSocialLink no-icon",href:s.link,"aria-label":s.ariaLabel??(typeof s.icon=="string"?s.icon:""),target:"_blank",rel:"noopener",innerHTML:n.value},null,8,zs))}}),qs=b(Ws,[["__scopeId","data-v-bd121fe5"]]),Rs={class:"VPSocialLinks"},Ks=m({__name:"VPSocialLinks",props:{links:{}},setup(o){return(e,t)=>(a(),d("div",Rs,[(a(!0),d(M,null,B(e.links,({link:n,icon:s,ariaLabel:r})=>(a(),k(qs,{key:n,icon:s,link:n,ariaLabel:r},null,8,["icon","link","ariaLabel"]))),128))]))}}),ge=b(Ks,[["__scopeId","data-v-d474d15f"]]),Js={key:0,class:"group translations"},Ys={class:"trans-title"},Qs={key:1,class:"group"},Xs={class:"item appearance"},Zs={class:"label"},xs={class:"appearance-action"},eo={key:2,class:"group"},to={class:"item social-links"},no=m({__name:"VPNavBarExtra",setup(o){const{site:e,theme:t}=L(),{localeLinks:n,currentLang:s}=X({correspondingLink:!0}),r=g(()=>n.value.length&&s.value.label||e.value.appearance||t.value.socialLinks);return(c,l)=>r.value?(a(),k(be,{key:0,class:"VPNavBarExtra",label:"extra navigation"},{default:p(()=>[i(n).length&&i(s).label?(a(),d("div",Js,[v("p",Ys,N(i(s).label),1),(a(!0),d(M,null,B(i(n),f=>(a(),k(ne,{key:f.link,item:f},null,8,["item"]))),128))])):h("",!0),i(e).appearance&&i(e).appearance!=="force-dark"&&i(e).appearance!=="force-auto"?(a(),d("div",Qs,[v("div",Xs,[v("p",Zs,N(i(t).darkModeSwitchLabel||"Appearance"),1),v("div",xs,[_(_e)])])])):h("",!0),i(t).socialLinks?(a(),d("div",eo,[v("div",to,[_(ge,{class:"social-links-list",links:i(t).socialLinks},null,8,["links"])])])):h("",!0)]),_:1})):h("",!0)}}),so=b(no,[["__scopeId","data-v-bb2aa2f0"]]),oo=["aria-expanded"],ao=m({__name:"VPNavBarHamburger",props:{active:{type:Boolean}},emits:["click"],setup(o){return(e,t)=>(a(),d("button",{type:"button",class:T(["VPNavBarHamburger",{active:e.active}]),"aria-label":"mobile navigation","aria-expanded":e.active,"aria-controls":"VPNavScreen",onClick:t[0]||(t[0]=n=>e.$emit("click"))},t[1]||(t[1]=[v("span",{class:"container"},[v("span",{class:"top"}),v("span",{class:"middle"}),v("span",{class:"bottom"})],-1)]),10,oo))}}),ro=b(ao,[["__scopeId","data-v-e5dd9c1c"]]),io=["innerHTML"],lo=m({__name:"VPNavBarMenuLink",props:{item:{}},setup(o){const{page:e}=L();return(t,n)=>(a(),k(F,{class:T({VPNavBarMenuLink:!0,active:i(W)(i(e).relativePath,t.item.activeMatch||t.item.link,!!t.item.activeMatch)}),href:t.item.link,target:t.item.target,rel:t.item.rel,"no-icon":t.item.noIcon,tabindex:"0"},{default:p(()=>[v("span",{innerHTML:t.item.text},null,8,io)]),_:1},8,["class","href","target","rel","no-icon"]))}}),co=b(lo,[["__scopeId","data-v-e56f3d57"]]),uo=m({__name:"VPNavBarMenuGroup",props:{item:{}},setup(o){const e=o,{page:t}=L(),n=r=>"component"in r?!1:"link"in r?W(t.value.relativePath,r.link,!!e.item.activeMatch):r.items.some(n),s=g(()=>n(e.item));return(r,c)=>(a(),k(be,{class:T({VPNavBarMenuGroup:!0,active:i(W)(i(t).relativePath,r.item.activeMatch,!!r.item.activeMatch)||s.value}),button:r.item.text,items:r.item.items},null,8,["class","button","items"]))}}),vo={key:0,"aria-labelledby":"main-nav-aria-label",class:"VPNavBarMenu"},po=m({__name:"VPNavBarMenu",setup(o){const{theme:e}=L();return(t,n)=>i(e).nav?(a(),d("nav",vo,[n[0]||(n[0]=v("span",{id:"main-nav-aria-label",class:"visually-hidden"}," Main Navigation ",-1)),(a(!0),d(M,null,B(i(e).nav,s=>(a(),d(M,{key:JSON.stringify(s)},["link"in s?(a(),k(co,{key:0,item:s},null,8,["item"])):"component"in s?(a(),k(E(s.component),U({key:1,ref_for:!0},s.props),null,16)):(a(),k(uo,{key:2,item:s},null,8,["item"]))],64))),128))])):h("",!0)}}),fo=b(po,[["__scopeId","data-v-39714824"]]);function ho(o){const{localeIndex:e,theme:t}=L();function n(s){var H,A,w;const r=s.split("."),c=(H=t.value.search)==null?void 0:H.options,l=c&&typeof c=="object",f=l&&((w=(A=c.locales)==null?void 0:A[e.value])==null?void 0:w.translations)||null,$=l&&c.translations||null;let P=f,y=$,S=o;const I=r.pop();for(const C of r){let G=null;const R=S==null?void 0:S[C];R&&(G=S=R);const se=y==null?void 0:y[C];se&&(G=y=se);const oe=P==null?void 0:P[C];oe&&(G=P=oe),R||(S=G),se||(y=G),oe||(P=G)}return(P==null?void 0:P[I])??(y==null?void 0:y[I])??(S==null?void 0:S[I])??""}return n}const mo=["aria-label"],_o={class:"DocSearch-Button-Container"},ko={class:"DocSearch-Button-Placeholder"},Pe=m({__name:"VPNavBarSearchButton",setup(o){const t=ho({button:{buttonText:"Search",buttonAriaLabel:"Search"}});return(n,s)=>(a(),d("button",{type:"button",class:"DocSearch DocSearch-Button","aria-label":i(t)("button.buttonAriaLabel")},[v("span",_o,[s[0]||(s[0]=v("span",{class:"vp-icon DocSearch-Search-Icon"},null,-1)),v("span",ko,N(i(t)("button.buttonText")),1)]),s[1]||(s[1]=v("span",{class:"DocSearch-Button-Keys"},[v("kbd",{class:"DocSearch-Button-Key"}),v("kbd",{class:"DocSearch-Button-Key"},"K")],-1))],8,mo))}}),bo={class:"VPNavBarSearch"},go={id:"local-search"},$o={key:1,id:"docsearch"},yo=m({__name:"VPNavBarSearch",setup(o){const e=()=>null,t=()=>null,{theme:n}=L(),s=V(!1),r=V(!1);j(()=>{});function c(){s.value||(s.value=!0,setTimeout(l,16))}function l(){const P=new Event("keydown");P.key="k",P.metaKey=!0,window.dispatchEvent(P),setTimeout(()=>{document.querySelector(".DocSearch-Modal")||l()},16)}const f=V(!1),$="";return(P,y)=>{var S;return a(),d("div",bo,[i($)==="local"?(a(),d(M,{key:0},[f.value?(a(),k(i(e),{key:0,onClose:y[0]||(y[0]=I=>f.value=!1)})):h("",!0),v("div",go,[_(Pe,{onClick:y[1]||(y[1]=I=>f.value=!0)})])],64)):i($)==="algolia"?(a(),d(M,{key:1},[s.value?(a(),k(i(t),{key:0,algolia:((S=i(n).search)==null?void 0:S.options)??i(n).algolia,onVnodeBeforeMount:y[2]||(y[2]=I=>r.value=!0)},null,8,["algolia"])):h("",!0),r.value?h("",!0):(a(),d("div",$o,[_(Pe,{onClick:c})]))],64)):h("",!0)])}}}),Po=m({__name:"VPNavBarSocialLinks",setup(o){const{theme:e}=L();return(t,n)=>i(e).socialLinks?(a(),k(ge,{key:0,class:"VPNavBarSocialLinks",links:i(e).socialLinks},null,8,["links"])):h("",!0)}}),Lo=b(Po,[["__scopeId","data-v-0394ad82"]]),Vo=["href","rel","target"],So=["innerHTML"],To={key:2},No=m({__name:"VPNavBarTitle",setup(o){const{site:e,theme:t}=L(),{hasSidebar:n}=O(),{currentLang:s}=X(),r=g(()=>{var f;return typeof t.value.logoLink=="string"?t.value.logoLink:(f=t.value.logoLink)==null?void 0:f.link}),c=g(()=>{var f;return typeof t.value.logoLink=="string"||(f=t.value.logoLink)==null?void 0:f.rel}),l=g(()=>{var f;return typeof t.value.logoLink=="string"||(f=t.value.logoLink)==null?void 0:f.target});return(f,$)=>(a(),d("div",{class:T(["VPNavBarTitle",{"has-sidebar":i(n)}])},[v("a",{class:"title",href:r.value??i(me)(i(s).link),rel:c.value,target:l.value},[u(f.$slots,"nav-bar-title-before",{},void 0,!0),i(t).logo?(a(),k(x,{key:0,class:"logo",image:i(t).logo},null,8,["image"])):h("",!0),i(t).siteTitle?(a(),d("span",{key:1,innerHTML:i(t).siteTitle},null,8,So)):i(t).siteTitle===void 0?(a(),d("span",To,N(i(e).title),1)):h("",!0),u(f.$slots,"nav-bar-title-after",{},void 0,!0)],8,Vo)],2))}}),wo=b(No,[["__scopeId","data-v-1e38c6bc"]]),Mo={class:"items"},Io={class:"title"},Ho=m({__name:"VPNavBarTranslations",setup(o){const{theme:e}=L(),{localeLinks:t,currentLang:n}=X({correspondingLink:!0});return(s,r)=>i(t).length&&i(n).label?(a(),k(be,{key:0,class:"VPNavBarTranslations",icon:"vpi-languages",label:i(e).langMenuLabel||"Change language"},{default:p(()=>[v("div",Mo,[v("p",Io,N(i(n).label),1),(a(!0),d(M,null,B(i(t),c=>(a(),k(ne,{key:c.link,item:c},null,8,["item"]))),128))])]),_:1},8,["label"])):h("",!0)}}),Bo=b(Ho,[["__scopeId","data-v-88af2de4"]]),Ao={class:"wrapper"},Co={class:"container"},Eo={class:"title"},Fo={class:"content"},Do={class:"content-body"},Oo=m({__name:"VPNavBar",props:{isScreenOpen:{type:Boolean}},emits:["toggle-screen"],setup(o){const e=o,{y:t}=we(),{isHome:n,hasSidebar:s}=O(),r=V({});return fe(()=>{r.value={"has-sidebar":s.value,home:n.value,top:t.value===0,"screen-open":e.isScreenOpen}}),(c,l)=>(a(),d("div",{class:T(["VPNavBar",r.value])},[v("div",Ao,[v("div",Co,[v("div",Eo,[_(wo,null,{"nav-bar-title-before":p(()=>[u(c.$slots,"nav-bar-title-before",{},void 0,!0)]),"nav-bar-title-after":p(()=>[u(c.$slots,"nav-bar-title-after",{},void 0,!0)]),_:3})]),v("div",Fo,[v("div",Do,[u(c.$slots,"nav-bar-content-before",{},void 0,!0),_(yo,{class:"search"}),_(fo,{class:"menu"}),_(Bo,{class:"translations"}),_(ys,{class:"appearance"}),_(Lo,{class:"social-links"}),_(so,{class:"extra"}),u(c.$slots,"nav-bar-content-after",{},void 0,!0),_(ro,{class:"hamburger",active:c.isScreenOpen,onClick:l[0]||(l[0]=f=>c.$emit("toggle-screen"))},null,8,["active"])])])])]),l[1]||(l[1]=v("div",{class:"divider"},[v("div",{class:"divider-line"})],-1))],2))}}),Go=b(Oo,[["__scopeId","data-v-0ae64501"]]),Uo={key:0,class:"VPNavScreenAppearance"},jo={class:"text"},zo=m({__name:"VPNavScreenAppearance",setup(o){const{site:e,theme:t}=L();return(n,s)=>i(e).appearance&&i(e).appearance!=="force-dark"&&i(e).appearance!=="force-auto"?(a(),d("div",Uo,[v("p",jo,N(i(t).darkModeSwitchLabel||"Appearance"),1),_(_e)])):h("",!0)}}),Wo=b(zo,[["__scopeId","data-v-b44890b2"]]),qo=["innerHTML"],Ro=m({__name:"VPNavScreenMenuLink",props:{item:{}},setup(o){const e=te("close-screen");return(t,n)=>(a(),k(F,{class:"VPNavScreenMenuLink",href:t.item.link,target:t.item.target,rel:t.item.rel,"no-icon":t.item.noIcon,onClick:i(e)},{default:p(()=>[v("span",{innerHTML:t.item.text},null,8,qo)]),_:1},8,["href","target","rel","no-icon","onClick"]))}}),Ko=b(Ro,[["__scopeId","data-v-df37e6dd"]]),Jo=["innerHTML"],Yo=m({__name:"VPNavScreenMenuGroupLink",props:{item:{}},setup(o){const e=te("close-screen");return(t,n)=>(a(),k(F,{class:"VPNavScreenMenuGroupLink",href:t.item.link,target:t.item.target,rel:t.item.rel,"no-icon":t.item.noIcon,onClick:i(e)},{default:p(()=>[v("span",{innerHTML:t.item.text},null,8,Jo)]),_:1},8,["href","target","rel","no-icon","onClick"]))}}),Fe=b(Yo,[["__scopeId","data-v-3e9c20e4"]]),Qo={class:"VPNavScreenMenuGroupSection"},Xo={key:0,class:"title"},Zo=m({__name:"VPNavScreenMenuGroupSection",props:{text:{},items:{}},setup(o){return(e,t)=>(a(),d("div",Qo,[e.text?(a(),d("p",Xo,N(e.text),1)):h("",!0),(a(!0),d(M,null,B(e.items,n=>(a(),k(Fe,{key:n.text,item:n},null,8,["item"]))),128))]))}}),xo=b(Zo,[["__scopeId","data-v-4b7a798b"]]),ea=["aria-controls","aria-expanded"],ta=["innerHTML"],na=["id"],sa={key:0,class:"item"},oa={key:1,class:"item"},aa={key:2,class:"group"},ra=m({__name:"VPNavScreenMenuGroup",props:{text:{},items:{}},setup(o){const e=o,t=V(!1),n=g(()=>`NavScreenGroup-${e.text.replace(" ","-").toLowerCase()}`);function s(){t.value=!t.value}return(r,c)=>(a(),d("div",{class:T(["VPNavScreenMenuGroup",{open:t.value}])},[v("button",{class:"button","aria-controls":n.value,"aria-expanded":t.value,onClick:s},[v("span",{class:"button-text",innerHTML:r.text},null,8,ta),c[0]||(c[0]=v("span",{class:"vpi-plus button-icon"},null,-1))],8,ea),v("div",{id:n.value,class:"items"},[(a(!0),d(M,null,B(r.items,l=>(a(),d(M,{key:JSON.stringify(l)},["link"in l?(a(),d("div",sa,[_(Fe,{item:l},null,8,["item"])])):"component"in l?(a(),d("div",oa,[(a(),k(E(l.component),U({ref_for:!0},l.props,{"screen-menu":""}),null,16))])):(a(),d("div",aa,[_(xo,{text:l.text,items:l.items},null,8,["text","items"])]))],64))),128))],8,na)],2))}}),ia=b(ra,[["__scopeId","data-v-956364f9"]]),la={key:0,class:"VPNavScreenMenu"},ca=m({__name:"VPNavScreenMenu",setup(o){const{theme:e}=L();return(t,n)=>i(e).nav?(a(),d("nav",la,[(a(!0),d(M,null,B(i(e).nav,s=>(a(),d(M,{key:JSON.stringify(s)},["link"in s?(a(),k(Ko,{key:0,item:s},null,8,["item"])):"component"in s?(a(),k(E(s.component),U({key:1,ref_for:!0},s.props,{"screen-menu":""}),null,16)):(a(),k(ia,{key:2,text:s.text||"",items:s.items},null,8,["text","items"]))],64))),128))])):h("",!0)}}),ua=m({__name:"VPNavScreenSocialLinks",setup(o){const{theme:e}=L();return(t,n)=>i(e).socialLinks?(a(),k(ge,{key:0,class:"VPNavScreenSocialLinks",links:i(e).socialLinks},null,8,["links"])):h("",!0)}}),da={class:"list"},va=m({__name:"VPNavScreenTranslations",setup(o){const{localeLinks:e,currentLang:t}=X({correspondingLink:!0}),n=V(!1);function s(){n.value=!n.value}return(r,c)=>i(e).length&&i(t).label?(a(),d("div",{key:0,class:T(["VPNavScreenTranslations",{open:n.value}])},[v("button",{class:"title",onClick:s},[c[0]||(c[0]=v("span",{class:"vpi-languages icon lang"},null,-1)),z(" "+N(i(t).label)+" ",1),c[1]||(c[1]=v("span",{class:"vpi-chevron-down icon chevron"},null,-1))]),v("ul",da,[(a(!0),d(M,null,B(i(e),l=>(a(),d("li",{key:l.link,class:"item"},[_(F,{class:"link",href:l.link},{default:p(()=>[z(N(l.text),1)]),_:2},1032,["href"])]))),128))])],2)):h("",!0)}}),pa=b(va,[["__scopeId","data-v-858fe1a4"]]),fa={class:"container"},ha=m({__name:"VPNavScreen",props:{open:{type:Boolean}},setup(o){const e=V(null),t=Me(J?document.body:null);return(n,s)=>(a(),k(de,{name:"fade",onEnter:s[0]||(s[0]=r=>t.value=!0),onAfterLeave:s[1]||(s[1]=r=>t.value=!1)},{default:p(()=>[n.open?(a(),d("div",{key:0,class:"VPNavScreen",ref_key:"screen",ref:e,id:"VPNavScreen"},[v("div",fa,[u(n.$slots,"nav-screen-content-before",{},void 0,!0),_(ca,{class:"menu"}),_(pa,{class:"translations"}),_(Wo,{class:"appearance"}),_(ua,{class:"social-links"}),u(n.$slots,"nav-screen-content-after",{},void 0,!0)])],512)):h("",!0)]),_:3}))}}),ma=b(ha,[["__scopeId","data-v-f2779853"]]),_a={key:0,class:"VPNav"},ka=m({__name:"VPNav",setup(o){const{isScreenOpen:e,closeScreen:t,toggleScreen:n}=vs(),{frontmatter:s}=L(),r=g(()=>s.value.navbar!==!1);return Ie("close-screen",t),Q(()=>{J&&document.documentElement.classList.toggle("hide-nav",!r.value)}),(c,l)=>r.value?(a(),d("header",_a,[_(Go,{"is-screen-open":i(e),onToggleScreen:i(n)},{"nav-bar-title-before":p(()=>[u(c.$slots,"nav-bar-title-before",{},void 0,!0)]),"nav-bar-title-after":p(()=>[u(c.$slots,"nav-bar-title-after",{},void 0,!0)]),"nav-bar-content-before":p(()=>[u(c.$slots,"nav-bar-content-before",{},void 0,!0)]),"nav-bar-content-after":p(()=>[u(c.$slots,"nav-bar-content-after",{},void 0,!0)]),_:3},8,["is-screen-open","onToggleScreen"]),_(ma,{open:i(e)},{"nav-screen-content-before":p(()=>[u(c.$slots,"nav-screen-content-before",{},void 0,!0)]),"nav-screen-content-after":p(()=>[u(c.$slots,"nav-screen-content-after",{},void 0,!0)]),_:3},8,["open"])])):h("",!0)}}),ba=b(ka,[["__scopeId","data-v-ae24b3ad"]]),ga=["role","tabindex"],$a={key:1,class:"items"},ya=m({__name:"VPSidebarItem",props:{item:{},depth:{}},setup(o){const e=o,{collapsed:t,collapsible:n,isLink:s,isActiveLink:r,hasActiveLink:c,hasChildren:l,toggle:f}=yt(g(()=>e.item)),$=g(()=>l.value?"section":"div"),P=g(()=>s.value?"a":"div"),y=g(()=>l.value?e.depth+2===7?"p":`h${e.depth+2}`:"p"),S=g(()=>s.value?void 0:"button"),I=g(()=>[[`level-${e.depth}`],{collapsible:n.value},{collapsed:t.value},{"is-link":s.value},{"is-active":r.value},{"has-active":c.value}]);function H(w){"key"in w&&w.key!=="Enter"||!e.item.link&&f()}function A(){e.item.link&&f()}return(w,C)=>{const G=q("VPSidebarItem",!0);return a(),k(E($.value),{class:T(["VPSidebarItem",I.value])},{default:p(()=>[w.item.text?(a(),d("div",U({key:0,class:"item",role:S.value},qe(w.item.items?{click:H,keydown:H}:{},!0),{tabindex:w.item.items&&0}),[C[1]||(C[1]=v("div",{class:"indicator"},null,-1)),w.item.link?(a(),k(F,{key:0,tag:P.value,class:"link",href:w.item.link,rel:w.item.rel,target:w.item.target},{default:p(()=>[(a(),k(E(y.value),{class:"text",innerHTML:w.item.text},null,8,["innerHTML"]))]),_:1},8,["tag","href","rel","target"])):(a(),k(E(y.value),{key:1,class:"text",innerHTML:w.item.text},null,8,["innerHTML"])),w.item.collapsed!=null&&w.item.items&&w.item.items.length?(a(),d("div",{key:2,class:"caret",role:"button","aria-label":"toggle section",onClick:A,onKeydown:Re(A,["enter"]),tabindex:"0"},C[0]||(C[0]=[v("span",{class:"vpi-chevron-right caret-icon"},null,-1)]),32)):h("",!0)],16,ga)):h("",!0),w.item.items&&w.item.items.length?(a(),d("div",$a,[w.depth<5?(a(!0),d(M,{key:0},B(w.item.items,R=>(a(),k(G,{key:R.text,item:R,depth:w.depth+1},null,8,["item","depth"]))),128)):h("",!0)])):h("",!0)]),_:1},8,["class"])}}}),Pa=b(ya,[["__scopeId","data-v-d81de50c"]]),La=m({__name:"VPSidebarGroup",props:{items:{}},setup(o){const e=V(!0);let t=null;return j(()=>{t=setTimeout(()=>{t=null,e.value=!1},300)}),Ke(()=>{t!=null&&(clearTimeout(t),t=null)}),(n,s)=>(a(!0),d(M,null,B(n.items,r=>(a(),d("div",{key:r.text,class:T(["group",{"no-transition":e.value}])},[_(Pa,{item:r,depth:0},null,8,["item"])],2))),128))}}),Va=b(La,[["__scopeId","data-v-8d50c081"]]),Sa={class:"nav",id:"VPSidebarNav","aria-labelledby":"sidebar-aria-label",tabindex:"-1"},Ta=m({__name:"VPSidebar",props:{open:{type:Boolean}},setup(o){const{sidebarGroups:e,hasSidebar:t}=O(),n=o,s=V(null),r=Me(J?document.body:null);D([n,s],()=>{var l;n.open?(r.value=!0,(l=s.value)==null||l.focus()):r.value=!1},{immediate:!0,flush:"post"});const c=V(0);return D(e,()=>{c.value+=1},{deep:!0}),(l,f)=>i(t)?(a(),d("aside",{key:0,class:T(["VPSidebar",{open:l.open}]),ref_key:"navEl",ref:s,onClick:f[0]||(f[0]=Je(()=>{},["stop"]))},[f[2]||(f[2]=v("div",{class:"curtain"},null,-1)),v("nav",Sa,[f[1]||(f[1]=v("span",{class:"visually-hidden",id:"sidebar-aria-label"}," Sidebar Navigation ",-1)),u(l.$slots,"sidebar-nav-before",{},void 0,!0),(a(),k(Va,{items:i(e),key:c.value},null,8,["items"])),u(l.$slots,"sidebar-nav-after",{},void 0,!0)])],2)):h("",!0)}}),Na=b(Ta,[["__scopeId","data-v-cbecfdd4"]]),wa=m({__name:"VPSkipLink",setup(o){const{theme:e}=L(),t=ee(),n=V();D(()=>t.path,()=>n.value.focus());function s({target:r}){const c=document.getElementById(decodeURIComponent(r.hash).slice(1));if(c){const l=()=>{c.removeAttribute("tabindex"),c.removeEventListener("blur",l)};c.setAttribute("tabindex","-1"),c.addEventListener("blur",l),c.focus(),window.scrollTo(0,0)}}return(r,c)=>(a(),d(M,null,[v("span",{ref_key:"backToTop",ref:n,tabindex:"-1"},null,512),v("a",{href:"#VPContent",class:"VPSkipLink visually-hidden",onClick:s},N(i(e).skipToContentLabel||"Skip to content"),1)],64))}}),Ma=b(wa,[["__scopeId","data-v-0b0ada53"]]),Ia=m({__name:"Layout",setup(o){const{isOpen:e,open:t,close:n}=$t();Pt({closeSidebar:n});const{frontmatter:s}=L(),r=Ye(),c=g(()=>!!r["home-hero-image"]);return Ie("hero-image-slot-exists",c),(l,f)=>{const $=q("Content");return i(s).layout!==!1?(a(),d("div",{key:0,class:T(["Layout",i(s).pageClass])},[u(l.$slots,"layout-top",{},void 0,!0),_(Ma),_(xe,{class:"backdrop",show:i(e),onClick:i(n)},null,8,["show","onClick"]),_(ba,null,{"nav-bar-title-before":p(()=>[u(l.$slots,"nav-bar-title-before",{},void 0,!0)]),"nav-bar-title-after":p(()=>[u(l.$slots,"nav-bar-title-after",{},void 0,!0)]),"nav-bar-content-before":p(()=>[u(l.$slots,"nav-bar-content-before",{},void 0,!0)]),"nav-bar-content-after":p(()=>[u(l.$slots,"nav-bar-content-after",{},void 0,!0)]),"nav-screen-content-before":p(()=>[u(l.$slots,"nav-screen-content-before",{},void 0,!0)]),"nav-screen-content-after":p(()=>[u(l.$slots,"nav-screen-content-after",{},void 0,!0)]),_:3}),_(ds,{open:i(e),onOpenMenu:i(t)},null,8,["open","onOpenMenu"]),_(Na,{open:i(e)},{"sidebar-nav-before":p(()=>[u(l.$slots,"sidebar-nav-before",{},void 0,!0)]),"sidebar-nav-after":p(()=>[u(l.$slots,"sidebar-nav-after",{},void 0,!0)]),_:3},8,["open"]),_(Qn,null,{"page-top":p(()=>[u(l.$slots,"page-top",{},void 0,!0)]),"page-bottom":p(()=>[u(l.$slots,"page-bottom",{},void 0,!0)]),"not-found":p(()=>[u(l.$slots,"not-found",{},void 0,!0)]),"home-hero-before":p(()=>[u(l.$slots,"home-hero-before",{},void 0,!0)]),"home-hero-info-before":p(()=>[u(l.$slots,"home-hero-info-before",{},void 0,!0)]),"home-hero-info":p(()=>[u(l.$slots,"home-hero-info",{},void 0,!0)]),"home-hero-info-after":p(()=>[u(l.$slots,"home-hero-info-after",{},void 0,!0)]),"home-hero-actions-after":p(()=>[u(l.$slots,"home-hero-actions-after",{},void 0,!0)]),"home-hero-image":p(()=>[u(l.$slots,"home-hero-image",{},void 0,!0)]),"home-hero-after":p(()=>[u(l.$slots,"home-hero-after",{},void 0,!0)]),"home-features-before":p(()=>[u(l.$slots,"home-features-before",{},void 0,!0)]),"home-features-after":p(()=>[u(l.$slots,"home-features-after",{},void 0,!0)]),"doc-footer-before":p(()=>[u(l.$slots,"doc-footer-before",{},void 0,!0)]),"doc-before":p(()=>[u(l.$slots,"doc-before",{},void 0,!0)]),"doc-after":p(()=>[u(l.$slots,"doc-after",{},void 0,!0)]),"doc-top":p(()=>[u(l.$slots,"doc-top",{},void 0,!0)]),"doc-bottom":p(()=>[u(l.$slots,"doc-bottom",{},void 0,!0)]),"aside-top":p(()=>[u(l.$slots,"aside-top",{},void 0,!0)]),"aside-bottom":p(()=>[u(l.$slots,"aside-bottom",{},void 0,!0)]),"aside-outline-before":p(()=>[u(l.$slots,"aside-outline-before",{},void 0,!0)]),"aside-outline-after":p(()=>[u(l.$slots,"aside-outline-after",{},void 0,!0)]),"aside-ads-before":p(()=>[u(l.$slots,"aside-ads-before",{},void 0,!0)]),"aside-ads-after":p(()=>[u(l.$slots,"aside-ads-after",{},void 0,!0)]),_:3}),_(ts),u(l.$slots,"layout-bottom",{},void 0,!0)],2)):(a(),k($,{key:1}))}}}),Ha=b(Ia,[["__scopeId","data-v-5e06b97a"]]),Ba={Layout:Ha,enhanceApp:({app:o})=>{o.component("Badge",Qe)}},Ca={...Ba,setup(){const{lang:o}=Le();Q(()=>{J&&(document.cookie=`nf_lang=${o.value}; expires=Mon, 1 Jan 2024 00:00:00 UTC; path=/`)})}};export{Ca as R}; diff --git a/assets/deps-craft-yml.md.DdOLH9fb.js b/assets/deps-craft-yml.md.Bb12IlRQ.js similarity index 94% rename from assets/deps-craft-yml.md.DdOLH9fb.js rename to assets/deps-craft-yml.md.Bb12IlRQ.js index bf5c27a5..eaad75ef 100644 --- a/assets/deps-craft-yml.md.DdOLH9fb.js +++ b/assets/deps-craft-yml.md.Bb12IlRQ.js @@ -1,4 +1,4 @@ -import{_ as s,c as i,o as a,a1 as n}from"./chunks/framework.gjrnbxUT.js";const g=JSON.parse('{"title":"","description":"","frontmatter":{},"headers":[],"relativePath":"deps-craft-yml.md","filePath":"deps-craft-yml.md"}'),l={name:"deps-craft-yml.md"},t=n(`
yaml
# PHP version to build (default: 8.4)
+import{_ as i,c as a,o as n,af as l}from"./chunks/framework.PeLcR_tw.js";const E=JSON.parse('{"title":"","description":"","frontmatter":{},"headers":[],"relativePath":"deps-craft-yml.md","filePath":"deps-craft-yml.md"}'),t={name:"deps-craft-yml.md"};function p(h,s,e,k,r,d){return n(),a("div",null,s[0]||(s[0]=[l(`
yaml
# PHP version to build (default: 8.4)
 php-version: 8.4
 # [REQUIRED] Static PHP extensions to build (list or comma-separated are both accepted)
 extensions: bcmath,fileinfo,phar,zlib,sodium,posix,pcntl
@@ -62,4 +62,4 @@ import{_ as s,c as i,o as a,a1 as n}from"./chunks/framework.gjrnbxUT.js";const g
 # Extra environment variables
 extra-env:
   # e.g. Use github token to avoid rate limit
-  GITHUB_TOKEN: your-github-token
`,1),p=[t];function h(e,k,r,d,o,c){return a(),i("div",null,p)}const y=s(l,[["render",h]]);export{g as __pageData,y as default}; + GITHUB_TOKEN: your-github-token
`,1)]))}const c=i(t,[["render",p]]);export{E as __pageData,c as default}; diff --git a/assets/deps-craft-yml.md.Bb12IlRQ.lean.js b/assets/deps-craft-yml.md.Bb12IlRQ.lean.js new file mode 100644 index 00000000..be57e021 --- /dev/null +++ b/assets/deps-craft-yml.md.Bb12IlRQ.lean.js @@ -0,0 +1 @@ +import{_ as i,c as a,o as n,af as l}from"./chunks/framework.PeLcR_tw.js";const E=JSON.parse('{"title":"","description":"","frontmatter":{},"headers":[],"relativePath":"deps-craft-yml.md","filePath":"deps-craft-yml.md"}'),t={name:"deps-craft-yml.md"};function p(h,s,e,k,r,d){return n(),a("div",null,s[0]||(s[0]=[l("",1)]))}const c=i(t,[["render",p]]);export{E as __pageData,c as default}; diff --git a/assets/deps-craft-yml.md.DdOLH9fb.lean.js b/assets/deps-craft-yml.md.DdOLH9fb.lean.js deleted file mode 100644 index 9a07b4b1..00000000 --- a/assets/deps-craft-yml.md.DdOLH9fb.lean.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as s,c as i,o as a,a1 as n}from"./chunks/framework.gjrnbxUT.js";const g=JSON.parse('{"title":"","description":"","frontmatter":{},"headers":[],"relativePath":"deps-craft-yml.md","filePath":"deps-craft-yml.md"}'),l={name:"deps-craft-yml.md"},t=n("",1),p=[t];function h(e,k,r,d,o,c){return a(),i("div",null,p)}const y=s(l,[["render",h]]);export{g as __pageData,y as default}; diff --git a/assets/deps-map-ext.md.BxLeBUVK.js b/assets/deps-map-ext.md.BxLeBUVK.js new file mode 100644 index 00000000..6f00d412 --- /dev/null +++ b/assets/deps-map-ext.md.BxLeBUVK.js @@ -0,0 +1 @@ +import{_ as d,c as b,o as r,af as l}from"./chunks/framework.PeLcR_tw.js";const c=JSON.parse('{"title":"","description":"","frontmatter":{},"headers":[],"relativePath":"deps-map-ext.md","filePath":"deps-map-ext.md"}'),s={name:"deps-map-ext.md"};function i(e,t,o,p,a,n){return r(),b("div",null,t[0]||(t[0]=[l('

Linux

Extension NameRequired ExtensionsSuggested ExtensionsRequired LibrariesSuggested Libraries
amqplibrabbitmq
brotlibrotli
bz2bzip2
curlcurl
dbaqdbm
domlibxml2
zlib
evsockets
eventopensslsocketslibevent
ffilibffi
ftpopenssl
gdzlibzlib
libpng
libavif
libwebp
libjpeg
freetype
gettextgettext
gmpgmp
gmsslgmssl
grpcgrpc
iconvlibiconv
igbinarysession
apcu
imagickimagemagick
imapopensslimap
intlicu
ldapopensslldapgmp
libsodium
lz4liblz4
mbregexmbstringonig
memcachezlib
session
memcachedsession
zlib
libmemcached
fastlz
mongodbicu
openssl
zstd
zlib
msgpacksession
mysqlimysqlnd
mysqlndzlib
odbcunixodbc
opensslzlibopenssl
zlib
password-argon2libargon2
pdo_mysqlpdo
mysqlnd
pdo_odbcpdo
odbc
unixodbc
pdo_pgsqlpdo
pgsql
postgresql
pdo_sqlitepdo
sqlite3
sqlite
pdo_sqlsrvpdo
sqlsrv
pgsqlpostgresql
pharzlib
rdkafkalibrdkafka
readlinereadline
redissession
igbinary
zstd
liblz4
simplexmllibxml2
snappyapcusnappy
soaplibxml2
sodiumlibsodium
spxzlib
sqlite3sqlite
sqlsrvpcntlunixodbc
ssh2openssl
zlib
libssh2
swooleopenssl
curl
swoole-hook-pgsql
swoole-hook-mysql
swoole-hook-sqlite
libcares
brotli
nghttp2
zlib
swoole-hook-mysqlmysqlnd
pdo
pdo_mysql
mysqli
swoole-hook-pgsqlpgsql
pdo
swoole-hook-sqlitesqlite3
pdo
swowopenssl
curl
openssl
curl
tidytidy
uuidlibuuid
uvsocketslibuv
xhprofctype
xlswriterzlib
zip
openssl
xmllibxml2
xmlreaderlibxml2
xmlwriterlibxml2
xslxml
dom
libxslt
xzxz
yacigbinaryfastlz
yamllibyaml
ziplibzip
zlibzlib
zstdzstd

macOS

Extension NameRequired ExtensionsSuggested ExtensionsRequired LibrariesSuggested Libraries
amqplibrabbitmq
brotlibrotli
bz2bzip2
curlcurl
dbaqdbm
domlibxml2
zlib
evsockets
eventopensslsocketslibevent
ffilibffi
ftpopenssl
gdzlibzlib
libpng
libavif
libwebp
libjpeg
freetype
gettextgettext
glfwglfw
gmpgmp
gmsslgmssl
grpcgrpc
iconvlibiconv
igbinarysession
apcu
imagickimagemagick
imapopensslimap
intlicu
ldapopensslldapgmp
libsodium
lz4liblz4
mbregexmbstringonig
memcachezlib
session
memcachedsession
zlib
libmemcached
fastlz
mongodbicu
openssl
zstd
zlib
msgpacksession
mysqlimysqlnd
mysqlndzlib
odbcunixodbc
opensslzlibopenssl
zlib
password-argon2libargon2
pdo_mysqlpdo
mysqlnd
pdo_odbcpdo
odbc
unixodbc
pdo_pgsqlpdo
pgsql
postgresql
pdo_sqlitepdo
sqlite3
sqlite
pdo_sqlsrvpdo
sqlsrv
pgsqlpostgresql
pharzlib
rdkafkalibrdkafka
readlinereadline
redissession
igbinary
zstd
liblz4
simplexmllibxml2
snappyapcusnappy
soaplibxml2
sodiumlibsodium
spxzlib
sqlite3sqlite
sqlsrvunixodbc
ssh2openssl
zlib
libssh2
swooleopenssl
curl
swoole-hook-pgsql
swoole-hook-mysql
swoole-hook-sqlite
libcares
brotli
nghttp2
zlib
swoole-hook-mysqlmysqlnd
pdo
pdo_mysql
mysqli
swoole-hook-pgsqlpgsql
pdo
swoole-hook-sqlitesqlite3
pdo
swowopenssl
curl
openssl
curl
tidytidy
uuidlibuuid
uvsocketslibuv
xhprofctype
xlswriterzlib
zip
openssl
xmllibxml2
xmlreaderlibxml2
xmlwriterlibxml2
xslxml
dom
libxslt
xzxz
yacigbinaryfastlz
yamllibyaml
ziplibzip
zlibzlib
zstdzstd

Windows

Extension NameRequired ExtensionsSuggested ExtensionsRequired LibrariesSuggested Libraries
amqpopenssllibrabbitmq
brotlibrotli
bz2bzip2
curlzlib
openssl
curl
dbaqdbm
domxmllibxml2
zlib
evsockets
ffilibffi-win
ftpopenssl
gdzlibzlib
libpng
libavif
libwebp
libjpeg
freetype
gmsslgmssl
iconvlibiconv-win
igbinarysession
apcu
mbregexmbstringonig
msgpacksession
mysqlimysqlnd
mysqlndzlib
opensslzlibopenssl
zlib
parallelpthreads4w
pdo_mysqlpdo
mysqlnd
pdo_odbcpdo
odbc
pdo_pgsqlpdo
pgsql
postgresql-win
pdo_sqlitepdo
sqlite3
sqlite
pdo_sqlsrvpdo
sqlsrv
pgsqlpostgresql-win
pharzlib
redissession
igbinary
simplexmlxmllibxml2
soapxmllibxml2
sodiumlibsodium
sqlite3sqlite
ssh2openssl
zlib
libssh2
swowopenssl
curl
openssl
curl
xlswriterzlib
zip
openssl
xmliconvlibxml2
xmlreaderxml
dom
libxml2
xmlwriterxmllibxml2
xzxz
yamllibyaml
zipzlib
bz2
libzip
zlib
bzip2
xz
zlibzlib

FreeBSD

Extension NameRequired ExtensionsSuggested ExtensionsRequired LibrariesSuggested Libraries
brotlibrotli
bz2bzip2
curlcurl
dbaqdbm
evsockets
ftpopenssl
mbregexmbstringonig
mysqlimysqlnd
mysqlndzlib
opensslzlibopenssl
zlib
pdo_mysqlpdo
mysqlnd
pharzlib
xzxz
zlibzlib
',8)]))}const g=d(s,[["render",i]]);export{c as __pageData,g as default}; diff --git a/assets/deps-map-ext.md.BxLeBUVK.lean.js b/assets/deps-map-ext.md.BxLeBUVK.lean.js new file mode 100644 index 00000000..a39ab432 --- /dev/null +++ b/assets/deps-map-ext.md.BxLeBUVK.lean.js @@ -0,0 +1 @@ +import{_ as d,c as b,o as r,af as l}from"./chunks/framework.PeLcR_tw.js";const c=JSON.parse('{"title":"","description":"","frontmatter":{},"headers":[],"relativePath":"deps-map-ext.md","filePath":"deps-map-ext.md"}'),s={name:"deps-map-ext.md"};function i(e,t,o,p,a,n){return r(),b("div",null,t[0]||(t[0]=[l("",8)]))}const g=d(s,[["render",i]]);export{c as __pageData,g as default}; diff --git a/assets/deps-map-ext.md.CKpfVu5J.js b/assets/deps-map-ext.md.CKpfVu5J.js deleted file mode 100644 index 5db6bba1..00000000 --- a/assets/deps-map-ext.md.CKpfVu5J.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as t,c as d,o as b,a1 as r}from"./chunks/framework.gjrnbxUT.js";const c=JSON.parse('{"title":"","description":"","frontmatter":{},"headers":[],"relativePath":"deps-map-ext.md","filePath":"deps-map-ext.md"}'),l={name:"deps-map-ext.md"},s=r('

Linux

Extension NameRequired ExtensionsSuggested ExtensionsRequired LibrariesSuggested Libraries
amqplibrabbitmq
bz2bzip2
curlcurl
dbaqdbm
domlibxml2
zlib
eventopensslsocketslibevent
ffilibffi
ftpopenssl
gdzlibzlib
libpng
libavif
libwebp
libjpeg
freetype
gettextgettext
gmpgmp
gmsslgmssl
grpcgrpc
iconvlibiconv
igbinarysession
apcu
imagickimagemagick
imapopensslimap
intlicu
ldapopensslldapgmp
libsodium
lz4liblz4
libxmlxml
mbregexmbstringonig
memcachezlib
session
mongodbicu
openssl
zstd
zlib
mysqlimysqlnd
mysqlndzlib
odbcunixodbc
opensslzlibopenssl
zlib
password-argon2libargon2
pdo_mysqlpdo
mysqlnd
pdo_odbcpdo
odbc
unixodbc
pdo_pgsqlpdo
pgsql
postgresql
pdo_sqlitepdo
sqlite3
sqlite
pdo_sqlsrvpdo
sqlsrv
pgsqlpostgresql
pharzlib
rdkafkalibrdkafka
readlinereadline
redissession
igbinary
zstd
liblz4
simplexmllibxml2
snappyapcusnappy
soaplibxml2
sodiumlibsodium
spxzlib
sqlite3sqlite
sqlsrvpcntlunixodbc
ssh2libssh2
swooleopenssl
curl
swoole-hook-pgsql
swoole-hook-mysql
swoole-hook-sqlite
libcares
brotli
nghttp2
zlib
swoole-hook-mysqlmysqlnd
pdo
pdo_mysql
mysqli
swoole-hook-pgsqlpgsql
pdo
swoole-hook-sqlitesqlite3
pdo
swowopenssl
curl
openssl
curl
tidytidy
uuidlibuuid
uvsocketslibuv
xhprofctype
xlswriterzlib
zip
openssl
xmllibxml2
xmlreaderlibxml2
xmlwriterlibxml2
xslxml
dom
libxslt
yacigbinary
yamllibyaml
ziplibzip
zlibzlib
zstdzstd

macOS

Extension NameRequired ExtensionsSuggested ExtensionsRequired LibrariesSuggested Libraries
amqplibrabbitmq
bz2bzip2
curlcurl
dbaqdbm
domlibxml2
zlib
eventopensslsocketslibevent
ffilibffi
ftpopenssl
gdzlibzlib
libpng
libavif
libwebp
libjpeg
freetype
gettextgettext
glfwglfw
gmpgmp
gmsslgmssl
grpcgrpc
iconvlibiconv
igbinarysession
apcu
imagickimagemagick
imapopensslimap
intlicu
ldapopensslldapgmp
libsodium
lz4liblz4
libxmlxml
mbregexmbstringonig
memcachezlib
session
memcachedsession
zlib
libmemcached
mongodbicu
openssl
zstd
zlib
mysqlimysqlnd
mysqlndzlib
odbcunixodbc
opensslzlibopenssl
zlib
password-argon2libargon2
pdo_mysqlpdo
mysqlnd
pdo_odbcpdo
odbc
unixodbc
pdo_pgsqlpdo
pgsql
postgresql
pdo_sqlitepdo
sqlite3
sqlite
pdo_sqlsrvpdo
sqlsrv
pgsqlpostgresql
pharzlib
rdkafkalibrdkafka
readlinereadline
redissession
igbinary
zstd
liblz4
simplexmllibxml2
snappyapcusnappy
soaplibxml2
sodiumlibsodium
spxzlib
sqlite3sqlite
sqlsrvunixodbc
ssh2libssh2
swooleopenssl
curl
swoole-hook-pgsql
swoole-hook-mysql
swoole-hook-sqlite
libcares
brotli
nghttp2
zlib
swoole-hook-mysqlmysqlnd
pdo
pdo_mysql
mysqli
swoole-hook-pgsqlpgsql
pdo
swoole-hook-sqlitesqlite3
pdo
swowopenssl
curl
openssl
curl
tidytidy
uuidlibuuid
uvsocketslibuv
xhprofctype
xlswriterzlib
zip
openssl
xmllibxml2
xmlreaderlibxml2
xmlwriterlibxml2
xslxml
dom
libxslt
yacigbinary
yamllibyaml
ziplibzip
zlibzlib
zstdzstd

Windows

Extension NameRequired ExtensionsSuggested ExtensionsRequired LibrariesSuggested Libraries
amqpopenssllibrabbitmq
bz2bzip2
curlzlib
openssl
curl
dbaqdbm
domxmllibxml2
zlib
ffilibffi-win
ftpopenssl
gdzlibzlib
libpng
libavif
libwebp
libjpeg
freetype
gmsslgmssl
iconvlibiconv-win
igbinarysession
apcu
libxmlxml
mbregexmbstringonig
mysqlimysqlnd
mysqlndzlib
opensslzlibopenssl
zlib
parallelpthreads4w
pdo_mysqlpdo
mysqlnd
pdo_odbcpdo
odbc
pdo_pgsqlpdo
pgsql
postgresql-win
pdo_sqlitepdo
sqlite3
sqlite
pdo_sqlsrvpdo
sqlsrv
pgsqlpostgresql-win
pharzlib
redissession
igbinary
simplexmlxmllibxml2
soapxmllibxml2
sodiumlibsodium
sqlite3sqlite
ssh2openssl
zlib
libssh2
swowopenssl
curl
openssl
curl
xlswriterzlib
zip
openssl
xmliconvlibxml2
xmlreaderxml
dom
libxml2
xmlwriterxmllibxml2
yamllibyaml
zipzlib
bz2
libzip
zlib
bzip2
xz
zlibzlib

FreeBSD

Extension NameRequired ExtensionsSuggested ExtensionsRequired LibrariesSuggested Libraries
bz2bzip2
curlcurl
dbaqdbm
ftpopenssl
mbregexmbstringonig
mysqlimysqlnd
mysqlndzlib
opensslzlibopenssl
zlib
pdo_mysqlpdo
mysqlnd
pharzlib
zlibzlib
',8),i=[s];function e(o,p,a,n,m,q){return b(),d("div",null,i)}const g=t(l,[["render",e]]);export{c as __pageData,g as default}; diff --git a/assets/deps-map-ext.md.CKpfVu5J.lean.js b/assets/deps-map-ext.md.CKpfVu5J.lean.js deleted file mode 100644 index 3f66c590..00000000 --- a/assets/deps-map-ext.md.CKpfVu5J.lean.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as t,c as d,o as b,a1 as r}from"./chunks/framework.gjrnbxUT.js";const c=JSON.parse('{"title":"","description":"","frontmatter":{},"headers":[],"relativePath":"deps-map-ext.md","filePath":"deps-map-ext.md"}'),l={name:"deps-map-ext.md"},s=r("",8),i=[s];function e(o,p,a,n,m,q){return b(),d("div",null,i)}const g=t(l,[["render",e]]);export{c as __pageData,g as default}; diff --git a/assets/deps-map-lib.md.D13FvK2Q.js b/assets/deps-map-lib.md.D13FvK2Q.js deleted file mode 100644 index 91b52c22..00000000 --- a/assets/deps-map-lib.md.D13FvK2Q.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as t,c as d,o as b,a1 as r}from"./chunks/framework.gjrnbxUT.js";const g=JSON.parse('{"title":"","description":"","frontmatter":{},"headers":[],"relativePath":"deps-map-lib.md","filePath":"deps-map-lib.md"}'),i={name:"deps-map-lib.md"},l=r('

Linux

Library NameRequired LibrariesSuggested Libraries
curlopenssl
zlib
libssh2
brotli
nghttp2
nghttp3
ngtcp2
zstd
libcares
freetypezliblibpng
bzip2
brotli
gettextlibiconvncurses
libxml2
grpczlib
openssl
imagemagickzlib
libpng
libjpeg
libwebp
freetype
libtiff
libheif
bzip2
zstd
xz
libzip
libxml2
imapopenssl
ldapopenssl
zlib
gmp
libsodium
libaclattr
libeventopenssl
libheiflibde265
libwebp
libaom
zlib
brotli
libpngzlib
librabbitmqopenssl
librdkafkazstd
libssh2opensslzlib
libtiffzlib
libjpeg
libxml2libiconvxz
icu
zlib
libxsltlibxml2
libzipzlibbzip2
xz
zstd
openssl
nghttp2zlib
openssl
libxml2
nghttp3
ngtcp2
nghttp3openssl
ngtcp2opensslnghttp3
brotli
opensslzlib
postgresqllibiconv
libxml2
openssl
zlib
readline
icu
libxslt
ldap
zstd
readlinencurses
snappyzlib
unixodbclibiconv
xzlibiconv

macOS

Library NameRequired LibrariesSuggested Libraries
curlopenssl
zlib
libssh2
brotli
nghttp2
nghttp3
ngtcp2
zstd
libcares
freetypezliblibpng
bzip2
brotli
gettextlibiconvncurses
libxml2
grpczlib
openssl
imagemagickzlib
libpng
libjpeg
libwebp
freetype
libtiff
libheif
bzip2
zstd
xz
libzip
libxml2
imapopenssl
ldapopenssl
zlib
gmp
libsodium
libeventopenssl
libheiflibde265
libwebp
libaom
zlib
brotli
libpngzlib
librabbitmqopenssl
librdkafkazstd
libssh2opensslzlib
libtiffzlib
libjpeg
libxml2libiconvxz
icu
zlib
libxsltlibxml2
libzipzlibbzip2
xz
zstd
openssl
nghttp2zlib
openssl
libxml2
nghttp3
ngtcp2
nghttp3openssl
ngtcp2opensslnghttp3
brotli
opensslzlib
postgresqllibiconv
libxml2
openssl
zlib
readline
icu
libxslt
ldap
zstd
readlinencurses
snappyzlib
unixodbclibiconv
xzlibiconv

Windows

Library NameRequired LibrariesSuggested Libraries
curlzlib
libssh2
nghttp2
brotli
zstd
freetypezliblibpng
bzip2
brotli
libjpegzlib
libpngzlib
librabbitmqopenssl
libssh2opensslzlib
libxml2libiconv-winzlib
libzipzlib
bzip2
xz
zstd
openssl
nghttp2zlib
openssl
libxml2
nghttp3
ngtcp2
nghttp3openssl
ngtcp2opensslnghttp3
brotli
opensslzlib

FreeBSD

Library NameRequired LibrariesSuggested Libraries
curlopenssl
zlib
libssh2
brotli
nghttp2
nghttp3
ngtcp2
zstd
libcares
opensslzlib
',8),e=[l];function s(n,a,p,o,h,z){return b(),d("div",null,e)}const m=t(i,[["render",s]]);export{g as __pageData,m as default}; diff --git a/assets/deps-map-lib.md.D13FvK2Q.lean.js b/assets/deps-map-lib.md.D13FvK2Q.lean.js deleted file mode 100644 index a5b03b90..00000000 --- a/assets/deps-map-lib.md.D13FvK2Q.lean.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as t,c as d,o as b,a1 as r}from"./chunks/framework.gjrnbxUT.js";const g=JSON.parse('{"title":"","description":"","frontmatter":{},"headers":[],"relativePath":"deps-map-lib.md","filePath":"deps-map-lib.md"}'),i={name:"deps-map-lib.md"},l=r("",8),e=[l];function s(n,a,p,o,h,z){return b(),d("div",null,e)}const m=t(i,[["render",s]]);export{g as __pageData,m as default}; diff --git a/assets/deps-map-lib.md.DlxAq0L9.js b/assets/deps-map-lib.md.DlxAq0L9.js new file mode 100644 index 00000000..b49221fe --- /dev/null +++ b/assets/deps-map-lib.md.DlxAq0L9.js @@ -0,0 +1 @@ +import{_ as d,c as b,o as r,af as i}from"./chunks/framework.PeLcR_tw.js";const z=JSON.parse('{"title":"","description":"","frontmatter":{},"headers":[],"relativePath":"deps-map-lib.md","filePath":"deps-map-lib.md"}'),l={name:"deps-map-lib.md"};function e(s,t,n,a,p,o){return r(),b("div",null,t[0]||(t[0]=[i('

Linux

Library NameRequired LibrariesSuggested Libraries
curlopenssl
zlib
libssh2
brotli
nghttp2
nghttp3
ngtcp2
zstd
libcares
freetypezliblibpng
bzip2
brotli
gettextlibiconvncurses
libxml2
grpczlib
openssl
imagemagickzlib
libpng
libjpeg
libwebp
freetype
libtiff
libheif
bzip2
zstd
xz
libzip
libxml2
imapopenssl
ldapopenssl
zlib
gmp
libsodium
libaclattr
libeventopenssl
libheiflibde265
libwebp
libaom
zlib
brotli
libpngzlib
librabbitmqopenssl
librdkafkazstd
libssh2opensslzlib
libtiffzlib
libjpeg
libxml2libiconvxz
icu
zlib
libxsltlibxml2
libzipzlibbzip2
xz
zstd
openssl
nghttp2zlib
openssl
libxml2
nghttp3
ngtcp2
nghttp3openssl
ngtcp2opensslnghttp3
brotli
opensslzlib
postgresqllibiconv
libxml2
openssl
zlib
readline
icu
libxslt
ldap
zstd
readlinencurses
snappyzlib
unixodbclibiconv
xzlibiconv

macOS

Library NameRequired LibrariesSuggested Libraries
curlopenssl
zlib
libssh2
brotli
nghttp2
nghttp3
ngtcp2
zstd
libcares
freetypezliblibpng
bzip2
brotli
gettextlibiconvncurses
libxml2
grpczlib
openssl
imagemagickzlib
libpng
libjpeg
libwebp
freetype
libtiff
libheif
bzip2
zstd
xz
libzip
libxml2
imapopenssl
ldapopenssl
zlib
gmp
libsodium
libeventopenssl
libheiflibde265
libwebp
libaom
zlib
brotli
libpngzlib
librabbitmqopenssl
librdkafkazstd
libssh2opensslzlib
libtiffzlib
libjpeg
libxml2libiconvxz
icu
zlib
libxsltlibxml2
libzipzlibbzip2
xz
zstd
openssl
nghttp2zlib
openssl
libxml2
nghttp3
ngtcp2
nghttp3openssl
ngtcp2opensslnghttp3
brotli
opensslzlib
postgresqllibiconv
libxml2
openssl
zlib
readline
icu
libxslt
ldap
zstd
readlinencurses
snappyzlib
unixodbclibiconv
xzlibiconv

Windows

Library NameRequired LibrariesSuggested Libraries
curlzlib
libssh2
nghttp2
brotli
zstd
freetypezliblibpng
bzip2
brotli
libjpegzlib
libpngzlib
librabbitmqopenssl
libssh2opensslzlib
libxml2libiconv-winzlib
libzipzlib
bzip2
xz
zstd
openssl
nghttp2zlib
openssl
libxml2
nghttp3
ngtcp2
nghttp3openssl
ngtcp2opensslnghttp3
brotli
opensslzlib

FreeBSD

Library NameRequired LibrariesSuggested Libraries
curlopenssl
zlib
libssh2
brotli
nghttp2
nghttp3
ngtcp2
zstd
libcares
opensslzlib
',8)]))}const c=d(l,[["render",e]]);export{z as __pageData,c as default}; diff --git a/assets/deps-map-lib.md.DlxAq0L9.lean.js b/assets/deps-map-lib.md.DlxAq0L9.lean.js new file mode 100644 index 00000000..aa0bb0c5 --- /dev/null +++ b/assets/deps-map-lib.md.DlxAq0L9.lean.js @@ -0,0 +1 @@ +import{_ as d,c as b,o as r,af as i}from"./chunks/framework.PeLcR_tw.js";const z=JSON.parse('{"title":"","description":"","frontmatter":{},"headers":[],"relativePath":"deps-map-lib.md","filePath":"deps-map-lib.md"}'),l={name:"deps-map-lib.md"};function e(s,t,n,a,p,o){return r(),b("div",null,t[0]||(t[0]=[i("",8)]))}const c=d(l,[["render",e]]);export{z as __pageData,c as default}; diff --git a/assets/en_contributing_index.md.C8tXDL1f.js b/assets/en_contributing_index.md.C8tXDL1f.js new file mode 100644 index 00000000..bf49658f --- /dev/null +++ b/assets/en_contributing_index.md.C8tXDL1f.js @@ -0,0 +1 @@ +import{_ as t,c as i,o,af as n}from"./chunks/framework.PeLcR_tw.js";const m=JSON.parse('{"title":"Contributing","description":"","frontmatter":{},"headers":[],"relativePath":"en/contributing/index.md","filePath":"en/contributing/index.md"}'),a={name:"en/contributing/index.md"};function r(s,e,c,l,d,h){return o(),i("div",null,e[0]||(e[0]=[n('

Contributing

Thank you for being here, this project welcomes your contributions!

Contribution Guide

If you have code or documentation to contribute, here's what you need to know first.

  1. What type of code are you contributing? (new extensions, bug fixes, security issues, project framework optimizations, documentation)
  2. If you contribute new files or new snippets, is your code checked by php-cs-fixer and phpstan?
  3. Have you fully read the Developer Guide before contributing code?

If you can answer the above questions and have made changes to the code, you can initiate a Pull Request in the project GitHub repository in time. After the code review is completed, the code can be modified according to the suggestion, or directly merged into the main branch.

Contribution Type

The main purpose of this project is to compile statically linked PHP binaries, and the command line processing function is written based on symfony/console. Before development, if you are not familiar with it, Check out the symfony/console documentation first.

Security Update

Because this project is basically a PHP project running locally, generally speaking, there will be no remote attacks. But if you find such a problem, please **DO NOT submit a PR or Issue in the GitHub repository, You need to contact the project maintainer (crazywhalecc) via mail.

Fix Bugs

Fixing bugs generally does not involve modification of the project structure and framework, so if you can locate the wrong code and fix it directly, please submit a PR directly.

New Extensions

For adding a new extension, you need to understand some basic structure of the project and how to add a new extension according to the existing logic. It will be covered in detail in the next section on this page. In general, you will need:

  1. Evaluate whether the extension can be compiled inline into PHP.
  2. Evaluate whether the extension's dependent libraries (if any) can be compiled statically.
  3. Write library compile commands on different platforms.
  4. Verify that the extension and its dependencies are compatible with existing extensions and dependencies.
  5. Verify that the extension works normally in cli, micro, fpm, embed SAPIs.
  6. Write documentation and add your extension.

Project Framework Optimization

If you are already familiar with the working principle of symfony/console, and at the same time want to make some modifications or optimizations to the framework of the project, please understand the following things first:

  1. Adding extensions does not belong to project framework optimization, but if you find that you have to optimize the framework when adding new extensions, you need to modify the framework itself before adding extensions.
  2. For some large-scale logical modifications (such as those involving LibraryBase, Extension objects, etc.), it is recommended to submit an Issue or Draft PR for discussion first.
  3. In the early stage of the project, it was a pure private development project, and there were some Chinese comments in the code. After internationalizing your project you can submit a PR to translate these comments into English.
  4. Please do not submit more useless code fragments in the code, such as a large number of unused variables, methods, classes, and code that has been rewritten many times.
',18)]))}const p=t(a,[["render",r]]);export{m as __pageData,p as default}; diff --git a/assets/en_contributing_index.md.C8tXDL1f.lean.js b/assets/en_contributing_index.md.C8tXDL1f.lean.js new file mode 100644 index 00000000..30f6a8cd --- /dev/null +++ b/assets/en_contributing_index.md.C8tXDL1f.lean.js @@ -0,0 +1 @@ +import{_ as t,c as i,o,af as n}from"./chunks/framework.PeLcR_tw.js";const m=JSON.parse('{"title":"Contributing","description":"","frontmatter":{},"headers":[],"relativePath":"en/contributing/index.md","filePath":"en/contributing/index.md"}'),a={name:"en/contributing/index.md"};function r(s,e,c,l,d,h){return o(),i("div",null,e[0]||(e[0]=[n("",18)]))}const p=t(a,[["render",r]]);export{m as __pageData,p as default}; diff --git a/assets/en_contributing_index.md.CsY8mx8F.js b/assets/en_contributing_index.md.CsY8mx8F.js deleted file mode 100644 index fc560af8..00000000 --- a/assets/en_contributing_index.md.CsY8mx8F.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as e,c as t,o,a1 as i}from"./chunks/framework.gjrnbxUT.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('

Contributing

Thank you for being here, this project welcomes your contributions!

Contribution Guide

If you have code or documentation to contribute, here's what you need to know first.

  1. What type of code are you contributing? (new extensions, bug fixes, security issues, project framework optimizations, documentation)
  2. If you contribute new files or new snippets, is your code checked by php-cs-fixer and phpstan?
  3. Have you fully read the Developer Guide before contributing code?

If you can answer the above questions and have made changes to the code, you can initiate a Pull Request in the project GitHub repository in time. After the code review is completed, the code can be modified according to the suggestion, or directly merged into the main branch.

Contribution Type

The main purpose of this project is to compile statically linked PHP binaries, and the command line processing function is written based on symfony/console. Before development, if you are not familiar with it, Check out the symfony/console documentation first.

Security Update

Because this project is basically a PHP project running locally, generally speaking, there will be no remote attacks. But if you find such a problem, please **DO NOT submit a PR or Issue in the GitHub repository, You need to contact the project maintainer (crazywhalecc) via mail.

Fix Bugs

Fixing bugs generally does not involve modification of the project structure and framework, so if you can locate the wrong code and fix it directly, please submit a PR directly.

New Extensions

For adding a new extension, you need to understand some basic structure of the project and how to add a new extension according to the existing logic. It will be covered in detail in the next section on this page. In general, you will need:

  1. Evaluate whether the extension can be compiled inline into PHP.
  2. Evaluate whether the extension's dependent libraries (if any) can be compiled statically.
  3. Write library compile commands on different platforms.
  4. Verify that the extension and its dependencies are compatible with existing extensions and dependencies.
  5. Verify that the extension works normally in cli, micro, fpm, embed SAPIs.
  6. Write documentation and add your extension.

Project Framework Optimization

If you are already familiar with the working principle of symfony/console, and at the same time want to make some modifications or optimizations to the framework of the project, please understand the following things first:

  1. Adding extensions does not belong to project framework optimization, but if you find that you have to optimize the framework when adding new extensions, you need to modify the framework itself before adding extensions.
  2. For some large-scale logical modifications (such as those involving LibraryBase, Extension objects, etc.), it is recommended to submit an Issue or Draft PR for discussion first.
  3. In the early stage of the project, it was a pure private development project, and there were some Chinese comments in the code. After internationalizing your project you can submit a PR to translate these comments into English.
  4. Please do not submit more useless code fragments in the code, such as a large number of unused variables, methods, classes, and code that has been rewritten many times.
',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}; diff --git a/assets/en_contributing_index.md.CsY8mx8F.lean.js b/assets/en_contributing_index.md.CsY8mx8F.lean.js deleted file mode 100644 index 822f9bdc..00000000 --- a/assets/en_contributing_index.md.CsY8mx8F.lean.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as e,c as t,o,a1 as i}from"./chunks/framework.gjrnbxUT.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}; diff --git a/assets/en_develop_craft-yml.md.B3k-Nl-b.lean.js b/assets/en_develop_craft-yml.md.B3k-Nl-b.lean.js deleted file mode 100644 index d4f3aa32..00000000 --- a/assets/en_develop_craft-yml.md.B3k-Nl-b.lean.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as s,c as i,o as a,a1 as n}from"./chunks/framework.gjrnbxUT.js";const g=JSON.parse('{"title":"craft.yml Configuration","description":"","frontmatter":{"aside":false},"headers":[],"relativePath":"en/develop/craft-yml.md","filePath":"en/develop/craft-yml.md"}'),l={name:"en/develop/craft-yml.md"},t=n("",2),p=[t];function e(h,k,r,d,o,c){return a(),i("div",null,p)}const y=s(l,[["render",e]]);export{g as __pageData,y as default}; diff --git a/assets/en_develop_craft-yml.md.B3k-Nl-b.js b/assets/en_develop_craft-yml.md.C4TSxsAG.js similarity index 92% rename from assets/en_develop_craft-yml.md.B3k-Nl-b.js rename to assets/en_develop_craft-yml.md.C4TSxsAG.js index b10e8e79..cdaba485 100644 --- a/assets/en_develop_craft-yml.md.B3k-Nl-b.js +++ b/assets/en_develop_craft-yml.md.C4TSxsAG.js @@ -1,4 +1,4 @@ -import{_ as s,c as i,o as a,a1 as n}from"./chunks/framework.gjrnbxUT.js";const g=JSON.parse('{"title":"craft.yml Configuration","description":"","frontmatter":{"aside":false},"headers":[],"relativePath":"en/develop/craft-yml.md","filePath":"en/develop/craft-yml.md"}'),l={name:"en/develop/craft-yml.md"},t=n(`

craft.yml Configuration

yaml
# PHP version to build (default: 8.4)
+import{_ as i,c as a,o as n,af as l}from"./chunks/framework.PeLcR_tw.js";const c=JSON.parse('{"title":"craft.yml Configuration","description":"","frontmatter":{"aside":false},"headers":[],"relativePath":"en/develop/craft-yml.md","filePath":"en/develop/craft-yml.md"}'),t={name:"en/develop/craft-yml.md"};function p(e,s,h,k,r,d){return n(),a("div",null,s[0]||(s[0]=[l(`

craft.yml Configuration

yaml
# PHP version to build (default: 8.4)
 php-version: 8.4
 # [REQUIRED] Static PHP extensions to build (list or comma-separated are both accepted)
 extensions: bcmath,fileinfo,phar,zlib,sodium,posix,pcntl
@@ -62,4 +62,4 @@ import{_ as s,c as i,o as a,a1 as n}from"./chunks/framework.gjrnbxUT.js";const g
 # Extra environment variables
 extra-env:
   # e.g. Use github token to avoid rate limit
-  GITHUB_TOKEN: your-github-token
`,2),p=[t];function e(h,k,r,d,o,c){return a(),i("div",null,p)}const y=s(l,[["render",e]]);export{g as __pageData,y as default}; + GITHUB_TOKEN: your-github-token
`,2)]))}const E=i(t,[["render",p]]);export{c as __pageData,E as default}; diff --git a/assets/en_develop_craft-yml.md.C4TSxsAG.lean.js b/assets/en_develop_craft-yml.md.C4TSxsAG.lean.js new file mode 100644 index 00000000..999d1bfd --- /dev/null +++ b/assets/en_develop_craft-yml.md.C4TSxsAG.lean.js @@ -0,0 +1 @@ +import{_ as i,c as a,o as n,af as l}from"./chunks/framework.PeLcR_tw.js";const c=JSON.parse('{"title":"craft.yml Configuration","description":"","frontmatter":{"aside":false},"headers":[],"relativePath":"en/develop/craft-yml.md","filePath":"en/develop/craft-yml.md"}'),t={name:"en/develop/craft-yml.md"};function p(e,s,h,k,r,d){return n(),a("div",null,s[0]||(s[0]=[l("",2)]))}const E=i(t,[["render",p]]);export{c as __pageData,E as default}; diff --git a/assets/en_develop_doctor-module.md.DGd8PeM_.lean.js b/assets/en_develop_doctor-module.md.DGd8PeM_.lean.js deleted file mode 100644 index 16fb7f92..00000000 --- a/assets/en_develop_doctor-module.md.DGd8PeM_.lean.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as s,c as i,o as a,a1 as e}from"./chunks/framework.gjrnbxUT.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}; diff --git a/assets/en_develop_doctor-module.md.DGd8PeM_.js b/assets/en_develop_doctor-module.md.DYVfKght.js similarity index 81% rename from assets/en_develop_doctor-module.md.DGd8PeM_.js rename to assets/en_develop_doctor-module.md.DYVfKght.js index a07cf467..db93ed28 100644 --- a/assets/en_develop_doctor-module.md.DGd8PeM_.js +++ b/assets/en_develop_doctor-module.md.DYVfKght.js @@ -1,4 +1,4 @@ -import{_ as s,c as i,o as a,a1 as e}from"./chunks/framework.gjrnbxUT.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(`

Doctor module

The Doctor module is a relatively independent module used to check the system environment, which can be entered with the command bin/spc doctor, and the entry command class is in DoctorCommand.php.

The Doctor module is a checklist with a series of check items and automatic repair items. These items are stored in the src/SPC/doctor/item/ directory, And two Attributes are used as check item tags and auto-fix item tags: #[AsCheckItem] and #[AsFixItem].

Take the existing check item if necessary tools are installed, which is used to check whether the packages necessary for compilation are installed in the macOS system. The following is its source code:

php
use SPC\\doctor\\AsCheckItem;
+import{_ as i,c as a,o as e,af as t}from"./chunks/framework.PeLcR_tw.js";const E=JSON.parse('{"title":"Doctor module","description":"","frontmatter":{},"headers":[],"relativePath":"en/develop/doctor-module.md","filePath":"en/develop/doctor-module.md"}'),h={name:"en/develop/doctor-module.md"};function n(l,s,k,p,r,d){return e(),a("div",null,s[0]||(s[0]=[t(`

Doctor module

The Doctor module is a relatively independent module used to check the system environment, which can be entered with the command bin/spc doctor, and the entry command class is in DoctorCommand.php.

The Doctor module is a checklist with a series of check items and automatic repair items. These items are stored in the src/SPC/doctor/item/ directory, And two Attributes are used as check item tags and auto-fix item tags: #[AsCheckItem] and #[AsFixItem].

Take the existing check item if necessary tools are installed, which is used to check whether the packages necessary for compilation are installed in the macOS system. The following is its source code:

php
use SPC\\doctor\\AsCheckItem;
 use SPC\\doctor\\AsFixItem;
 use SPC\\doctor\\CheckResult;
 
@@ -15,7 +15,7 @@ import{_ as s,c as i,o as a,a1 as e}from"./chunks/framework.gjrnbxUT.js";const g
         return CheckResult::fail('missing system commands: ' . implode(', ', $missing), 'build-tools', [$missing]);
     }
     return CheckResult::ok();
-}

The first parameter of the attribute is the name of the check item, and the following limit_os parameter restricts the check item to be triggered only under the specified system, and level is the priority of executing the check item, the larger the number, the higher the priority higher.

The $this->findCommand() method used in it is the method of SPC\\builder\\traits\\UnixSystemUtilTrait, the purpose is to find the location of the system command, and return NULL if it cannot be found.

Each check item method should return a SPC\\doctor\\CheckResult:

  • When returning CheckResult::fail(), 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.
  • When CheckResult::ok() is returned, the check passed. You can also pass a parameter to return the check result, for example: CheckResult::ok('OS supported').
  • When returning CheckResult::fail(), if the third parameter is included, the array of the third parameter will be used as the parameter of AsFixItem.

The following is the method for automatically repairing items corresponding to this check item:

php
#[AsFixItem('build-tools')]
+}

The first parameter of the attribute is the name of the check item, and the following limit_os parameter restricts the check item to be triggered only under the specified system, and level is the priority of executing the check item, the larger the number, the higher the priority higher.

The $this->findCommand() method used in it is the method of SPC\\builder\\traits\\UnixSystemUtilTrait, the purpose is to find the location of the system command, and return NULL if it cannot be found.

Each check item method should return a SPC\\doctor\\CheckResult:

  • When returning CheckResult::fail(), 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.
  • When CheckResult::ok() is returned, the check passed. You can also pass a parameter to return the check result, for example: CheckResult::ok('OS supported').
  • When returning CheckResult::fail(), if the third parameter is included, the array of the third parameter will be used as the parameter of AsFixItem.

The following is the method for automatically repairing items corresponding to this check item:

php
#[AsFixItem('build-tools')]
 public function fixBuildTools(array $missing): bool
 {
     foreach ($missing as $cmd) {
@@ -26,4 +26,4 @@ import{_ as s,c as i,o as a,a1 as e}from"./chunks/framework.gjrnbxUT.js";const g
         }
     }
     return true;
-}

#[AsFixItem()] 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.

In the code here, shell()->exec() is the method of executing commands of the project, which is used to replace exec() and system(), and also provides debugging, obtaining execution status, entering directories, etc. characteristic.

`,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}; +}

#[AsFixItem()] 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.

In the code here, shell()->exec() is the method of executing commands of the project, which is used to replace exec() and system(), and also provides debugging, obtaining execution status, entering directories, etc. characteristic.

`,13)]))}const c=i(h,[["render",n]]);export{E as __pageData,c as default}; diff --git a/assets/en_develop_doctor-module.md.DYVfKght.lean.js b/assets/en_develop_doctor-module.md.DYVfKght.lean.js new file mode 100644 index 00000000..35fc494b --- /dev/null +++ b/assets/en_develop_doctor-module.md.DYVfKght.lean.js @@ -0,0 +1 @@ +import{_ as i,c as a,o as e,af as t}from"./chunks/framework.PeLcR_tw.js";const E=JSON.parse('{"title":"Doctor module","description":"","frontmatter":{},"headers":[],"relativePath":"en/develop/doctor-module.md","filePath":"en/develop/doctor-module.md"}'),h={name:"en/develop/doctor-module.md"};function n(l,s,k,p,r,d){return e(),a("div",null,s[0]||(s[0]=[t("",13)]))}const c=i(h,[["render",n]]);export{E as __pageData,c as default}; diff --git a/assets/en_develop_index.md.B7_c9YYa.js b/assets/en_develop_index.md.B7_c9YYa.js deleted file mode 100644 index e73298a9..00000000 --- a/assets/en_develop_index.md.B7_c9YYa.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as e,c as t,o,a1 as n}from"./chunks/framework.gjrnbxUT.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('

Start Developing

Developing this project requires the installation and deployment of a PHP environment, as well as some extensions and Composer commonly used in PHP projects.

The development environment and running environment of the project are almost exactly the same. You can refer to the Manual Build 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.

Regardless of its purpose, this project itself is actually a php-cli 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.

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.

Environment preparation

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.

Regardless of which PHP you use, in your development environment you need to install these extensions:

curl,dom,filter,mbstring,openssl,pcntl,phar,posix,sodium,tokenizer,xml,xmlwriter

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.

For micro self-executing binaries built by static-php-cli itself, only pcntl,posix,mbstring,tokenizer,phar is required.

Start development

Continuing down to see the project structure documentation, you can learn how static-php-cli works.

',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}; diff --git a/assets/en_develop_index.md.B7_c9YYa.lean.js b/assets/en_develop_index.md.B7_c9YYa.lean.js deleted file mode 100644 index 8a2130aa..00000000 --- a/assets/en_develop_index.md.B7_c9YYa.lean.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as e,c as t,o,a1 as n}from"./chunks/framework.gjrnbxUT.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}; diff --git a/assets/en_develop_index.md.DSlquryN.js b/assets/en_develop_index.md.DSlquryN.js new file mode 100644 index 00000000..b6152d13 --- /dev/null +++ b/assets/en_develop_index.md.DSlquryN.js @@ -0,0 +1 @@ +import{_ as t,c as o,o as n,af as i}from"./chunks/framework.PeLcR_tw.js";const m=JSON.parse('{"title":"Start Developing","description":"","frontmatter":{},"headers":[],"relativePath":"en/develop/index.md","filePath":"en/develop/index.md"}'),s={name:"en/develop/index.md"};function a(r,e,l,p,c,d){return n(),o("div",null,e[0]||(e[0]=[i('

Start Developing

Developing this project requires the installation and deployment of a PHP environment, as well as some extensions and Composer commonly used in PHP projects.

The development environment and running environment of the project are almost exactly the same. You can refer to the Manual Build 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.

Regardless of its purpose, this project itself is actually a php-cli 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.

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.

Environment preparation

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.

Regardless of which PHP you use, in your development environment you need to install these extensions:

curl,dom,filter,mbstring,openssl,pcntl,phar,posix,sodium,tokenizer,xml,xmlwriter

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.

For micro self-executing binaries built by static-php-cli itself, only pcntl,posix,mbstring,tokenizer,phar is required.

Start development

Continuing down to see the project structure documentation, you can learn how static-php-cli works.

',13)]))}const u=t(s,[["render",a]]);export{m as __pageData,u as default}; diff --git a/assets/en_develop_index.md.DSlquryN.lean.js b/assets/en_develop_index.md.DSlquryN.lean.js new file mode 100644 index 00000000..a06412b8 --- /dev/null +++ b/assets/en_develop_index.md.DSlquryN.lean.js @@ -0,0 +1 @@ +import{_ as t,c as o,o as n,af as i}from"./chunks/framework.PeLcR_tw.js";const m=JSON.parse('{"title":"Start Developing","description":"","frontmatter":{},"headers":[],"relativePath":"en/develop/index.md","filePath":"en/develop/index.md"}'),s={name:"en/develop/index.md"};function a(r,e,l,p,c,d){return n(),o("div",null,e[0]||(e[0]=[i("",13)]))}const u=t(s,[["render",a]]);export{m as __pageData,u as default}; diff --git a/assets/en_develop_php-src-changes.md.DLlooohw.js b/assets/en_develop_php-src-changes.md.DLlooohw.js deleted file mode 100644 index 33f301b8..00000000 --- a/assets/en_develop_php-src-changes.md.DLlooohw.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as e,c as i,o as t,a1 as o}from"./chunks/framework.gjrnbxUT.js";const f=JSON.parse('{"title":"Modifications to PHP source code","description":"","frontmatter":{},"headers":[],"relativePath":"en/develop/php-src-changes.md","filePath":"en/develop/php-src-changes.md"}'),a={name:"en/develop/php-src-changes.md"},s=o('

Modifications to PHP source code

During the static compilation process, static-php-cli made some modifications to the PHP source code in order to achieve good compatibility, performance, and security. The following is a description of the current modifications to the PHP source code.

Based on the patches provided by the phpmicro project, static-php-cli has made some modifications to the PHP source code to meet the needs of static compilation. The patches currently used by static-php-cli during compilation in the patch list are:

  • static_opcache
  • static_extensions_win32
  • cli_checks
  • disable_huge_page
  • vcruntime140
  • win32
  • zend_stream
  • cli_static
  • macos_iconv
  • phar

PHP <= 8.1 libxml patch

Because PHP only provides security updates for 8.1 and stops updating older versions, static-php-cli applies the libxml compilation patch that has been applied in newer versions of PHP to PHP 8.1 and below.

gd extension Windows patch

Compiling the gd extension under Windows requires major changes to the config.w32 file. static-php-cli has made some changes to the gd extension to make it easier to compile under Windows.

YAML extension Windows patch

YAML extension needs to modify the config.w32 file to compile under Windows. static-php-cli has made some modifications to the YAML extension to make it easier to compile under Windows.

static-php-cli version information insertion

When compiling, static-php-cli will insert the static-php-cli version information into the PHP version information for easy identification.

Add option to hardcode INI

When using the -I parameter to hardcode INI into static PHP functionality, static-php-cli will modify the PHP source code to insert the hardcoded content.

Linux system repair patch

Some compilation environments may lack some system header files or libraries. static-php-cli will automatically fix these problems during compilation, such as:

  • HAVE_STRLCAT missing problem
  • HAVE_STRLCPY missing problem

Fiber issue fix patch for Windows

When compiling PHP on Windows, there will be some issues with the Fiber extension. static-php-cli will automatically fix these issues during compilation (modify config.w32 in php-src).

',20),n=[s];function c(r,h,l,p,d,m){return t(),i("div",null,n)}const P=e(a,[["render",c]]);export{f as __pageData,P as default}; diff --git a/assets/en_develop_php-src-changes.md.DLlooohw.lean.js b/assets/en_develop_php-src-changes.md.DLlooohw.lean.js deleted file mode 100644 index fd0a1880..00000000 --- a/assets/en_develop_php-src-changes.md.DLlooohw.lean.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as e,c as i,o as t,a1 as o}from"./chunks/framework.gjrnbxUT.js";const f=JSON.parse('{"title":"Modifications to PHP source code","description":"","frontmatter":{},"headers":[],"relativePath":"en/develop/php-src-changes.md","filePath":"en/develop/php-src-changes.md"}'),a={name:"en/develop/php-src-changes.md"},s=o("",20),n=[s];function c(r,h,l,p,d,m){return t(),i("div",null,n)}const P=e(a,[["render",c]]);export{f as __pageData,P as default}; diff --git a/assets/en_develop_php-src-changes.md.DadHFaGC.js b/assets/en_develop_php-src-changes.md.DadHFaGC.js new file mode 100644 index 00000000..8c48111e --- /dev/null +++ b/assets/en_develop_php-src-changes.md.DadHFaGC.js @@ -0,0 +1 @@ +import{_ as i,c as t,o as a,af as o}from"./chunks/framework.PeLcR_tw.js";const m=JSON.parse('{"title":"Modifications to PHP source code","description":"","frontmatter":{},"headers":[],"relativePath":"en/develop/php-src-changes.md","filePath":"en/develop/php-src-changes.md"}'),s={name:"en/develop/php-src-changes.md"};function n(c,e,r,l,h,p){return a(),t("div",null,e[0]||(e[0]=[o('

Modifications to PHP source code

During the static compilation process, static-php-cli made some modifications to the PHP source code in order to achieve good compatibility, performance, and security. The following is a description of the current modifications to the PHP source code.

Based on the patches provided by the phpmicro project, static-php-cli has made some modifications to the PHP source code to meet the needs of static compilation. The patches currently used by static-php-cli during compilation in the patch list are:

  • static_opcache
  • static_extensions_win32
  • cli_checks
  • disable_huge_page
  • vcruntime140
  • win32
  • zend_stream
  • cli_static
  • macos_iconv
  • phar

PHP <= 8.1 libxml patch

Because PHP only provides security updates for 8.1 and stops updating older versions, static-php-cli applies the libxml compilation patch that has been applied in newer versions of PHP to PHP 8.1 and below.

gd extension Windows patch

Compiling the gd extension under Windows requires major changes to the config.w32 file. static-php-cli has made some changes to the gd extension to make it easier to compile under Windows.

YAML extension Windows patch

YAML extension needs to modify the config.w32 file to compile under Windows. static-php-cli has made some modifications to the YAML extension to make it easier to compile under Windows.

static-php-cli version information insertion

When compiling, static-php-cli will insert the static-php-cli version information into the PHP version information for easy identification.

Add option to hardcode INI

When using the -I parameter to hardcode INI into static PHP functionality, static-php-cli will modify the PHP source code to insert the hardcoded content.

Linux system repair patch

Some compilation environments may lack some system header files or libraries. static-php-cli will automatically fix these problems during compilation, such as:

  • HAVE_STRLCAT missing problem
  • HAVE_STRLCPY missing problem

Fiber issue fix patch for Windows

When compiling PHP on Windows, there will be some issues with the Fiber extension. static-php-cli will automatically fix these issues during compilation (modify config.w32 in php-src).

',20)]))}const f=i(s,[["render",n]]);export{m as __pageData,f as default}; diff --git a/assets/en_develop_php-src-changes.md.DadHFaGC.lean.js b/assets/en_develop_php-src-changes.md.DadHFaGC.lean.js new file mode 100644 index 00000000..cdddd7ab --- /dev/null +++ b/assets/en_develop_php-src-changes.md.DadHFaGC.lean.js @@ -0,0 +1 @@ +import{_ as i,c as t,o as a,af as o}from"./chunks/framework.PeLcR_tw.js";const m=JSON.parse('{"title":"Modifications to PHP source code","description":"","frontmatter":{},"headers":[],"relativePath":"en/develop/php-src-changes.md","filePath":"en/develop/php-src-changes.md"}'),s={name:"en/develop/php-src-changes.md"};function n(c,e,r,l,h,p){return a(),t("div",null,e[0]||(e[0]=[o("",20)]))}const f=i(s,[["render",n]]);export{m as __pageData,f as default}; diff --git a/assets/en_develop_source-module.md.CdOHR0ez.lean.js b/assets/en_develop_source-module.md.CdOHR0ez.lean.js deleted file mode 100644 index 948178ca..00000000 --- a/assets/en_develop_source-module.md.CdOHR0ez.lean.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as s,c as i,o as a,a1 as e}from"./chunks/framework.gjrnbxUT.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("",75),l=[n];function h(p,o,k,d,r,E){return a(),i("div",null,l)}const g=s(t,[["render",h]]);export{u as __pageData,g as default}; diff --git a/assets/en_develop_source-module.md.CdOHR0ez.js b/assets/en_develop_source-module.md.CeJEgS_j.js similarity index 71% rename from assets/en_develop_source-module.md.CdOHR0ez.js rename to assets/en_develop_source-module.md.CeJEgS_j.js index 783c9039..29063ec7 100644 --- a/assets/en_develop_source-module.md.CdOHR0ez.js +++ b/assets/en_develop_source-module.md.CeJEgS_j.js @@ -1,4 +1,4 @@ -import{_ as s,c as i,o as a,a1 as e}from"./chunks/framework.gjrnbxUT.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(`

Source module

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 source.json and pkg.json file, which records the download method of all downloadable sources.

The main commands involved in the download function are bin/spc download and bin/spc extract. The download command is a downloader that downloads sources according to the configuration file, and the extract command is an extractor that extract sources from downloaded files.

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.

The configuration file of the downloader is source.json, which contains the download methods of all sources. You can add the source download methods you need, or modify the existing source download methods.

The download configuration structure of each source is as follows. The following is the source download configuration corresponding to the libevent extension:

json
{
+import{_ as i,c as a,o as e,af as t}from"./chunks/framework.PeLcR_tw.js";const E=JSON.parse('{"title":"Source module","description":"","frontmatter":{},"headers":[],"relativePath":"en/develop/source-module.md","filePath":"en/develop/source-module.md"}'),n={name:"en/develop/source-module.md"};function l(h,s,p,o,k,d){return e(),a("div",null,s[0]||(s[0]=[t(`

Source module

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 source.json and pkg.json file, which records the download method of all downloadable sources.

The main commands involved in the download function are bin/spc download and bin/spc extract. The download command is a downloader that downloads sources according to the configuration file, and the extract command is an extractor that extract sources from downloaded files.

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.

The configuration file of the downloader is source.json, which contains the download methods of all sources. You can add the source download methods you need, or modify the existing source download methods.

The download configuration structure of each source is as follows. The following is the source download configuration corresponding to the libevent extension:

json
{
   "libevent": {
     "type": "ghrel",
     "repo": "libevent/libevent",
@@ -9,7 +9,7 @@ import{_ as s,c as i,o as a,a1 as e}from"./chunks/framework.gjrnbxUT.js";const u
       "path": "LICENSE"
     }
   }
-}

The most important field here is type. Currently, the types it supports are:

  • url: Directly use URL to download, for example: https://download.libsodium.org/libsodium/releases/libsodium-1.0.18.tar.gz.
  • ghrel: Use the GitHub Release API to download, download the artifacts uploaded from the latest version released by maintainers.
  • ghtar: Use the GitHub Release API to download. Different from ghrel, ghtar is downloaded from the source code (tar.gz) in the latest Release of the project.
  • ghtagtar: Use GitHub Release API to download. Compared with ghtar, ghtagtar can find the latest one from the tags list and download the source code in tar.gz format (because some projects only use tag release version).
  • bitbuckettag: Download using BitBucket API, basically the same as ghtagtar, except this one applies to BitBucket.
  • git: Clone the project directly from a Git address to download sources, applicable to any public Git repository.
  • filelist: 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.
  • custom: If none of the above download methods are satisfactory, you can write custom, create a new class under src/SPC/store/source/, extends CustomSourceBase, and write the download script yourself.

source.json Common parameters

Each source file in source.json has the following params:

  • license: the open source license of the source code, see Open Source License section below
  • type: must be one of the types mentioned above
  • path (optional): release the source code to the specified directory instead of source/{name}
  • provide-pre-built (optional): whether to provide precompiled binary files. If true, it will automatically try to download precompiled binary files when running bin/spc download

TIP

The path parameter in source.json can specify a relative or absolute path. When specified as a relative path, the path is based on source/.

Download type - url

URL type sources refer to downloading files directly from the URL.

The parameters included are:

  • url: The download address of the file, such as https://example.com/file.tgz
  • filename (optional): The file name saved to the local area. If not specified, the file name of the url will be used.

Example (download the imagick extension and extract it to the extension storage path of the php source code):

json
{
+}

The most important field here is type. Currently, the types it supports are:

  • url: Directly use URL to download, for example: https://download.libsodium.org/libsodium/releases/libsodium-1.0.18.tar.gz.
  • ghrel: Use the GitHub Release API to download, download the artifacts uploaded from the latest version released by maintainers.
  • ghtar: Use the GitHub Release API to download. Different from ghrel, ghtar is downloaded from the source code (tar.gz) in the latest Release of the project.
  • ghtagtar: Use GitHub Release API to download. Compared with ghtar, ghtagtar can find the latest one from the tags list and download the source code in tar.gz format (because some projects only use tag release version).
  • bitbuckettag: Download using BitBucket API, basically the same as ghtagtar, except this one applies to BitBucket.
  • git: Clone the project directly from a Git address to download sources, applicable to any public Git repository.
  • filelist: 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.
  • custom: If none of the above download methods are satisfactory, you can write custom, create a new class under src/SPC/store/source/, extends CustomSourceBase, and write the download script yourself.

source.json Common parameters

Each source file in source.json has the following params:

  • license: the open source license of the source code, see Open Source License section below
  • type: must be one of the types mentioned above
  • path (optional): release the source code to the specified directory instead of source/{name}
  • provide-pre-built (optional): whether to provide precompiled binary files. If true, it will automatically try to download precompiled binary files when running bin/spc download

TIP

The path parameter in source.json can specify a relative or absolute path. When specified as a relative path, the path is based on source/.

Download type - url

URL type sources refer to downloading files directly from the URL.

The parameters included are:

  • url: The download address of the file, such as https://example.com/file.tgz
  • filename (optional): The file name saved to the local area. If not specified, the file name of the url will be used.

Example (download the imagick extension and extract it to the extension storage path of the php source code):

json
{
    "ext-imagick": {
      "type": "url",
      "url": "https://pecl.php.net/get/imagick",
@@ -20,7 +20,7 @@ import{_ as s,c as i,o as a,a1 as e}from"./chunks/framework.gjrnbxUT.js";const u
        "path": "LICENSE"
      }
    }
-}

Download type - ghrel

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.

The parameters included are:

  • repo: GitHub repository name
  • match: regular expression matching Assets files
  • prefer-stable: Whether to download stable versions first (default is false)

Example (download the libsodium library, matching the libsodium-x.y.tar.gz file in Release):

json
{
+}

Download type - ghrel

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.

The parameters included are:

  • repo: GitHub repository name
  • match: regular expression matching Assets files
  • prefer-stable: Whether to download stable versions first (default is false)

Example (download the libsodium library, matching the libsodium-x.y.tar.gz file in Release):

json
{
    "libsodium": {
      "type": "ghrel",
      "repo": "jedisct1/libsodium",
@@ -30,7 +30,7 @@ import{_ as s,c as i,o as a,a1 as e}from"./chunks/framework.gjrnbxUT.js";const u
        "path": "LICENSE"
      }
    }
-}

Download type - ghtar

ghtar will download the file from the GitHub Release Tag. Unlike ghrel, ghtar will download the source code (tar.gz) from the latest Release of the project.

The parameters included are:

  • repo: GitHub repository name
  • prefer-stable: Whether to download stable versions first (default is false)

Example (brotli library):

json
{
+}

Download type - ghtar

ghtar will download the file from the GitHub Release Tag. Unlike ghrel, ghtar will download the source code (tar.gz) from the latest Release of the project.

The parameters included are:

  • repo: GitHub repository name
  • prefer-stable: Whether to download stable versions first (default is false)

Example (brotli library):

json
{
    "brotli": {
      "type": "ghtar",
      "repo": "google/brotli",
@@ -39,7 +39,7 @@ import{_ as s,c as i,o as a,a1 as e}from"./chunks/framework.gjrnbxUT.js";const u
        "path": "LICENSE"
      }
    }
-}

Download type - ghtagtar

Use the GitHub Release API to download. Compared with ghtar, ghtagtar can find the latest one from the tags list and download the source code in tar.gz format (because some projects only use the tag version).

The parameters included are:

  • repo: GitHub repository name
  • prefer-stable: Whether to download stable versions first (default is false)

Example (gmp library):

json
{
+}

Download type - ghtagtar

Use the GitHub Release API to download. Compared with ghtar, ghtagtar can find the latest one from the tags list and download the source code in tar.gz format (because some projects only use the tag version).

The parameters included are:

  • repo: GitHub repository name
  • prefer-stable: Whether to download stable versions first (default is false)

Example (gmp library):

json
{
    "gmp": {
      "type": "ghtagtar",
      "repo": "alisw/GMP",
@@ -48,7 +48,7 @@ import{_ as s,c as i,o as a,a1 as e}from"./chunks/framework.gjrnbxUT.js";const u
        "text": "EXAMPLE LICENSE"
      }
    }
-}

Download Type - bitbuckettag

Download using BitBucket API, basically the same as ghtagtar, except this one works with BitBucket.

The parameters included are:

  • repo: BitBucket repository name

Download type - git

Clone the project directly from a Git address to download sources, applicable to any public Git repository.

The parameters included are:

  • url: Git link (HTTPS only)
  • rev: branch name
json
{
+}

Download Type - bitbuckettag

Download using BitBucket API, basically the same as ghtagtar, except this one works with BitBucket.

The parameters included are:

  • repo: BitBucket repository name

Download type - git

Clone the project directly from a Git address to download sources, applicable to any public Git repository.

The parameters included are:

  • url: Git link (HTTPS only)
  • rev: branch name
json
{
    "imap": {
      "type": "git",
      "url": "https://github.com/static-php/imap.git",
@@ -58,7 +58,7 @@ import{_ as s,c as i,o as a,a1 as e}from"./chunks/framework.gjrnbxUT.js";const u
        "path": "LICENSE"
      }
    }
-}

Download type - filelist

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.

Note that this method is only applicable to static sites with page index functions such as mirror sites and GNU official websites.

The parameters included are:

  • url: The URL of the page to crawl the latest version of the file
  • regex: regular expression matching file names and download links

Example (download the libiconv library from the GNU official website):

json
{
+}

Download type - filelist

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.

Note that this method is only applicable to static sites with page index functions such as mirror sites and GNU official websites.

The parameters included are:

  • url: The URL of the page to crawl the latest version of the file
  • regex: regular expression matching file names and download links

Example (download the libiconv library from the GNU official website):

json
{
    "libiconv": {
      "type": "filelist",
      "url": "https://ftp.gnu.org/gnu/libiconv/",
@@ -68,7 +68,7 @@ import{_ as s,c as i,o as a,a1 as e}from"./chunks/framework.gjrnbxUT.js";const u
        "path": "COPYING"
      }
    }
-}

Download type - custom

If the above downloading methods are not satisfactory, you can write custom, create a new class under src/SPC/store/source/, extends CustomSourceBase, and write the download script yourself.

I won’t go into details here, you can look at src/SPC/store/source/PhpSource.php or src/SPC/store/source/PostgreSQLSource.php as examples.

pkg.json General parameters

pkg.json stores non-source-code files, such as precompiled tools musl-toolchain and UPX. It includes:

  • type: The same type as source.json and different kinds of parameters.
  • extract (optional): The path to decompress after downloading, the default is pkgroot/{pkg_name}.
  • extract-files (optional): Extract only the specified files to the specified location after downloading.

It should be noted that pkg.json does not involve compilation, modification and distribution of source code, so there is no license open source license field. And you cannot use the extract and extract-files parameters at the same time.

Example (download nasm locally and extract only program files to PHP SDK):

json
{
+}

Download type - custom

If the above downloading methods are not satisfactory, you can write custom, create a new class under src/SPC/store/source/, extends CustomSourceBase, and write the download script yourself.

I won’t go into details here, you can look at src/SPC/store/source/PhpSource.php or src/SPC/store/source/PostgreSQLSource.php as examples.

pkg.json General parameters

pkg.json stores non-source-code files, such as precompiled tools musl-toolchain and UPX. It includes:

  • type: The same type as source.json and different kinds of parameters.
  • extract (optional): The path to decompress after downloading, the default is pkgroot/{pkg_name}.
  • extract-files (optional): Extract only the specified files to the specified location after downloading.

It should be noted that pkg.json does not involve compilation, modification and distribution of source code, so there is no license open source license field. And you cannot use the extract and extract-files parameters at the same time.

Example (download nasm locally and extract only program files to PHP SDK):

json
{
    "nasm-x86_64-win": {
      "type": "url",
      "url": "https://www.nasm.us/pub/nasm/releasebuilds/2.16.01/win64/nasm-2.16.01-win64.zip",
@@ -77,7 +77,7 @@ import{_ as s,c as i,o as a,a1 as e}from"./chunks/framework.gjrnbxUT.js";const u
        "nasm-2.16.01/ndisasm.exe": "{php_sdk_path}/bin/ndisasm.exe"
      }
    }
-}

The key name in extract-files is the file in the source folder, and the key value is the storage path. The storage path can use the following variables:

  • {php_sdk_path}: (Windows only) PHP SDK path
  • {pkg_root_path}: pkgroot/
  • {working_dir}: current working directory
  • {download_path}: download directory
  • {source_path}: source code decompression directory

When extract-files does not use variables and is a relative path, the directory of the relative path is {working_dir}.

Open source license

For source.json, each source file should contain an open source license. The license field stores the open source license information.

Each license contains the following parameters:

  • type: file or text
  • path: the license file in the source code directory (required when type is file)
  • text: License text (required when type is text)

Example (yaml extension source code with LICENSE file):

json
{
+}

The key name in extract-files is the file in the source folder, and the key value is the storage path. The storage path can use the following variables:

  • {php_sdk_path}: (Windows only) PHP SDK path
  • {pkg_root_path}: pkgroot/
  • {working_dir}: current working directory
  • {download_path}: download directory
  • {source_path}: source code decompression directory

When extract-files does not use variables and is a relative path, the directory of the relative path is {working_dir}.

Open source license

For source.json, each source file should contain an open source license. The license field stores the open source license information.

Each license contains the following parameters:

  • type: file or text
  • path: the license file in the source code directory (required when type is file)
  • text: License text (required when type is text)

Example (yaml extension source code with LICENSE file):

json
{
    "yaml": {
      "type": "git",
      "path": "php-src/ext/yaml",
@@ -88,7 +88,7 @@ import{_ as s,c as i,o as a,a1 as e}from"./chunks/framework.gjrnbxUT.js";const u
        "path": "LICENSE"
      }
    }
-}

When an open source project has multiple licenses, multiple files can be specified:

json
{
+}

When an open source project has multiple licenses, multiple files can be specified:

json
{
    "libuv": {
      "type": "ghtar",
      "repo": "libuv/libuv",
@@ -103,7 +103,7 @@ import{_ as s,c as i,o as a,a1 as e}from"./chunks/framework.gjrnbxUT.js";const u
        }
      ]
    }
-}

When the license of an open source project uses different files between versions, path can be used as an array to list the possible license files:

json
{
+}

When the license of an open source project uses different files between versions, path can be used as an array to list the possible license files:

json
{
   "redis": {
     "type": "git",
     "path": "php-src/ext/redis",
@@ -117,4 +117,4 @@ import{_ as s,c as i,o as a,a1 as e}from"./chunks/framework.gjrnbxUT.js";const u
       ]
     }
   }
-}
`,75),l=[n];function h(p,o,k,d,r,E){return a(),i("div",null,l)}const g=s(t,[["render",h]]);export{u as __pageData,g as default}; +}
`,75)]))}const c=i(n,[["render",l]]);export{E as __pageData,c as default}; diff --git a/assets/en_develop_source-module.md.CeJEgS_j.lean.js b/assets/en_develop_source-module.md.CeJEgS_j.lean.js new file mode 100644 index 00000000..f2b5cc9e --- /dev/null +++ b/assets/en_develop_source-module.md.CeJEgS_j.lean.js @@ -0,0 +1 @@ +import{_ as i,c as a,o as e,af as t}from"./chunks/framework.PeLcR_tw.js";const E=JSON.parse('{"title":"Source module","description":"","frontmatter":{},"headers":[],"relativePath":"en/develop/source-module.md","filePath":"en/develop/source-module.md"}'),n={name:"en/develop/source-module.md"};function l(h,s,p,o,k,d){return e(),a("div",null,s[0]||(s[0]=[t("",75)]))}const c=i(n,[["render",l]]);export{E as __pageData,c as default}; diff --git a/assets/en_develop_structure.md.BA5PDIse.js b/assets/en_develop_structure.md.BA5PDIse.js deleted file mode 100644 index a31cca8c..00000000 --- a/assets/en_develop_structure.md.BA5PDIse.js +++ /dev/null @@ -1,10 +0,0 @@ -import{_ as e,c as o,o as t,a1 as c}from"./chunks/framework.gjrnbxUT.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(`

Introduction to project structure

static-php-cli mainly contains three logical components: sources, dependent libraries, and extensions. These components contains 4 configuration files: source.json, pkg.json, lib.json, and ext.json.

A complete process for building standalone static PHP is:

  1. Use the source download module Downloader to download specified or all source codes. These sources include PHP source code, dependent library source code, and extension source code.
  2. Use the source decompression module SourceExtractor to decompress the downloaded sources to the compilation directory.
  3. Use the dependency tool to calculate the dependent extensions and dependent libraries of the currently added extension, and then compile each library that needs to be compiled in the order of dependencies.
  4. After building each dependent library using Builder under the corresponding operating system, install it to the buildroot directory.
  5. If external extensions are included (the source code does not contain extensions within PHP), copy the external extensions to the source/php-src/ext/ directory.
  6. Use Builder to build the PHP source code and build target to the buildroot directory.

The project is mainly divided into several folders:

  • bin/: used to store program entry files, including bin/spc, bin/spc-alpine-docker, bin/setup-runtime.
  • config/: Contains all the extensions and dependent libraries supported by the project, as well as the download link and download methods of these sources. It is divided into files: lib.json, ext.json, source.json, pkg.json, pre-built.json .
  • src/: The core code of the project, including the entire framework and commands for compiling various extensions and libraries.
  • vendor/: The directory that Composer depends on, you do not need to make any modifications to it.

The operating principle is to start a ConsoleApplication of symfony/console, and then parse the commands entered by the user in the terminal.

Basic command line structure

bin/spc is an entry file, including the Unix common #!/usr/bin/env php, which is used to allow the system to automatically execute with the PHP interpreter installed on the system. After the project executes new ConsoleApplication(), the framework will automatically register them as commands.

The project does not directly use the Command registration method and command execution method recommended by Symfony. Here are small changes:

  1. Each command uses the #[AsCommand()] Attribute to register the name and description.
  2. Abstract execute() so that all commands are based on BaseCommand (which is based on Symfony\\Component\\Console\\Command\\Command), and the execution code of each command itself is written in the handle() method .
  3. Added variable $no_motd to BaseCommand, which is used to display the Figlet greeting when the command is executed.
  4. BaseCommand saves InputInterface and OutputInterface as member variables. You can use $this->input and $this->output within the command class.

Basic source code structure

The source code of the project is located in the src/SPC directory, supports automatic loading of the PSR-4 standard, and contains the following subdirectories and classes:

  • src/SPC/builder/: The core compilation command code used to build libraries, PHP and related extensions under different operating systems, and also includes some compilation system tool methods.
  • src/SPC/command/: All commands of the project are here.
  • src/SPC/doctor/: Doctor module, which is a relatively independent module used to check the system environment. It can be entered using the command bin/spc doctor.
  • src/SPC/exception/: exception class.
  • src/SPC/store/: Classes related to storage, files and sources are all here.
  • src/SPC/util/: Some reusable tool methods are here.
  • src/SPC/ConsoleApplication.php: command line program entry file.

If you have read the source code, you may find that there is also a src/globals/ directory, which is used to store some global variables, global methods, and non-PSR-4 standard PHP source code that is relied upon during the build process, such as extension sanity check code etc.

Phar application directory issue

Like other php-cli projects, spc itself has additional considerations for paths. Because spc can run in multiple modes such as php-cli directly, micro SAPI, php-cli with Phar, vendor with Phar, etc., there are ambiguities in various root directories. A complete explanation is given here. This problem is generally common in the base class path selection problem of accessing files in PHP projects, especially when used with micro.sfx.

Note that this may only be useful for you when developing Phar projects or PHP frameworks.

Next, we will treat static-php-cli (that is, spc) as a normal php command line program. You can understand spc as any of your own php-cli applications for reference.

There are three basic constant theoretical values below. We recommend that you introduce these three constants when writing PHP projects:

  • WORKING_DIR: the working directory when executing PHP scripts

  • SOURCE_ROOT_DIR or ROOT_DIR: the root directory of the project folder, generally the directory where composer.json is located

  • FRAMEWORK_ROOT_DIR: the root directory of the framework used, which may be used by self-developed frameworks. Generally, the framework directory is read-only

You can define these constants in your framework entry or cli applications to facilitate the use of paths in your project.

The following are PHP built-in constant values, which have been defined inside the PHP interpreter:

  • __DIR__: the directory where the file of the currently executed script is located

  • __FILE__: the file path of the currently executed script

Git project mode (source)

Git project mode refers to a framework or program itself stored in plain text in the current folder, and running through php path/to/entry.php.

Assume that your project is stored in the /home/example/static-php-cli/ directory, or your project is the framework itself, which contains project files such as composer.json:

composer.json
-src/App/MyCommand.app
-vendor/*
-bin/entry.php

We assume that the above constants are obtained from src/App/MyCommand.php:

ConstantValue
WORKING_DIR/home/example/static-php-cli
SOURCE_ROOT_DIR/home/example/static-php-cli
FRAMEWORK_ROOT_DIR/home/example/static-php-cli
__DIR__/home/example/static-php-cli/src/App
__FILE__/home/example/static-php-cli/src/App/MyCommand.php

In this case, the values of WORKING_DIR, SOURCE_ROOT_DIR, and FRAMEWORK_ROOT_DIR are exactly the same: /home/example/static-php-cli.

The source code of the framework and the source code of the application are both in the current path.

Vendor library mode (vendor)

The vendor library mode generally means that your project is a framework or is installed into the project as a composer dependency by other applications, and the storage location is in the vendor/author/XXX directory.

Suppose your project is crazywhalecc/static-php-cli, and you or others install this project in another project using composer require.

We assume that static-php-cli contains all files except the vendor directory with the same Git mode, and get the constant value from src/App/MyCommand, Directory constant should be:

ConstantValue
WORKING_DIR/home/example/another-app
SOURCE_ROOT_DIR/home/example/another-app
FRAMEWORK_ROOT_DIR/home/example/another-app/vendor/crazywhalecc/static-php-cli
__DIR__/home/example/another-app/vendor/crazywhalecc/static-php-cli/src/App
__FILE__/home/example/another-app/vendor/crazywhalecc/static-php-cli/src/App/MyCommand.php

Here SOURCE_ROOT_DIR refers to the root directory of the project using static-php-cli.

Git project Phar mode (source-phar)

Git project Phar mode refers to the mode of packaging the project directory of the Git project mode into a phar file. We assume that /home/example/static-php-cli will be packaged into a Phar file, and the directory has the following files:

composer.json
-src/App/MyCommand.app
-vendor/*
-bin/entry.php

When packaged into app.phar and stored in the /home/example/static-php-cli directory, app.phar is executed at this time. Assuming that the src/App/MyCommand code is executed, the constant is obtained in the file:

ConstantValue
WORKING_DIR/home/example/static-php-cli
SOURCE_ROOT_DIRphar:///home/example/static-php-cli/app.phar/
FRAMEWORK_ROOT_DIRphar:///home/example/static-php-cli/app.phar/
__DIR__phar:///home/example/static-php-cli/app.phar/src/App
__FILE__phar:///home/example/static-php-cli/app.phar/src/App/MyCommand.php

Because the phar:// protocol is required to read files in the phar itself, the project root directory and the framework directory will be different from WORKING_DIR.

Vendor Library Phar Mode (vendor-phar)

Vendor Library Phar Mode means that your project is installed as a framework in other projects and stored in the vendor directory.

We assume that your project directory structure is as follows:

composer.json                           # Composer configuration file of the current project
-box.json                                # Configuration file for packaging Phar
-another-app.php                         # Entry file of another project
-vendor/crazywhalecc/static-php-cli/*    # Your project is used as a dependent library

When packaging these files under the directory /home/example/another-app/ into app.phar, the value of the following constant for your project should be:

ConstantValue
WORKING_DIR/home/example/another-app
SOURCE_ROOT_DIRphar:///home/example/another-app/app.phar/
FRAMEWORK_ROOT_DIRphar:///home/example/another-app/app.phar/vendor/crazywhalecc/static-php-cli
__DIR__phar:///home/example/another-app/app.phar/vendor/crazywhalecc/static-php-cli/src/App
__FILE__phar:///home/example/another-app/app.phar/vendor/crazywhalecc/static-php-cli/src/App/MyCommand.php
`,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}; diff --git a/assets/en_develop_structure.md.BA5PDIse.lean.js b/assets/en_develop_structure.md.BA5PDIse.lean.js deleted file mode 100644 index 9b7a2fbb..00000000 --- a/assets/en_develop_structure.md.BA5PDIse.lean.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as e,c as o,o as t,a1 as c}from"./chunks/framework.gjrnbxUT.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}; diff --git a/assets/en_develop_structure.md.D1kBTweh.js b/assets/en_develop_structure.md.D1kBTweh.js new file mode 100644 index 00000000..91d140af --- /dev/null +++ b/assets/en_develop_structure.md.D1kBTweh.js @@ -0,0 +1,10 @@ +import{_ as o,c as t,o as c,af as d}from"./chunks/framework.PeLcR_tw.js";const m=JSON.parse('{"title":"Introduction to project structure","description":"","frontmatter":{},"headers":[],"relativePath":"en/develop/structure.md","filePath":"en/develop/structure.md"}'),a={name:"en/develop/structure.md"};function r(i,e,s,n,p,l){return c(),t("div",null,e[0]||(e[0]=[d(`

Introduction to project structure

static-php-cli mainly contains three logical components: sources, dependent libraries, and extensions. These components contains 4 configuration files: source.json, pkg.json, lib.json, and ext.json.

A complete process for building standalone static PHP is:

  1. Use the source download module Downloader to download specified or all source codes. These sources include PHP source code, dependent library source code, and extension source code.
  2. Use the source decompression module SourceExtractor to decompress the downloaded sources to the compilation directory.
  3. Use the dependency tool to calculate the dependent extensions and dependent libraries of the currently added extension, and then compile each library that needs to be compiled in the order of dependencies.
  4. After building each dependent library using Builder under the corresponding operating system, install it to the buildroot directory.
  5. If external extensions are included (the source code does not contain extensions within PHP), copy the external extensions to the source/php-src/ext/ directory.
  6. Use Builder to build the PHP source code and build target to the buildroot directory.

The project is mainly divided into several folders:

  • bin/: used to store program entry files, including bin/spc, bin/spc-alpine-docker, bin/setup-runtime.
  • config/: Contains all the extensions and dependent libraries supported by the project, as well as the download link and download methods of these sources. It is divided into files: lib.json, ext.json, source.json, pkg.json, pre-built.json .
  • src/: The core code of the project, including the entire framework and commands for compiling various extensions and libraries.
  • vendor/: The directory that Composer depends on, you do not need to make any modifications to it.

The operating principle is to start a ConsoleApplication of symfony/console, and then parse the commands entered by the user in the terminal.

Basic command line structure

bin/spc is an entry file, including the Unix common #!/usr/bin/env php, which is used to allow the system to automatically execute with the PHP interpreter installed on the system. After the project executes new ConsoleApplication(), the framework will automatically register them as commands.

The project does not directly use the Command registration method and command execution method recommended by Symfony. Here are small changes:

  1. Each command uses the #[AsCommand()] Attribute to register the name and description.
  2. Abstract execute() so that all commands are based on BaseCommand (which is based on Symfony\\Component\\Console\\Command\\Command), and the execution code of each command itself is written in the handle() method .
  3. Added variable $no_motd to BaseCommand, which is used to display the Figlet greeting when the command is executed.
  4. BaseCommand saves InputInterface and OutputInterface as member variables. You can use $this->input and $this->output within the command class.

Basic source code structure

The source code of the project is located in the src/SPC directory, supports automatic loading of the PSR-4 standard, and contains the following subdirectories and classes:

  • src/SPC/builder/: The core compilation command code used to build libraries, PHP and related extensions under different operating systems, and also includes some compilation system tool methods.
  • src/SPC/command/: All commands of the project are here.
  • src/SPC/doctor/: Doctor module, which is a relatively independent module used to check the system environment. It can be entered using the command bin/spc doctor.
  • src/SPC/exception/: exception class.
  • src/SPC/store/: Classes related to storage, files and sources are all here.
  • src/SPC/util/: Some reusable tool methods are here.
  • src/SPC/ConsoleApplication.php: command line program entry file.

If you have read the source code, you may find that there is also a src/globals/ directory, which is used to store some global variables, global methods, and non-PSR-4 standard PHP source code that is relied upon during the build process, such as extension sanity check code etc.

Phar application directory issue

Like other php-cli projects, spc itself has additional considerations for paths. Because spc can run in multiple modes such as php-cli directly, micro SAPI, php-cli with Phar, vendor with Phar, etc., there are ambiguities in various root directories. A complete explanation is given here. This problem is generally common in the base class path selection problem of accessing files in PHP projects, especially when used with micro.sfx.

Note that this may only be useful for you when developing Phar projects or PHP frameworks.

Next, we will treat static-php-cli (that is, spc) as a normal php command line program. You can understand spc as any of your own php-cli applications for reference.

There are three basic constant theoretical values below. We recommend that you introduce these three constants when writing PHP projects:

  • WORKING_DIR: the working directory when executing PHP scripts

  • SOURCE_ROOT_DIR or ROOT_DIR: the root directory of the project folder, generally the directory where composer.json is located

  • FRAMEWORK_ROOT_DIR: the root directory of the framework used, which may be used by self-developed frameworks. Generally, the framework directory is read-only

You can define these constants in your framework entry or cli applications to facilitate the use of paths in your project.

The following are PHP built-in constant values, which have been defined inside the PHP interpreter:

  • __DIR__: the directory where the file of the currently executed script is located

  • __FILE__: the file path of the currently executed script

Git project mode (source)

Git project mode refers to a framework or program itself stored in plain text in the current folder, and running through php path/to/entry.php.

Assume that your project is stored in the /home/example/static-php-cli/ directory, or your project is the framework itself, which contains project files such as composer.json:

composer.json
+src/App/MyCommand.app
+vendor/*
+bin/entry.php

We assume that the above constants are obtained from src/App/MyCommand.php:

ConstantValue
WORKING_DIR/home/example/static-php-cli
SOURCE_ROOT_DIR/home/example/static-php-cli
FRAMEWORK_ROOT_DIR/home/example/static-php-cli
__DIR__/home/example/static-php-cli/src/App
__FILE__/home/example/static-php-cli/src/App/MyCommand.php

In this case, the values of WORKING_DIR, SOURCE_ROOT_DIR, and FRAMEWORK_ROOT_DIR are exactly the same: /home/example/static-php-cli.

The source code of the framework and the source code of the application are both in the current path.

Vendor library mode (vendor)

The vendor library mode generally means that your project is a framework or is installed into the project as a composer dependency by other applications, and the storage location is in the vendor/author/XXX directory.

Suppose your project is crazywhalecc/static-php-cli, and you or others install this project in another project using composer require.

We assume that static-php-cli contains all files except the vendor directory with the same Git mode, and get the constant value from src/App/MyCommand, Directory constant should be:

ConstantValue
WORKING_DIR/home/example/another-app
SOURCE_ROOT_DIR/home/example/another-app
FRAMEWORK_ROOT_DIR/home/example/another-app/vendor/crazywhalecc/static-php-cli
__DIR__/home/example/another-app/vendor/crazywhalecc/static-php-cli/src/App
__FILE__/home/example/another-app/vendor/crazywhalecc/static-php-cli/src/App/MyCommand.php

Here SOURCE_ROOT_DIR refers to the root directory of the project using static-php-cli.

Git project Phar mode (source-phar)

Git project Phar mode refers to the mode of packaging the project directory of the Git project mode into a phar file. We assume that /home/example/static-php-cli will be packaged into a Phar file, and the directory has the following files:

composer.json
+src/App/MyCommand.app
+vendor/*
+bin/entry.php

When packaged into app.phar and stored in the /home/example/static-php-cli directory, app.phar is executed at this time. Assuming that the src/App/MyCommand code is executed, the constant is obtained in the file:

ConstantValue
WORKING_DIR/home/example/static-php-cli
SOURCE_ROOT_DIRphar:///home/example/static-php-cli/app.phar/
FRAMEWORK_ROOT_DIRphar:///home/example/static-php-cli/app.phar/
__DIR__phar:///home/example/static-php-cli/app.phar/src/App
__FILE__phar:///home/example/static-php-cli/app.phar/src/App/MyCommand.php

Because the phar:// protocol is required to read files in the phar itself, the project root directory and the framework directory will be different from WORKING_DIR.

Vendor Library Phar Mode (vendor-phar)

Vendor Library Phar Mode means that your project is installed as a framework in other projects and stored in the vendor directory.

We assume that your project directory structure is as follows:

composer.json                           # Composer configuration file of the current project
+box.json                                # Configuration file for packaging Phar
+another-app.php                         # Entry file of another project
+vendor/crazywhalecc/static-php-cli/*    # Your project is used as a dependent library

When packaging these files under the directory /home/example/another-app/ into app.phar, the value of the following constant for your project should be:

ConstantValue
WORKING_DIR/home/example/another-app
SOURCE_ROOT_DIRphar:///home/example/another-app/app.phar/
FRAMEWORK_ROOT_DIRphar:///home/example/another-app/app.phar/vendor/crazywhalecc/static-php-cli
__DIR__phar:///home/example/another-app/app.phar/vendor/crazywhalecc/static-php-cli/src/App
__FILE__phar:///home/example/another-app/app.phar/vendor/crazywhalecc/static-php-cli/src/App/MyCommand.php
`,50)]))}const u=o(a,[["render",r]]);export{m as __pageData,u as default}; diff --git a/assets/en_develop_structure.md.D1kBTweh.lean.js b/assets/en_develop_structure.md.D1kBTweh.lean.js new file mode 100644 index 00000000..2cd47cdf --- /dev/null +++ b/assets/en_develop_structure.md.D1kBTweh.lean.js @@ -0,0 +1 @@ +import{_ as o,c as t,o as c,af as d}from"./chunks/framework.PeLcR_tw.js";const m=JSON.parse('{"title":"Introduction to project structure","description":"","frontmatter":{},"headers":[],"relativePath":"en/develop/structure.md","filePath":"en/develop/structure.md"}'),a={name:"en/develop/structure.md"};function r(i,e,s,n,p,l){return c(),t("div",null,e[0]||(e[0]=[d("",50)]))}const u=o(a,[["render",r]]);export{m as __pageData,u as default}; diff --git a/assets/en_develop_system-build-tools.md.D6vaAwN3.lean.js b/assets/en_develop_system-build-tools.md.D6vaAwN3.lean.js deleted file mode 100644 index aaebaccf..00000000 --- a/assets/en_develop_system-build-tools.md.D6vaAwN3.lean.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as s,c as i,o as a,a1 as e}from"./chunks/framework.gjrnbxUT.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}; diff --git a/assets/en_develop_system-build-tools.md.D6vaAwN3.js b/assets/en_develop_system-build-tools.md.DK4AaCy_.js similarity index 52% rename from assets/en_develop_system-build-tools.md.D6vaAwN3.js rename to assets/en_develop_system-build-tools.md.DK4AaCy_.js index 18d2f240..0ac53756 100644 --- a/assets/en_develop_system-build-tools.md.D6vaAwN3.js +++ b/assets/en_develop_system-build-tools.md.DK4AaCy_.js @@ -1,4 +1,4 @@ -import{_ as s,c as i,o as a,a1 as e}from"./chunks/framework.gjrnbxUT.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(`

Compilation Tools

static-php-cli uses many system compilation tools when building static PHP. These tools mainly include:

  • autoconf: used to generate configure scripts.
  • make: used to execute Makefile.
  • cmake: used to execute CMakeLists.txt.
  • pkg-config: Used to find the installation path of dependent libraries.
  • gcc: used to compile C/C++ projects under Linux.
  • clang: used to compile C/C++ projects under macOS.

For Linux and macOS operating systems, these tools can usually be installed through the package manager, which is written in the doctor module. Theoretically we can also compile and download these tools manually, but this will increase the complexity of compilation, so we do not recommend this.

Linux Compilation Tools

For Linux systems, different distributions have different installation methods for compilation tools. And for static compilation, the package management of some distributions cannot install libraries and tools for pure static compilation. Therefore, for the Linux platform and its different distributions, we currently provide a variety of compilation environment preparations.

Glibc Environment

The glibc environment refers to the underlying libc library of the system (that is, the C standard library that all programs written in C language are dynamically linked to) uses glibc, which is the default environment for most distributions. For example: Ubuntu, Debian, CentOS, RHEL, openSUSE, Arch Linux, etc.

In the glibc environment, the package management and compiler we use point to glibc by default, and glibc cannot be statically linked well. One of the reasons it cannot be statically linked is that its network library nss cannot be compiled statically.

For the glibc environment, in static-php-cli and spc in 2.0-RC8 and later, you can choose two ways to build static PHP:

  1. Use Docker to build, you can use bin/spc-alpine-docker to build, it will build an Alpine Linux docker image.
  2. Use bin/spc doctor --auto-fix to install the musl-wrapper and musl-cross-make packages, and then build directly. (Related source code)

Generally speaking, the build results in these two environments are consistent, and you can choose according to actual needs.

In the doctor module, static-php-cli will first detect the current Linux distribution. If the current distribution is a glibc environment, you will be prompted to install the musl-wrapper and musl-cross-make packages.

The process of installing musl-wrapper in the glibc environment is as follows:

  1. Download the specific version of musl-wrapper source code from the musl official website.
  2. Use gcc installed from the package management to compile the musl-wrapper source code and generate musl-libc and other libraries: ./configure --disable-gcc-wrapper && make -j && sudo make install.
  3. The musl-wrapper related libraries will be installed in the /usr/local/musl directory.

The process of installing musl-cross-make in the glibc environment is as follows:

  1. Download the precompiled musl-cross-make compressed package from dl.static-php.dev .
  2. Unzip to the /usr/local/musl directory.

TIP

In the glibc environment, static compilation can be achieved by directly installing musl-wrapper, but musl-wrapper only contains musl-gcc and not musl-g++, which means that C++ code cannot be compiled. So we need musl-cross-make to provide musl-g++.

The reason why the musl-cross-make package cannot be compiled directly locally is that its compilation environment requirements are relatively high (requires more than 36GB of memory, compiled under Alpine Linux), so we provide precompiled binary packages that can be used for all Linux distributions.

At the same time, the package management of some distributions provides musl-wrapper, but musl-cross-make needs to match the corresponding musl-wrapper version, so we do not use package management to install musl-wrapper.

Compiling musl-cross-make will be introduced in the musl-cross-make Toolchain Compilation section of this chapter.

Musl Environment

The musl environment refers to the system's underlying libc library that uses musl, which is a lightweight C standard library that can be well statically linked.

For the currently popular Linux distributions, Alpine Linux uses the musl environment, so static-php-cli can directly build static PHP under Alpine Linux. You only need to install basic compilation tools (such as gcc, cmake, etc.) directly from the package management.

For other distributions, if your distribution uses the musl environment, you can also use static-php-cli to build static PHP directly after installing the necessary compilation tools.

TIP

In the musl environment, static-php-cli will automatically skip the installation of musl-wrapper and musl-cross-make.

Docker Environment

The Docker environment refers to using Docker containers to build static PHP. You can use bin/spc-alpine-docker to build. Before executing this command, you need to install Docker first, and then execute bin/spc-alpine-docker in the project root directory.

After executing bin/spc-alpine-docker, static-php-cli will automatically download the Alpine Linux image and then build a cwcc-spc-x86_64 or cwcc-spc-aarch64 image. Then all build process is performed within this image, which is equivalent to compiling in Alpine Linux.

musl-cross-make Toolchain Compilation

In Linux, although you do not need to manually compile the musl-cross-make tool, if you want to understand its compilation process, you can refer here. Another important reason is that this may not be compiled using automated tools such as CI and Actions, because the existing CI service compilation environment does not meet the compilation requirements of musl-cross-make, and the configuration that meets the requirements is too expensive.

The compilation process of musl-cross-make is as follows:

Prepare an Alpine Linux environment (either directly installed or using Docker). The compilation process requires more than 36GB of memory, so you need to compile on a machine with larger memory. Without this much memory, compilation may fail.

Then write the following content into the config.mak file:

makefile
STAT = -static --static
+import{_ as i,c as a,o as e,af as n}from"./chunks/framework.PeLcR_tw.js";const d=JSON.parse('{"title":"Compilation Tools","description":"","frontmatter":{},"headers":[],"relativePath":"en/develop/system-build-tools.md","filePath":"en/develop/system-build-tools.md"}'),t={name:"en/develop/system-build-tools.md"};function l(o,s,p,h,c,r){return e(),a("div",null,s[0]||(s[0]=[n(`

Compilation Tools

static-php-cli uses many system compilation tools when building static PHP. These tools mainly include:

  • autoconf: used to generate configure scripts.
  • make: used to execute Makefile.
  • cmake: used to execute CMakeLists.txt.
  • pkg-config: Used to find the installation path of dependent libraries.
  • gcc: used to compile C/C++ projects under Linux.
  • clang: used to compile C/C++ projects under macOS.

For Linux and macOS operating systems, these tools can usually be installed through the package manager, which is written in the doctor module. Theoretically we can also compile and download these tools manually, but this will increase the complexity of compilation, so we do not recommend this.

Linux Compilation Tools

For Linux systems, different distributions have different installation methods for compilation tools. And for static compilation, the package management of some distributions cannot install libraries and tools for pure static compilation. Therefore, for the Linux platform and its different distributions, we currently provide a variety of compilation environment preparations.

Glibc Environment

The glibc environment refers to the underlying libc library of the system (that is, the C standard library that all programs written in C language are dynamically linked to) uses glibc, which is the default environment for most distributions. For example: Ubuntu, Debian, CentOS, RHEL, openSUSE, Arch Linux, etc.

In the glibc environment, the package management and compiler we use point to glibc by default, and glibc cannot be statically linked well. One of the reasons it cannot be statically linked is that its network library nss cannot be compiled statically.

For the glibc environment, in static-php-cli and spc in 2.0-RC8 and later, you can choose two ways to build static PHP:

  1. Use Docker to build, you can use bin/spc-alpine-docker to build, it will build an Alpine Linux docker image.
  2. Use bin/spc doctor --auto-fix to install the musl-wrapper and musl-cross-make packages, and then build directly. (Related source code)

Generally speaking, the build results in these two environments are consistent, and you can choose according to actual needs.

In the doctor module, static-php-cli will first detect the current Linux distribution. If the current distribution is a glibc environment, you will be prompted to install the musl-wrapper and musl-cross-make packages.

The process of installing musl-wrapper in the glibc environment is as follows:

  1. Download the specific version of musl-wrapper source code from the musl official website.
  2. Use gcc installed from the package management to compile the musl-wrapper source code and generate musl-libc and other libraries: ./configure --disable-gcc-wrapper && make -j && sudo make install.
  3. The musl-wrapper related libraries will be installed in the /usr/local/musl directory.

The process of installing musl-cross-make in the glibc environment is as follows:

  1. Download the precompiled musl-cross-make compressed package from dl.static-php.dev .
  2. Unzip to the /usr/local/musl directory.

TIP

In the glibc environment, static compilation can be achieved by directly installing musl-wrapper, but musl-wrapper only contains musl-gcc and not musl-g++, which means that C++ code cannot be compiled. So we need musl-cross-make to provide musl-g++.

The reason why the musl-cross-make package cannot be compiled directly locally is that its compilation environment requirements are relatively high (requires more than 36GB of memory, compiled under Alpine Linux), so we provide precompiled binary packages that can be used for all Linux distributions.

At the same time, the package management of some distributions provides musl-wrapper, but musl-cross-make needs to match the corresponding musl-wrapper version, so we do not use package management to install musl-wrapper.

Compiling musl-cross-make will be introduced in the musl-cross-make Toolchain Compilation section of this chapter.

Musl Environment

The musl environment refers to the system's underlying libc library that uses musl, which is a lightweight C standard library that can be well statically linked.

For the currently popular Linux distributions, Alpine Linux uses the musl environment, so static-php-cli can directly build static PHP under Alpine Linux. You only need to install basic compilation tools (such as gcc, cmake, etc.) directly from the package management.

For other distributions, if your distribution uses the musl environment, you can also use static-php-cli to build static PHP directly after installing the necessary compilation tools.

TIP

In the musl environment, static-php-cli will automatically skip the installation of musl-wrapper and musl-cross-make.

Docker Environment

The Docker environment refers to using Docker containers to build static PHP. You can use bin/spc-alpine-docker to build. Before executing this command, you need to install Docker first, and then execute bin/spc-alpine-docker in the project root directory.

After executing bin/spc-alpine-docker, static-php-cli will automatically download the Alpine Linux image and then build a cwcc-spc-x86_64 or cwcc-spc-aarch64 image. Then all build process is performed within this image, which is equivalent to compiling in Alpine Linux.

musl-cross-make Toolchain Compilation

In Linux, although you do not need to manually compile the musl-cross-make tool, if you want to understand its compilation process, you can refer here. Another important reason is that this may not be compiled using automated tools such as CI and Actions, because the existing CI service compilation environment does not meet the compilation requirements of musl-cross-make, and the configuration that meets the requirements is too expensive.

The compilation process of musl-cross-make is as follows:

Prepare an Alpine Linux environment (either directly installed or using Docker). The compilation process requires more than 36GB of memory, so you need to compile on a machine with larger memory. Without this much memory, compilation may fail.

Then write the following content into the config.mak file:

makefile
STAT = -static --static
 FLAG = -g0 -Os -Wno-error
 
 ifneq ($(NATIVE),)
@@ -20,7 +20,7 @@ import{_ as s,c as i,o as a,a1 as e}from"./chunks/framework.gjrnbxUT.js";const g
 GMP_VER = 6.2.1
 MPC_VER = 1.2.1
 MPFR_VER = 4.2.0
-LINUX_VER = 6.1.36

And also you need to add gcc-13.2.0.tar.xz.sha1 file, contents here:

5f95b6d042fb37d45c6cbebfc91decfbc4fb493c  gcc-13.2.0.tar.xz

If you are using Docker to build, create a new Dockerfile file and write the following content:

dockerfile
FROM alpine:edge
+LINUX_VER = 6.1.36

And also you need to add gcc-13.2.0.tar.xz.sha1 file, contents here:

5f95b6d042fb37d45c6cbebfc91decfbc4fb493c  gcc-13.2.0.tar.xz

If you are using Docker to build, create a new Dockerfile file and write the following content:

dockerfile
FROM alpine:edge
 
 RUN apk add --no-cache \\
 gcc g++ git make curl perl \\
@@ -44,7 +44,7 @@ import{_ as s,c as i,o as a,a1 as e}from"./chunks/framework.gjrnbxUT.js";const g
 RUN sed -i 's/poison calloc/poison/g' ./gcc-13.2.0/gcc/system.h
 RUN make TARGET=x86_64-linux-musl -j
 RUN make TARGET=x86_64-linux-musl install -j
-RUN tar cvzf x86_64-musl-toolchain.tgz output/*

If you are using Alpine Linux in a non-Docker environment, you can directly execute the commands in the Dockerfile, for example:

bash
apk add --no-cache \\
+RUN tar cvzf x86_64-musl-toolchain.tgz output/*

If you are using Alpine Linux in a non-Docker environment, you can directly execute the commands in the Dockerfile, for example:

bash
apk add --no-cache \\
 gcc g++ git make curl perl \\
 rsync patch wget libtool \\
 texinfo autoconf automake \\
@@ -65,4 +65,4 @@ import{_ as s,c as i,o as a,a1 as e}from"./chunks/framework.gjrnbxUT.js";const g
 sed -i 's/poison calloc/poison/g' ./gcc-13.2.0/gcc/system.h
 make TARGET=x86_64-linux-musl -j
 make TARGET=x86_64-linux-musl install -j
-tar cvzf x86_64-musl-toolchain.tgz output/*

TIP

All the above scripts are suitable for x86_64 architecture Linux. If you need to build musl-cross-make for the ARM environment, just replace all x86_64 above with aarch64.

This compilation process may fail due to insufficient memory, network problems, etc. You can try a few more times, or use a machine with larger memory to compile. If you encounter problems or you have better improvement solutions, go to Discussion.

macOS Environment

For macOS systems, the main compilation tool we use is clang, which is the default compiler for macOS systems and is also the compiler of Xcode.

Compiling under macOS mainly relies on Xcode or Xcode Command Line Tools. You can download Xcode from the App Store, or execute xcode-select --install in the terminal to install Xcode Command Line Tools.

In addition, in the doctor environment check module, static-php-cli will check whether Homebrew, compilation tools, etc. are installed on the macOS system. If not, you will be prompted to install them. I will not go into details here.

FreeBSD Environment

FreeBSD is also a Unix system, and its compilation tools are similar to macOS. You can directly use the package management pkg to install clang and other compilation tools through the doctor command.

pkg-config Compilation (*nix only)

If you observe the compilation log when using static-php-cli to build static PHP, you will find that no matter what is compiled, pkg-config will be compiled first. This is because pkg-config is a library used to find dependencies. In earlier versions of static-php-cli, we directly used the pkg-config tool installed by package management, but this would cause some problems, such as:

  • Even if PKG_CONFIG_PATH is specified, pkg-config will try to find dependent packages from the system path.
  • Since pkg-config will look for dependent packages from the system path, if a dependent package with the same name exists in the system, compilation may fail.

In order to avoid the above problems, we compile pkg-config into buildroot/bin in user mode and use it. We use parameters such as --without-sysroot to avoid looking for dependent packages from the system path.

`,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}; +tar cvzf x86_64-musl-toolchain.tgz output/*

TIP

All the above scripts are suitable for x86_64 architecture Linux. If you need to build musl-cross-make for the ARM environment, just replace all x86_64 above with aarch64.

This compilation process may fail due to insufficient memory, network problems, etc. You can try a few more times, or use a machine with larger memory to compile. If you encounter problems or you have better improvement solutions, go to Discussion.

macOS Environment

For macOS systems, the main compilation tool we use is clang, which is the default compiler for macOS systems and is also the compiler of Xcode.

Compiling under macOS mainly relies on Xcode or Xcode Command Line Tools. You can download Xcode from the App Store, or execute xcode-select --install in the terminal to install Xcode Command Line Tools.

In addition, in the doctor environment check module, static-php-cli will check whether Homebrew, compilation tools, etc. are installed on the macOS system. If not, you will be prompted to install them. I will not go into details here.

FreeBSD Environment

FreeBSD is also a Unix system, and its compilation tools are similar to macOS. You can directly use the package management pkg to install clang and other compilation tools through the doctor command.

pkg-config Compilation (*nix only)

If you observe the compilation log when using static-php-cli to build static PHP, you will find that no matter what is compiled, pkg-config will be compiled first. This is because pkg-config is a library used to find dependencies. In earlier versions of static-php-cli, we directly used the pkg-config tool installed by package management, but this would cause some problems, such as:

  • Even if PKG_CONFIG_PATH is specified, pkg-config will try to find dependent packages from the system path.
  • Since pkg-config will look for dependent packages from the system path, if a dependent package with the same name exists in the system, compilation may fail.

In order to avoid the above problems, we compile pkg-config into buildroot/bin in user mode and use it. We use parameters such as --without-sysroot to avoid looking for dependent packages from the system path.

`,50)]))}const m=i(t,[["render",l]]);export{d as __pageData,m as default}; diff --git a/assets/en_develop_system-build-tools.md.DK4AaCy_.lean.js b/assets/en_develop_system-build-tools.md.DK4AaCy_.lean.js new file mode 100644 index 00000000..a3df1311 --- /dev/null +++ b/assets/en_develop_system-build-tools.md.DK4AaCy_.lean.js @@ -0,0 +1 @@ +import{_ as i,c as a,o as e,af as n}from"./chunks/framework.PeLcR_tw.js";const d=JSON.parse('{"title":"Compilation Tools","description":"","frontmatter":{},"headers":[],"relativePath":"en/develop/system-build-tools.md","filePath":"en/develop/system-build-tools.md"}'),t={name:"en/develop/system-build-tools.md"};function l(o,s,p,h,c,r){return e(),a("div",null,s[0]||(s[0]=[n("",50)]))}const m=i(t,[["render",l]]);export{d as __pageData,m as default}; diff --git a/assets/en_faq_index.md.3yHOajzp.js b/assets/en_faq_index.md.3yHOajzp.js new file mode 100644 index 00000000..08eb5dbf --- /dev/null +++ b/assets/en_faq_index.md.3yHOajzp.js @@ -0,0 +1,5 @@ +import{_ as i,c as s,o,af as t}from"./chunks/framework.PeLcR_tw.js";const u=JSON.parse('{"title":"FAQ","description":"","frontmatter":{},"headers":[],"relativePath":"en/faq/index.md","filePath":"en/faq/index.md"}'),a={name:"en/faq/index.md"};function n(l,e,r,c,d,p){return o(),s("div",null,e[0]||(e[0]=[t(`

FAQ

Here will be some questions that you may encounter easily. There are currently many, but I need to take time to organize them.

What is the path of php.ini ?

On Linux, macOS and FreeBSD, the path of php.ini is /usr/local/etc/php/php.ini. On Windows, the path is C:\\windows\\php.ini or the current directory of php.exe. The directory where to look for php.ini can be changed on *nix using the manual build option --with-config-file-path.

In addition, on Linux, macOS and FreeBSD, .ini files present in the /usr/local/etc/php/conf.d directory will also be loaded. On Windows, this path is empty by default. The directory can be changed using the manual build option --with-config-file-scan-dir.

php.ini will also be searched for in the other standard locations.

Can statically-compiled PHP install extensions?

Because the principle of installing PHP extensions under the normal mode is to use .so type dynamic link library to install new extensions, and we use the static link PHP compiled by this project. However, static linking has different definitions in different operating systems.

First of all, for Linux systems, statically linked binaries will not link the system's dynamic link library. Purely statically linked binaries (build with -all-static) cannot load dynamic libraries, so new extensions cannot be added. At the same time, in pure static mode, you cannot use extensions such as ffi to load external .so modules.

You can use the command ldd buildroot/bin/php to check whether the binary you built under Linux is purely statically linked.

If you build GNU libc based PHP, you can use the ffi extension to load external .so modules and load .so extensions with the same ABI.

For example, you can use the following command to build a static PHP binary dynamically linked with glibc, supporting FFI extensions and loading the xdebug.so extension of the same PHP version and the same TS type:

bash
bin/spc-gnu-docker download --for-extensions=ffi,xml --with-php=8.4
+bin/spc-gnu-docker build ffi,xml --build-cli --debug
+
+buildroot/bin/php -d "zend_extension=/path/to/php{PHP_VER}-{ts/nts}/xdebug.so" --ri xdebug

For macOS platform, almost all binaries under macOS cannot be truly purely statically linked, and almost all binaries will link macOS system libraries: /usr/lib/libresolv.9.dylib and /usr/lib/libSystem.B.dylib. So on macOS, you can use statically compiled PHP binaries under certain compilation conditions, and dynamically linked extensions:

  1. Using the --no-strip parameter will not strip information such as debugging symbols from the binary file for use with external Zend extensions such as Xdebug.
  2. If you want to compile some Zend extensions, use Homebrew, MacPorts, source code compilation, and install a normal version of PHP on your operating system.
  3. Use the phpize && ./configure && make command to compile the extensions you want to use.
  4. Copy the extension file xxxx.so to the outside, use the statically compiled PHP binary, for example to use the Xdebug extension: cd buildroot/bin/ && ./php -d "zend_extension=/path/to/xdebug.so".
bash
# build statically linked php-cli but not stripped
+bin/spc build ffi --build-cli --no-strip

Can it support Oracle database extension?

Some extensions that rely on closed source libraries, such as oci8, sourceguardian, etc., they do not provide purely statically compiled dependent library files (.a), only dynamic dependent library files (.so). These extensions cannot be compiled into static-php-cli using source code, so this project may never support these extensions. However, in theory you can access and use such extensions under macOS and Linux according to the above questions.

If you have a need for such extensions, or most people have needs for these closed-source extensions, see the discussion on standalone-php-cli. Welcome to leave a message.

Does it support Windows?

The project currently supports Windows, but the number of supported extensions is small. Windows support is not perfect. There are mainly the following problems:

  1. The compilation process of Windows is different from that of *nix, and the toolchain used is also different. The compilation tools used to compile the dependent libraries of each extension are almost completely different.
  2. The demand for the Windows version will also be advanced based on the needs of all people who use this project. If many people need it, I will support related extensions as soon as possible.

Can I protect my source code with micro?

You can't. micro.sfx is essentially combining php and php code into one file, there is no process of compiling or encrypting the PHP code.

First of all, php-src is the official interpreter of PHP code, and there is no PHP compiler compatible with mainstream branches on the market. I saw on the Internet that there is a project called BPC (Binary PHP Compiler?) that can compile PHP into binary, but there are many restrictions.

The direction of encrypting and protecting the code is not the same as compiling. After compiling, the code can also be obtained through reverse engineering and other methods. The real protection is still carried out by means of packing and encrypting the code.

Therefore, this project (static-php-cli) and related projects (lwmbs, swoole-cli) all provide a convenient compilation tool for php-src source code. The phpmicro referenced by this project and related projects is only a package of PHP's sapi interface, not a compilation tool for PHP code. The compiler for PHP code is a completely different project, so the extra cases are not taken into account. If you are interested in encryption, you can consider using existing encryption technologies, such as Swoole Compiler, Source Guardian, etc.

Unable to use ssl

Update: This issue has been fixed in the latest version of static-php-cli, which now reads the system's certificate file by default. If you still have problems, try the solution below.

When using curl, pgsql, etc. to request an HTTPS website or establish an SSL connection, there may be an error:80000002:system library::No such file or directory error. This error is caused by statically compiled PHP without specifying openssl.cafile via php.ini.

You can solve this problem by specifying php.ini before using PHP and adding openssl.cafile=/path/to/your-cert.pem in the INI.

For Linux systems, you can download the cacert.pem file from the curl official website, or you can use the certificate file that comes with the system. For the certificate locations of different distros, please refer to Golang docs.

INI configuration openssl.cafile cannot be set dynamically using the ini_set() function, because openssl.cafile is a PHP_INI_SYSTEM type configuration and can only be set in the php.ini file.

Why don't we support older versions of PHP?

Because older versions of PHP have many problems, such as security issues, performance issues, and functional issues. In addition, many older versions of PHP are not compatible with the latest dependency libraries, which is one of the reasons why older versions of PHP are not supported.

You can use older versions compiled earlier by static-php-cli, such as PHP 8.0, but earlier versions will not be explicitly supported.

`,36)]))}const m=i(a,[["render",n]]);export{u as __pageData,m as default}; diff --git a/assets/en_faq_index.md.3yHOajzp.lean.js b/assets/en_faq_index.md.3yHOajzp.lean.js new file mode 100644 index 00000000..8eec863f --- /dev/null +++ b/assets/en_faq_index.md.3yHOajzp.lean.js @@ -0,0 +1 @@ +import{_ as i,c as s,o,af as t}from"./chunks/framework.PeLcR_tw.js";const u=JSON.parse('{"title":"FAQ","description":"","frontmatter":{},"headers":[],"relativePath":"en/faq/index.md","filePath":"en/faq/index.md"}'),a={name:"en/faq/index.md"};function n(l,e,r,c,d,p){return o(),s("div",null,e[0]||(e[0]=[t("",36)]))}const m=i(a,[["render",n]]);export{u as __pageData,m as default}; diff --git a/assets/en_faq_index.md.Dk3Q4ZlV.js b/assets/en_faq_index.md.Dk3Q4ZlV.js deleted file mode 100644 index 10b78767..00000000 --- a/assets/en_faq_index.md.Dk3Q4ZlV.js +++ /dev/null @@ -1,5 +0,0 @@ -import{_ as e,c as i,o,a1 as s}from"./chunks/framework.gjrnbxUT.js";const f=JSON.parse('{"title":"FAQ","description":"","frontmatter":{},"headers":[],"relativePath":"en/faq/index.md","filePath":"en/faq/index.md"}'),t={name:"en/faq/index.md"},a=s(`

FAQ

Here will be some questions that you may encounter easily. There are currently many, but I need to take time to organize them.

What is the path of php.ini ?

On Linux, macOS and FreeBSD, the path of php.ini is /usr/local/etc/php/php.ini. On Windows, the path is C:\\windows\\php.ini or the current directory of php.exe. The directory where to look for php.ini can be changed on *nix using the manual build option --with-config-file-path.

In addition, on Linux, macOS and FreeBSD, .ini files present in the /usr/local/etc/php/conf.d directory will also be loaded. On Windows, this path is empty by default. The directory can be changed using the manual build option --with-config-file-scan-dir.

php.ini will also be searched for in the other standard locations.

Can statically-compiled PHP install extensions?

Because the principle of installing PHP extensions under the normal mode is to use .so type dynamic link library to install new extensions, and we use the static link PHP compiled by this project. However, static linking has different definitions in different operating systems.

First of all, for Linux systems, statically linked binaries will not link the system's dynamic link library. Purely statically linked binaries (build with -all-static) cannot load dynamic libraries, so new extensions cannot be added. At the same time, in pure static mode, you cannot use extensions such as ffi to load external .so modules.

You can use the command ldd buildroot/bin/php to check whether the binary you built under Linux is purely statically linked.

If you build GNU libc based PHP, you can use the ffi extension to load external .so modules and load .so extensions with the same ABI.

For example, you can use the following command to build a static PHP binary dynamically linked with glibc, supporting FFI extensions and loading the xdebug.so extension of the same PHP version and the same TS type:

bash
bin/spc-gnu-docker download --for-extensions=ffi,xml --with-php=8.4
-bin/spc-gnu-docker build ffi,xml --build-cli --debug
-
-buildroot/bin/php -d "zend_extension=/path/to/php{PHP_VER}-{ts/nts}/xdebug.so" --ri xdebug

For macOS platform, almost all binaries under macOS cannot be truly purely statically linked, and almost all binaries will link macOS system libraries: /usr/lib/libresolv.9.dylib and /usr/lib/libSystem.B.dylib. So on macOS, you can use statically compiled PHP binaries under certain compilation conditions, and dynamically linked extensions:

  1. Using the --no-strip parameter will not strip information such as debugging symbols from the binary file for use with external Zend extensions such as Xdebug.
  2. If you want to compile some Zend extensions, use Homebrew, MacPorts, source code compilation, and install a normal version of PHP on your operating system.
  3. Use the phpize && ./configure && make command to compile the extensions you want to use.
  4. Copy the extension file xxxx.so to the outside, use the statically compiled PHP binary, for example to use the Xdebug extension: cd buildroot/bin/ && ./php -d "zend_extension=/path/to/xdebug.so".
bash
# build statically linked php-cli but not stripped
-bin/spc build ffi --build-cli --no-strip

Can it support Oracle database extension?

Some extensions that rely on closed source libraries, such as oci8, sourceguardian, etc., they do not provide purely statically compiled dependent library files (.a), only dynamic dependent library files (.so). These extensions cannot be compiled into static-php-cli using source code, so this project may never support these extensions. However, in theory you can access and use such extensions under macOS and Linux according to the above questions.

If you have a need for such extensions, or most people have needs for these closed-source extensions, see the discussion on standalone-php-cli. Welcome to leave a message.

Does it support Windows?

The project currently supports Windows, but the number of supported extensions is small. Windows support is not perfect. There are mainly the following problems:

  1. The compilation process of Windows is different from that of *nix, and the toolchain used is also different. The compilation tools used to compile the dependent libraries of each extension are almost completely different.
  2. The demand for the Windows version will also be advanced based on the needs of all people who use this project. If many people need it, I will support related extensions as soon as possible.

Can I protect my source code with micro?

You can't. micro.sfx is essentially combining php and php code into one file, there is no process of compiling or encrypting the PHP code.

First of all, php-src is the official interpreter of PHP code, and there is no PHP compiler compatible with mainstream branches on the market. I saw on the Internet that there is a project called BPC (Binary PHP Compiler?) that can compile PHP into binary, but there are many restrictions.

The direction of encrypting and protecting the code is not the same as compiling. After compiling, the code can also be obtained through reverse engineering and other methods. The real protection is still carried out by means of packing and encrypting the code.

Therefore, this project (static-php-cli) and related projects (lwmbs, swoole-cli) all provide a convenient compilation tool for php-src source code. The phpmicro referenced by this project and related projects is only a package of PHP's sapi interface, not a compilation tool for PHP code. The compiler for PHP code is a completely different project, so the extra cases are not taken into account. If you are interested in encryption, you can consider using existing encryption technologies, such as Swoole Compiler, Source Guardian, etc.

Unable to use ssl

Update: This issue has been fixed in the latest version of static-php-cli, which now reads the system's certificate file by default. If you still have problems, try the solution below.

When using curl, pgsql, etc. to request an HTTPS website or establish an SSL connection, there may be an error:80000002:system library::No such file or directory error. This error is caused by statically compiled PHP without specifying openssl.cafile via php.ini.

You can solve this problem by specifying php.ini before using PHP and adding openssl.cafile=/path/to/your-cert.pem in the INI.

For Linux systems, you can download the cacert.pem file from the curl official website, or you can use the certificate file that comes with the system. For the certificate locations of different distros, please refer to Golang docs.

INI configuration openssl.cafile cannot be set dynamically using the ini_set() function, because openssl.cafile is a PHP_INI_SYSTEM type configuration and can only be set in the php.ini file.

Why don't we support older versions of PHP?

Because older versions of PHP have many problems, such as security issues, performance issues, and functional issues. In addition, many older versions of PHP are not compatible with the latest dependency libraries, which is one of the reasons why older versions of PHP are not supported.

You can use older versions compiled earlier by static-php-cli, such as PHP 8.0, but earlier versions will not be explicitly supported.

`,36),n=[a];function l(r,c,d,p,h,u){return o(),i("div",null,n)}const y=e(t,[["render",l]]);export{f as __pageData,y as default}; diff --git a/assets/en_faq_index.md.Dk3Q4ZlV.lean.js b/assets/en_faq_index.md.Dk3Q4ZlV.lean.js deleted file mode 100644 index cdf6056d..00000000 --- a/assets/en_faq_index.md.Dk3Q4ZlV.lean.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as e,c as i,o,a1 as s}from"./chunks/framework.gjrnbxUT.js";const f=JSON.parse('{"title":"FAQ","description":"","frontmatter":{},"headers":[],"relativePath":"en/faq/index.md","filePath":"en/faq/index.md"}'),t={name:"en/faq/index.md"},a=s("",36),n=[a];function l(r,c,d,p,h,u){return o(),i("div",null,n)}const y=e(t,[["render",l]]);export{f as __pageData,y as default}; diff --git a/assets/en_guide_action-build.md.BCJvLz8l.js b/assets/en_guide_action-build.md.BCJvLz8l.js new file mode 100644 index 00000000..3a79cab9 --- /dev/null +++ b/assets/en_guide_action-build.md.BCJvLz8l.js @@ -0,0 +1 @@ +import{_ as t,c as o,o as i,af as n}from"./chunks/framework.PeLcR_tw.js";const h=JSON.parse('{"title":"GitHub Action Build","description":"","frontmatter":{},"headers":[],"relativePath":"en/guide/action-build.md","filePath":"en/guide/action-build.md"}'),a={name:"en/guide/action-build.md"};function l(r,e,s,c,d,u){return i(),o("div",null,e[0]||(e[0]=[n('

GitHub Action Build

Action Build refers to compiling directly using GitHub Action.

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:Enter.

Self-hosted binaries are also built from Actions: repo. 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

Build Guide

Using GitHub Action makes it easy to build a statically compiled PHP and phpmicro, while also defining the extensions to compile.

  1. Fork project.
  2. Go to the Actions of the project and select CI.
  3. Select Run workflow, fill in the PHP version you want to compile, the target type, and the list of extensions. (extensions comma separated, e.g. bcmath,curl,mbstring)
  4. After waiting for about a period of time, enter the corresponding task and get Artifacts.

If you enable debug, all logs will be output at build time, including compiled logs, for troubleshooting.

If you need to build in other environments, you can use manual build.

Extensions

You can go to extensions check here to see if all the extensions you need currently support. and then go to command generator select the extension you need to compile, copy the extensions string to extensions option.

',11)]))}const m=t(a,[["render",l]]);export{h as __pageData,m as default}; diff --git a/assets/en_guide_action-build.md.BCJvLz8l.lean.js b/assets/en_guide_action-build.md.BCJvLz8l.lean.js new file mode 100644 index 00000000..3afca8e2 --- /dev/null +++ b/assets/en_guide_action-build.md.BCJvLz8l.lean.js @@ -0,0 +1 @@ +import{_ as t,c as o,o as i,af as n}from"./chunks/framework.PeLcR_tw.js";const h=JSON.parse('{"title":"GitHub Action Build","description":"","frontmatter":{},"headers":[],"relativePath":"en/guide/action-build.md","filePath":"en/guide/action-build.md"}'),a={name:"en/guide/action-build.md"};function l(r,e,s,c,d,u){return i(),o("div",null,e[0]||(e[0]=[n("",11)]))}const m=t(a,[["render",l]]);export{h as __pageData,m as default}; diff --git a/assets/en_guide_action-build.md.BKamBazh.js b/assets/en_guide_action-build.md.BKamBazh.js deleted file mode 100644 index 761700a6..00000000 --- a/assets/en_guide_action-build.md.BKamBazh.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as e,c as t,o,a1 as i}from"./chunks/framework.gjrnbxUT.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('

GitHub Action Build

Action Build refers to compiling directly using GitHub Action.

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:Enter.

Self-hosted binaries are also built from Actions: repo. 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

Build Guide

Using GitHub Action makes it easy to build a statically compiled PHP and phpmicro, while also defining the extensions to compile.

  1. Fork project.
  2. Go to the Actions of the project and select CI.
  3. Select Run workflow, fill in the PHP version you want to compile, the target type, and the list of extensions. (extensions comma separated, e.g. bcmath,curl,mbstring)
  4. After waiting for about a period of time, enter the corresponding task and get Artifacts.

If you enable debug, all logs will be output at build time, including compiled logs, for troubleshooting.

If you need to build in other environments, you can use manual build.

Extensions

You can go to extensions check here to see if all the extensions you need currently support. and then go to command generator select the extension you need to compile, copy the extensions string to extensions option.

',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}; diff --git a/assets/en_guide_action-build.md.BKamBazh.lean.js b/assets/en_guide_action-build.md.BKamBazh.lean.js deleted file mode 100644 index 8c6bbb2a..00000000 --- a/assets/en_guide_action-build.md.BKamBazh.lean.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as e,c as t,o,a1 as i}from"./chunks/framework.gjrnbxUT.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}; diff --git a/assets/en_guide_build-on-windows.md.0XosmiyO.js b/assets/en_guide_build-on-windows.md.0XosmiyO.js deleted file mode 100644 index 0b45e4d4..00000000 --- a/assets/en_guide_build-on-windows.md.0XosmiyO.js +++ /dev/null @@ -1,23 +0,0 @@ -import{_ as e,c as i,o as s,a1 as a}from"./chunks/framework.gjrnbxUT.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(`

Build on Windows

Because the Windows system is an NT kernel, the compilation tools and operating system interfaces used by Unix-like operating systems are almost completely different, so the build process on Windows will be slightly different from that of Unix systems.

GitHub Actions Build

Building the Windows version of static-php from Actions is now supported. Like Linux and macOS, you need to Fork the static-php-cli repository to your GitHub account first, then you can enter Extension List to select the extension to be compiled, and then go to your own CI on Windows select the PHP version, fill in the extension list (comma separated), and click Run.

If you're going to develop or build locally, please read on.

Requirements

The tools required to build static PHP on Windows are the same as PHP's official Windows build tools. You can read Official Documentation.

To sum up, you need the following environment and tools:

  • Windows 10/11 (requires build 17063 or later)
  • Visual Studio 2019/2022 (recommended 2022)
  • C++ desktop development for Visual Studio
  • Git for Windows
  • php-sdk-binary-tools (can be installed automatically using doctor)
  • strawberry-perl (can be installed automatically using doctor)
  • nasm (can be installed automatically using doctor)

TIP

The construction of static-php-cli on Windows refers to using MSVC to build PHP and is not based on MinGW, Cygwin, WSL and other environments.

If you prefer to use WSL, please refer to the chapter on Building on Linux.

After installing Visual Studio and selecting the C++ desktop development workload, you may download about 8GB of compilation tools, and the download speed depends on your network conditions.

Install Git

Git for Windows can be downloaded and installed from here Standalone Installer 64-bit version, installed in the default location (C:\\Program Files\\Git\\). If you don't want to download and install manually, you can also use Visual Studio Installer and check Git in the Individual component tab.

Prepare static-php-cli

Downloading the static-php-cli project is very simple, just use git clone. It is recommended to place the project in C:\\spc-build\\ or a similar directory. It is best not to have spaces in the path.

shell
mkdir "C:\\spc-build"
-cd C:\\spc-build
-git clone https://github.com/crazywhalecc/static-php-cli.git
-cd static-php-cli

It is a bit strange that static-php-cli itself requires a PHP environment, but now you can quickly install the PHP environment through a script. Generally, your computer will not have the Windows version of PHP installed, so we recommend that you use bin/setup-runtime directly after downloading static-php-cli to install PHP and Composer in the current directory.

shell
# Install PHP and Composer to the ./runtime/ directory
-bin/setup-runtime
-
-# After installation, if you need to use PHP and Composer in global commands, 
-# use the following command to add the runtime/ directory to PATH
-bin/setup-runtime -action add-path
-
-# Delete the runtime/ directory in PATH
-bin/setup-runtime -action remove-path

Finally, now that you have PHP and Composer installed, you need to install static-php-cli's Composer dependencies:

shell
composer install

Install other Tools (automatic)

For php-sdk-binary-tools, strawberry-perl, and nasm, we recommend that you directly use the command bin/spc doctor to check and install them.

If doctor successfully installs automatically, please skip the steps below to manually install the above tools.

But if the automatic installation fails, please refer to the manual installation method below.

Install php-sdk-binary-tools (manual)

shell
cd C:\\spc-build\\static-php-cli
-git clone https://github.com/php/php-sdk-binary-tools.git

You can also set the global variable PHP_SDK_PATH in Windows settings and clone the project to the path corresponding to the variable. Under normal circumstances, you don't need to change it.

Install strawberry-perl (manual)

If you don't need to compile the openssl extension, you don't need to install perl.

  1. Download the latest version of strawberry-perl from GitHub.
  2. Install to the C:\\spc-build\\static-php-cli\\pkgroot\\perl\\ directory.

You can download the -portable version and extract it directly to the above directory. The last perl.exe should be located at C:\\spc-build\\static-php-cli\\pkgroot\\perl\\perl\\bin\\perl.exe.

Install nasm (manual)

If you don't need to compile openssl extension, you don't need to install nasm.

  1. Download the nasm tool (x64) from official website.
  2. Place nasm.exe and ndisasm.exe in the C:\\spc-build\\static-php-cli\\php-sdk-binary-tools\\bin\\ directory.

Download required sources

Same as Manual build - Download

Build PHP

Use the build command to start building the static php binary. Before executing the bin/spc build command, be sure to use the download command to download sources. It is recommended to use doctor to check the environment.

Build SAPI

You need to go to Extension List or Command Generator to select the extension you want to add, and then use the command bin/spc build to compile. You need to specify targets, choose from the following parameters (at least one):

  • --build-cli: Build a cli sapi (command line interface, which can execute PHP code on the command line)
  • --build-micro: Build a micro sapi (used to build a standalone executable binary containing PHP code)
shell
# Compile PHP with bcmath,openssl,zlib extensions, the compilation target is cli
-bin/spc build "bcmath,openssl,zlib" --build-cli
-
-# Compile PHP with phar,curl,posix,pcntl,tokenizer extensions, compile target is micro and cli
-bin/spc build "bcmath,openssl,zlib" --build-micro --build-cli

WARNING

In Windows, it is best to use double quotes to wrap parameters containing commas, such as "bcmath,openssl,mbstring".

Debug

If you encounter problems during the compilation process, or want to view each executing shell command, you can use --debug to enable debug mode and view all terminal logs:

shell
bin/spc build "openssl" --build-cli --debug

Build Options

During the compilation process, in some special cases, the compiler and the content of the compilation directory need to be intervened. You can try to use the following commands:

  • --with-clean: clean up old make files before compiling PHP
  • --enable-zts: Make compiled PHP thread-safe version (default is NTS version)
  • --with-libs=XXX,YYY: Compile the specified dependent library before compiling PHP, and activate some extension optional functions
  • --with-config-file-scan-dir=XXX: Set the directory to scan for .ini files after reading php.ini (Check here for default paths)
  • -I xxx=yyy: Hard compile INI options into PHP before compiling (support multiple options, alias is --with-hardcoded-ini)
  • --with-micro-fake-cli: When compiling micro, let micro's PHP_SAPI pretend to be cli (for compatibility with some programs that check PHP_SAPI)
  • --disable-opcache-jit: Disable opcache jit (enabled by default)
  • --without-micro-ext-test: After building micro.sfx, do not test the running results of different extensions in micro.sfx
  • --with-suggested-exts: Add ext-suggests as dependencies when compiling
  • --with-suggested-libs: Add lib-suggests as dependencies when compiling
  • --with-upx-pack: Use UPX to reduce the size of the binary file after compilation (you need to use bin/spc install-pkg upx to install upx first)
  • --with-micro-logo=XXX.ico: Customize the icon of the exe executable file after customizing the micro build (in the format of .ico)

Here is a simple example where we preset a larger memory_limit and disable the system function:

shell
bin/spc build "bcmath,openssl" --build-cli -I "memory_limit=4G" -I "disable_functions=system"

Another example: Customize our hello-world.exe program logo:

shell
bin/spc build "ffi,bcmath" --build-micro --with-micro-logo=mylogo.ico --debug
-bin/spc micro:combine hello.php
-# Then we got \`my-app.exe\` with custom logo!
-my-app.exe

Use php.exe

After php.exe is compiled, it is located in the buildroot\\bin\\ directory. You can copy it to any location for use.

shell
.\\php -v

Use micro.sfx

phpmicro is a SelF-extracted eXecutable SAPI module, provided by phpmicro project. But this project is using a fork of phpmicro, because we need to add some features to it. It can put php runtime and your source code together.

The final compilation result will output a file named ./micro.sfx, which needs to be used with your PHP source code like code.php. This file will be located in the path buildroot/bin/micro.sfx.

Prepare your project source code, which can be a single PHP file or a Phar file, for use.

If you want to combine phar files, you must add phar extension when compiling!

shell
# code.php "<?php echo 'Hello world' . PHP_EOL;"
-bin/spc micro:combine code.php -O my-app.exe
-# Run it!!! Copy it to another computer!!!
-./my-app.exe

If you package a PHAR file, just replace code.php with the phar file path. You can use box-project/box to package your CLI project as Phar, It is then combined with phpmicro to produce a standalone executable binary.

For more details on the micro:combine command, refer to command on Unix systems.

`,64),l=[o];function n(p,d,h,c,r,u){return s(),i("div",null,l)}const b=e(t,[["render",n]]);export{m as __pageData,b as default}; diff --git a/assets/en_guide_build-on-windows.md.0XosmiyO.lean.js b/assets/en_guide_build-on-windows.md.0XosmiyO.lean.js deleted file mode 100644 index 6246bdfc..00000000 --- a/assets/en_guide_build-on-windows.md.0XosmiyO.lean.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as e,c as i,o as s,a1 as a}from"./chunks/framework.gjrnbxUT.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("",64),l=[o];function n(p,d,h,c,r,u){return s(),i("div",null,l)}const b=e(t,[["render",n]]);export{m as __pageData,b as default}; diff --git a/assets/en_guide_build-on-windows.md.CG23CkLK.js b/assets/en_guide_build-on-windows.md.CG23CkLK.js new file mode 100644 index 00000000..2d12bbab --- /dev/null +++ b/assets/en_guide_build-on-windows.md.CG23CkLK.js @@ -0,0 +1,23 @@ +import{_ as e,c as s,o as a,af as t}from"./chunks/framework.PeLcR_tw.js";const k=JSON.parse('{"title":"Build on Windows","description":"","frontmatter":{},"headers":[],"relativePath":"en/guide/build-on-windows.md","filePath":"en/guide/build-on-windows.md"}'),l={name:"en/guide/build-on-windows.md"};function o(n,i,h,d,r,p){return a(),s("div",null,i[0]||(i[0]=[t(`

Build on Windows

Because the Windows system is an NT kernel, the compilation tools and operating system interfaces used by Unix-like operating systems are almost completely different, so the build process on Windows will be slightly different from that of Unix systems.

GitHub Actions Build

Building the Windows version of static-php from Actions is now supported. Like Linux and macOS, you need to Fork the static-php-cli repository to your GitHub account first, then you can enter Extension List to select the extension to be compiled, and then go to your own CI on Windows select the PHP version, fill in the extension list (comma separated), and click Run.

If you're going to develop or build locally, please read on.

Requirements

The tools required to build static PHP on Windows are the same as PHP's official Windows build tools. You can read Official Documentation.

To sum up, you need the following environment and tools:

  • Windows 10/11 (requires build 17063 or later)
  • Visual Studio 2019/2022 (recommended 2022)
  • C++ desktop development for Visual Studio
  • Git for Windows
  • php-sdk-binary-tools (can be installed automatically using doctor)
  • strawberry-perl (can be installed automatically using doctor)
  • nasm (can be installed automatically using doctor)

TIP

The construction of static-php-cli on Windows refers to using MSVC to build PHP and is not based on MinGW, Cygwin, WSL and other environments.

If you prefer to use WSL, please refer to the chapter on Building on Linux.

After installing Visual Studio and selecting the C++ desktop development workload, you may download about 8GB of compilation tools, and the download speed depends on your network conditions.

Install Git

Git for Windows can be downloaded and installed from here Standalone Installer 64-bit version, installed in the default location (C:\\Program Files\\Git\\). If you don't want to download and install manually, you can also use Visual Studio Installer and check Git in the Individual component tab.

Prepare static-php-cli

Downloading the static-php-cli project is very simple, just use git clone. It is recommended to place the project in C:\\spc-build\\ or a similar directory. It is best not to have spaces in the path.

shell
mkdir "C:\\spc-build"
+cd C:\\spc-build
+git clone https://github.com/crazywhalecc/static-php-cli.git
+cd static-php-cli

It is a bit strange that static-php-cli itself requires a PHP environment, but now you can quickly install the PHP environment through a script. Generally, your computer will not have the Windows version of PHP installed, so we recommend that you use bin/setup-runtime directly after downloading static-php-cli to install PHP and Composer in the current directory.

shell
# Install PHP and Composer to the ./runtime/ directory
+bin/setup-runtime
+
+# After installation, if you need to use PHP and Composer in global commands, 
+# use the following command to add the runtime/ directory to PATH
+bin/setup-runtime -action add-path
+
+# Delete the runtime/ directory in PATH
+bin/setup-runtime -action remove-path

Finally, now that you have PHP and Composer installed, you need to install static-php-cli's Composer dependencies:

shell
composer install

Install other Tools (automatic)

For php-sdk-binary-tools, strawberry-perl, and nasm, we recommend that you directly use the command bin/spc doctor to check and install them.

If doctor successfully installs automatically, please skip the steps below to manually install the above tools.

But if the automatic installation fails, please refer to the manual installation method below.

Install php-sdk-binary-tools (manual)

shell
cd C:\\spc-build\\static-php-cli
+git clone https://github.com/php/php-sdk-binary-tools.git

You can also set the global variable PHP_SDK_PATH in Windows settings and clone the project to the path corresponding to the variable. Under normal circumstances, you don't need to change it.

Install strawberry-perl (manual)

If you don't need to compile the openssl extension, you don't need to install perl.

  1. Download the latest version of strawberry-perl from GitHub.
  2. Install to the C:\\spc-build\\static-php-cli\\pkgroot\\perl\\ directory.

You can download the -portable version and extract it directly to the above directory. The last perl.exe should be located at C:\\spc-build\\static-php-cli\\pkgroot\\perl\\perl\\bin\\perl.exe.

Install nasm (manual)

If you don't need to compile openssl extension, you don't need to install nasm.

  1. Download the nasm tool (x64) from official website.
  2. Place nasm.exe and ndisasm.exe in the C:\\spc-build\\static-php-cli\\php-sdk-binary-tools\\bin\\ directory.

Download required sources

Same as Manual build - Download

Build PHP

Use the build command to start building the static php binary. Before executing the bin/spc build command, be sure to use the download command to download sources. It is recommended to use doctor to check the environment.

Build SAPI

You need to go to Extension List or Command Generator to select the extension you want to add, and then use the command bin/spc build to compile. You need to specify targets, choose from the following parameters (at least one):

  • --build-cli: Build a cli sapi (command line interface, which can execute PHP code on the command line)
  • --build-micro: Build a micro sapi (used to build a standalone executable binary containing PHP code)
shell
# Compile PHP with bcmath,openssl,zlib extensions, the compilation target is cli
+bin/spc build "bcmath,openssl,zlib" --build-cli
+
+# Compile PHP with phar,curl,posix,pcntl,tokenizer extensions, compile target is micro and cli
+bin/spc build "bcmath,openssl,zlib" --build-micro --build-cli

WARNING

In Windows, it is best to use double quotes to wrap parameters containing commas, such as "bcmath,openssl,mbstring".

Debug

If you encounter problems during the compilation process, or want to view each executing shell command, you can use --debug to enable debug mode and view all terminal logs:

shell
bin/spc build "openssl" --build-cli --debug

Build Options

During the compilation process, in some special cases, the compiler and the content of the compilation directory need to be intervened. You can try to use the following commands:

  • --with-clean: clean up old make files before compiling PHP
  • --enable-zts: Make compiled PHP thread-safe version (default is NTS version)
  • --with-libs=XXX,YYY: Compile the specified dependent library before compiling PHP, and activate some extension optional functions
  • --with-config-file-scan-dir=XXX: Set the directory to scan for .ini files after reading php.ini (Check here for default paths)
  • -I xxx=yyy: Hard compile INI options into PHP before compiling (support multiple options, alias is --with-hardcoded-ini)
  • --with-micro-fake-cli: When compiling micro, let micro's PHP_SAPI pretend to be cli (for compatibility with some programs that check PHP_SAPI)
  • --disable-opcache-jit: Disable opcache jit (enabled by default)
  • --without-micro-ext-test: After building micro.sfx, do not test the running results of different extensions in micro.sfx
  • --with-suggested-exts: Add ext-suggests as dependencies when compiling
  • --with-suggested-libs: Add lib-suggests as dependencies when compiling
  • --with-upx-pack: Use UPX to reduce the size of the binary file after compilation (you need to use bin/spc install-pkg upx to install upx first)
  • --with-micro-logo=XXX.ico: Customize the icon of the exe executable file after customizing the micro build (in the format of .ico)

Here is a simple example where we preset a larger memory_limit and disable the system function:

shell
bin/spc build "bcmath,openssl" --build-cli -I "memory_limit=4G" -I "disable_functions=system"

Another example: Customize our hello-world.exe program logo:

shell
bin/spc build "ffi,bcmath" --build-micro --with-micro-logo=mylogo.ico --debug
+bin/spc micro:combine hello.php
+# Then we got \`my-app.exe\` with custom logo!
+my-app.exe

Use php.exe

After php.exe is compiled, it is located in the buildroot\\bin\\ directory. You can copy it to any location for use.

shell
.\\php -v

Use micro.sfx

phpmicro is a SelF-extracted eXecutable SAPI module, provided by phpmicro project. But this project is using a fork of phpmicro, because we need to add some features to it. It can put php runtime and your source code together.

The final compilation result will output a file named ./micro.sfx, which needs to be used with your PHP source code like code.php. This file will be located in the path buildroot/bin/micro.sfx.

Prepare your project source code, which can be a single PHP file or a Phar file, for use.

If you want to combine phar files, you must add phar extension when compiling!

shell
# code.php "<?php echo 'Hello world' . PHP_EOL;"
+bin/spc micro:combine code.php -O my-app.exe
+# Run it!!! Copy it to another computer!!!
+./my-app.exe

If you package a PHAR file, just replace code.php with the phar file path. You can use box-project/box to package your CLI project as Phar, It is then combined with phpmicro to produce a standalone executable binary.

For more details on the micro:combine command, refer to command on Unix systems.

`,64)]))}const u=e(l,[["render",o]]);export{k as __pageData,u as default}; diff --git a/assets/en_guide_build-on-windows.md.CG23CkLK.lean.js b/assets/en_guide_build-on-windows.md.CG23CkLK.lean.js new file mode 100644 index 00000000..5292adff --- /dev/null +++ b/assets/en_guide_build-on-windows.md.CG23CkLK.lean.js @@ -0,0 +1 @@ +import{_ as e,c as s,o as a,af as t}from"./chunks/framework.PeLcR_tw.js";const k=JSON.parse('{"title":"Build on Windows","description":"","frontmatter":{},"headers":[],"relativePath":"en/guide/build-on-windows.md","filePath":"en/guide/build-on-windows.md"}'),l={name:"en/guide/build-on-windows.md"};function o(n,i,h,d,r,p){return a(),s("div",null,i[0]||(i[0]=[t("",64)]))}const u=e(l,[["render",o]]);export{k as __pageData,u as default}; diff --git a/assets/en_guide_build-with-glibc.md.CR2nDLf8.js b/assets/en_guide_build-with-glibc.md.CR2nDLf8.js deleted file mode 100644 index 43b68ccf..00000000 --- a/assets/en_guide_build-with-glibc.md.CR2nDLf8.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as i,c as e,o as t,a1 as a}from"./chunks/framework.gjrnbxUT.js";const m=JSON.parse('{"title":"Build glibc Compatible Linux Binary","description":"","frontmatter":{},"headers":[],"relativePath":"en/guide/build-with-glibc.md","filePath":"en/guide/build-with-glibc.md"}'),s={name:"en/guide/build-with-glibc.md"},n=a('

Build glibc Compatible Linux Binary

Why Build glibc Compatible Binary

Currently, the binaries built by static-php-cli on Linux by default are based on musl-libc (statically linked). musl-libc is a lightweight libc implementation that aims to be compatible with glibc and provides good support for pure static linking. This means that the compiled static PHP executable can be used on almost any Linux distribution without worrying about the versions of libc, libstdc++, etc.

However, there are some issues with pure static linking of musl-libc binaries on Linux:

  • The dl() function in PHP cannot be used to load dynamic libraries and external PHP extensions.
  • The FFI extension in PHP cannot be used.
  • In some extreme cases, performance issues may occur. See musl-libc performance issues.

Different Linux distributions use different default libc. For example, Alpine Linux uses musl libc, while most Linux distributions use glibc. However, even so, we cannot directly use any distribution using glibc to build portable static binaries because glibc has some issues:

  • Binaries built with gcc and other tools on newer versions of distributions cannot run on older versions of distributions.
  • glibc is not recommended to be statically linked because some of its features require the support of dynamic libraries.

However, we can use Docker to solve this problem. The final output is a binary dynamically linked with glibc and some necessary libraries, but statically linked with all other dependencies.

  1. Use an older version of a Linux distribution (such as CentOS 7.x), which has an older version of glibc but can run on most modern Linux distributions.
  2. Build the static binary of PHP in this container so that it can run on most modern Linux distributions.

Using glibc static binaries can run on most modern Linux distributions but cannot run on musl libc distributions, such as CentOS 6, Alpine Linux, etc.

Build glibc Compatible Linux Binary

The latest version of static-php-cli includes the bin/spc-gnu-docker script, which can create a CentOS 7.x (glibc-2.17) Docker container with one click and build a glibc compatible PHP static binary in the container.

Then, run the following command once. The first run will take a long time because it needs to download the CentOS 7.x image and some build tools.

bash
bin/spc-gnu-docker

After the image is built, you will see the same command help menu as bin/spc, which means the container is ready.

After the container is ready, you can refer to the local build section to build your PHP static binary. Just replace bin/spc or ./spc with bin/spc-gnu-docker.

bash
bin/spc-gnu-docker build bcmath,ctype,openssl,pdo,phar,posix,session,tokenizer,xml,zip --build-cli --debug

Notes

In rare cases, glibc-based static PHP may encounter segment faults and other errors, but there are currently few examples. If you encounter any issues, please submit an issue.

glibc build is an extended feature and is not part of the default static-php support. If you have related issues or requirements, please indicate that you are building based on glibc when submitting an issue.

If you need to build glibc-based binaries without using Docker, please refer to the bin/spc-gnu-docker script to manually create a similar environment.

Since glibc binaries are not the main goal of the project, we generally do not test the compatibility of various libraries and extensions under glibc. If any specific library builds successfully on musl-libc but fails on glibc, please submit an issue.

',22),l=[n];function o(r,c,u,b,d,h){return t(),e("div",null,l)}const g=i(s,[["render",o]]);export{m as __pageData,g as default}; diff --git a/assets/en_guide_build-with-glibc.md.CR2nDLf8.lean.js b/assets/en_guide_build-with-glibc.md.CR2nDLf8.lean.js deleted file mode 100644 index 71f7000b..00000000 --- a/assets/en_guide_build-with-glibc.md.CR2nDLf8.lean.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as i,c as e,o as t,a1 as a}from"./chunks/framework.gjrnbxUT.js";const m=JSON.parse('{"title":"Build glibc Compatible Linux Binary","description":"","frontmatter":{},"headers":[],"relativePath":"en/guide/build-with-glibc.md","filePath":"en/guide/build-with-glibc.md"}'),s={name:"en/guide/build-with-glibc.md"},n=a("",22),l=[n];function o(r,c,u,b,d,h){return t(),e("div",null,l)}const g=i(s,[["render",o]]);export{m as __pageData,g as default}; diff --git a/assets/en_guide_build-with-glibc.md.i6uYM8tR.js b/assets/en_guide_build-with-glibc.md.i6uYM8tR.js new file mode 100644 index 00000000..dba1c064 --- /dev/null +++ b/assets/en_guide_build-with-glibc.md.i6uYM8tR.js @@ -0,0 +1 @@ +import{_ as e,c as t,o as s,af as a}from"./chunks/framework.PeLcR_tw.js";const h=JSON.parse('{"title":"Build glibc Compatible Linux Binary","description":"","frontmatter":{},"headers":[],"relativePath":"en/guide/build-with-glibc.md","filePath":"en/guide/build-with-glibc.md"}'),n={name:"en/guide/build-with-glibc.md"};function l(o,i,r,c,b,u){return s(),t("div",null,i[0]||(i[0]=[a('

Build glibc Compatible Linux Binary

Why Build glibc Compatible Binary

Currently, the binaries built by static-php-cli on Linux by default are based on musl-libc (statically linked). musl-libc is a lightweight libc implementation that aims to be compatible with glibc and provides good support for pure static linking. This means that the compiled static PHP executable can be used on almost any Linux distribution without worrying about the versions of libc, libstdc++, etc.

However, there are some issues with pure static linking of musl-libc binaries on Linux:

  • The dl() function in PHP cannot be used to load dynamic libraries and external PHP extensions.
  • The FFI extension in PHP cannot be used.
  • In some extreme cases, performance issues may occur. See musl-libc performance issues.

Different Linux distributions use different default libc. For example, Alpine Linux uses musl libc, while most Linux distributions use glibc. However, even so, we cannot directly use any distribution using glibc to build portable static binaries because glibc has some issues:

  • Binaries built with gcc and other tools on newer versions of distributions cannot run on older versions of distributions.
  • glibc is not recommended to be statically linked because some of its features require the support of dynamic libraries.

However, we can use Docker to solve this problem. The final output is a binary dynamically linked with glibc and some necessary libraries, but statically linked with all other dependencies.

  1. Use an older version of a Linux distribution (such as CentOS 7.x), which has an older version of glibc but can run on most modern Linux distributions.
  2. Build the static binary of PHP in this container so that it can run on most modern Linux distributions.

Using glibc static binaries can run on most modern Linux distributions but cannot run on musl libc distributions, such as CentOS 6, Alpine Linux, etc.

Build glibc Compatible Linux Binary

The latest version of static-php-cli includes the bin/spc-gnu-docker script, which can create a CentOS 7.x (glibc-2.17) Docker container with one click and build a glibc compatible PHP static binary in the container.

Then, run the following command once. The first run will take a long time because it needs to download the CentOS 7.x image and some build tools.

bash
bin/spc-gnu-docker

After the image is built, you will see the same command help menu as bin/spc, which means the container is ready.

After the container is ready, you can refer to the local build section to build your PHP static binary. Just replace bin/spc or ./spc with bin/spc-gnu-docker.

bash
bin/spc-gnu-docker build bcmath,ctype,openssl,pdo,phar,posix,session,tokenizer,xml,zip --build-cli --debug

Notes

In rare cases, glibc-based static PHP may encounter segment faults and other errors, but there are currently few examples. If you encounter any issues, please submit an issue.

glibc build is an extended feature and is not part of the default static-php support. If you have related issues or requirements, please indicate that you are building based on glibc when submitting an issue.

If you need to build glibc-based binaries without using Docker, please refer to the bin/spc-gnu-docker script to manually create a similar environment.

Since glibc binaries are not the main goal of the project, we generally do not test the compatibility of various libraries and extensions under glibc. If any specific library builds successfully on musl-libc but fails on glibc, please submit an issue.

',22)]))}const p=e(n,[["render",l]]);export{h as __pageData,p as default}; diff --git a/assets/en_guide_build-with-glibc.md.i6uYM8tR.lean.js b/assets/en_guide_build-with-glibc.md.i6uYM8tR.lean.js new file mode 100644 index 00000000..3784fe6a --- /dev/null +++ b/assets/en_guide_build-with-glibc.md.i6uYM8tR.lean.js @@ -0,0 +1 @@ +import{_ as e,c as t,o as s,af as a}from"./chunks/framework.PeLcR_tw.js";const h=JSON.parse('{"title":"Build glibc Compatible Linux Binary","description":"","frontmatter":{},"headers":[],"relativePath":"en/guide/build-with-glibc.md","filePath":"en/guide/build-with-glibc.md"}'),n={name:"en/guide/build-with-glibc.md"};function l(o,i,r,c,b,u){return s(),t("div",null,i[0]||(i[0]=[a("",22)]))}const p=e(n,[["render",l]]);export{h as __pageData,p as default}; diff --git a/assets/en_guide_cli-generator.md.BVb63i-q.js b/assets/en_guide_cli-generator.md.BVb63i-q.js deleted file mode 100644 index a237b10d..00000000 --- a/assets/en_guide_cli-generator.md.BVb63i-q.js +++ /dev/null @@ -1 +0,0 @@ -import{C as e}from"./chunks/CliGenerator.CaE8R34N.js";import{d as t,c as a,I as o,a1 as n,o as r}from"./chunks/framework.gjrnbxUT.js";const i=n('

CLI Build Command Generator

TIP

The extensions selected below may contain extensions that are not supported by the selected operating system, which may cause compilation to fail. Please check Supported Extensions first.

',2),u=JSON.parse('{"title":"CLI Build Command Generator","description":"","frontmatter":{"aside":false},"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}; diff --git a/assets/en_guide_cli-generator.md.BVb63i-q.lean.js b/assets/en_guide_cli-generator.md.BVb63i-q.lean.js deleted file mode 100644 index a237b10d..00000000 --- a/assets/en_guide_cli-generator.md.BVb63i-q.lean.js +++ /dev/null @@ -1 +0,0 @@ -import{C as e}from"./chunks/CliGenerator.CaE8R34N.js";import{d as t,c as a,I as o,a1 as n,o as r}from"./chunks/framework.gjrnbxUT.js";const i=n('

CLI Build Command Generator

TIP

The extensions selected below may contain extensions that are not supported by the selected operating system, which may cause compilation to fail. Please check Supported Extensions first.

',2),u=JSON.parse('{"title":"CLI Build Command Generator","description":"","frontmatter":{"aside":false},"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}; diff --git a/assets/en_guide_cli-generator.md.Dbqc05Q2.js b/assets/en_guide_cli-generator.md.Dbqc05Q2.js new file mode 100644 index 00000000..4c17380f --- /dev/null +++ b/assets/en_guide_cli-generator.md.Dbqc05Q2.js @@ -0,0 +1 @@ +import{C as t}from"./chunks/CliGenerator.D2FJpN3t.js";import{d as a,c as o,o as n,af as r,J as i}from"./chunks/framework.PeLcR_tw.js";const p=JSON.parse('{"title":"CLI Build Command Generator","description":"","frontmatter":{"aside":false},"headers":[],"relativePath":"en/guide/cli-generator.md","filePath":"en/guide/cli-generator.md"}'),s={name:"en/guide/cli-generator.md"},_=a({...s,setup(l){return(c,e)=>(n(),o("div",null,[e[0]||(e[0]=r('

CLI Build Command Generator

TIP

The extensions selected below may contain extensions that are not supported by the selected operating system, which may cause compilation to fail. Please check Supported Extensions first.

',2)),i(t,{lang:"en"})]))}});export{p as __pageData,_ as default}; diff --git a/assets/en_guide_cli-generator.md.Dbqc05Q2.lean.js b/assets/en_guide_cli-generator.md.Dbqc05Q2.lean.js new file mode 100644 index 00000000..e4991d36 --- /dev/null +++ b/assets/en_guide_cli-generator.md.Dbqc05Q2.lean.js @@ -0,0 +1 @@ +import{C as t}from"./chunks/CliGenerator.D2FJpN3t.js";import{d as a,c as o,o as n,af as r,J as i}from"./chunks/framework.PeLcR_tw.js";const p=JSON.parse('{"title":"CLI Build Command Generator","description":"","frontmatter":{"aside":false},"headers":[],"relativePath":"en/guide/cli-generator.md","filePath":"en/guide/cli-generator.md"}'),s={name:"en/guide/cli-generator.md"},_=a({...s,setup(l){return(c,e)=>(n(),o("div",null,[e[0]||(e[0]=r("",2)),i(t,{lang:"en"})]))}});export{p as __pageData,_ as default}; diff --git a/assets/en_guide_deps-map.md.C7t3AggN.js b/assets/en_guide_deps-map.md.C7t3AggN.js deleted file mode 100644 index 9e9a4763..00000000 --- a/assets/en_guide_deps-map.md.C7t3AggN.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as t,c as d,o as b,a1 as r}from"./chunks/framework.gjrnbxUT.js";const g=JSON.parse('{"title":"Dependency Table","description":"","frontmatter":{"outline":"deep"},"headers":[],"relativePath":"en/guide/deps-map.md","filePath":"en/guide/deps-map.md"}'),l={name:"en/guide/deps-map.md"},i=r('

Dependency Table

When compiling PHP, each extension and library has dependencies, which may be required or optional. You can choose whether to include these optional dependencies.

For example, when compiling the gd extension under Linux, the zlib,libpng libraries and the zlib extension are forced to be compiled, while the libavif,libwebp,libjpeg,freetype libraries are optional libraries and will not be compiled by default unless specified by the --with-libs=avif,webp,jpeg,freetype option.

  • For optional extensions (optional features of extensions), you need to specify them manually at compile time, for example, to enable igbinary support for Redis: bin/spc build redis,igbinary.
  • For optional libraries, you need to compile and specify them through the --with-libs=XXX option.
  • If you want to enable all optional extensions, you can use bin/spc build redis --with-suggested-exts.
  • If you want to enable all optional libraries, you can use --with-suggested-libs.

Extension Dependency Table

Linux

Extension NameRequired ExtensionsSuggested ExtensionsRequired LibrariesSuggested Libraries
amqplibrabbitmq
bz2bzip2
curlcurl
dbaqdbm
domlibxml2
zlib
eventopensslsocketslibevent
ffilibffi
ftpopenssl
gdzlibzlib
libpng
libavif
libwebp
libjpeg
freetype
gettextgettext
gmpgmp
gmsslgmssl
grpcgrpc
iconvlibiconv
igbinarysession
apcu
imagickimagemagick
imapopensslimap
intlicu
ldapopensslldapgmp
libsodium
lz4liblz4
libxmlxml
mbregexmbstringonig
memcachezlib
session
mongodbicu
openssl
zstd
zlib
mysqlimysqlnd
mysqlndzlib
odbcunixodbc
opensslzlibopenssl
zlib
password-argon2libargon2
pdo_mysqlpdo
mysqlnd
pdo_odbcpdo
odbc
unixodbc
pdo_pgsqlpdo
pgsql
postgresql
pdo_sqlitepdo
sqlite3
sqlite
pdo_sqlsrvpdo
sqlsrv
pgsqlpostgresql
pharzlib
rdkafkalibrdkafka
readlinereadline
redissession
igbinary
zstd
liblz4
simplexmllibxml2
snappyapcusnappy
soaplibxml2
sodiumlibsodium
spxzlib
sqlite3sqlite
sqlsrvpcntlunixodbc
ssh2libssh2
swooleopenssl
curl
swoole-hook-pgsql
swoole-hook-mysql
swoole-hook-sqlite
libcares
brotli
nghttp2
zlib
swoole-hook-mysqlmysqlnd
pdo
pdo_mysql
mysqli
swoole-hook-pgsqlpgsql
pdo
swoole-hook-sqlitesqlite3
pdo
swowopenssl
curl
openssl
curl
tidytidy
uuidlibuuid
uvsocketslibuv
xhprofctype
xlswriterzlib
zip
openssl
xmllibxml2
xmlreaderlibxml2
xmlwriterlibxml2
xslxml
dom
libxslt
yacigbinary
yamllibyaml
ziplibzip
zlibzlib
zstdzstd

macOS

Extension NameRequired ExtensionsSuggested ExtensionsRequired LibrariesSuggested Libraries
amqplibrabbitmq
bz2bzip2
curlcurl
dbaqdbm
domlibxml2
zlib
eventopensslsocketslibevent
ffilibffi
ftpopenssl
gdzlibzlib
libpng
libavif
libwebp
libjpeg
freetype
gettextgettext
glfwglfw
gmpgmp
gmsslgmssl
grpcgrpc
iconvlibiconv
igbinarysession
apcu
imagickimagemagick
imapopensslimap
intlicu
ldapopensslldapgmp
libsodium
lz4liblz4
libxmlxml
mbregexmbstringonig
memcachezlib
session
memcachedsession
zlib
libmemcached
mongodbicu
openssl
zstd
zlib
mysqlimysqlnd
mysqlndzlib
odbcunixodbc
opensslzlibopenssl
zlib
password-argon2libargon2
pdo_mysqlpdo
mysqlnd
pdo_odbcpdo
odbc
unixodbc
pdo_pgsqlpdo
pgsql
postgresql
pdo_sqlitepdo
sqlite3
sqlite
pdo_sqlsrvpdo
sqlsrv
pgsqlpostgresql
pharzlib
rdkafkalibrdkafka
readlinereadline
redissession
igbinary
zstd
liblz4
simplexmllibxml2
snappyapcusnappy
soaplibxml2
sodiumlibsodium
spxzlib
sqlite3sqlite
sqlsrvunixodbc
ssh2libssh2
swooleopenssl
curl
swoole-hook-pgsql
swoole-hook-mysql
swoole-hook-sqlite
libcares
brotli
nghttp2
zlib
swoole-hook-mysqlmysqlnd
pdo
pdo_mysql
mysqli
swoole-hook-pgsqlpgsql
pdo
swoole-hook-sqlitesqlite3
pdo
swowopenssl
curl
openssl
curl
tidytidy
uuidlibuuid
uvsocketslibuv
xhprofctype
xlswriterzlib
zip
openssl
xmllibxml2
xmlreaderlibxml2
xmlwriterlibxml2
xslxml
dom
libxslt
yacigbinary
yamllibyaml
ziplibzip
zlibzlib
zstdzstd

Windows

Extension NameRequired ExtensionsSuggested ExtensionsRequired LibrariesSuggested Libraries
amqpopenssllibrabbitmq
bz2bzip2
curlzlib
openssl
curl
dbaqdbm
domxmllibxml2
zlib
ffilibffi-win
ftpopenssl
gdzlibzlib
libpng
libavif
libwebp
libjpeg
freetype
gmsslgmssl
iconvlibiconv-win
igbinarysession
apcu
libxmlxml
mbregexmbstringonig
mysqlimysqlnd
mysqlndzlib
opensslzlibopenssl
zlib
parallelpthreads4w
pdo_mysqlpdo
mysqlnd
pdo_odbcpdo
odbc
pdo_pgsqlpdo
pgsql
postgresql-win
pdo_sqlitepdo
sqlite3
sqlite
pdo_sqlsrvpdo
sqlsrv
pgsqlpostgresql-win
pharzlib
redissession
igbinary
simplexmlxmllibxml2
soapxmllibxml2
sodiumlibsodium
sqlite3sqlite
ssh2openssl
zlib
libssh2
swowopenssl
curl
openssl
curl
xlswriterzlib
zip
openssl
xmliconvlibxml2
xmlreaderxml
dom
libxml2
xmlwriterxmllibxml2
yamllibyaml
zipzlib
bz2
libzip
zlib
bzip2
xz
zlibzlib

FreeBSD

Extension NameRequired ExtensionsSuggested ExtensionsRequired LibrariesSuggested Libraries
bz2bzip2
curlcurl
dbaqdbm
ftpopenssl
mbregexmbstringonig
mysqlimysqlnd
mysqlndzlib
opensslzlibopenssl
zlib
pdo_mysqlpdo
mysqlnd
pharzlib
zlibzlib

Library Dependency Table

Linux

Library NameRequired LibrariesSuggested Libraries
curlopenssl
zlib
libssh2
brotli
nghttp2
nghttp3
ngtcp2
zstd
libcares
freetypezliblibpng
bzip2
brotli
gettextlibiconvncurses
libxml2
grpczlib
openssl
imagemagickzlib
libpng
libjpeg
libwebp
freetype
libtiff
libheif
bzip2
zstd
xz
libzip
libxml2
imapopenssl
ldapopenssl
zlib
gmp
libsodium
libaclattr
libeventopenssl
libheiflibde265
libwebp
libaom
zlib
brotli
libpngzlib
librabbitmqopenssl
librdkafkazstd
libssh2opensslzlib
libtiffzlib
libjpeg
libxml2libiconvxz
icu
zlib
libxsltlibxml2
libzipzlibbzip2
xz
zstd
openssl
nghttp2zlib
openssl
libxml2
nghttp3
ngtcp2
nghttp3openssl
ngtcp2opensslnghttp3
brotli
opensslzlib
postgresqllibiconv
libxml2
openssl
zlib
readline
icu
libxslt
ldap
zstd
readlinencurses
snappyzlib
unixodbclibiconv
xzlibiconv

macOS

Library NameRequired LibrariesSuggested Libraries
curlopenssl
zlib
libssh2
brotli
nghttp2
nghttp3
ngtcp2
zstd
libcares
freetypezliblibpng
bzip2
brotli
gettextlibiconvncurses
libxml2
grpczlib
openssl
imagemagickzlib
libpng
libjpeg
libwebp
freetype
libtiff
libheif
bzip2
zstd
xz
libzip
libxml2
imapopenssl
ldapopenssl
zlib
gmp
libsodium
libeventopenssl
libheiflibde265
libwebp
libaom
zlib
brotli
libpngzlib
librabbitmqopenssl
librdkafkazstd
libssh2opensslzlib
libtiffzlib
libjpeg
libxml2libiconvxz
icu
zlib
libxsltlibxml2
libzipzlibbzip2
xz
zstd
openssl
nghttp2zlib
openssl
libxml2
nghttp3
ngtcp2
nghttp3openssl
ngtcp2opensslnghttp3
brotli
opensslzlib
postgresqllibiconv
libxml2
openssl
zlib
readline
icu
libxslt
ldap
zstd
readlinencurses
snappyzlib
unixodbclibiconv
xzlibiconv

Windows

Library NameRequired LibrariesSuggested Libraries
curlzlib
libssh2
nghttp2
brotli
zstd
freetypezliblibpng
bzip2
brotli
libjpegzlib
libpngzlib
librabbitmqopenssl
libssh2opensslzlib
libxml2libiconv-winzlib
libzipzlib
bzip2
xz
zstd
openssl
nghttp2zlib
openssl
libxml2
nghttp3
ngtcp2
nghttp3openssl
ngtcp2opensslnghttp3
brotli
opensslzlib

FreeBSD

Library NameRequired LibrariesSuggested Libraries
curlopenssl
zlib
libssh2
brotli
nghttp2
nghttp3
ngtcp2
zstd
libcares
opensslzlib
',22),e=[i];function s(o,n,a,p,h,m){return b(),d("div",null,e)}const z=t(l,[["render",s]]);export{g as __pageData,z as default}; diff --git a/assets/en_guide_deps-map.md.C7t3AggN.lean.js b/assets/en_guide_deps-map.md.C7t3AggN.lean.js deleted file mode 100644 index 1440aab1..00000000 --- a/assets/en_guide_deps-map.md.C7t3AggN.lean.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as t,c as d,o as b,a1 as r}from"./chunks/framework.gjrnbxUT.js";const g=JSON.parse('{"title":"Dependency Table","description":"","frontmatter":{"outline":"deep"},"headers":[],"relativePath":"en/guide/deps-map.md","filePath":"en/guide/deps-map.md"}'),l={name:"en/guide/deps-map.md"},i=r("",22),e=[i];function s(o,n,a,p,h,m){return b(),d("div",null,e)}const z=t(l,[["render",s]]);export{g as __pageData,z as default}; diff --git a/assets/en_guide_deps-map.md.DqPbUPJ0.js b/assets/en_guide_deps-map.md.DqPbUPJ0.js new file mode 100644 index 00000000..d75cb94a --- /dev/null +++ b/assets/en_guide_deps-map.md.DqPbUPJ0.js @@ -0,0 +1 @@ +import{_ as d,c as b,o as r,af as l}from"./chunks/framework.PeLcR_tw.js";const h=JSON.parse('{"title":"Dependency Table","description":"","frontmatter":{"outline":"deep"},"headers":[],"relativePath":"en/guide/deps-map.md","filePath":"en/guide/deps-map.md"}'),i={name:"en/guide/deps-map.md"};function e(s,t,o,n,a,p){return r(),b("div",null,t[0]||(t[0]=[l('

Dependency Table

When compiling PHP, each extension and library has dependencies, which may be required or optional. You can choose whether to include these optional dependencies.

For example, when compiling the gd extension under Linux, the zlib,libpng libraries and the zlib extension are forced to be compiled, while the libavif,libwebp,libjpeg,freetype libraries are optional libraries and will not be compiled by default unless specified by the --with-libs=avif,webp,jpeg,freetype option.

  • For optional extensions (optional features of extensions), you need to specify them manually at compile time, for example, to enable igbinary support for Redis: bin/spc build redis,igbinary.
  • For optional libraries, you need to compile and specify them through the --with-libs=XXX option.
  • If you want to enable all optional extensions, you can use bin/spc build redis --with-suggested-exts.
  • If you want to enable all optional libraries, you can use --with-suggested-libs.

Extension Dependency Table

Linux

Extension NameRequired ExtensionsSuggested ExtensionsRequired LibrariesSuggested Libraries
amqplibrabbitmq
brotlibrotli
bz2bzip2
curlcurl
dbaqdbm
domlibxml2
zlib
evsockets
eventopensslsocketslibevent
ffilibffi
ftpopenssl
gdzlibzlib
libpng
libavif
libwebp
libjpeg
freetype
gettextgettext
gmpgmp
gmsslgmssl
grpcgrpc
iconvlibiconv
igbinarysession
apcu
imagickimagemagick
imapopensslimap
intlicu
ldapopensslldapgmp
libsodium
lz4liblz4
mbregexmbstringonig
memcachezlib
session
memcachedsession
zlib
libmemcached
fastlz
mongodbicu
openssl
zstd
zlib
msgpacksession
mysqlimysqlnd
mysqlndzlib
odbcunixodbc
opensslzlibopenssl
zlib
password-argon2libargon2
pdo_mysqlpdo
mysqlnd
pdo_odbcpdo
odbc
unixodbc
pdo_pgsqlpdo
pgsql
postgresql
pdo_sqlitepdo
sqlite3
sqlite
pdo_sqlsrvpdo
sqlsrv
pgsqlpostgresql
pharzlib
rdkafkalibrdkafka
readlinereadline
redissession
igbinary
zstd
liblz4
simplexmllibxml2
snappyapcusnappy
soaplibxml2
sodiumlibsodium
spxzlib
sqlite3sqlite
sqlsrvpcntlunixodbc
ssh2openssl
zlib
libssh2
swooleopenssl
curl
swoole-hook-pgsql
swoole-hook-mysql
swoole-hook-sqlite
libcares
brotli
nghttp2
zlib
swoole-hook-mysqlmysqlnd
pdo
pdo_mysql
mysqli
swoole-hook-pgsqlpgsql
pdo
swoole-hook-sqlitesqlite3
pdo
swowopenssl
curl
openssl
curl
tidytidy
uuidlibuuid
uvsocketslibuv
xhprofctype
xlswriterzlib
zip
openssl
xmllibxml2
xmlreaderlibxml2
xmlwriterlibxml2
xslxml
dom
libxslt
xzxz
yacigbinaryfastlz
yamllibyaml
ziplibzip
zlibzlib
zstdzstd

macOS

Extension NameRequired ExtensionsSuggested ExtensionsRequired LibrariesSuggested Libraries
amqplibrabbitmq
brotlibrotli
bz2bzip2
curlcurl
dbaqdbm
domlibxml2
zlib
evsockets
eventopensslsocketslibevent
ffilibffi
ftpopenssl
gdzlibzlib
libpng
libavif
libwebp
libjpeg
freetype
gettextgettext
glfwglfw
gmpgmp
gmsslgmssl
grpcgrpc
iconvlibiconv
igbinarysession
apcu
imagickimagemagick
imapopensslimap
intlicu
ldapopensslldapgmp
libsodium
lz4liblz4
mbregexmbstringonig
memcachezlib
session
memcachedsession
zlib
libmemcached
fastlz
mongodbicu
openssl
zstd
zlib
msgpacksession
mysqlimysqlnd
mysqlndzlib
odbcunixodbc
opensslzlibopenssl
zlib
password-argon2libargon2
pdo_mysqlpdo
mysqlnd
pdo_odbcpdo
odbc
unixodbc
pdo_pgsqlpdo
pgsql
postgresql
pdo_sqlitepdo
sqlite3
sqlite
pdo_sqlsrvpdo
sqlsrv
pgsqlpostgresql
pharzlib
rdkafkalibrdkafka
readlinereadline
redissession
igbinary
zstd
liblz4
simplexmllibxml2
snappyapcusnappy
soaplibxml2
sodiumlibsodium
spxzlib
sqlite3sqlite
sqlsrvunixodbc
ssh2openssl
zlib
libssh2
swooleopenssl
curl
swoole-hook-pgsql
swoole-hook-mysql
swoole-hook-sqlite
libcares
brotli
nghttp2
zlib
swoole-hook-mysqlmysqlnd
pdo
pdo_mysql
mysqli
swoole-hook-pgsqlpgsql
pdo
swoole-hook-sqlitesqlite3
pdo
swowopenssl
curl
openssl
curl
tidytidy
uuidlibuuid
uvsocketslibuv
xhprofctype
xlswriterzlib
zip
openssl
xmllibxml2
xmlreaderlibxml2
xmlwriterlibxml2
xslxml
dom
libxslt
xzxz
yacigbinaryfastlz
yamllibyaml
ziplibzip
zlibzlib
zstdzstd

Windows

Extension NameRequired ExtensionsSuggested ExtensionsRequired LibrariesSuggested Libraries
amqpopenssllibrabbitmq
brotlibrotli
bz2bzip2
curlzlib
openssl
curl
dbaqdbm
domxmllibxml2
zlib
evsockets
ffilibffi-win
ftpopenssl
gdzlibzlib
libpng
libavif
libwebp
libjpeg
freetype
gmsslgmssl
iconvlibiconv-win
igbinarysession
apcu
mbregexmbstringonig
msgpacksession
mysqlimysqlnd
mysqlndzlib
opensslzlibopenssl
zlib
parallelpthreads4w
pdo_mysqlpdo
mysqlnd
pdo_odbcpdo
odbc
pdo_pgsqlpdo
pgsql
postgresql-win
pdo_sqlitepdo
sqlite3
sqlite
pdo_sqlsrvpdo
sqlsrv
pgsqlpostgresql-win
pharzlib
redissession
igbinary
simplexmlxmllibxml2
soapxmllibxml2
sodiumlibsodium
sqlite3sqlite
ssh2openssl
zlib
libssh2
swowopenssl
curl
openssl
curl
xlswriterzlib
zip
openssl
xmliconvlibxml2
xmlreaderxml
dom
libxml2
xmlwriterxmllibxml2
xzxz
yamllibyaml
zipzlib
bz2
libzip
zlib
bzip2
xz
zlibzlib

FreeBSD

Extension NameRequired ExtensionsSuggested ExtensionsRequired LibrariesSuggested Libraries
brotlibrotli
bz2bzip2
curlcurl
dbaqdbm
evsockets
ftpopenssl
mbregexmbstringonig
mysqlimysqlnd
mysqlndzlib
opensslzlibopenssl
zlib
pdo_mysqlpdo
mysqlnd
pharzlib
xzxz
zlibzlib

Library Dependency Table

Linux

Library NameRequired LibrariesSuggested Libraries
curlopenssl
zlib
libssh2
brotli
nghttp2
nghttp3
ngtcp2
zstd
libcares
freetypezliblibpng
bzip2
brotli
gettextlibiconvncurses
libxml2
grpczlib
openssl
imagemagickzlib
libpng
libjpeg
libwebp
freetype
libtiff
libheif
bzip2
zstd
xz
libzip
libxml2
imapopenssl
ldapopenssl
zlib
gmp
libsodium
libaclattr
libeventopenssl
libheiflibde265
libwebp
libaom
zlib
brotli
libpngzlib
librabbitmqopenssl
librdkafkazstd
libssh2opensslzlib
libtiffzlib
libjpeg
libxml2libiconvxz
icu
zlib
libxsltlibxml2
libzipzlibbzip2
xz
zstd
openssl
nghttp2zlib
openssl
libxml2
nghttp3
ngtcp2
nghttp3openssl
ngtcp2opensslnghttp3
brotli
opensslzlib
postgresqllibiconv
libxml2
openssl
zlib
readline
icu
libxslt
ldap
zstd
readlinencurses
snappyzlib
unixodbclibiconv
xzlibiconv

macOS

Library NameRequired LibrariesSuggested Libraries
curlopenssl
zlib
libssh2
brotli
nghttp2
nghttp3
ngtcp2
zstd
libcares
freetypezliblibpng
bzip2
brotli
gettextlibiconvncurses
libxml2
grpczlib
openssl
imagemagickzlib
libpng
libjpeg
libwebp
freetype
libtiff
libheif
bzip2
zstd
xz
libzip
libxml2
imapopenssl
ldapopenssl
zlib
gmp
libsodium
libeventopenssl
libheiflibde265
libwebp
libaom
zlib
brotli
libpngzlib
librabbitmqopenssl
librdkafkazstd
libssh2opensslzlib
libtiffzlib
libjpeg
libxml2libiconvxz
icu
zlib
libxsltlibxml2
libzipzlibbzip2
xz
zstd
openssl
nghttp2zlib
openssl
libxml2
nghttp3
ngtcp2
nghttp3openssl
ngtcp2opensslnghttp3
brotli
opensslzlib
postgresqllibiconv
libxml2
openssl
zlib
readline
icu
libxslt
ldap
zstd
readlinencurses
snappyzlib
unixodbclibiconv
xzlibiconv

Windows

Library NameRequired LibrariesSuggested Libraries
curlzlib
libssh2
nghttp2
brotli
zstd
freetypezliblibpng
bzip2
brotli
libjpegzlib
libpngzlib
librabbitmqopenssl
libssh2opensslzlib
libxml2libiconv-winzlib
libzipzlib
bzip2
xz
zstd
openssl
nghttp2zlib
openssl
libxml2
nghttp3
ngtcp2
nghttp3openssl
ngtcp2opensslnghttp3
brotli
opensslzlib

FreeBSD

Library NameRequired LibrariesSuggested Libraries
curlopenssl
zlib
libssh2
brotli
nghttp2
nghttp3
ngtcp2
zstd
libcares
opensslzlib
',22)]))}const c=d(i,[["render",e]]);export{h as __pageData,c as default}; diff --git a/assets/en_guide_deps-map.md.DqPbUPJ0.lean.js b/assets/en_guide_deps-map.md.DqPbUPJ0.lean.js new file mode 100644 index 00000000..9ef4b9b3 --- /dev/null +++ b/assets/en_guide_deps-map.md.DqPbUPJ0.lean.js @@ -0,0 +1 @@ +import{_ as d,c as b,o as r,af as l}from"./chunks/framework.PeLcR_tw.js";const h=JSON.parse('{"title":"Dependency Table","description":"","frontmatter":{"outline":"deep"},"headers":[],"relativePath":"en/guide/deps-map.md","filePath":"en/guide/deps-map.md"}'),i={name:"en/guide/deps-map.md"};function e(s,t,o,n,a,p){return r(),b("div",null,t[0]||(t[0]=[l("",22)]))}const c=d(i,[["render",e]]);export{h as __pageData,c as default}; diff --git a/assets/en_guide_env-vars.md.CMHjddfB.js b/assets/en_guide_env-vars.md.CMHjddfB.js deleted file mode 100644 index 8e6883b4..00000000 --- a/assets/en_guide_env-vars.md.CMHjddfB.js +++ /dev/null @@ -1,12 +0,0 @@ -import{_ as e,c as i,o as t,a1 as a}from"./chunks/framework.gjrnbxUT.js";const u=JSON.parse('{"title":"Environment variables","description":"","frontmatter":{},"headers":[],"relativePath":"en/guide/env-vars.md","filePath":"en/guide/env-vars.md"}'),n={name:"en/guide/env-vars.md"},s=a(`

Environment variables

All environment variables mentioned in the list on this page have default values unless otherwise noted. You can override the default values by setting these environment variables.

Environment variables list

Starting from version 2.3.5, we have centralized the environment variables in the config/env.ini file. You can set environment variables by modifying this file.

We divide the environment variables supported by static-php-cli into three types:

  • Global internal environment variables: declared after static-php-cli starts, you can use getenv() to get them internally in static-php-cli, and you can override them before starting static-php-cli.
  • Fixed environment variables: declared after static-php-cli starts, you can only use getenv() to get them, but you cannot override them through shell scripts.
  • Config file environment variables: declared before static-php-cli build, you can set these environment variables by modifying the config/env.ini file or through shell scripts.

You can read the comments for each parameter in config/env.ini to understand its purpose.

Custom environment variables

Generally, you don't need to modify any of the following environment variables as they are already set to optimal values. However, if you have special needs, you can set these environment variables to meet your needs (for example, you need to debug PHP performance under different compilation parameters).

If you want to use custom environment variables, you can use the export command in the terminal or set the environment variables directly before the command, for example:

shell
# export first
-export SPC_CONCURRENCY=4
-bin/spc build mbstring,pcntl --build-cli
-
-# or direct use
-SPC_CONCURRENCY=4 bin/spc build mbstring,pcntl --build-cli

Or, if you need to modify an environment variable for a long time, you can modify the config/env.ini file.

config/env.ini is divided into three sections, [global] is globally effective, [windows], [macos], [linux] are only effective for the corresponding operating system.

For example, if you need to modify the ./configure command for compiling PHP, you can find the SPC_CMD_PREFIX_PHP_CONFIGURE environment variable in the config/env.ini file, and then modify its value.

If your build conditions are more complex and require multiple env.ini files to switch, we recommend that you use the config/env.custom.ini file. In this way, you can specify your environment variables by writing additional override items without modifying the default config/env.ini file.

ini
; This is an example of \`config/env.custom.ini\` file, 
-; we modify the \`SPC_CONCURRENCY\` and linux default CFLAGS passing to libs and PHP
-[global]
-SPC_CONCURRENCY=4
-
-[linux]
-SPC_DEFAULT_C_FLAGS="-O3"

Library environment variables (Unix only)

Starting from 2.2.0, static-php-cli supports custom environment variables for all compilation dependent library commands of macOS, Linux, FreeBSD and other Unix systems.

In this way, you can adjust the behavior of compiling dependent libraries through environment variables at any time. For example, you can set the optimization parameters for compiling the xxx library through xxx_CFLAGS=-O0.

Of course, not every library supports the injection of environment variables. We currently provide three wildcard environment variables with the suffixes:

  • _CFLAGS: CFLAGS for the compiler
  • _LDFLAGS: LDFLAGS for the linker
  • _LIBS: LIBS for the linker

The prefix is the name of the dependent library, and the specific name of the library is subject to lib.json. Among them, the library name with - needs to replace - with _.

Here is an example of an optimization option that replaces the openssl library compilation:

shell
openssl_CFLAGS="-O0"

The library name uses the same name listed in lib.json and is case-sensitive.

TIP

When no relevant environment variables are specified, except for the following variables, the remaining values are empty by default:

var namevar default value
pkg_config_CFLAGSmacOS: $SPC_DEFAULT_C_FLAGS -Wimplicit-function-declaration -Wno-int-conversion, Other: empty
pkg_config_LDFLAGSLinux: --static, Other: empty
imagemagick_LDFLAGSLinux: -static, Other: empty
imagemagick_LIBSmacOS: -liconv, Other: empty
ldap_LDFLAGS-L$BUILD_LIB_PATH
openssl_CFLAGSLinux: $SPC_DEFAULT_C_FLAGS, Other: empty
others...empty

The following table is a list of library names that support customizing the above three variables:

lib name
brotli
bzip
curl
freetype
gettext
gmp
imagemagick
ldap
libargon2
libavif
libcares
libevent
openssl

TIP

Because adapting custom environment variables to each library is a particularly tedious task, and in most cases you do not need custom environment variables for these libraries, so we currently only support custom environment variables for some libraries.

If the library you need to customize environment variables is not listed above, you can submit your request through GitHub Issue.

`,29),o=[s];function r(l,d,c,p,h,m){return t(),i("div",null,o)}const b=e(n,[["render",r]]);export{u as __pageData,b as default}; diff --git a/assets/en_guide_env-vars.md.CMHjddfB.lean.js b/assets/en_guide_env-vars.md.CMHjddfB.lean.js deleted file mode 100644 index 9b89b154..00000000 --- a/assets/en_guide_env-vars.md.CMHjddfB.lean.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as e,c as i,o as t,a1 as a}from"./chunks/framework.gjrnbxUT.js";const u=JSON.parse('{"title":"Environment variables","description":"","frontmatter":{},"headers":[],"relativePath":"en/guide/env-vars.md","filePath":"en/guide/env-vars.md"}'),n={name:"en/guide/env-vars.md"},s=a("",29),o=[s];function r(l,d,c,p,h,m){return t(),i("div",null,o)}const b=e(n,[["render",r]]);export{u as __pageData,b as default}; diff --git a/assets/en_guide_env-vars.md.DzVATbtO.js b/assets/en_guide_env-vars.md.DzVATbtO.js new file mode 100644 index 00000000..a46127a2 --- /dev/null +++ b/assets/en_guide_env-vars.md.DzVATbtO.js @@ -0,0 +1,12 @@ +import{_ as i,c as t,o as a,af as n}from"./chunks/framework.PeLcR_tw.js";const m=JSON.parse('{"title":"Environment variables","description":"","frontmatter":{},"headers":[],"relativePath":"en/guide/env-vars.md","filePath":"en/guide/env-vars.md"}'),s={name:"en/guide/env-vars.md"};function r(o,e,l,d,c,h){return a(),t("div",null,e[0]||(e[0]=[n(`

Environment variables

All environment variables mentioned in the list on this page have default values unless otherwise noted. You can override the default values by setting these environment variables.

Environment variables list

Starting from version 2.3.5, we have centralized the environment variables in the config/env.ini file. You can set environment variables by modifying this file.

We divide the environment variables supported by static-php-cli into three types:

  • Global internal environment variables: declared after static-php-cli starts, you can use getenv() to get them internally in static-php-cli, and you can override them before starting static-php-cli.
  • Fixed environment variables: declared after static-php-cli starts, you can only use getenv() to get them, but you cannot override them through shell scripts.
  • Config file environment variables: declared before static-php-cli build, you can set these environment variables by modifying the config/env.ini file or through shell scripts.

You can read the comments for each parameter in config/env.ini to understand its purpose.

Custom environment variables

Generally, you don't need to modify any of the following environment variables as they are already set to optimal values. However, if you have special needs, you can set these environment variables to meet your needs (for example, you need to debug PHP performance under different compilation parameters).

If you want to use custom environment variables, you can use the export command in the terminal or set the environment variables directly before the command, for example:

shell
# export first
+export SPC_CONCURRENCY=4
+bin/spc build mbstring,pcntl --build-cli
+
+# or direct use
+SPC_CONCURRENCY=4 bin/spc build mbstring,pcntl --build-cli

Or, if you need to modify an environment variable for a long time, you can modify the config/env.ini file.

config/env.ini is divided into three sections, [global] is globally effective, [windows], [macos], [linux] are only effective for the corresponding operating system.

For example, if you need to modify the ./configure command for compiling PHP, you can find the SPC_CMD_PREFIX_PHP_CONFIGURE environment variable in the config/env.ini file, and then modify its value.

If your build conditions are more complex and require multiple env.ini files to switch, we recommend that you use the config/env.custom.ini file. In this way, you can specify your environment variables by writing additional override items without modifying the default config/env.ini file.

ini
; This is an example of \`config/env.custom.ini\` file, 
+; we modify the \`SPC_CONCURRENCY\` and linux default CFLAGS passing to libs and PHP
+[global]
+SPC_CONCURRENCY=4
+
+[linux]
+SPC_DEFAULT_C_FLAGS="-O3"

Library environment variables (Unix only)

Starting from 2.2.0, static-php-cli supports custom environment variables for all compilation dependent library commands of macOS, Linux, FreeBSD and other Unix systems.

In this way, you can adjust the behavior of compiling dependent libraries through environment variables at any time. For example, you can set the optimization parameters for compiling the xxx library through xxx_CFLAGS=-O0.

Of course, not every library supports the injection of environment variables. We currently provide three wildcard environment variables with the suffixes:

  • _CFLAGS: CFLAGS for the compiler
  • _LDFLAGS: LDFLAGS for the linker
  • _LIBS: LIBS for the linker

The prefix is the name of the dependent library, and the specific name of the library is subject to lib.json. Among them, the library name with - needs to replace - with _.

Here is an example of an optimization option that replaces the openssl library compilation:

shell
openssl_CFLAGS="-O0"

The library name uses the same name listed in lib.json and is case-sensitive.

TIP

When no relevant environment variables are specified, except for the following variables, the remaining values are empty by default:

var namevar default value
pkg_config_CFLAGSmacOS: $SPC_DEFAULT_C_FLAGS -Wimplicit-function-declaration -Wno-int-conversion, Other: empty
pkg_config_LDFLAGSLinux: --static, Other: empty
imagemagick_LDFLAGSLinux: -static, Other: empty
imagemagick_LIBSmacOS: -liconv, Other: empty
ldap_LDFLAGS-L$BUILD_LIB_PATH
openssl_CFLAGSLinux: $SPC_DEFAULT_C_FLAGS, Other: empty
others...empty

The following table is a list of library names that support customizing the above three variables:

lib name
brotli
bzip
curl
freetype
gettext
gmp
imagemagick
ldap
libargon2
libavif
libcares
libevent
openssl

TIP

Because adapting custom environment variables to each library is a particularly tedious task, and in most cases you do not need custom environment variables for these libraries, so we currently only support custom environment variables for some libraries.

If the library you need to customize environment variables is not listed above, you can submit your request through GitHub Issue.

`,29)]))}const b=i(s,[["render",r]]);export{m as __pageData,b as default}; diff --git a/assets/en_guide_env-vars.md.DzVATbtO.lean.js b/assets/en_guide_env-vars.md.DzVATbtO.lean.js new file mode 100644 index 00000000..373f65cf --- /dev/null +++ b/assets/en_guide_env-vars.md.DzVATbtO.lean.js @@ -0,0 +1 @@ +import{_ as i,c as t,o as a,af as n}from"./chunks/framework.PeLcR_tw.js";const m=JSON.parse('{"title":"Environment variables","description":"","frontmatter":{},"headers":[],"relativePath":"en/guide/env-vars.md","filePath":"en/guide/env-vars.md"}'),s={name:"en/guide/env-vars.md"};function r(o,e,l,d,c,h){return a(),t("div",null,e[0]||(e[0]=[n("",29)]))}const b=i(s,[["render",r]]);export{m as __pageData,b as default}; diff --git a/assets/en_guide_extension-notes.md.D_szqpv1.js b/assets/en_guide_extension-notes.md.D_szqpv1.js deleted file mode 100644 index 68b49548..00000000 --- a/assets/en_guide_extension-notes.md.D_szqpv1.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as e,c as o,o as a,a1 as i}from"./chunks/framework.gjrnbxUT.js";const m=JSON.parse('{"title":"Extension Notes","description":"","frontmatter":{},"headers":[],"relativePath":"en/guide/extension-notes.md","filePath":"en/guide/extension-notes.md"}'),l={name:"en/guide/extension-notes.md"},t=i('

Extension Notes

Because it is a static compilation, extensions will not compile 100% perfectly, and different extensions have different requirements for PHP and the environment, which will be listed one by one here.

curl

HTTP3 support is not enabled by default, compile with --with-libs="nghttp2,nghttp3,ngtcp2" to enable HTTP3 support for PHP >= 8.4.

When using curl to request HTTPS, there may be an error:80000002:system library::No such file or directory error. For details on the solution, see FAQ - Unable to use ssl.

phpmicro

  1. Only PHP >= 8.0 is supported.

swoole

  1. swoole >= 5.0 Only PHP >= 8.0 is supported.
  2. swoole Currently, curl hooks are not supported for PHP 8.0.x (which may be fixed in the future).
  3. When compiling, if only swoole extension is included, the supported Swoole database coroutine hook will not be fully enabled. If you need to use it, please add the corresponding swoole-hook-xxx extension.
  4. The zend_mm_heap corrupted problem may occur in swoole under some extension combinations. The cause has not yet been found.

swoole-hook-pgsql

swoole-hook-pgsql is not an extension, it's a Hook feature of Swoole. If you use swoole,swoole-hook-pgsql, you will enable Swoole's PostgreSQL client and the coroutine mode of the pdo_pgsql extension.

swoole-hook-pgsql conflicts with the pdo_pgsql extension. If you want to use Swoole and pdo_pgsql, please delete the pdo_pgsql extension and enable swoole and swoole-hook-pgsql. This extension contains an implementation of the coroutine environment for pdo_pgsql.

On macOS systems, pdo_pgsql may not be able to connect to the postgresql server normally, please use it with caution.

swoole-hook-mysql

swoole-hook-mysql is not an extension, it's a Hook feature of Swoole. If you use swoole,swoole-hook-mysql, you will enable the coroutine mode of Swoole's mysqlnd and pdo_mysql.

swoole-hook-sqlite

swoole-hook-sqlite is not an extension, it's a Hook feature of Swoole. If you use swoole,swoole-hook-sqlite, you will enable the coroutine mode of Swoole's pdo_sqlite (Swoole must be 5.1 or above).

swoole-hook-sqlite conflicts with the pdo_sqlite extension. If you want to use Swoole and pdo_sqlite, please delete the pdo_sqlite extension and enable swoole and swoole-hook-sqlite. This extension contains an implementation of the coroutine environment for pdo_sqlite.

swow

  1. Only PHP 8.0 ~ 8.4 is supported.

imagick

  1. The imagick extension currently only has openmp support on musl libc. This means that multithreading is disabled on glibc or other operating systems. The extension is still fully functional.

imap

  1. Kerberos is not supported
  2. ext-imap is not thread safe due to the underlying c-client. It's not possible to use it in --enable-zts builds.
  3. Because the extension may be dropped from php, we recommend you look for an alternative implementation, such as Webklex/php-imap

gd

  1. gd Extension relies on more additional Graphics library. By default, using bin/spc build gd directly will not support some Graphics library, such as libjpeg, libavif, etc. Currently, it supports four libraries: freetype,libjpeg,libavif,libwebp. Therefore, the following command can be used to introduce them into the gd library:
bash
bin/spc build gd --with-libs=freetype,libjpeg,libavif,libwebp --build-cli

mcrypt

  1. Currently not supported, and this extension will not be supported in the future. #32

oci8

  1. oci8 is an extension of the Oracle database, because the library on which the extension provided by Oracle does not provide a statically compiled version (.a) or source code, and this extension cannot be compiled into php by static linking, so it cannot be supported.

xdebug

  1. Xdebug is only buildable as a shared extension. On Linux, you need to use static-php-cli with SPC_LIBC=glibc.
  2. When using Linux/glibc or macOS, you can compile Xdebug as a shared extension using --build-shared="xdebug". The compiled ./php binary can be configured and run by specifying the INI, eg ./php -d 'zend_extension=/path/to/xdebug.so' your-code.php.

xml

  1. xml includes xml, xmlreader, xmlwriter, xsl, dom, simplexml, etc. When adding xml extensions, it is best to enable these extensions at the same time.
  2. libxml is included in xml extension. Enabling xml is equivalent to enabling libxml.

glfw

  1. glfw depends on OpenGL, and linux environment also needs X11, which cannot be linked statically.
  2. macOS platform, we can compile and link system builtin OpenGL and related libraries dynamically.

rar

  1. The rar extension currently has a problem when compiling phpmicro with the common extension collection in the macOS x86_64 environment.

pgsql

pgsql ssl connection is not compatible with openssl 3.2.0. See:

pgsql 16.2 has fixed this bug, now it's working.

When pgsql uses SSL connection, there may be error:80000002:system library::No such file or directory error, For details on the solution, see FAQ - Unable to use ssl.

openssl

When using openssl-based extensions (such as curl, pgsql and other network libraries), there may be an error:80000002:system library::No such file or directory error. For details on the solution, see FAQ - Unable to use ssl.

password-argon2

  1. password-argon2 is not a standard extension, it is an additional algorithm for the password_hash function.
  2. On Linux systems, password-argon2 dependency libargon2 conflicts with the libsodium library.

ffi

  1. Due to the limitation of musl libc's static linkage, you cannot use ffi because dynamic libraries cannot be loaded. If you need to use the ffi extension, see Compile PHP with GNU libc.
  2. macOS supports the ffi extension, but errors will occur when some kernels do not contain debugging symbols.
  3. Windows x64 supports the ffi extension.

xhprof

The xhprof extension consists of three parts: xhprof_extension, xhprof_html, xhprof_libs. Only xhprof_extension is included in the compiled binary. If you need to use xhprof, please download the source code from pecl.php.net/package/xhprof and specify the xhprof_libs and xhprof_html paths for use.

event

If you enable event extension on macOS, the openpty will be disabled due to issue:

parallel

Parallel is only supported on PHP 8.0 ZTS and above.

spx

  1. The SPX extension only supports NTS mode.
  2. SPX does not support Windows, and the official repository does not support static compilation. static-php-cli uses a modified version.

mimalloc

  1. This is not technically an extension, but a library.
  2. Building with --with-libs="mimalloc" on Linux or macOS will override the default allocator.
  3. This is experimental for now, but is recommended in threaded environments.
',61),s=[t];function n(r,h,d,c,p,u){return a(),o("div",null,s)}const f=e(l,[["render",n]]);export{m as __pageData,f as default}; diff --git a/assets/en_guide_extension-notes.md.D_szqpv1.lean.js b/assets/en_guide_extension-notes.md.D_szqpv1.lean.js deleted file mode 100644 index 92d3497b..00000000 --- a/assets/en_guide_extension-notes.md.D_szqpv1.lean.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as e,c as o,o as a,a1 as i}from"./chunks/framework.gjrnbxUT.js";const m=JSON.parse('{"title":"Extension Notes","description":"","frontmatter":{},"headers":[],"relativePath":"en/guide/extension-notes.md","filePath":"en/guide/extension-notes.md"}'),l={name:"en/guide/extension-notes.md"},t=i("",61),s=[t];function n(r,h,d,c,p,u){return a(),o("div",null,s)}const f=e(l,[["render",n]]);export{m as __pageData,f as default}; diff --git a/assets/en_guide_extension-notes.md.DadE5Bxb.js b/assets/en_guide_extension-notes.md.DadE5Bxb.js new file mode 100644 index 00000000..013eee35 --- /dev/null +++ b/assets/en_guide_extension-notes.md.DadE5Bxb.js @@ -0,0 +1 @@ +import{_ as o,c as i,o as a,af as l}from"./chunks/framework.PeLcR_tw.js";const b=JSON.parse('{"title":"Extension Notes","description":"","frontmatter":{},"headers":[],"relativePath":"en/guide/extension-notes.md","filePath":"en/guide/extension-notes.md"}'),s={name:"en/guide/extension-notes.md"};function t(n,e,r,h,d,c){return a(),i("div",null,e[0]||(e[0]=[l('

Extension Notes

Because it is a static compilation, extensions will not compile 100% perfectly, and different extensions have different requirements for PHP and the environment, which will be listed one by one here.

curl

HTTP3 support is not enabled by default, compile with --with-libs="nghttp2,nghttp3,ngtcp2" to enable HTTP3 support for PHP >= 8.4.

When using curl to request HTTPS, there may be an error:80000002:system library::No such file or directory error. For details on the solution, see FAQ - Unable to use ssl.

phpmicro

  1. Only PHP >= 8.0 is supported.

swoole

  1. swoole >= 5.0 Only PHP >= 8.0 is supported.
  2. swoole Currently, curl hooks are not supported for PHP 8.0.x (which may be fixed in the future).
  3. When compiling, if only swoole extension is included, the supported Swoole database coroutine hook will not be fully enabled. If you need to use it, please add the corresponding swoole-hook-xxx extension.
  4. The zend_mm_heap corrupted problem may occur in swoole under some extension combinations. The cause has not yet been found.

swoole-hook-pgsql

swoole-hook-pgsql is not an extension, it's a Hook feature of Swoole. If you use swoole,swoole-hook-pgsql, you will enable Swoole's PostgreSQL client and the coroutine mode of the pdo_pgsql extension.

swoole-hook-pgsql conflicts with the pdo_pgsql extension. If you want to use Swoole and pdo_pgsql, please delete the pdo_pgsql extension and enable swoole and swoole-hook-pgsql. This extension contains an implementation of the coroutine environment for pdo_pgsql.

On macOS systems, pdo_pgsql may not be able to connect to the postgresql server normally, please use it with caution.

swoole-hook-mysql

swoole-hook-mysql is not an extension, it's a Hook feature of Swoole. If you use swoole,swoole-hook-mysql, you will enable the coroutine mode of Swoole's mysqlnd and pdo_mysql.

swoole-hook-sqlite

swoole-hook-sqlite is not an extension, it's a Hook feature of Swoole. If you use swoole,swoole-hook-sqlite, you will enable the coroutine mode of Swoole's pdo_sqlite (Swoole must be 5.1 or above).

swoole-hook-sqlite conflicts with the pdo_sqlite extension. If you want to use Swoole and pdo_sqlite, please delete the pdo_sqlite extension and enable swoole and swoole-hook-sqlite. This extension contains an implementation of the coroutine environment for pdo_sqlite.

swow

  1. Only PHP 8.0 ~ 8.4 is supported.

imagick

  1. The imagick extension currently only has openmp support on musl libc. This means that multithreading is disabled on glibc or other operating systems. The extension is still fully functional.

imap

  1. Kerberos is not supported
  2. ext-imap is not thread safe due to the underlying c-client. It's not possible to use it in --enable-zts builds.
  3. Because the extension may be dropped from php, we recommend you look for an alternative implementation, such as Webklex/php-imap

gd

  1. gd Extension relies on more additional Graphics library. By default, using bin/spc build gd directly will not support some Graphics library, such as libjpeg, libavif, etc. Currently, it supports four libraries: freetype,libjpeg,libavif,libwebp. Therefore, the following command can be used to introduce them into the gd library:
bash
bin/spc build gd --with-libs=freetype,libjpeg,libavif,libwebp --build-cli

mcrypt

  1. Currently not supported, and this extension will not be supported in the future. #32

oci8

  1. oci8 is an extension of the Oracle database, because the library on which the extension provided by Oracle does not provide a statically compiled version (.a) or source code, and this extension cannot be compiled into php by static linking, so it cannot be supported.

xdebug

  1. Xdebug is only buildable as a shared extension. On Linux, you need to use static-php-cli with SPC_LIBC=glibc.
  2. When using Linux/glibc or macOS, you can compile Xdebug as a shared extension using --build-shared="xdebug". The compiled ./php binary can be configured and run by specifying the INI, eg ./php -d 'zend_extension=/path/to/xdebug.so' your-code.php.

xml

  1. xml includes xml, xmlreader, xmlwriter, xsl, dom, simplexml, etc. When adding xml extensions, it is best to enable these extensions at the same time.
  2. libxml is included in xml extension. Enabling xml is equivalent to enabling libxml.

glfw

  1. glfw depends on OpenGL, and linux environment also needs X11, which cannot be linked statically.
  2. macOS platform, we can compile and link system builtin OpenGL and related libraries dynamically.

rar

  1. The rar extension currently has a problem when compiling phpmicro with the common extension collection in the macOS x86_64 environment.

pgsql

pgsql ssl connection is not compatible with openssl 3.2.0. See:

pgsql 16.2 has fixed this bug, now it's working.

When pgsql uses SSL connection, there may be error:80000002:system library::No such file or directory error, For details on the solution, see FAQ - Unable to use ssl.

openssl

When using openssl-based extensions (such as curl, pgsql and other network libraries), there may be an error:80000002:system library::No such file or directory error. For details on the solution, see FAQ - Unable to use ssl.

password-argon2

  1. password-argon2 is not a standard extension, it is an additional algorithm for the password_hash function.
  2. On Linux systems, password-argon2 dependency libargon2 conflicts with the libsodium library.

ffi

  1. Due to the limitation of musl libc's static linkage, you cannot use ffi because dynamic libraries cannot be loaded. If you need to use the ffi extension, see Compile PHP with GNU libc.
  2. macOS supports the ffi extension, but errors will occur when some kernels do not contain debugging symbols.
  3. Windows x64 supports the ffi extension.

xhprof

The xhprof extension consists of three parts: xhprof_extension, xhprof_html, xhprof_libs. Only xhprof_extension is included in the compiled binary. If you need to use xhprof, please download the source code from pecl.php.net/package/xhprof and specify the xhprof_libs and xhprof_html paths for use.

event

If you enable event extension on macOS, the openpty will be disabled due to issue:

parallel

Parallel is only supported on PHP 8.0 ZTS and above.

spx

  1. SPX does not support Windows, and the official repository does not support static compilation. static-php-cli uses a modified version.

mimalloc

  1. This is not technically an extension, but a library.
  2. Building with --with-libs="mimalloc" on Linux or macOS will override the default allocator.
  3. This is experimental for now, but is recommended in threaded environments.
',61)]))}const u=o(s,[["render",t]]);export{b as __pageData,u as default}; diff --git a/assets/en_guide_extension-notes.md.DadE5Bxb.lean.js b/assets/en_guide_extension-notes.md.DadE5Bxb.lean.js new file mode 100644 index 00000000..12f53f9f --- /dev/null +++ b/assets/en_guide_extension-notes.md.DadE5Bxb.lean.js @@ -0,0 +1 @@ +import{_ as o,c as i,o as a,af as l}from"./chunks/framework.PeLcR_tw.js";const b=JSON.parse('{"title":"Extension Notes","description":"","frontmatter":{},"headers":[],"relativePath":"en/guide/extension-notes.md","filePath":"en/guide/extension-notes.md"}'),s={name:"en/guide/extension-notes.md"};function t(n,e,r,h,d,c){return a(),i("div",null,e[0]||(e[0]=[l("",61)]))}const u=o(s,[["render",t]]);export{b as __pageData,u as default}; diff --git a/assets/en_guide_extensions.md.Bh08P1y7.js b/assets/en_guide_extensions.md.Bh08P1y7.js new file mode 100644 index 00000000..143983cb --- /dev/null +++ b/assets/en_guide_extensions.md.Bh08P1y7.js @@ -0,0 +1 @@ +import{_ as o}from"./chunks/SearchTable.B9T2e1C1.js";import{c as i,o as s,af as t,J as a}from"./chunks/framework.PeLcR_tw.js";const d=JSON.parse('{"title":"Extensions","description":"","frontmatter":{},"headers":[],"relativePath":"en/guide/extensions.md","filePath":"en/guide/extensions.md"}'),n={name:"en/guide/extensions.md"},u=Object.assign(n,{setup(l){return(r,e)=>(s(),i("div",null,[e[0]||(e[0]=t('

Extensions

  • yes: supported
  • blank: not supported yet, or WIP
  • no with issue link: confirmed to be unavailable due to issue
  • partial with issue link: supported but not perfect due to issue
',2)),a(o),e[1]||(e[1]=t('

TIP

If an extension you need is missing, you can create a Feature Request.

Some extensions or libraries that the extension depends on will have some optional features. For example, the gd library optionally supports libwebp, freetype, etc. If you only use bin/spc build gd --build-cli they will not be included (static-php-cli defaults to the minimum dependency principle).

For more information about optional libraries, see Extensions, Library Dependency Map. For optional libraries, you can also select an extension from the Command Generator and then select optional libraries.

',1))]))}});export{d as __pageData,u as default}; diff --git a/assets/en_guide_extensions.md.Bh08P1y7.lean.js b/assets/en_guide_extensions.md.Bh08P1y7.lean.js new file mode 100644 index 00000000..657fc447 --- /dev/null +++ b/assets/en_guide_extensions.md.Bh08P1y7.lean.js @@ -0,0 +1 @@ +import{_ as o}from"./chunks/SearchTable.B9T2e1C1.js";import{c as i,o as s,af as t,J as a}from"./chunks/framework.PeLcR_tw.js";const d=JSON.parse('{"title":"Extensions","description":"","frontmatter":{},"headers":[],"relativePath":"en/guide/extensions.md","filePath":"en/guide/extensions.md"}'),n={name:"en/guide/extensions.md"},u=Object.assign(n,{setup(l){return(r,e)=>(s(),i("div",null,[e[0]||(e[0]=t("",2)),a(o),e[1]||(e[1]=t("",1))]))}});export{d as __pageData,u as default}; diff --git a/assets/en_guide_extensions.md.CvNq1b9J.js b/assets/en_guide_extensions.md.CvNq1b9J.js deleted file mode 100644 index 42729b50..00000000 --- a/assets/en_guide_extensions.md.CvNq1b9J.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as t}from"./chunks/SearchTable.CnJN64_Q.js";import{c as o,I as i,a1 as e,o as s}from"./chunks/framework.gjrnbxUT.js";const a=e('

Extensions

  • yes: supported
  • blank: not supported yet, or WIP
  • no with issue link: confirmed to be unavailable due to issue
  • partial with issue link: supported but not perfect due to issue
',2),n=e('

TIP

If an extension you need is missing, you can create a Feature Request.

Some extensions or libraries that the extension depends on will have some optional features. For example, the gd library optionally supports libwebp, freetype, etc. If you only use bin/spc build gd --build-cli they will not be included (static-php-cli defaults to the minimum dependency principle).

For more information about optional libraries, see Extensions, Library Dependency Map. For optional libraries, you can also select an extension from the Command Generator and then select optional libraries.

',1),_=JSON.parse('{"title":"Extensions","description":"","frontmatter":{},"headers":[],"relativePath":"en/guide/extensions.md","filePath":"en/guide/extensions.md"}'),l={name:"en/guide/extensions.md"},m=Object.assign(l,{setup(r){return(c,p)=>(s(),o("div",null,[a,i(t),n]))}});export{_ as __pageData,m as default}; diff --git a/assets/en_guide_extensions.md.CvNq1b9J.lean.js b/assets/en_guide_extensions.md.CvNq1b9J.lean.js deleted file mode 100644 index 3128a2f4..00000000 --- a/assets/en_guide_extensions.md.CvNq1b9J.lean.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as t}from"./chunks/SearchTable.CnJN64_Q.js";import{c as o,I as i,a1 as e,o as s}from"./chunks/framework.gjrnbxUT.js";const a=e("",2),n=e("",1),_=JSON.parse('{"title":"Extensions","description":"","frontmatter":{},"headers":[],"relativePath":"en/guide/extensions.md","filePath":"en/guide/extensions.md"}'),l={name:"en/guide/extensions.md"},m=Object.assign(l,{setup(r){return(c,p)=>(s(),o("div",null,[a,i(t),n]))}});export{_ as __pageData,m as default}; diff --git a/assets/en_guide_index.md.BE1G5v55.js b/assets/en_guide_index.md.BE1G5v55.js new file mode 100644 index 00000000..193f8657 --- /dev/null +++ b/assets/en_guide_index.md.BE1G5v55.js @@ -0,0 +1 @@ +import{_ as t,c as i,o,af as r}from"./chunks/framework.PeLcR_tw.js";const h=JSON.parse('{"title":"Guide","description":"","frontmatter":{},"headers":[],"relativePath":"en/guide/index.md","filePath":"en/guide/index.md"}'),n={name:"en/guide/index.md"};function a(s,e,d,l,p,c){return o(),i("div",null,e[0]||(e[0]=[r('

Guide

Static php cli is a tool used to build statically compiled PHP binaries, currently supporting Linux and macOS systems.

In the guide section, you will learn how to use static php cli to build standalone PHP programs.

Compilation Environment

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.

x86_64aarch64
macOS⚙️ 💻⚙️ 💻
Linux⚙️ 💻⚙️ 💻
Windows⚙️ 💻
FreeBSD💻💻

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.

There are two architectures for macOS: x86_64 and Arm, but binaries compiled on one architecture cannot be directly used on the other architecture. Rosetta 2 cannot guarantee that programs compiled with Arm architecture can fully run on x86_64 environment.

Windows currently only supports the x86_64 architecture, and does not support 32-bit x86 or arm64 architecture.

Supported PHP Version

Currently, static php cli supports PHP versions 8.1 to 8.4, and theoretically supports PHP 8.0 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.

',12)]))}const m=t(n,[["render",a]]);export{h as __pageData,m as default}; diff --git a/assets/en_guide_index.md.BE1G5v55.lean.js b/assets/en_guide_index.md.BE1G5v55.lean.js new file mode 100644 index 00000000..f3b74d1d --- /dev/null +++ b/assets/en_guide_index.md.BE1G5v55.lean.js @@ -0,0 +1 @@ +import{_ as t,c as i,o,af as r}from"./chunks/framework.PeLcR_tw.js";const h=JSON.parse('{"title":"Guide","description":"","frontmatter":{},"headers":[],"relativePath":"en/guide/index.md","filePath":"en/guide/index.md"}'),n={name:"en/guide/index.md"};function a(s,e,d,l,p,c){return o(),i("div",null,e[0]||(e[0]=[r("",12)]))}const m=t(n,[["render",a]]);export{h as __pageData,m as default}; diff --git a/assets/en_guide_index.md.BScdGPaV.js b/assets/en_guide_index.md.BScdGPaV.js deleted file mode 100644 index db906e62..00000000 --- a/assets/en_guide_index.md.BScdGPaV.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as e,c as t,o,a1 as i}from"./chunks/framework.gjrnbxUT.js";const b=JSON.parse('{"title":"Guide","description":"","frontmatter":{},"headers":[],"relativePath":"en/guide/index.md","filePath":"en/guide/index.md"}'),r={name:"en/guide/index.md"},n=i('

Guide

Static php cli is a tool used to build statically compiled PHP binaries, currently supporting Linux and macOS systems.

In the guide section, you will learn how to use static php cli to build standalone PHP programs.

Compilation Environment

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.

x86_64aarch64
macOS⚙️ 💻⚙️ 💻
Linux⚙️ 💻⚙️ 💻
Windows⚙️ 💻
FreeBSD💻💻

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.

There are two architectures for macOS: x86_64 and Arm, but binaries compiled on one architecture cannot be directly used on the other architecture. Rosetta 2 cannot guarantee that programs compiled with Arm architecture can fully run on x86_64 environment.

Windows currently only supports the x86_64 architecture, and does not support 32-bit x86 or arm64 architecture.

Supported PHP Version

Currently, static php cli supports PHP versions 8.1 to 8.4, and theoretically supports PHP 8.0 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.

',12),a=[n];function s(d,l,c,p,u,h){return o(),t("div",null,a)}const _=e(r,[["render",s]]);export{b as __pageData,_ as default}; diff --git a/assets/en_guide_index.md.BScdGPaV.lean.js b/assets/en_guide_index.md.BScdGPaV.lean.js deleted file mode 100644 index da58b7d3..00000000 --- a/assets/en_guide_index.md.BScdGPaV.lean.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as e,c as t,o,a1 as i}from"./chunks/framework.gjrnbxUT.js";const b=JSON.parse('{"title":"Guide","description":"","frontmatter":{},"headers":[],"relativePath":"en/guide/index.md","filePath":"en/guide/index.md"}'),r={name:"en/guide/index.md"},n=i("",12),a=[n];function s(d,l,c,p,u,h){return o(),t("div",null,a)}const _=e(r,[["render",s]]);export{b as __pageData,_ as default}; diff --git a/assets/en_guide_manual-build.md.BU7HLqGh.js b/assets/en_guide_manual-build.md.BCHDiDxK.js similarity index 55% rename from assets/en_guide_manual-build.md.BU7HLqGh.js rename to assets/en_guide_manual-build.md.BCHDiDxK.js index 748a5f53..14f6a669 100644 --- a/assets/en_guide_manual-build.md.BU7HLqGh.js +++ b/assets/en_guide_manual-build.md.BCHDiDxK.js @@ -1,4 +1,4 @@ -import{_ as s,c as i,o as e,a1 as a}from"./chunks/framework.gjrnbxUT.js";const g=JSON.parse('{"title":"Build (Linux, macOS, FreeBSD)","description":"","frontmatter":{"outline":"deep"},"headers":[],"relativePath":"en/guide/manual-build.md","filePath":"en/guide/manual-build.md"}'),n={name:"en/guide/manual-build.md"},t=a(`

Build (Linux, macOS, FreeBSD)

This section covers the build process for Linux, macOS, and FreeBSD. If you want to build on Windows, also need to read Build on Windows.

This project provides a binary file of static-php-cli. You can directly download the binary file of the corresponding platform and then use it to build static PHP. Currently, the platforms supported by spc binary are Linux and macOS.

Here's how to download from self-hosted server:

bash
# Download from self-hosted nightly builds (sync with main branch)
+import{_ as s,c as e,o as a,af as n}from"./chunks/framework.PeLcR_tw.js";const k=JSON.parse('{"title":"Build (Linux, macOS, FreeBSD)","description":"","frontmatter":{"outline":"deep"},"headers":[],"relativePath":"en/guide/manual-build.md","filePath":"en/guide/manual-build.md"}'),t={name:"en/guide/manual-build.md"};function l(p,i,h,o,d,r){return a(),e("div",null,i[0]||(i[0]=[n(`

Build (Linux, macOS, FreeBSD)

This section covers the build process for Linux, macOS, and FreeBSD. If you want to build on Windows, also need to read Build on Windows.

This project provides a binary file of static-php-cli. You can directly download the binary file of the corresponding platform and then use it to build static PHP. Currently, the platforms supported by spc binary are Linux and macOS.

Here's how to download from self-hosted server:

bash
# Download from self-hosted nightly builds (sync with main branch)
 # For Linux x86_64
 curl -fsSL -o spc https://dl.static-php.dev/static-php-cli/spc-bin/nightly/spc-linux-x86_64
 # For Linux aarch64
@@ -16,16 +16,16 @@ import{_ as s,c as i,o as e,a1 as a}from"./chunks/framework.gjrnbxUT.js";const g
 # Run (Linux and macOS)
 ./spc --version
 # Run (Windows powershell)
-.\\spc.exe --version

If you are using the packaged spc binary, you will need to replace the leading bin/spc with ./spc in all the commands below.

Build locally (using source code)

If you have problems using the spc binary, or if you need to modify the static-php-cli source code, download static-php-cli from the source code.

Currently, it supports building on macOS and Linux. macOS supports the latest version of the operating system and two architectures, while Linux supports Debian and derivative distributions, as well as Alpine Linux.

Because this project itself is developed using PHP, it is also necessary to install PHP on the system during compilation. This project also provides static binary PHP suitable for this project, which can be selected and used according to actual situations.

bash
# clone repo
+.\\spc.exe --version

If you are using the packaged spc binary, you will need to replace the leading bin/spc with ./spc in all the commands below.

Build locally (using source code)

If you have problems using the spc binary, or if you need to modify the static-php-cli source code, download static-php-cli from the source code.

Currently, it supports building on macOS and Linux. macOS supports the latest version of the operating system and two architectures, while Linux supports Debian and derivative distributions, as well as Alpine Linux.

Because this project itself is developed using PHP, it is also necessary to install PHP on the system during compilation. This project also provides static binary PHP suitable for this project, which can be selected and used according to actual situations.

bash
# clone repo
 git clone https://github.com/crazywhalecc/static-php-cli.git --depth=1
 cd static-php-cli
 
 # You need to install the PHP environment first before running Composer and this project. The installation method can be referred to below.
-composer update

Use Precompiled Static PHP Binaries

If you don't want to use Docker and install PHP in the system, you can directly download the php binary cli program compiled by this project itself. The usage process is as follows:

Deploy the environment using the command, the command will download a static php-cli binary from self-hosted server. Next, it will automatically download Composer from getcomposer or Aliyun mirror.

TIP

Using precompiled static PHP binaries is currently only supported on Linux and macOS. The FreeBSD environment is currently not supported due to the lack of an automated build environment.

bash
bin/setup-runtime
+composer update

Use Precompiled Static PHP Binaries

If you don't want to use Docker and install PHP in the system, you can directly download the php binary cli program compiled by this project itself. The usage process is as follows:

Deploy the environment using the command, the command will download a static php-cli binary from self-hosted server. Next, it will automatically download Composer from getcomposer or Aliyun mirror.

TIP

Using precompiled static PHP binaries is currently only supported on Linux and macOS. The FreeBSD environment is currently not supported due to the lack of an automated build environment.

bash
bin/setup-runtime
 
 # For users with special network environments such as mainland China, you can use mirror sites (aliyun) to speed up the download speed
-bin/setup-runtime --mirror china

This script will download two files in total: bin/php and bin/composer. After the download is complete, there are two ways to use it:

  1. Add the bin/ directory to the PATH: export PATH="/path/to/your/static-php-cli/bin:$PATH", after adding the path, it is equivalent to installing PHP in the system, you can directly Use commands such as composer, php -v, or directly use bin/spc.
  2. Direct call, such as executing static-php-cli command: bin/php bin/spc --help, executing Composer: bin/php bin/composer update.

Use Docker

If you don't want to install PHP and Composer runtime environment on your system, you can use the built-in Docker environment build script.

bash
# To use directly, replace \`bin/spc\` with \`bin/spc-alpine-docker\` in all used commands
-bin/spc-alpine-docker

The first time the command is executed, docker build will be used to build a Docker image. The default built Docker image is the x86_64 architecture, and the image name is cwcc-spc-x86_64.

If you want to build aarch64 static-php-cli in x86_64 environment, you can use qemu to emulate the arm image to run Docker, but the speed will be very slow. Use command: SPC_USE_ARCH=aarch64 bin/spc-alpine-docker.

If it prompts that sudo is required to run after running, execute the following command once to grant static-php-cli permission to execute sudo:

bash
export SPC_USE_SUDO=yes

Use System PHP

Below are some example commands for installing PHP and Composer in the system. It is recommended to search for the specific installation method yourself or ask the AI search engine to obtain the answer, which will not be elaborated here.

bash
# [macOS], need install Homebrew first. See https://brew.sh/
+bin/setup-runtime --mirror china

This script will download two files in total: bin/php and bin/composer. After the download is complete, there are two ways to use it:

  1. Add the bin/ directory to the PATH: export PATH="/path/to/your/static-php-cli/bin:$PATH", after adding the path, it is equivalent to installing PHP in the system, you can directly Use commands such as composer, php -v, or directly use bin/spc.
  2. Direct call, such as executing static-php-cli command: bin/php bin/spc --help, executing Composer: bin/php bin/composer update.

Use Docker

If you don't want to install PHP and Composer runtime environment on your system, you can use the built-in Docker environment build script.

bash
# To use directly, replace \`bin/spc\` with \`bin/spc-alpine-docker\` in all used commands
+bin/spc-alpine-docker

The first time the command is executed, docker build will be used to build a Docker image. The default built Docker image is the x86_64 architecture, and the image name is cwcc-spc-x86_64.

If you want to build aarch64 static-php-cli in x86_64 environment, you can use qemu to emulate the arm image to run Docker, but the speed will be very slow. Use command: SPC_USE_ARCH=aarch64 bin/spc-alpine-docker.

If it prompts that sudo is required to run after running, execute the following command once to grant static-php-cli permission to execute sudo:

bash
export SPC_USE_SUDO=yes

Use System PHP

Below are some example commands for installing PHP and Composer in the system. It is recommended to search for the specific installation method yourself or ask the AI search engine to obtain the answer, which will not be elaborated here.

bash
# [macOS], need install Homebrew first. See https://brew.sh/
 # Remember change your composer executable path. For M1/M2 Chip mac, "/opt/homebrew/bin/", for Intel mac, "/usr/local/bin/". Or add it to your own path.
 brew install php wget
 wget https://getcomposer.org/download/latest-stable/composer.phar -O /path/to/your/bin/composer && chmod +x /path/to/your/bin/composer
@@ -34,12 +34,12 @@ import{_ as s,c as i,o as e,a1 as a}from"./chunks/framework.gjrnbxUT.js";const g
 sudo apt install php-cli composer php-tokenizer
 
 # [Alpine]
-apk add bash file wget xz php81 php81-common php81-pcntl php81-tokenizer php81-phar php81-posix php81-xml composer

TIP

Currently, some versions of Ubuntu install older PHP versions, so no installation commands are provided. If necessary, it is recommended to add software sources such as ppa first, and then install the latest version of PHP and tokenizer, XML, and phar extensions.

Older versions of Debian may have an older (<= 7.4) version of PHP installed by default, it is recommended to upgrade Debian first.

Using bin/spc craft, you can use a configuration file and a command to automatically check the environment, download source code, build dependency libraries, build PHP and extensions, etc.

You need to write a craft.yml file and save it in the current working directory. craft.yml can be generated by command generator or written manually.

For manual writing, please refer to the comments in craft.yml configuration to write it. Let's assume that you compile an extension combination and choose PHP 8.4, outputting cli and fpm:

yaml
# path/to/craft.yml
+apk add bash file wget xz php81 php81-common php81-pcntl php81-tokenizer php81-phar php81-posix php81-xml composer

TIP

Currently, some versions of Ubuntu install older PHP versions, so no installation commands are provided. If necessary, it is recommended to add software sources such as ppa first, and then install the latest version of PHP and tokenizer, XML, and phar extensions.

Older versions of Debian may have an older (<= 7.4) version of PHP installed by default, it is recommended to upgrade Debian first.

Using bin/spc craft, you can use a configuration file and a command to automatically check the environment, download source code, build dependency libraries, build PHP and extensions, etc.

You need to write a craft.yml file and save it in the current working directory. craft.yml can be generated by command generator or written manually.

For manual writing, please refer to the comments in craft.yml configuration to write it. Let's assume that you compile an extension combination and choose PHP 8.4, outputting cli and fpm:

yaml
# path/to/craft.yml
 php-version: 8.4
 extensions: bcmath,posix,phar,zlib,openssl,curl,fileinfo,tokenizer
 sapi:
   - cli
-  - fpm

Then use the bin/spc craft command to compile:

bash
bin/spc craft --debug

If the build is successful, you will see the buildroot/bin directory in the current directory, which contains the compiled PHP binary file, or the corresponding SAPI.

  • cli: The build result is buildroot/bin/php.exe on Windows and buildroot/bin/php on other platforms.
  • fpm: The build result is buildroot/bin/php-fpm.
  • micro: The build result is buildroot/bin/micro.sfx. If you need to further package it with PHP code, please refer to Packaging micro binary.
  • embed: See Using embed.

If the build fails, you can use the --debug parameter to view detailed error information, or use the --with-clean to clear the old compilation results and recompile.

If the build still fails to use the above method, please submit an issue and attach your craft.yml and craft.log.

Step-by-step build command

If you have customized requirements, or the need to download and compile PHP and dependent libraries separately, you can use the bin/spc command to execute step by step.

Command download - Download dependency packages

Use the command bin/spc download to download the source code required for compilation, including php-src and the source code of various dependent libraries.

bash
# Download all dependencies, defaults to php 8.4
+  - fpm

Then use the bin/spc craft command to compile:

bash
bin/spc craft --debug

If the build is successful, you will see the buildroot/bin directory in the current directory, which contains the compiled PHP binary file, or the corresponding SAPI.

  • cli: The build result is buildroot/bin/php.exe on Windows and buildroot/bin/php on other platforms.
  • fpm: The build result is buildroot/bin/php-fpm.
  • micro: The build result is buildroot/bin/micro.sfx. If you need to further package it with PHP code, please refer to Packaging micro binary.
  • embed: See Using embed.

If the build fails, you can use the --debug parameter to view detailed error information, or use the --with-clean to clear the old compilation results and recompile.

If the build still fails to use the above method, please submit an issue and attach your craft.yml and craft.log.

Step-by-step build command

If you have customized requirements, or the need to download and compile PHP and dependent libraries separately, you can use the bin/spc command to execute step by step.

Command download - Download dependency packages

Use the command bin/spc download to download the source code required for compilation, including php-src and the source code of various dependent libraries.

bash
# Download all dependencies, defaults to php 8.4
 bin/spc download --all
 
 # Download all dependent packages, and specify the main version of PHP to download, optional: 8.1, 8.2, 8.3, 8.4
@@ -74,51 +74,51 @@ import{_ as s,c as i,o as e,a1 as a}from"./chunks/framework.gjrnbxUT.js";const g
 bin/spc download --for-extensions=curl,pcntl,xml --ignore-cache-sources=php-src --with-php=8.3.10
 
 # Set retry times (default is 0)
-bin/spc download --all --retry=2

If the network in your area is not good, or the speed of downloading the dependency package is too slow, you can download download.zip which is packaged regularly every week from GitHub Action, and use the command to directly use the zip archive as a dependency.

Dependent packages can be downloaded locally from Action. Enter Action and select the latest Workflow that has been successfully run, and download download-files-x.y.

bash
bin/spc download --from-zip=/path/to/your/download.zip

If a source cannot be downloaded all the time, or you need to download some specific version of the package, such as downloading the beta version of PHP, the old version of the library, etc., you can use the parameter -U or --custom-url to rewrite the download link, Make the downloader force the link you specify to download packages from this source. The method of use is {source-name}:{url}, which can rewrite the download URLs of multiple libraries at the same time. Also, it is available when downloading with the --for-extensions option.

bash
# Specifying to download a beta version of PHP8.3
+bin/spc download --all --retry=2

If the network in your area is not good, or the speed of downloading the dependency package is too slow, you can download download.zip which is packaged regularly every week from GitHub Action, and use the command to directly use the zip archive as a dependency.

Dependent packages can be downloaded locally from Action. Enter Action and select the latest Workflow that has been successfully run, and download download-files-x.y.

bash
bin/spc download --from-zip=/path/to/your/download.zip

If a source cannot be downloaded all the time, or you need to download some specific version of the package, such as downloading the beta version of PHP, the old version of the library, etc., you can use the parameter -U or --custom-url to rewrite the download link, Make the downloader force the link you specify to download packages from this source. The method of use is {source-name}:{url}, which can rewrite the download URLs of multiple libraries at the same time. Also, it is available when downloading with the --for-extensions option.

bash
# Specifying to download a beta version of PHP8.3
 bin/spc download --all -U "php-src:https://downloads.php.net/~eric/php-8.3.0beta1.tar.gz"
 
 # Specifying to download an older version of the curl library
-bin/spc download --all -U "curl:https://curl.se/download/curl-7.88.1.tar.gz"

If the source you download is not a link, but a git repository, you can use -G or --custom-git to rewrite the download link, so that the downloader can force the use of the specified git repository to download packages from this source. The usage method is {source-name}:{branch}:{url}, which can rewrite the download link of multiple libraries at the same time. It is also available when downloading with the --for-extensions option.

bash
# Specifying to download the source code of the PHP extension from the specified branch of the git repository
+bin/spc download --all -U "curl:https://curl.se/download/curl-7.88.1.tar.gz"

If the source you download is not a link, but a git repository, you can use -G or --custom-git to rewrite the download link, so that the downloader can force the use of the specified git repository to download packages from this source. The usage method is {source-name}:{branch}:{url}, which can rewrite the download link of multiple libraries at the same time. It is also available when downloading with the --for-extensions option.

bash
# Specifying to download the source code of the PHP extension from the specified branch of the git repository
 bin/spc download --for-extensions=redis -G "php-src:master:https://github.com/php/php-src.git"
 
 # Download the latest code from the master branch of the swoole-src repository instead of PECL release version
-bin/spc download --for-extensions=swoole -G "swoole:master:https://github.com/swoole/swoole-src.git"

Command - doctor

If you can run bin/spc normally but cannot compile static PHP or dependent libraries normally, you can run bin/spc doctor first to check whether the system itself lacks dependencies.

bash
# Quick check
+bin/spc download --for-extensions=swoole -G "swoole:master:https://github.com/swoole/swoole-src.git"

Command - doctor

If you can run bin/spc normally but cannot compile static PHP or dependent libraries normally, you can run bin/spc doctor first to check whether the system itself lacks dependencies.

bash
# Quick check
 bin/spc doctor
 
 # Quickly check and fix when it can be automatically repaired (use package management to install dependent packages, only support the above-mentioned operating systems and distributions)
-bin/spc doctor --auto-fix

Command - build

Use the build command to start building the static php binary. Before executing the bin/spc build command, be sure to use the download command to download sources. It is recommended to use doctor to check the environment.

Basic build

You need to go to Extension List or Command Generator to select the extension you want to add, and then use the command bin/spc build to compile. You need to specify a compilation target, choose from the following parameters:

  • --build-cli: Build a cli sapi (command line interface, which can execute PHP code on the command line)
  • --build-fpm: Build a fpm sapi (php-fpm, used in conjunction with other traditional fpm architecture software such as nginx)
  • --build-micro: Build a micro sapi (used to build a standalone executable binary containing PHP code)
  • --build-embed: Build an embed sapi (used to embed into other C language programs)
  • --build-all: build all above sapi
bash
# Compile PHP with bcmath,curl,openssl,ftp,posix,pcntl extensions, the compilation target is cli
+bin/spc doctor --auto-fix

Command - build

Use the build command to start building the static php binary. Before executing the bin/spc build command, be sure to use the download command to download sources. It is recommended to use doctor to check the environment.

Basic build

You need to go to Extension List or Command Generator to select the extension you want to add, and then use the command bin/spc build to compile. You need to specify a compilation target, choose from the following parameters:

  • --build-cli: Build a cli sapi (command line interface, which can execute PHP code on the command line)
  • --build-fpm: Build a fpm sapi (php-fpm, used in conjunction with other traditional fpm architecture software such as nginx)
  • --build-micro: Build a micro sapi (used to build a standalone executable binary containing PHP code)
  • --build-embed: Build an embed sapi (used to embed into other C language programs)
  • --build-all: build all above sapi
bash
# Compile PHP with bcmath,curl,openssl,ftp,posix,pcntl extensions, the compilation target is cli
 bin/spc build bcmath,curl,openssl,ftp,posix,pcntl --build-cli
 
 # Compile PHP with phar,curl,posix,pcntl,tokenizer extensions, compile target is micro
-bin/spc build phar,curl,posix,pcntl,tokenizer --build-micro

TIP

If you need to repeatedly build and debug, you can delete the buildroot/ and source/ directories so that you can re-extract and build all you need from the downloaded source code package:

shell
# remove
+bin/spc build phar,curl,posix,pcntl,tokenizer --build-micro

TIP

If you need to repeatedly build and debug, you can delete the buildroot/ and source/ directories so that you can re-extract and build all you need from the downloaded source code package:

shell
# remove
 rm -rf buildroot source
 # build again
-bin/spc build bcmath,curl,openssl,ftp,posix,pcntl --build-cli

TIP

If you want to build multiple versions of PHP and don't want to build other dependent libraries repeatedly each time, you can use switch-php-version to quickly switch to another version and compile after compiling one version:

shell
# switch to 8.4
+bin/spc build bcmath,curl,openssl,ftp,posix,pcntl --build-cli

TIP

If you want to build multiple versions of PHP and don't want to build other dependent libraries repeatedly each time, you can use switch-php-version to quickly switch to another version and compile after compiling one version:

shell
# switch to 8.4
 bin/spc switch-php-version 8.4
 # build
 bin/spc build bcmath,curl,openssl,ftp,posix,pcntl --build-cli
 # switch to 8.1
 bin/spc switch-php-version 8.1
 # build
-bin/spc build bcmath,curl,openssl,ftp,posix,pcntl --build-cli

Build Options

During the compilation process, in some special cases, the compiler and the content of the compilation directory need to be intervened. You can try to use the following commands:

  • --cc=XXX: Specifies the execution command of the C language compiler (Linux default musl-gcc or gcc, macOS default clang)
  • --cxx=XXX: Specifies the execution command of the C++ language compiler (Linux defaults to g++, macOS defaults to clang++)
  • --with-clean: clean up old make files before compiling PHP
  • --enable-zts: Make compiled PHP thread-safe version (default is NTS version)
  • --no-strip: Do not run strip after compiling the PHP library to trim the binary file to reduce its size (the macOS binary file without trim can use dynamically linked third-party extensions)
  • --with-libs=XXX,YYY: Compile the specified dependent library before compiling PHP, and activate some extended optional functions (such as libavif of the gd library, etc.)
  • --with-config-file-path=XXX: Set the path in which to look for php.ini (Check here for default paths)
  • --with-config-file-scan-dir=XXX: Set the directory to scan for .ini files after reading php.ini (Check here for default paths)
  • -I xxx=yyy: Hard compile INI options into PHP before compiling (support multiple options, alias is --with-hardcoded-ini)
  • --with-micro-fake-cli: When compiling micro, let micro's PHP_SAPI pretend to be cli (for compatibility with some programs that check PHP_SAPI)
  • --disable-opcache-jit: Disable opcache jit (enabled by default)
  • -P xxx.php: Inject external scripts during static-php-cli compilation (see Inject external scripts below for details)
  • --without-micro-ext-test: After building micro.sfx, do not test the running results of different extensions in micro.sfx
  • --with-suggested-exts: Add ext-suggests as dependencies when compiling
  • --with-suggested-libs: Add lib-suggests as dependencies when compiling
  • --with-upx-pack: Use UPX to reduce the size of the binary file after compilation (you need to use bin/spc install-pkg upx to install upx first)
  • --build-shared=XXX,YYY: compile the specified extension into a shared library (the default is to compile into a static library)

For hardcoding INI options, it works for cli, micro, embed sapi. Here is a simple example where we preset a larger memory_limit and disable the system function:

bash
bin/spc build bcmath,pcntl,posix --build-all -I "memory_limit=4G" -I "disable_functions=system"

Debug

If you encounter problems during the compilation process, or want to view each executing shell command, you can use --debug to enable debug mode and view all terminal logs:

bash
bin/spc build mysqlnd,pdo_mysql --build-all --debug

Command - micro:combine

Use the micro:combine command to build the compiled micro.sfx and your code (.php or .phar file) into an executable binary. You can also use this command to directly build a micro binary injected with ini configuration.

TIP

Injecting ini configuration refers to adding a special structure after micro.sfx to save ini configuration items before combining micro.sfx with PHP source code.

micro.sfx can identify the INI file header through a special byte, and the micro can be started with INI through the INI file header.

The original wiki of this feature is in phpmicro - Wiki, and this feature may change in the future.

The following is the general usage, directly packaging the php source code into a file:

bash
# Before doing the packaging process, you should use \`build --build-micro\` to compile micro.sfx
+bin/spc build bcmath,curl,openssl,ftp,posix,pcntl --build-cli

Build Options

During the compilation process, in some special cases, the compiler and the content of the compilation directory need to be intervened. You can try to use the following commands:

  • --cc=XXX: Specifies the execution command of the C language compiler (Linux default musl-gcc or gcc, macOS default clang)
  • --cxx=XXX: Specifies the execution command of the C++ language compiler (Linux defaults to g++, macOS defaults to clang++)
  • --with-clean: clean up old make files before compiling PHP
  • --enable-zts: Make compiled PHP thread-safe version (default is NTS version)
  • --no-strip: Do not run strip after compiling the PHP library to trim the binary file to reduce its size (the macOS binary file without trim can use dynamically linked third-party extensions)
  • --with-libs=XXX,YYY: Compile the specified dependent library before compiling PHP, and activate some extended optional functions (such as libavif of the gd library, etc.)
  • --with-config-file-path=XXX: Set the path in which to look for php.ini (Check here for default paths)
  • --with-config-file-scan-dir=XXX: Set the directory to scan for .ini files after reading php.ini (Check here for default paths)
  • -I xxx=yyy: Hard compile INI options into PHP before compiling (support multiple options, alias is --with-hardcoded-ini)
  • --with-micro-fake-cli: When compiling micro, let micro's PHP_SAPI pretend to be cli (for compatibility with some programs that check PHP_SAPI)
  • --disable-opcache-jit: Disable opcache jit (enabled by default)
  • -P xxx.php: Inject external scripts during static-php-cli compilation (see Inject external scripts below for details)
  • --without-micro-ext-test: After building micro.sfx, do not test the running results of different extensions in micro.sfx
  • --with-suggested-exts: Add ext-suggests as dependencies when compiling
  • --with-suggested-libs: Add lib-suggests as dependencies when compiling
  • --with-upx-pack: Use UPX to reduce the size of the binary file after compilation (you need to use bin/spc install-pkg upx to install upx first)
  • --build-shared=XXX,YYY: compile the specified extension into a shared library (the default is to compile into a static library)

For hardcoding INI options, it works for cli, micro, embed sapi. Here is a simple example where we preset a larger memory_limit and disable the system function:

bash
bin/spc build bcmath,pcntl,posix --build-all -I "memory_limit=4G" -I "disable_functions=system"

Debug

If you encounter problems during the compilation process, or want to view each executing shell command, you can use --debug to enable debug mode and view all terminal logs:

bash
bin/spc build mysqlnd,pdo_mysql --build-all --debug

Command - micro:combine

Use the micro:combine command to build the compiled micro.sfx and your code (.php or .phar file) into an executable binary. You can also use this command to directly build a micro binary injected with ini configuration.

TIP

Injecting ini configuration refers to adding a special structure after micro.sfx to save ini configuration items before combining micro.sfx with PHP source code.

micro.sfx can identify the INI file header through a special byte, and the micro can be started with INI through the INI file header.

The original wiki of this feature is in phpmicro - Wiki, and this feature may change in the future.

The following is the general usage, directly packaging the php source code into a file:

bash
# Before doing the packaging process, you should use \`build --build-micro\` to compile micro.sfx
 echo "<?php echo 'hello';" > a.php
 bin/spc micro:combine a.php
 
 # Just use it
-./my-app

You can use the following options to specify the file name to be output, and you can also specify micro.sfx in other paths for packaging.

bash
# specify the output filename
+./my-app

You can use the following options to specify the file name to be output, and you can also specify micro.sfx in other paths for packaging.

bash
# specify the output filename
 bin/spc micro:combine a.php --output=custom-bin
 # Use absolute path
 bin/spc micro:combine a.php -O /tmp/my-custom-app
 
 # Specify micro.sfx in other locations for packaging
-bin/spc micro:combine a.app --with-micro=/path/to/your/micro.sfx

If you want to inject ini configuration items, you can use the following parameters to add ini to the executable file from a file or command line option.

bash
# Specified using command-line options (-I is shorthand for --with-ini-set)
+bin/spc micro:combine a.app --with-micro=/path/to/your/micro.sfx

If you want to inject ini configuration items, you can use the following parameters to add ini to the executable file from a file or command line option.

bash
# Specified using command-line options (-I is shorthand for --with-ini-set)
 bin/spc micro:combine a.php -I "a=b" -I "foo=bar"
 
 # Use ini file specification (-N is shorthand for --with-ini-file)
-bin/spc micro:combine a.php -N /path/to/your/custom.ini

WARNING

Note, please do not directly use the PHP source code or the php.ini file in the system-installed PHP, it is best to manually write an ini configuration file that you need, for example:

ini
; custom.ini
+bin/spc micro:combine a.php -N /path/to/your/custom.ini

WARNING

Note, please do not directly use the PHP source code or the php.ini file in the system-installed PHP, it is best to manually write an ini configuration file that you need, for example:

ini
; custom.ini
 curl.cainfo=/path/to/your/cafile.pem
-memory_limit=1G

The ini injection of this command is achieved by appending a special structure after micro.sfx, which is different from the function of inserting hard-coded INI during compilation.

If you want to package phar, just replace a.php with the packaged phar file. But please note that micro.sfx under phar needs extra attention to the path problem, see Developing - Phar directory issue.

Command - extract

Use the command bin/spc extract to unpack and copy the source code required for compilation, including php-src and the source code of various dependent libraries (you need to specify the name of the library to be unpacked).

For example, after we have downloaded sources, we want to distribute and execute the build process, manually unpack and copy the package to a specified location, and we can use commands.

bash
# Unzip the downloaded compressed package of php-src and libxml2, and store the decompressed source code in the source directory
-bin/spc extract php-src,libxml2

Command - dump-extensions

Use the command bin/spc dump-extensions to export required extensions of the current project.

bash
# Print the extension list of the project, pass in the root directory of the project containing composer.json
+memory_limit=1G

The ini injection of this command is achieved by appending a special structure after micro.sfx, which is different from the function of inserting hard-coded INI during compilation.

If you want to package phar, just replace a.php with the packaged phar file. But please note that micro.sfx under phar needs extra attention to the path problem, see Developing - Phar directory issue.

Command - extract

Use the command bin/spc extract to unpack and copy the source code required for compilation, including php-src and the source code of various dependent libraries (you need to specify the name of the library to be unpacked).

For example, after we have downloaded sources, we want to distribute and execute the build process, manually unpack and copy the package to a specified location, and we can use commands.

bash
# Unzip the downloaded compressed package of php-src and libxml2, and store the decompressed source code in the source directory
+bin/spc extract php-src,libxml2

Command - dump-extensions

Use the command bin/spc dump-extensions to export required extensions of the current project.

bash
# Print the extension list of the project, pass in the root directory of the project containing composer.json
 bin/spc dump-extensions /path/to/your/project/
 
 # Print the extension list of the project, excluding development dependencies
@@ -134,7 +134,7 @@ import{_ as s,c as i,o as e,a1 as a}from"./chunks/framework.gjrnbxUT.js";const g
 bin/spc dump-extensions /path-to/your/project/ --no-ext-output=mbstring,posix,pcntl,phar
 
 # Do not exclude extensions not supported by spc when outputting
-bin/spc dump-extensions /path/to/your/project/ --no-spc-filter

It should be noted that the project directory must contain the vendor/installed.json and composer.lock files, otherwise they cannot be found normally.

Dev Command - dev

Debug commands refer to a collection of commands that can assist in outputting some information when you use static-php-cli to build PHP or modify and enhance the static-php-cli project itself.

  • dev:extensions: output all currently supported extension names, or output the specified extension information
  • dev:php-version: output the currently compiled PHP version (by reading php_version.h)
  • dev:sort-config: Sort the list of configuration files in the config/ directory in alphabetical order
  • dev:lib-ver <lib-name>: Read the version from the source code of the dependency library (only available for specific dependency libraries)
  • dev:ext-ver <ext-name>: Read the corresponding version from the source code of the extension (only available for specific extensions)
  • dev:pack-lib <lib-name>: Package the specified library into a tar.gz file (maintainer only)
  • dev:gen-ext-docs: Generate extension documentation (maintainer only)
bash
# output all extensions information
+bin/spc dump-extensions /path/to/your/project/ --no-spc-filter

It should be noted that the project directory must contain the vendor/installed.json and composer.lock files, otherwise they cannot be found normally.

Dev Command - dev

Debug commands refer to a collection of commands that can assist in outputting some information when you use static-php-cli to build PHP or modify and enhance the static-php-cli project itself.

  • dev:extensions: output all currently supported extension names, or output the specified extension information
  • dev:php-version: output the currently compiled PHP version (by reading php_version.h)
  • dev:sort-config: Sort the list of configuration files in the config/ directory in alphabetical order
  • dev:lib-ver <lib-name>: Read the version from the source code of the dependency library (only available for specific dependency libraries)
  • dev:ext-ver <ext-name>: Read the corresponding version from the source code of the extension (only available for specific extensions)
  • dev:pack-lib <lib-name>: Package the specified library into a tar.gz file (maintainer only)
  • dev:gen-ext-docs: Generate extension documentation (maintainer only)
bash
# output all extensions information
 bin/spc dev:extensions
 
 # Output the meta information of the specified extension
@@ -150,7 +150,7 @@ import{_ as s,c as i,o as e,a1 as a}from"./chunks/framework.gjrnbxUT.js";const g
 bin/spc dev:php-version
 
 # Sort the configuration files in the config/ directory in alphabetical order (e.g. ext.json)
-bin/spc dev:sort-config ext

Command - install-pkg

Use the command bin/spc install-pkg to download some precompiled or closed source tools and install them into the pkgroot directory.

When bin/spc doctor automatically repairs the Windows environment, tools such as nasm and perl will be downloaded, and the installation process of install-pkg will also be used.

Here is an example of installing the tool:

  • Download and install UPX (Linux and Windows only): bin/spc install-pkg upx

Command - del-download

In some cases, you need to delete single or multiple specified download source files and re-download them, such as switching PHP versions. The bin/spc del-download command is provided after the 2.1.0-beta.4 version. Specified source files can be deleted.

Deletes downloaded source files containing precompiled packages and source code named as keys in source.json or pkg.json. Here are some examples:

  • Delete the old PHP source code and switch to download the 8.3 version: bin/spc del-download php-src && bin/spc download php-src --with-php=8.3
  • Delete the download file of redis extension: bin/spc del-download redis
  • Delete the downloaded musl-toolchain x86_64: bin/spc del-download musl-toolchain-x86_64-linux

Inject External Script

Injecting external scripts refers to inserting one or more scripts during the static-php-cli compilation process to more flexibly support parameter modifications and source code patches in different environments.

Under normal circumstances, this function mainly solves the problem that the patch cannot be modified by modifying the static-php-cli code when compiling with spc binary.

There is another situation: your project directly depends on the crazywhalecc/static-php-cli repository and is synchronized with main branch, but some proprietary modifications are required, and these feature are not suitable for merging into the main branch.

In view of the above situation, in the official version 2.0.0, static-php-cli has added multiple event trigger points. You can write an external xx.php script and pass it in through the command line parameter -P and execute.

When writing to inject external scripts, the methods you will use are builder() and patch_point(). Among them, patch_point() obtains the name of the current event, and builder() obtains the BuilderBase object.

Because the incoming patch point does not distinguish between events, you must write the code you want to execute in if(patch_point() === 'your_event_name'), otherwise it will be executed repeatedly in other events.

The following are the supported patch_point event names and corresponding locations:

Event nameEvent description
before-libs-extractTriggered before the dependent libraries extracted
after-libs-extractTriggered after the compiled dependent libraries extracted
before-php-extractTriggered before PHP source code extracted
after-php-extractTriggered after PHP source code extracted
before-micro-extractTriggered before phpmicro extract
after-micro-extractTriggered after phpmicro extracted
before-exts-extractTriggered before the extension (to be compiled) extracted to the PHP source directory
after-exts-extractTriggered after the extension extracted to the PHP source directory
before-library[name]-buildTriggered before the library named name is compiled (such as before-library[postgresql]-build)
after-library[name]-buildTriggered after the library named name is compiled
before-php-buildconfTriggered before compiling PHP command ./buildconf
before-php-configureTriggered before compiling PHP command ./configure
before-php-makeTriggered before compiling PHP command make
before-sanity-checkTriggered after compiling PHP but before running extended checks

The following is a simple example of temporarily modifying the PHP source code. Enable the CLI function to search for the php.ini configuration in the current working directory:

php
// a.php
+bin/spc dev:sort-config ext

Command - install-pkg

Use the command bin/spc install-pkg to download some precompiled or closed source tools and install them into the pkgroot directory.

When bin/spc doctor automatically repairs the Windows environment, tools such as nasm and perl will be downloaded, and the installation process of install-pkg will also be used.

Here is an example of installing the tool:

  • Download and install UPX (Linux and Windows only): bin/spc install-pkg upx

Command - del-download

In some cases, you need to delete single or multiple specified download source files and re-download them, such as switching PHP versions. The bin/spc del-download command is provided after the 2.1.0-beta.4 version. Specified source files can be deleted.

Deletes downloaded source files containing precompiled packages and source code named as keys in source.json or pkg.json. Here are some examples:

  • Delete the old PHP source code and switch to download the 8.3 version: bin/spc del-download php-src && bin/spc download php-src --with-php=8.3
  • Delete the download file of redis extension: bin/spc del-download redis
  • Delete the downloaded musl-toolchain x86_64: bin/spc del-download musl-toolchain-x86_64-linux

Inject External Script

Injecting external scripts refers to inserting one or more scripts during the static-php-cli compilation process to more flexibly support parameter modifications and source code patches in different environments.

Under normal circumstances, this function mainly solves the problem that the patch cannot be modified by modifying the static-php-cli code when compiling with spc binary.

There is another situation: your project directly depends on the crazywhalecc/static-php-cli repository and is synchronized with main branch, but some proprietary modifications are required, and these feature are not suitable for merging into the main branch.

In view of the above situation, in the official version 2.0.0, static-php-cli has added multiple event trigger points. You can write an external xx.php script and pass it in through the command line parameter -P and execute.

When writing to inject external scripts, the methods you will use are builder() and patch_point(). Among them, patch_point() obtains the name of the current event, and builder() obtains the BuilderBase object.

Because the incoming patch point does not distinguish between events, you must write the code you want to execute in if(patch_point() === 'your_event_name'), otherwise it will be executed repeatedly in other events.

The following are the supported patch_point event names and corresponding locations:

Event nameEvent description
before-libs-extractTriggered before the dependent libraries extracted
after-libs-extractTriggered after the compiled dependent libraries extracted
before-php-extractTriggered before PHP source code extracted
after-php-extractTriggered after PHP source code extracted
before-micro-extractTriggered before phpmicro extract
after-micro-extractTriggered after phpmicro extracted
before-exts-extractTriggered before the extension (to be compiled) extracted to the PHP source directory
after-exts-extractTriggered after the extension extracted to the PHP source directory
before-library[name]-buildTriggered before the library named name is compiled (such as before-library[postgresql]-build)
after-library[name]-buildTriggered after the library named name is compiled
before-php-buildconfTriggered before compiling PHP command ./buildconf
before-php-configureTriggered before compiling PHP command ./configure
before-php-makeTriggered before compiling PHP command make
before-sanity-checkTriggered after compiling PHP but before running extended checks

The following is a simple example of temporarily modifying the PHP source code. Enable the CLI function to search for the php.ini configuration in the current working directory:

php
// a.php
 <?php
 // patch it before \`./buildconf\` executed
 if (patch_point() === 'before-php-buildconf') {
@@ -159,20 +159,20 @@ import{_ as s,c as i,o as e,a1 as a}from"./chunks/framework.gjrnbxUT.js";const g
         'sapi_module->php_ini_ignore_cwd = 1;',
         'sapi_module->php_ini_ignore_cwd = 0;'
     );
-}
bash
bin/spc build mbstring --build-cli -P a.php
+}
bash
bin/spc build mbstring --build-cli -P a.php
 # Write in ./
-echo 'memory_limit=8G' > ./php.ini
$ buildroot/bin/php -i | grep Loaded
+echo 'memory_limit=8G' > ./php.ini
$ buildroot/bin/php -i | grep Loaded
 Loaded Configuration File => /Users/jerry/project/git-project/static-php-cli/php.ini
 
 $ buildroot/bin/php -i | grep memory
-memory_limit => 8G => 8G

For the objects, methods and interfaces supported by static-php-cli, you can read the source code. Most methods and objects have corresponding comments.

Commonly used objects and functions using the -P function are:

  • SPC\\store\\FileSystem: file management class
    • ::replaceFileStr(string $filename, string $search, $replace): Replace file string content
    • ::replaceFileStr(string $filename, string $pattern, $replace): Regularly replace file content
    • ::replaceFileUser(string $filename, $callback): User-defined function replaces file content
    • ::copyDir(string $from, string $to): Recursively copy a directory to another location
    • ::convertPath(string $path): Convert the path delimiter to the current system delimiter
    • ::scanDirFiles(string $dir, bool $recursive = true, bool|string $relative = false, bool $include_dir = false): Traverse directory files
  • SPC\\builder\\BuilderBase: Build object
    • ->getPatchPoint(): Get the current injection point name
    • ->getOption(string $key, $default = null): Get command line and compile-time options
    • ->getPHPVersionID(): Get the currently compiled PHP version ID
    • ->getPHPVersion(): Get the currently compiled PHP version number
    • ->setOption(string $key, $value): Set options
    • ->setOptionIfNotExists(string $key, $value): Set option if option does not exist

TIP

static-php-cli has many open methods, which cannot be listed in the docs, but as long as it is a public function and is not marked as @internal, it theoretically can be called.

Multiple builds

If you need to build multiple times locally, the following method can save you time downloading resources and compiling.

  • If you only switch the PHP version without changing the dependent libraries, you can use bin/spc switch-php-version to quickly switch the PHP version, and then re-run the same build command.
  • If you want to rebuild once, but do not re-download the source code, you can first rm -rf buildroot source to delete the compilation directory and source code directory, and then rebuild.
  • If you want to update a version of a dependency, you can use bin/spc del-download <source-name> to delete the specified source code, and then use download <source-name> to download it again.
  • If you want to update all dependent versions, you can use bin/spc download --clean to delete all downloaded sources, and then download them again.

embed usage

If you want to embed static-php into other C language programs, you can use --build-embed to build an embed version of PHP.

bash
bin/spc build {your extensions} --build-embed --debug

Under normal circumstances, PHP embed will generate php-config after compilation. For static-php, we provide spc-config to obtain the parameters during compilation. In addition, when using embed SAPI (libphp.a), you need to use the same compiler as libphp, otherwise there will be a link error.

Here is the basic usage of spc-config:

bash
# output all flags and options
+memory_limit => 8G => 8G

For the objects, methods and interfaces supported by static-php-cli, you can read the source code. Most methods and objects have corresponding comments.

Commonly used objects and functions using the -P function are:

  • SPC\\store\\FileSystem: file management class
    • ::replaceFileStr(string $filename, string $search, $replace): Replace file string content
    • ::replaceFileStr(string $filename, string $pattern, $replace): Regularly replace file content
    • ::replaceFileUser(string $filename, $callback): User-defined function replaces file content
    • ::copyDir(string $from, string $to): Recursively copy a directory to another location
    • ::convertPath(string $path): Convert the path delimiter to the current system delimiter
    • ::scanDirFiles(string $dir, bool $recursive = true, bool|string $relative = false, bool $include_dir = false): Traverse directory files
  • SPC\\builder\\BuilderBase: Build object
    • ->getPatchPoint(): Get the current injection point name
    • ->getOption(string $key, $default = null): Get command line and compile-time options
    • ->getPHPVersionID(): Get the currently compiled PHP version ID
    • ->getPHPVersion(): Get the currently compiled PHP version number
    • ->setOption(string $key, $value): Set options
    • ->setOptionIfNotExists(string $key, $value): Set option if option does not exist

TIP

static-php-cli has many open methods, which cannot be listed in the docs, but as long as it is a public function and is not marked as @internal, it theoretically can be called.

Multiple builds

If you need to build multiple times locally, the following method can save you time downloading resources and compiling.

  • If you only switch the PHP version without changing the dependent libraries, you can use bin/spc switch-php-version to quickly switch the PHP version, and then re-run the same build command.
  • If you want to rebuild once, but do not re-download the source code, you can first rm -rf buildroot source to delete the compilation directory and source code directory, and then rebuild.
  • If you want to update a version of a dependency, you can use bin/spc del-download <source-name> to delete the specified source code, and then use download <source-name> to download it again.
  • If you want to update all dependent versions, you can use bin/spc download --clean to delete all downloaded sources, and then download them again.

embed usage

If you want to embed static-php into other C language programs, you can use --build-embed to build an embed version of PHP.

bash
bin/spc build {your extensions} --build-embed --debug

Under normal circumstances, PHP embed will generate php-config after compilation. For static-php, we provide spc-config to obtain the parameters during compilation. In addition, when using embed SAPI (libphp.a), you need to use the same compiler as libphp, otherwise there will be a link error.

Here is the basic usage of spc-config:

bash
# output all flags and options
 bin/spc spc-config curl,zlib,phar,openssl
 
 # output libs
 bin/spc spc-config curl,zlib,phar,openssl --libs
 
 # output includes
-bin/spc spc-config curl,zlib,phar,openssl --includes

By default, static-php uses the following compilers on different systems:

  • macOS: clang
  • Linux (Alpine Linux): gcc
  • Linux (glibc based distros, x86_64): /usr/local/musl/bin/x86_64-linux-musl-gcc
  • Linux (glibc based distros, aarch64): /usr/local/musl/bin/aarch64-linux-musl-gcc
  • FreeBSD: clang

Here is an example of using embed SAPI:

c
// embed.c
+bin/spc spc-config curl,zlib,phar,openssl --includes

By default, static-php uses the following compilers on different systems:

  • macOS: clang
  • Linux (Alpine Linux): gcc
  • Linux (glibc based distros, x86_64): /usr/local/musl/bin/x86_64-linux-musl-gcc
  • Linux (glibc based distros, aarch64): /usr/local/musl/bin/aarch64-linux-musl-gcc
  • FreeBSD: clang

Here is an example of using embed SAPI:

c
// embed.c
 #include <sapi/embed/php_embed.h>
 
 int main(int argc,char **argv){
@@ -189,12 +189,12 @@ import{_ as s,c as i,o as e,a1 as a}from"./chunks/framework.gjrnbxUT.js";const g
 
     PHP_EMBED_END_BLOCK()
     return 0;
-}
php
<?php 
+}
php
<?php 
 // embed.php
-echo "Hello world!\\n";
bash
# compile in debian/ubuntu x86_64
+echo "Hello world!\\n";
bash
# compile in debian/ubuntu x86_64
 /usr/local/musl/bin/x86_64-linux-musl-gcc embed.c $(bin/spc spc-config bcmath,zlib) -static -o embed
 # compile in macOS/FreeBSD
 clang embed.c $(bin/spc spc-config bcmath,zlib) -o embed
 
 ./embed
-# out: Hello world!
`,136),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}; +# out: Hello world!
`,136)]))}const g=s(t,[["render",l]]);export{k as __pageData,g as default}; diff --git a/assets/en_guide_manual-build.md.BCHDiDxK.lean.js b/assets/en_guide_manual-build.md.BCHDiDxK.lean.js new file mode 100644 index 00000000..6e613614 --- /dev/null +++ b/assets/en_guide_manual-build.md.BCHDiDxK.lean.js @@ -0,0 +1 @@ +import{_ as s,c as e,o as a,af as n}from"./chunks/framework.PeLcR_tw.js";const k=JSON.parse('{"title":"Build (Linux, macOS, FreeBSD)","description":"","frontmatter":{"outline":"deep"},"headers":[],"relativePath":"en/guide/manual-build.md","filePath":"en/guide/manual-build.md"}'),t={name:"en/guide/manual-build.md"};function l(p,i,h,o,d,r){return a(),e("div",null,i[0]||(i[0]=[n("",136)]))}const g=s(t,[["render",l]]);export{k as __pageData,g as default}; diff --git a/assets/en_guide_manual-build.md.BU7HLqGh.lean.js b/assets/en_guide_manual-build.md.BU7HLqGh.lean.js deleted file mode 100644 index 05649e18..00000000 --- a/assets/en_guide_manual-build.md.BU7HLqGh.lean.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as s,c as i,o as e,a1 as a}from"./chunks/framework.gjrnbxUT.js";const g=JSON.parse('{"title":"Build (Linux, macOS, FreeBSD)","description":"","frontmatter":{"outline":"deep"},"headers":[],"relativePath":"en/guide/manual-build.md","filePath":"en/guide/manual-build.md"}'),n={name:"en/guide/manual-build.md"},t=a("",136),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}; diff --git a/assets/en_guide_troubleshooting.md.BvJgQKvb.js b/assets/en_guide_troubleshooting.md.BvJgQKvb.js new file mode 100644 index 00000000..a30acacf --- /dev/null +++ b/assets/en_guide_troubleshooting.md.BvJgQKvb.js @@ -0,0 +1 @@ +import{_ as o,c as t,o as a,af as r}from"./chunks/framework.PeLcR_tw.js";const m=JSON.parse('{"title":"Troubleshooting","description":"","frontmatter":{},"headers":[],"relativePath":"en/guide/troubleshooting.md","filePath":"en/guide/troubleshooting.md"}'),n={name:"en/guide/troubleshooting.md"};function i(s,e,l,d,c,u){return a(),t("div",null,e[0]||(e[0]=[r('

Troubleshooting

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.

Download Failure

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. After encountering a download failure, you can try to call the download command multiple times.

When downloading extensions, you may eventually see errors like curl: (56) The requested URL returned error: 403 which are often caused by github rate limiting. You can verify this by adding --debug to the command and will see something like [DEBU] Running command (no output) : curl -sfSL "https://api.github.com/repos/openssl/openssl/releases".

To fix this, create a personal access token on GitHub and set it as an environment variable GITHUB_TOKEN=<XXX>.

If you confirm that the address is indeed inaccessible, you can submit an Issue or PR to update the url or download type.

Doctor Can't Fix Something

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.

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 Some check items can not be fixed, 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.

Compile Error

When you encounter a compilation error, if the --debug 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 spc command and parameters used.

If you are rebuilding, please refer to the Local Build - Multiple Builds section.

',13)]))}const p=o(n,[["render",i]]);export{m as __pageData,p as default}; diff --git a/assets/en_guide_troubleshooting.md.BvJgQKvb.lean.js b/assets/en_guide_troubleshooting.md.BvJgQKvb.lean.js new file mode 100644 index 00000000..277a053a --- /dev/null +++ b/assets/en_guide_troubleshooting.md.BvJgQKvb.lean.js @@ -0,0 +1 @@ +import{_ as o,c as t,o as a,af as r}from"./chunks/framework.PeLcR_tw.js";const m=JSON.parse('{"title":"Troubleshooting","description":"","frontmatter":{},"headers":[],"relativePath":"en/guide/troubleshooting.md","filePath":"en/guide/troubleshooting.md"}'),n={name:"en/guide/troubleshooting.md"};function i(s,e,l,d,c,u){return a(),t("div",null,e[0]||(e[0]=[r("",13)]))}const p=o(n,[["render",i]]);export{m as __pageData,p as default}; diff --git a/assets/en_guide_troubleshooting.md.CTxnPJxK.js b/assets/en_guide_troubleshooting.md.CTxnPJxK.js deleted file mode 100644 index 78d06c1a..00000000 --- a/assets/en_guide_troubleshooting.md.CTxnPJxK.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as e,c as o,o as t,a1 as a}from"./chunks/framework.gjrnbxUT.js";const b=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('

Troubleshooting

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.

Download Failure

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. After encountering a download failure, you can try to call the download command multiple times.

When downloading extensions, you may eventually see errors like curl: (56) The requested URL returned error: 403 which are often caused by github rate limiting. You can verify this by adding --debug to the command and will see something like [DEBU] Running command (no output) : curl -sfSL "https://api.github.com/repos/openssl/openssl/releases".

To fix this, create a personal access token on GitHub and set it as an environment variable GITHUB_TOKEN=<XXX>.

If you confirm that the address is indeed inaccessible, you can submit an Issue or PR to update the url or download type.

Doctor Can't Fix Something

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.

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 Some check items can not be fixed, 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.

Compile Error

When you encounter a compilation error, if the --debug 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 spc command and parameters used.

If you are rebuilding, please refer to the Local Build - Multiple Builds section.

',13),i=[n];function s(l,c,d,u,h,m){return t(),o("div",null,i)}const f=e(r,[["render",s]]);export{b as __pageData,f as default}; diff --git a/assets/en_guide_troubleshooting.md.CTxnPJxK.lean.js b/assets/en_guide_troubleshooting.md.CTxnPJxK.lean.js deleted file mode 100644 index 72c5bb17..00000000 --- a/assets/en_guide_troubleshooting.md.CTxnPJxK.lean.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as e,c as o,o as t,a1 as a}from"./chunks/framework.gjrnbxUT.js";const b=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("",13),i=[n];function s(l,c,d,u,h,m){return t(),o("div",null,i)}const f=e(r,[["render",s]]);export{b as __pageData,f as default}; diff --git a/assets/en_index.md.Cbpb4iAg.js b/assets/en_index.md.kO-e39M0.js similarity index 93% rename from assets/en_index.md.Cbpb4iAg.js rename to assets/en_index.md.kO-e39M0.js index dc400bf2..1df4a0ee 100644 --- a/assets/en_index.md.Cbpb4iAg.js +++ b/assets/en_index.md.kO-e39M0.js @@ -1 +1 @@ -import{_ as e,c as t,o as a}from"./chunks/framework.gjrnbxUT.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}; +import{_ as e,c as t,o as a}from"./chunks/framework.PeLcR_tw.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}; diff --git a/assets/en_index.md.Cbpb4iAg.lean.js b/assets/en_index.md.kO-e39M0.lean.js similarity index 93% rename from assets/en_index.md.Cbpb4iAg.lean.js rename to assets/en_index.md.kO-e39M0.lean.js index dc400bf2..1df4a0ee 100644 --- a/assets/en_index.md.Cbpb4iAg.lean.js +++ b/assets/en_index.md.kO-e39M0.lean.js @@ -1 +1 @@ -import{_ as e,c as t,o as a}from"./chunks/framework.gjrnbxUT.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}; +import{_ as e,c as t,o as a}from"./chunks/framework.PeLcR_tw.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}; diff --git a/assets/extension-notes.md.Bw8xYOie.js b/assets/extension-notes.md.DkpYDq7p.js similarity index 81% rename from assets/extension-notes.md.Bw8xYOie.js rename to assets/extension-notes.md.DkpYDq7p.js index 15c36d71..c546f9cf 100644 --- a/assets/extension-notes.md.Bw8xYOie.js +++ b/assets/extension-notes.md.DkpYDq7p.js @@ -1 +1 @@ -import{_ as e,c as t,o as n}from"./chunks/framework.gjrnbxUT.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}; +import{_ as e,c as t,o as n}from"./chunks/framework.PeLcR_tw.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}; diff --git a/assets/extension-notes.md.Bw8xYOie.lean.js b/assets/extension-notes.md.DkpYDq7p.lean.js similarity index 81% rename from assets/extension-notes.md.Bw8xYOie.lean.js rename to assets/extension-notes.md.DkpYDq7p.lean.js index 15c36d71..c546f9cf 100644 --- a/assets/extension-notes.md.Bw8xYOie.lean.js +++ b/assets/extension-notes.md.DkpYDq7p.lean.js @@ -1 +1 @@ -import{_ as e,c as t,o as n}from"./chunks/framework.gjrnbxUT.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}; +import{_ as e,c as t,o as n}from"./chunks/framework.PeLcR_tw.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}; diff --git a/assets/extensions.md.B7vVUihc.js b/assets/extensions.md.B7vVUihc.js deleted file mode 100644 index 6993a4b3..00000000 --- a/assets/extensions.md.B7vVUihc.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as t,c as d,o as e,a1 as s}from"./chunks/framework.gjrnbxUT.js";const c=JSON.parse('{"title":"","description":"","frontmatter":{},"headers":[],"relativePath":"extensions.md","filePath":"extensions.md"}'),y={name:"extensions.md"},r=s('
Extension NameLinuxmacOSFreeBSDWindows
amqpyesyesyes
apcuyesyesyesyes
astyesyesyesyes
bcmathyesyesyesyes
bz2yesyesyesyes
calendaryesyesyesyes
ctypeyesyesyesyes
curlyesyesyesyes
dbayesyesyesyes
dioyesyesyes
domyesyesyes
dsyesyesyesyes
enchant
evyesyesyesyes
eventyesyes
exifyesyesyesyes
ffipartialyesyes
fileinfoyesyesyesyes
filteryesyesyesyes
ftpyesyesyesyes
gdyesyesyes
gettextyesyes
glfwnoyesno
gmpyesyes
gmsslyesyesyes
grpcyesyes
iconvyesyesyes
igbinaryyesyesyes
imagickyesyes
imapyesyes
inotifyyesnono
intlyesyesno
ldapyesyes
lz4yesyes
libxmlyesyesyes
mbregexyesyesyesyes
mbstringyesyesyesyes
mcryptnononono
memcacheyesyes
memcachednoyes
mongodbyesyes
msgpackyesyesyes
mysqliyesyesyesyes
mysqlndyesyesyesyes
oci8nonono
odbcyesyes
opcacheyesyesyesyes
opensslyesyesyesyes
opentelemetryyesyesyes
parallelyesyesyes
password-argon2yesyes
pcntlyesyesyesno
pdoyesyesyesyes
pdo_mysqlyesyesyesyes
pdo_odbcyesyesyes
pdo_pgsqlyesyesyes
pdo_sqliteyesyesyes
pdo_sqlsrvyesyesyes
pgsqlyesyesyes
pharyesyesyesyes
posixyesyesyesno
protobufyesyes
raryespartialyes
rdkafkayesyes
readlineyesyes
redisyesyesyes
sessionyesyesyesyes
shmopyesyesyesyes
simdjsonyesyesyesyes
simplexmlyesyesyes
snappyyesyes
soapyesyesyes
socketsyesyesyesyes
sodiumyesyesyes
spxyesyesno
sqlite3yesyesyes
sqlsrvyesyesyes
ssh2yesyesyes
swooleyesyesno
swoole-hook-mysqlyesyesno
swoole-hook-pgsqlyespartialno
swoole-hook-sqliteyesyesno
swowyesyesyes
sysvmsgyesyesno
sysvsemyesyesno
sysvshmyesyesyes
tidyyesyes
tokenizeryesyesyesyes
uuidyesyes
uvyesyes
xdebugpartialpartialno
xhprofyesyes
xlswriteryesyesyes
xmlyesyesyes
xmlreaderyesyesyes
xmlwriteryesyesyes
xslyesyes
yacyesyesyes
yamlyesyesyes
zipyesyesyes
zlibyesyesyesyes
zstdyesyes
',1),o=[r];function n(a,l,i,h,m,p){return e(),d("div",null,o)}const f=t(y,[["render",n]]);export{c as __pageData,f as default}; diff --git a/assets/extensions.md.B7vVUihc.lean.js b/assets/extensions.md.B7vVUihc.lean.js deleted file mode 100644 index 0268292e..00000000 --- a/assets/extensions.md.B7vVUihc.lean.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as t,c as d,o as e,a1 as s}from"./chunks/framework.gjrnbxUT.js";const c=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 f=t(y,[["render",n]]);export{c as __pageData,f as default}; diff --git a/assets/extensions.md.pYqpfHc4.js b/assets/extensions.md.pYqpfHc4.js new file mode 100644 index 00000000..e8d6a3fb --- /dev/null +++ b/assets/extensions.md.pYqpfHc4.js @@ -0,0 +1 @@ +import{_ as d,c as e,o as s,af as y}from"./chunks/framework.PeLcR_tw.js";const p=JSON.parse('{"title":"","description":"","frontmatter":{},"headers":[],"relativePath":"extensions.md","filePath":"extensions.md"}'),r={name:"extensions.md"};function o(n,t,a,l,i,h){return s(),e("div",null,t[0]||(t[0]=[y('
Extension NameLinuxmacOSFreeBSDWindows
amqpyesyesyes
apcuyesyesyesyes
astyesyesyesyes
bcmathyesyesyesyes
brotliyesyesyesyes
bz2yesyesyesyes
calendaryesyesyesyes
ctypeyesyesyesyes
curlyesyesyesyes
dbayesyesyesyes
dioyesyesyes
domyesyesyes
dsyesyesyesyes
enchant
evyesyesyesyes
eventyesyes
exifyesyesyesyes
ffipartialyesyes
fileinfoyesyesyesyes
filteryesyesyesyes
ftpyesyesyesyes
gdyesyesyes
gettextyesyes
glfwnoyesno
gmpyesyes
gmsslyesyesyes
grpcyesyes
iconvyesyesyes
igbinaryyesyesyes
imagickyesyes
imapyesyes
inotifyyesnono
intlyesyesno
ldapyesyes
libxmlyesyesyes
lz4yesyes
mbregexyesyesyesyes
mbstringyesyesyesyes
mcryptnononono
memcacheyesyes
memcachedyesyes
mongodbyesyes
msgpackyesyesyes
mysqliyesyesyesyes
mysqlndyesyesyesyes
oci8nonono
odbcyesyes
opcacheyesyesyesyes
opensslyesyesyesyes
opentelemetryyesyesyes
parallelyesyesyes
password-argon2yesyes
pcntlyesyesyesno
pdoyesyesyesyes
pdo_mysqlyesyesyesyes
pdo_odbcyesyesyes
pdo_pgsqlyesyesyes
pdo_sqliteyesyesyes
pdo_sqlsrvyesyesyes
pgsqlyesyesyes
pharyesyesyesyes
posixyesyesyesno
protobufyesyes
raryespartialyes
rdkafkayesyes
readlineyesyes
redisyesyesyes
sessionyesyesyesyes
shmopyesyesyesyes
simdjsonyesyesyesyes
simplexmlyesyesyes
snappyyesyes
soapyesyesyes
socketsyesyesyesyes
sodiumyesyesyes
spxyesyesno
sqlite3yesyesyes
sqlsrvyesyesyes
ssh2yesyesyes
swooleyesyesno
swoole-hook-mysqlyesyesno
swoole-hook-pgsqlyespartialno
swoole-hook-sqliteyesyesno
swowyesyesyes
sysvmsgyesyesno
sysvsemyesyesno
sysvshmyesyesyes
tidyyesyes
tokenizeryesyesyesyes
uuidyesyes
uvyesyes
xdebugpartialpartialno
xhprofyesyes
xlswriteryesyesyes
xmlyesyesyes
xmlreaderyesyesyes
xmlwriteryesyesyes
xslyesyes
xzyesyesyesyes
yacyesyesyes
yamlyesyesyes
zipyesyesyes
zlibyesyesyesyes
zstdyesyes
',1)]))}const x=d(r,[["render",o]]);export{p as __pageData,x as default}; diff --git a/assets/extensions.md.pYqpfHc4.lean.js b/assets/extensions.md.pYqpfHc4.lean.js new file mode 100644 index 00000000..54433e93 --- /dev/null +++ b/assets/extensions.md.pYqpfHc4.lean.js @@ -0,0 +1 @@ +import{_ as d,c as e,o as s,af as y}from"./chunks/framework.PeLcR_tw.js";const p=JSON.parse('{"title":"","description":"","frontmatter":{},"headers":[],"relativePath":"extensions.md","filePath":"extensions.md"}'),r={name:"extensions.md"};function o(n,t,a,l,i,h){return s(),e("div",null,t[0]||(t[0]=[y("",1)]))}const x=d(r,[["render",o]]);export{p as __pageData,x as default}; diff --git a/assets/index.md.mKXtywCA.js b/assets/index.md.Dnq-iVNo.js similarity index 94% rename from assets/index.md.mKXtywCA.js rename to assets/index.md.Dnq-iVNo.js index d78b6636..8a833bf9 100644 --- a/assets/index.md.mKXtywCA.js +++ b/assets/index.md.Dnq-iVNo.js @@ -1 +1 @@ -import{_ as e,c as t,o as a}from"./chunks/framework.gjrnbxUT.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}; +import{_ as e,c as t,o as a}from"./chunks/framework.PeLcR_tw.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}; diff --git a/assets/index.md.mKXtywCA.lean.js b/assets/index.md.Dnq-iVNo.lean.js similarity index 94% rename from assets/index.md.mKXtywCA.lean.js rename to assets/index.md.Dnq-iVNo.lean.js index d78b6636..8a833bf9 100644 --- a/assets/index.md.mKXtywCA.lean.js +++ b/assets/index.md.Dnq-iVNo.lean.js @@ -1 +1 @@ -import{_ as e,c as t,o as a}from"./chunks/framework.gjrnbxUT.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}; +import{_ as e,c as t,o as a}from"./chunks/framework.PeLcR_tw.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}; diff --git a/assets/style.B_PHkrN1.css b/assets/style.B_PHkrN1.css deleted file mode 100644 index 5caab566..00000000 --- a/assets/style.B_PHkrN1.css +++ /dev/null @@ -1 +0,0 @@ -.box[data-v-9f8f76a1]{display:flex;flex-wrap:wrap;max-width:100%}.ext-item[data-v-9f8f76a1]{margin:4px 8px}h2[data-v-9f8f76a1]{margin-bottom:8px}.command-preview[data-v-9f8f76a1]{padding:1.2rem;background:var(--vp-c-divider);border-radius:8px;word-break:break-all;font-family:monospace;overflow-wrap:break-word}.pre[data-v-9f8f76a1]{white-space:pre-wrap;word-break:break-word;overflow-wrap:break-word}.option-line[data-v-9f8f76a1]{padding:4px 8px}.option-title[data-v-9f8f76a1]{margin:4px 8px 4px 4px;font-weight:700}select[data-v-9f8f76a1]{border-radius:4px;border:1px solid var(--vp-c-divider);padding:0 4px;width:300px}.my-btn[data-v-9f8f76a1]{color:var(--vp-button-alt-text);background-color:var(--vp-button-alt-bg);border-radius:8px;padding:0 16px;line-height:32px;font-size:14px;display:inline-block;text-align:center;font-weight:600;margin-right:8px;white-space:nowrap;transition:color .25s,border-color .25s,background-color .25s;cursor:pointer;border:1px solid var(--vp-button-alt-border)}.my-btn[data-v-9f8f76a1]:hover{border-color:var(--vp-button-alt-hover-border);color:var(--vp-button-alt-hover-text);background-color:var(--vp-button-alt-hover-bg)}.my-btn[data-v-9f8f76a1]:active{border-color:var(--vp-button-alt-active-border);color:var(--vp-button-alt-active-text);background-color:var(--vp-button-alt-active-bg)}.textarea[data-v-9f8f76a1]{border:1px solid var(--vp-c-divider);border-radius:4px;width:calc(100% - 12px);padding:4px 8px}.input[data-v-9f8f76a1]{display:block;border:1px solid var(--vp-c-divider);border-radius:4px;width:100%;padding:4px 8px}.command-container[data-v-9f8f76a1]{margin-bottom:24px}.modal-button[data-v-9f8f76a1]{padding:4px 8px;border-radius:4px;border-color:var(--vp-button-alt-border);color:var(--vp-button-alt-text);background-color:var(--vp-button-alt-bg)}.modal-button[data-v-9f8f76a1]:hover{border-color:var(--vp-button-alt-hover-border);color:var(--vp-button-alt-hover-text);background-color:var(--vp-button-alt-hover-bg)}.modal-button[data-v-9f8f76a1]:active{border-color:var(--vp-button-alt-active-border);color:var(--vp-button-alt-active-text);background-color:var(--vp-button-alt-active-bg)}@font-face{font-family:Inter;font-style:normal;font-weight:100 900;font-display:swap;src:url(/assets/inter-roman-cyrillic-ext.BBPuwvHQ.woff2) format("woff2");unicode-range:U+0460-052F,U+1C80-1C88,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:Inter;font-style:normal;font-weight:100 900;font-display:swap;src:url(/assets/inter-roman-cyrillic.C5lxZ8CY.woff2) format("woff2");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:Inter;font-style:normal;font-weight:100 900;font-display:swap;src:url(/assets/inter-roman-greek-ext.CqjqNYQ-.woff2) format("woff2");unicode-range:U+1F00-1FFF}@font-face{font-family:Inter;font-style:normal;font-weight:100 900;font-display:swap;src:url(/assets/inter-roman-greek.BBVDIX6e.woff2) format("woff2");unicode-range:U+0370-0377,U+037A-037F,U+0384-038A,U+038C,U+038E-03A1,U+03A3-03FF}@font-face{font-family:Inter;font-style:normal;font-weight:100 900;font-display:swap;src:url(/assets/inter-roman-vietnamese.BjW4sHH5.woff2) format("woff2");unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB}@font-face{font-family:Inter;font-style:normal;font-weight:100 900;font-display:swap;src:url(/assets/inter-roman-latin-ext.4ZJIpNVo.woff2) format("woff2");unicode-range:U+0100-02AF,U+0304,U+0308,U+0329,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Inter;font-style:normal;font-weight:100 900;font-display:swap;src:url(/assets/inter-roman-latin.Di8DUHzh.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Inter;font-style:italic;font-weight:100 900;font-display:swap;src:url(/assets/inter-italic-cyrillic-ext.r48I6akx.woff2) format("woff2");unicode-range:U+0460-052F,U+1C80-1C88,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:Inter;font-style:italic;font-weight:100 900;font-display:swap;src:url(/assets/inter-italic-cyrillic.By2_1cv3.woff2) format("woff2");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:Inter;font-style:italic;font-weight:100 900;font-display:swap;src:url(/assets/inter-italic-greek-ext.1u6EdAuj.woff2) format("woff2");unicode-range:U+1F00-1FFF}@font-face{font-family:Inter;font-style:italic;font-weight:100 900;font-display:swap;src:url(/assets/inter-italic-greek.DJ8dCoTZ.woff2) format("woff2");unicode-range:U+0370-0377,U+037A-037F,U+0384-038A,U+038C,U+038E-03A1,U+03A3-03FF}@font-face{font-family:Inter;font-style:italic;font-weight:100 900;font-display:swap;src:url(/assets/inter-italic-vietnamese.BSbpV94h.woff2) format("woff2");unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB}@font-face{font-family:Inter;font-style:italic;font-weight:100 900;font-display:swap;src:url(/assets/inter-italic-latin-ext.CN1xVJS-.woff2) format("woff2");unicode-range:U+0100-02AF,U+0304,U+0308,U+0329,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Inter;font-style:italic;font-weight:100 900;font-display:swap;src:url(/assets/inter-italic-latin.C2AdPX0b.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Punctuation SC;font-weight:400;src:local("PingFang SC Regular"),local("Noto Sans CJK SC"),local("Microsoft YaHei");unicode-range:U+201C,U+201D,U+2018,U+2019,U+2E3A,U+2014,U+2013,U+2026,U+00B7,U+007E,U+002F}@font-face{font-family:Punctuation SC;font-weight:500;src:local("PingFang SC Medium"),local("Noto Sans CJK SC"),local("Microsoft YaHei");unicode-range:U+201C,U+201D,U+2018,U+2019,U+2E3A,U+2014,U+2013,U+2026,U+00B7,U+007E,U+002F}@font-face{font-family:Punctuation SC;font-weight:600;src:local("PingFang SC Semibold"),local("Noto Sans CJK SC Bold"),local("Microsoft YaHei Bold");unicode-range:U+201C,U+201D,U+2018,U+2019,U+2E3A,U+2014,U+2013,U+2026,U+00B7,U+007E,U+002F}@font-face{font-family:Punctuation SC;font-weight:700;src:local("PingFang SC Semibold"),local("Noto Sans CJK SC Bold"),local("Microsoft YaHei Bold");unicode-range:U+201C,U+201D,U+2018,U+2019,U+2E3A,U+2014,U+2013,U+2026,U+00B7,U+007E,U+002F}:root{--vp-c-white: #ffffff;--vp-c-black: #000000;--vp-c-neutral: var(--vp-c-black);--vp-c-neutral-inverse: var(--vp-c-white)}.dark{--vp-c-neutral: var(--vp-c-white);--vp-c-neutral-inverse: var(--vp-c-black)}:root{--vp-c-gray-1: #dddde3;--vp-c-gray-2: #e4e4e9;--vp-c-gray-3: #ebebef;--vp-c-gray-soft: rgba(142, 150, 170, .14);--vp-c-indigo-1: #3451b2;--vp-c-indigo-2: #3a5ccc;--vp-c-indigo-3: #5672cd;--vp-c-indigo-soft: rgba(100, 108, 255, .14);--vp-c-purple-1: #6f42c1;--vp-c-purple-2: #7e4cc9;--vp-c-purple-3: #8e5cd9;--vp-c-purple-soft: rgba(159, 122, 234, .14);--vp-c-green-1: #18794e;--vp-c-green-2: #299764;--vp-c-green-3: #30a46c;--vp-c-green-soft: rgba(16, 185, 129, .14);--vp-c-yellow-1: #915930;--vp-c-yellow-2: #946300;--vp-c-yellow-3: #9f6a00;--vp-c-yellow-soft: rgba(234, 179, 8, .14);--vp-c-red-1: #b8272c;--vp-c-red-2: #d5393e;--vp-c-red-3: #e0575b;--vp-c-red-soft: rgba(244, 63, 94, .14);--vp-c-sponsor: #db2777}.dark{--vp-c-gray-1: #515c67;--vp-c-gray-2: #414853;--vp-c-gray-3: #32363f;--vp-c-gray-soft: rgba(101, 117, 133, .16);--vp-c-indigo-1: #a8b1ff;--vp-c-indigo-2: #5c73e7;--vp-c-indigo-3: #3e63dd;--vp-c-indigo-soft: rgba(100, 108, 255, .16);--vp-c-purple-1: #c8abfa;--vp-c-purple-2: #a879e6;--vp-c-purple-3: #8e5cd9;--vp-c-purple-soft: rgba(159, 122, 234, .16);--vp-c-green-1: #3dd68c;--vp-c-green-2: #30a46c;--vp-c-green-3: #298459;--vp-c-green-soft: rgba(16, 185, 129, .16);--vp-c-yellow-1: #f9b44e;--vp-c-yellow-2: #da8b17;--vp-c-yellow-3: #a46a0a;--vp-c-yellow-soft: rgba(234, 179, 8, .16);--vp-c-red-1: #f66f81;--vp-c-red-2: #f14158;--vp-c-red-3: #b62a3c;--vp-c-red-soft: rgba(244, 63, 94, .16)}:root{--vp-c-bg: #ffffff;--vp-c-bg-alt: #f6f6f7;--vp-c-bg-elv: #ffffff;--vp-c-bg-soft: #f6f6f7}.dark{--vp-c-bg: #1b1b1f;--vp-c-bg-alt: #161618;--vp-c-bg-elv: #202127;--vp-c-bg-soft: #202127}:root{--vp-c-border: #c2c2c4;--vp-c-divider: #e2e2e3;--vp-c-gutter: #e2e2e3}.dark{--vp-c-border: #3c3f44;--vp-c-divider: #2e2e32;--vp-c-gutter: #000000}:root{--vp-c-text-1: rgba(60, 60, 67);--vp-c-text-2: rgba(60, 60, 67, .78);--vp-c-text-3: rgba(60, 60, 67, .56)}.dark{--vp-c-text-1: rgba(255, 255, 245, .86);--vp-c-text-2: rgba(235, 235, 245, .6);--vp-c-text-3: rgba(235, 235, 245, .38)}:root{--vp-c-default-1: var(--vp-c-gray-1);--vp-c-default-2: var(--vp-c-gray-2);--vp-c-default-3: var(--vp-c-gray-3);--vp-c-default-soft: var(--vp-c-gray-soft);--vp-c-brand-1: var(--vp-c-indigo-1);--vp-c-brand-2: var(--vp-c-indigo-2);--vp-c-brand-3: var(--vp-c-indigo-3);--vp-c-brand-soft: var(--vp-c-indigo-soft);--vp-c-brand: var(--vp-c-brand-1);--vp-c-tip-1: var(--vp-c-brand-1);--vp-c-tip-2: var(--vp-c-brand-2);--vp-c-tip-3: var(--vp-c-brand-3);--vp-c-tip-soft: var(--vp-c-brand-soft);--vp-c-note-1: var(--vp-c-brand-1);--vp-c-note-2: var(--vp-c-brand-2);--vp-c-note-3: var(--vp-c-brand-3);--vp-c-note-soft: var(--vp-c-brand-soft);--vp-c-success-1: var(--vp-c-green-1);--vp-c-success-2: var(--vp-c-green-2);--vp-c-success-3: var(--vp-c-green-3);--vp-c-success-soft: var(--vp-c-green-soft);--vp-c-important-1: var(--vp-c-purple-1);--vp-c-important-2: var(--vp-c-purple-2);--vp-c-important-3: var(--vp-c-purple-3);--vp-c-important-soft: var(--vp-c-purple-soft);--vp-c-warning-1: var(--vp-c-yellow-1);--vp-c-warning-2: var(--vp-c-yellow-2);--vp-c-warning-3: var(--vp-c-yellow-3);--vp-c-warning-soft: var(--vp-c-yellow-soft);--vp-c-danger-1: var(--vp-c-red-1);--vp-c-danger-2: var(--vp-c-red-2);--vp-c-danger-3: var(--vp-c-red-3);--vp-c-danger-soft: var(--vp-c-red-soft);--vp-c-caution-1: var(--vp-c-red-1);--vp-c-caution-2: var(--vp-c-red-2);--vp-c-caution-3: var(--vp-c-red-3);--vp-c-caution-soft: var(--vp-c-red-soft)}:root{--vp-font-family-base: "Inter", ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--vp-font-family-mono: ui-monospace, "Menlo", "Monaco", "Consolas", "Liberation Mono", "Courier New", monospace;font-optical-sizing:auto}:root:where(:lang(zh)){--vp-font-family-base: "Punctuation SC", "Inter", ui-sans-serif, system-ui, "PingFang SC", "Noto Sans CJK SC", "Noto Sans SC", "Heiti SC", "Microsoft YaHei", "DengXian", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"}:root{--vp-shadow-1: 0 1px 2px rgba(0, 0, 0, .04), 0 1px 2px rgba(0, 0, 0, .06);--vp-shadow-2: 0 3px 12px rgba(0, 0, 0, .07), 0 1px 4px rgba(0, 0, 0, .07);--vp-shadow-3: 0 12px 32px rgba(0, 0, 0, .1), 0 2px 6px rgba(0, 0, 0, .08);--vp-shadow-4: 0 14px 44px rgba(0, 0, 0, .12), 0 3px 9px rgba(0, 0, 0, .12);--vp-shadow-5: 0 18px 56px rgba(0, 0, 0, .16), 0 4px 12px rgba(0, 0, 0, .16)}:root{--vp-z-index-footer: 10;--vp-z-index-local-nav: 20;--vp-z-index-nav: 30;--vp-z-index-layout-top: 40;--vp-z-index-backdrop: 50;--vp-z-index-sidebar: 60}@media (min-width: 960px){:root{--vp-z-index-sidebar: 25}}:root{--vp-layout-max-width: 1440px}:root{--vp-header-anchor-symbol: "#"}:root{--vp-code-line-height: 1.7;--vp-code-font-size: .875em;--vp-code-color: var(--vp-c-brand-1);--vp-code-link-color: var(--vp-c-brand-1);--vp-code-link-hover-color: var(--vp-c-brand-2);--vp-code-bg: var(--vp-c-default-soft);--vp-code-block-color: var(--vp-c-text-2);--vp-code-block-bg: var(--vp-c-bg-alt);--vp-code-block-divider-color: var(--vp-c-gutter);--vp-code-lang-color: var(--vp-c-text-3);--vp-code-line-highlight-color: var(--vp-c-default-soft);--vp-code-line-number-color: var(--vp-c-text-3);--vp-code-line-diff-add-color: var(--vp-c-success-soft);--vp-code-line-diff-add-symbol-color: var(--vp-c-success-1);--vp-code-line-diff-remove-color: var(--vp-c-danger-soft);--vp-code-line-diff-remove-symbol-color: var(--vp-c-danger-1);--vp-code-line-warning-color: var(--vp-c-warning-soft);--vp-code-line-error-color: var(--vp-c-danger-soft);--vp-code-copy-code-border-color: var(--vp-c-divider);--vp-code-copy-code-bg: var(--vp-c-bg-soft);--vp-code-copy-code-hover-border-color: var(--vp-c-divider);--vp-code-copy-code-hover-bg: var(--vp-c-bg);--vp-code-copy-code-active-text: var(--vp-c-text-2);--vp-code-copy-copied-text-content: "Copied";--vp-code-tab-divider: var(--vp-code-block-divider-color);--vp-code-tab-text-color: var(--vp-c-text-2);--vp-code-tab-bg: var(--vp-code-block-bg);--vp-code-tab-hover-text-color: var(--vp-c-text-1);--vp-code-tab-active-text-color: var(--vp-c-text-1);--vp-code-tab-active-bar-color: var(--vp-c-brand-1)}:root{--vp-button-brand-border: transparent;--vp-button-brand-text: var(--vp-c-white);--vp-button-brand-bg: var(--vp-c-brand-3);--vp-button-brand-hover-border: transparent;--vp-button-brand-hover-text: var(--vp-c-white);--vp-button-brand-hover-bg: var(--vp-c-brand-2);--vp-button-brand-active-border: transparent;--vp-button-brand-active-text: var(--vp-c-white);--vp-button-brand-active-bg: var(--vp-c-brand-1);--vp-button-alt-border: transparent;--vp-button-alt-text: var(--vp-c-text-1);--vp-button-alt-bg: var(--vp-c-default-3);--vp-button-alt-hover-border: transparent;--vp-button-alt-hover-text: var(--vp-c-text-1);--vp-button-alt-hover-bg: var(--vp-c-default-2);--vp-button-alt-active-border: transparent;--vp-button-alt-active-text: var(--vp-c-text-1);--vp-button-alt-active-bg: var(--vp-c-default-1);--vp-button-sponsor-border: var(--vp-c-text-2);--vp-button-sponsor-text: var(--vp-c-text-2);--vp-button-sponsor-bg: transparent;--vp-button-sponsor-hover-border: var(--vp-c-sponsor);--vp-button-sponsor-hover-text: var(--vp-c-sponsor);--vp-button-sponsor-hover-bg: transparent;--vp-button-sponsor-active-border: var(--vp-c-sponsor);--vp-button-sponsor-active-text: var(--vp-c-sponsor);--vp-button-sponsor-active-bg: transparent}:root{--vp-custom-block-font-size: 14px;--vp-custom-block-code-font-size: 13px;--vp-custom-block-info-border: transparent;--vp-custom-block-info-text: var(--vp-c-text-1);--vp-custom-block-info-bg: var(--vp-c-default-soft);--vp-custom-block-info-code-bg: var(--vp-c-default-soft);--vp-custom-block-note-border: transparent;--vp-custom-block-note-text: var(--vp-c-text-1);--vp-custom-block-note-bg: var(--vp-c-default-soft);--vp-custom-block-note-code-bg: var(--vp-c-default-soft);--vp-custom-block-tip-border: transparent;--vp-custom-block-tip-text: var(--vp-c-text-1);--vp-custom-block-tip-bg: var(--vp-c-tip-soft);--vp-custom-block-tip-code-bg: var(--vp-c-tip-soft);--vp-custom-block-important-border: transparent;--vp-custom-block-important-text: var(--vp-c-text-1);--vp-custom-block-important-bg: var(--vp-c-important-soft);--vp-custom-block-important-code-bg: var(--vp-c-important-soft);--vp-custom-block-warning-border: transparent;--vp-custom-block-warning-text: var(--vp-c-text-1);--vp-custom-block-warning-bg: var(--vp-c-warning-soft);--vp-custom-block-warning-code-bg: var(--vp-c-warning-soft);--vp-custom-block-danger-border: transparent;--vp-custom-block-danger-text: var(--vp-c-text-1);--vp-custom-block-danger-bg: var(--vp-c-danger-soft);--vp-custom-block-danger-code-bg: var(--vp-c-danger-soft);--vp-custom-block-caution-border: transparent;--vp-custom-block-caution-text: var(--vp-c-text-1);--vp-custom-block-caution-bg: var(--vp-c-caution-soft);--vp-custom-block-caution-code-bg: var(--vp-c-caution-soft);--vp-custom-block-details-border: var(--vp-custom-block-info-border);--vp-custom-block-details-text: var(--vp-custom-block-info-text);--vp-custom-block-details-bg: var(--vp-custom-block-info-bg);--vp-custom-block-details-code-bg: var(--vp-custom-block-info-code-bg)}:root{--vp-input-border-color: var(--vp-c-border);--vp-input-bg-color: var(--vp-c-bg-alt);--vp-input-switch-bg-color: var(--vp-c-default-soft)}:root{--vp-nav-height: 64px;--vp-nav-bg-color: var(--vp-c-bg);--vp-nav-screen-bg-color: var(--vp-c-bg);--vp-nav-logo-height: 24px}.hide-nav{--vp-nav-height: 0px}.hide-nav .VPSidebar{--vp-nav-height: 22px}:root{--vp-local-nav-bg-color: var(--vp-c-bg)}:root{--vp-sidebar-width: 272px;--vp-sidebar-bg-color: var(--vp-c-bg-alt)}:root{--vp-backdrop-bg-color: rgba(0, 0, 0, .6)}:root{--vp-home-hero-name-color: var(--vp-c-brand-1);--vp-home-hero-name-background: transparent;--vp-home-hero-image-background-image: none;--vp-home-hero-image-filter: none}:root{--vp-badge-info-border: transparent;--vp-badge-info-text: var(--vp-c-text-2);--vp-badge-info-bg: var(--vp-c-default-soft);--vp-badge-tip-border: transparent;--vp-badge-tip-text: var(--vp-c-tip-1);--vp-badge-tip-bg: var(--vp-c-tip-soft);--vp-badge-warning-border: transparent;--vp-badge-warning-text: var(--vp-c-warning-1);--vp-badge-warning-bg: var(--vp-c-warning-soft);--vp-badge-danger-border: transparent;--vp-badge-danger-text: var(--vp-c-danger-1);--vp-badge-danger-bg: var(--vp-c-danger-soft)}:root{--vp-carbon-ads-text-color: var(--vp-c-text-1);--vp-carbon-ads-poweredby-color: var(--vp-c-text-2);--vp-carbon-ads-bg-color: var(--vp-c-bg-soft);--vp-carbon-ads-hover-text-color: var(--vp-c-brand-1);--vp-carbon-ads-hover-poweredby-color: var(--vp-c-text-1)}:root{--vp-local-search-bg: var(--vp-c-bg);--vp-local-search-result-bg: var(--vp-c-bg);--vp-local-search-result-border: var(--vp-c-divider);--vp-local-search-result-selected-bg: var(--vp-c-bg);--vp-local-search-result-selected-border: var(--vp-c-brand-1);--vp-local-search-highlight-bg: var(--vp-c-brand-1);--vp-local-search-highlight-text: var(--vp-c-neutral-inverse)}@media (prefers-reduced-motion: reduce){*,:before,:after{animation-delay:-1ms!important;animation-duration:1ms!important;animation-iteration-count:1!important;background-attachment:initial!important;scroll-behavior:auto!important;transition-duration:0s!important;transition-delay:0s!important}}*,:before,:after{box-sizing:border-box}html{line-height:1.4;font-size:16px;-webkit-text-size-adjust:100%}html.dark{color-scheme:dark}body{margin:0;width:100%;min-width:320px;min-height:100vh;line-height:24px;font-family:var(--vp-font-family-base);font-size:16px;font-weight:400;color:var(--vp-c-text-1);background-color:var(--vp-c-bg);font-synthesis:style;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}main{display:block}h1,h2,h3,h4,h5,h6{margin:0;line-height:24px;font-size:16px;font-weight:400}p{margin:0}strong,b{font-weight:600}a,area,button,[role=button],input,label,select,summary,textarea{touch-action:manipulation}a{color:inherit;text-decoration:inherit}ol,ul{list-style:none;margin:0;padding:0}blockquote{margin:0}pre,code,kbd,samp{font-family:var(--vp-font-family-mono)}img,svg,video,canvas,audio,iframe,embed,object{display:block}figure{margin:0}img,video{max-width:100%;height:auto}button,input,optgroup,select,textarea{border:0;padding:0;line-height:inherit;color:inherit}button{padding:0;font-family:inherit;background-color:transparent;background-image:none}button:enabled,[role=button]:enabled{cursor:pointer}button:focus,button:focus-visible{outline:1px dotted;outline:4px auto -webkit-focus-ring-color}button:focus:not(:focus-visible){outline:none!important}input:focus,textarea:focus,select:focus{outline:none}table{border-collapse:collapse}input{background-color:transparent}input:-ms-input-placeholder,textarea:-ms-input-placeholder{color:var(--vp-c-text-3)}input::-ms-input-placeholder,textarea::-ms-input-placeholder{color:var(--vp-c-text-3)}input::placeholder,textarea::placeholder{color:var(--vp-c-text-3)}input::-webkit-outer-spin-button,input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}input[type=number]{-moz-appearance:textfield}textarea{resize:vertical}select{-webkit-appearance:none}fieldset{margin:0;padding:0}h1,h2,h3,h4,h5,h6,li,p{overflow-wrap:break-word}vite-error-overlay{z-index:9999}mjx-container{overflow-x:auto}mjx-container>svg{display:inline-block;margin:auto}[class^=vpi-],[class*=" vpi-"],.vp-icon{width:1em;height:1em}[class^=vpi-].bg,[class*=" vpi-"].bg,.vp-icon.bg{background-size:100% 100%;background-color:transparent}[class^=vpi-]:not(.bg),[class*=" vpi-"]:not(.bg),.vp-icon:not(.bg){-webkit-mask:var(--icon) no-repeat;mask:var(--icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit}.vpi-align-left{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M21 6H3M15 12H3M17 18H3'/%3E%3C/svg%3E")}.vpi-arrow-right,.vpi-arrow-down,.vpi-arrow-left,.vpi-arrow-up{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M5 12h14M12 5l7 7-7 7'/%3E%3C/svg%3E")}.vpi-chevron-right,.vpi-chevron-down,.vpi-chevron-left,.vpi-chevron-up{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='m9 18 6-6-6-6'/%3E%3C/svg%3E")}.vpi-chevron-down,.vpi-arrow-down{transform:rotate(90deg)}.vpi-chevron-left,.vpi-arrow-left{transform:rotate(180deg)}.vpi-chevron-up,.vpi-arrow-up{transform:rotate(-90deg)}.vpi-square-pen{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7'/%3E%3Cpath d='M18.375 2.625a2.121 2.121 0 1 1 3 3L12 15l-4 1 1-4Z'/%3E%3C/svg%3E")}.vpi-plus{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M5 12h14M12 5v14'/%3E%3C/svg%3E")}.vpi-sun{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Cpath d='M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M6.34 17.66l-1.41 1.41M19.07 4.93l-1.41 1.41'/%3E%3C/svg%3E")}.vpi-moon{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z'/%3E%3C/svg%3E")}.vpi-more-horizontal{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='1'/%3E%3Ccircle cx='19' cy='12' r='1'/%3E%3Ccircle cx='5' cy='12' r='1'/%3E%3C/svg%3E")}.vpi-languages{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='m5 8 6 6M4 14l6-6 2-3M2 5h12M7 2h1M22 22l-5-10-5 10M14 18h6'/%3E%3C/svg%3E")}.vpi-heart{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z'/%3E%3C/svg%3E")}.vpi-search{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E")}.vpi-layout-list{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Crect width='7' height='7' x='3' y='3' rx='1'/%3E%3Crect width='7' height='7' x='3' y='14' rx='1'/%3E%3Cpath d='M14 4h7M14 9h7M14 15h7M14 20h7'/%3E%3C/svg%3E")}.vpi-delete{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M20 5H9l-7 7 7 7h11a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2ZM18 9l-6 6M12 9l6 6'/%3E%3C/svg%3E")}.vpi-corner-down-left{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='m9 10-5 5 5 5'/%3E%3Cpath d='M20 4v7a4 4 0 0 1-4 4H4'/%3E%3C/svg%3E")}:root{--vp-icon-copy: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='rgba(128,128,128,1)' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Crect width='8' height='4' x='8' y='2' rx='1' ry='1'/%3E%3Cpath d='M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2'/%3E%3C/svg%3E");--vp-icon-copied: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='rgba(128,128,128,1)' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Crect width='8' height='4' x='8' y='2' rx='1' ry='1'/%3E%3Cpath d='M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2'/%3E%3Cpath d='m9 14 2 2 4-4'/%3E%3C/svg%3E")}.vpi-social-discord{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20.317 4.37a19.791 19.791 0 0 0-4.885-1.515.074.074 0 0 0-.079.037c-.21.375-.444.864-.608 1.25a18.27 18.27 0 0 0-5.487 0 12.64 12.64 0 0 0-.617-1.25.077.077 0 0 0-.079-.037A19.736 19.736 0 0 0 3.677 4.37a.07.07 0 0 0-.032.027C.533 9.046-.32 13.58.099 18.057a.082.082 0 0 0 .031.057 19.9 19.9 0 0 0 5.993 3.03.078.078 0 0 0 .084-.028c.462-.63.874-1.295 1.226-1.994a.076.076 0 0 0-.041-.106 13.107 13.107 0 0 1-1.872-.892.077.077 0 0 1-.008-.128 10.2 10.2 0 0 0 .372-.292.074.074 0 0 1 .077-.01c3.928 1.793 8.18 1.793 12.062 0a.074.074 0 0 1 .078.01c.12.098.246.198.373.292a.077.077 0 0 1-.006.127 12.299 12.299 0 0 1-1.873.892.077.077 0 0 0-.041.107c.36.698.772 1.362 1.225 1.993a.076.076 0 0 0 .084.028 19.839 19.839 0 0 0 6.002-3.03.077.077 0 0 0 .032-.054c.5-5.177-.838-9.674-3.549-13.66a.061.061 0 0 0-.031-.03zM8.02 15.33c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.956-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.956 2.418-2.157 2.418zm7.975 0c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.955-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.946 2.418-2.157 2.418Z'/%3E%3C/svg%3E")}.vpi-social-facebook{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9.101 23.691v-7.98H6.627v-3.667h2.474v-1.58c0-4.085 1.848-5.978 5.858-5.978.401 0 .955.042 1.468.103a8.68 8.68 0 0 1 1.141.195v3.325a8.623 8.623 0 0 0-.653-.036 26.805 26.805 0 0 0-.733-.009c-.707 0-1.259.096-1.675.309a1.686 1.686 0 0 0-.679.622c-.258.42-.374.995-.374 1.752v1.297h3.919l-.386 2.103-.287 1.564h-3.246v8.245C19.396 23.238 24 18.179 24 12.044c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.628 3.874 10.35 9.101 11.647Z'/%3E%3C/svg%3E")}.vpi-social-github{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12'/%3E%3C/svg%3E")}.vpi-social-instagram{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7.03.084c-1.277.06-2.149.264-2.91.563a5.874 5.874 0 0 0-2.124 1.388 5.878 5.878 0 0 0-1.38 2.127C.321 4.926.12 5.8.064 7.076.008 8.354-.005 8.764.001 12.023c.007 3.259.021 3.667.083 4.947.061 1.277.264 2.149.563 2.911.308.789.72 1.457 1.388 2.123a5.872 5.872 0 0 0 2.129 1.38c.763.295 1.636.496 2.913.552 1.278.056 1.689.069 4.947.063 3.257-.007 3.668-.021 4.947-.082 1.28-.06 2.147-.265 2.91-.563a5.881 5.881 0 0 0 2.123-1.388 5.881 5.881 0 0 0 1.38-2.129c.295-.763.496-1.636.551-2.912.056-1.28.07-1.69.063-4.948-.006-3.258-.02-3.667-.081-4.947-.06-1.28-.264-2.148-.564-2.911a5.892 5.892 0 0 0-1.387-2.123 5.857 5.857 0 0 0-2.128-1.38C19.074.322 18.202.12 16.924.066 15.647.009 15.236-.006 11.977 0 8.718.008 8.31.021 7.03.084m.14 21.693c-1.17-.05-1.805-.245-2.228-.408a3.736 3.736 0 0 1-1.382-.895 3.695 3.695 0 0 1-.9-1.378c-.165-.423-.363-1.058-.417-2.228-.06-1.264-.072-1.644-.08-4.848-.006-3.204.006-3.583.061-4.848.05-1.169.246-1.805.408-2.228.216-.561.477-.96.895-1.382a3.705 3.705 0 0 1 1.379-.9c.423-.165 1.057-.361 2.227-.417 1.265-.06 1.644-.072 4.848-.08 3.203-.006 3.583.006 4.85.062 1.168.05 1.804.244 2.227.408.56.216.96.475 1.382.895.421.42.681.817.9 1.378.165.422.362 1.056.417 2.227.06 1.265.074 1.645.08 4.848.005 3.203-.006 3.583-.061 4.848-.051 1.17-.245 1.805-.408 2.23-.216.56-.477.96-.896 1.38a3.705 3.705 0 0 1-1.378.9c-.422.165-1.058.362-2.226.418-1.266.06-1.645.072-4.85.079-3.204.007-3.582-.006-4.848-.06m9.783-16.192a1.44 1.44 0 1 0 1.437-1.442 1.44 1.44 0 0 0-1.437 1.442M5.839 12.012a6.161 6.161 0 1 0 12.323-.024 6.162 6.162 0 0 0-12.323.024M8 12.008A4 4 0 1 1 12.008 16 4 4 0 0 1 8 12.008'/%3E%3C/svg%3E")}.vpi-social-linkedin{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433a2.062 2.062 0 0 1-2.063-2.065 2.064 2.064 0 1 1 2.063 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z'/%3E%3C/svg%3E")}.vpi-social-mastodon{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M23.268 5.313c-.35-2.578-2.617-4.61-5.304-5.004C17.51.242 15.792 0 11.813 0h-.03c-3.98 0-4.835.242-5.288.309C3.882.692 1.496 2.518.917 5.127.64 6.412.61 7.837.661 9.143c.074 1.874.088 3.745.26 5.611.118 1.24.325 2.47.62 3.68.55 2.237 2.777 4.098 4.96 4.857 2.336.792 4.849.923 7.256.38.265-.061.527-.132.786-.213.585-.184 1.27-.39 1.774-.753a.057.057 0 0 0 .023-.043v-1.809a.052.052 0 0 0-.02-.041.053.053 0 0 0-.046-.01 20.282 20.282 0 0 1-4.709.545c-2.73 0-3.463-1.284-3.674-1.818a5.593 5.593 0 0 1-.319-1.433.053.053 0 0 1 .066-.054c1.517.363 3.072.546 4.632.546.376 0 .75 0 1.125-.01 1.57-.044 3.224-.124 4.768-.422.038-.008.077-.015.11-.024 2.435-.464 4.753-1.92 4.989-5.604.008-.145.03-1.52.03-1.67.002-.512.167-3.63-.024-5.545zm-3.748 9.195h-2.561V8.29c0-1.309-.55-1.976-1.67-1.976-1.23 0-1.846.79-1.846 2.35v3.403h-2.546V8.663c0-1.56-.617-2.35-1.848-2.35-1.112 0-1.668.668-1.67 1.977v6.218H4.822V8.102c0-1.31.337-2.35 1.011-3.12.696-.77 1.608-1.164 2.74-1.164 1.311 0 2.302.5 2.962 1.498l.638 1.06.638-1.06c.66-.999 1.65-1.498 2.96-1.498 1.13 0 2.043.395 2.74 1.164.675.77 1.012 1.81 1.012 3.12z'/%3E%3C/svg%3E")}.vpi-social-npm{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M1.763 0C.786 0 0 .786 0 1.763v20.474C0 23.214.786 24 1.763 24h20.474c.977 0 1.763-.786 1.763-1.763V1.763C24 .786 23.214 0 22.237 0zM5.13 5.323l13.837.019-.009 13.836h-3.464l.01-10.382h-3.456L12.04 19.17H5.113z'/%3E%3C/svg%3E")}.vpi-social-slack{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5.042 15.165a2.528 2.528 0 0 1-2.52 2.523A2.528 2.528 0 0 1 0 15.165a2.527 2.527 0 0 1 2.522-2.52h2.52v2.52zm1.271 0a2.527 2.527 0 0 1 2.521-2.52 2.527 2.527 0 0 1 2.521 2.52v6.313A2.528 2.528 0 0 1 8.834 24a2.528 2.528 0 0 1-2.521-2.522v-6.313zM8.834 5.042a2.528 2.528 0 0 1-2.521-2.52A2.528 2.528 0 0 1 8.834 0a2.528 2.528 0 0 1 2.521 2.522v2.52H8.834zm0 1.271a2.528 2.528 0 0 1 2.521 2.521 2.528 2.528 0 0 1-2.521 2.521H2.522A2.528 2.528 0 0 1 0 8.834a2.528 2.528 0 0 1 2.522-2.521h6.312zm10.122 2.521a2.528 2.528 0 0 1 2.522-2.521A2.528 2.528 0 0 1 24 8.834a2.528 2.528 0 0 1-2.522 2.521h-2.522V8.834zm-1.268 0a2.528 2.528 0 0 1-2.523 2.521 2.527 2.527 0 0 1-2.52-2.521V2.522A2.527 2.527 0 0 1 15.165 0a2.528 2.528 0 0 1 2.523 2.522v6.312zm-2.523 10.122a2.528 2.528 0 0 1 2.523 2.522A2.528 2.528 0 0 1 15.165 24a2.527 2.527 0 0 1-2.52-2.522v-2.522h2.52zm0-1.268a2.527 2.527 0 0 1-2.52-2.523 2.526 2.526 0 0 1 2.52-2.52h6.313A2.527 2.527 0 0 1 24 15.165a2.528 2.528 0 0 1-2.522 2.523h-6.313z'/%3E%3C/svg%3E")}.vpi-social-twitter,.vpi-social-x{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M18.901 1.153h3.68l-8.04 9.19L24 22.846h-7.406l-5.8-7.584-6.638 7.584H.474l8.6-9.83L0 1.154h7.594l5.243 6.932ZM17.61 20.644h2.039L6.486 3.24H4.298Z'/%3E%3C/svg%3E")}.vpi-social-youtube{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M23.498 6.186a3.016 3.016 0 0 0-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 0 0 .502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 0 0 2.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 0 0 2.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z'/%3E%3C/svg%3E")}.visually-hidden{position:absolute;width:1px;height:1px;white-space:nowrap;clip:rect(0 0 0 0);clip-path:inset(50%);overflow:hidden}.custom-block{border:1px solid transparent;border-radius:8px;padding:16px 16px 8px;line-height:24px;font-size:var(--vp-custom-block-font-size);color:var(--vp-c-text-2)}.custom-block.info{border-color:var(--vp-custom-block-info-border);color:var(--vp-custom-block-info-text);background-color:var(--vp-custom-block-info-bg)}.custom-block.info a,.custom-block.info code{color:var(--vp-c-brand-1)}.custom-block.info a:hover,.custom-block.info a:hover>code{color:var(--vp-c-brand-2)}.custom-block.info code{background-color:var(--vp-custom-block-info-code-bg)}.custom-block.note{border-color:var(--vp-custom-block-note-border);color:var(--vp-custom-block-note-text);background-color:var(--vp-custom-block-note-bg)}.custom-block.note a,.custom-block.note code{color:var(--vp-c-brand-1)}.custom-block.note a:hover,.custom-block.note a:hover>code{color:var(--vp-c-brand-2)}.custom-block.note code{background-color:var(--vp-custom-block-note-code-bg)}.custom-block.tip{border-color:var(--vp-custom-block-tip-border);color:var(--vp-custom-block-tip-text);background-color:var(--vp-custom-block-tip-bg)}.custom-block.tip a,.custom-block.tip code{color:var(--vp-c-tip-1)}.custom-block.tip a:hover,.custom-block.tip a:hover>code{color:var(--vp-c-tip-2)}.custom-block.tip code{background-color:var(--vp-custom-block-tip-code-bg)}.custom-block.important{border-color:var(--vp-custom-block-important-border);color:var(--vp-custom-block-important-text);background-color:var(--vp-custom-block-important-bg)}.custom-block.important a,.custom-block.important code{color:var(--vp-c-important-1)}.custom-block.important a:hover,.custom-block.important a:hover>code{color:var(--vp-c-important-2)}.custom-block.important code{background-color:var(--vp-custom-block-important-code-bg)}.custom-block.warning{border-color:var(--vp-custom-block-warning-border);color:var(--vp-custom-block-warning-text);background-color:var(--vp-custom-block-warning-bg)}.custom-block.warning a,.custom-block.warning code{color:var(--vp-c-warning-1)}.custom-block.warning a:hover,.custom-block.warning a:hover>code{color:var(--vp-c-warning-2)}.custom-block.warning code{background-color:var(--vp-custom-block-warning-code-bg)}.custom-block.danger{border-color:var(--vp-custom-block-danger-border);color:var(--vp-custom-block-danger-text);background-color:var(--vp-custom-block-danger-bg)}.custom-block.danger a,.custom-block.danger code{color:var(--vp-c-danger-1)}.custom-block.danger a:hover,.custom-block.danger a:hover>code{color:var(--vp-c-danger-2)}.custom-block.danger code{background-color:var(--vp-custom-block-danger-code-bg)}.custom-block.caution{border-color:var(--vp-custom-block-caution-border);color:var(--vp-custom-block-caution-text);background-color:var(--vp-custom-block-caution-bg)}.custom-block.caution a,.custom-block.caution code{color:var(--vp-c-caution-1)}.custom-block.caution a:hover,.custom-block.caution a:hover>code{color:var(--vp-c-caution-2)}.custom-block.caution code{background-color:var(--vp-custom-block-caution-code-bg)}.custom-block.details{border-color:var(--vp-custom-block-details-border);color:var(--vp-custom-block-details-text);background-color:var(--vp-custom-block-details-bg)}.custom-block.details a{color:var(--vp-c-brand-1)}.custom-block.details a:hover,.custom-block.details a:hover>code{color:var(--vp-c-brand-2)}.custom-block.details code{background-color:var(--vp-custom-block-details-code-bg)}.custom-block-title{font-weight:600}.custom-block p+p{margin:8px 0}.custom-block.details summary{margin:0 0 8px;font-weight:700;cursor:pointer;-webkit-user-select:none;user-select:none}.custom-block.details summary+p{margin:8px 0}.custom-block a{color:inherit;font-weight:600;text-decoration:underline;text-underline-offset:2px;transition:opacity .25s}.custom-block a:hover{opacity:.75}.custom-block code{font-size:var(--vp-custom-block-code-font-size)}.custom-block.custom-block th,.custom-block.custom-block blockquote>p{font-size:var(--vp-custom-block-font-size);color:inherit}.dark .vp-code span{color:var(--shiki-dark, inherit)}html:not(.dark) .vp-code span{color:var(--shiki-light, inherit)}.vp-code-group{margin-top:16px}.vp-code-group .tabs{position:relative;display:flex;margin-right:-24px;margin-left:-24px;padding:0 12px;background-color:var(--vp-code-tab-bg);overflow-x:auto;overflow-y:hidden;box-shadow:inset 0 -1px var(--vp-code-tab-divider)}@media (min-width: 640px){.vp-code-group .tabs{margin-right:0;margin-left:0;border-radius:8px 8px 0 0}}.vp-code-group .tabs input{position:fixed;opacity:0;pointer-events:none}.vp-code-group .tabs label{position:relative;display:inline-block;border-bottom:1px solid transparent;padding:0 12px;line-height:48px;font-size:14px;font-weight:500;color:var(--vp-code-tab-text-color);white-space:nowrap;cursor:pointer;transition:color .25s}.vp-code-group .tabs label:after{position:absolute;right:8px;bottom:-1px;left:8px;z-index:1;height:2px;border-radius:2px;content:"";background-color:transparent;transition:background-color .25s}.vp-code-group label:hover{color:var(--vp-code-tab-hover-text-color)}.vp-code-group input:checked+label{color:var(--vp-code-tab-active-text-color)}.vp-code-group input:checked+label:after{background-color:var(--vp-code-tab-active-bar-color)}.vp-code-group div[class*=language-],.vp-block{display:none;margin-top:0!important;border-top-left-radius:0!important;border-top-right-radius:0!important}.vp-code-group div[class*=language-].active,.vp-block.active{display:block}.vp-block{padding:20px 24px}.vp-doc h1,.vp-doc h2,.vp-doc h3,.vp-doc h4,.vp-doc h5,.vp-doc h6{position:relative;font-weight:600;outline:none}.vp-doc h1{letter-spacing:-.02em;line-height:40px;font-size:28px}.vp-doc h2{margin:48px 0 16px;border-top:1px solid var(--vp-c-divider);padding-top:24px;letter-spacing:-.02em;line-height:32px;font-size:24px}.vp-doc h3{margin:32px 0 0;letter-spacing:-.01em;line-height:28px;font-size:20px}.vp-doc .header-anchor{position:absolute;top:0;left:0;margin-left:-.87em;font-weight:500;-webkit-user-select:none;user-select:none;opacity:0;text-decoration:none;transition:color .25s,opacity .25s}.vp-doc .header-anchor:before{content:var(--vp-header-anchor-symbol)}.vp-doc h1:hover .header-anchor,.vp-doc h1 .header-anchor:focus,.vp-doc h2:hover .header-anchor,.vp-doc h2 .header-anchor:focus,.vp-doc h3:hover .header-anchor,.vp-doc h3 .header-anchor:focus,.vp-doc h4:hover .header-anchor,.vp-doc h4 .header-anchor:focus,.vp-doc h5:hover .header-anchor,.vp-doc h5 .header-anchor:focus,.vp-doc h6:hover .header-anchor,.vp-doc h6 .header-anchor:focus{opacity:1}@media (min-width: 768px){.vp-doc h1{letter-spacing:-.02em;line-height:40px;font-size:32px}}.vp-doc h2 .header-anchor{top:24px}.vp-doc p,.vp-doc summary{margin:16px 0}.vp-doc p{line-height:28px}.vp-doc blockquote{margin:16px 0;border-left:2px solid var(--vp-c-divider);padding-left:16px;transition:border-color .5s}.vp-doc blockquote>p{margin:0;font-size:16px;color:var(--vp-c-text-2);transition:color .5s}.vp-doc a{font-weight:500;color:var(--vp-c-brand-1);text-decoration:underline;text-underline-offset:2px;transition:color .25s,opacity .25s}.vp-doc a:hover{color:var(--vp-c-brand-2)}.vp-doc strong{font-weight:600}.vp-doc ul,.vp-doc ol{padding-left:1.25rem;margin:16px 0}.vp-doc ul{list-style:disc}.vp-doc ol{list-style:decimal}.vp-doc li+li{margin-top:8px}.vp-doc li>ol,.vp-doc li>ul{margin:8px 0 0}.vp-doc table{display:block;border-collapse:collapse;margin:20px 0;overflow-x:auto}.vp-doc tr{background-color:var(--vp-c-bg);border-top:1px solid var(--vp-c-divider);transition:background-color .5s}.vp-doc tr:nth-child(2n){background-color:var(--vp-c-bg-soft)}.vp-doc th,.vp-doc td{border:1px solid var(--vp-c-divider);padding:8px 16px}.vp-doc th{text-align:left;font-size:14px;font-weight:600;color:var(--vp-c-text-2);background-color:var(--vp-c-bg-soft)}.vp-doc td{font-size:14px}.vp-doc hr{margin:16px 0;border:none;border-top:1px solid var(--vp-c-divider)}.vp-doc .custom-block{margin:16px 0}.vp-doc .custom-block p{margin:8px 0;line-height:24px}.vp-doc .custom-block p:first-child{margin:0}.vp-doc .custom-block div[class*=language-]{margin:8px 0;border-radius:8px}.vp-doc .custom-block div[class*=language-] code{font-weight:400;background-color:transparent}.vp-doc .custom-block .vp-code-group .tabs{margin:0;border-radius:8px 8px 0 0}.vp-doc :not(pre,h1,h2,h3,h4,h5,h6)>code{font-size:var(--vp-code-font-size);color:var(--vp-code-color)}.vp-doc :not(pre)>code{border-radius:4px;padding:3px 6px;background-color:var(--vp-code-bg);transition:color .25s,background-color .5s}.vp-doc a>code{color:var(--vp-code-link-color)}.vp-doc a:hover>code{color:var(--vp-code-link-hover-color)}.vp-doc h1>code,.vp-doc h2>code,.vp-doc h3>code{font-size:.9em}.vp-doc div[class*=language-],.vp-block{position:relative;margin:16px -24px;background-color:var(--vp-code-block-bg);overflow-x:auto;transition:background-color .5s}@media (min-width: 640px){.vp-doc div[class*=language-],.vp-block{border-radius:8px;margin:16px 0}}@media (max-width: 639px){.vp-doc li div[class*=language-]{border-radius:8px 0 0 8px}}.vp-doc div[class*=language-]+div[class*=language-],.vp-doc div[class$=-api]+div[class*=language-],.vp-doc div[class*=language-]+div[class$=-api]>div[class*=language-]{margin-top:-8px}.vp-doc [class*=language-] pre,.vp-doc [class*=language-] code{direction:ltr;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none}.vp-doc [class*=language-] pre{position:relative;z-index:1;margin:0;padding:20px 0;background:transparent;overflow-x:auto}.vp-doc [class*=language-] code{display:block;padding:0 24px;width:fit-content;min-width:100%;line-height:var(--vp-code-line-height);font-size:var(--vp-code-font-size);color:var(--vp-code-block-color);transition:color .5s}.vp-doc [class*=language-] code .highlighted{background-color:var(--vp-code-line-highlight-color);transition:background-color .5s;margin:0 -24px;padding:0 24px;width:calc(100% + 48px);display:inline-block}.vp-doc [class*=language-] code .highlighted.error{background-color:var(--vp-code-line-error-color)}.vp-doc [class*=language-] code .highlighted.warning{background-color:var(--vp-code-line-warning-color)}.vp-doc [class*=language-] code .diff{transition:background-color .5s;margin:0 -24px;padding:0 24px;width:calc(100% + 48px);display:inline-block}.vp-doc [class*=language-] code .diff:before{position:absolute;left:10px}.vp-doc [class*=language-] .has-focused-lines .line:not(.has-focus){filter:blur(.095rem);opacity:.4;transition:filter .35s,opacity .35s}.vp-doc [class*=language-] .has-focused-lines .line:not(.has-focus){opacity:.7;transition:filter .35s,opacity .35s}.vp-doc [class*=language-]:hover .has-focused-lines .line:not(.has-focus){filter:blur(0);opacity:1}.vp-doc [class*=language-] code .diff.remove{background-color:var(--vp-code-line-diff-remove-color);opacity:.7}.vp-doc [class*=language-] code .diff.remove:before{content:"-";color:var(--vp-code-line-diff-remove-symbol-color)}.vp-doc [class*=language-] code .diff.add{background-color:var(--vp-code-line-diff-add-color)}.vp-doc [class*=language-] code .diff.add:before{content:"+";color:var(--vp-code-line-diff-add-symbol-color)}.vp-doc div[class*=language-].line-numbers-mode{padding-left:32px}.vp-doc .line-numbers-wrapper{position:absolute;top:0;bottom:0;left:0;z-index:3;border-right:1px solid var(--vp-code-block-divider-color);padding-top:20px;width:32px;text-align:center;font-family:var(--vp-font-family-mono);line-height:var(--vp-code-line-height);font-size:var(--vp-code-font-size);color:var(--vp-code-line-number-color);transition:border-color .5s,color .5s}.vp-doc [class*=language-]>button.copy{direction:ltr;position:absolute;top:12px;right:12px;z-index:3;border:1px solid var(--vp-code-copy-code-border-color);border-radius:4px;width:40px;height:40px;background-color:var(--vp-code-copy-code-bg);opacity:0;cursor:pointer;background-image:var(--vp-icon-copy);background-position:50%;background-size:20px;background-repeat:no-repeat;transition:border-color .25s,background-color .25s,opacity .25s}.vp-doc [class*=language-]:hover>button.copy,.vp-doc [class*=language-]>button.copy:focus{opacity:1}.vp-doc [class*=language-]>button.copy:hover,.vp-doc [class*=language-]>button.copy.copied{border-color:var(--vp-code-copy-code-hover-border-color);background-color:var(--vp-code-copy-code-hover-bg)}.vp-doc [class*=language-]>button.copy.copied,.vp-doc [class*=language-]>button.copy:hover.copied{border-radius:0 4px 4px 0;background-color:var(--vp-code-copy-code-hover-bg);background-image:var(--vp-icon-copied)}.vp-doc [class*=language-]>button.copy.copied:before,.vp-doc [class*=language-]>button.copy:hover.copied:before{position:relative;top:-1px;transform:translate(calc(-100% - 1px));display:flex;justify-content:center;align-items:center;border:1px solid var(--vp-code-copy-code-hover-border-color);border-right:0;border-radius:4px 0 0 4px;padding:0 10px;width:fit-content;height:40px;text-align:center;font-size:12px;font-weight:500;color:var(--vp-code-copy-code-active-text);background-color:var(--vp-code-copy-code-hover-bg);white-space:nowrap;content:var(--vp-code-copy-copied-text-content)}.vp-doc [class*=language-]>span.lang{position:absolute;top:2px;right:8px;z-index:2;font-size:12px;font-weight:500;color:var(--vp-code-lang-color);transition:color .4s,opacity .4s}.vp-doc [class*=language-]:hover>button.copy+span.lang,.vp-doc [class*=language-]>button.copy:focus+span.lang{opacity:0}.vp-doc .VPTeamMembers{margin-top:24px}.vp-doc .VPTeamMembers.small.count-1 .container{margin:0!important;max-width:calc((100% - 24px)/2)!important}.vp-doc .VPTeamMembers.small.count-2 .container,.vp-doc .VPTeamMembers.small.count-3 .container{max-width:100%!important}.vp-doc .VPTeamMembers.medium.count-1 .container{margin:0!important;max-width:calc((100% - 24px)/2)!important}:is(.vp-external-link-icon,.vp-doc a[href*="://"],.vp-doc a[target=_blank]):not(.no-icon):after{display:inline-block;margin-top:-1px;margin-left:4px;width:11px;height:11px;background:currentColor;color:var(--vp-c-text-3);flex-shrink:0;--icon: url("data:image/svg+xml, %3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' %3E%3Cpath d='M0 0h24v24H0V0z' fill='none' /%3E%3Cpath d='M9 5v2h6.59L4 18.59 5.41 20 17 8.41V15h2V5H9z' /%3E%3C/svg%3E");-webkit-mask-image:var(--icon);mask-image:var(--icon)}.vp-external-link-icon:after{content:""}.external-link-icon-enabled :is(.vp-doc a[href*="://"],.vp-doc a[target=_blank]):after{content:"";color:currentColor}.vp-sponsor{border-radius:16px;overflow:hidden}.vp-sponsor.aside{border-radius:12px}.vp-sponsor-section+.vp-sponsor-section{margin-top:4px}.vp-sponsor-tier{margin:0 0 4px!important;text-align:center;letter-spacing:1px!important;line-height:24px;width:100%;font-weight:600;color:var(--vp-c-text-2);background-color:var(--vp-c-bg-soft)}.vp-sponsor.normal .vp-sponsor-tier{padding:13px 0 11px;font-size:14px}.vp-sponsor.aside .vp-sponsor-tier{padding:9px 0 7px;font-size:12px}.vp-sponsor-grid+.vp-sponsor-tier{margin-top:4px}.vp-sponsor-grid{display:flex;flex-wrap:wrap;gap:4px}.vp-sponsor-grid.xmini .vp-sponsor-grid-link{height:64px}.vp-sponsor-grid.xmini .vp-sponsor-grid-image{max-width:64px;max-height:22px}.vp-sponsor-grid.mini .vp-sponsor-grid-link{height:72px}.vp-sponsor-grid.mini .vp-sponsor-grid-image{max-width:96px;max-height:24px}.vp-sponsor-grid.small .vp-sponsor-grid-link{height:96px}.vp-sponsor-grid.small .vp-sponsor-grid-image{max-width:96px;max-height:24px}.vp-sponsor-grid.medium .vp-sponsor-grid-link{height:112px}.vp-sponsor-grid.medium .vp-sponsor-grid-image{max-width:120px;max-height:36px}.vp-sponsor-grid.big .vp-sponsor-grid-link{height:184px}.vp-sponsor-grid.big .vp-sponsor-grid-image{max-width:192px;max-height:56px}.vp-sponsor-grid[data-vp-grid="2"] .vp-sponsor-grid-item{width:calc((100% - 4px)/2)}.vp-sponsor-grid[data-vp-grid="3"] .vp-sponsor-grid-item{width:calc((100% - 4px * 2) / 3)}.vp-sponsor-grid[data-vp-grid="4"] .vp-sponsor-grid-item{width:calc((100% - 12px)/4)}.vp-sponsor-grid[data-vp-grid="5"] .vp-sponsor-grid-item{width:calc((100% - 16px)/5)}.vp-sponsor-grid[data-vp-grid="6"] .vp-sponsor-grid-item{width:calc((100% - 4px * 5) / 6)}.vp-sponsor-grid-item{flex-shrink:0;width:100%;background-color:var(--vp-c-bg-soft);transition:background-color .25s}.vp-sponsor-grid-item:hover{background-color:var(--vp-c-default-soft)}.vp-sponsor-grid-item:hover .vp-sponsor-grid-image{filter:grayscale(0) invert(0)}.vp-sponsor-grid-item.empty:hover{background-color:var(--vp-c-bg-soft)}.dark .vp-sponsor-grid-item:hover{background-color:var(--vp-c-white)}.dark .vp-sponsor-grid-item.empty:hover{background-color:var(--vp-c-bg-soft)}.vp-sponsor-grid-link{display:flex}.vp-sponsor-grid-box{display:flex;justify-content:center;align-items:center;width:100%}.vp-sponsor-grid-image{max-width:100%;filter:grayscale(1);transition:filter .25s}.dark .vp-sponsor-grid-image{filter:grayscale(1) invert(1)}.VPBadge{display:inline-block;margin-left:2px;border:1px solid transparent;border-radius:12px;padding:0 10px;line-height:22px;font-size:12px;font-weight:500;transform:translateY(-2px)}.VPBadge.small{padding:0 6px;line-height:18px;font-size:10px;transform:translateY(-8px)}.VPDocFooter .VPBadge{display:none}.vp-doc h1>.VPBadge{margin-top:4px;vertical-align:top}.vp-doc h2>.VPBadge{margin-top:3px;padding:0 8px;vertical-align:top}.vp-doc h3>.VPBadge{vertical-align:middle}.vp-doc h4>.VPBadge,.vp-doc h5>.VPBadge,.vp-doc h6>.VPBadge{vertical-align:middle;line-height:18px}.VPBadge.info{border-color:var(--vp-badge-info-border);color:var(--vp-badge-info-text);background-color:var(--vp-badge-info-bg)}.VPBadge.tip{border-color:var(--vp-badge-tip-border);color:var(--vp-badge-tip-text);background-color:var(--vp-badge-tip-bg)}.VPBadge.warning{border-color:var(--vp-badge-warning-border);color:var(--vp-badge-warning-text);background-color:var(--vp-badge-warning-bg)}.VPBadge.danger{border-color:var(--vp-badge-danger-border);color:var(--vp-badge-danger-text);background-color:var(--vp-badge-danger-bg)}.VPBackdrop[data-v-c79a1216]{position:fixed;top:0;right:0;bottom:0;left:0;z-index:var(--vp-z-index-backdrop);background:var(--vp-backdrop-bg-color);transition:opacity .5s}.VPBackdrop.fade-enter-from[data-v-c79a1216],.VPBackdrop.fade-leave-to[data-v-c79a1216]{opacity:0}.VPBackdrop.fade-leave-active[data-v-c79a1216]{transition-duration:.25s}@media (min-width: 1280px){.VPBackdrop[data-v-c79a1216]{display:none}}.NotFound[data-v-d6be1790]{padding:64px 24px 96px;text-align:center}@media (min-width: 768px){.NotFound[data-v-d6be1790]{padding:96px 32px 168px}}.code[data-v-d6be1790]{line-height:64px;font-size:64px;font-weight:600}.title[data-v-d6be1790]{padding-top:12px;letter-spacing:2px;line-height:20px;font-size:20px;font-weight:700}.divider[data-v-d6be1790]{margin:24px auto 18px;width:64px;height:1px;background-color:var(--vp-c-divider)}.quote[data-v-d6be1790]{margin:0 auto;max-width:256px;font-size:14px;font-weight:500;color:var(--vp-c-text-2)}.action[data-v-d6be1790]{padding-top:20px}.link[data-v-d6be1790]{display:inline-block;border:1px solid var(--vp-c-brand-1);border-radius:16px;padding:3px 16px;font-size:14px;font-weight:500;color:var(--vp-c-brand-1);transition:border-color .25s,color .25s}.link[data-v-d6be1790]:hover{border-color:var(--vp-c-brand-2);color:var(--vp-c-brand-2)}.root[data-v-b933a997]{position:relative;z-index:1}.nested[data-v-b933a997]{padding-right:16px;padding-left:16px}.outline-link[data-v-b933a997]{display:block;line-height:32px;font-size:14px;font-weight:400;color:var(--vp-c-text-2);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;transition:color .5s}.outline-link[data-v-b933a997]:hover,.outline-link.active[data-v-b933a997]{color:var(--vp-c-text-1);transition:color .25s}.outline-link.nested[data-v-b933a997]{padding-left:13px}.VPDocAsideOutline[data-v-a5bbad30]{display:none}.VPDocAsideOutline.has-outline[data-v-a5bbad30]{display:block}.content[data-v-a5bbad30]{position:relative;border-left:1px solid var(--vp-c-divider);padding-left:16px;font-size:13px;font-weight:500}.outline-marker[data-v-a5bbad30]{position:absolute;top:32px;left:-1px;z-index:0;opacity:0;width:2px;border-radius:2px;height:18px;background-color:var(--vp-c-brand-1);transition:top .25s cubic-bezier(0,1,.5,1),background-color .5s,opacity .25s}.outline-title[data-v-a5bbad30]{line-height:32px;font-size:14px;font-weight:600}.VPDocAside[data-v-3f215769]{display:flex;flex-direction:column;flex-grow:1}.spacer[data-v-3f215769]{flex-grow:1}.VPDocAside[data-v-3f215769] .spacer+.VPDocAsideSponsors,.VPDocAside[data-v-3f215769] .spacer+.VPDocAsideCarbonAds{margin-top:24px}.VPDocAside[data-v-3f215769] .VPDocAsideSponsors+.VPDocAsideCarbonAds{margin-top:16px}.VPLastUpdated[data-v-7e05ebdb]{line-height:24px;font-size:14px;font-weight:500;color:var(--vp-c-text-2)}@media (min-width: 640px){.VPLastUpdated[data-v-7e05ebdb]{line-height:32px;font-size:14px;font-weight:500}}.VPDocFooter[data-v-d4a0bba5]{margin-top:64px}.edit-info[data-v-d4a0bba5]{padding-bottom:18px}@media (min-width: 640px){.edit-info[data-v-d4a0bba5]{display:flex;justify-content:space-between;align-items:center;padding-bottom:14px}}.edit-link-button[data-v-d4a0bba5]{display:flex;align-items:center;border:0;line-height:32px;font-size:14px;font-weight:500;color:var(--vp-c-brand-1);transition:color .25s}.edit-link-button[data-v-d4a0bba5]:hover{color:var(--vp-c-brand-2)}.edit-link-icon[data-v-d4a0bba5]{margin-right:8px}.prev-next[data-v-d4a0bba5]{border-top:1px solid var(--vp-c-divider);padding-top:24px;display:grid;grid-row-gap:8px}@media (min-width: 640px){.prev-next[data-v-d4a0bba5]{grid-template-columns:repeat(2,1fr);grid-column-gap:16px}}.pager-link[data-v-d4a0bba5]{display:block;border:1px solid var(--vp-c-divider);border-radius:8px;padding:11px 16px 13px;width:100%;height:100%;transition:border-color .25s}.pager-link[data-v-d4a0bba5]:hover{border-color:var(--vp-c-brand-1)}.pager-link.next[data-v-d4a0bba5]{margin-left:auto;text-align:right}.desc[data-v-d4a0bba5]{display:block;line-height:20px;font-size:12px;font-weight:500;color:var(--vp-c-text-2)}.title[data-v-d4a0bba5]{display:block;line-height:20px;font-size:14px;font-weight:500;color:var(--vp-c-brand-1);transition:color .25s}.VPDoc[data-v-39a288b8]{padding:32px 24px 96px;width:100%}@media (min-width: 768px){.VPDoc[data-v-39a288b8]{padding:48px 32px 128px}}@media (min-width: 960px){.VPDoc[data-v-39a288b8]{padding:48px 32px 0}.VPDoc:not(.has-sidebar) .container[data-v-39a288b8]{display:flex;justify-content:center;max-width:992px}.VPDoc:not(.has-sidebar) .content[data-v-39a288b8]{max-width:752px}}@media (min-width: 1280px){.VPDoc .container[data-v-39a288b8]{display:flex;justify-content:center}.VPDoc .aside[data-v-39a288b8]{display:block}}@media (min-width: 1440px){.VPDoc:not(.has-sidebar) .content[data-v-39a288b8]{max-width:784px}.VPDoc:not(.has-sidebar) .container[data-v-39a288b8]{max-width:1104px}}.container[data-v-39a288b8]{margin:0 auto;width:100%}.aside[data-v-39a288b8]{position:relative;display:none;order:2;flex-grow:1;padding-left:32px;width:100%;max-width:256px}.left-aside[data-v-39a288b8]{order:1;padding-left:unset;padding-right:32px}.aside-container[data-v-39a288b8]{position:fixed;top:0;padding-top:calc(var(--vp-nav-height) + var(--vp-layout-top-height, 0px) + var(--vp-doc-top-height, 0px) + 48px);width:224px;height:100vh;overflow-x:hidden;overflow-y:auto;scrollbar-width:none}.aside-container[data-v-39a288b8]::-webkit-scrollbar{display:none}.aside-curtain[data-v-39a288b8]{position:fixed;bottom:0;z-index:10;width:224px;height:32px;background:linear-gradient(transparent,var(--vp-c-bg) 70%)}.aside-content[data-v-39a288b8]{display:flex;flex-direction:column;min-height:calc(100vh - (var(--vp-nav-height) + var(--vp-layout-top-height, 0px) + 48px));padding-bottom:32px}.content[data-v-39a288b8]{position:relative;margin:0 auto;width:100%}@media (min-width: 960px){.content[data-v-39a288b8]{padding:0 32px 128px}}@media (min-width: 1280px){.content[data-v-39a288b8]{order:1;margin:0;min-width:640px}}.content-container[data-v-39a288b8]{margin:0 auto}.VPDoc.has-aside .content-container[data-v-39a288b8]{max-width:688px}.VPButton[data-v-cad61b99]{display:inline-block;border:1px solid transparent;text-align:center;font-weight:600;white-space:nowrap;transition:color .25s,border-color .25s,background-color .25s}.VPButton[data-v-cad61b99]:active{transition:color .1s,border-color .1s,background-color .1s}.VPButton.medium[data-v-cad61b99]{border-radius:20px;padding:0 20px;line-height:38px;font-size:14px}.VPButton.big[data-v-cad61b99]{border-radius:24px;padding:0 24px;line-height:46px;font-size:16px}.VPButton.brand[data-v-cad61b99]{border-color:var(--vp-button-brand-border);color:var(--vp-button-brand-text);background-color:var(--vp-button-brand-bg)}.VPButton.brand[data-v-cad61b99]:hover{border-color:var(--vp-button-brand-hover-border);color:var(--vp-button-brand-hover-text);background-color:var(--vp-button-brand-hover-bg)}.VPButton.brand[data-v-cad61b99]:active{border-color:var(--vp-button-brand-active-border);color:var(--vp-button-brand-active-text);background-color:var(--vp-button-brand-active-bg)}.VPButton.alt[data-v-cad61b99]{border-color:var(--vp-button-alt-border);color:var(--vp-button-alt-text);background-color:var(--vp-button-alt-bg)}.VPButton.alt[data-v-cad61b99]:hover{border-color:var(--vp-button-alt-hover-border);color:var(--vp-button-alt-hover-text);background-color:var(--vp-button-alt-hover-bg)}.VPButton.alt[data-v-cad61b99]:active{border-color:var(--vp-button-alt-active-border);color:var(--vp-button-alt-active-text);background-color:var(--vp-button-alt-active-bg)}.VPButton.sponsor[data-v-cad61b99]{border-color:var(--vp-button-sponsor-border);color:var(--vp-button-sponsor-text);background-color:var(--vp-button-sponsor-bg)}.VPButton.sponsor[data-v-cad61b99]:hover{border-color:var(--vp-button-sponsor-hover-border);color:var(--vp-button-sponsor-hover-text);background-color:var(--vp-button-sponsor-hover-bg)}.VPButton.sponsor[data-v-cad61b99]:active{border-color:var(--vp-button-sponsor-active-border);color:var(--vp-button-sponsor-active-text);background-color:var(--vp-button-sponsor-active-bg)}html:not(.dark) .VPImage.dark[data-v-8426fc1a]{display:none}.dark .VPImage.light[data-v-8426fc1a]{display:none}.VPHero[data-v-303bb580]{margin-top:calc((var(--vp-nav-height) + var(--vp-layout-top-height, 0px)) * -1);padding:calc(var(--vp-nav-height) + var(--vp-layout-top-height, 0px) + 48px) 24px 48px}@media (min-width: 640px){.VPHero[data-v-303bb580]{padding:calc(var(--vp-nav-height) + var(--vp-layout-top-height, 0px) + 80px) 48px 64px}}@media (min-width: 960px){.VPHero[data-v-303bb580]{padding:calc(var(--vp-nav-height) + var(--vp-layout-top-height, 0px) + 80px) 64px 64px}}.container[data-v-303bb580]{display:flex;flex-direction:column;margin:0 auto;max-width:1152px}@media (min-width: 960px){.container[data-v-303bb580]{flex-direction:row}}.main[data-v-303bb580]{position:relative;z-index:10;order:2;flex-grow:1;flex-shrink:0}.VPHero.has-image .container[data-v-303bb580]{text-align:center}@media (min-width: 960px){.VPHero.has-image .container[data-v-303bb580]{text-align:left}}@media (min-width: 960px){.main[data-v-303bb580]{order:1;width:calc((100% / 3) * 2)}.VPHero.has-image .main[data-v-303bb580]{max-width:592px}}.name[data-v-303bb580],.text[data-v-303bb580]{max-width:392px;letter-spacing:-.4px;line-height:40px;font-size:32px;font-weight:700;white-space:pre-wrap}.VPHero.has-image .name[data-v-303bb580],.VPHero.has-image .text[data-v-303bb580]{margin:0 auto}.name[data-v-303bb580]{color:var(--vp-home-hero-name-color)}.clip[data-v-303bb580]{background:var(--vp-home-hero-name-background);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:var(--vp-home-hero-name-color)}@media (min-width: 640px){.name[data-v-303bb580],.text[data-v-303bb580]{max-width:576px;line-height:56px;font-size:48px}}@media (min-width: 960px){.name[data-v-303bb580],.text[data-v-303bb580]{line-height:64px;font-size:56px}.VPHero.has-image .name[data-v-303bb580],.VPHero.has-image .text[data-v-303bb580]{margin:0}}.tagline[data-v-303bb580]{padding-top:8px;max-width:392px;line-height:28px;font-size:18px;font-weight:500;white-space:pre-wrap;color:var(--vp-c-text-2)}.VPHero.has-image .tagline[data-v-303bb580]{margin:0 auto}@media (min-width: 640px){.tagline[data-v-303bb580]{padding-top:12px;max-width:576px;line-height:32px;font-size:20px}}@media (min-width: 960px){.tagline[data-v-303bb580]{line-height:36px;font-size:24px}.VPHero.has-image .tagline[data-v-303bb580]{margin:0}}.actions[data-v-303bb580]{display:flex;flex-wrap:wrap;margin:-6px;padding-top:24px}.VPHero.has-image .actions[data-v-303bb580]{justify-content:center}@media (min-width: 640px){.actions[data-v-303bb580]{padding-top:32px}}@media (min-width: 960px){.VPHero.has-image .actions[data-v-303bb580]{justify-content:flex-start}}.action[data-v-303bb580]{flex-shrink:0;padding:6px}.image[data-v-303bb580]{order:1;margin:-76px -24px -48px}@media (min-width: 640px){.image[data-v-303bb580]{margin:-108px -24px -48px}}@media (min-width: 960px){.image[data-v-303bb580]{flex-grow:1;order:2;margin:0;min-height:100%}}.image-container[data-v-303bb580]{position:relative;margin:0 auto;width:320px;height:320px}@media (min-width: 640px){.image-container[data-v-303bb580]{width:392px;height:392px}}@media (min-width: 960px){.image-container[data-v-303bb580]{display:flex;justify-content:center;align-items:center;width:100%;height:100%;transform:translate(-32px,-32px)}}.image-bg[data-v-303bb580]{position:absolute;top:50%;left:50%;border-radius:50%;width:192px;height:192px;background-image:var(--vp-home-hero-image-background-image);filter:var(--vp-home-hero-image-filter);transform:translate(-50%,-50%)}@media (min-width: 640px){.image-bg[data-v-303bb580]{width:256px;height:256px}}@media (min-width: 960px){.image-bg[data-v-303bb580]{width:320px;height:320px}}[data-v-303bb580] .image-src{position:absolute;top:50%;left:50%;max-width:192px;max-height:192px;transform:translate(-50%,-50%)}@media (min-width: 640px){[data-v-303bb580] .image-src{max-width:256px;max-height:256px}}@media (min-width: 960px){[data-v-303bb580] .image-src{max-width:320px;max-height:320px}}.VPFeature[data-v-a3976bdc]{display:block;border:1px solid var(--vp-c-bg-soft);border-radius:12px;height:100%;background-color:var(--vp-c-bg-soft);transition:border-color .25s,background-color .25s}.VPFeature.link[data-v-a3976bdc]:hover{border-color:var(--vp-c-brand-1)}.box[data-v-a3976bdc]{display:flex;flex-direction:column;padding:24px;height:100%}.box[data-v-a3976bdc]>.VPImage{margin-bottom:20px}.icon[data-v-a3976bdc]{display:flex;justify-content:center;align-items:center;margin-bottom:20px;border-radius:6px;background-color:var(--vp-c-default-soft);width:48px;height:48px;font-size:24px;transition:background-color .25s}.title[data-v-a3976bdc]{line-height:24px;font-size:16px;font-weight:600}.details[data-v-a3976bdc]{flex-grow:1;padding-top:8px;line-height:24px;font-size:14px;font-weight:500;color:var(--vp-c-text-2)}.link-text[data-v-a3976bdc]{padding-top:8px}.link-text-value[data-v-a3976bdc]{display:flex;align-items:center;font-size:14px;font-weight:500;color:var(--vp-c-brand-1)}.link-text-icon[data-v-a3976bdc]{margin-left:6px}.VPFeatures[data-v-a6181336]{position:relative;padding:0 24px}@media (min-width: 640px){.VPFeatures[data-v-a6181336]{padding:0 48px}}@media (min-width: 960px){.VPFeatures[data-v-a6181336]{padding:0 64px}}.container[data-v-a6181336]{margin:0 auto;max-width:1152px}.items[data-v-a6181336]{display:flex;flex-wrap:wrap;margin:-8px}.item[data-v-a6181336]{padding:8px;width:100%}@media (min-width: 640px){.item.grid-2[data-v-a6181336],.item.grid-4[data-v-a6181336],.item.grid-6[data-v-a6181336]{width:50%}}@media (min-width: 768px){.item.grid-2[data-v-a6181336],.item.grid-4[data-v-a6181336]{width:50%}.item.grid-3[data-v-a6181336],.item.grid-6[data-v-a6181336]{width:calc(100% / 3)}}@media (min-width: 960px){.item.grid-4[data-v-a6181336]{width:25%}}.container[data-v-8e2d4988]{margin:auto;width:100%;max-width:1280px;padding:0 24px}@media (min-width: 640px){.container[data-v-8e2d4988]{padding:0 48px}}@media (min-width: 960px){.container[data-v-8e2d4988]{width:100%;padding:0 64px}}.vp-doc[data-v-8e2d4988] .VPHomeSponsors,.vp-doc[data-v-8e2d4988] .VPTeamPage{margin-left:var(--vp-offset, calc(50% - 50vw) );margin-right:var(--vp-offset, calc(50% - 50vw) )}.vp-doc[data-v-8e2d4988] .VPHomeSponsors h2{border-top:none;letter-spacing:normal}.vp-doc[data-v-8e2d4988] .VPHomeSponsors a,.vp-doc[data-v-8e2d4988] .VPTeamPage a{text-decoration:none}.VPHome[data-v-686f80a6]{margin-bottom:96px}@media (min-width: 768px){.VPHome[data-v-686f80a6]{margin-bottom:128px}}.VPContent[data-v-1428d186]{flex-grow:1;flex-shrink:0;margin:var(--vp-layout-top-height, 0px) auto 0;width:100%}.VPContent.is-home[data-v-1428d186]{width:100%;max-width:100%}.VPContent.has-sidebar[data-v-1428d186]{margin:0}@media (min-width: 960px){.VPContent[data-v-1428d186]{padding-top:var(--vp-nav-height)}.VPContent.has-sidebar[data-v-1428d186]{margin:var(--vp-layout-top-height, 0px) 0 0;padding-left:var(--vp-sidebar-width)}}@media (min-width: 1440px){.VPContent.has-sidebar[data-v-1428d186]{padding-right:calc((100vw - var(--vp-layout-max-width)) / 2);padding-left:calc((100vw - var(--vp-layout-max-width)) / 2 + var(--vp-sidebar-width))}}.VPFooter[data-v-e315a0ad]{position:relative;z-index:var(--vp-z-index-footer);border-top:1px solid var(--vp-c-gutter);padding:32px 24px;background-color:var(--vp-c-bg)}.VPFooter.has-sidebar[data-v-e315a0ad]{display:none}.VPFooter[data-v-e315a0ad] a{text-decoration-line:underline;text-underline-offset:2px;transition:color .25s}.VPFooter[data-v-e315a0ad] a:hover{color:var(--vp-c-text-1)}@media (min-width: 768px){.VPFooter[data-v-e315a0ad]{padding:32px}}.container[data-v-e315a0ad]{margin:0 auto;max-width:var(--vp-layout-max-width);text-align:center}.message[data-v-e315a0ad],.copyright[data-v-e315a0ad]{line-height:24px;font-size:14px;font-weight:500;color:var(--vp-c-text-2)}.VPLocalNavOutlineDropdown[data-v-17a5e62e]{padding:12px 20px 11px}@media (min-width: 960px){.VPLocalNavOutlineDropdown[data-v-17a5e62e]{padding:12px 36px 11px}}.VPLocalNavOutlineDropdown button[data-v-17a5e62e]{display:block;font-size:12px;font-weight:500;line-height:24px;color:var(--vp-c-text-2);transition:color .5s;position:relative}.VPLocalNavOutlineDropdown button[data-v-17a5e62e]:hover{color:var(--vp-c-text-1);transition:color .25s}.VPLocalNavOutlineDropdown button.open[data-v-17a5e62e]{color:var(--vp-c-text-1)}.icon[data-v-17a5e62e]{display:inline-block;vertical-align:middle;margin-left:2px;font-size:14px;transform:rotate(0);transition:transform .25s}@media (min-width: 960px){.VPLocalNavOutlineDropdown button[data-v-17a5e62e]{font-size:14px}.icon[data-v-17a5e62e]{font-size:16px}}.open>.icon[data-v-17a5e62e]{transform:rotate(90deg)}.items[data-v-17a5e62e]{position:absolute;top:40px;right:16px;left:16px;display:grid;gap:1px;border:1px solid var(--vp-c-border);border-radius:8px;background-color:var(--vp-c-gutter);max-height:calc(var(--vp-vh, 100vh) - 86px);overflow:hidden auto;box-shadow:var(--vp-shadow-3)}@media (min-width: 960px){.items[data-v-17a5e62e]{right:auto;left:calc(var(--vp-sidebar-width) + 32px);width:320px}}.header[data-v-17a5e62e]{background-color:var(--vp-c-bg-soft)}.top-link[data-v-17a5e62e]{display:block;padding:0 16px;line-height:48px;font-size:14px;font-weight:500;color:var(--vp-c-brand-1)}.outline[data-v-17a5e62e]{padding:8px 0;background-color:var(--vp-c-bg-soft)}.flyout-enter-active[data-v-17a5e62e]{transition:all .2s ease-out}.flyout-leave-active[data-v-17a5e62e]{transition:all .15s ease-in}.flyout-enter-from[data-v-17a5e62e],.flyout-leave-to[data-v-17a5e62e]{opacity:0;transform:translateY(-16px)}.VPLocalNav[data-v-a6f0e41e]{position:sticky;top:0;left:0;z-index:var(--vp-z-index-local-nav);border-bottom:1px solid var(--vp-c-gutter);padding-top:var(--vp-layout-top-height, 0px);width:100%;background-color:var(--vp-local-nav-bg-color)}.VPLocalNav.fixed[data-v-a6f0e41e]{position:fixed}@media (min-width: 960px){.VPLocalNav[data-v-a6f0e41e]{top:var(--vp-nav-height)}.VPLocalNav.has-sidebar[data-v-a6f0e41e]{padding-left:var(--vp-sidebar-width)}.VPLocalNav.empty[data-v-a6f0e41e]{display:none}}@media (min-width: 1280px){.VPLocalNav[data-v-a6f0e41e]{display:none}}@media (min-width: 1440px){.VPLocalNav.has-sidebar[data-v-a6f0e41e]{padding-left:calc((100vw - var(--vp-layout-max-width)) / 2 + var(--vp-sidebar-width))}}.container[data-v-a6f0e41e]{display:flex;justify-content:space-between;align-items:center}.menu[data-v-a6f0e41e]{display:flex;align-items:center;padding:12px 24px 11px;line-height:24px;font-size:12px;font-weight:500;color:var(--vp-c-text-2);transition:color .5s}.menu[data-v-a6f0e41e]:hover{color:var(--vp-c-text-1);transition:color .25s}@media (min-width: 768px){.menu[data-v-a6f0e41e]{padding:0 32px}}@media (min-width: 960px){.menu[data-v-a6f0e41e]{display:none}}.menu-icon[data-v-a6f0e41e]{margin-right:8px;font-size:14px}.VPOutlineDropdown[data-v-a6f0e41e]{padding:12px 24px 11px}@media (min-width: 768px){.VPOutlineDropdown[data-v-a6f0e41e]{padding:12px 32px 11px}}.VPSwitch[data-v-1d5665e3]{position:relative;border-radius:11px;display:block;width:40px;height:22px;flex-shrink:0;border:1px solid var(--vp-input-border-color);background-color:var(--vp-input-switch-bg-color);transition:border-color .25s!important}.VPSwitch[data-v-1d5665e3]:hover{border-color:var(--vp-c-brand-1)}.check[data-v-1d5665e3]{position:absolute;top:1px;left:1px;width:18px;height:18px;border-radius:50%;background-color:var(--vp-c-neutral-inverse);box-shadow:var(--vp-shadow-1);transition:transform .25s!important}.icon[data-v-1d5665e3]{position:relative;display:block;width:18px;height:18px;border-radius:50%;overflow:hidden}.icon[data-v-1d5665e3] [class^=vpi-]{position:absolute;top:3px;left:3px;width:12px;height:12px;color:var(--vp-c-text-2)}.dark .icon[data-v-1d5665e3] [class^=vpi-]{color:var(--vp-c-text-1);transition:opacity .25s!important}.sun[data-v-d1f28634]{opacity:1}.moon[data-v-d1f28634],.dark .sun[data-v-d1f28634]{opacity:0}.dark .moon[data-v-d1f28634]{opacity:1}.dark .VPSwitchAppearance[data-v-d1f28634] .check{transform:translate(18px)}.VPNavBarAppearance[data-v-e6aabb21]{display:none}@media (min-width: 1280px){.VPNavBarAppearance[data-v-e6aabb21]{display:flex;align-items:center}}.VPMenuGroup+.VPMenuLink[data-v-43f1e123]{margin:12px -12px 0;border-top:1px solid var(--vp-c-divider);padding:12px 12px 0}.link[data-v-43f1e123]{display:block;border-radius:6px;padding:0 12px;line-height:32px;font-size:14px;font-weight:500;color:var(--vp-c-text-1);white-space:nowrap;transition:background-color .25s,color .25s}.link[data-v-43f1e123]:hover{color:var(--vp-c-brand-1);background-color:var(--vp-c-default-soft)}.link.active[data-v-43f1e123]{color:var(--vp-c-brand-1)}.VPMenuGroup[data-v-69e747b5]{margin:12px -12px 0;border-top:1px solid var(--vp-c-divider);padding:12px 12px 0}.VPMenuGroup[data-v-69e747b5]:first-child{margin-top:0;border-top:0;padding-top:0}.VPMenuGroup+.VPMenuGroup[data-v-69e747b5]{margin-top:12px;border-top:1px solid var(--vp-c-divider)}.title[data-v-69e747b5]{padding:0 12px;line-height:32px;font-size:14px;font-weight:600;color:var(--vp-c-text-2);white-space:nowrap;transition:color .25s}.VPMenu[data-v-e7ea1737]{border-radius:12px;padding:12px;min-width:128px;border:1px solid var(--vp-c-divider);background-color:var(--vp-c-bg-elv);box-shadow:var(--vp-shadow-3);transition:background-color .5s;max-height:calc(100vh - var(--vp-nav-height));overflow-y:auto}.VPMenu[data-v-e7ea1737] .group{margin:0 -12px;padding:0 12px 12px}.VPMenu[data-v-e7ea1737] .group+.group{border-top:1px solid var(--vp-c-divider);padding:11px 12px 12px}.VPMenu[data-v-e7ea1737] .group:last-child{padding-bottom:0}.VPMenu[data-v-e7ea1737] .group+.item{border-top:1px solid var(--vp-c-divider);padding:11px 16px 0}.VPMenu[data-v-e7ea1737] .item{padding:0 16px;white-space:nowrap}.VPMenu[data-v-e7ea1737] .label{flex-grow:1;line-height:28px;font-size:12px;font-weight:500;color:var(--vp-c-text-2);transition:color .5s}.VPMenu[data-v-e7ea1737] .action{padding-left:24px}.VPFlyout[data-v-b6c34ac9]{position:relative}.VPFlyout[data-v-b6c34ac9]:hover{color:var(--vp-c-brand-1);transition:color .25s}.VPFlyout:hover .text[data-v-b6c34ac9]{color:var(--vp-c-text-2)}.VPFlyout:hover .icon[data-v-b6c34ac9]{fill:var(--vp-c-text-2)}.VPFlyout.active .text[data-v-b6c34ac9]{color:var(--vp-c-brand-1)}.VPFlyout.active:hover .text[data-v-b6c34ac9]{color:var(--vp-c-brand-2)}.VPFlyout:hover .menu[data-v-b6c34ac9],.button[aria-expanded=true]+.menu[data-v-b6c34ac9]{opacity:1;visibility:visible;transform:translateY(0)}.button[aria-expanded=false]+.menu[data-v-b6c34ac9]{opacity:0;visibility:hidden;transform:translateY(0)}.button[data-v-b6c34ac9]{display:flex;align-items:center;padding:0 12px;height:var(--vp-nav-height);color:var(--vp-c-text-1);transition:color .5s}.text[data-v-b6c34ac9]{display:flex;align-items:center;line-height:var(--vp-nav-height);font-size:14px;font-weight:500;color:var(--vp-c-text-1);transition:color .25s}.option-icon[data-v-b6c34ac9]{margin-right:0;font-size:16px}.text-icon[data-v-b6c34ac9]{margin-left:4px;font-size:14px}.icon[data-v-b6c34ac9]{font-size:20px;transition:fill .25s}.menu[data-v-b6c34ac9]{position:absolute;top:calc(var(--vp-nav-height) / 2 + 20px);right:0;opacity:0;visibility:hidden;transition:opacity .25s,visibility .25s,transform .25s}.VPSocialLink[data-v-eee4e7cb]{display:flex;justify-content:center;align-items:center;width:36px;height:36px;color:var(--vp-c-text-2);transition:color .5s}.VPSocialLink[data-v-eee4e7cb]:hover{color:var(--vp-c-text-1);transition:color .25s}.VPSocialLink[data-v-eee4e7cb]>svg,.VPSocialLink[data-v-eee4e7cb]>[class^=vpi-social-]{width:20px;height:20px;fill:currentColor}.VPSocialLinks[data-v-7bc22406]{display:flex;justify-content:center}.VPNavBarExtra[data-v-d0bd9dde]{display:none;margin-right:-12px}@media (min-width: 768px){.VPNavBarExtra[data-v-d0bd9dde]{display:block}}@media (min-width: 1280px){.VPNavBarExtra[data-v-d0bd9dde]{display:none}}.trans-title[data-v-d0bd9dde]{padding:0 24px 0 12px;line-height:32px;font-size:14px;font-weight:700;color:var(--vp-c-text-1)}.item.appearance[data-v-d0bd9dde],.item.social-links[data-v-d0bd9dde]{display:flex;align-items:center;padding:0 12px}.item.appearance[data-v-d0bd9dde]{min-width:176px}.appearance-action[data-v-d0bd9dde]{margin-right:-2px}.social-links-list[data-v-d0bd9dde]{margin:-4px -8px}.VPNavBarHamburger[data-v-e5dd9c1c]{display:flex;justify-content:center;align-items:center;width:48px;height:var(--vp-nav-height)}@media (min-width: 768px){.VPNavBarHamburger[data-v-e5dd9c1c]{display:none}}.container[data-v-e5dd9c1c]{position:relative;width:16px;height:14px;overflow:hidden}.VPNavBarHamburger:hover .top[data-v-e5dd9c1c]{top:0;left:0;transform:translate(4px)}.VPNavBarHamburger:hover .middle[data-v-e5dd9c1c]{top:6px;left:0;transform:translate(0)}.VPNavBarHamburger:hover .bottom[data-v-e5dd9c1c]{top:12px;left:0;transform:translate(8px)}.VPNavBarHamburger.active .top[data-v-e5dd9c1c]{top:6px;transform:translate(0) rotate(225deg)}.VPNavBarHamburger.active .middle[data-v-e5dd9c1c]{top:6px;transform:translate(16px)}.VPNavBarHamburger.active .bottom[data-v-e5dd9c1c]{top:6px;transform:translate(0) rotate(135deg)}.VPNavBarHamburger.active:hover .top[data-v-e5dd9c1c],.VPNavBarHamburger.active:hover .middle[data-v-e5dd9c1c],.VPNavBarHamburger.active:hover .bottom[data-v-e5dd9c1c]{background-color:var(--vp-c-text-2);transition:top .25s,background-color .25s,transform .25s}.top[data-v-e5dd9c1c],.middle[data-v-e5dd9c1c],.bottom[data-v-e5dd9c1c]{position:absolute;width:16px;height:2px;background-color:var(--vp-c-text-1);transition:top .25s,background-color .5s,transform .25s}.top[data-v-e5dd9c1c]{top:0;left:0;transform:translate(0)}.middle[data-v-e5dd9c1c]{top:6px;left:0;transform:translate(8px)}.bottom[data-v-e5dd9c1c]{top:12px;left:0;transform:translate(4px)}.VPNavBarMenuLink[data-v-9c663999]{display:flex;align-items:center;padding:0 12px;line-height:var(--vp-nav-height);font-size:14px;font-weight:500;color:var(--vp-c-text-1);transition:color .25s}.VPNavBarMenuLink.active[data-v-9c663999],.VPNavBarMenuLink[data-v-9c663999]:hover{color:var(--vp-c-brand-1)}.VPNavBarMenu[data-v-7f418b0f]{display:none}@media (min-width: 768px){.VPNavBarMenu[data-v-7f418b0f]{display:flex}}/*! @docsearch/css 3.6.0 | MIT License | © Algolia, Inc. and contributors | https://docsearch.algolia.com */:root{--docsearch-primary-color:#5468ff;--docsearch-text-color:#1c1e21;--docsearch-spacing:12px;--docsearch-icon-stroke-width:1.4;--docsearch-highlight-color:var(--docsearch-primary-color);--docsearch-muted-color:#969faf;--docsearch-container-background:rgba(101,108,133,.8);--docsearch-logo-color:#5468ff;--docsearch-modal-width:560px;--docsearch-modal-height:600px;--docsearch-modal-background:#f5f6f7;--docsearch-modal-shadow:inset 1px 1px 0 0 hsla(0,0%,100%,.5),0 3px 8px 0 #555a64;--docsearch-searchbox-height:56px;--docsearch-searchbox-background:#ebedf0;--docsearch-searchbox-focus-background:#fff;--docsearch-searchbox-shadow:inset 0 0 0 2px var(--docsearch-primary-color);--docsearch-hit-height:56px;--docsearch-hit-color:#444950;--docsearch-hit-active-color:#fff;--docsearch-hit-background:#fff;--docsearch-hit-shadow:0 1px 3px 0 #d4d9e1;--docsearch-key-gradient:linear-gradient(-225deg,#d5dbe4,#f8f8f8);--docsearch-key-shadow:inset 0 -2px 0 0 #cdcde6,inset 0 0 1px 1px #fff,0 1px 2px 1px rgba(30,35,90,.4);--docsearch-key-pressed-shadow:inset 0 -2px 0 0 #cdcde6,inset 0 0 1px 1px #fff,0 1px 1px 0 rgba(30,35,90,.4);--docsearch-footer-height:44px;--docsearch-footer-background:#fff;--docsearch-footer-shadow:0 -1px 0 0 #e0e3e8,0 -3px 6px 0 rgba(69,98,155,.12)}html[data-theme=dark]{--docsearch-text-color:#f5f6f7;--docsearch-container-background:rgba(9,10,17,.8);--docsearch-modal-background:#15172a;--docsearch-modal-shadow:inset 1px 1px 0 0 #2c2e40,0 3px 8px 0 #000309;--docsearch-searchbox-background:#090a11;--docsearch-searchbox-focus-background:#000;--docsearch-hit-color:#bec3c9;--docsearch-hit-shadow:none;--docsearch-hit-background:#090a11;--docsearch-key-gradient:linear-gradient(-26.5deg,#565872,#31355b);--docsearch-key-shadow:inset 0 -2px 0 0 #282d55,inset 0 0 1px 1px #51577d,0 2px 2px 0 rgba(3,4,9,.3);--docsearch-key-pressed-shadow:inset 0 -2px 0 0 #282d55,inset 0 0 1px 1px #51577d,0 1px 1px 0 rgba(3,4,9,.30196078431372547);--docsearch-footer-background:#1e2136;--docsearch-footer-shadow:inset 0 1px 0 0 rgba(73,76,106,.5),0 -4px 8px 0 rgba(0,0,0,.2);--docsearch-logo-color:#fff;--docsearch-muted-color:#7f8497}.DocSearch-Button{align-items:center;background:var(--docsearch-searchbox-background);border:0;border-radius:40px;color:var(--docsearch-muted-color);cursor:pointer;display:flex;font-weight:500;height:36px;justify-content:space-between;margin:0 0 0 16px;padding:0 8px;-webkit-user-select:none;user-select:none}.DocSearch-Button:active,.DocSearch-Button:focus,.DocSearch-Button:hover{background:var(--docsearch-searchbox-focus-background);box-shadow:var(--docsearch-searchbox-shadow);color:var(--docsearch-text-color);outline:none}.DocSearch-Button-Container{align-items:center;display:flex}.DocSearch-Search-Icon{stroke-width:1.6}.DocSearch-Button .DocSearch-Search-Icon{color:var(--docsearch-text-color)}.DocSearch-Button-Placeholder{font-size:1rem;padding:0 12px 0 6px}.DocSearch-Button-Keys{display:flex;min-width:calc(40px + .8em)}.DocSearch-Button-Key{align-items:center;background:var(--docsearch-key-gradient);border-radius:3px;box-shadow:var(--docsearch-key-shadow);color:var(--docsearch-muted-color);display:flex;height:18px;justify-content:center;margin-right:.4em;position:relative;padding:0 0 2px;border:0;top:-1px;width:20px}.DocSearch-Button-Key--pressed{transform:translate3d(0,1px,0);box-shadow:var(--docsearch-key-pressed-shadow)}@media (max-width:768px){.DocSearch-Button-Keys,.DocSearch-Button-Placeholder{display:none}}.DocSearch--active{overflow:hidden!important}.DocSearch-Container,.DocSearch-Container *{box-sizing:border-box}.DocSearch-Container{background-color:var(--docsearch-container-background);height:100vh;left:0;position:fixed;top:0;width:100vw;z-index:200}.DocSearch-Container a{text-decoration:none}.DocSearch-Link{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;border:0;color:var(--docsearch-highlight-color);cursor:pointer;font:inherit;margin:0;padding:0}.DocSearch-Modal{background:var(--docsearch-modal-background);border-radius:6px;box-shadow:var(--docsearch-modal-shadow);flex-direction:column;margin:60px auto auto;max-width:var(--docsearch-modal-width);position:relative}.DocSearch-SearchBar{display:flex;padding:var(--docsearch-spacing) var(--docsearch-spacing) 0}.DocSearch-Form{align-items:center;background:var(--docsearch-searchbox-focus-background);border-radius:4px;box-shadow:var(--docsearch-searchbox-shadow);display:flex;height:var(--docsearch-searchbox-height);margin:0;padding:0 var(--docsearch-spacing);position:relative;width:100%}.DocSearch-Input{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:transparent;border:0;color:var(--docsearch-text-color);flex:1;font:inherit;font-size:1.2em;height:100%;outline:none;padding:0 0 0 8px;width:80%}.DocSearch-Input::placeholder{color:var(--docsearch-muted-color);opacity:1}.DocSearch-Input::-webkit-search-cancel-button,.DocSearch-Input::-webkit-search-decoration,.DocSearch-Input::-webkit-search-results-button,.DocSearch-Input::-webkit-search-results-decoration{display:none}.DocSearch-LoadingIndicator,.DocSearch-MagnifierLabel,.DocSearch-Reset{margin:0;padding:0}.DocSearch-MagnifierLabel,.DocSearch-Reset{align-items:center;color:var(--docsearch-highlight-color);display:flex;justify-content:center}.DocSearch-Container--Stalled .DocSearch-MagnifierLabel,.DocSearch-LoadingIndicator{display:none}.DocSearch-Container--Stalled .DocSearch-LoadingIndicator{align-items:center;color:var(--docsearch-highlight-color);display:flex;justify-content:center}@media screen and (prefers-reduced-motion:reduce){.DocSearch-Reset{animation:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;border:0;border-radius:50%;color:var(--docsearch-icon-color);cursor:pointer;right:0;stroke-width:var(--docsearch-icon-stroke-width)}}.DocSearch-Reset{animation:fade-in .1s ease-in forwards;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;border:0;border-radius:50%;color:var(--docsearch-icon-color);cursor:pointer;padding:2px;right:0;stroke-width:var(--docsearch-icon-stroke-width)}.DocSearch-Reset[hidden]{display:none}.DocSearch-Reset:hover{color:var(--docsearch-highlight-color)}.DocSearch-LoadingIndicator svg,.DocSearch-MagnifierLabel svg{height:24px;width:24px}.DocSearch-Cancel{display:none}.DocSearch-Dropdown{max-height:calc(var(--docsearch-modal-height) - var(--docsearch-searchbox-height) - var(--docsearch-spacing) - var(--docsearch-footer-height));min-height:var(--docsearch-spacing);overflow-y:auto;overflow-y:overlay;padding:0 var(--docsearch-spacing);scrollbar-color:var(--docsearch-muted-color) var(--docsearch-modal-background);scrollbar-width:thin}.DocSearch-Dropdown::-webkit-scrollbar{width:12px}.DocSearch-Dropdown::-webkit-scrollbar-track{background:transparent}.DocSearch-Dropdown::-webkit-scrollbar-thumb{background-color:var(--docsearch-muted-color);border:3px solid var(--docsearch-modal-background);border-radius:20px}.DocSearch-Dropdown ul{list-style:none;margin:0;padding:0}.DocSearch-Label{font-size:.75em;line-height:1.6em}.DocSearch-Help,.DocSearch-Label{color:var(--docsearch-muted-color)}.DocSearch-Help{font-size:.9em;margin:0;-webkit-user-select:none;user-select:none}.DocSearch-Title{font-size:1.2em}.DocSearch-Logo a{display:flex}.DocSearch-Logo svg{color:var(--docsearch-logo-color);margin-left:8px}.DocSearch-Hits:last-of-type{margin-bottom:24px}.DocSearch-Hits mark{background:none;color:var(--docsearch-highlight-color)}.DocSearch-HitsFooter{color:var(--docsearch-muted-color);display:flex;font-size:.85em;justify-content:center;margin-bottom:var(--docsearch-spacing);padding:var(--docsearch-spacing)}.DocSearch-HitsFooter a{border-bottom:1px solid;color:inherit}.DocSearch-Hit{border-radius:4px;display:flex;padding-bottom:4px;position:relative}@media screen and (prefers-reduced-motion:reduce){.DocSearch-Hit--deleting{transition:none}}.DocSearch-Hit--deleting{opacity:0;transition:all .25s linear}@media screen and (prefers-reduced-motion:reduce){.DocSearch-Hit--favoriting{transition:none}}.DocSearch-Hit--favoriting{transform:scale(0);transform-origin:top center;transition:all .25s linear;transition-delay:.25s}.DocSearch-Hit a{background:var(--docsearch-hit-background);border-radius:4px;box-shadow:var(--docsearch-hit-shadow);display:block;padding-left:var(--docsearch-spacing);width:100%}.DocSearch-Hit-source{background:var(--docsearch-modal-background);color:var(--docsearch-highlight-color);font-size:.85em;font-weight:600;line-height:32px;margin:0 -4px;padding:8px 4px 0;position:sticky;top:0;z-index:10}.DocSearch-Hit-Tree{color:var(--docsearch-muted-color);height:var(--docsearch-hit-height);opacity:.5;stroke-width:var(--docsearch-icon-stroke-width);width:24px}.DocSearch-Hit[aria-selected=true] a{background-color:var(--docsearch-highlight-color)}.DocSearch-Hit[aria-selected=true] mark{text-decoration:underline}.DocSearch-Hit-Container{align-items:center;color:var(--docsearch-hit-color);display:flex;flex-direction:row;height:var(--docsearch-hit-height);padding:0 var(--docsearch-spacing) 0 0}.DocSearch-Hit-icon{height:20px;width:20px}.DocSearch-Hit-action,.DocSearch-Hit-icon{color:var(--docsearch-muted-color);stroke-width:var(--docsearch-icon-stroke-width)}.DocSearch-Hit-action{align-items:center;display:flex;height:22px;width:22px}.DocSearch-Hit-action svg{display:block;height:18px;width:18px}.DocSearch-Hit-action+.DocSearch-Hit-action{margin-left:6px}.DocSearch-Hit-action-button{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;border:0;border-radius:50%;color:inherit;cursor:pointer;padding:2px}svg.DocSearch-Hit-Select-Icon{display:none}.DocSearch-Hit[aria-selected=true] .DocSearch-Hit-Select-Icon{display:block}.DocSearch-Hit-action-button:focus,.DocSearch-Hit-action-button:hover{background:#0003;transition:background-color .1s ease-in}@media screen and (prefers-reduced-motion:reduce){.DocSearch-Hit-action-button:focus,.DocSearch-Hit-action-button:hover{transition:none}}.DocSearch-Hit-action-button:focus path,.DocSearch-Hit-action-button:hover path{fill:#fff}.DocSearch-Hit-content-wrapper{display:flex;flex:1 1 auto;flex-direction:column;font-weight:500;justify-content:center;line-height:1.2em;margin:0 8px;overflow-x:hidden;position:relative;text-overflow:ellipsis;white-space:nowrap;width:80%}.DocSearch-Hit-title{font-size:.9em}.DocSearch-Hit-path{color:var(--docsearch-muted-color);font-size:.75em}.DocSearch-Hit[aria-selected=true] .DocSearch-Hit-action,.DocSearch-Hit[aria-selected=true] .DocSearch-Hit-icon,.DocSearch-Hit[aria-selected=true] .DocSearch-Hit-path,.DocSearch-Hit[aria-selected=true] .DocSearch-Hit-text,.DocSearch-Hit[aria-selected=true] .DocSearch-Hit-title,.DocSearch-Hit[aria-selected=true] .DocSearch-Hit-Tree,.DocSearch-Hit[aria-selected=true] mark{color:var(--docsearch-hit-active-color)!important}@media screen and (prefers-reduced-motion:reduce){.DocSearch-Hit-action-button:focus,.DocSearch-Hit-action-button:hover{background:#0003;transition:none}}.DocSearch-ErrorScreen,.DocSearch-NoResults,.DocSearch-StartScreen{font-size:.9em;margin:0 auto;padding:36px 0;text-align:center;width:80%}.DocSearch-Screen-Icon{color:var(--docsearch-muted-color);padding-bottom:12px}.DocSearch-NoResults-Prefill-List{display:inline-block;padding-bottom:24px;text-align:left}.DocSearch-NoResults-Prefill-List ul{display:inline-block;padding:8px 0 0}.DocSearch-NoResults-Prefill-List li{list-style-position:inside;list-style-type:"» "}.DocSearch-Prefill{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;border:0;border-radius:1em;color:var(--docsearch-highlight-color);cursor:pointer;display:inline-block;font-size:1em;font-weight:700;padding:0}.DocSearch-Prefill:focus,.DocSearch-Prefill:hover{outline:none;text-decoration:underline}.DocSearch-Footer{align-items:center;background:var(--docsearch-footer-background);border-radius:0 0 8px 8px;box-shadow:var(--docsearch-footer-shadow);display:flex;flex-direction:row-reverse;flex-shrink:0;height:var(--docsearch-footer-height);justify-content:space-between;padding:0 var(--docsearch-spacing);position:relative;-webkit-user-select:none;user-select:none;width:100%;z-index:300}.DocSearch-Commands{color:var(--docsearch-muted-color);display:flex;list-style:none;margin:0;padding:0}.DocSearch-Commands li{align-items:center;display:flex}.DocSearch-Commands li:not(:last-of-type){margin-right:.8em}.DocSearch-Commands-Key{align-items:center;background:var(--docsearch-key-gradient);border-radius:2px;box-shadow:var(--docsearch-key-shadow);display:flex;height:18px;justify-content:center;margin-right:.4em;padding:0 0 1px;color:var(--docsearch-muted-color);border:0;width:20px}.DocSearch-VisuallyHiddenForAccessibility{clip:rect(0 0 0 0);clip-path:inset(50%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}@media (max-width:768px){:root{--docsearch-spacing:10px;--docsearch-footer-height:40px}.DocSearch-Dropdown{height:100%}.DocSearch-Container{height:100vh;height:-webkit-fill-available;height:calc(var(--docsearch-vh, 1vh)*100);position:absolute}.DocSearch-Footer{border-radius:0;bottom:0;position:absolute}.DocSearch-Hit-content-wrapper{display:flex;position:relative;width:80%}.DocSearch-Modal{border-radius:0;box-shadow:none;height:100vh;height:-webkit-fill-available;height:calc(var(--docsearch-vh, 1vh)*100);margin:0;max-width:100%;width:100%}.DocSearch-Dropdown{max-height:calc(var(--docsearch-vh, 1vh)*100 - var(--docsearch-searchbox-height) - var(--docsearch-spacing) - var(--docsearch-footer-height))}.DocSearch-Cancel{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;border:0;color:var(--docsearch-highlight-color);cursor:pointer;display:inline-block;flex:none;font:inherit;font-size:1em;font-weight:500;margin-left:var(--docsearch-spacing);outline:none;overflow:hidden;padding:0;-webkit-user-select:none;user-select:none;white-space:nowrap}.DocSearch-Commands,.DocSearch-Hit-Tree{display:none}}@keyframes fade-in{0%{opacity:0}to{opacity:1}}[class*=DocSearch]{--docsearch-primary-color: var(--vp-c-brand-1);--docsearch-highlight-color: var(--docsearch-primary-color);--docsearch-text-color: var(--vp-c-text-1);--docsearch-muted-color: var(--vp-c-text-2);--docsearch-searchbox-shadow: none;--docsearch-searchbox-background: transparent;--docsearch-searchbox-focus-background: transparent;--docsearch-key-gradient: transparent;--docsearch-key-shadow: none;--docsearch-modal-background: var(--vp-c-bg-soft);--docsearch-footer-background: var(--vp-c-bg)}.dark [class*=DocSearch]{--docsearch-modal-shadow: none;--docsearch-footer-shadow: none;--docsearch-logo-color: var(--vp-c-text-2);--docsearch-hit-background: var(--vp-c-default-soft);--docsearch-hit-color: var(--vp-c-text-2);--docsearch-hit-shadow: none}.DocSearch-Button{display:flex;justify-content:center;align-items:center;margin:0;padding:0;width:48px;height:55px;background:transparent;transition:border-color .25s}.DocSearch-Button:hover{background:transparent}.DocSearch-Button:focus{outline:1px dotted;outline:5px auto -webkit-focus-ring-color}.DocSearch-Button-Key--pressed{transform:none;box-shadow:none}.DocSearch-Button:focus:not(:focus-visible){outline:none!important}@media (min-width: 768px){.DocSearch-Button{justify-content:flex-start;border:1px solid transparent;border-radius:8px;padding:0 10px 0 12px;width:100%;height:40px;background-color:var(--vp-c-bg-alt)}.DocSearch-Button:hover{border-color:var(--vp-c-brand-1);background:var(--vp-c-bg-alt)}}.DocSearch-Button .DocSearch-Button-Container{display:flex;align-items:center}.DocSearch-Button .DocSearch-Search-Icon{position:relative;width:16px;height:16px;color:var(--vp-c-text-1);fill:currentColor;transition:color .5s}.DocSearch-Button:hover .DocSearch-Search-Icon{color:var(--vp-c-text-1)}@media (min-width: 768px){.DocSearch-Button .DocSearch-Search-Icon{top:1px;margin-right:8px;width:14px;height:14px;color:var(--vp-c-text-2)}}.DocSearch-Button .DocSearch-Button-Placeholder{display:none;margin-top:2px;padding:0 16px 0 0;font-size:13px;font-weight:500;color:var(--vp-c-text-2);transition:color .5s}.DocSearch-Button:hover .DocSearch-Button-Placeholder{color:var(--vp-c-text-1)}@media (min-width: 768px){.DocSearch-Button .DocSearch-Button-Placeholder{display:inline-block}}.DocSearch-Button .DocSearch-Button-Keys{direction:ltr;display:none;min-width:auto}@media (min-width: 768px){.DocSearch-Button .DocSearch-Button-Keys{display:flex;align-items:center}}.DocSearch-Button .DocSearch-Button-Key{display:block;margin:2px 0 0;border:1px solid var(--vp-c-divider);border-right:none;border-radius:4px 0 0 4px;padding-left:6px;min-width:0;width:auto;height:22px;line-height:22px;font-family:var(--vp-font-family-base);font-size:12px;font-weight:500;transition:color .5s,border-color .5s}.DocSearch-Button .DocSearch-Button-Key+.DocSearch-Button-Key{border-right:1px solid var(--vp-c-divider);border-left:none;border-radius:0 4px 4px 0;padding-left:2px;padding-right:6px}.DocSearch-Button .DocSearch-Button-Key:first-child{font-size:0!important}.DocSearch-Button .DocSearch-Button-Key:first-child:after{content:"Ctrl";font-size:12px;letter-spacing:normal;color:var(--docsearch-muted-color)}.mac .DocSearch-Button .DocSearch-Button-Key:first-child:after{content:"⌘"}.DocSearch-Button .DocSearch-Button-Key:first-child>*{display:none}.DocSearch-Search-Icon{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' stroke-width='1.6' viewBox='0 0 20 20'%3E%3Cpath fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' d='m14.386 14.386 4.088 4.088-4.088-4.088A7.533 7.533 0 1 1 3.733 3.733a7.533 7.533 0 0 1 10.653 10.653z'/%3E%3C/svg%3E")}.VPNavBarSearch{display:flex;align-items:center}@media (min-width: 768px){.VPNavBarSearch{flex-grow:1;padding-left:24px}}@media (min-width: 960px){.VPNavBarSearch{padding-left:32px}}.dark .DocSearch-Footer{border-top:1px solid var(--vp-c-divider)}.DocSearch-Form{border:1px solid var(--vp-c-brand-1);background-color:var(--vp-c-white)}.dark .DocSearch-Form{background-color:var(--vp-c-default-soft)}.DocSearch-Screen-Icon>svg{margin:auto}.VPNavBarSocialLinks[data-v-0394ad82]{display:none}@media (min-width: 1280px){.VPNavBarSocialLinks[data-v-0394ad82]{display:flex;align-items:center}}.title[data-v-ab179fa1]{display:flex;align-items:center;border-bottom:1px solid transparent;width:100%;height:var(--vp-nav-height);font-size:16px;font-weight:600;color:var(--vp-c-text-1);transition:opacity .25s}@media (min-width: 960px){.title[data-v-ab179fa1]{flex-shrink:0}.VPNavBarTitle.has-sidebar .title[data-v-ab179fa1]{border-bottom-color:var(--vp-c-divider)}}[data-v-ab179fa1] .logo{margin-right:8px;height:var(--vp-nav-logo-height)}.VPNavBarTranslations[data-v-88af2de4]{display:none}@media (min-width: 1280px){.VPNavBarTranslations[data-v-88af2de4]{display:flex;align-items:center}}.title[data-v-88af2de4]{padding:0 24px 0 12px;line-height:32px;font-size:14px;font-weight:700;color:var(--vp-c-text-1)}.VPNavBar[data-v-ccf7ddec]{position:relative;height:var(--vp-nav-height);pointer-events:none;white-space:nowrap;transition:background-color .5s}.VPNavBar[data-v-ccf7ddec]:not(.home){background-color:var(--vp-nav-bg-color)}@media (min-width: 960px){.VPNavBar[data-v-ccf7ddec]:not(.home){background-color:transparent}.VPNavBar[data-v-ccf7ddec]:not(.has-sidebar):not(.home.top){background-color:var(--vp-nav-bg-color)}}.wrapper[data-v-ccf7ddec]{padding:0 8px 0 24px}@media (min-width: 768px){.wrapper[data-v-ccf7ddec]{padding:0 32px}}@media (min-width: 960px){.VPNavBar.has-sidebar .wrapper[data-v-ccf7ddec]{padding:0}}.container[data-v-ccf7ddec]{display:flex;justify-content:space-between;margin:0 auto;max-width:calc(var(--vp-layout-max-width) - 64px);height:var(--vp-nav-height);pointer-events:none}.container>.title[data-v-ccf7ddec],.container>.content[data-v-ccf7ddec]{pointer-events:none}.container[data-v-ccf7ddec] *{pointer-events:auto}@media (min-width: 960px){.VPNavBar.has-sidebar .container[data-v-ccf7ddec]{max-width:100%}}.title[data-v-ccf7ddec]{flex-shrink:0;height:calc(var(--vp-nav-height) - 1px);transition:background-color .5s}@media (min-width: 960px){.VPNavBar.has-sidebar .title[data-v-ccf7ddec]{position:absolute;top:0;left:0;z-index:2;padding:0 32px;width:var(--vp-sidebar-width);height:var(--vp-nav-height);background-color:transparent}}@media (min-width: 1440px){.VPNavBar.has-sidebar .title[data-v-ccf7ddec]{padding-left:max(32px,calc((100% - (var(--vp-layout-max-width) - 64px)) / 2));width:calc((100% - (var(--vp-layout-max-width) - 64px)) / 2 + var(--vp-sidebar-width) - 32px)}}.content[data-v-ccf7ddec]{flex-grow:1}@media (min-width: 960px){.VPNavBar.has-sidebar .content[data-v-ccf7ddec]{position:relative;z-index:1;padding-right:32px;padding-left:var(--vp-sidebar-width)}}@media (min-width: 1440px){.VPNavBar.has-sidebar .content[data-v-ccf7ddec]{padding-right:calc((100vw - var(--vp-layout-max-width)) / 2 + 32px);padding-left:calc((100vw - var(--vp-layout-max-width)) / 2 + var(--vp-sidebar-width))}}.content-body[data-v-ccf7ddec]{display:flex;justify-content:flex-end;align-items:center;height:var(--vp-nav-height);transition:background-color .5s}@media (min-width: 960px){.VPNavBar:not(.home.top) .content-body[data-v-ccf7ddec]{position:relative;background-color:var(--vp-nav-bg-color)}.VPNavBar:not(.has-sidebar):not(.home.top) .content-body[data-v-ccf7ddec]{background-color:transparent}}@media (max-width: 767px){.content-body[data-v-ccf7ddec]{column-gap:.5rem}}.menu+.translations[data-v-ccf7ddec]:before,.menu+.appearance[data-v-ccf7ddec]:before,.menu+.social-links[data-v-ccf7ddec]:before,.translations+.appearance[data-v-ccf7ddec]:before,.appearance+.social-links[data-v-ccf7ddec]:before{margin-right:8px;margin-left:8px;width:1px;height:24px;background-color:var(--vp-c-divider);content:""}.menu+.appearance[data-v-ccf7ddec]:before,.translations+.appearance[data-v-ccf7ddec]:before{margin-right:16px}.appearance+.social-links[data-v-ccf7ddec]:before{margin-left:16px}.social-links[data-v-ccf7ddec]{margin-right:-8px}.divider[data-v-ccf7ddec]{width:100%;height:1px}@media (min-width: 960px){.VPNavBar.has-sidebar .divider[data-v-ccf7ddec]{padding-left:var(--vp-sidebar-width)}}@media (min-width: 1440px){.VPNavBar.has-sidebar .divider[data-v-ccf7ddec]{padding-left:calc((100vw - var(--vp-layout-max-width)) / 2 + var(--vp-sidebar-width))}}.divider-line[data-v-ccf7ddec]{width:100%;height:1px;transition:background-color .5s}.VPNavBar:not(.home) .divider-line[data-v-ccf7ddec]{background-color:var(--vp-c-gutter)}@media (min-width: 960px){.VPNavBar:not(.home.top) .divider-line[data-v-ccf7ddec]{background-color:var(--vp-c-gutter)}.VPNavBar:not(.has-sidebar):not(.home.top) .divider[data-v-ccf7ddec]{background-color:var(--vp-c-gutter)}}.VPNavScreenAppearance[data-v-2d7af913]{display:flex;justify-content:space-between;align-items:center;border-radius:8px;padding:12px 14px 12px 16px;background-color:var(--vp-c-bg-soft)}.text[data-v-2d7af913]{line-height:24px;font-size:12px;font-weight:500;color:var(--vp-c-text-2)}.VPNavScreenMenuLink[data-v-7f31e1f6]{display:block;border-bottom:1px solid var(--vp-c-divider);padding:12px 0 11px;line-height:24px;font-size:14px;font-weight:500;color:var(--vp-c-text-1);transition:border-color .25s,color .25s}.VPNavScreenMenuLink[data-v-7f31e1f6]:hover{color:var(--vp-c-brand-1)}.VPNavScreenMenuGroupLink[data-v-19976ae1]{display:block;margin-left:12px;line-height:32px;font-size:14px;font-weight:400;color:var(--vp-c-text-1);transition:color .25s}.VPNavScreenMenuGroupLink[data-v-19976ae1]:hover{color:var(--vp-c-brand-1)}.VPNavScreenMenuGroupSection[data-v-8133b170]{display:block}.title[data-v-8133b170]{line-height:32px;font-size:13px;font-weight:700;color:var(--vp-c-text-2);transition:color .25s}.VPNavScreenMenuGroup[data-v-ff6087d4]{border-bottom:1px solid var(--vp-c-divider);height:48px;overflow:hidden;transition:border-color .5s}.VPNavScreenMenuGroup .items[data-v-ff6087d4]{visibility:hidden}.VPNavScreenMenuGroup.open .items[data-v-ff6087d4]{visibility:visible}.VPNavScreenMenuGroup.open[data-v-ff6087d4]{padding-bottom:10px;height:auto}.VPNavScreenMenuGroup.open .button[data-v-ff6087d4]{padding-bottom:6px;color:var(--vp-c-brand-1)}.VPNavScreenMenuGroup.open .button-icon[data-v-ff6087d4]{transform:rotate(45deg)}.button[data-v-ff6087d4]{display:flex;justify-content:space-between;align-items:center;padding:12px 4px 11px 0;width:100%;line-height:24px;font-size:14px;font-weight:500;color:var(--vp-c-text-1);transition:color .25s}.button[data-v-ff6087d4]:hover{color:var(--vp-c-brand-1)}.button-icon[data-v-ff6087d4]{transition:transform .25s}.group[data-v-ff6087d4]:first-child{padding-top:0}.group+.group[data-v-ff6087d4],.group+.item[data-v-ff6087d4]{padding-top:4px}.VPNavScreenTranslations[data-v-858fe1a4]{height:24px;overflow:hidden}.VPNavScreenTranslations.open[data-v-858fe1a4]{height:auto}.title[data-v-858fe1a4]{display:flex;align-items:center;font-size:14px;font-weight:500;color:var(--vp-c-text-1)}.icon[data-v-858fe1a4]{font-size:16px}.icon.lang[data-v-858fe1a4]{margin-right:8px}.icon.chevron[data-v-858fe1a4]{margin-left:4px}.list[data-v-858fe1a4]{padding:4px 0 0 24px}.link[data-v-858fe1a4]{line-height:32px;font-size:13px;color:var(--vp-c-text-1)}.VPNavScreen[data-v-cc5739dd]{position:fixed;top:calc(var(--vp-nav-height) + var(--vp-layout-top-height, 0px) + 1px);right:0;bottom:0;left:0;padding:0 32px;width:100%;background-color:var(--vp-nav-screen-bg-color);overflow-y:auto;transition:background-color .5s;pointer-events:auto}.VPNavScreen.fade-enter-active[data-v-cc5739dd],.VPNavScreen.fade-leave-active[data-v-cc5739dd]{transition:opacity .25s}.VPNavScreen.fade-enter-active .container[data-v-cc5739dd],.VPNavScreen.fade-leave-active .container[data-v-cc5739dd]{transition:transform .25s ease}.VPNavScreen.fade-enter-from[data-v-cc5739dd],.VPNavScreen.fade-leave-to[data-v-cc5739dd]{opacity:0}.VPNavScreen.fade-enter-from .container[data-v-cc5739dd],.VPNavScreen.fade-leave-to .container[data-v-cc5739dd]{transform:translateY(-8px)}@media (min-width: 768px){.VPNavScreen[data-v-cc5739dd]{display:none}}.container[data-v-cc5739dd]{margin:0 auto;padding:24px 0 96px;max-width:288px}.menu+.translations[data-v-cc5739dd],.menu+.appearance[data-v-cc5739dd],.translations+.appearance[data-v-cc5739dd]{margin-top:24px}.menu+.social-links[data-v-cc5739dd]{margin-top:16px}.appearance+.social-links[data-v-cc5739dd]{margin-top:16px}.VPNav[data-v-ae24b3ad]{position:relative;top:var(--vp-layout-top-height, 0px);left:0;z-index:var(--vp-z-index-nav);width:100%;pointer-events:none;transition:background-color .5s}@media (min-width: 960px){.VPNav[data-v-ae24b3ad]{position:fixed}}.VPSidebarItem.level-0[data-v-b8d55f3b]{padding-bottom:24px}.VPSidebarItem.collapsed.level-0[data-v-b8d55f3b]{padding-bottom:10px}.item[data-v-b8d55f3b]{position:relative;display:flex;width:100%}.VPSidebarItem.collapsible>.item[data-v-b8d55f3b]{cursor:pointer}.indicator[data-v-b8d55f3b]{position:absolute;top:6px;bottom:6px;left:-17px;width:2px;border-radius:2px;transition:background-color .25s}.VPSidebarItem.level-2.is-active>.item>.indicator[data-v-b8d55f3b],.VPSidebarItem.level-3.is-active>.item>.indicator[data-v-b8d55f3b],.VPSidebarItem.level-4.is-active>.item>.indicator[data-v-b8d55f3b],.VPSidebarItem.level-5.is-active>.item>.indicator[data-v-b8d55f3b]{background-color:var(--vp-c-brand-1)}.link[data-v-b8d55f3b]{display:flex;align-items:center;flex-grow:1}.text[data-v-b8d55f3b]{flex-grow:1;padding:4px 0;line-height:24px;font-size:14px;transition:color .25s}.VPSidebarItem.level-0 .text[data-v-b8d55f3b]{font-weight:700;color:var(--vp-c-text-1)}.VPSidebarItem.level-1 .text[data-v-b8d55f3b],.VPSidebarItem.level-2 .text[data-v-b8d55f3b],.VPSidebarItem.level-3 .text[data-v-b8d55f3b],.VPSidebarItem.level-4 .text[data-v-b8d55f3b],.VPSidebarItem.level-5 .text[data-v-b8d55f3b]{font-weight:500;color:var(--vp-c-text-2)}.VPSidebarItem.level-0.is-link>.item>.link:hover .text[data-v-b8d55f3b],.VPSidebarItem.level-1.is-link>.item>.link:hover .text[data-v-b8d55f3b],.VPSidebarItem.level-2.is-link>.item>.link:hover .text[data-v-b8d55f3b],.VPSidebarItem.level-3.is-link>.item>.link:hover .text[data-v-b8d55f3b],.VPSidebarItem.level-4.is-link>.item>.link:hover .text[data-v-b8d55f3b],.VPSidebarItem.level-5.is-link>.item>.link:hover .text[data-v-b8d55f3b]{color:var(--vp-c-brand-1)}.VPSidebarItem.level-0.has-active>.item>.text[data-v-b8d55f3b],.VPSidebarItem.level-1.has-active>.item>.text[data-v-b8d55f3b],.VPSidebarItem.level-2.has-active>.item>.text[data-v-b8d55f3b],.VPSidebarItem.level-3.has-active>.item>.text[data-v-b8d55f3b],.VPSidebarItem.level-4.has-active>.item>.text[data-v-b8d55f3b],.VPSidebarItem.level-5.has-active>.item>.text[data-v-b8d55f3b],.VPSidebarItem.level-0.has-active>.item>.link>.text[data-v-b8d55f3b],.VPSidebarItem.level-1.has-active>.item>.link>.text[data-v-b8d55f3b],.VPSidebarItem.level-2.has-active>.item>.link>.text[data-v-b8d55f3b],.VPSidebarItem.level-3.has-active>.item>.link>.text[data-v-b8d55f3b],.VPSidebarItem.level-4.has-active>.item>.link>.text[data-v-b8d55f3b],.VPSidebarItem.level-5.has-active>.item>.link>.text[data-v-b8d55f3b]{color:var(--vp-c-text-1)}.VPSidebarItem.level-0.is-active>.item .link>.text[data-v-b8d55f3b],.VPSidebarItem.level-1.is-active>.item .link>.text[data-v-b8d55f3b],.VPSidebarItem.level-2.is-active>.item .link>.text[data-v-b8d55f3b],.VPSidebarItem.level-3.is-active>.item .link>.text[data-v-b8d55f3b],.VPSidebarItem.level-4.is-active>.item .link>.text[data-v-b8d55f3b],.VPSidebarItem.level-5.is-active>.item .link>.text[data-v-b8d55f3b]{color:var(--vp-c-brand-1)}.caret[data-v-b8d55f3b]{display:flex;justify-content:center;align-items:center;margin-right:-7px;width:32px;height:32px;color:var(--vp-c-text-3);cursor:pointer;transition:color .25s;flex-shrink:0}.item:hover .caret[data-v-b8d55f3b]{color:var(--vp-c-text-2)}.item:hover .caret[data-v-b8d55f3b]:hover{color:var(--vp-c-text-1)}.caret-icon[data-v-b8d55f3b]{font-size:18px;transform:rotate(90deg);transition:transform .25s}.VPSidebarItem.collapsed .caret-icon[data-v-b8d55f3b]{transform:rotate(0)}.VPSidebarItem.level-1 .items[data-v-b8d55f3b],.VPSidebarItem.level-2 .items[data-v-b8d55f3b],.VPSidebarItem.level-3 .items[data-v-b8d55f3b],.VPSidebarItem.level-4 .items[data-v-b8d55f3b],.VPSidebarItem.level-5 .items[data-v-b8d55f3b]{border-left:1px solid var(--vp-c-divider);padding-left:16px}.VPSidebarItem.collapsed .items[data-v-b8d55f3b]{display:none}.VPSidebar[data-v-575e6a36]{position:fixed;top:var(--vp-layout-top-height, 0px);bottom:0;left:0;z-index:var(--vp-z-index-sidebar);padding:32px 32px 96px;width:calc(100vw - 64px);max-width:320px;background-color:var(--vp-sidebar-bg-color);opacity:0;box-shadow:var(--vp-c-shadow-3);overflow-x:hidden;overflow-y:auto;transform:translate(-100%);transition:opacity .5s,transform .25s ease;overscroll-behavior:contain}.VPSidebar.open[data-v-575e6a36]{opacity:1;visibility:visible;transform:translate(0);transition:opacity .25s,transform .5s cubic-bezier(.19,1,.22,1)}.dark .VPSidebar[data-v-575e6a36]{box-shadow:var(--vp-shadow-1)}@media (min-width: 960px){.VPSidebar[data-v-575e6a36]{padding-top:var(--vp-nav-height);width:var(--vp-sidebar-width);max-width:100%;background-color:var(--vp-sidebar-bg-color);opacity:1;visibility:visible;box-shadow:none;transform:translate(0)}}@media (min-width: 1440px){.VPSidebar[data-v-575e6a36]{padding-left:max(32px,calc((100% - (var(--vp-layout-max-width) - 64px)) / 2));width:calc((100% - (var(--vp-layout-max-width) - 64px)) / 2 + var(--vp-sidebar-width) - 32px)}}@media (min-width: 960px){.curtain[data-v-575e6a36]{position:sticky;top:-64px;left:0;z-index:1;margin-top:calc(var(--vp-nav-height) * -1);margin-right:-32px;margin-left:-32px;height:var(--vp-nav-height);background-color:var(--vp-sidebar-bg-color)}}.nav[data-v-575e6a36]{outline:0}.group+.group[data-v-575e6a36]{border-top:1px solid var(--vp-c-divider);padding-top:10px}@media (min-width: 960px){.group[data-v-575e6a36]{padding-top:10px;width:calc(var(--vp-sidebar-width) - 64px)}}.VPSkipLink[data-v-0f60ec36]{top:8px;left:8px;padding:8px 16px;z-index:999;border-radius:8px;font-size:12px;font-weight:700;text-decoration:none;color:var(--vp-c-brand-1);box-shadow:var(--vp-shadow-3);background-color:var(--vp-c-bg)}.VPSkipLink[data-v-0f60ec36]:focus{height:auto;width:auto;clip:auto;clip-path:none}@media (min-width: 1280px){.VPSkipLink[data-v-0f60ec36]{top:14px;left:16px}}.Layout[data-v-5d98c3a5]{display:flex;flex-direction:column;min-height:100vh}.VPHomeSponsors[data-v-3d121b4a]{border-top:1px solid var(--vp-c-gutter);padding-top:88px!important}.VPHomeSponsors[data-v-3d121b4a]{margin:96px 0}@media (min-width: 768px){.VPHomeSponsors[data-v-3d121b4a]{margin:128px 0}}.VPHomeSponsors[data-v-3d121b4a]{padding:0 24px}@media (min-width: 768px){.VPHomeSponsors[data-v-3d121b4a]{padding:0 48px}}@media (min-width: 960px){.VPHomeSponsors[data-v-3d121b4a]{padding:0 64px}}.container[data-v-3d121b4a]{margin:0 auto;max-width:1152px}.love[data-v-3d121b4a]{margin:0 auto;width:fit-content;font-size:28px;color:var(--vp-c-text-3)}.icon[data-v-3d121b4a]{display:inline-block}.message[data-v-3d121b4a]{margin:0 auto;padding-top:10px;max-width:320px;text-align:center;line-height:24px;font-size:16px;font-weight:500;color:var(--vp-c-text-2)}.sponsors[data-v-3d121b4a]{padding-top:32px}.action[data-v-3d121b4a]{padding-top:40px;text-align:center}.VPTeamPage[data-v-7c57f839]{margin:96px 0}@media (min-width: 768px){.VPTeamPage[data-v-7c57f839]{margin:128px 0}}.VPHome .VPTeamPageTitle[data-v-7c57f839-s]{border-top:1px solid var(--vp-c-gutter);padding-top:88px!important}.VPTeamPageSection+.VPTeamPageSection[data-v-7c57f839-s],.VPTeamMembers+.VPTeamPageSection[data-v-7c57f839-s]{margin-top:64px}.VPTeamMembers+.VPTeamMembers[data-v-7c57f839-s]{margin-top:24px}@media (min-width: 768px){.VPTeamPageTitle+.VPTeamPageSection[data-v-7c57f839-s]{margin-top:16px}.VPTeamPageSection+.VPTeamPageSection[data-v-7c57f839-s],.VPTeamMembers+.VPTeamPageSection[data-v-7c57f839-s]{margin-top:96px}}.VPTeamMembers[data-v-7c57f839-s]{padding:0 24px}@media (min-width: 768px){.VPTeamMembers[data-v-7c57f839-s]{padding:0 48px}}@media (min-width: 960px){.VPTeamMembers[data-v-7c57f839-s]{padding:0 64px}}.VPTeamPageTitle[data-v-bf2cbdac]{padding:48px 32px;text-align:center}@media (min-width: 768px){.VPTeamPageTitle[data-v-bf2cbdac]{padding:64px 48px 48px}}@media (min-width: 960px){.VPTeamPageTitle[data-v-bf2cbdac]{padding:80px 64px 48px}}.title[data-v-bf2cbdac]{letter-spacing:0;line-height:44px;font-size:36px;font-weight:500}@media (min-width: 768px){.title[data-v-bf2cbdac]{letter-spacing:-.5px;line-height:56px;font-size:48px}}.lead[data-v-bf2cbdac]{margin:0 auto;max-width:512px;padding-top:12px;line-height:24px;font-size:16px;font-weight:500;color:var(--vp-c-text-2)}@media (min-width: 768px){.lead[data-v-bf2cbdac]{max-width:592px;letter-spacing:.15px;line-height:28px;font-size:20px}}.VPTeamPageSection[data-v-b1a88750]{padding:0 32px}@media (min-width: 768px){.VPTeamPageSection[data-v-b1a88750]{padding:0 48px}}@media (min-width: 960px){.VPTeamPageSection[data-v-b1a88750]{padding:0 64px}}.title[data-v-b1a88750]{position:relative;margin:0 auto;max-width:1152px;text-align:center;color:var(--vp-c-text-2)}.title-line[data-v-b1a88750]{position:absolute;top:16px;left:0;width:100%;height:1px;background-color:var(--vp-c-divider)}.title-text[data-v-b1a88750]{position:relative;display:inline-block;padding:0 24px;letter-spacing:0;line-height:32px;font-size:20px;font-weight:500;background-color:var(--vp-c-bg)}.lead[data-v-b1a88750]{margin:0 auto;max-width:480px;padding-top:12px;text-align:center;line-height:24px;font-size:16px;font-weight:500;color:var(--vp-c-text-2)}.members[data-v-b1a88750]{padding-top:40px}.VPTeamMembersItem[data-v-f3fa364a]{display:flex;flex-direction:column;gap:2px;border-radius:12px;width:100%;height:100%;overflow:hidden}.VPTeamMembersItem.small .profile[data-v-f3fa364a]{padding:32px}.VPTeamMembersItem.small .data[data-v-f3fa364a]{padding-top:20px}.VPTeamMembersItem.small .avatar[data-v-f3fa364a]{width:64px;height:64px}.VPTeamMembersItem.small .name[data-v-f3fa364a]{line-height:24px;font-size:16px}.VPTeamMembersItem.small .affiliation[data-v-f3fa364a]{padding-top:4px;line-height:20px;font-size:14px}.VPTeamMembersItem.small .desc[data-v-f3fa364a]{padding-top:12px;line-height:20px;font-size:14px}.VPTeamMembersItem.small .links[data-v-f3fa364a]{margin:0 -16px -20px;padding:10px 0 0}.VPTeamMembersItem.medium .profile[data-v-f3fa364a]{padding:48px 32px}.VPTeamMembersItem.medium .data[data-v-f3fa364a]{padding-top:24px;text-align:center}.VPTeamMembersItem.medium .avatar[data-v-f3fa364a]{width:96px;height:96px}.VPTeamMembersItem.medium .name[data-v-f3fa364a]{letter-spacing:.15px;line-height:28px;font-size:20px}.VPTeamMembersItem.medium .affiliation[data-v-f3fa364a]{padding-top:4px;font-size:16px}.VPTeamMembersItem.medium .desc[data-v-f3fa364a]{padding-top:16px;max-width:288px;font-size:16px}.VPTeamMembersItem.medium .links[data-v-f3fa364a]{margin:0 -16px -12px;padding:16px 12px 0}.profile[data-v-f3fa364a]{flex-grow:1;background-color:var(--vp-c-bg-soft)}.data[data-v-f3fa364a]{text-align:center}.avatar[data-v-f3fa364a]{position:relative;flex-shrink:0;margin:0 auto;border-radius:50%;box-shadow:var(--vp-shadow-3)}.avatar-img[data-v-f3fa364a]{position:absolute;top:0;right:0;bottom:0;left:0;border-radius:50%;object-fit:cover}.name[data-v-f3fa364a]{margin:0;font-weight:600}.affiliation[data-v-f3fa364a]{margin:0;font-weight:500;color:var(--vp-c-text-2)}.org.link[data-v-f3fa364a]{color:var(--vp-c-text-2);transition:color .25s}.org.link[data-v-f3fa364a]:hover{color:var(--vp-c-brand-1)}.desc[data-v-f3fa364a]{margin:0 auto}.desc[data-v-f3fa364a] a{font-weight:500;color:var(--vp-c-brand-1);text-decoration-style:dotted;transition:color .25s}.links[data-v-f3fa364a]{display:flex;justify-content:center;height:56px}.sp-link[data-v-f3fa364a]{display:flex;justify-content:center;align-items:center;text-align:center;padding:16px;font-size:14px;font-weight:500;color:var(--vp-c-sponsor);background-color:var(--vp-c-bg-soft);transition:color .25s,background-color .25s}.sp .sp-link.link[data-v-f3fa364a]:hover,.sp .sp-link.link[data-v-f3fa364a]:focus{outline:none;color:var(--vp-c-white);background-color:var(--vp-c-sponsor)}.sp-icon[data-v-f3fa364a]{margin-right:8px;font-size:16px}.VPTeamMembers.small .container[data-v-6cb0dbc4]{grid-template-columns:repeat(auto-fit,minmax(224px,1fr))}.VPTeamMembers.small.count-1 .container[data-v-6cb0dbc4]{max-width:276px}.VPTeamMembers.small.count-2 .container[data-v-6cb0dbc4]{max-width:576px}.VPTeamMembers.small.count-3 .container[data-v-6cb0dbc4]{max-width:876px}.VPTeamMembers.medium .container[data-v-6cb0dbc4]{grid-template-columns:repeat(auto-fit,minmax(256px,1fr))}@media (min-width: 375px){.VPTeamMembers.medium .container[data-v-6cb0dbc4]{grid-template-columns:repeat(auto-fit,minmax(288px,1fr))}}.VPTeamMembers.medium.count-1 .container[data-v-6cb0dbc4]{max-width:368px}.VPTeamMembers.medium.count-2 .container[data-v-6cb0dbc4]{max-width:760px}.container[data-v-6cb0dbc4]{display:grid;gap:24px;margin:0 auto;max-width:1152px}.searchinput{border:1px solid var(--vp-c-divider)} diff --git a/assets/style.DzD7Taea.css b/assets/style.DzD7Taea.css new file mode 100644 index 00000000..06c3d1ff --- /dev/null +++ b/assets/style.DzD7Taea.css @@ -0,0 +1 @@ +@font-face{font-family:Inter;font-style:normal;font-weight:100 900;font-display:swap;src:url(/assets/inter-roman-cyrillic-ext.BBPuwvHQ.woff2) format("woff2");unicode-range:U+0460-052F,U+1C80-1C88,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:Inter;font-style:normal;font-weight:100 900;font-display:swap;src:url(/assets/inter-roman-cyrillic.C5lxZ8CY.woff2) format("woff2");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:Inter;font-style:normal;font-weight:100 900;font-display:swap;src:url(/assets/inter-roman-greek-ext.CqjqNYQ-.woff2) format("woff2");unicode-range:U+1F00-1FFF}@font-face{font-family:Inter;font-style:normal;font-weight:100 900;font-display:swap;src:url(/assets/inter-roman-greek.BBVDIX6e.woff2) format("woff2");unicode-range:U+0370-0377,U+037A-037F,U+0384-038A,U+038C,U+038E-03A1,U+03A3-03FF}@font-face{font-family:Inter;font-style:normal;font-weight:100 900;font-display:swap;src:url(/assets/inter-roman-vietnamese.BjW4sHH5.woff2) format("woff2");unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB}@font-face{font-family:Inter;font-style:normal;font-weight:100 900;font-display:swap;src:url(/assets/inter-roman-latin-ext.4ZJIpNVo.woff2) format("woff2");unicode-range:U+0100-02AF,U+0304,U+0308,U+0329,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Inter;font-style:normal;font-weight:100 900;font-display:swap;src:url(/assets/inter-roman-latin.Di8DUHzh.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Inter;font-style:italic;font-weight:100 900;font-display:swap;src:url(/assets/inter-italic-cyrillic-ext.r48I6akx.woff2) format("woff2");unicode-range:U+0460-052F,U+1C80-1C88,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:Inter;font-style:italic;font-weight:100 900;font-display:swap;src:url(/assets/inter-italic-cyrillic.By2_1cv3.woff2) format("woff2");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:Inter;font-style:italic;font-weight:100 900;font-display:swap;src:url(/assets/inter-italic-greek-ext.1u6EdAuj.woff2) format("woff2");unicode-range:U+1F00-1FFF}@font-face{font-family:Inter;font-style:italic;font-weight:100 900;font-display:swap;src:url(/assets/inter-italic-greek.DJ8dCoTZ.woff2) format("woff2");unicode-range:U+0370-0377,U+037A-037F,U+0384-038A,U+038C,U+038E-03A1,U+03A3-03FF}@font-face{font-family:Inter;font-style:italic;font-weight:100 900;font-display:swap;src:url(/assets/inter-italic-vietnamese.BSbpV94h.woff2) format("woff2");unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB}@font-face{font-family:Inter;font-style:italic;font-weight:100 900;font-display:swap;src:url(/assets/inter-italic-latin-ext.CN1xVJS-.woff2) format("woff2");unicode-range:U+0100-02AF,U+0304,U+0308,U+0329,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Inter;font-style:italic;font-weight:100 900;font-display:swap;src:url(/assets/inter-italic-latin.C2AdPX0b.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Punctuation SC;font-weight:400;src:local("PingFang SC Regular"),local("Noto Sans CJK SC"),local("Microsoft YaHei");unicode-range:U+201C,U+201D,U+2018,U+2019,U+2E3A,U+2014,U+2013,U+2026,U+00B7,U+007E,U+002F}@font-face{font-family:Punctuation SC;font-weight:500;src:local("PingFang SC Medium"),local("Noto Sans CJK SC"),local("Microsoft YaHei");unicode-range:U+201C,U+201D,U+2018,U+2019,U+2E3A,U+2014,U+2013,U+2026,U+00B7,U+007E,U+002F}@font-face{font-family:Punctuation SC;font-weight:600;src:local("PingFang SC Semibold"),local("Noto Sans CJK SC Bold"),local("Microsoft YaHei Bold");unicode-range:U+201C,U+201D,U+2018,U+2019,U+2E3A,U+2014,U+2013,U+2026,U+00B7,U+007E,U+002F}@font-face{font-family:Punctuation SC;font-weight:700;src:local("PingFang SC Semibold"),local("Noto Sans CJK SC Bold"),local("Microsoft YaHei Bold");unicode-range:U+201C,U+201D,U+2018,U+2019,U+2E3A,U+2014,U+2013,U+2026,U+00B7,U+007E,U+002F}:root{--vp-c-white: #ffffff;--vp-c-black: #000000;--vp-c-neutral: var(--vp-c-black);--vp-c-neutral-inverse: var(--vp-c-white)}.dark{--vp-c-neutral: var(--vp-c-white);--vp-c-neutral-inverse: var(--vp-c-black)}:root{--vp-c-gray-1: #dddde3;--vp-c-gray-2: #e4e4e9;--vp-c-gray-3: #ebebef;--vp-c-gray-soft: rgba(142, 150, 170, .14);--vp-c-indigo-1: #3451b2;--vp-c-indigo-2: #3a5ccc;--vp-c-indigo-3: #5672cd;--vp-c-indigo-soft: rgba(100, 108, 255, .14);--vp-c-purple-1: #6f42c1;--vp-c-purple-2: #7e4cc9;--vp-c-purple-3: #8e5cd9;--vp-c-purple-soft: rgba(159, 122, 234, .14);--vp-c-green-1: #18794e;--vp-c-green-2: #299764;--vp-c-green-3: #30a46c;--vp-c-green-soft: rgba(16, 185, 129, .14);--vp-c-yellow-1: #915930;--vp-c-yellow-2: #946300;--vp-c-yellow-3: #9f6a00;--vp-c-yellow-soft: rgba(234, 179, 8, .14);--vp-c-red-1: #b8272c;--vp-c-red-2: #d5393e;--vp-c-red-3: #e0575b;--vp-c-red-soft: rgba(244, 63, 94, .14);--vp-c-sponsor: #db2777}.dark{--vp-c-gray-1: #515c67;--vp-c-gray-2: #414853;--vp-c-gray-3: #32363f;--vp-c-gray-soft: rgba(101, 117, 133, .16);--vp-c-indigo-1: #a8b1ff;--vp-c-indigo-2: #5c73e7;--vp-c-indigo-3: #3e63dd;--vp-c-indigo-soft: rgba(100, 108, 255, .16);--vp-c-purple-1: #c8abfa;--vp-c-purple-2: #a879e6;--vp-c-purple-3: #8e5cd9;--vp-c-purple-soft: rgba(159, 122, 234, .16);--vp-c-green-1: #3dd68c;--vp-c-green-2: #30a46c;--vp-c-green-3: #298459;--vp-c-green-soft: rgba(16, 185, 129, .16);--vp-c-yellow-1: #f9b44e;--vp-c-yellow-2: #da8b17;--vp-c-yellow-3: #a46a0a;--vp-c-yellow-soft: rgba(234, 179, 8, .16);--vp-c-red-1: #f66f81;--vp-c-red-2: #f14158;--vp-c-red-3: #b62a3c;--vp-c-red-soft: rgba(244, 63, 94, .16)}:root{--vp-c-bg: #ffffff;--vp-c-bg-alt: #f6f6f7;--vp-c-bg-elv: #ffffff;--vp-c-bg-soft: #f6f6f7}.dark{--vp-c-bg: #1b1b1f;--vp-c-bg-alt: #161618;--vp-c-bg-elv: #202127;--vp-c-bg-soft: #202127}:root{--vp-c-border: #c2c2c4;--vp-c-divider: #e2e2e3;--vp-c-gutter: #e2e2e3}.dark{--vp-c-border: #3c3f44;--vp-c-divider: #2e2e32;--vp-c-gutter: #000000}:root{--vp-c-text-1: #3c3c43;--vp-c-text-2: #67676c;--vp-c-text-3: #929295}.dark{--vp-c-text-1: #dfdfd6;--vp-c-text-2: #98989f;--vp-c-text-3: #6a6a71}:root{--vp-c-default-1: var(--vp-c-gray-1);--vp-c-default-2: var(--vp-c-gray-2);--vp-c-default-3: var(--vp-c-gray-3);--vp-c-default-soft: var(--vp-c-gray-soft);--vp-c-brand-1: var(--vp-c-indigo-1);--vp-c-brand-2: var(--vp-c-indigo-2);--vp-c-brand-3: var(--vp-c-indigo-3);--vp-c-brand-soft: var(--vp-c-indigo-soft);--vp-c-brand: var(--vp-c-brand-1);--vp-c-tip-1: var(--vp-c-brand-1);--vp-c-tip-2: var(--vp-c-brand-2);--vp-c-tip-3: var(--vp-c-brand-3);--vp-c-tip-soft: var(--vp-c-brand-soft);--vp-c-note-1: var(--vp-c-brand-1);--vp-c-note-2: var(--vp-c-brand-2);--vp-c-note-3: var(--vp-c-brand-3);--vp-c-note-soft: var(--vp-c-brand-soft);--vp-c-success-1: var(--vp-c-green-1);--vp-c-success-2: var(--vp-c-green-2);--vp-c-success-3: var(--vp-c-green-3);--vp-c-success-soft: var(--vp-c-green-soft);--vp-c-important-1: var(--vp-c-purple-1);--vp-c-important-2: var(--vp-c-purple-2);--vp-c-important-3: var(--vp-c-purple-3);--vp-c-important-soft: var(--vp-c-purple-soft);--vp-c-warning-1: var(--vp-c-yellow-1);--vp-c-warning-2: var(--vp-c-yellow-2);--vp-c-warning-3: var(--vp-c-yellow-3);--vp-c-warning-soft: var(--vp-c-yellow-soft);--vp-c-danger-1: var(--vp-c-red-1);--vp-c-danger-2: var(--vp-c-red-2);--vp-c-danger-3: var(--vp-c-red-3);--vp-c-danger-soft: var(--vp-c-red-soft);--vp-c-caution-1: var(--vp-c-red-1);--vp-c-caution-2: var(--vp-c-red-2);--vp-c-caution-3: var(--vp-c-red-3);--vp-c-caution-soft: var(--vp-c-red-soft)}:root{--vp-font-family-base: "Inter", ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--vp-font-family-mono: ui-monospace, "Menlo", "Monaco", "Consolas", "Liberation Mono", "Courier New", monospace;font-optical-sizing:auto}:root:where(:lang(zh)){--vp-font-family-base: "Punctuation SC", "Inter", ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"}:root{--vp-shadow-1: 0 1px 2px rgba(0, 0, 0, .04), 0 1px 2px rgba(0, 0, 0, .06);--vp-shadow-2: 0 3px 12px rgba(0, 0, 0, .07), 0 1px 4px rgba(0, 0, 0, .07);--vp-shadow-3: 0 12px 32px rgba(0, 0, 0, .1), 0 2px 6px rgba(0, 0, 0, .08);--vp-shadow-4: 0 14px 44px rgba(0, 0, 0, .12), 0 3px 9px rgba(0, 0, 0, .12);--vp-shadow-5: 0 18px 56px rgba(0, 0, 0, .16), 0 4px 12px rgba(0, 0, 0, .16)}:root{--vp-z-index-footer: 10;--vp-z-index-local-nav: 20;--vp-z-index-nav: 30;--vp-z-index-layout-top: 40;--vp-z-index-backdrop: 50;--vp-z-index-sidebar: 60}@media (min-width: 960px){:root{--vp-z-index-sidebar: 25}}:root{--vp-layout-max-width: 1440px}:root{--vp-header-anchor-symbol: "#"}:root{--vp-code-line-height: 1.7;--vp-code-font-size: .875em;--vp-code-color: var(--vp-c-brand-1);--vp-code-link-color: var(--vp-c-brand-1);--vp-code-link-hover-color: var(--vp-c-brand-2);--vp-code-bg: var(--vp-c-default-soft);--vp-code-block-color: var(--vp-c-text-2);--vp-code-block-bg: var(--vp-c-bg-alt);--vp-code-block-divider-color: var(--vp-c-gutter);--vp-code-lang-color: var(--vp-c-text-2);--vp-code-line-highlight-color: var(--vp-c-default-soft);--vp-code-line-number-color: var(--vp-c-text-2);--vp-code-line-diff-add-color: var(--vp-c-success-soft);--vp-code-line-diff-add-symbol-color: var(--vp-c-success-1);--vp-code-line-diff-remove-color: var(--vp-c-danger-soft);--vp-code-line-diff-remove-symbol-color: var(--vp-c-danger-1);--vp-code-line-warning-color: var(--vp-c-warning-soft);--vp-code-line-error-color: var(--vp-c-danger-soft);--vp-code-copy-code-border-color: var(--vp-c-divider);--vp-code-copy-code-bg: var(--vp-c-bg-soft);--vp-code-copy-code-hover-border-color: var(--vp-c-divider);--vp-code-copy-code-hover-bg: var(--vp-c-bg);--vp-code-copy-code-active-text: var(--vp-c-text-2);--vp-code-copy-copied-text-content: "Copied";--vp-code-tab-divider: var(--vp-code-block-divider-color);--vp-code-tab-text-color: var(--vp-c-text-2);--vp-code-tab-bg: var(--vp-code-block-bg);--vp-code-tab-hover-text-color: var(--vp-c-text-1);--vp-code-tab-active-text-color: var(--vp-c-text-1);--vp-code-tab-active-bar-color: var(--vp-c-brand-1)}:lang(es),:lang(pt){--vp-code-copy-copied-text-content: "Copiado"}:lang(fa){--vp-code-copy-copied-text-content: "کپی شد"}:lang(ko){--vp-code-copy-copied-text-content: "복사됨"}:lang(ru){--vp-code-copy-copied-text-content: "Скопировано"}:lang(zh){--vp-code-copy-copied-text-content: "已复制"}:root{--vp-button-brand-border: transparent;--vp-button-brand-text: var(--vp-c-white);--vp-button-brand-bg: var(--vp-c-brand-3);--vp-button-brand-hover-border: transparent;--vp-button-brand-hover-text: var(--vp-c-white);--vp-button-brand-hover-bg: var(--vp-c-brand-2);--vp-button-brand-active-border: transparent;--vp-button-brand-active-text: var(--vp-c-white);--vp-button-brand-active-bg: var(--vp-c-brand-1);--vp-button-alt-border: transparent;--vp-button-alt-text: var(--vp-c-text-1);--vp-button-alt-bg: var(--vp-c-default-3);--vp-button-alt-hover-border: transparent;--vp-button-alt-hover-text: var(--vp-c-text-1);--vp-button-alt-hover-bg: var(--vp-c-default-2);--vp-button-alt-active-border: transparent;--vp-button-alt-active-text: var(--vp-c-text-1);--vp-button-alt-active-bg: var(--vp-c-default-1);--vp-button-sponsor-border: var(--vp-c-text-2);--vp-button-sponsor-text: var(--vp-c-text-2);--vp-button-sponsor-bg: transparent;--vp-button-sponsor-hover-border: var(--vp-c-sponsor);--vp-button-sponsor-hover-text: var(--vp-c-sponsor);--vp-button-sponsor-hover-bg: transparent;--vp-button-sponsor-active-border: var(--vp-c-sponsor);--vp-button-sponsor-active-text: var(--vp-c-sponsor);--vp-button-sponsor-active-bg: transparent}:root{--vp-custom-block-font-size: 14px;--vp-custom-block-code-font-size: 13px;--vp-custom-block-info-border: transparent;--vp-custom-block-info-text: var(--vp-c-text-1);--vp-custom-block-info-bg: var(--vp-c-default-soft);--vp-custom-block-info-code-bg: var(--vp-c-default-soft);--vp-custom-block-note-border: transparent;--vp-custom-block-note-text: var(--vp-c-text-1);--vp-custom-block-note-bg: var(--vp-c-default-soft);--vp-custom-block-note-code-bg: var(--vp-c-default-soft);--vp-custom-block-tip-border: transparent;--vp-custom-block-tip-text: var(--vp-c-text-1);--vp-custom-block-tip-bg: var(--vp-c-tip-soft);--vp-custom-block-tip-code-bg: var(--vp-c-tip-soft);--vp-custom-block-important-border: transparent;--vp-custom-block-important-text: var(--vp-c-text-1);--vp-custom-block-important-bg: var(--vp-c-important-soft);--vp-custom-block-important-code-bg: var(--vp-c-important-soft);--vp-custom-block-warning-border: transparent;--vp-custom-block-warning-text: var(--vp-c-text-1);--vp-custom-block-warning-bg: var(--vp-c-warning-soft);--vp-custom-block-warning-code-bg: var(--vp-c-warning-soft);--vp-custom-block-danger-border: transparent;--vp-custom-block-danger-text: var(--vp-c-text-1);--vp-custom-block-danger-bg: var(--vp-c-danger-soft);--vp-custom-block-danger-code-bg: var(--vp-c-danger-soft);--vp-custom-block-caution-border: transparent;--vp-custom-block-caution-text: var(--vp-c-text-1);--vp-custom-block-caution-bg: var(--vp-c-caution-soft);--vp-custom-block-caution-code-bg: var(--vp-c-caution-soft);--vp-custom-block-details-border: var(--vp-custom-block-info-border);--vp-custom-block-details-text: var(--vp-custom-block-info-text);--vp-custom-block-details-bg: var(--vp-custom-block-info-bg);--vp-custom-block-details-code-bg: var(--vp-custom-block-info-code-bg)}:root{--vp-input-border-color: var(--vp-c-border);--vp-input-bg-color: var(--vp-c-bg-alt);--vp-input-switch-bg-color: var(--vp-c-default-soft)}:root{--vp-nav-height: 64px;--vp-nav-bg-color: var(--vp-c-bg);--vp-nav-screen-bg-color: var(--vp-c-bg);--vp-nav-logo-height: 24px}.hide-nav{--vp-nav-height: 0px}.hide-nav .VPSidebar{--vp-nav-height: 22px}:root{--vp-local-nav-bg-color: var(--vp-c-bg)}:root{--vp-sidebar-width: 272px;--vp-sidebar-bg-color: var(--vp-c-bg-alt)}:root{--vp-backdrop-bg-color: rgba(0, 0, 0, .6)}:root{--vp-home-hero-name-color: var(--vp-c-brand-1);--vp-home-hero-name-background: transparent;--vp-home-hero-image-background-image: none;--vp-home-hero-image-filter: none}:root{--vp-badge-info-border: transparent;--vp-badge-info-text: var(--vp-c-text-2);--vp-badge-info-bg: var(--vp-c-default-soft);--vp-badge-tip-border: transparent;--vp-badge-tip-text: var(--vp-c-tip-1);--vp-badge-tip-bg: var(--vp-c-tip-soft);--vp-badge-warning-border: transparent;--vp-badge-warning-text: var(--vp-c-warning-1);--vp-badge-warning-bg: var(--vp-c-warning-soft);--vp-badge-danger-border: transparent;--vp-badge-danger-text: var(--vp-c-danger-1);--vp-badge-danger-bg: var(--vp-c-danger-soft)}:root{--vp-carbon-ads-text-color: var(--vp-c-text-1);--vp-carbon-ads-poweredby-color: var(--vp-c-text-2);--vp-carbon-ads-bg-color: var(--vp-c-bg-soft);--vp-carbon-ads-hover-text-color: var(--vp-c-brand-1);--vp-carbon-ads-hover-poweredby-color: var(--vp-c-text-1)}:root{--vp-local-search-bg: var(--vp-c-bg);--vp-local-search-result-bg: var(--vp-c-bg);--vp-local-search-result-border: var(--vp-c-divider);--vp-local-search-result-selected-bg: var(--vp-c-bg);--vp-local-search-result-selected-border: var(--vp-c-brand-1);--vp-local-search-highlight-bg: var(--vp-c-brand-1);--vp-local-search-highlight-text: var(--vp-c-neutral-inverse)}@media (prefers-reduced-motion: reduce){*,:before,:after{animation-delay:-1ms!important;animation-duration:1ms!important;animation-iteration-count:1!important;background-attachment:initial!important;scroll-behavior:auto!important;transition-duration:0s!important;transition-delay:0s!important}}*,:before,:after{box-sizing:border-box}html{line-height:1.4;font-size:16px;-webkit-text-size-adjust:100%}html.dark{color-scheme:dark}body{margin:0;width:100%;min-width:320px;min-height:100vh;line-height:24px;font-family:var(--vp-font-family-base);font-size:16px;font-weight:400;color:var(--vp-c-text-1);background-color:var(--vp-c-bg);font-synthesis:style;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}main{display:block}h1,h2,h3,h4,h5,h6{margin:0;line-height:24px;font-size:16px;font-weight:400}p{margin:0}strong,b{font-weight:600}a,area,button,[role=button],input,label,select,summary,textarea{touch-action:manipulation}a{color:inherit;text-decoration:inherit}ol,ul{list-style:none;margin:0;padding:0}blockquote{margin:0}pre,code,kbd,samp{font-family:var(--vp-font-family-mono)}img,svg,video,canvas,audio,iframe,embed,object{display:block}figure{margin:0}img,video{max-width:100%;height:auto}button,input,optgroup,select,textarea{border:0;padding:0;line-height:inherit;color:inherit}button{padding:0;font-family:inherit;background-color:transparent;background-image:none}button:enabled,[role=button]:enabled{cursor:pointer}button:focus,button:focus-visible{outline:1px dotted;outline:4px auto -webkit-focus-ring-color}button:focus:not(:focus-visible){outline:none!important}input:focus,textarea:focus,select:focus{outline:none}table{border-collapse:collapse}input{background-color:transparent}input:-ms-input-placeholder,textarea:-ms-input-placeholder{color:var(--vp-c-text-3)}input::-ms-input-placeholder,textarea::-ms-input-placeholder{color:var(--vp-c-text-3)}input::placeholder,textarea::placeholder{color:var(--vp-c-text-3)}input::-webkit-outer-spin-button,input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}input[type=number]{-moz-appearance:textfield}textarea{resize:vertical}select{-webkit-appearance:none}fieldset{margin:0;padding:0}h1,h2,h3,h4,h5,h6,li,p{overflow-wrap:break-word}vite-error-overlay{z-index:9999}mjx-container{overflow-x:auto}mjx-container>svg{display:inline-block;margin:auto}[class^=vpi-],[class*=" vpi-"],.vp-icon{width:1em;height:1em}[class^=vpi-].bg,[class*=" vpi-"].bg,.vp-icon.bg{background-size:100% 100%;background-color:transparent}[class^=vpi-]:not(.bg),[class*=" vpi-"]:not(.bg),.vp-icon:not(.bg){-webkit-mask:var(--icon) no-repeat;mask:var(--icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit}.vpi-align-left{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M21 6H3M15 12H3M17 18H3'/%3E%3C/svg%3E")}.vpi-arrow-right,.vpi-arrow-down,.vpi-arrow-left,.vpi-arrow-up{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M5 12h14M12 5l7 7-7 7'/%3E%3C/svg%3E")}.vpi-chevron-right,.vpi-chevron-down,.vpi-chevron-left,.vpi-chevron-up{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='m9 18 6-6-6-6'/%3E%3C/svg%3E")}.vpi-chevron-down,.vpi-arrow-down{transform:rotate(90deg)}.vpi-chevron-left,.vpi-arrow-left{transform:rotate(180deg)}.vpi-chevron-up,.vpi-arrow-up{transform:rotate(-90deg)}.vpi-square-pen{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7'/%3E%3Cpath d='M18.375 2.625a2.121 2.121 0 1 1 3 3L12 15l-4 1 1-4Z'/%3E%3C/svg%3E")}.vpi-plus{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M5 12h14M12 5v14'/%3E%3C/svg%3E")}.vpi-sun{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Cpath d='M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M6.34 17.66l-1.41 1.41M19.07 4.93l-1.41 1.41'/%3E%3C/svg%3E")}.vpi-moon{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z'/%3E%3C/svg%3E")}.vpi-more-horizontal{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='1'/%3E%3Ccircle cx='19' cy='12' r='1'/%3E%3Ccircle cx='5' cy='12' r='1'/%3E%3C/svg%3E")}.vpi-languages{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='m5 8 6 6M4 14l6-6 2-3M2 5h12M7 2h1M22 22l-5-10-5 10M14 18h6'/%3E%3C/svg%3E")}.vpi-heart{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z'/%3E%3C/svg%3E")}.vpi-search{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E")}.vpi-layout-list{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Crect width='7' height='7' x='3' y='3' rx='1'/%3E%3Crect width='7' height='7' x='3' y='14' rx='1'/%3E%3Cpath d='M14 4h7M14 9h7M14 15h7M14 20h7'/%3E%3C/svg%3E")}.vpi-delete{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M20 5H9l-7 7 7 7h11a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2ZM18 9l-6 6M12 9l6 6'/%3E%3C/svg%3E")}.vpi-corner-down-left{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='m9 10-5 5 5 5'/%3E%3Cpath d='M20 4v7a4 4 0 0 1-4 4H4'/%3E%3C/svg%3E")}:root{--vp-icon-copy: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='rgba(128,128,128,1)' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Crect width='8' height='4' x='8' y='2' rx='1' ry='1'/%3E%3Cpath d='M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2'/%3E%3C/svg%3E");--vp-icon-copied: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='rgba(128,128,128,1)' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Crect width='8' height='4' x='8' y='2' rx='1' ry='1'/%3E%3Cpath d='M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2'/%3E%3Cpath d='m9 14 2 2 4-4'/%3E%3C/svg%3E")}.visually-hidden{position:absolute;width:1px;height:1px;white-space:nowrap;clip:rect(0 0 0 0);clip-path:inset(50%);overflow:hidden}.custom-block{border:1px solid transparent;border-radius:8px;padding:16px 16px 8px;line-height:24px;font-size:var(--vp-custom-block-font-size);color:var(--vp-c-text-2)}.custom-block.info{border-color:var(--vp-custom-block-info-border);color:var(--vp-custom-block-info-text);background-color:var(--vp-custom-block-info-bg)}.custom-block.info a,.custom-block.info code{color:var(--vp-c-brand-1)}.custom-block.info a:hover,.custom-block.info a:hover>code{color:var(--vp-c-brand-2)}.custom-block.info code{background-color:var(--vp-custom-block-info-code-bg)}.custom-block.note{border-color:var(--vp-custom-block-note-border);color:var(--vp-custom-block-note-text);background-color:var(--vp-custom-block-note-bg)}.custom-block.note a,.custom-block.note code{color:var(--vp-c-brand-1)}.custom-block.note a:hover,.custom-block.note a:hover>code{color:var(--vp-c-brand-2)}.custom-block.note code{background-color:var(--vp-custom-block-note-code-bg)}.custom-block.tip{border-color:var(--vp-custom-block-tip-border);color:var(--vp-custom-block-tip-text);background-color:var(--vp-custom-block-tip-bg)}.custom-block.tip a,.custom-block.tip code{color:var(--vp-c-tip-1)}.custom-block.tip a:hover,.custom-block.tip a:hover>code{color:var(--vp-c-tip-2)}.custom-block.tip code{background-color:var(--vp-custom-block-tip-code-bg)}.custom-block.important{border-color:var(--vp-custom-block-important-border);color:var(--vp-custom-block-important-text);background-color:var(--vp-custom-block-important-bg)}.custom-block.important a,.custom-block.important code{color:var(--vp-c-important-1)}.custom-block.important a:hover,.custom-block.important a:hover>code{color:var(--vp-c-important-2)}.custom-block.important code{background-color:var(--vp-custom-block-important-code-bg)}.custom-block.warning{border-color:var(--vp-custom-block-warning-border);color:var(--vp-custom-block-warning-text);background-color:var(--vp-custom-block-warning-bg)}.custom-block.warning a,.custom-block.warning code{color:var(--vp-c-warning-1)}.custom-block.warning a:hover,.custom-block.warning a:hover>code{color:var(--vp-c-warning-2)}.custom-block.warning code{background-color:var(--vp-custom-block-warning-code-bg)}.custom-block.danger{border-color:var(--vp-custom-block-danger-border);color:var(--vp-custom-block-danger-text);background-color:var(--vp-custom-block-danger-bg)}.custom-block.danger a,.custom-block.danger code{color:var(--vp-c-danger-1)}.custom-block.danger a:hover,.custom-block.danger a:hover>code{color:var(--vp-c-danger-2)}.custom-block.danger code{background-color:var(--vp-custom-block-danger-code-bg)}.custom-block.caution{border-color:var(--vp-custom-block-caution-border);color:var(--vp-custom-block-caution-text);background-color:var(--vp-custom-block-caution-bg)}.custom-block.caution a,.custom-block.caution code{color:var(--vp-c-caution-1)}.custom-block.caution a:hover,.custom-block.caution a:hover>code{color:var(--vp-c-caution-2)}.custom-block.caution code{background-color:var(--vp-custom-block-caution-code-bg)}.custom-block.details{border-color:var(--vp-custom-block-details-border);color:var(--vp-custom-block-details-text);background-color:var(--vp-custom-block-details-bg)}.custom-block.details a{color:var(--vp-c-brand-1)}.custom-block.details a:hover,.custom-block.details a:hover>code{color:var(--vp-c-brand-2)}.custom-block.details code{background-color:var(--vp-custom-block-details-code-bg)}.custom-block-title{font-weight:600}.custom-block p+p{margin:8px 0}.custom-block.details summary{margin:0 0 8px;font-weight:700;cursor:pointer;-webkit-user-select:none;user-select:none}.custom-block.details summary+p{margin:8px 0}.custom-block a{color:inherit;font-weight:600;text-decoration:underline;text-underline-offset:2px;transition:opacity .25s}.custom-block a:hover{opacity:.75}.custom-block code{font-size:var(--vp-custom-block-code-font-size)}.custom-block.custom-block th,.custom-block.custom-block blockquote>p{font-size:var(--vp-custom-block-font-size);color:inherit}.dark .shiki span{color:var(--shiki-dark, inherit)}html:not(.dark) .shiki span{color:var(--shiki-light, inherit)}.vp-code-group{margin-top:16px}.vp-code-group .tabs{position:relative;display:flex;margin-right:-24px;margin-left:-24px;padding:0 12px;background-color:var(--vp-code-tab-bg);overflow-x:auto;overflow-y:hidden;box-shadow:inset 0 -1px var(--vp-code-tab-divider)}@media (min-width: 640px){.vp-code-group .tabs{margin-right:0;margin-left:0;border-radius:8px 8px 0 0}}.vp-code-group .tabs input{position:fixed;opacity:0;pointer-events:none}.vp-code-group .tabs label{position:relative;display:inline-block;border-bottom:1px solid transparent;padding:0 12px;line-height:48px;font-size:14px;font-weight:500;color:var(--vp-code-tab-text-color);white-space:nowrap;cursor:pointer;transition:color .25s}.vp-code-group .tabs label:after{position:absolute;right:8px;bottom:-1px;left:8px;z-index:1;height:2px;border-radius:2px;content:"";background-color:transparent;transition:background-color .25s}.vp-code-group label:hover{color:var(--vp-code-tab-hover-text-color)}.vp-code-group input:checked+label{color:var(--vp-code-tab-active-text-color)}.vp-code-group input:checked+label:after{background-color:var(--vp-code-tab-active-bar-color)}.vp-code-group div[class*=language-],.vp-block{display:none;margin-top:0!important;border-top-left-radius:0!important;border-top-right-radius:0!important}.vp-code-group div[class*=language-].active,.vp-block.active{display:block}.vp-block{padding:20px 24px}.vp-doc h1,.vp-doc h2,.vp-doc h3,.vp-doc h4,.vp-doc h5,.vp-doc h6{position:relative;font-weight:600;outline:none}.vp-doc h1{letter-spacing:-.02em;line-height:40px;font-size:28px}.vp-doc h2{margin:48px 0 16px;border-top:1px solid var(--vp-c-divider);padding-top:24px;letter-spacing:-.02em;line-height:32px;font-size:24px}.vp-doc h3{margin:32px 0 0;letter-spacing:-.01em;line-height:28px;font-size:20px}.vp-doc h4{margin:24px 0 0;letter-spacing:-.01em;line-height:24px;font-size:18px}.vp-doc .header-anchor{position:absolute;top:0;left:0;margin-left:-.87em;font-weight:500;-webkit-user-select:none;user-select:none;opacity:0;text-decoration:none;transition:color .25s,opacity .25s}.vp-doc .header-anchor:before{content:var(--vp-header-anchor-symbol)}.vp-doc h1:hover .header-anchor,.vp-doc h1 .header-anchor:focus,.vp-doc h2:hover .header-anchor,.vp-doc h2 .header-anchor:focus,.vp-doc h3:hover .header-anchor,.vp-doc h3 .header-anchor:focus,.vp-doc h4:hover .header-anchor,.vp-doc h4 .header-anchor:focus,.vp-doc h5:hover .header-anchor,.vp-doc h5 .header-anchor:focus,.vp-doc h6:hover .header-anchor,.vp-doc h6 .header-anchor:focus{opacity:1}@media (min-width: 768px){.vp-doc h1{letter-spacing:-.02em;line-height:40px;font-size:32px}}.vp-doc h2 .header-anchor{top:24px}.vp-doc p,.vp-doc summary{margin:16px 0}.vp-doc p{line-height:28px}.vp-doc blockquote{margin:16px 0;border-left:2px solid var(--vp-c-divider);padding-left:16px;transition:border-color .5s;color:var(--vp-c-text-2)}.vp-doc blockquote>p{margin:0;font-size:16px;transition:color .5s}.vp-doc a{font-weight:500;color:var(--vp-c-brand-1);text-decoration:underline;text-underline-offset:2px;transition:color .25s,opacity .25s}.vp-doc a:hover{color:var(--vp-c-brand-2)}.vp-doc strong{font-weight:600}.vp-doc ul,.vp-doc ol{padding-left:1.25rem;margin:16px 0}.vp-doc ul{list-style:disc}.vp-doc ol{list-style:decimal}.vp-doc li+li{margin-top:8px}.vp-doc li>ol,.vp-doc li>ul{margin:8px 0 0}.vp-doc table{display:block;border-collapse:collapse;margin:20px 0;overflow-x:auto}.vp-doc tr{background-color:var(--vp-c-bg);border-top:1px solid var(--vp-c-divider);transition:background-color .5s}.vp-doc tr:nth-child(2n){background-color:var(--vp-c-bg-soft)}.vp-doc th,.vp-doc td{border:1px solid var(--vp-c-divider);padding:8px 16px}.vp-doc th{text-align:left;font-size:14px;font-weight:600;color:var(--vp-c-text-2);background-color:var(--vp-c-bg-soft)}.vp-doc td{font-size:14px}.vp-doc hr{margin:16px 0;border:none;border-top:1px solid var(--vp-c-divider)}.vp-doc .custom-block{margin:16px 0}.vp-doc .custom-block p{margin:8px 0;line-height:24px}.vp-doc .custom-block p:first-child{margin:0}.vp-doc .custom-block div[class*=language-]{margin:8px 0;border-radius:8px}.vp-doc .custom-block div[class*=language-] code{font-weight:400;background-color:transparent}.vp-doc .custom-block .vp-code-group .tabs{margin:0;border-radius:8px 8px 0 0}.vp-doc :not(pre,h1,h2,h3,h4,h5,h6)>code{font-size:var(--vp-code-font-size);color:var(--vp-code-color)}.vp-doc :not(pre)>code{border-radius:4px;padding:3px 6px;background-color:var(--vp-code-bg);transition:color .25s,background-color .5s}.vp-doc a>code{color:var(--vp-code-link-color)}.vp-doc a:hover>code{color:var(--vp-code-link-hover-color)}.vp-doc h1>code,.vp-doc h2>code,.vp-doc h3>code,.vp-doc h4>code{font-size:.9em}.vp-doc div[class*=language-],.vp-block{position:relative;margin:16px -24px;background-color:var(--vp-code-block-bg);overflow-x:auto;transition:background-color .5s}@media (min-width: 640px){.vp-doc div[class*=language-],.vp-block{border-radius:8px;margin:16px 0}}@media (max-width: 639px){.vp-doc li div[class*=language-]{border-radius:8px 0 0 8px}}.vp-doc div[class*=language-]+div[class*=language-],.vp-doc div[class$=-api]+div[class*=language-],.vp-doc div[class*=language-]+div[class$=-api]>div[class*=language-]{margin-top:-8px}.vp-doc [class*=language-] pre,.vp-doc [class*=language-] code{-moz-tab-size:4;-o-tab-size:4;tab-size:4}.vp-doc [class*=language-] pre{position:relative;z-index:1;margin:0;padding:20px 0;background:transparent;overflow-x:auto}.vp-doc [class*=language-] code{display:block;padding:0 24px;width:fit-content;min-width:100%;line-height:var(--vp-code-line-height);font-size:var(--vp-code-font-size);color:var(--vp-code-block-color);transition:color .5s}.vp-doc [class*=language-] code .highlighted{background-color:var(--vp-code-line-highlight-color);transition:background-color .5s;margin:0 -24px;padding:0 24px;width:calc(100% + 48px);display:inline-block}.vp-doc [class*=language-] code .highlighted.error{background-color:var(--vp-code-line-error-color)}.vp-doc [class*=language-] code .highlighted.warning{background-color:var(--vp-code-line-warning-color)}.vp-doc [class*=language-] code .diff{transition:background-color .5s;margin:0 -24px;padding:0 24px;width:calc(100% + 48px);display:inline-block}.vp-doc [class*=language-] code .diff:before{position:absolute;left:10px}.vp-doc [class*=language-] .has-focused-lines .line:not(.has-focus){filter:blur(.095rem);opacity:.4;transition:filter .35s,opacity .35s}.vp-doc [class*=language-] .has-focused-lines .line:not(.has-focus){opacity:.7;transition:filter .35s,opacity .35s}.vp-doc [class*=language-]:hover .has-focused-lines .line:not(.has-focus){filter:blur(0);opacity:1}.vp-doc [class*=language-] code .diff.remove{background-color:var(--vp-code-line-diff-remove-color);opacity:.7}.vp-doc [class*=language-] code .diff.remove:before{content:"-";color:var(--vp-code-line-diff-remove-symbol-color)}.vp-doc [class*=language-] code .diff.add{background-color:var(--vp-code-line-diff-add-color)}.vp-doc [class*=language-] code .diff.add:before{content:"+";color:var(--vp-code-line-diff-add-symbol-color)}.vp-doc div[class*=language-].line-numbers-mode{padding-left:32px}.vp-doc .line-numbers-wrapper{position:absolute;top:0;bottom:0;left:0;z-index:3;border-right:1px solid var(--vp-code-block-divider-color);padding-top:20px;width:32px;text-align:center;font-family:var(--vp-font-family-mono);line-height:var(--vp-code-line-height);font-size:var(--vp-code-font-size);color:var(--vp-code-line-number-color);transition:border-color .5s,color .5s}.vp-doc [class*=language-]>button.copy{direction:ltr;position:absolute;top:12px;right:12px;z-index:3;border:1px solid var(--vp-code-copy-code-border-color);border-radius:4px;width:40px;height:40px;background-color:var(--vp-code-copy-code-bg);opacity:0;cursor:pointer;background-image:var(--vp-icon-copy);background-position:50%;background-size:20px;background-repeat:no-repeat;transition:border-color .25s,background-color .25s,opacity .25s}.vp-doc [class*=language-]:hover>button.copy,.vp-doc [class*=language-]>button.copy:focus{opacity:1}.vp-doc [class*=language-]>button.copy:hover,.vp-doc [class*=language-]>button.copy.copied{border-color:var(--vp-code-copy-code-hover-border-color);background-color:var(--vp-code-copy-code-hover-bg)}.vp-doc [class*=language-]>button.copy.copied,.vp-doc [class*=language-]>button.copy:hover.copied{border-radius:0 4px 4px 0;background-color:var(--vp-code-copy-code-hover-bg);background-image:var(--vp-icon-copied)}.vp-doc [class*=language-]>button.copy.copied:before,.vp-doc [class*=language-]>button.copy:hover.copied:before{position:relative;top:-1px;transform:translate(calc(-100% - 1px));display:flex;justify-content:center;align-items:center;border:1px solid var(--vp-code-copy-code-hover-border-color);border-right:0;border-radius:4px 0 0 4px;padding:0 10px;width:fit-content;height:40px;text-align:center;font-size:12px;font-weight:500;color:var(--vp-code-copy-code-active-text);background-color:var(--vp-code-copy-code-hover-bg);white-space:nowrap;content:var(--vp-code-copy-copied-text-content)}.vp-doc [class*=language-]>span.lang{position:absolute;top:2px;right:8px;z-index:2;font-size:12px;font-weight:500;-webkit-user-select:none;user-select:none;color:var(--vp-code-lang-color);transition:color .4s,opacity .4s}.vp-doc [class*=language-]:hover>button.copy+span.lang,.vp-doc [class*=language-]>button.copy:focus+span.lang{opacity:0}.vp-doc .VPTeamMembers{margin-top:24px}.vp-doc .VPTeamMembers.small.count-1 .container{margin:0!important;max-width:calc((100% - 24px)/2)!important}.vp-doc .VPTeamMembers.small.count-2 .container,.vp-doc .VPTeamMembers.small.count-3 .container{max-width:100%!important}.vp-doc .VPTeamMembers.medium.count-1 .container{margin:0!important;max-width:calc((100% - 24px)/2)!important}:is(.vp-external-link-icon,.vp-doc a[href*="://"],.vp-doc a[target=_blank]):not(:is(.no-icon,svg a,:has(img,svg))):after{display:inline-block;margin-top:-1px;margin-left:4px;width:11px;height:11px;background:currentColor;color:var(--vp-c-text-3);flex-shrink:0;--icon: url("data:image/svg+xml, %3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' %3E%3Cpath d='M0 0h24v24H0V0z' fill='none' /%3E%3Cpath d='M9 5v2h6.59L4 18.59 5.41 20 17 8.41V15h2V5H9z' /%3E%3C/svg%3E");-webkit-mask-image:var(--icon);mask-image:var(--icon)}.vp-external-link-icon:after{content:""}.external-link-icon-enabled :is(.vp-doc a[href*="://"],.vp-doc a[target=_blank]):not(:is(.no-icon,svg a,:has(img,svg))):after{content:"";color:currentColor}.vp-sponsor{border-radius:16px;overflow:hidden}.vp-sponsor.aside{border-radius:12px}.vp-sponsor-section+.vp-sponsor-section{margin-top:4px}.vp-sponsor-tier{margin:0 0 4px!important;text-align:center;letter-spacing:1px!important;line-height:24px;width:100%;font-weight:600;color:var(--vp-c-text-2);background-color:var(--vp-c-bg-soft)}.vp-sponsor.normal .vp-sponsor-tier{padding:13px 0 11px;font-size:14px}.vp-sponsor.aside .vp-sponsor-tier{padding:9px 0 7px;font-size:12px}.vp-sponsor-grid+.vp-sponsor-tier{margin-top:4px}.vp-sponsor-grid{display:flex;flex-wrap:wrap;gap:4px}.vp-sponsor-grid.xmini .vp-sponsor-grid-link{height:64px}.vp-sponsor-grid.xmini .vp-sponsor-grid-image{max-width:64px;max-height:22px}.vp-sponsor-grid.mini .vp-sponsor-grid-link{height:72px}.vp-sponsor-grid.mini .vp-sponsor-grid-image{max-width:96px;max-height:24px}.vp-sponsor-grid.small .vp-sponsor-grid-link{height:96px}.vp-sponsor-grid.small .vp-sponsor-grid-image{max-width:96px;max-height:24px}.vp-sponsor-grid.medium .vp-sponsor-grid-link{height:112px}.vp-sponsor-grid.medium .vp-sponsor-grid-image{max-width:120px;max-height:36px}.vp-sponsor-grid.big .vp-sponsor-grid-link{height:184px}.vp-sponsor-grid.big .vp-sponsor-grid-image{max-width:192px;max-height:56px}.vp-sponsor-grid[data-vp-grid="2"] .vp-sponsor-grid-item{width:calc((100% - 4px)/2)}.vp-sponsor-grid[data-vp-grid="3"] .vp-sponsor-grid-item{width:calc((100% - 4px * 2) / 3)}.vp-sponsor-grid[data-vp-grid="4"] .vp-sponsor-grid-item{width:calc((100% - 12px)/4)}.vp-sponsor-grid[data-vp-grid="5"] .vp-sponsor-grid-item{width:calc((100% - 16px)/5)}.vp-sponsor-grid[data-vp-grid="6"] .vp-sponsor-grid-item{width:calc((100% - 4px * 5) / 6)}.vp-sponsor-grid-item{flex-shrink:0;width:100%;background-color:var(--vp-c-bg-soft);transition:background-color .25s}.vp-sponsor-grid-item:hover{background-color:var(--vp-c-default-soft)}.vp-sponsor-grid-item:hover .vp-sponsor-grid-image{filter:grayscale(0) invert(0)}.vp-sponsor-grid-item.empty:hover{background-color:var(--vp-c-bg-soft)}.dark .vp-sponsor-grid-item:hover{background-color:var(--vp-c-white)}.dark .vp-sponsor-grid-item.empty:hover{background-color:var(--vp-c-bg-soft)}.vp-sponsor-grid-link{display:flex}.vp-sponsor-grid-box{display:flex;justify-content:center;align-items:center;width:100%}.vp-sponsor-grid-image{max-width:100%;filter:grayscale(1);transition:filter .25s}.dark .vp-sponsor-grid-image{filter:grayscale(1) invert(1)}.VPBadge{display:inline-block;margin-left:2px;border:1px solid transparent;border-radius:12px;padding:0 10px;line-height:22px;font-size:12px;font-weight:500;transform:translateY(-2px)}.VPBadge.small{padding:0 6px;line-height:18px;font-size:10px;transform:translateY(-8px)}.VPDocFooter .VPBadge{display:none}.vp-doc h1>.VPBadge{margin-top:4px;vertical-align:top}.vp-doc h2>.VPBadge{margin-top:3px;padding:0 8px;vertical-align:top}.vp-doc h3>.VPBadge{vertical-align:middle}.vp-doc h4>.VPBadge,.vp-doc h5>.VPBadge,.vp-doc h6>.VPBadge{vertical-align:middle;line-height:18px}.VPBadge.info{border-color:var(--vp-badge-info-border);color:var(--vp-badge-info-text);background-color:var(--vp-badge-info-bg)}.VPBadge.tip{border-color:var(--vp-badge-tip-border);color:var(--vp-badge-tip-text);background-color:var(--vp-badge-tip-bg)}.VPBadge.warning{border-color:var(--vp-badge-warning-border);color:var(--vp-badge-warning-text);background-color:var(--vp-badge-warning-bg)}.VPBadge.danger{border-color:var(--vp-badge-danger-border);color:var(--vp-badge-danger-text);background-color:var(--vp-badge-danger-bg)}.VPBackdrop[data-v-c79a1216]{position:fixed;top:0;right:0;bottom:0;left:0;z-index:var(--vp-z-index-backdrop);background:var(--vp-backdrop-bg-color);transition:opacity .5s}.VPBackdrop.fade-enter-from[data-v-c79a1216],.VPBackdrop.fade-leave-to[data-v-c79a1216]{opacity:0}.VPBackdrop.fade-leave-active[data-v-c79a1216]{transition-duration:.25s}@media (min-width: 1280px){.VPBackdrop[data-v-c79a1216]{display:none}}.NotFound[data-v-829df670]{padding:64px 24px 96px;text-align:center}@media (min-width: 768px){.NotFound[data-v-829df670]{padding:96px 32px 168px}}.code[data-v-829df670]{line-height:64px;font-size:64px;font-weight:600}.title[data-v-829df670]{padding-top:12px;letter-spacing:2px;line-height:20px;font-size:20px;font-weight:700}.divider[data-v-829df670]{margin:24px auto 18px;width:64px;height:1px;background-color:var(--vp-c-divider)}.quote[data-v-829df670]{margin:0 auto;max-width:256px;font-size:14px;font-weight:500;color:var(--vp-c-text-2)}.action[data-v-829df670]{padding-top:20px}.link[data-v-829df670]{display:inline-block;border:1px solid var(--vp-c-brand-1);border-radius:16px;padding:3px 16px;font-size:14px;font-weight:500;color:var(--vp-c-brand-1);transition:border-color .25s,color .25s}.link[data-v-829df670]:hover{border-color:var(--vp-c-brand-2);color:var(--vp-c-brand-2)}.root[data-v-2d0bdf9b]{position:relative;z-index:1}.nested[data-v-2d0bdf9b]{padding-right:16px;padding-left:16px}.outline-link[data-v-2d0bdf9b]{display:block;line-height:32px;font-size:14px;font-weight:400;color:var(--vp-c-text-2);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;transition:color .5s}.outline-link[data-v-2d0bdf9b]:hover,.outline-link.active[data-v-2d0bdf9b]{color:var(--vp-c-text-1);transition:color .25s}.outline-link.nested[data-v-2d0bdf9b]{padding-left:13px}.VPDocAsideOutline[data-v-60d5052e]{display:none}.VPDocAsideOutline.has-outline[data-v-60d5052e]{display:block}.content[data-v-60d5052e]{position:relative;border-left:1px solid var(--vp-c-divider);padding-left:16px;font-size:13px;font-weight:500}.outline-marker[data-v-60d5052e]{position:absolute;top:32px;left:-1px;z-index:0;opacity:0;width:2px;border-radius:2px;height:18px;background-color:var(--vp-c-brand-1);transition:top .25s cubic-bezier(0,1,.5,1),background-color .5s,opacity .25s}.outline-title[data-v-60d5052e]{line-height:32px;font-size:14px;font-weight:600}.VPDocAside[data-v-3f215769]{display:flex;flex-direction:column;flex-grow:1}.spacer[data-v-3f215769]{flex-grow:1}.VPDocAside[data-v-3f215769] .spacer+.VPDocAsideSponsors,.VPDocAside[data-v-3f215769] .spacer+.VPDocAsideCarbonAds{margin-top:24px}.VPDocAside[data-v-3f215769] .VPDocAsideSponsors+.VPDocAsideCarbonAds{margin-top:16px}.VPLastUpdated[data-v-e98dd255]{line-height:24px;font-size:14px;font-weight:500;color:var(--vp-c-text-2)}@media (min-width: 640px){.VPLastUpdated[data-v-e98dd255]{line-height:32px;font-size:14px;font-weight:500}}.VPDocFooter[data-v-e257564d]{margin-top:64px}.edit-info[data-v-e257564d]{padding-bottom:18px}@media (min-width: 640px){.edit-info[data-v-e257564d]{display:flex;justify-content:space-between;align-items:center;padding-bottom:14px}}.edit-link-button[data-v-e257564d]{display:flex;align-items:center;border:0;line-height:32px;font-size:14px;font-weight:500;color:var(--vp-c-brand-1);transition:color .25s}.edit-link-button[data-v-e257564d]:hover{color:var(--vp-c-brand-2)}.edit-link-icon[data-v-e257564d]{margin-right:8px}.prev-next[data-v-e257564d]{border-top:1px solid var(--vp-c-divider);padding-top:24px;display:grid;grid-row-gap:8px}@media (min-width: 640px){.prev-next[data-v-e257564d]{grid-template-columns:repeat(2,1fr);grid-column-gap:16px}}.pager-link[data-v-e257564d]{display:block;border:1px solid var(--vp-c-divider);border-radius:8px;padding:11px 16px 13px;width:100%;height:100%;transition:border-color .25s}.pager-link[data-v-e257564d]:hover{border-color:var(--vp-c-brand-1)}.pager-link.next[data-v-e257564d]{margin-left:auto;text-align:right}.desc[data-v-e257564d]{display:block;line-height:20px;font-size:12px;font-weight:500;color:var(--vp-c-text-2)}.title[data-v-e257564d]{display:block;line-height:20px;font-size:14px;font-weight:500;color:var(--vp-c-brand-1);transition:color .25s}.VPDoc[data-v-7011f0d8]{padding:32px 24px 96px;width:100%}@media (min-width: 768px){.VPDoc[data-v-7011f0d8]{padding:48px 32px 128px}}@media (min-width: 960px){.VPDoc[data-v-7011f0d8]{padding:48px 32px 0}.VPDoc:not(.has-sidebar) .container[data-v-7011f0d8]{display:flex;justify-content:center;max-width:992px}.VPDoc:not(.has-sidebar) .content[data-v-7011f0d8]{max-width:752px}}@media (min-width: 1280px){.VPDoc .container[data-v-7011f0d8]{display:flex;justify-content:center}.VPDoc .aside[data-v-7011f0d8]{display:block}}@media (min-width: 1440px){.VPDoc:not(.has-sidebar) .content[data-v-7011f0d8]{max-width:784px}.VPDoc:not(.has-sidebar) .container[data-v-7011f0d8]{max-width:1104px}}.container[data-v-7011f0d8]{margin:0 auto;width:100%}.aside[data-v-7011f0d8]{position:relative;display:none;order:2;flex-grow:1;padding-left:32px;width:100%;max-width:256px}.left-aside[data-v-7011f0d8]{order:1;padding-left:unset;padding-right:32px}.aside-container[data-v-7011f0d8]{position:fixed;top:0;padding-top:calc(var(--vp-nav-height) + var(--vp-layout-top-height, 0px) + var(--vp-doc-top-height, 0px) + 48px);width:224px;height:100vh;overflow-x:hidden;overflow-y:auto;scrollbar-width:none}.aside-container[data-v-7011f0d8]::-webkit-scrollbar{display:none}.aside-curtain[data-v-7011f0d8]{position:fixed;bottom:0;z-index:10;width:224px;height:32px;background:linear-gradient(transparent,var(--vp-c-bg) 70%);pointer-events:none}.aside-content[data-v-7011f0d8]{display:flex;flex-direction:column;min-height:calc(100vh - (var(--vp-nav-height) + var(--vp-layout-top-height, 0px) + 48px));padding-bottom:32px}.content[data-v-7011f0d8]{position:relative;margin:0 auto;width:100%}@media (min-width: 960px){.content[data-v-7011f0d8]{padding:0 32px 128px}}@media (min-width: 1280px){.content[data-v-7011f0d8]{order:1;margin:0;min-width:640px}}.content-container[data-v-7011f0d8]{margin:0 auto}.VPDoc.has-aside .content-container[data-v-7011f0d8]{max-width:688px}.VPButton[data-v-01bff58b]{display:inline-block;border:1px solid transparent;text-align:center;font-weight:600;white-space:nowrap;transition:color .25s,border-color .25s,background-color .25s}.VPButton[data-v-01bff58b]:active{transition:color .1s,border-color .1s,background-color .1s}.VPButton.medium[data-v-01bff58b]{border-radius:20px;padding:0 20px;line-height:38px;font-size:14px}.VPButton.big[data-v-01bff58b]{border-radius:24px;padding:0 24px;line-height:46px;font-size:16px}.VPButton.brand[data-v-01bff58b]{border-color:var(--vp-button-brand-border);color:var(--vp-button-brand-text);background-color:var(--vp-button-brand-bg)}.VPButton.brand[data-v-01bff58b]:hover{border-color:var(--vp-button-brand-hover-border);color:var(--vp-button-brand-hover-text);background-color:var(--vp-button-brand-hover-bg)}.VPButton.brand[data-v-01bff58b]:active{border-color:var(--vp-button-brand-active-border);color:var(--vp-button-brand-active-text);background-color:var(--vp-button-brand-active-bg)}.VPButton.alt[data-v-01bff58b]{border-color:var(--vp-button-alt-border);color:var(--vp-button-alt-text);background-color:var(--vp-button-alt-bg)}.VPButton.alt[data-v-01bff58b]:hover{border-color:var(--vp-button-alt-hover-border);color:var(--vp-button-alt-hover-text);background-color:var(--vp-button-alt-hover-bg)}.VPButton.alt[data-v-01bff58b]:active{border-color:var(--vp-button-alt-active-border);color:var(--vp-button-alt-active-text);background-color:var(--vp-button-alt-active-bg)}.VPButton.sponsor[data-v-01bff58b]{border-color:var(--vp-button-sponsor-border);color:var(--vp-button-sponsor-text);background-color:var(--vp-button-sponsor-bg)}.VPButton.sponsor[data-v-01bff58b]:hover{border-color:var(--vp-button-sponsor-hover-border);color:var(--vp-button-sponsor-hover-text);background-color:var(--vp-button-sponsor-hover-bg)}.VPButton.sponsor[data-v-01bff58b]:active{border-color:var(--vp-button-sponsor-active-border);color:var(--vp-button-sponsor-active-text);background-color:var(--vp-button-sponsor-active-bg)}html:not(.dark) .VPImage.dark[data-v-8426fc1a]{display:none}.dark .VPImage.light[data-v-8426fc1a]{display:none}.VPHero[data-v-f930dc11]{margin-top:calc((var(--vp-nav-height) + var(--vp-layout-top-height, 0px)) * -1);padding:calc(var(--vp-nav-height) + var(--vp-layout-top-height, 0px) + 48px) 24px 48px}@media (min-width: 640px){.VPHero[data-v-f930dc11]{padding:calc(var(--vp-nav-height) + var(--vp-layout-top-height, 0px) + 80px) 48px 64px}}@media (min-width: 960px){.VPHero[data-v-f930dc11]{padding:calc(var(--vp-nav-height) + var(--vp-layout-top-height, 0px) + 80px) 64px 64px}}.container[data-v-f930dc11]{display:flex;flex-direction:column;margin:0 auto;max-width:1152px}@media (min-width: 960px){.container[data-v-f930dc11]{flex-direction:row}}.main[data-v-f930dc11]{position:relative;z-index:10;order:2;flex-grow:1;flex-shrink:0}.VPHero.has-image .container[data-v-f930dc11]{text-align:center}@media (min-width: 960px){.VPHero.has-image .container[data-v-f930dc11]{text-align:left}}@media (min-width: 960px){.main[data-v-f930dc11]{order:1;width:calc((100% / 3) * 2)}.VPHero.has-image .main[data-v-f930dc11]{max-width:592px}}.heading[data-v-f930dc11]{display:flex;flex-direction:column}.name[data-v-f930dc11],.text[data-v-f930dc11]{width:fit-content;max-width:392px;letter-spacing:-.4px;line-height:40px;font-size:32px;font-weight:700;white-space:pre-wrap}.VPHero.has-image .name[data-v-f930dc11],.VPHero.has-image .text[data-v-f930dc11]{margin:0 auto}.name[data-v-f930dc11]{color:var(--vp-home-hero-name-color)}.clip[data-v-f930dc11]{background:var(--vp-home-hero-name-background);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:var(--vp-home-hero-name-color)}@media (min-width: 640px){.name[data-v-f930dc11],.text[data-v-f930dc11]{max-width:576px;line-height:56px;font-size:48px}}@media (min-width: 960px){.name[data-v-f930dc11],.text[data-v-f930dc11]{line-height:64px;font-size:56px}.VPHero.has-image .name[data-v-f930dc11],.VPHero.has-image .text[data-v-f930dc11]{margin:0}}.tagline[data-v-f930dc11]{padding-top:8px;max-width:392px;line-height:28px;font-size:18px;font-weight:500;white-space:pre-wrap;color:var(--vp-c-text-2)}.VPHero.has-image .tagline[data-v-f930dc11]{margin:0 auto}@media (min-width: 640px){.tagline[data-v-f930dc11]{padding-top:12px;max-width:576px;line-height:32px;font-size:20px}}@media (min-width: 960px){.tagline[data-v-f930dc11]{line-height:36px;font-size:24px}.VPHero.has-image .tagline[data-v-f930dc11]{margin:0}}.actions[data-v-f930dc11]{display:flex;flex-wrap:wrap;margin:-6px;padding-top:24px}.VPHero.has-image .actions[data-v-f930dc11]{justify-content:center}@media (min-width: 640px){.actions[data-v-f930dc11]{padding-top:32px}}@media (min-width: 960px){.VPHero.has-image .actions[data-v-f930dc11]{justify-content:flex-start}}.action[data-v-f930dc11]{flex-shrink:0;padding:6px}.image[data-v-f930dc11]{order:1;margin:-76px -24px -48px}@media (min-width: 640px){.image[data-v-f930dc11]{margin:-108px -24px -48px}}@media (min-width: 960px){.image[data-v-f930dc11]{flex-grow:1;order:2;margin:0;min-height:100%}}.image-container[data-v-f930dc11]{position:relative;margin:0 auto;width:320px;height:320px}@media (min-width: 640px){.image-container[data-v-f930dc11]{width:392px;height:392px}}@media (min-width: 960px){.image-container[data-v-f930dc11]{display:flex;justify-content:center;align-items:center;width:100%;height:100%;transform:translate(-32px,-32px)}}.image-bg[data-v-f930dc11]{position:absolute;top:50%;left:50%;border-radius:50%;width:192px;height:192px;background-image:var(--vp-home-hero-image-background-image);filter:var(--vp-home-hero-image-filter);transform:translate(-50%,-50%)}@media (min-width: 640px){.image-bg[data-v-f930dc11]{width:256px;height:256px}}@media (min-width: 960px){.image-bg[data-v-f930dc11]{width:320px;height:320px}}[data-v-f930dc11] .image-src{position:absolute;top:50%;left:50%;max-width:192px;max-height:192px;width:100%;height:100%;object-fit:contain;transform:translate(-50%,-50%)}@media (min-width: 640px){[data-v-f930dc11] .image-src{max-width:256px;max-height:256px}}@media (min-width: 960px){[data-v-f930dc11] .image-src{max-width:320px;max-height:320px}}.VPFeature[data-v-5219619b]{display:block;border:1px solid var(--vp-c-bg-soft);border-radius:12px;height:100%;background-color:var(--vp-c-bg-soft);transition:border-color .25s,background-color .25s}.VPFeature.link[data-v-5219619b]:hover{border-color:var(--vp-c-brand-1)}.box[data-v-5219619b]{display:flex;flex-direction:column;padding:24px;height:100%}.box[data-v-5219619b]>.VPImage{margin-bottom:20px}.icon[data-v-5219619b]{display:flex;justify-content:center;align-items:center;margin-bottom:20px;border-radius:6px;background-color:var(--vp-c-default-soft);width:48px;height:48px;font-size:24px;transition:background-color .25s}.title[data-v-5219619b]{line-height:24px;font-size:16px;font-weight:600}.details[data-v-5219619b]{flex-grow:1;padding-top:8px;line-height:24px;font-size:14px;font-weight:500;color:var(--vp-c-text-2)}.link-text[data-v-5219619b]{padding-top:8px}.link-text-value[data-v-5219619b]{display:flex;align-items:center;font-size:14px;font-weight:500;color:var(--vp-c-brand-1)}.link-text-icon[data-v-5219619b]{margin-left:6px}.VPFeatures[data-v-a6181336]{position:relative;padding:0 24px}@media (min-width: 640px){.VPFeatures[data-v-a6181336]{padding:0 48px}}@media (min-width: 960px){.VPFeatures[data-v-a6181336]{padding:0 64px}}.container[data-v-a6181336]{margin:0 auto;max-width:1152px}.items[data-v-a6181336]{display:flex;flex-wrap:wrap;margin:-8px}.item[data-v-a6181336]{padding:8px;width:100%}@media (min-width: 640px){.item.grid-2[data-v-a6181336],.item.grid-4[data-v-a6181336],.item.grid-6[data-v-a6181336]{width:50%}}@media (min-width: 768px){.item.grid-2[data-v-a6181336],.item.grid-4[data-v-a6181336]{width:50%}.item.grid-3[data-v-a6181336],.item.grid-6[data-v-a6181336]{width:calc(100% / 3)}}@media (min-width: 960px){.item.grid-4[data-v-a6181336]{width:25%}}.container[data-v-8e2d4988]{margin:auto;width:100%;max-width:1280px;padding:0 24px}@media (min-width: 640px){.container[data-v-8e2d4988]{padding:0 48px}}@media (min-width: 960px){.container[data-v-8e2d4988]{width:100%;padding:0 64px}}.vp-doc[data-v-8e2d4988] .VPHomeSponsors,.vp-doc[data-v-8e2d4988] .VPTeamPage{margin-left:var(--vp-offset, calc(50% - 50vw) );margin-right:var(--vp-offset, calc(50% - 50vw) )}.vp-doc[data-v-8e2d4988] .VPHomeSponsors h2{border-top:none;letter-spacing:normal}.vp-doc[data-v-8e2d4988] .VPHomeSponsors a,.vp-doc[data-v-8e2d4988] .VPTeamPage a{text-decoration:none}.VPHome[data-v-8b561e3d]{margin-bottom:96px}@media (min-width: 768px){.VPHome[data-v-8b561e3d]{margin-bottom:128px}}.VPContent[data-v-aff0b8d7]{flex-grow:1;flex-shrink:0;margin:var(--vp-layout-top-height, 0px) auto 0;width:100%}.VPContent.is-home[data-v-aff0b8d7]{width:100%;max-width:100%}.VPContent.has-sidebar[data-v-aff0b8d7]{margin:0}@media (min-width: 960px){.VPContent[data-v-aff0b8d7]{padding-top:var(--vp-nav-height)}.VPContent.has-sidebar[data-v-aff0b8d7]{margin:var(--vp-layout-top-height, 0px) 0 0;padding-left:var(--vp-sidebar-width)}}@media (min-width: 1440px){.VPContent.has-sidebar[data-v-aff0b8d7]{padding-right:calc((100vw - var(--vp-layout-max-width)) / 2);padding-left:calc((100vw - var(--vp-layout-max-width)) / 2 + var(--vp-sidebar-width))}}.VPFooter[data-v-c3855bb3]{position:relative;z-index:var(--vp-z-index-footer);border-top:1px solid var(--vp-c-gutter);padding:32px 24px;background-color:var(--vp-c-bg)}.VPFooter.has-sidebar[data-v-c3855bb3]{display:none}.VPFooter[data-v-c3855bb3] a{text-decoration-line:underline;text-underline-offset:2px;transition:color .25s}.VPFooter[data-v-c3855bb3] a:hover{color:var(--vp-c-text-1)}@media (min-width: 768px){.VPFooter[data-v-c3855bb3]{padding:32px}}.container[data-v-c3855bb3]{margin:0 auto;max-width:var(--vp-layout-max-width);text-align:center}.message[data-v-c3855bb3],.copyright[data-v-c3855bb3]{line-height:24px;font-size:14px;font-weight:500;color:var(--vp-c-text-2)}.VPLocalNavOutlineDropdown[data-v-5fabb9ca]{padding:12px 20px 11px}@media (min-width: 960px){.VPLocalNavOutlineDropdown[data-v-5fabb9ca]{padding:12px 36px 11px}}.VPLocalNavOutlineDropdown button[data-v-5fabb9ca]{display:block;font-size:12px;font-weight:500;line-height:24px;color:var(--vp-c-text-2);transition:color .5s;position:relative}.VPLocalNavOutlineDropdown button[data-v-5fabb9ca]:hover{color:var(--vp-c-text-1);transition:color .25s}.VPLocalNavOutlineDropdown button.open[data-v-5fabb9ca]{color:var(--vp-c-text-1)}.icon[data-v-5fabb9ca]{display:inline-block;vertical-align:middle;margin-left:2px;font-size:14px;transform:rotate(0);transition:transform .25s}@media (min-width: 960px){.VPLocalNavOutlineDropdown button[data-v-5fabb9ca]{font-size:14px}.icon[data-v-5fabb9ca]{font-size:16px}}.open>.icon[data-v-5fabb9ca]{transform:rotate(90deg)}.items[data-v-5fabb9ca]{position:absolute;top:40px;right:16px;left:16px;display:grid;gap:1px;border:1px solid var(--vp-c-border);border-radius:8px;background-color:var(--vp-c-gutter);max-height:calc(var(--vp-vh, 100vh) - 86px);overflow:hidden auto;box-shadow:var(--vp-shadow-3)}@media (min-width: 960px){.items[data-v-5fabb9ca]{right:auto;left:calc(var(--vp-sidebar-width) + 32px);width:320px}}.header[data-v-5fabb9ca]{background-color:var(--vp-c-bg-soft)}.top-link[data-v-5fabb9ca]{display:block;padding:0 16px;line-height:48px;font-size:14px;font-weight:500;color:var(--vp-c-brand-1)}.outline[data-v-5fabb9ca]{padding:8px 0;background-color:var(--vp-c-bg-soft)}.flyout-enter-active[data-v-5fabb9ca]{transition:all .2s ease-out}.flyout-leave-active[data-v-5fabb9ca]{transition:all .15s ease-in}.flyout-enter-from[data-v-5fabb9ca],.flyout-leave-to[data-v-5fabb9ca]{opacity:0;transform:translateY(-16px)}.VPLocalNav[data-v-e30e5487]{position:sticky;top:0;left:0;z-index:var(--vp-z-index-local-nav);border-bottom:1px solid var(--vp-c-gutter);padding-top:var(--vp-layout-top-height, 0px);width:100%;background-color:var(--vp-local-nav-bg-color)}.VPLocalNav.fixed[data-v-e30e5487]{position:fixed}@media (min-width: 960px){.VPLocalNav[data-v-e30e5487]{top:var(--vp-nav-height)}.VPLocalNav.has-sidebar[data-v-e30e5487]{padding-left:var(--vp-sidebar-width)}.VPLocalNav.empty[data-v-e30e5487]{display:none}}@media (min-width: 1280px){.VPLocalNav[data-v-e30e5487]{display:none}}@media (min-width: 1440px){.VPLocalNav.has-sidebar[data-v-e30e5487]{padding-left:calc((100vw - var(--vp-layout-max-width)) / 2 + var(--vp-sidebar-width))}}.container[data-v-e30e5487]{display:flex;justify-content:space-between;align-items:center}.menu[data-v-e30e5487]{display:flex;align-items:center;padding:12px 24px 11px;line-height:24px;font-size:12px;font-weight:500;color:var(--vp-c-text-2);transition:color .5s}.menu[data-v-e30e5487]:hover{color:var(--vp-c-text-1);transition:color .25s}@media (min-width: 768px){.menu[data-v-e30e5487]{padding:0 32px}}@media (min-width: 960px){.menu[data-v-e30e5487]{display:none}}.menu-icon[data-v-e30e5487]{margin-right:8px;font-size:14px}.VPOutlineDropdown[data-v-e30e5487]{padding:12px 24px 11px}@media (min-width: 768px){.VPOutlineDropdown[data-v-e30e5487]{padding:12px 32px 11px}}.VPSwitch[data-v-1d5665e3]{position:relative;border-radius:11px;display:block;width:40px;height:22px;flex-shrink:0;border:1px solid var(--vp-input-border-color);background-color:var(--vp-input-switch-bg-color);transition:border-color .25s!important}.VPSwitch[data-v-1d5665e3]:hover{border-color:var(--vp-c-brand-1)}.check[data-v-1d5665e3]{position:absolute;top:1px;left:1px;width:18px;height:18px;border-radius:50%;background-color:var(--vp-c-neutral-inverse);box-shadow:var(--vp-shadow-1);transition:transform .25s!important}.icon[data-v-1d5665e3]{position:relative;display:block;width:18px;height:18px;border-radius:50%;overflow:hidden}.icon[data-v-1d5665e3] [class^=vpi-]{position:absolute;top:3px;left:3px;width:12px;height:12px;color:var(--vp-c-text-2)}.dark .icon[data-v-1d5665e3] [class^=vpi-]{color:var(--vp-c-text-1);transition:opacity .25s!important}.sun[data-v-5337faa4]{opacity:1}.moon[data-v-5337faa4],.dark .sun[data-v-5337faa4]{opacity:0}.dark .moon[data-v-5337faa4]{opacity:1}.dark .VPSwitchAppearance[data-v-5337faa4] .check{transform:translate(18px)}.VPNavBarAppearance[data-v-6c893767]{display:none}@media (min-width: 1280px){.VPNavBarAppearance[data-v-6c893767]{display:flex;align-items:center}}.VPMenuGroup+.VPMenuLink[data-v-35975db6]{margin:12px -12px 0;border-top:1px solid var(--vp-c-divider);padding:12px 12px 0}.link[data-v-35975db6]{display:block;border-radius:6px;padding:0 12px;line-height:32px;font-size:14px;font-weight:500;color:var(--vp-c-text-1);white-space:nowrap;transition:background-color .25s,color .25s}.link[data-v-35975db6]:hover{color:var(--vp-c-brand-1);background-color:var(--vp-c-default-soft)}.link.active[data-v-35975db6]{color:var(--vp-c-brand-1)}.VPMenuGroup[data-v-74489cb8]{margin:12px -12px 0;border-top:1px solid var(--vp-c-divider);padding:12px 12px 0}.VPMenuGroup[data-v-74489cb8]:first-child{margin-top:0;border-top:0;padding-top:0}.VPMenuGroup+.VPMenuGroup[data-v-74489cb8]{margin-top:12px;border-top:1px solid var(--vp-c-divider)}.title[data-v-74489cb8]{padding:0 12px;line-height:32px;font-size:14px;font-weight:600;color:var(--vp-c-text-2);white-space:nowrap;transition:color .25s}.VPMenu[data-v-c9afd7f1]{border-radius:12px;padding:12px;min-width:128px;border:1px solid var(--vp-c-divider);background-color:var(--vp-c-bg-elv);box-shadow:var(--vp-shadow-3);transition:background-color .5s;max-height:calc(100vh - var(--vp-nav-height));overflow-y:auto}.VPMenu[data-v-c9afd7f1] .group{margin:0 -12px;padding:0 12px 12px}.VPMenu[data-v-c9afd7f1] .group+.group{border-top:1px solid var(--vp-c-divider);padding:11px 12px 12px}.VPMenu[data-v-c9afd7f1] .group:last-child{padding-bottom:0}.VPMenu[data-v-c9afd7f1] .group+.item{border-top:1px solid var(--vp-c-divider);padding:11px 16px 0}.VPMenu[data-v-c9afd7f1] .item{padding:0 16px;white-space:nowrap}.VPMenu[data-v-c9afd7f1] .label{flex-grow:1;line-height:28px;font-size:12px;font-weight:500;color:var(--vp-c-text-2);transition:color .5s}.VPMenu[data-v-c9afd7f1] .action{padding-left:24px}.VPFlyout[data-v-3ab3deac]{position:relative}.VPFlyout[data-v-3ab3deac]:hover{color:var(--vp-c-brand-1);transition:color .25s}.VPFlyout:hover .text[data-v-3ab3deac]{color:var(--vp-c-text-2)}.VPFlyout:hover .icon[data-v-3ab3deac]{fill:var(--vp-c-text-2)}.VPFlyout.active .text[data-v-3ab3deac]{color:var(--vp-c-brand-1)}.VPFlyout.active:hover .text[data-v-3ab3deac]{color:var(--vp-c-brand-2)}.button[aria-expanded=false]+.menu[data-v-3ab3deac]{opacity:0;visibility:hidden;transform:translateY(0)}.VPFlyout:hover .menu[data-v-3ab3deac],.button[aria-expanded=true]+.menu[data-v-3ab3deac]{opacity:1;visibility:visible;transform:translateY(0)}.button[data-v-3ab3deac]{display:flex;align-items:center;padding:0 12px;height:var(--vp-nav-height);color:var(--vp-c-text-1);transition:color .5s}.text[data-v-3ab3deac]{display:flex;align-items:center;line-height:var(--vp-nav-height);font-size:14px;font-weight:500;color:var(--vp-c-text-1);transition:color .25s}.option-icon[data-v-3ab3deac]{margin-right:0;font-size:16px}.text-icon[data-v-3ab3deac]{margin-left:4px;font-size:14px}.icon[data-v-3ab3deac]{font-size:20px;transition:fill .25s}.menu[data-v-3ab3deac]{position:absolute;top:calc(var(--vp-nav-height) / 2 + 20px);right:0;opacity:0;visibility:hidden;transition:opacity .25s,visibility .25s,transform .25s}.VPSocialLink[data-v-bd121fe5]{display:flex;justify-content:center;align-items:center;width:36px;height:36px;color:var(--vp-c-text-2);transition:color .5s}.VPSocialLink[data-v-bd121fe5]:hover{color:var(--vp-c-text-1);transition:color .25s}.VPSocialLink[data-v-bd121fe5]>svg,.VPSocialLink[data-v-bd121fe5]>[class^=vpi-social-]{width:20px;height:20px;fill:currentColor}.VPSocialLinks[data-v-d474d15f]{display:flex;justify-content:center}.VPNavBarExtra[data-v-bb2aa2f0]{display:none;margin-right:-12px}@media (min-width: 768px){.VPNavBarExtra[data-v-bb2aa2f0]{display:block}}@media (min-width: 1280px){.VPNavBarExtra[data-v-bb2aa2f0]{display:none}}.trans-title[data-v-bb2aa2f0]{padding:0 24px 0 12px;line-height:32px;font-size:14px;font-weight:700;color:var(--vp-c-text-1)}.item.appearance[data-v-bb2aa2f0],.item.social-links[data-v-bb2aa2f0]{display:flex;align-items:center;padding:0 12px}.item.appearance[data-v-bb2aa2f0]{min-width:176px}.appearance-action[data-v-bb2aa2f0]{margin-right:-2px}.social-links-list[data-v-bb2aa2f0]{margin:-4px -8px}.VPNavBarHamburger[data-v-e5dd9c1c]{display:flex;justify-content:center;align-items:center;width:48px;height:var(--vp-nav-height)}@media (min-width: 768px){.VPNavBarHamburger[data-v-e5dd9c1c]{display:none}}.container[data-v-e5dd9c1c]{position:relative;width:16px;height:14px;overflow:hidden}.VPNavBarHamburger:hover .top[data-v-e5dd9c1c]{top:0;left:0;transform:translate(4px)}.VPNavBarHamburger:hover .middle[data-v-e5dd9c1c]{top:6px;left:0;transform:translate(0)}.VPNavBarHamburger:hover .bottom[data-v-e5dd9c1c]{top:12px;left:0;transform:translate(8px)}.VPNavBarHamburger.active .top[data-v-e5dd9c1c]{top:6px;transform:translate(0) rotate(225deg)}.VPNavBarHamburger.active .middle[data-v-e5dd9c1c]{top:6px;transform:translate(16px)}.VPNavBarHamburger.active .bottom[data-v-e5dd9c1c]{top:6px;transform:translate(0) rotate(135deg)}.VPNavBarHamburger.active:hover .top[data-v-e5dd9c1c],.VPNavBarHamburger.active:hover .middle[data-v-e5dd9c1c],.VPNavBarHamburger.active:hover .bottom[data-v-e5dd9c1c]{background-color:var(--vp-c-text-2);transition:top .25s,background-color .25s,transform .25s}.top[data-v-e5dd9c1c],.middle[data-v-e5dd9c1c],.bottom[data-v-e5dd9c1c]{position:absolute;width:16px;height:2px;background-color:var(--vp-c-text-1);transition:top .25s,background-color .5s,transform .25s}.top[data-v-e5dd9c1c]{top:0;left:0;transform:translate(0)}.middle[data-v-e5dd9c1c]{top:6px;left:0;transform:translate(8px)}.bottom[data-v-e5dd9c1c]{top:12px;left:0;transform:translate(4px)}.VPNavBarMenuLink[data-v-e56f3d57]{display:flex;align-items:center;padding:0 12px;line-height:var(--vp-nav-height);font-size:14px;font-weight:500;color:var(--vp-c-text-1);transition:color .25s}.VPNavBarMenuLink.active[data-v-e56f3d57],.VPNavBarMenuLink[data-v-e56f3d57]:hover{color:var(--vp-c-brand-1)}.VPNavBarMenu[data-v-39714824]{display:none}@media (min-width: 768px){.VPNavBarMenu[data-v-39714824]{display:flex}}/*! @docsearch/css 3.9.0 | MIT License | © Algolia, Inc. and contributors | https://docsearch.algolia.com */:root{--docsearch-primary-color:#5468ff;--docsearch-text-color:#1c1e21;--docsearch-spacing:12px;--docsearch-icon-stroke-width:1.4;--docsearch-highlight-color:var(--docsearch-primary-color);--docsearch-muted-color:#969faf;--docsearch-container-background:rgba(101,108,133,.8);--docsearch-logo-color:#5468ff;--docsearch-modal-width:560px;--docsearch-modal-height:600px;--docsearch-modal-background:#f5f6f7;--docsearch-modal-shadow:inset 1px 1px 0 0 hsla(0,0%,100%,.5),0 3px 8px 0 #555a64;--docsearch-searchbox-height:56px;--docsearch-searchbox-background:#ebedf0;--docsearch-searchbox-focus-background:#fff;--docsearch-searchbox-shadow:inset 0 0 0 2px var(--docsearch-primary-color);--docsearch-hit-height:56px;--docsearch-hit-color:#444950;--docsearch-hit-active-color:#fff;--docsearch-hit-background:#fff;--docsearch-hit-shadow:0 1px 3px 0 #d4d9e1;--docsearch-key-gradient:linear-gradient(-225deg,#d5dbe4,#f8f8f8);--docsearch-key-shadow:inset 0 -2px 0 0 #cdcde6,inset 0 0 1px 1px #fff,0 1px 2px 1px rgba(30,35,90,.4);--docsearch-key-pressed-shadow:inset 0 -2px 0 0 #cdcde6,inset 0 0 1px 1px #fff,0 1px 1px 0 rgba(30,35,90,.4);--docsearch-footer-height:44px;--docsearch-footer-background:#fff;--docsearch-footer-shadow:0 -1px 0 0 #e0e3e8,0 -3px 6px 0 rgba(69,98,155,.12)}html[data-theme=dark]{--docsearch-text-color:#f5f6f7;--docsearch-container-background:rgba(9,10,17,.8);--docsearch-modal-background:#15172a;--docsearch-modal-shadow:inset 1px 1px 0 0 #2c2e40,0 3px 8px 0 #000309;--docsearch-searchbox-background:#090a11;--docsearch-searchbox-focus-background:#000;--docsearch-hit-color:#bec3c9;--docsearch-hit-shadow:none;--docsearch-hit-background:#090a11;--docsearch-key-gradient:linear-gradient(-26.5deg,#565872,#31355b);--docsearch-key-shadow:inset 0 -2px 0 0 #282d55,inset 0 0 1px 1px #51577d,0 2px 2px 0 rgba(3,4,9,.3);--docsearch-key-pressed-shadow:inset 0 -2px 0 0 #282d55,inset 0 0 1px 1px #51577d,0 1px 1px 0 #0304094d;--docsearch-footer-background:#1e2136;--docsearch-footer-shadow:inset 0 1px 0 0 rgba(73,76,106,.5),0 -4px 8px 0 rgba(0,0,0,.2);--docsearch-logo-color:#fff;--docsearch-muted-color:#7f8497}.DocSearch-Button{align-items:center;background:var(--docsearch-searchbox-background);border:0;border-radius:40px;color:var(--docsearch-muted-color);cursor:pointer;display:flex;font-weight:500;height:36px;justify-content:space-between;margin:0 0 0 16px;padding:0 8px;-webkit-user-select:none;user-select:none}.DocSearch-Button:active,.DocSearch-Button:focus,.DocSearch-Button:hover{background:var(--docsearch-searchbox-focus-background);box-shadow:var(--docsearch-searchbox-shadow);color:var(--docsearch-text-color);outline:none}.DocSearch-Button-Container{align-items:center;display:flex}.DocSearch-Search-Icon{stroke-width:1.6}.DocSearch-Button .DocSearch-Search-Icon{color:var(--docsearch-text-color)}.DocSearch-Button-Placeholder{font-size:1rem;padding:0 12px 0 6px}.DocSearch-Button-Keys{display:flex;min-width:calc(40px + .8em)}.DocSearch-Button-Key{align-items:center;background:var(--docsearch-key-gradient);border:0;border-radius:3px;box-shadow:var(--docsearch-key-shadow);color:var(--docsearch-muted-color);display:flex;height:18px;justify-content:center;margin-right:.4em;padding:0 0 2px;position:relative;top:-1px;transition-duration:.1s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);width:20px}@media (prefers-reduced-motion){.DocSearch-Button-Key{transition:none}}.DocSearch-Button-Key--pressed{box-shadow:var(--docsearch-key-pressed-shadow);transform:translate3d(0,1px,0)}@media (max-width:768px){.DocSearch-Button-Keys,.DocSearch-Button-Placeholder{display:none}}.DocSearch--active{overflow:hidden!important}.DocSearch-Container,.DocSearch-Container *{box-sizing:border-box}.DocSearch-Container{background-color:var(--docsearch-container-background);height:100vh;left:0;position:fixed;top:0;width:100vw;z-index:200}.DocSearch-Container a{text-decoration:none}.DocSearch-Link{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;border:0;color:var(--docsearch-highlight-color);cursor:pointer;font:inherit;margin:0;padding:0}.DocSearch-Modal{background:var(--docsearch-modal-background);border-radius:6px;box-shadow:var(--docsearch-modal-shadow);flex-direction:column;margin:60px auto auto;max-width:var(--docsearch-modal-width);position:relative}.DocSearch-SearchBar{display:flex;padding:var(--docsearch-spacing) var(--docsearch-spacing) 0}.DocSearch-Form{align-items:center;background:var(--docsearch-searchbox-focus-background);border-radius:4px;box-shadow:var(--docsearch-searchbox-shadow);display:flex;height:var(--docsearch-searchbox-height);margin:0;padding:0 var(--docsearch-spacing);position:relative;width:100%}.DocSearch-Input{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:transparent;border:0;color:var(--docsearch-text-color);flex:1;font:inherit;font-size:1.2em;height:100%;outline:none;padding:0 0 0 8px;width:80%}.DocSearch-Input::placeholder{color:var(--docsearch-muted-color);opacity:1}.DocSearch-Input::-webkit-search-cancel-button,.DocSearch-Input::-webkit-search-decoration,.DocSearch-Input::-webkit-search-results-button,.DocSearch-Input::-webkit-search-results-decoration{display:none}.DocSearch-LoadingIndicator,.DocSearch-MagnifierLabel,.DocSearch-Reset{margin:0;padding:0}.DocSearch-MagnifierLabel,.DocSearch-Reset{align-items:center;color:var(--docsearch-highlight-color);display:flex;justify-content:center}.DocSearch-Container--Stalled .DocSearch-MagnifierLabel,.DocSearch-LoadingIndicator{display:none}.DocSearch-Container--Stalled .DocSearch-LoadingIndicator{align-items:center;color:var(--docsearch-highlight-color);display:flex;justify-content:center}@media screen and (prefers-reduced-motion:reduce){.DocSearch-Reset{animation:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;border:0;border-radius:50%;color:var(--docsearch-icon-color);cursor:pointer;right:0;stroke-width:var(--docsearch-icon-stroke-width)}}.DocSearch-Reset{animation:fade-in .1s ease-in forwards;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;border:0;border-radius:50%;color:var(--docsearch-icon-color);cursor:pointer;padding:2px;right:0;stroke-width:var(--docsearch-icon-stroke-width)}.DocSearch-Reset[hidden]{display:none}.DocSearch-Reset:hover{color:var(--docsearch-highlight-color)}.DocSearch-LoadingIndicator svg,.DocSearch-MagnifierLabel svg{height:24px;width:24px}.DocSearch-Cancel{display:none}.DocSearch-Dropdown{max-height:calc(var(--docsearch-modal-height) - var(--docsearch-searchbox-height) - var(--docsearch-spacing) - var(--docsearch-footer-height));min-height:var(--docsearch-spacing);overflow-y:auto;overflow-y:overlay;padding:0 var(--docsearch-spacing);scrollbar-color:var(--docsearch-muted-color) var(--docsearch-modal-background);scrollbar-width:thin}.DocSearch-Dropdown::-webkit-scrollbar{width:12px}.DocSearch-Dropdown::-webkit-scrollbar-track{background:transparent}.DocSearch-Dropdown::-webkit-scrollbar-thumb{background-color:var(--docsearch-muted-color);border:3px solid var(--docsearch-modal-background);border-radius:20px}.DocSearch-Dropdown ul{list-style:none;margin:0;padding:0}.DocSearch-Label{font-size:.75em;line-height:1.6em}.DocSearch-Help,.DocSearch-Label{color:var(--docsearch-muted-color)}.DocSearch-Help{font-size:.9em;margin:0;-webkit-user-select:none;user-select:none}.DocSearch-Title{font-size:1.2em}.DocSearch-Logo a{display:flex}.DocSearch-Logo svg{color:var(--docsearch-logo-color);margin-left:8px}.DocSearch-Hits:last-of-type{margin-bottom:24px}.DocSearch-Hits mark{background:none;color:var(--docsearch-highlight-color)}.DocSearch-HitsFooter{color:var(--docsearch-muted-color);display:flex;font-size:.85em;justify-content:center;margin-bottom:var(--docsearch-spacing);padding:var(--docsearch-spacing)}.DocSearch-HitsFooter a{border-bottom:1px solid;color:inherit}.DocSearch-Hit{border-radius:4px;display:flex;padding-bottom:4px;position:relative;scroll-margin-top:40px}@media screen and (prefers-reduced-motion:reduce){.DocSearch-Hit--deleting{transition:none}}.DocSearch-Hit--deleting{opacity:0;transition:all .25s linear}@media screen and (prefers-reduced-motion:reduce){.DocSearch-Hit--favoriting{transition:none}}.DocSearch-Hit--favoriting{transform:scale(0);transform-origin:top center;transition:all .25s linear;transition-delay:.25s}.DocSearch-Hit a{background:var(--docsearch-hit-background);border-radius:4px;box-shadow:var(--docsearch-hit-shadow);display:block;padding-left:var(--docsearch-spacing);width:100%}.DocSearch-Hit-source{background:var(--docsearch-modal-background);color:var(--docsearch-highlight-color);font-size:.85em;font-weight:600;line-height:32px;margin:0 -4px;padding:8px 4px 0;position:sticky;top:0;z-index:10}.DocSearch-Hit-Tree{color:var(--docsearch-muted-color);height:var(--docsearch-hit-height);opacity:.5;stroke-width:var(--docsearch-icon-stroke-width);width:24px}.DocSearch-Hit[aria-selected=true] a{background-color:var(--docsearch-highlight-color)}.DocSearch-Hit[aria-selected=true] mark{text-decoration:underline}.DocSearch-Hit-Container{align-items:center;color:var(--docsearch-hit-color);display:flex;flex-direction:row;height:var(--docsearch-hit-height);padding:0 var(--docsearch-spacing) 0 0}.DocSearch-Hit-icon{height:20px;width:20px}.DocSearch-Hit-action,.DocSearch-Hit-icon{color:var(--docsearch-muted-color);stroke-width:var(--docsearch-icon-stroke-width)}.DocSearch-Hit-action{align-items:center;display:flex;height:22px;width:22px}.DocSearch-Hit-action svg{display:block;height:18px;width:18px}.DocSearch-Hit-action+.DocSearch-Hit-action{margin-left:6px}.DocSearch-Hit-action-button{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;border:0;border-radius:50%;color:inherit;cursor:pointer;padding:2px}svg.DocSearch-Hit-Select-Icon{display:none}.DocSearch-Hit[aria-selected=true] .DocSearch-Hit-Select-Icon{display:block}.DocSearch-Hit-action-button:focus,.DocSearch-Hit-action-button:hover{background:#0003;transition:background-color .1s ease-in}@media screen and (prefers-reduced-motion:reduce){.DocSearch-Hit-action-button:focus,.DocSearch-Hit-action-button:hover{transition:none}}.DocSearch-Hit-action-button:focus path,.DocSearch-Hit-action-button:hover path{fill:#fff}.DocSearch-Hit-content-wrapper{display:flex;flex:1 1 auto;flex-direction:column;font-weight:500;justify-content:center;line-height:1.2em;margin:0 8px;overflow-x:hidden;position:relative;text-overflow:ellipsis;white-space:nowrap;width:80%}.DocSearch-Hit-title{font-size:.9em}.DocSearch-Hit-path{color:var(--docsearch-muted-color);font-size:.75em}.DocSearch-Hit[aria-selected=true] .DocSearch-Hit-Tree,.DocSearch-Hit[aria-selected=true] .DocSearch-Hit-action,.DocSearch-Hit[aria-selected=true] .DocSearch-Hit-icon,.DocSearch-Hit[aria-selected=true] .DocSearch-Hit-path,.DocSearch-Hit[aria-selected=true] .DocSearch-Hit-text,.DocSearch-Hit[aria-selected=true] .DocSearch-Hit-title,.DocSearch-Hit[aria-selected=true] mark{color:var(--docsearch-hit-active-color)!important}@media screen and (prefers-reduced-motion:reduce){.DocSearch-Hit-action-button:focus,.DocSearch-Hit-action-button:hover{background:#0003;transition:none}}.DocSearch-ErrorScreen,.DocSearch-NoResults,.DocSearch-StartScreen{font-size:.9em;margin:0 auto;padding:36px 0;text-align:center;width:80%}.DocSearch-Screen-Icon{color:var(--docsearch-muted-color);padding-bottom:12px}.DocSearch-NoResults-Prefill-List{display:inline-block;padding-bottom:24px;text-align:left}.DocSearch-NoResults-Prefill-List ul{display:inline-block;padding:8px 0 0}.DocSearch-NoResults-Prefill-List li{list-style-position:inside;list-style-type:"» "}.DocSearch-Prefill{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;border:0;border-radius:1em;color:var(--docsearch-highlight-color);cursor:pointer;display:inline-block;font-size:1em;font-weight:700;padding:0}.DocSearch-Prefill:focus,.DocSearch-Prefill:hover{outline:none;text-decoration:underline}.DocSearch-Footer{align-items:center;background:var(--docsearch-footer-background);border-radius:0 0 8px 8px;box-shadow:var(--docsearch-footer-shadow);display:flex;flex-direction:row-reverse;flex-shrink:0;height:var(--docsearch-footer-height);justify-content:space-between;padding:0 var(--docsearch-spacing);position:relative;-webkit-user-select:none;user-select:none;width:100%;z-index:300}.DocSearch-Commands{color:var(--docsearch-muted-color);display:flex;list-style:none;margin:0;padding:0}.DocSearch-Commands li{align-items:center;display:flex}.DocSearch-Commands li:not(:last-of-type){margin-right:.8em}.DocSearch-Commands-Key{align-items:center;background:var(--docsearch-key-gradient);border:0;border-radius:2px;box-shadow:var(--docsearch-key-shadow);color:var(--docsearch-muted-color);display:flex;height:18px;justify-content:center;margin-right:.4em;padding:0 0 1px;width:20px}.DocSearch-VisuallyHiddenForAccessibility{clip:rect(0 0 0 0);clip-path:inset(50%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}@media (max-width:768px){:root{--docsearch-spacing:10px;--docsearch-footer-height:40px}.DocSearch-Dropdown{height:100%}.DocSearch-Container{height:100vh;height:-webkit-fill-available;height:calc(var(--docsearch-vh, 1vh)*100);position:absolute}.DocSearch-Footer{border-radius:0;bottom:0;position:absolute}.DocSearch-Hit-content-wrapper{display:flex;position:relative;width:80%}.DocSearch-Modal{border-radius:0;box-shadow:none;height:100vh;height:-webkit-fill-available;height:calc(var(--docsearch-vh, 1vh)*100);margin:0;max-width:100%;width:100%}.DocSearch-Dropdown{max-height:calc(var(--docsearch-vh, 1vh)*100 - var(--docsearch-searchbox-height) - var(--docsearch-spacing) - var(--docsearch-footer-height))}.DocSearch-Cancel{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;border:0;color:var(--docsearch-highlight-color);cursor:pointer;display:inline-block;flex:none;font:inherit;font-size:1em;font-weight:500;margin-left:var(--docsearch-spacing);outline:none;overflow:hidden;padding:0;-webkit-user-select:none;user-select:none;white-space:nowrap}.DocSearch-Commands,.DocSearch-Hit-Tree{display:none}}@keyframes fade-in{0%{opacity:0}to{opacity:1}}[class*=DocSearch]{--docsearch-primary-color: var(--vp-c-brand-1);--docsearch-highlight-color: var(--docsearch-primary-color);--docsearch-text-color: var(--vp-c-text-1);--docsearch-muted-color: var(--vp-c-text-2);--docsearch-searchbox-shadow: none;--docsearch-searchbox-background: transparent;--docsearch-searchbox-focus-background: transparent;--docsearch-key-gradient: transparent;--docsearch-key-shadow: none;--docsearch-modal-background: var(--vp-c-bg-soft);--docsearch-footer-background: var(--vp-c-bg)}.dark [class*=DocSearch]{--docsearch-modal-shadow: none;--docsearch-footer-shadow: none;--docsearch-logo-color: var(--vp-c-text-2);--docsearch-hit-background: var(--vp-c-default-soft);--docsearch-hit-color: var(--vp-c-text-2);--docsearch-hit-shadow: none}.DocSearch-Button{display:flex;justify-content:center;align-items:center;margin:0;padding:0;width:48px;height:55px;background:transparent;transition:border-color .25s}.DocSearch-Button:hover{background:transparent}.DocSearch-Button:focus{outline:1px dotted;outline:5px auto -webkit-focus-ring-color}.DocSearch-Button-Key--pressed{transform:none;box-shadow:none}.DocSearch-Button:focus:not(:focus-visible){outline:none!important}@media (min-width: 768px){.DocSearch-Button{justify-content:flex-start;border:1px solid transparent;border-radius:8px;padding:0 10px 0 12px;width:100%;height:40px;background-color:var(--vp-c-bg-alt)}.DocSearch-Button:hover{border-color:var(--vp-c-brand-1);background:var(--vp-c-bg-alt)}}.DocSearch-Button .DocSearch-Button-Container{display:flex;align-items:center}.DocSearch-Button .DocSearch-Search-Icon{position:relative;width:16px;height:16px;color:var(--vp-c-text-1);fill:currentColor;transition:color .5s}.DocSearch-Button:hover .DocSearch-Search-Icon{color:var(--vp-c-text-1)}@media (min-width: 768px){.DocSearch-Button .DocSearch-Search-Icon{top:1px;margin-right:8px;width:14px;height:14px;color:var(--vp-c-text-2)}}.DocSearch-Button .DocSearch-Button-Placeholder{display:none;margin-top:2px;padding:0 16px 0 0;font-size:13px;font-weight:500;color:var(--vp-c-text-2);transition:color .5s}.DocSearch-Button:hover .DocSearch-Button-Placeholder{color:var(--vp-c-text-1)}@media (min-width: 768px){.DocSearch-Button .DocSearch-Button-Placeholder{display:inline-block}}.DocSearch-Button .DocSearch-Button-Keys{direction:ltr;display:none;min-width:auto}@media (min-width: 768px){.DocSearch-Button .DocSearch-Button-Keys{display:flex;align-items:center}}.DocSearch-Button .DocSearch-Button-Key{display:block;margin:2px 0 0;border:1px solid var(--vp-c-divider);border-right:none;border-radius:4px 0 0 4px;padding-left:6px;min-width:0;width:auto;height:22px;line-height:22px;font-family:var(--vp-font-family-base);font-size:12px;font-weight:500;transition:color .5s,border-color .5s}.DocSearch-Button .DocSearch-Button-Key+.DocSearch-Button-Key{border-right:1px solid var(--vp-c-divider);border-left:none;border-radius:0 4px 4px 0;padding-left:2px;padding-right:6px}.DocSearch-Button .DocSearch-Button-Key:first-child{font-size:0!important}.DocSearch-Button .DocSearch-Button-Key:first-child:after{content:"Ctrl";font-size:12px;letter-spacing:normal;color:var(--docsearch-muted-color)}.mac .DocSearch-Button .DocSearch-Button-Key:first-child:after{content:"⌘"}.DocSearch-Button .DocSearch-Button-Key:first-child>*{display:none}.DocSearch-Search-Icon{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' stroke-width='1.6' viewBox='0 0 20 20'%3E%3Cpath fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' d='m14.386 14.386 4.088 4.088-4.088-4.088A7.533 7.533 0 1 1 3.733 3.733a7.533 7.533 0 0 1 10.653 10.653z'/%3E%3C/svg%3E")}.VPNavBarSearch{display:flex;align-items:center}@media (min-width: 768px){.VPNavBarSearch{flex-grow:1;padding-left:24px}}@media (min-width: 960px){.VPNavBarSearch{padding-left:32px}}.dark .DocSearch-Footer{border-top:1px solid var(--vp-c-divider)}.DocSearch-Form{border:1px solid var(--vp-c-brand-1);background-color:var(--vp-c-white)}.dark .DocSearch-Form{background-color:var(--vp-c-default-soft)}.DocSearch-Screen-Icon>svg{margin:auto}.VPNavBarSocialLinks[data-v-0394ad82]{display:none}@media (min-width: 1280px){.VPNavBarSocialLinks[data-v-0394ad82]{display:flex;align-items:center}}.title[data-v-1e38c6bc]{display:flex;align-items:center;border-bottom:1px solid transparent;width:100%;height:var(--vp-nav-height);font-size:16px;font-weight:600;color:var(--vp-c-text-1);transition:opacity .25s}@media (min-width: 960px){.title[data-v-1e38c6bc]{flex-shrink:0}.VPNavBarTitle.has-sidebar .title[data-v-1e38c6bc]{border-bottom-color:var(--vp-c-divider)}}[data-v-1e38c6bc] .logo{margin-right:8px;height:var(--vp-nav-logo-height)}.VPNavBarTranslations[data-v-88af2de4]{display:none}@media (min-width: 1280px){.VPNavBarTranslations[data-v-88af2de4]{display:flex;align-items:center}}.title[data-v-88af2de4]{padding:0 24px 0 12px;line-height:32px;font-size:14px;font-weight:700;color:var(--vp-c-text-1)}.VPNavBar[data-v-0ae64501]{position:relative;height:var(--vp-nav-height);pointer-events:none;white-space:nowrap;transition:background-color .25s}.VPNavBar.screen-open[data-v-0ae64501]{transition:none;background-color:var(--vp-nav-bg-color);border-bottom:1px solid var(--vp-c-divider)}.VPNavBar[data-v-0ae64501]:not(.home){background-color:var(--vp-nav-bg-color)}@media (min-width: 960px){.VPNavBar[data-v-0ae64501]:not(.home){background-color:transparent}.VPNavBar[data-v-0ae64501]:not(.has-sidebar):not(.home.top){background-color:var(--vp-nav-bg-color)}}.wrapper[data-v-0ae64501]{padding:0 8px 0 24px}@media (min-width: 768px){.wrapper[data-v-0ae64501]{padding:0 32px}}@media (min-width: 960px){.VPNavBar.has-sidebar .wrapper[data-v-0ae64501]{padding:0}}.container[data-v-0ae64501]{display:flex;justify-content:space-between;margin:0 auto;max-width:calc(var(--vp-layout-max-width) - 64px);height:var(--vp-nav-height);pointer-events:none}.container>.title[data-v-0ae64501],.container>.content[data-v-0ae64501]{pointer-events:none}.container[data-v-0ae64501] *{pointer-events:auto}@media (min-width: 960px){.VPNavBar.has-sidebar .container[data-v-0ae64501]{max-width:100%}}.title[data-v-0ae64501]{flex-shrink:0;height:calc(var(--vp-nav-height) - 1px);transition:background-color .5s}@media (min-width: 960px){.VPNavBar.has-sidebar .title[data-v-0ae64501]{position:absolute;top:0;left:0;z-index:2;padding:0 32px;width:var(--vp-sidebar-width);height:var(--vp-nav-height);background-color:transparent}}@media (min-width: 1440px){.VPNavBar.has-sidebar .title[data-v-0ae64501]{padding-left:max(32px,calc((100% - (var(--vp-layout-max-width) - 64px)) / 2));width:calc((100% - (var(--vp-layout-max-width) - 64px)) / 2 + var(--vp-sidebar-width) - 32px)}}.content[data-v-0ae64501]{flex-grow:1}@media (min-width: 960px){.VPNavBar.has-sidebar .content[data-v-0ae64501]{position:relative;z-index:1;padding-right:32px;padding-left:var(--vp-sidebar-width)}}@media (min-width: 1440px){.VPNavBar.has-sidebar .content[data-v-0ae64501]{padding-right:calc((100vw - var(--vp-layout-max-width)) / 2 + 32px);padding-left:calc((100vw - var(--vp-layout-max-width)) / 2 + var(--vp-sidebar-width))}}.content-body[data-v-0ae64501]{display:flex;justify-content:flex-end;align-items:center;height:var(--vp-nav-height);transition:background-color .5s}@media (min-width: 960px){.VPNavBar:not(.home.top) .content-body[data-v-0ae64501]{position:relative;background-color:var(--vp-nav-bg-color)}.VPNavBar:not(.has-sidebar):not(.home.top) .content-body[data-v-0ae64501]{background-color:transparent}}@media (max-width: 767px){.content-body[data-v-0ae64501]{column-gap:.5rem}}.menu+.translations[data-v-0ae64501]:before,.menu+.appearance[data-v-0ae64501]:before,.menu+.social-links[data-v-0ae64501]:before,.translations+.appearance[data-v-0ae64501]:before,.appearance+.social-links[data-v-0ae64501]:before{margin-right:8px;margin-left:8px;width:1px;height:24px;background-color:var(--vp-c-divider);content:""}.menu+.appearance[data-v-0ae64501]:before,.translations+.appearance[data-v-0ae64501]:before{margin-right:16px}.appearance+.social-links[data-v-0ae64501]:before{margin-left:16px}.social-links[data-v-0ae64501]{margin-right:-8px}.divider[data-v-0ae64501]{width:100%;height:1px}@media (min-width: 960px){.VPNavBar.has-sidebar .divider[data-v-0ae64501]{padding-left:var(--vp-sidebar-width)}}@media (min-width: 1440px){.VPNavBar.has-sidebar .divider[data-v-0ae64501]{padding-left:calc((100vw - var(--vp-layout-max-width)) / 2 + var(--vp-sidebar-width))}}.divider-line[data-v-0ae64501]{width:100%;height:1px;transition:background-color .5s}.VPNavBar:not(.home) .divider-line[data-v-0ae64501]{background-color:var(--vp-c-gutter)}@media (min-width: 960px){.VPNavBar:not(.home.top) .divider-line[data-v-0ae64501]{background-color:var(--vp-c-gutter)}.VPNavBar:not(.has-sidebar):not(.home.top) .divider[data-v-0ae64501]{background-color:var(--vp-c-gutter)}}.VPNavScreenAppearance[data-v-b44890b2]{display:flex;justify-content:space-between;align-items:center;border-radius:8px;padding:12px 14px 12px 16px;background-color:var(--vp-c-bg-soft)}.text[data-v-b44890b2]{line-height:24px;font-size:12px;font-weight:500;color:var(--vp-c-text-2)}.VPNavScreenMenuLink[data-v-df37e6dd]{display:block;border-bottom:1px solid var(--vp-c-divider);padding:12px 0 11px;line-height:24px;font-size:14px;font-weight:500;color:var(--vp-c-text-1);transition:border-color .25s,color .25s}.VPNavScreenMenuLink[data-v-df37e6dd]:hover{color:var(--vp-c-brand-1)}.VPNavScreenMenuGroupLink[data-v-3e9c20e4]{display:block;margin-left:12px;line-height:32px;font-size:14px;font-weight:400;color:var(--vp-c-text-1);transition:color .25s}.VPNavScreenMenuGroupLink[data-v-3e9c20e4]:hover{color:var(--vp-c-brand-1)}.VPNavScreenMenuGroupSection[data-v-4b7a798b]{display:block}.title[data-v-4b7a798b]{line-height:32px;font-size:13px;font-weight:700;color:var(--vp-c-text-2);transition:color .25s}.VPNavScreenMenuGroup[data-v-956364f9]{border-bottom:1px solid var(--vp-c-divider);height:48px;overflow:hidden;transition:border-color .5s}.VPNavScreenMenuGroup .items[data-v-956364f9]{visibility:hidden}.VPNavScreenMenuGroup.open .items[data-v-956364f9]{visibility:visible}.VPNavScreenMenuGroup.open[data-v-956364f9]{padding-bottom:10px;height:auto}.VPNavScreenMenuGroup.open .button[data-v-956364f9]{padding-bottom:6px;color:var(--vp-c-brand-1)}.VPNavScreenMenuGroup.open .button-icon[data-v-956364f9]{transform:rotate(45deg)}.button[data-v-956364f9]{display:flex;justify-content:space-between;align-items:center;padding:12px 4px 11px 0;width:100%;line-height:24px;font-size:14px;font-weight:500;color:var(--vp-c-text-1);transition:color .25s}.button[data-v-956364f9]:hover{color:var(--vp-c-brand-1)}.button-icon[data-v-956364f9]{transition:transform .25s}.group[data-v-956364f9]:first-child{padding-top:0}.group+.group[data-v-956364f9],.group+.item[data-v-956364f9]{padding-top:4px}.VPNavScreenTranslations[data-v-858fe1a4]{height:24px;overflow:hidden}.VPNavScreenTranslations.open[data-v-858fe1a4]{height:auto}.title[data-v-858fe1a4]{display:flex;align-items:center;font-size:14px;font-weight:500;color:var(--vp-c-text-1)}.icon[data-v-858fe1a4]{font-size:16px}.icon.lang[data-v-858fe1a4]{margin-right:8px}.icon.chevron[data-v-858fe1a4]{margin-left:4px}.list[data-v-858fe1a4]{padding:4px 0 0 24px}.link[data-v-858fe1a4]{line-height:32px;font-size:13px;color:var(--vp-c-text-1)}.VPNavScreen[data-v-f2779853]{position:fixed;top:calc(var(--vp-nav-height) + var(--vp-layout-top-height, 0px));right:0;bottom:0;left:0;padding:0 32px;width:100%;background-color:var(--vp-nav-screen-bg-color);overflow-y:auto;transition:background-color .25s;pointer-events:auto}.VPNavScreen.fade-enter-active[data-v-f2779853],.VPNavScreen.fade-leave-active[data-v-f2779853]{transition:opacity .25s}.VPNavScreen.fade-enter-active .container[data-v-f2779853],.VPNavScreen.fade-leave-active .container[data-v-f2779853]{transition:transform .25s ease}.VPNavScreen.fade-enter-from[data-v-f2779853],.VPNavScreen.fade-leave-to[data-v-f2779853]{opacity:0}.VPNavScreen.fade-enter-from .container[data-v-f2779853],.VPNavScreen.fade-leave-to .container[data-v-f2779853]{transform:translateY(-8px)}@media (min-width: 768px){.VPNavScreen[data-v-f2779853]{display:none}}.container[data-v-f2779853]{margin:0 auto;padding:24px 0 96px;max-width:288px}.menu+.translations[data-v-f2779853],.menu+.appearance[data-v-f2779853],.translations+.appearance[data-v-f2779853]{margin-top:24px}.menu+.social-links[data-v-f2779853]{margin-top:16px}.appearance+.social-links[data-v-f2779853]{margin-top:16px}.VPNav[data-v-ae24b3ad]{position:relative;top:var(--vp-layout-top-height, 0px);left:0;z-index:var(--vp-z-index-nav);width:100%;pointer-events:none;transition:background-color .5s}@media (min-width: 960px){.VPNav[data-v-ae24b3ad]{position:fixed}}.VPSidebarItem.level-0[data-v-d81de50c]{padding-bottom:24px}.VPSidebarItem.collapsed.level-0[data-v-d81de50c]{padding-bottom:10px}.item[data-v-d81de50c]{position:relative;display:flex;width:100%}.VPSidebarItem.collapsible>.item[data-v-d81de50c]{cursor:pointer}.indicator[data-v-d81de50c]{position:absolute;top:6px;bottom:6px;left:-17px;width:2px;border-radius:2px;transition:background-color .25s}.VPSidebarItem.level-2.is-active>.item>.indicator[data-v-d81de50c],.VPSidebarItem.level-3.is-active>.item>.indicator[data-v-d81de50c],.VPSidebarItem.level-4.is-active>.item>.indicator[data-v-d81de50c],.VPSidebarItem.level-5.is-active>.item>.indicator[data-v-d81de50c]{background-color:var(--vp-c-brand-1)}.link[data-v-d81de50c]{display:flex;align-items:center;flex-grow:1}.text[data-v-d81de50c]{flex-grow:1;padding:4px 0;line-height:24px;font-size:14px;transition:color .25s}.VPSidebarItem.level-0 .text[data-v-d81de50c]{font-weight:700;color:var(--vp-c-text-1)}.VPSidebarItem.level-1 .text[data-v-d81de50c],.VPSidebarItem.level-2 .text[data-v-d81de50c],.VPSidebarItem.level-3 .text[data-v-d81de50c],.VPSidebarItem.level-4 .text[data-v-d81de50c],.VPSidebarItem.level-5 .text[data-v-d81de50c]{font-weight:500;color:var(--vp-c-text-2)}.VPSidebarItem.level-0.is-link>.item>.link:hover .text[data-v-d81de50c],.VPSidebarItem.level-1.is-link>.item>.link:hover .text[data-v-d81de50c],.VPSidebarItem.level-2.is-link>.item>.link:hover .text[data-v-d81de50c],.VPSidebarItem.level-3.is-link>.item>.link:hover .text[data-v-d81de50c],.VPSidebarItem.level-4.is-link>.item>.link:hover .text[data-v-d81de50c],.VPSidebarItem.level-5.is-link>.item>.link:hover .text[data-v-d81de50c]{color:var(--vp-c-brand-1)}.VPSidebarItem.level-0.has-active>.item>.text[data-v-d81de50c],.VPSidebarItem.level-1.has-active>.item>.text[data-v-d81de50c],.VPSidebarItem.level-2.has-active>.item>.text[data-v-d81de50c],.VPSidebarItem.level-3.has-active>.item>.text[data-v-d81de50c],.VPSidebarItem.level-4.has-active>.item>.text[data-v-d81de50c],.VPSidebarItem.level-5.has-active>.item>.text[data-v-d81de50c],.VPSidebarItem.level-0.has-active>.item>.link>.text[data-v-d81de50c],.VPSidebarItem.level-1.has-active>.item>.link>.text[data-v-d81de50c],.VPSidebarItem.level-2.has-active>.item>.link>.text[data-v-d81de50c],.VPSidebarItem.level-3.has-active>.item>.link>.text[data-v-d81de50c],.VPSidebarItem.level-4.has-active>.item>.link>.text[data-v-d81de50c],.VPSidebarItem.level-5.has-active>.item>.link>.text[data-v-d81de50c]{color:var(--vp-c-text-1)}.VPSidebarItem.level-0.is-active>.item .link>.text[data-v-d81de50c],.VPSidebarItem.level-1.is-active>.item .link>.text[data-v-d81de50c],.VPSidebarItem.level-2.is-active>.item .link>.text[data-v-d81de50c],.VPSidebarItem.level-3.is-active>.item .link>.text[data-v-d81de50c],.VPSidebarItem.level-4.is-active>.item .link>.text[data-v-d81de50c],.VPSidebarItem.level-5.is-active>.item .link>.text[data-v-d81de50c]{color:var(--vp-c-brand-1)}.caret[data-v-d81de50c]{display:flex;justify-content:center;align-items:center;margin-right:-7px;width:32px;height:32px;color:var(--vp-c-text-3);cursor:pointer;transition:color .25s;flex-shrink:0}.item:hover .caret[data-v-d81de50c]{color:var(--vp-c-text-2)}.item:hover .caret[data-v-d81de50c]:hover{color:var(--vp-c-text-1)}.caret-icon[data-v-d81de50c]{font-size:18px;transform:rotate(90deg);transition:transform .25s}.VPSidebarItem.collapsed .caret-icon[data-v-d81de50c]{transform:rotate(0)}.VPSidebarItem.level-1 .items[data-v-d81de50c],.VPSidebarItem.level-2 .items[data-v-d81de50c],.VPSidebarItem.level-3 .items[data-v-d81de50c],.VPSidebarItem.level-4 .items[data-v-d81de50c],.VPSidebarItem.level-5 .items[data-v-d81de50c]{border-left:1px solid var(--vp-c-divider);padding-left:16px}.VPSidebarItem.collapsed .items[data-v-d81de50c]{display:none}.no-transition[data-v-8d50c081] .caret-icon{transition:none}.group+.group[data-v-8d50c081]{border-top:1px solid var(--vp-c-divider);padding-top:10px}@media (min-width: 960px){.group[data-v-8d50c081]{padding-top:10px;width:calc(var(--vp-sidebar-width) - 64px)}}.VPSidebar[data-v-cbecfdd4]{position:fixed;top:var(--vp-layout-top-height, 0px);bottom:0;left:0;z-index:var(--vp-z-index-sidebar);padding:32px 32px 96px;width:calc(100vw - 64px);max-width:320px;background-color:var(--vp-sidebar-bg-color);opacity:0;box-shadow:var(--vp-c-shadow-3);overflow-x:hidden;overflow-y:auto;transform:translate(-100%);transition:opacity .5s,transform .25s ease;overscroll-behavior:contain}.VPSidebar.open[data-v-cbecfdd4]{opacity:1;visibility:visible;transform:translate(0);transition:opacity .25s,transform .5s cubic-bezier(.19,1,.22,1)}.dark .VPSidebar[data-v-cbecfdd4]{box-shadow:var(--vp-shadow-1)}@media (min-width: 960px){.VPSidebar[data-v-cbecfdd4]{padding-top:var(--vp-nav-height);width:var(--vp-sidebar-width);max-width:100%;background-color:var(--vp-sidebar-bg-color);opacity:1;visibility:visible;box-shadow:none;transform:translate(0)}}@media (min-width: 1440px){.VPSidebar[data-v-cbecfdd4]{padding-left:max(32px,calc((100% - (var(--vp-layout-max-width) - 64px)) / 2));width:calc((100% - (var(--vp-layout-max-width) - 64px)) / 2 + var(--vp-sidebar-width) - 32px)}}@media (min-width: 960px){.curtain[data-v-cbecfdd4]{position:sticky;top:-64px;left:0;z-index:1;margin-top:calc(var(--vp-nav-height) * -1);margin-right:-32px;margin-left:-32px;height:var(--vp-nav-height);background-color:var(--vp-sidebar-bg-color)}}.nav[data-v-cbecfdd4]{outline:0}.VPSkipLink[data-v-0b0ada53]{top:8px;left:8px;padding:8px 16px;z-index:999;border-radius:8px;font-size:12px;font-weight:700;text-decoration:none;color:var(--vp-c-brand-1);box-shadow:var(--vp-shadow-3);background-color:var(--vp-c-bg)}.VPSkipLink[data-v-0b0ada53]:focus{height:auto;width:auto;clip:auto;clip-path:none}@media (min-width: 1280px){.VPSkipLink[data-v-0b0ada53]{top:14px;left:16px}}.Layout[data-v-5e06b97a]{display:flex;flex-direction:column;min-height:100vh}.box[data-v-520722c6]{display:flex;flex-wrap:wrap;max-width:100%}.ext-item[data-v-520722c6]{margin:4px 8px}h2[data-v-520722c6]{margin-bottom:8px}.command-preview[data-v-520722c6]{padding:1.2rem;background:var(--vp-c-divider);border-radius:8px;word-break:break-all;font-family:monospace;overflow-wrap:break-word}.pre[data-v-520722c6]{white-space:pre-wrap;word-break:break-word;overflow-wrap:break-word}.option-line[data-v-520722c6]{padding:4px 8px}.option-title[data-v-520722c6]{margin:4px 8px 4px 4px;font-weight:700}select[data-v-520722c6]{border-radius:4px;border:1px solid var(--vp-c-divider);padding:0 4px;width:300px}.my-btn[data-v-520722c6]{color:var(--vp-button-alt-text);background-color:var(--vp-button-alt-bg);border-radius:8px;padding:0 16px;line-height:32px;font-size:14px;display:inline-block;text-align:center;font-weight:600;margin-right:8px;white-space:nowrap;transition:color .25s,border-color .25s,background-color .25s;cursor:pointer;border:1px solid var(--vp-button-alt-border)}.my-btn[data-v-520722c6]:hover{border-color:var(--vp-button-alt-hover-border);color:var(--vp-button-alt-hover-text);background-color:var(--vp-button-alt-hover-bg)}.my-btn[data-v-520722c6]:active{border-color:var(--vp-button-alt-active-border);color:var(--vp-button-alt-active-text);background-color:var(--vp-button-alt-active-bg)}.textarea[data-v-520722c6]{border:1px solid var(--vp-c-divider);border-radius:4px;width:calc(100% - 12px);padding:4px 8px}.input[data-v-520722c6]{display:block;border:1px solid var(--vp-c-divider);border-radius:4px;width:100%;padding:4px 8px}.command-container[data-v-520722c6]{margin-bottom:24px}.modal-button[data-v-520722c6]{padding:4px 8px;border-radius:4px;border-color:var(--vp-button-alt-border);color:var(--vp-button-alt-text);background-color:var(--vp-button-alt-bg)}.modal-button[data-v-520722c6]:hover{border-color:var(--vp-button-alt-hover-border);color:var(--vp-button-alt-hover-text);background-color:var(--vp-button-alt-hover-bg)}.modal-button[data-v-520722c6]:active{border-color:var(--vp-button-alt-active-border);color:var(--vp-button-alt-active-text);background-color:var(--vp-button-alt-active-bg)}.searchinput{border:1px solid var(--vp-c-divider)} diff --git a/assets/zh_contributing_index.md.7JN5xgrv.js b/assets/zh_contributing_index.md.7JN5xgrv.js new file mode 100644 index 00000000..e2617c09 --- /dev/null +++ b/assets/zh_contributing_index.md.7JN5xgrv.js @@ -0,0 +1 @@ +import{_ as a,c as i,o as l,af as o}from"./chunks/framework.PeLcR_tw.js";const m=JSON.parse('{"title":"贡献指南","description":"","frontmatter":{},"headers":[],"relativePath":"zh/contributing/index.md","filePath":"zh/contributing/index.md"}'),r={name:"zh/contributing/index.md"};function n(t,e,c,d,s,h){return l(),i("div",null,e[0]||(e[0]=[o('

贡献指南

感谢你能够看到这里,本项目非常欢迎你的贡献!

贡献方法

如果你有代码或文档想要贡献,需要先了解以下内容。

  1. 你要贡献什么类型的代码?(新扩展、修复 Bug、安全问题、项目框架优化、文档)
  2. 如果你贡献了新文件或新片段,你的代码是否经过 php-cs-fixerphpstan 的检查?
  3. 在贡献代码前是否充分阅读了 开发指南

如果你可以回答以上问题,并已经对代码做出了修改,可以及时在项目 GitHub 仓库发起 Pull Request。待代码审查完毕后,可根据建议修改代码,或直接合并到主分支。

贡献类型

本项目主要用途是编译静态链接的 PHP 二进制,基于 symfony/console 编写了命令行处理功能。在开发之前,如果你对它不够熟悉, 可以先查看 symfony/console 文档

安全问题

因为本项目基本上是属于本地运行的 PHP 项目,一般来说不会存在远程攻击行为。但如果你发现了此类问题,请不要在 GitHub 仓库提交 PR 或 Issue, 你需要通过 邮件 的方式联系项目维护者(crazywhalecc)。

修复 Bug

修复 Bug 一般不涉及项目结构和框架的修改,所以如果你可以定位到错误代码并直接修复它,请直接提交 PR。

新扩展

对于添加一个新扩展来说,你需要先了解一些本项目的基本结构,以及如何根据现有的逻辑添加新扩展。在本页的下一章节将会详细介绍。 总的来说,你需要:

  1. 评估扩展是否可以内联编译到 PHP 中。
  2. 评估扩展的依赖库(如果有)是否可以静态编译。
  3. 写出扩展的依赖库在不同平台编译命令。
  4. 验证扩展及其依赖库能否与现有扩展和依赖库兼容。
  5. 验证扩展在 climicrofpmembed 几种 SAPI 中均正常工作。
  6. 编写文档,加入你的扩展。

项目框架优化

如果你已经熟悉 symfony/console 的工作原理,并同时要对项目的框架进行一些修改或优化,请先了解以下事情:

  1. 加入扩展不属于项目框架优化,但如果你在加入新的扩展时发现不得不优化框架,则需先对框架本身进行修改,然后再加入扩展。
  2. 对于一些大规模逻辑修改(例如涉及 LibraryBase、Extension 对象等的修改)时,建议先提交 Issue 或 Draft PR 进行讨论方案。
  3. 项目早期为纯中文开发项目,代码中存在一部分中文的注释。国际化项目后你可以提交 PR 将这些注释翻译为英语。
  4. 请不要在代码中提交包含较多无用的代码片段,例如大量未被使用的变量、方法、类、重复写了很多次的代码。
',18)]))}const f=a(r,[["render",n]]);export{m as __pageData,f as default}; diff --git a/assets/zh_contributing_index.md.7JN5xgrv.lean.js b/assets/zh_contributing_index.md.7JN5xgrv.lean.js new file mode 100644 index 00000000..dd42eff0 --- /dev/null +++ b/assets/zh_contributing_index.md.7JN5xgrv.lean.js @@ -0,0 +1 @@ +import{_ as a,c as i,o as l,af as o}from"./chunks/framework.PeLcR_tw.js";const m=JSON.parse('{"title":"贡献指南","description":"","frontmatter":{},"headers":[],"relativePath":"zh/contributing/index.md","filePath":"zh/contributing/index.md"}'),r={name:"zh/contributing/index.md"};function n(t,e,c,d,s,h){return l(),i("div",null,e[0]||(e[0]=[o("",18)]))}const f=a(r,[["render",n]]);export{m as __pageData,f as default}; diff --git a/assets/zh_contributing_index.md.BvgdahxO.js b/assets/zh_contributing_index.md.BvgdahxO.js deleted file mode 100644 index 196efca6..00000000 --- a/assets/zh_contributing_index.md.BvgdahxO.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as e,c as a,o,a1 as i}from"./chunks/framework.gjrnbxUT.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('

贡献指南

感谢你能够看到这里,本项目非常欢迎你的贡献!

贡献方法

如果你有代码或文档想要贡献,需要先了解以下内容。

  1. 你要贡献什么类型的代码?(新扩展、修复 Bug、安全问题、项目框架优化、文档)
  2. 如果你贡献了新文件或新片段,你的代码是否经过 php-cs-fixerphpstan 的检查?
  3. 在贡献代码前是否充分阅读了 开发指南

如果你可以回答以上问题,并已经对代码做出了修改,可以及时在项目 GitHub 仓库发起 Pull Request。待代码审查完毕后,可根据建议修改代码,或直接合并到主分支。

贡献类型

本项目主要用途是编译静态链接的 PHP 二进制,基于 symfony/console 编写了命令行处理功能。在开发之前,如果你对它不够熟悉, 可以先查看 symfony/console 文档

安全问题

因为本项目基本上是属于本地运行的 PHP 项目,一般来说不会存在远程攻击行为。但如果你发现了此类问题,请不要在 GitHub 仓库提交 PR 或 Issue, 你需要通过 邮件 的方式联系项目维护者(crazywhalecc)。

修复 Bug

修复 Bug 一般不涉及项目结构和框架的修改,所以如果你可以定位到错误代码并直接修复它,请直接提交 PR。

新扩展

对于添加一个新扩展来说,你需要先了解一些本项目的基本结构,以及如何根据现有的逻辑添加新扩展。在本页的下一章节将会详细介绍。 总的来说,你需要:

  1. 评估扩展是否可以内联编译到 PHP 中。
  2. 评估扩展的依赖库(如果有)是否可以静态编译。
  3. 写出扩展的依赖库在不同平台编译命令。
  4. 验证扩展及其依赖库能否与现有扩展和依赖库兼容。
  5. 验证扩展在 climicrofpmembed 几种 SAPI 中均正常工作。
  6. 编写文档,加入你的扩展。

项目框架优化

如果你已经熟悉 symfony/console 的工作原理,并同时要对项目的框架进行一些修改或优化,请先了解以下事情:

  1. 加入扩展不属于项目框架优化,但如果你在加入新的扩展时发现不得不优化框架,则需先对框架本身进行修改,然后再加入扩展。
  2. 对于一些大规模逻辑修改(例如涉及 LibraryBase、Extension 对象等的修改)时,建议先提交 Issue 或 Draft PR 进行讨论方案。
  3. 项目早期为纯中文开发项目,代码中存在一部分中文的注释。国际化项目后你可以提交 PR 将这些注释翻译为英语。
  4. 请不要在代码中提交包含较多无用的代码片段,例如大量未被使用的变量、方法、类、重复写了很多次的代码。
',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}; diff --git a/assets/zh_contributing_index.md.BvgdahxO.lean.js b/assets/zh_contributing_index.md.BvgdahxO.lean.js deleted file mode 100644 index 62186c0c..00000000 --- a/assets/zh_contributing_index.md.BvgdahxO.lean.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as e,c as a,o,a1 as i}from"./chunks/framework.gjrnbxUT.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}; diff --git a/assets/zh_develop_craft-yml.md.Crgeurk7.js b/assets/zh_develop_craft-yml.md.BerY4loY.js similarity index 93% rename from assets/zh_develop_craft-yml.md.Crgeurk7.js rename to assets/zh_develop_craft-yml.md.BerY4loY.js index 95993705..a68f305c 100644 --- a/assets/zh_develop_craft-yml.md.Crgeurk7.js +++ b/assets/zh_develop_craft-yml.md.BerY4loY.js @@ -1,4 +1,4 @@ -import{_ as s,c as i,o as a,a1 as n}from"./chunks/framework.gjrnbxUT.js";const g=JSON.parse('{"title":"craft.yml 配置","description":"","frontmatter":{"aside":false},"headers":[],"relativePath":"zh/develop/craft-yml.md","filePath":"zh/develop/craft-yml.md"}'),l={name:"zh/develop/craft-yml.md"},t=n(`

craft.yml 配置

yaml
# PHP version to build (default: 8.4)
+import{_ as i,c as a,o as n,af as l}from"./chunks/framework.PeLcR_tw.js";const c=JSON.parse('{"title":"craft.yml 配置","description":"","frontmatter":{"aside":false},"headers":[],"relativePath":"zh/develop/craft-yml.md","filePath":"zh/develop/craft-yml.md"}'),t={name:"zh/develop/craft-yml.md"};function p(h,s,e,k,r,d){return n(),a("div",null,s[0]||(s[0]=[l(`

craft.yml 配置

yaml
# PHP version to build (default: 8.4)
 php-version: 8.4
 # [REQUIRED] Static PHP extensions to build (list or comma-separated are both accepted)
 extensions: bcmath,fileinfo,phar,zlib,sodium,posix,pcntl
@@ -62,4 +62,4 @@ import{_ as s,c as i,o as a,a1 as n}from"./chunks/framework.gjrnbxUT.js";const g
 # Extra environment variables
 extra-env:
   # e.g. Use github token to avoid rate limit
-  GITHUB_TOKEN: your-github-token
`,2),p=[t];function e(h,k,r,d,o,c){return a(),i("div",null,p)}const y=s(l,[["render",e]]);export{g as __pageData,y as default}; + GITHUB_TOKEN: your-github-token
`,2)]))}const E=i(t,[["render",p]]);export{c as __pageData,E as default}; diff --git a/assets/zh_develop_craft-yml.md.BerY4loY.lean.js b/assets/zh_develop_craft-yml.md.BerY4loY.lean.js new file mode 100644 index 00000000..8a11b470 --- /dev/null +++ b/assets/zh_develop_craft-yml.md.BerY4loY.lean.js @@ -0,0 +1 @@ +import{_ as i,c as a,o as n,af as l}from"./chunks/framework.PeLcR_tw.js";const c=JSON.parse('{"title":"craft.yml 配置","description":"","frontmatter":{"aside":false},"headers":[],"relativePath":"zh/develop/craft-yml.md","filePath":"zh/develop/craft-yml.md"}'),t={name:"zh/develop/craft-yml.md"};function p(h,s,e,k,r,d){return n(),a("div",null,s[0]||(s[0]=[l("",2)]))}const E=i(t,[["render",p]]);export{c as __pageData,E as default}; diff --git a/assets/zh_develop_craft-yml.md.Crgeurk7.lean.js b/assets/zh_develop_craft-yml.md.Crgeurk7.lean.js deleted file mode 100644 index 8fb62129..00000000 --- a/assets/zh_develop_craft-yml.md.Crgeurk7.lean.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as s,c as i,o as a,a1 as n}from"./chunks/framework.gjrnbxUT.js";const g=JSON.parse('{"title":"craft.yml 配置","description":"","frontmatter":{"aside":false},"headers":[],"relativePath":"zh/develop/craft-yml.md","filePath":"zh/develop/craft-yml.md"}'),l={name:"zh/develop/craft-yml.md"},t=n("",2),p=[t];function e(h,k,r,d,o,c){return a(),i("div",null,p)}const y=s(l,[["render",e]]);export{g as __pageData,y as default}; diff --git a/assets/zh_develop_doctor-module.md.DgFAPT6E.js b/assets/zh_develop_doctor-module.md.B8r2lbU8.js similarity index 81% rename from assets/zh_develop_doctor-module.md.DgFAPT6E.js rename to assets/zh_develop_doctor-module.md.B8r2lbU8.js index 4ec30472..a4c196a4 100644 --- a/assets/zh_develop_doctor-module.md.DgFAPT6E.js +++ b/assets/zh_develop_doctor-module.md.B8r2lbU8.js @@ -1,4 +1,4 @@ -import{_ as s,c as i,o as a,a1 as n}from"./chunks/framework.gjrnbxUT.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(`

Doctor 模块

Doctor 模块是一个较为独立的用于检查系统环境的模块,可使用命令 bin/spc doctor 进入,入口的命令类在 DoctorCommand.php 中。

Doctor 模块是一个检查单,里面有一系列的检查项目和自动修复项目。这些项目都存放在 src/SPC/doctor/item/ 目录中, 并且使用了两种 Attribute 用作检查项标记和自动修复项目标记:#[AsCheckItem]#[AsFixItem]

以现有的检查项 if necessary tools are installed,它是用于检查编译必需的包是否安装在 macOS 系统内,下面是它的源码:

php
use SPC\\doctor\\AsCheckItem;
+import{_ as i,c as a,o as n,af as h}from"./chunks/framework.PeLcR_tw.js";const g=JSON.parse('{"title":"Doctor 模块","description":"","frontmatter":{},"headers":[],"relativePath":"zh/develop/doctor-module.md","filePath":"zh/develop/doctor-module.md"}'),l={name:"zh/develop/doctor-module.md"};function k(t,s,p,e,d,E){return n(),a("div",null,s[0]||(s[0]=[h(`

Doctor 模块

Doctor 模块是一个较为独立的用于检查系统环境的模块,可使用命令 bin/spc doctor 进入,入口的命令类在 DoctorCommand.php 中。

Doctor 模块是一个检查单,里面有一系列的检查项目和自动修复项目。这些项目都存放在 src/SPC/doctor/item/ 目录中, 并且使用了两种 Attribute 用作检查项标记和自动修复项目标记:#[AsCheckItem]#[AsFixItem]

以现有的检查项 if necessary tools are installed,它是用于检查编译必需的包是否安装在 macOS 系统内,下面是它的源码:

php
use SPC\\doctor\\AsCheckItem;
 use SPC\\doctor\\AsFixItem;
 use SPC\\doctor\\CheckResult;
 
@@ -15,7 +15,7 @@ import{_ as s,c as i,o as a,a1 as n}from"./chunks/framework.gjrnbxUT.js";const g
         return CheckResult::fail('missing system commands: ' . implode(', ', $missing), 'build-tools', [$missing]);
     }
     return CheckResult::ok();
-}

属性的第一个参数就是检查项目的名称,后面的 limit_os 参数是限制了该检查项仅在指定的系统下触发,level 是执行该检查项的优先级,数字越大,优先级越高。

里面用到的 $this->findCommand() 方法为 SPC\\builder\\traits\\UnixSystemUtilTrait 的方法,用途是查找系统命令所在位置,找不到时返回 NULL。

每个检查项的方法都应该返回一个 SPC\\doctor\\CheckResult

  • 在返回 CheckResult::fail() 时,第一个参数用于输出终端的错误提示,第二个参数是在这个检查项可自动修复时的修复项目名称。
  • 在返回 CheckResult::ok() 时,表明检查通过。你也可以传递一个参数,用于返回检查结果,例如:CheckResult::ok('OS supported')
  • 在返回 CheckResult::fail() 时,如果包含了第三个参数,第三个参数的数组将被当作 AsFixItem 的参数。

下面是这个检查项对应的自动修复项的方法:

php
#[AsFixItem('build-tools')]
+}

属性的第一个参数就是检查项目的名称,后面的 limit_os 参数是限制了该检查项仅在指定的系统下触发,level 是执行该检查项的优先级,数字越大,优先级越高。

里面用到的 $this->findCommand() 方法为 SPC\\builder\\traits\\UnixSystemUtilTrait 的方法,用途是查找系统命令所在位置,找不到时返回 NULL。

每个检查项的方法都应该返回一个 SPC\\doctor\\CheckResult

  • 在返回 CheckResult::fail() 时,第一个参数用于输出终端的错误提示,第二个参数是在这个检查项可自动修复时的修复项目名称。
  • 在返回 CheckResult::ok() 时,表明检查通过。你也可以传递一个参数,用于返回检查结果,例如:CheckResult::ok('OS supported')
  • 在返回 CheckResult::fail() 时,如果包含了第三个参数,第三个参数的数组将被当作 AsFixItem 的参数。

下面是这个检查项对应的自动修复项的方法:

php
#[AsFixItem('build-tools')]
 public function fixBuildTools(array $missing): bool
 {
     foreach ($missing as $cmd) {
@@ -26,4 +26,4 @@ import{_ as s,c as i,o as a,a1 as n}from"./chunks/framework.gjrnbxUT.js";const g
         }
     }
     return true;
-}

#[AsFixItem()] 属性传入的参数即修复项的名称,该方法必须返回 True 或 False。当返回 False 时,表明自动修复失败,需要手动处理。

此处的代码中 shell()->exec() 是项目的执行命令的方法,用于替代 exec()system(),同时提供了 debug、获取执行状态、进入目录等特性。

`,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}; +}

#[AsFixItem()] 属性传入的参数即修复项的名称,该方法必须返回 True 或 False。当返回 False 时,表明自动修复失败,需要手动处理。

此处的代码中 shell()->exec() 是项目的执行命令的方法,用于替代 exec()system(),同时提供了 debug、获取执行状态、进入目录等特性。

`,13)]))}const c=i(l,[["render",k]]);export{g as __pageData,c as default}; diff --git a/assets/zh_develop_doctor-module.md.B8r2lbU8.lean.js b/assets/zh_develop_doctor-module.md.B8r2lbU8.lean.js new file mode 100644 index 00000000..1c427d29 --- /dev/null +++ b/assets/zh_develop_doctor-module.md.B8r2lbU8.lean.js @@ -0,0 +1 @@ +import{_ as i,c as a,o as n,af as h}from"./chunks/framework.PeLcR_tw.js";const g=JSON.parse('{"title":"Doctor 模块","description":"","frontmatter":{},"headers":[],"relativePath":"zh/develop/doctor-module.md","filePath":"zh/develop/doctor-module.md"}'),l={name:"zh/develop/doctor-module.md"};function k(t,s,p,e,d,E){return n(),a("div",null,s[0]||(s[0]=[h("",13)]))}const c=i(l,[["render",k]]);export{g as __pageData,c as default}; diff --git a/assets/zh_develop_doctor-module.md.DgFAPT6E.lean.js b/assets/zh_develop_doctor-module.md.DgFAPT6E.lean.js deleted file mode 100644 index 9afed7c3..00000000 --- a/assets/zh_develop_doctor-module.md.DgFAPT6E.lean.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as s,c as i,o as a,a1 as n}from"./chunks/framework.gjrnbxUT.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}; diff --git a/assets/zh_develop_index.md.-CPpDfMx.js b/assets/zh_develop_index.md.-CPpDfMx.js deleted file mode 100644 index df925405..00000000 --- a/assets/zh_develop_index.md.-CPpDfMx.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as e,c as a,o as t,a1 as o}from"./chunks/framework.gjrnbxUT.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('

开发简介

开发本项目需要安装部署 PHP 环境,以及一些 PHP 项目常用的扩展和 Composer。

项目的开发环境和运行环境几乎完全一致,你可以参照 指南-本地构建 部分安装系统 PHP 或使用本项目预构建的静态 PHP 作为环境,这里不再赘述。

抛开用途,本项目本身其实就是一个 php-cli 程序,你可以将它当作一个正常的 PHP 项目进行编辑和开发,同时你需要了解不同系统的 Shell 命令行。

本项目目前的目的就是为了编译静态编译的独立 PHP,但主体部分也包含编译很多依赖库的静态版本,所以你可以复用这套编译逻辑,用于构建其他程序的独立二进制版本,例如 Nginx 等。

环境准备

开发本项目需要 PHP 环境。你可以使用系统自带的 PHP,也可以使用本项目构建的静态 PHP。

无论是使用哪种 PHP,在开发环境,你需要安装这些扩展:

curl,dom,filter,mbstring,openssl,pcntl,phar,posix,sodium,tokenizer,xml,xmlwriter

static-php-cli 项目本身不需要这么多扩展,但在开发过程中,你会用到 Composer、PHPUnit 等工具,它们需要这些扩展。

对于 static-php-cli 自身构建的 micro 自执行二进制,仅需要 pcntl,posix,mbstring,tokenizer,phar

开始开发

继续向下查看项目结构的文档,你可以从中了解 static-php-cli 是如何运作的。

',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}; diff --git a/assets/zh_develop_index.md.-CPpDfMx.lean.js b/assets/zh_develop_index.md.-CPpDfMx.lean.js deleted file mode 100644 index b60f45fe..00000000 --- a/assets/zh_develop_index.md.-CPpDfMx.lean.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as e,c as a,o as t,a1 as o}from"./chunks/framework.gjrnbxUT.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}; diff --git a/assets/zh_develop_index.md.BFWliVJD.js b/assets/zh_develop_index.md.BFWliVJD.js new file mode 100644 index 00000000..3bd4cdad --- /dev/null +++ b/assets/zh_develop_index.md.BFWliVJD.js @@ -0,0 +1 @@ +import{_ as a,c as i,o as t,af as s}from"./chunks/framework.PeLcR_tw.js";const P=JSON.parse('{"title":"开发简介","description":"","frontmatter":{},"headers":[],"relativePath":"zh/develop/index.md","filePath":"zh/develop/index.md"}'),p={name:"zh/develop/index.md"};function o(r,e,l,n,c,d){return t(),i("div",null,e[0]||(e[0]=[s('

开发简介

开发本项目需要安装部署 PHP 环境,以及一些 PHP 项目常用的扩展和 Composer。

项目的开发环境和运行环境几乎完全一致,你可以参照 指南-本地构建 部分安装系统 PHP 或使用本项目预构建的静态 PHP 作为环境,这里不再赘述。

抛开用途,本项目本身其实就是一个 php-cli 程序,你可以将它当作一个正常的 PHP 项目进行编辑和开发,同时你需要了解不同系统的 Shell 命令行。

本项目目前的目的就是为了编译静态编译的独立 PHP,但主体部分也包含编译很多依赖库的静态版本,所以你可以复用这套编译逻辑,用于构建其他程序的独立二进制版本,例如 Nginx 等。

环境准备

开发本项目需要 PHP 环境。你可以使用系统自带的 PHP,也可以使用本项目构建的静态 PHP。

无论是使用哪种 PHP,在开发环境,你需要安装这些扩展:

curl,dom,filter,mbstring,openssl,pcntl,phar,posix,sodium,tokenizer,xml,xmlwriter

static-php-cli 项目本身不需要这么多扩展,但在开发过程中,你会用到 Composer、PHPUnit 等工具,它们需要这些扩展。

对于 static-php-cli 自身构建的 micro 自执行二进制,仅需要 pcntl,posix,mbstring,tokenizer,phar

开始开发

继续向下查看项目结构的文档,你可以从中了解 static-php-cli 是如何运作的。

',13)]))}const m=a(p,[["render",o]]);export{P as __pageData,m as default}; diff --git a/assets/zh_develop_index.md.BFWliVJD.lean.js b/assets/zh_develop_index.md.BFWliVJD.lean.js new file mode 100644 index 00000000..2b226f68 --- /dev/null +++ b/assets/zh_develop_index.md.BFWliVJD.lean.js @@ -0,0 +1 @@ +import{_ as a,c as i,o as t,af as s}from"./chunks/framework.PeLcR_tw.js";const P=JSON.parse('{"title":"开发简介","description":"","frontmatter":{},"headers":[],"relativePath":"zh/develop/index.md","filePath":"zh/develop/index.md"}'),p={name:"zh/develop/index.md"};function o(r,e,l,n,c,d){return t(),i("div",null,e[0]||(e[0]=[s("",13)]))}const m=a(p,[["render",o]]);export{P as __pageData,m as default}; diff --git a/assets/zh_develop_php-src-changes.md.CkjaMIky.js b/assets/zh_develop_php-src-changes.md.CkjaMIky.js new file mode 100644 index 00000000..b51edfb2 --- /dev/null +++ b/assets/zh_develop_php-src-changes.md.CkjaMIky.js @@ -0,0 +1 @@ +import{_ as a,c as e,o as l,af as c}from"./chunks/framework.PeLcR_tw.js";const m=JSON.parse('{"title":"对 PHP 源码的修改","description":"","frontmatter":{},"headers":[],"relativePath":"zh/develop/php-src-changes.md","filePath":"zh/develop/php-src-changes.md"}'),t={name:"zh/develop/php-src-changes.md"};function r(p,i,s,h,n,o){return l(),e("div",null,i[0]||(i[0]=[c('

对 PHP 源码的修改

由于 static-php-cli 在静态编译过程中为了实现良好的兼容性、性能和安全性,对 PHP 源码进行了一些修改。下面是目前对 PHP 源码修改的说明。

micro 相关补丁

基于 phpmicro 项目提供的补丁,static-php-cli 对 PHP 源码进行了一些修改,以适应静态编译的需求。补丁列表 包含:

目前 static-php-cli 在编译时用到的补丁有:

  • static_opcache
  • static_extensions_win32
  • cli_checks
  • disable_huge_page
  • vcruntime140
  • win32
  • zend_stream
  • cli_static
  • macos_iconv
  • phar

PHP <= 8.1 libxml 补丁

因为 PHP 官方仅对 8.1 进行安全更新,旧版本停止更新,所以 static-php-cli 对 PHP 8.1 及以下版本应用了在新版本 PHP 中已经应用的 libxml 编译补丁。

gd 扩展 Windows 补丁

在 Windows 下编译 gd 扩展需要大幅改动 config.w32 文件,static-php-cli 对 gd 扩展进行了一些修改,使其在 Windows 下编译更加方便。

yaml 扩展 Windows 补丁

yaml 扩展在 Windows 下编译需要修改 config.w32 文件,static-php-cli 对 yaml 扩展进行了一些修改,使其在 Windows 下编译更加方便。

static-php-cli 版本信息插入

static-php-cli 在编译时会在 PHP 版本信息中插入 static-php-cli 的版本信息,以便于识别。

加入硬编码 INI 的选项

在使用 -I 参数硬编码 INI 到静态 PHP 的功能中,static-php-cli 会修改 PHP 源码以插入硬编码内容。

Linux 系统修复补丁

部分编译环境可能缺少一些头文件或库,static-php-cli 会在编译时自动修复这些问题,如:

  • HAVE_STRLCAT missing problem
  • HAVE_STRLCPY missing problem

Windows 系统下 Fiber 问题修复补丁

在 Windows 下编译 PHP 时,Fiber 扩展会出现一些问题,static-php-cli 会在编译时自动修复这些问题(修改 php-src 的 config.w32)。

',21)]))}const P=a(t,[["render",r]]);export{m as __pageData,P as default}; diff --git a/assets/zh_develop_php-src-changes.md.CkjaMIky.lean.js b/assets/zh_develop_php-src-changes.md.CkjaMIky.lean.js new file mode 100644 index 00000000..d85e1864 --- /dev/null +++ b/assets/zh_develop_php-src-changes.md.CkjaMIky.lean.js @@ -0,0 +1 @@ +import{_ as a,c as e,o as l,af as c}from"./chunks/framework.PeLcR_tw.js";const m=JSON.parse('{"title":"对 PHP 源码的修改","description":"","frontmatter":{},"headers":[],"relativePath":"zh/develop/php-src-changes.md","filePath":"zh/develop/php-src-changes.md"}'),t={name:"zh/develop/php-src-changes.md"};function r(p,i,s,h,n,o){return l(),e("div",null,i[0]||(i[0]=[c("",21)]))}const P=a(t,[["render",r]]);export{m as __pageData,P as default}; diff --git a/assets/zh_develop_php-src-changes.md.Df0-NcBw.js b/assets/zh_develop_php-src-changes.md.Df0-NcBw.js deleted file mode 100644 index 8025c282..00000000 --- a/assets/zh_develop_php-src-changes.md.Df0-NcBw.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as i,c as a,o as e,a1 as l}from"./chunks/framework.gjrnbxUT.js";const _=JSON.parse('{"title":"对 PHP 源码的修改","description":"","frontmatter":{},"headers":[],"relativePath":"zh/develop/php-src-changes.md","filePath":"zh/develop/php-src-changes.md"}'),t={name:"zh/develop/php-src-changes.md"},c=l('

对 PHP 源码的修改

由于 static-php-cli 在静态编译过程中为了实现良好的兼容性、性能和安全性,对 PHP 源码进行了一些修改。下面是目前对 PHP 源码修改的说明。

micro 相关补丁

基于 phpmicro 项目提供的补丁,static-php-cli 对 PHP 源码进行了一些修改,以适应静态编译的需求。补丁列表 包含:

目前 static-php-cli 在编译时用到的补丁有:

  • static_opcache
  • static_extensions_win32
  • cli_checks
  • disable_huge_page
  • vcruntime140
  • win32
  • zend_stream
  • cli_static
  • macos_iconv
  • phar

PHP <= 8.1 libxml 补丁

因为 PHP 官方仅对 8.1 进行安全更新,旧版本停止更新,所以 static-php-cli 对 PHP 8.1 及以下版本应用了在新版本 PHP 中已经应用的 libxml 编译补丁。

gd 扩展 Windows 补丁

在 Windows 下编译 gd 扩展需要大幅改动 config.w32 文件,static-php-cli 对 gd 扩展进行了一些修改,使其在 Windows 下编译更加方便。

yaml 扩展 Windows 补丁

yaml 扩展在 Windows 下编译需要修改 config.w32 文件,static-php-cli 对 yaml 扩展进行了一些修改,使其在 Windows 下编译更加方便。

static-php-cli 版本信息插入

static-php-cli 在编译时会在 PHP 版本信息中插入 static-php-cli 的版本信息,以便于识别。

加入硬编码 INI 的选项

在使用 -I 参数硬编码 INI 到静态 PHP 的功能中,static-php-cli 会修改 PHP 源码以插入硬编码内容。

Linux 系统修复补丁

部分编译环境可能缺少一些头文件或库,static-php-cli 会在编译时自动修复这些问题,如:

  • HAVE_STRLCAT missing problem
  • HAVE_STRLCPY missing problem

Windows 系统下 Fiber 问题修复补丁

在 Windows 下编译 PHP 时,Fiber 扩展会出现一些问题,static-php-cli 会在编译时自动修复这些问题(修改 php-src 的 config.w32)。

',21),o=[c];function s(r,p,h,n,d,m){return e(),a("div",null,o)}const u=i(t,[["render",s]]);export{_ as __pageData,u as default}; diff --git a/assets/zh_develop_php-src-changes.md.Df0-NcBw.lean.js b/assets/zh_develop_php-src-changes.md.Df0-NcBw.lean.js deleted file mode 100644 index ec078cac..00000000 --- a/assets/zh_develop_php-src-changes.md.Df0-NcBw.lean.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as i,c as a,o as e,a1 as l}from"./chunks/framework.gjrnbxUT.js";const _=JSON.parse('{"title":"对 PHP 源码的修改","description":"","frontmatter":{},"headers":[],"relativePath":"zh/develop/php-src-changes.md","filePath":"zh/develop/php-src-changes.md"}'),t={name:"zh/develop/php-src-changes.md"},c=l("",21),o=[c];function s(r,p,h,n,d,m){return e(),a("div",null,o)}const u=i(t,[["render",s]]);export{_ as __pageData,u as default}; diff --git a/assets/zh_develop_source-module.md.D0odLsHX.lean.js b/assets/zh_develop_source-module.md.D0odLsHX.lean.js deleted file mode 100644 index 4fa9f105..00000000 --- a/assets/zh_develop_source-module.md.D0odLsHX.lean.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as s,c as i,o as a,a1 as t}from"./chunks/framework.gjrnbxUT.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("",75),p=[l];function h(e,k,o,E,d,r){return a(),i("div",null,p)}const u=s(n,[["render",h]]);export{g as __pageData,u as default}; diff --git a/assets/zh_develop_source-module.md.D0odLsHX.js b/assets/zh_develop_source-module.md.DoBnezP5.js similarity index 71% rename from assets/zh_develop_source-module.md.D0odLsHX.js rename to assets/zh_develop_source-module.md.DoBnezP5.js index 7c91ef0a..3139c041 100644 --- a/assets/zh_develop_source-module.md.D0odLsHX.js +++ b/assets/zh_develop_source-module.md.DoBnezP5.js @@ -1,4 +1,4 @@ -import{_ as s,c as i,o as a,a1 as t}from"./chunks/framework.gjrnbxUT.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(`

资源模块

static-php-cli 的下载资源模块是一个主要的功能,它包含了所依赖的库、外部扩展、PHP 源码的下载方式和资源解压方式。 下载的配置文件主要涉及 source.jsonpkg.json 文件,这个文件记录了所有可下载的资源的下载方式。

下载功能主要涉及的命令有 bin/spc downloadbin/spc extract。其中 download 命令是一个下载器,它会根据配置文件下载资源; extract 命令是一个解压器,它会根据配置文件解压资源。

一般来说,下载资源可能会比较慢,因为这些资源来源于各个官网、GitHub 等不同位置,同时它们也占用了较大空间,所以你可以在一次下载资源后,可重复使用。

下载器的配置文件是 source.json,它包含了所有资源的下载方式,你可以在其中添加你需要的资源下载方式,也可以修改已有的资源下载方式。

每个资源的下载配置结构如下,下面是 libevent 扩展对应的资源下载配置:

json
{
+import{_ as i,c as a,o as t,af as n}from"./chunks/framework.PeLcR_tw.js";const r=JSON.parse('{"title":"资源模块","description":"","frontmatter":{},"headers":[],"relativePath":"zh/develop/source-module.md","filePath":"zh/develop/source-module.md"}'),l={name:"zh/develop/source-module.md"};function h(e,s,p,k,E,o){return t(),a("div",null,s[0]||(s[0]=[n(`

资源模块

static-php-cli 的下载资源模块是一个主要的功能,它包含了所依赖的库、外部扩展、PHP 源码的下载方式和资源解压方式。 下载的配置文件主要涉及 source.jsonpkg.json 文件,这个文件记录了所有可下载的资源的下载方式。

下载功能主要涉及的命令有 bin/spc downloadbin/spc extract。其中 download 命令是一个下载器,它会根据配置文件下载资源; extract 命令是一个解压器,它会根据配置文件解压资源。

一般来说,下载资源可能会比较慢,因为这些资源来源于各个官网、GitHub 等不同位置,同时它们也占用了较大空间,所以你可以在一次下载资源后,可重复使用。

下载器的配置文件是 source.json,它包含了所有资源的下载方式,你可以在其中添加你需要的资源下载方式,也可以修改已有的资源下载方式。

每个资源的下载配置结构如下,下面是 libevent 扩展对应的资源下载配置:

json
{
   "libevent": {
     "type": "ghrel",
     "repo": "libevent/libevent",
@@ -9,7 +9,7 @@ import{_ as s,c as i,o as a,a1 as t}from"./chunks/framework.gjrnbxUT.js";const g
       "path": "LICENSE"
     }
   }
-}

这里最主要的字段是 type,目前它支持的类型有:

  • url: 直接使用 URL 下载,例如:https://download.libsodium.org/libsodium/releases/libsodium-1.0.18.tar.gz
  • ghrel: 使用 GitHub Release API 下载,即从 GitHub 项目发布的最新版本中上传的附件下载。
  • ghtar: 使用 GitHub Release API 下载,与 ghrel 不同的是,ghtar 是从项目的最新 Release 中找 source code (tar.gz) 下载的。
  • ghtagtar: 使用 GitHub Release API 下载,与 ghtar 相比,ghtagtar 可以从 tags 列表找最新的,并下载 tar.gz 格式的源码(因为有些项目只使用了 tag 发布版本)。
  • bitbuckettag: 使用 BitBucket API 下载,基本和 ghtagtar 相同,只是这个适用于 BitBucket。
  • git: 直接从一个 Git 地址克隆项目来下载资源,适用于任何公开 Git 仓库。
  • filelist: 使用爬虫爬取提供文件索引的 Web 下载站点,并获取最新版本的文件名并下载。
  • custom: 如果以上下载方式都不能满足,你可以编写 custom 后,在 src/SPC/store/source/ 下新建一个类,并继承 CustomSourceBase,自己编写下载脚本。

source.json 通用参数

source.json 中每个源文件拥有以下字段:

  • license: 源代码的开源许可证,见下方 开源许可证 章节
  • type: 必须为上面提到的类型之一
  • path(可选): 释放源码到指定目录而非 source/{name}
  • provide-pre-built(可选): 是否提供预编译的二进制文件,如果为 true,则会在 bin/spc download 时尝试自动下载预编译的二进制文件

TIP

source.json 中的 path 参数可指定相对路径或绝对路径。当指定为相对路径时,路径基于 source/

下载类型 - url

url 类型的资源指的是从 URL 直接下载文件。

包含的参数有:

  • url: 文件的下载地址,如 https://example.com/file.tgz
  • filename(可选): 保存到本地的文件名,如不指定,则使用 url 的文件名

例子(下载 imagick 扩展,并解压缩到 php 源码的扩展存放路径):

json
{
+}

这里最主要的字段是 type,目前它支持的类型有:

  • url: 直接使用 URL 下载,例如:https://download.libsodium.org/libsodium/releases/libsodium-1.0.18.tar.gz
  • ghrel: 使用 GitHub Release API 下载,即从 GitHub 项目发布的最新版本中上传的附件下载。
  • ghtar: 使用 GitHub Release API 下载,与 ghrel 不同的是,ghtar 是从项目的最新 Release 中找 source code (tar.gz) 下载的。
  • ghtagtar: 使用 GitHub Release API 下载,与 ghtar 相比,ghtagtar 可以从 tags 列表找最新的,并下载 tar.gz 格式的源码(因为有些项目只使用了 tag 发布版本)。
  • bitbuckettag: 使用 BitBucket API 下载,基本和 ghtagtar 相同,只是这个适用于 BitBucket。
  • git: 直接从一个 Git 地址克隆项目来下载资源,适用于任何公开 Git 仓库。
  • filelist: 使用爬虫爬取提供文件索引的 Web 下载站点,并获取最新版本的文件名并下载。
  • custom: 如果以上下载方式都不能满足,你可以编写 custom 后,在 src/SPC/store/source/ 下新建一个类,并继承 CustomSourceBase,自己编写下载脚本。

source.json 通用参数

source.json 中每个源文件拥有以下字段:

  • license: 源代码的开源许可证,见下方 开源许可证 章节
  • type: 必须为上面提到的类型之一
  • path(可选): 释放源码到指定目录而非 source/{name}
  • provide-pre-built(可选): 是否提供预编译的二进制文件,如果为 true,则会在 bin/spc download 时尝试自动下载预编译的二进制文件

TIP

source.json 中的 path 参数可指定相对路径或绝对路径。当指定为相对路径时,路径基于 source/

下载类型 - url

url 类型的资源指的是从 URL 直接下载文件。

包含的参数有:

  • url: 文件的下载地址,如 https://example.com/file.tgz
  • filename(可选): 保存到本地的文件名,如不指定,则使用 url 的文件名

例子(下载 imagick 扩展,并解压缩到 php 源码的扩展存放路径):

json
{
   "ext-imagick": {
     "type": "url",
     "url": "https://pecl.php.net/get/imagick",
@@ -20,7 +20,7 @@ import{_ as s,c as i,o as a,a1 as t}from"./chunks/framework.gjrnbxUT.js";const g
       "path": "LICENSE"
     }
   }
-}

下载类型 - ghrel

ghrel 会从 GitHub Release 中上传的 Assets 下载文件。首先使用 GitHub Release API 获取最新版本,然后根据正则匹配方式下载相应的文件。

包含的参数有:

  • repo: GitHub 仓库名称
  • match: 匹配 Assets 文件的正则表达式
  • prefer-stable: 是否优先下载稳定版本(默认为 false

例子(下载 libsodium 库,匹配 Release 中的 libsodium-x.y.tar.gz 文件):

json
{
+}

下载类型 - ghrel

ghrel 会从 GitHub Release 中上传的 Assets 下载文件。首先使用 GitHub Release API 获取最新版本,然后根据正则匹配方式下载相应的文件。

包含的参数有:

  • repo: GitHub 仓库名称
  • match: 匹配 Assets 文件的正则表达式
  • prefer-stable: 是否优先下载稳定版本(默认为 false

例子(下载 libsodium 库,匹配 Release 中的 libsodium-x.y.tar.gz 文件):

json
{
   "libsodium": {
     "type": "ghrel",
     "repo": "jedisct1/libsodium",
@@ -30,7 +30,7 @@ import{_ as s,c as i,o as a,a1 as t}from"./chunks/framework.gjrnbxUT.js";const g
       "path": "LICENSE"
     }
   }
-}

下载类型 - ghtar

ghtar 会从 GitHub Release Tag 下载文件,与 ghrel 不同的是,ghtar 是从项目的最新 Release 中找 source code (tar.gz) 下载的。

包含的参数有:

  • repo: GitHub 仓库名称
  • prefer-stable: 是否优先下载稳定版本(默认为 false

例子(brotli 库):

json
{
+}

下载类型 - ghtar

ghtar 会从 GitHub Release Tag 下载文件,与 ghrel 不同的是,ghtar 是从项目的最新 Release 中找 source code (tar.gz) 下载的。

包含的参数有:

  • repo: GitHub 仓库名称
  • prefer-stable: 是否优先下载稳定版本(默认为 false

例子(brotli 库):

json
{
   "brotli": {
     "type": "ghtar",
     "repo": "google/brotli",
@@ -39,7 +39,7 @@ import{_ as s,c as i,o as a,a1 as t}from"./chunks/framework.gjrnbxUT.js";const g
       "path": "LICENSE"
     }
   }
-}

下载类型 - ghtagtar

使用 GitHub Release API 下载,与 ghtar 相比,ghtagtar 可以从 tags 列表找最新的,并下载 tar.gz 格式的源码(因为有些项目只使用了 tag 发布版本)。

包含的参数有:

  • repo: GitHub 仓库名称
  • prefer-stable: 是否优先下载稳定版本(默认为 false

例子(gmp 库):

json
{
+}

下载类型 - ghtagtar

使用 GitHub Release API 下载,与 ghtar 相比,ghtagtar 可以从 tags 列表找最新的,并下载 tar.gz 格式的源码(因为有些项目只使用了 tag 发布版本)。

包含的参数有:

  • repo: GitHub 仓库名称
  • prefer-stable: 是否优先下载稳定版本(默认为 false

例子(gmp 库):

json
{
   "gmp": {
     "type": "ghtagtar",
     "repo": "alisw/GMP",
@@ -48,7 +48,7 @@ import{_ as s,c as i,o as a,a1 as t}from"./chunks/framework.gjrnbxUT.js";const g
       "text": "EXAMPLE LICENSE"
     }
   }
-}

下载类型 - bitbuckettag

使用 BitBucket API 下载,基本和 ghtagtar 相同,只是这个适用于 BitBucket。

包含的参数有:

  • repo: BitBucket 仓库名称

下载类型 - git

直接从一个 Git 地址克隆项目来下载资源,适用于任何公开 Git 仓库。

包含的参数有:

  • url: Git 链接(仅限 HTTPS)
  • rev: 分支名称
json
{
+}

下载类型 - bitbuckettag

使用 BitBucket API 下载,基本和 ghtagtar 相同,只是这个适用于 BitBucket。

包含的参数有:

  • repo: BitBucket 仓库名称

下载类型 - git

直接从一个 Git 地址克隆项目来下载资源,适用于任何公开 Git 仓库。

包含的参数有:

  • url: Git 链接(仅限 HTTPS)
  • rev: 分支名称
json
{
   "imap": {
     "type": "git",
     "url": "https://github.com/static-php/imap.git",
@@ -58,7 +58,7 @@ import{_ as s,c as i,o as a,a1 as t}from"./chunks/framework.gjrnbxUT.js";const g
       "path": "LICENSE"
     }
   }
-}

下载类型 - filelist

使用爬虫爬取提供文件索引的 Web 下载站点,并获取最新版本的文件名并下载。

注意,该方法仅限于镜像站、GNU 官网等具有页面 index 功能的静态站点使用。

包含的参数有:

  • url: 要爬取文件最新版本的页面 URL
  • regex: 匹配文件名及下载链接的正则表达式

例子(从 GNU 官网下载 libiconv 库):

json
{
+}

下载类型 - filelist

使用爬虫爬取提供文件索引的 Web 下载站点,并获取最新版本的文件名并下载。

注意,该方法仅限于镜像站、GNU 官网等具有页面 index 功能的静态站点使用。

包含的参数有:

  • url: 要爬取文件最新版本的页面 URL
  • regex: 匹配文件名及下载链接的正则表达式

例子(从 GNU 官网下载 libiconv 库):

json
{
   "libiconv": {
     "type": "filelist",
     "url": "https://ftp.gnu.org/gnu/libiconv/",
@@ -68,7 +68,7 @@ import{_ as s,c as i,o as a,a1 as t}from"./chunks/framework.gjrnbxUT.js";const g
       "path": "COPYING"
     }
   }
-}

下载类型 - custom

如果以上下载方式都不能满足,你可以编写 custom 后,在 src/SPC/store/source/ 下新建一个类,并继承 CustomSourceBase,自己编写下载脚本。

这里不再赘述,你可以查看 src/SPC/store/source/PhpSource.phpsrc/SPC/store/source/PostgreSQLSource.php 作为例子。

pkg.json 通用参数

pkg.json 存放的是非源码类型的文件资源,例如 musl-toolchain、UPX 等预编译的工具。它的使用包含:

  • type: 与 source.json 相同的类型及不同种类的参数。
  • extract(可选): 下载后解压缩的路径,默认为 pkgroot/{pkg_name}
  • extract-files(可选): 下载后仅解压指定的文件到指定位置。

需要注意的是,pkg.json 不涉及源代码的编译和修改分发,所以没有 license 开源许可证字段。并且你不能同时使用 extractextract-files 参数。

例子(下载 nasm 到本地,并只提取程序文件到 PHP SDK):

json
{
+}

下载类型 - custom

如果以上下载方式都不能满足,你可以编写 custom 后,在 src/SPC/store/source/ 下新建一个类,并继承 CustomSourceBase,自己编写下载脚本。

这里不再赘述,你可以查看 src/SPC/store/source/PhpSource.phpsrc/SPC/store/source/PostgreSQLSource.php 作为例子。

pkg.json 通用参数

pkg.json 存放的是非源码类型的文件资源,例如 musl-toolchain、UPX 等预编译的工具。它的使用包含:

  • type: 与 source.json 相同的类型及不同种类的参数。
  • extract(可选): 下载后解压缩的路径,默认为 pkgroot/{pkg_name}
  • extract-files(可选): 下载后仅解压指定的文件到指定位置。

需要注意的是,pkg.json 不涉及源代码的编译和修改分发,所以没有 license 开源许可证字段。并且你不能同时使用 extractextract-files 参数。

例子(下载 nasm 到本地,并只提取程序文件到 PHP SDK):

json
{
   "nasm-x86_64-win": {
     "type": "url",
     "url": "https://www.nasm.us/pub/nasm/releasebuilds/2.16.01/win64/nasm-2.16.01-win64.zip",
@@ -77,7 +77,7 @@ import{_ as s,c as i,o as a,a1 as t}from"./chunks/framework.gjrnbxUT.js";const g
       "nasm-2.16.01/ndisasm.exe": "{php_sdk_path}/bin/ndisasm.exe"
     }
   }
-}

extract-files 中的键名为源文件夹下的文件,键值为存放的路径。存放的路径可以使用以下变量:

  • {php_sdk_path}: (仅限 Windows)PHP SDK 路径
  • {pkg_root_path}: pkgroot/
  • {working_dir}: 当前工作目录
  • {download_path}: 下载目录
  • {source_path}: 源码解压缩目录

extract-files 不使用变量且为相对路径时,相对路径的目录为 {working_dir}

开源许可证

对于 source.json 而言,每个源文件都应包含开源许可证。license 字段存放了开源许可证的信息。

每个 license 包含的参数有:

  • type: filetext
  • path: 源代码目录中的许可证文件(当 typefile 时,此项必填)
  • text: 许可证文本(当 typetext 时,此项必填)

例子(yaml 扩展的源代码中带有 LICENSE 文件):

json
{
+}

extract-files 中的键名为源文件夹下的文件,键值为存放的路径。存放的路径可以使用以下变量:

  • {php_sdk_path}: (仅限 Windows)PHP SDK 路径
  • {pkg_root_path}: pkgroot/
  • {working_dir}: 当前工作目录
  • {download_path}: 下载目录
  • {source_path}: 源码解压缩目录

extract-files 不使用变量且为相对路径时,相对路径的目录为 {working_dir}

开源许可证

对于 source.json 而言,每个源文件都应包含开源许可证。license 字段存放了开源许可证的信息。

每个 license 包含的参数有:

  • type: filetext
  • path: 源代码目录中的许可证文件(当 typefile 时,此项必填)
  • text: 许可证文本(当 typetext 时,此项必填)

例子(yaml 扩展的源代码中带有 LICENSE 文件):

json
{
   "yaml": {
     "type": "git",
     "path": "php-src/ext/yaml",
@@ -88,7 +88,7 @@ import{_ as s,c as i,o as a,a1 as t}from"./chunks/framework.gjrnbxUT.js";const g
       "path": "LICENSE"
     }
   }
-}

当开源项目拥有多个许可证时,可指定多个文件:

json
{
+}

当开源项目拥有多个许可证时,可指定多个文件:

json
{
   "libuv": {
     "type": "ghtar",
     "repo": "libuv/libuv",
@@ -103,7 +103,7 @@ import{_ as s,c as i,o as a,a1 as t}from"./chunks/framework.gjrnbxUT.js";const g
       }
     ]
   }
-}

当一个开源项目的许可证在不同版本间使用不同的文件,path 参数可以使用数组将可能的许可证文件列出:

json
{
+}

当一个开源项目的许可证在不同版本间使用不同的文件,path 参数可以使用数组将可能的许可证文件列出:

json
{
   "redis": {
     "type": "git",
     "path": "php-src/ext/redis",
@@ -117,4 +117,4 @@ import{_ as s,c as i,o as a,a1 as t}from"./chunks/framework.gjrnbxUT.js";const g
       ]
     }
   }
-}
`,75),p=[l];function h(e,k,o,E,d,r){return a(),i("div",null,p)}const u=s(n,[["render",h]]);export{g as __pageData,u as default}; +}
`,75)]))}const c=i(l,[["render",h]]);export{r as __pageData,c as default}; diff --git a/assets/zh_develop_source-module.md.DoBnezP5.lean.js b/assets/zh_develop_source-module.md.DoBnezP5.lean.js new file mode 100644 index 00000000..a2c5150a --- /dev/null +++ b/assets/zh_develop_source-module.md.DoBnezP5.lean.js @@ -0,0 +1 @@ +import{_ as i,c as a,o as t,af as n}from"./chunks/framework.PeLcR_tw.js";const r=JSON.parse('{"title":"资源模块","description":"","frontmatter":{},"headers":[],"relativePath":"zh/develop/source-module.md","filePath":"zh/develop/source-module.md"}'),l={name:"zh/develop/source-module.md"};function h(e,s,p,k,E,o){return t(),a("div",null,s[0]||(s[0]=[n("",75)]))}const c=i(l,[["render",h]]);export{r as __pageData,c as default}; diff --git a/assets/zh_develop_structure.md.B-0RMSSw.js b/assets/zh_develop_structure.md.B-0RMSSw.js deleted file mode 100644 index 2ec933af..00000000 --- a/assets/zh_develop_structure.md.B-0RMSSw.js +++ /dev/null @@ -1,10 +0,0 @@ -import{_ as e,c as o,o as c,a1 as d}from"./chunks/framework.gjrnbxUT.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(`

项目结构简介

static-php-cli 主要包含三种逻辑组件:资源、依赖库、扩展。这三种组件四个配置文件:source.jsonlib.jsonext.jsonpkg.json

一个完整的构建静态 PHP 流程是:

  1. 使用资源下载模块 Downloader 下载指定或所有资源,这些资源包含 PHP 源码、依赖库源码、扩展源码。
  2. 使用资源解压模块 SourceExtractor 解压下载的资源到编译目录。
  3. 使用依赖工具计算出当前加入的扩展的依赖扩展、依赖库,然后对每个需要编译的依赖库进行编译,按照依赖顺序。
  4. 使用对应操作系统下的 Builder 构建每个依赖库后,将其安装到 buildroot 目录。
  5. 如果包含外部扩展(源码没有包含在 PHP 内的扩展),将外部扩展拷贝到 source/php-src/ext/ 目录。
  6. 使用 Builder 构建 PHP 源码,将其安装到 buildroot 目录。

项目主要分为几个文件夹:

  • bin/: 用于存放程序入口文件,包含 bin/spcbin/spc-alpine-dockerbin/setup-runtime
  • config/: 包含了所有项目支持的扩展、依赖库以及这些资源下载的地址、下载方式等,:lib.jsonext.jsonsource.jsonpkg.jsonpre-built.json
  • src/SPC/: 项目的核心代码,包含了整个框架以及编译各种扩展和库的命令。
  • src/globals/: 项目的全局方法和常量、运行时需要的测试文件(例如:扩展的可用性检查代码)。
  • vendor/: Composer 依赖的目录,你无需对它做出任何修改。

其中运行原理就是启动一个 symfony/consoleConsoleApplication,然后解析用户在终端输入的命令。

基本命令行结构

bin/spc 是一个 PHP 代码入口文件,包含了 Unix 通用的 #!/usr/bin/env php 用来让系统自动以系统安装好的 PHP 解释器执行。 在项目执行了 new ConsoleApplication() 后,框架会自动使用反射的方式,解析 src/SPC/command 目录下的所有类,并将其注册成为命令。

项目并没有直接使用 Symfony 推荐的 Command 注册方式和命令执行方式,这里做出了一点小变动:

  1. 每个命令都使用 #[AsCommand()] Attribute 来注册名称和简介。
  2. execute() 抽象化,让所有命令基于 BaseCommand(它基于 Symfony\\Component\\Console\\Command\\Command),每个命令本身的执行代码写到了 handle() 方法中。
  3. BaseCommand 添加了变量 $no_motd,用于是否在该命令执行时显示 Figlet 欢迎词。
  4. BaseCommandInputInterfaceOutputInterface 保存为成员变量,你可以在命令的类内使用 $this->input$this->output

基本源码结构

项目的源码位于 src/SPC 目录,支持 PSR-4 标准的自动加载,包含以下子目录和类:

  • src/SPC/builder/: 用于不同操作系统下构建依赖库、PHP 及相关扩展的核心编译命令代码,还包含了一些编译的系统工具方法。
  • src/SPC/command/: 项目的所有命令都在这里。
  • src/SPC/doctor/: Doctor 模块,它是一个较为独立的用于检查系统环境的模块,可使用命令 bin/spc doctor 进入。
  • src/SPC/exception/: 异常类。
  • src/SPC/store/: 有关存储、文件和资源的类都在这里。
  • src/SPC/util/: 一些可以复用的工具方法都在这里。
  • src/SPC/ConsoleApplication.php: 命令行程序入口文件。

如果你阅读过源码,你可能会发现还有一个 src/globals/ 目录,它是用于存放一些全局变量、全局方法、构建过程中依赖的非 PSR-4 标准的 PHP 源码,例如测试扩展代码等。

Phar 应用目录问题

和其他 php-cli 项目一样,spc 自身对路径有额外的考虑。 因为 spc 可以在 php-cli directlymicro SAPIphp-cli with Pharvendor with Phar 等多种模式下运行,各类根目录存在歧义。这里会进行一个完整的说明。 此问题一般常见于 PHP 项目中存取文件的基类路径选择问题,尤其是在配合 micro.sfx 使用时容易出现路径问题。

注意,此处仅对你在开发 Phar 项目或 PHP 框架时可能有用。

接下来我们都将 static-php-cli(也就是 spc)当作一个普通的 php 命令行程序来看,你可以将 spc 理解为你自己的任何 php-cli 应用以参考。

下面主要有三个基本的常量理论值,我们建议你在编写 php 项目时引入这三种常量:

  • WORKING_DIR:执行 PHP 脚本时的工作目录
  • SOURCE_ROOT_DIRROOT_DIR:项目文件夹的根目录,一般为 composer.json 所在目录
  • FRAMEWORK_ROOT_DIR:使用框架的根目录,自行开发的框架可能会用到,一般框架目录为只读

你可以在你的框架或者 cli 应用程序入口中定义这些常量,以方便在你的项目中使用路径。

下面是 PHP 内置的常量值,在 PHP 解释器内部已被定义:

  • __DIR__:当前执行脚本的文件所在目录
  • __FILE__:当前执行脚本的文件路径

Git 项目模式(source)

Git 项目模式指的是一个框架或程序本身在当前文件夹以纯文本形式存放,运行通过 php path/to/entry.php 方式。

假设你的项目存放在 /home/example/static-php-cli/ 目录下,或你的项目就是框架本身,里面包含 composer.json 等项目文件:

composer.json
-src/App/MyCommand.app
-vendor/*
-bin/entry.php

我们假设从 src/App/MyCommand.php 中获取以上常量:

ConstantValue
WORKING_DIR/home/example/static-php-cli
SOURCE_ROOT_DIR/home/example/static-php-cli
FRAMEWORK_ROOT_DIR/home/example/static-php-cli
__DIR__/home/example/static-php-cli/src/App
__FILE__/home/example/static-php-cli/src/App/MyCommand.php

这种情况下,WORKING_DIRSOURCE_ROOT_DIRFRAMEWORK_ROOT_DIR 的值是完全一致的:/home/example/static-php-cli。 框架的源码和应用的源码都在当前路径下。

Vendor 库模式(vendor)

Vendor 库模式一般是指你的项目为框架类或者被其他应用作为 composer 依赖项安装到项目中,存放位置在 vendor/author/XXX 目录。

假设你的项目是 crazywhalecc/static-php-cli,你或其他人在另一个项目使用 composer require 安装了这个项目。

我们假设 static-php-cli 中包含同 Git 模式 的除 vendor 目录外的所有文件,并从 src/App/MyCommand 中获取常量值, 目录常量应该是:

ConstantValue
WORKING_DIR/home/example/another-app
SOURCE_ROOT_DIR/home/example/another-app
FRAMEWORK_ROOT_DIR/home/example/another-app/vendor/crazywhalecc/static-php-cli
__DIR__/home/example/another-app/vendor/crazywhalecc/static-php-cli/src/App
__FILE__/home/example/another-app/vendor/crazywhalecc/static-php-cli/src/App/MyCommand.php

这里的 SOURCE_ROOT_DIR 就指的是使用 static-php-cli 的项目的根目录。

Git 项目 Phar 模式(source-phar)

Git 项目 Phar 模式指的是将 Git 项目模式的项目目录打包为一个 phar 文件的模式。我们假设 /home/example/static-php-cli 将打包为一个 Phar 文件,目录有以下文件:

composer.json
-src/App/MyCommand.app
-vendor/*
-bin/entry.php

打包为 app.phar 并存放到 /home/example/static-php-cli 目录下时,此时执行 app.phar,假设执行了 src/App/MyCommand 代码,常量在该文件内获取:

ConstantValue
WORKING_DIR/home/example/static-php-cli
SOURCE_ROOT_DIRphar:///home/example/static-php-cli/app.phar/
FRAMEWORK_ROOT_DIRphar:///home/example/static-php-cli/app.phar/
__DIR__phar:///home/example/static-php-cli/app.phar/src/App
__FILE__phar:///home/example/static-php-cli/app.phar/src/App/MyCommand.php

因为在 phar 内读取自身 phar 的文件需要 phar:// 协议进行,所以项目根目录和框架目录将会和 WORKING_DIR 不同。

Vendor 库 Phar 模式(vendor-phar)

Vendor 库 Phar 模式指的是你的项目作为框架安装在其他项目内,存储于 vendor 目录下。

我们假设你的项目目录结构如下:

composer.json # 当前项目的 Composer 配置文件
-box.json # 打包 Phar 的配置文件
-another-app.php # 另一个项目的入口文件
-vendor/crazywhalecc/static-php-cli/* # 你的项目被作为依赖库

将该目录 /home/example/another-app/ 下的这些文件打包为 app.phar 时,对于你的项目而言,下面常量的值应为:

ConstantValue
WORKING_DIR/home/example/another-app
SOURCE_ROOT_DIRphar:///home/example/another-app/app.phar/
FRAMEWORK_ROOT_DIRphar:///home/example/another-app/app.phar/vendor/crazywhalecc/static-php-cli
__DIR__phar:///home/example/another-app/app.phar/vendor/crazywhalecc/static-php-cli/src/App
__FILE__phar:///home/example/another-app/app.phar/vendor/crazywhalecc/static-php-cli/src/App/MyCommand.php
`,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}; diff --git a/assets/zh_develop_structure.md.B-0RMSSw.lean.js b/assets/zh_develop_structure.md.B-0RMSSw.lean.js deleted file mode 100644 index 0b14cc0c..00000000 --- a/assets/zh_develop_structure.md.B-0RMSSw.lean.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as e,c as o,o as c,a1 as d}from"./chunks/framework.gjrnbxUT.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}; diff --git a/assets/zh_develop_structure.md.DStJTsYD.js b/assets/zh_develop_structure.md.DStJTsYD.js new file mode 100644 index 00000000..8ed0c71a --- /dev/null +++ b/assets/zh_develop_structure.md.DStJTsYD.js @@ -0,0 +1,10 @@ +import{_ as o,c as d,o as c,af as a}from"./chunks/framework.PeLcR_tw.js";const m=JSON.parse('{"title":"项目结构简介","description":"","frontmatter":{},"headers":[],"relativePath":"zh/develop/structure.md","filePath":"zh/develop/structure.md"}'),t={name:"zh/develop/structure.md"};function p(r,e,i,s,l,n){return c(),d("div",null,e[0]||(e[0]=[a(`

项目结构简介

static-php-cli 主要包含三种逻辑组件:资源、依赖库、扩展。这三种组件四个配置文件:source.jsonlib.jsonext.jsonpkg.json

一个完整的构建静态 PHP 流程是:

  1. 使用资源下载模块 Downloader 下载指定或所有资源,这些资源包含 PHP 源码、依赖库源码、扩展源码。
  2. 使用资源解压模块 SourceExtractor 解压下载的资源到编译目录。
  3. 使用依赖工具计算出当前加入的扩展的依赖扩展、依赖库,然后对每个需要编译的依赖库进行编译,按照依赖顺序。
  4. 使用对应操作系统下的 Builder 构建每个依赖库后,将其安装到 buildroot 目录。
  5. 如果包含外部扩展(源码没有包含在 PHP 内的扩展),将外部扩展拷贝到 source/php-src/ext/ 目录。
  6. 使用 Builder 构建 PHP 源码,将其安装到 buildroot 目录。

项目主要分为几个文件夹:

  • bin/: 用于存放程序入口文件,包含 bin/spcbin/spc-alpine-dockerbin/setup-runtime
  • config/: 包含了所有项目支持的扩展、依赖库以及这些资源下载的地址、下载方式等,:lib.jsonext.jsonsource.jsonpkg.jsonpre-built.json
  • src/SPC/: 项目的核心代码,包含了整个框架以及编译各种扩展和库的命令。
  • src/globals/: 项目的全局方法和常量、运行时需要的测试文件(例如:扩展的可用性检查代码)。
  • vendor/: Composer 依赖的目录,你无需对它做出任何修改。

其中运行原理就是启动一个 symfony/consoleConsoleApplication,然后解析用户在终端输入的命令。

基本命令行结构

bin/spc 是一个 PHP 代码入口文件,包含了 Unix 通用的 #!/usr/bin/env php 用来让系统自动以系统安装好的 PHP 解释器执行。 在项目执行了 new ConsoleApplication() 后,框架会自动使用反射的方式,解析 src/SPC/command 目录下的所有类,并将其注册成为命令。

项目并没有直接使用 Symfony 推荐的 Command 注册方式和命令执行方式,这里做出了一点小变动:

  1. 每个命令都使用 #[AsCommand()] Attribute 来注册名称和简介。
  2. execute() 抽象化,让所有命令基于 BaseCommand(它基于 Symfony\\Component\\Console\\Command\\Command),每个命令本身的执行代码写到了 handle() 方法中。
  3. BaseCommand 添加了变量 $no_motd,用于是否在该命令执行时显示 Figlet 欢迎词。
  4. BaseCommandInputInterfaceOutputInterface 保存为成员变量,你可以在命令的类内使用 $this->input$this->output

基本源码结构

项目的源码位于 src/SPC 目录,支持 PSR-4 标准的自动加载,包含以下子目录和类:

  • src/SPC/builder/: 用于不同操作系统下构建依赖库、PHP 及相关扩展的核心编译命令代码,还包含了一些编译的系统工具方法。
  • src/SPC/command/: 项目的所有命令都在这里。
  • src/SPC/doctor/: Doctor 模块,它是一个较为独立的用于检查系统环境的模块,可使用命令 bin/spc doctor 进入。
  • src/SPC/exception/: 异常类。
  • src/SPC/store/: 有关存储、文件和资源的类都在这里。
  • src/SPC/util/: 一些可以复用的工具方法都在这里。
  • src/SPC/ConsoleApplication.php: 命令行程序入口文件。

如果你阅读过源码,你可能会发现还有一个 src/globals/ 目录,它是用于存放一些全局变量、全局方法、构建过程中依赖的非 PSR-4 标准的 PHP 源码,例如测试扩展代码等。

Phar 应用目录问题

和其他 php-cli 项目一样,spc 自身对路径有额外的考虑。 因为 spc 可以在 php-cli directlymicro SAPIphp-cli with Pharvendor with Phar 等多种模式下运行,各类根目录存在歧义。这里会进行一个完整的说明。 此问题一般常见于 PHP 项目中存取文件的基类路径选择问题,尤其是在配合 micro.sfx 使用时容易出现路径问题。

注意,此处仅对你在开发 Phar 项目或 PHP 框架时可能有用。

接下来我们都将 static-php-cli(也就是 spc)当作一个普通的 php 命令行程序来看,你可以将 spc 理解为你自己的任何 php-cli 应用以参考。

下面主要有三个基本的常量理论值,我们建议你在编写 php 项目时引入这三种常量:

  • WORKING_DIR:执行 PHP 脚本时的工作目录
  • SOURCE_ROOT_DIRROOT_DIR:项目文件夹的根目录,一般为 composer.json 所在目录
  • FRAMEWORK_ROOT_DIR:使用框架的根目录,自行开发的框架可能会用到,一般框架目录为只读

你可以在你的框架或者 cli 应用程序入口中定义这些常量,以方便在你的项目中使用路径。

下面是 PHP 内置的常量值,在 PHP 解释器内部已被定义:

  • __DIR__:当前执行脚本的文件所在目录
  • __FILE__:当前执行脚本的文件路径

Git 项目模式(source)

Git 项目模式指的是一个框架或程序本身在当前文件夹以纯文本形式存放,运行通过 php path/to/entry.php 方式。

假设你的项目存放在 /home/example/static-php-cli/ 目录下,或你的项目就是框架本身,里面包含 composer.json 等项目文件:

composer.json
+src/App/MyCommand.app
+vendor/*
+bin/entry.php

我们假设从 src/App/MyCommand.php 中获取以上常量:

ConstantValue
WORKING_DIR/home/example/static-php-cli
SOURCE_ROOT_DIR/home/example/static-php-cli
FRAMEWORK_ROOT_DIR/home/example/static-php-cli
__DIR__/home/example/static-php-cli/src/App
__FILE__/home/example/static-php-cli/src/App/MyCommand.php

这种情况下,WORKING_DIRSOURCE_ROOT_DIRFRAMEWORK_ROOT_DIR 的值是完全一致的:/home/example/static-php-cli。 框架的源码和应用的源码都在当前路径下。

Vendor 库模式(vendor)

Vendor 库模式一般是指你的项目为框架类或者被其他应用作为 composer 依赖项安装到项目中,存放位置在 vendor/author/XXX 目录。

假设你的项目是 crazywhalecc/static-php-cli,你或其他人在另一个项目使用 composer require 安装了这个项目。

我们假设 static-php-cli 中包含同 Git 模式 的除 vendor 目录外的所有文件,并从 src/App/MyCommand 中获取常量值, 目录常量应该是:

ConstantValue
WORKING_DIR/home/example/another-app
SOURCE_ROOT_DIR/home/example/another-app
FRAMEWORK_ROOT_DIR/home/example/another-app/vendor/crazywhalecc/static-php-cli
__DIR__/home/example/another-app/vendor/crazywhalecc/static-php-cli/src/App
__FILE__/home/example/another-app/vendor/crazywhalecc/static-php-cli/src/App/MyCommand.php

这里的 SOURCE_ROOT_DIR 就指的是使用 static-php-cli 的项目的根目录。

Git 项目 Phar 模式(source-phar)

Git 项目 Phar 模式指的是将 Git 项目模式的项目目录打包为一个 phar 文件的模式。我们假设 /home/example/static-php-cli 将打包为一个 Phar 文件,目录有以下文件:

composer.json
+src/App/MyCommand.app
+vendor/*
+bin/entry.php

打包为 app.phar 并存放到 /home/example/static-php-cli 目录下时,此时执行 app.phar,假设执行了 src/App/MyCommand 代码,常量在该文件内获取:

ConstantValue
WORKING_DIR/home/example/static-php-cli
SOURCE_ROOT_DIRphar:///home/example/static-php-cli/app.phar/
FRAMEWORK_ROOT_DIRphar:///home/example/static-php-cli/app.phar/
__DIR__phar:///home/example/static-php-cli/app.phar/src/App
__FILE__phar:///home/example/static-php-cli/app.phar/src/App/MyCommand.php

因为在 phar 内读取自身 phar 的文件需要 phar:// 协议进行,所以项目根目录和框架目录将会和 WORKING_DIR 不同。

Vendor 库 Phar 模式(vendor-phar)

Vendor 库 Phar 模式指的是你的项目作为框架安装在其他项目内,存储于 vendor 目录下。

我们假设你的项目目录结构如下:

composer.json # 当前项目的 Composer 配置文件
+box.json # 打包 Phar 的配置文件
+another-app.php # 另一个项目的入口文件
+vendor/crazywhalecc/static-php-cli/* # 你的项目被作为依赖库

将该目录 /home/example/another-app/ 下的这些文件打包为 app.phar 时,对于你的项目而言,下面常量的值应为:

ConstantValue
WORKING_DIR/home/example/another-app
SOURCE_ROOT_DIRphar:///home/example/another-app/app.phar/
FRAMEWORK_ROOT_DIRphar:///home/example/another-app/app.phar/vendor/crazywhalecc/static-php-cli
__DIR__phar:///home/example/another-app/app.phar/vendor/crazywhalecc/static-php-cli/src/App
__FILE__phar:///home/example/another-app/app.phar/vendor/crazywhalecc/static-php-cli/src/App/MyCommand.php
`,49)]))}const _=o(t,[["render",p]]);export{m as __pageData,_ as default}; diff --git a/assets/zh_develop_structure.md.DStJTsYD.lean.js b/assets/zh_develop_structure.md.DStJTsYD.lean.js new file mode 100644 index 00000000..1d26063d --- /dev/null +++ b/assets/zh_develop_structure.md.DStJTsYD.lean.js @@ -0,0 +1 @@ +import{_ as o,c as d,o as c,af as a}from"./chunks/framework.PeLcR_tw.js";const m=JSON.parse('{"title":"项目结构简介","description":"","frontmatter":{},"headers":[],"relativePath":"zh/develop/structure.md","filePath":"zh/develop/structure.md"}'),t={name:"zh/develop/structure.md"};function p(r,e,i,s,l,n){return c(),d("div",null,e[0]||(e[0]=[a("",49)]))}const _=o(t,[["render",p]]);export{m as __pageData,_ as default}; diff --git a/assets/zh_develop_system-build-tools.md.Ds53VEw1.js b/assets/zh_develop_system-build-tools.md.CxPkPV_h.js similarity index 53% rename from assets/zh_develop_system-build-tools.md.Ds53VEw1.js rename to assets/zh_develop_system-build-tools.md.CxPkPV_h.js index 25d9e227..cc2c3643 100644 --- a/assets/zh_develop_system-build-tools.md.Ds53VEw1.js +++ b/assets/zh_develop_system-build-tools.md.CxPkPV_h.js @@ -1,4 +1,4 @@ -import{_ as s,c as i,o as a,a1 as l}from"./chunks/framework.gjrnbxUT.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(`

系统编译工具

static-php-cli 在构建静态 PHP 时使用了许多系统编译工具,这些工具主要包括:

  • autoconf: 用于生成 configure 脚本。
  • make: 用于执行 Makefile
  • cmake: 用于执行 CMakeLists.txt
  • pkg-config: 用于查找依赖库的安装路径。
  • gcc: 用于在 Linux 下编译 C/C++ 语言代码。
  • clang: 用于在 macOS 下编译 C/C++ 语言代码。

对于 Linux 和 macOS 操作系统,这些工具通常可以通过包管理安装,这部分在 doctor 模块中编写了。 理论上我们也可以通过编译和手动下载这些工具,但这样会增加编译的复杂度,所以我们不推荐这样做。

Linux 环境编译工具

对于 Linux 系统来说,不同发行版的编译工具安装方式不同。而且对于静态编译来说,某些发行版的包管理无法安装用于纯静态编译的库和工具, 所以对于 Linux 平台及其不同发行版,我们目前提供了多种编译环境的部署措施。

glibc 环境

glibc 环境指的是系统底层的 libc 库(即所有 C 语言编写的程序动态链接的 C 标准库)使用的是 glibc,这是大多数发行版的默认环境。 例如:Ubuntu、Debian、CentOS、RHEL、openSUSE、Arch Linux 等。

而 glibc 环境下,我们使用的包管理、编译器都是默认指向 glibc 的,glibc 不能被良好地静态链接。它不能被静态链接的原因之一是它的网络库 nss 无法静态编译。

对于 glibc 环境,在 2.0 RC8 及以后的 static-php-cli 及 spc 中,你可以选择两种方式来构建静态 PHP:

  1. 使用 Docker 构建,这是最简单的方式,你可以使用 bin/spc-alpine-docker 来构建,它会在 Alpine Linux 环境下构建。
  2. 使用 bin/spc doctor 安装 musl-wrapper 和 musl-cross-make 套件,然后直接正常构建。(相关源码

一般来说,这两种构建方式的构建结果是一致的,你可以根据实际需求选择。

在 doctor 模块中,static-php-cli 会先检测当前的 Linux 发行版。如果当前发行版是 glibc 环境,会提示需要安装 musl-wrapper 和 musl-cross-make 套件。

在 glibc 环境下安装 musl-wrapper 的过程如下:

  1. 从 musl 官网下载特定版本的 musl-wrapper 源码
  2. 使用从包管理安装的 gcc 编译 musl-wrapper 源码,生成 musl-libc 等库:./configure --disable-gcc-wrapper && make -j && sudo make install
  3. musl-wrapper 相关库将被安装在 /usr/local/musl 目录。

在 glibc 环境下安装 musl-cross-make 的过程如下:

  1. 从 dl.static-php.dev 下载预编译好的 musl-cross-make 压缩包。
  2. 解压到 /usr/local/musl 目录。

TIP

在 glibc 环境下,静态编译可以通过直接安装 musl-wrapper 来实现,但是 musl-wrapper 仅包含了 musl-gcc,而没有 musl-g++,这也就意味着无法编译 C++ 代码。 所以我们需要 musl-cross-make 来提供 musl-g++

而 musl-cross-make 套件无法在本地直接编译的原因是它的编译环境要求比较高(需要 36GB 以上内存,Alpine Linux 下编译),所以我们提供了预编译好的二进制包,可用于所有 Linux 发行版。

同时,部分发行版的包管理提供了 musl-wrapper,但 musl-cross-make 需要匹配对应的 musl-wrapper 版本,所以我们不使用包管理安装 musl-wrapper。

对于如何编译 musl-cross-make,将在本章节内的 编译 musl-cross-make 小节中介绍。

musl 环境

musl 环境指的是系统底层的 libc 库使用的是 musl,这是一种轻量级的 C 标准库,它的特点是可以被良好地静态链接。

对于目前流行的 Linux 发行版,Alpine Linux 使用的就是 musl 环境,所以 static-php-cli 在 Alpine Linux 下可以直接构建静态 PHP,仅需直接从包管理安装基础编译工具(如 gcc、cmake 等)即可。

对于其他发行版,如果你的发行版使用的是 musl 环境,那么你也可以在安装必要的编译工具后直接使用 static-php-cli 构建静态 PHP。

TIP

在 musl 环境下,static-php-cli 会自动跳过 musl-wrapper 和 musl-cross-make 的安装。

Docker 环境

Docker 环境指的是使用 Docker 容器来构建静态 PHP,你可以使用 bin/spc-alpine-docker 来构建。 执行这个命令前需要先安装 Docker,然后在项目根目录执行 bin/spc-alpine-docker 即可。

在执行 bin/spc-alpine-docker 后,static-php-cli 会自动下载 Alpine Linux 镜像,然后构建一个 cwcc-spc-x86_64cwcc-spc-aarch64 的镜像。 然后一切的构建都在这个镜像内进行,相当于在 Alpine Linux 内编译。总的来说,Docker 环境就是 musl 环境。

musl-cross-make 工具链编译

在 Linux 中,尽管你不需要手动编译 musl-cross-make 工具,但是如果你想了解它的编译过程,可以参考这里。 还有一个重要的原因就是,这个可能无法使用 CI、Actions 等自动化工具编译,因为现有的 CI 服务编译环境不满足 musl-cross-make 的编译要求,满足要求的配置价格太高。

musl-cross-make 的编译过程如下:

准备一个 Alpine Linux 环境(直接安装或使用 Docker 均可),编译的过程需要 36GB 以上内存,所以你需要在内存较大的机器上编译。如果没有这么多内存,可能会导致编译失败。

然后将以下内容写入 config.mak 文件内:

makefile
STAT = -static --static
+import{_ as i,c as a,o as l,af as n}from"./chunks/framework.PeLcR_tw.js";const o=JSON.parse('{"title":"系统编译工具","description":"","frontmatter":{},"headers":[],"relativePath":"zh/develop/system-build-tools.md","filePath":"zh/develop/system-build-tools.md"}'),p={name:"zh/develop/system-build-tools.md"};function e(h,s,k,t,c,d){return l(),a("div",null,s[0]||(s[0]=[n(`

系统编译工具

static-php-cli 在构建静态 PHP 时使用了许多系统编译工具,这些工具主要包括:

  • autoconf: 用于生成 configure 脚本。
  • make: 用于执行 Makefile
  • cmake: 用于执行 CMakeLists.txt
  • pkg-config: 用于查找依赖库的安装路径。
  • gcc: 用于在 Linux 下编译 C/C++ 语言代码。
  • clang: 用于在 macOS 下编译 C/C++ 语言代码。

对于 Linux 和 macOS 操作系统,这些工具通常可以通过包管理安装,这部分在 doctor 模块中编写了。 理论上我们也可以通过编译和手动下载这些工具,但这样会增加编译的复杂度,所以我们不推荐这样做。

Linux 环境编译工具

对于 Linux 系统来说,不同发行版的编译工具安装方式不同。而且对于静态编译来说,某些发行版的包管理无法安装用于纯静态编译的库和工具, 所以对于 Linux 平台及其不同发行版,我们目前提供了多种编译环境的部署措施。

glibc 环境

glibc 环境指的是系统底层的 libc 库(即所有 C 语言编写的程序动态链接的 C 标准库)使用的是 glibc,这是大多数发行版的默认环境。 例如:Ubuntu、Debian、CentOS、RHEL、openSUSE、Arch Linux 等。

而 glibc 环境下,我们使用的包管理、编译器都是默认指向 glibc 的,glibc 不能被良好地静态链接。它不能被静态链接的原因之一是它的网络库 nss 无法静态编译。

对于 glibc 环境,在 2.0 RC8 及以后的 static-php-cli 及 spc 中,你可以选择两种方式来构建静态 PHP:

  1. 使用 Docker 构建,这是最简单的方式,你可以使用 bin/spc-alpine-docker 来构建,它会在 Alpine Linux 环境下构建。
  2. 使用 bin/spc doctor 安装 musl-wrapper 和 musl-cross-make 套件,然后直接正常构建。(相关源码

一般来说,这两种构建方式的构建结果是一致的,你可以根据实际需求选择。

在 doctor 模块中,static-php-cli 会先检测当前的 Linux 发行版。如果当前发行版是 glibc 环境,会提示需要安装 musl-wrapper 和 musl-cross-make 套件。

在 glibc 环境下安装 musl-wrapper 的过程如下:

  1. 从 musl 官网下载特定版本的 musl-wrapper 源码
  2. 使用从包管理安装的 gcc 编译 musl-wrapper 源码,生成 musl-libc 等库:./configure --disable-gcc-wrapper && make -j && sudo make install
  3. musl-wrapper 相关库将被安装在 /usr/local/musl 目录。

在 glibc 环境下安装 musl-cross-make 的过程如下:

  1. 从 dl.static-php.dev 下载预编译好的 musl-cross-make 压缩包。
  2. 解压到 /usr/local/musl 目录。

TIP

在 glibc 环境下,静态编译可以通过直接安装 musl-wrapper 来实现,但是 musl-wrapper 仅包含了 musl-gcc,而没有 musl-g++,这也就意味着无法编译 C++ 代码。 所以我们需要 musl-cross-make 来提供 musl-g++

而 musl-cross-make 套件无法在本地直接编译的原因是它的编译环境要求比较高(需要 36GB 以上内存,Alpine Linux 下编译),所以我们提供了预编译好的二进制包,可用于所有 Linux 发行版。

同时,部分发行版的包管理提供了 musl-wrapper,但 musl-cross-make 需要匹配对应的 musl-wrapper 版本,所以我们不使用包管理安装 musl-wrapper。

对于如何编译 musl-cross-make,将在本章节内的 编译 musl-cross-make 小节中介绍。

musl 环境

musl 环境指的是系统底层的 libc 库使用的是 musl,这是一种轻量级的 C 标准库,它的特点是可以被良好地静态链接。

对于目前流行的 Linux 发行版,Alpine Linux 使用的就是 musl 环境,所以 static-php-cli 在 Alpine Linux 下可以直接构建静态 PHP,仅需直接从包管理安装基础编译工具(如 gcc、cmake 等)即可。

对于其他发行版,如果你的发行版使用的是 musl 环境,那么你也可以在安装必要的编译工具后直接使用 static-php-cli 构建静态 PHP。

TIP

在 musl 环境下,static-php-cli 会自动跳过 musl-wrapper 和 musl-cross-make 的安装。

Docker 环境

Docker 环境指的是使用 Docker 容器来构建静态 PHP,你可以使用 bin/spc-alpine-docker 来构建。 执行这个命令前需要先安装 Docker,然后在项目根目录执行 bin/spc-alpine-docker 即可。

在执行 bin/spc-alpine-docker 后,static-php-cli 会自动下载 Alpine Linux 镜像,然后构建一个 cwcc-spc-x86_64cwcc-spc-aarch64 的镜像。 然后一切的构建都在这个镜像内进行,相当于在 Alpine Linux 内编译。总的来说,Docker 环境就是 musl 环境。

musl-cross-make 工具链编译

在 Linux 中,尽管你不需要手动编译 musl-cross-make 工具,但是如果你想了解它的编译过程,可以参考这里。 还有一个重要的原因就是,这个可能无法使用 CI、Actions 等自动化工具编译,因为现有的 CI 服务编译环境不满足 musl-cross-make 的编译要求,满足要求的配置价格太高。

musl-cross-make 的编译过程如下:

准备一个 Alpine Linux 环境(直接安装或使用 Docker 均可),编译的过程需要 36GB 以上内存,所以你需要在内存较大的机器上编译。如果没有这么多内存,可能会导致编译失败。

然后将以下内容写入 config.mak 文件内:

makefile
STAT = -static --static
 FLAG = -g0 -Os -Wno-error
 
 ifneq ($(NATIVE),)
@@ -20,7 +20,7 @@ import{_ as s,c as i,o as a,a1 as l}from"./chunks/framework.gjrnbxUT.js";const g
 GMP_VER = 6.2.1
 MPC_VER = 1.2.1
 MPFR_VER = 4.2.0
-LINUX_VER = 6.1.36

同时,你需要新建一个 gcc-13.2.0.tar.xz.sha1 文件,文件内容如下:

5f95b6d042fb37d45c6cbebfc91decfbc4fb493c  gcc-13.2.0.tar.xz

如果你使用的是 Docker 构建,新建一个 Dockerfile 文件,写入以下内容:

dockerfile
FROM alpine:edge
+LINUX_VER = 6.1.36

同时,你需要新建一个 gcc-13.2.0.tar.xz.sha1 文件,文件内容如下:

5f95b6d042fb37d45c6cbebfc91decfbc4fb493c  gcc-13.2.0.tar.xz

如果你使用的是 Docker 构建,新建一个 Dockerfile 文件,写入以下内容:

dockerfile
FROM alpine:edge
 
 RUN apk add --no-cache \\
 gcc g++ git make curl perl \\
@@ -44,7 +44,7 @@ import{_ as s,c as i,o as a,a1 as l}from"./chunks/framework.gjrnbxUT.js";const g
 RUN sed -i 's/poison calloc/poison/g' ./gcc-13.2.0/gcc/system.h
 RUN make TARGET=x86_64-linux-musl -j
 RUN make TARGET=x86_64-linux-musl install -j
-RUN tar cvzf x86_64-musl-toolchain.tgz output/*

如果你使用的是非 Docker 环境的 Alpine Linux,可以直接执行 Dockerfile 中的命令,例如:

bash
apk add --no-cache \\
+RUN tar cvzf x86_64-musl-toolchain.tgz output/*

如果你使用的是非 Docker 环境的 Alpine Linux,可以直接执行 Dockerfile 中的命令,例如:

bash
apk add --no-cache \\
 gcc g++ git make curl perl \\
 rsync patch wget libtool \\
 texinfo autoconf automake \\
@@ -64,4 +64,4 @@ import{_ as s,c as i,o as a,a1 as l}from"./chunks/framework.gjrnbxUT.js";const g
 sed -i 's/poison calloc/poison/g' ./gcc-13.2.0/gcc/system.h
 make TARGET=x86_64-linux-musl -j
 make TARGET=x86_64-linux-musl install -j
-tar cvzf x86_64-musl-toolchain.tgz output/*

TIP

以上所有脚本都适用于 x86_64 架构的 Linux。如果你需要构建 ARM 环境的 musl-cross-make,只需要将上方所有 x86_64 替换为 aarch64 即可。

这个编译过程可能会因为内存不足、网络问题等原因导致编译失败,你可以多尝试几次,或者使用更大内存的机器来编译。 如果遇到了问题,或者你有更好的改进方案,可以在 讨论 中提出。

macOS 环境编译工具

对于 macOS 系统来说,我们使用的编译工具主要是 clang,它是 macOS 系统默认的编译器,同时也是 Xcode 的编译器。

在 macOS 下编译,主要依赖于 Xcode 或 Xcode Command Line Tools,你可以在 App Store 下载 Xcode,或者在终端执行 xcode-select --install 来安装 Xcode Command Line Tools。

此外,在 doctor 环境检查模块中,static-php-cli 会检查 macOS 系统是否安装了 Homebrew、编译工具等,如果没有,会提示你安装,这里不再赘述。

FreeBSD 环境编译工具

FreeBSD 也是 Unix 系统,它的编译工具和 macOS 类似,你可以直接使用包管理 pkg 安装 clang 等编译工具,通过 doctor 命令。

pkg-config 编译

如果你在使用 static-php-cli 构建静态 PHP 时仔细观察编译的日志,你会发现无论编译什么,都会先编译 pkg-config,这是因为 pkg-config 是一个用于查找依赖库的工具。 在早期的 static-php-cli 版本中,我们直接使用了包管理安装的 pkg-config 工具,但是这样会导致一些问题,例如:

  • 即使指定了 PKG_CONFIG_PATHpkg-config 也会尝试从系统路径中查找依赖包。
  • 由于 pkg-config 会从系统路径中查找依赖包,所以如果系统中存在同名的依赖包,可能会导致编译失败。

为了避免以上问题,我们将 pkg-config 编译到用户态的 buildroot/bin 内并使用,使用了 --without-sysroot 等参数来避免从系统路径中查找依赖包。

`,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}; +tar cvzf x86_64-musl-toolchain.tgz output/*

TIP

以上所有脚本都适用于 x86_64 架构的 Linux。如果你需要构建 ARM 环境的 musl-cross-make,只需要将上方所有 x86_64 替换为 aarch64 即可。

这个编译过程可能会因为内存不足、网络问题等原因导致编译失败,你可以多尝试几次,或者使用更大内存的机器来编译。 如果遇到了问题,或者你有更好的改进方案,可以在 讨论 中提出。

macOS 环境编译工具

对于 macOS 系统来说,我们使用的编译工具主要是 clang,它是 macOS 系统默认的编译器,同时也是 Xcode 的编译器。

在 macOS 下编译,主要依赖于 Xcode 或 Xcode Command Line Tools,你可以在 App Store 下载 Xcode,或者在终端执行 xcode-select --install 来安装 Xcode Command Line Tools。

此外,在 doctor 环境检查模块中,static-php-cli 会检查 macOS 系统是否安装了 Homebrew、编译工具等,如果没有,会提示你安装,这里不再赘述。

FreeBSD 环境编译工具

FreeBSD 也是 Unix 系统,它的编译工具和 macOS 类似,你可以直接使用包管理 pkg 安装 clang 等编译工具,通过 doctor 命令。

pkg-config 编译

如果你在使用 static-php-cli 构建静态 PHP 时仔细观察编译的日志,你会发现无论编译什么,都会先编译 pkg-config,这是因为 pkg-config 是一个用于查找依赖库的工具。 在早期的 static-php-cli 版本中,我们直接使用了包管理安装的 pkg-config 工具,但是这样会导致一些问题,例如:

  • 即使指定了 PKG_CONFIG_PATHpkg-config 也会尝试从系统路径中查找依赖包。
  • 由于 pkg-config 会从系统路径中查找依赖包,所以如果系统中存在同名的依赖包,可能会导致编译失败。

为了避免以上问题,我们将 pkg-config 编译到用户态的 buildroot/bin 内并使用,使用了 --without-sysroot 等参数来避免从系统路径中查找依赖包。

`,50)]))}const E=i(p,[["render",e]]);export{o as __pageData,E as default}; diff --git a/assets/zh_develop_system-build-tools.md.CxPkPV_h.lean.js b/assets/zh_develop_system-build-tools.md.CxPkPV_h.lean.js new file mode 100644 index 00000000..d1397476 --- /dev/null +++ b/assets/zh_develop_system-build-tools.md.CxPkPV_h.lean.js @@ -0,0 +1 @@ +import{_ as i,c as a,o as l,af as n}from"./chunks/framework.PeLcR_tw.js";const o=JSON.parse('{"title":"系统编译工具","description":"","frontmatter":{},"headers":[],"relativePath":"zh/develop/system-build-tools.md","filePath":"zh/develop/system-build-tools.md"}'),p={name:"zh/develop/system-build-tools.md"};function e(h,s,k,t,c,d){return l(),a("div",null,s[0]||(s[0]=[n("",50)]))}const E=i(p,[["render",e]]);export{o as __pageData,E as default}; diff --git a/assets/zh_develop_system-build-tools.md.Ds53VEw1.lean.js b/assets/zh_develop_system-build-tools.md.Ds53VEw1.lean.js deleted file mode 100644 index 367ede73..00000000 --- a/assets/zh_develop_system-build-tools.md.Ds53VEw1.lean.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as s,c as i,o as a,a1 as l}from"./chunks/framework.gjrnbxUT.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}; diff --git a/assets/zh_faq_index.md.CGJwisr-.js b/assets/zh_faq_index.md.CGJwisr-.js deleted file mode 100644 index 57df4da3..00000000 --- a/assets/zh_faq_index.md.CGJwisr-.js +++ /dev/null @@ -1,5 +0,0 @@ -import{_ as i,c as e,o as a,a1 as s}from"./chunks/framework.gjrnbxUT.js";const P=JSON.parse('{"title":"常见问题","description":"","frontmatter":{},"headers":[],"relativePath":"zh/faq/index.md","filePath":"zh/faq/index.md"}'),o={name:"zh/faq/index.md"},p=s(`

常见问题

这里将会编写一些你容易遇到的问题。目前有很多,但是我需要花时间来整理一下。

php.ini 的路径是什么?

在 Linux、macOS 和 FreeBSD 上,php.ini 的默认路径是 /usr/local/etc/php/php.ini。 在 Windows 中,路径是 C:\\windows\\php.iniphp.exe 所在的当前目录。 可以在 *nix 系统中使用手动构建选项 --with-config-file-path 来更改查找 php.ini 的目录。

此外,在 Linux、macOS 和 FreeBSD 上,/usr/local/etc/php/conf.d 目录中的 *.ini 文件也会被加载。 在 Windows 中,该路径默认为空。 可以使用手动构建选项 --with-config-file-scan-dir 更改该目录。

PHP 默认也会从 其他标准位置 中搜索 php.ini

静态编译的 PHP 可以安装扩展吗

因为传统架构下的 PHP 安装扩展的原理是使用 .so 类型的动态链接的库方式安装新扩展,而使用本项目编译的静态链接的 PHP。但是静态链接在不同操作系统有不同的定义。

首先对于 Linux 系统来说,静态链接的二进制文件是不会链接系统的动态链接库的,纯静态链接的二进制无法加载动态库,所以无法添加新的扩展。 同时,在纯静态模式下你也不能使用 ffi 等扩展加载外部的 .so 模块。

你可以通过命令 ldd buildroot/bin/php 来查看你在 Linux 下构建的二进制是否为纯静态链接的。

如果你 构建 GNU libc 兼容的 PHP,你可以使用 ffi 扩展加载外部的 .so 模块,并且加载具有相同 ABI 的 .so 扩展。

例如,你可以使用以下命令构建一个 glibc 动态链接的静态 PHP 二进制,同时支持 FFI 扩展和加载相同 PHP 版本和相同 TS 类型的 xdebug.so 扩展:

bash
bin/spc-gnu-docker download --for-extensions=ffi,xml --with-php=8.4
-bin/spc-gnu-docker build ffi,xml --build-cli --debug
-
-buildroot/bin/php -d "zend_extension=/path/to/php{PHP_VER}-{ts/nts}/xdebug.so" --ri xdebug

对于 macOS 平台来说,macOS 下的几乎所有二进制文件都无法真正纯静态链接,几乎所有二进制文件都会链接 macOS 的系统库:/usr/lib/libresolv.9.dylib/usr/lib/libSystem.B.dylib。 所以在 macOS 系统下,在特定的编译条件下可以使用静态编译的 php 二进制文件,可使用动态链接的扩展:

  1. 使用 --no-strip 参数,将不会对二进制文件去除调试符号等信息,以供使用 Xdebug 等外部 Zend 扩展。
  2. 如果要编译某些 Zend 扩展,使用 Homebrew、MacPorts、源码编译的形式,在所在的操作系统安装一个普通版本的 PHP。
  3. 使用 phpize && ./configure && make 命令编译想要使用的扩展。
  4. 将扩展文件 xxxx.so 拷贝到外部,使用静态编译的 PHP 二进制,例如使用 Xdebug 扩展:cd buildroot/bin/ && ./php -d "zend_extension=/path/to/xdebug.so"
bash
# 构建静态 php-cli
-bin/spc build ffi --build-cli --no-strip

可以支持 Oracle 数据库扩展吗

部分依赖库闭源的扩展,如 oci8sourceguardian 等,它们没有提供纯静态编译的依赖库文件(.a),仅提供了动态依赖库文件(.so), 这些扩展无法使用源码的形式编译到 static-php-cli 中,所以本项目可能永远也不会支持这些扩展。不过,理论上你可以根据上面的问题在 macOS 和 Linux 下接入和使用这类扩展。

如果你对此类扩展有需求,或者大部分人都对这些闭源扩展使用有需求, 可以看看有关 standalone-php-cli 的讨论。欢迎留言。

支持 Windows 吗

该项目目前已支持 Windows,但支持的扩展数量较少,Windows 的支持并不完美,主要有以下几个问题:

  1. Windows 的编译流程与 *nix 不同,使用的工具链也不同,编译各个扩展的依赖库使用的编译工具也几乎完全不同。
  2. Windows 版本的需求也会根据所有使用本项目的人的需求推进,如果有很多人需要,我会尽快支持相关扩展。

使用 micro 可以保护我的源码吗

不可以。micro.sfx 本质上是将 php 和 php 代码结合为一个文件,没有 PHP 代码编译或加密的过程。 首先 php-src 是 PHP 代码的官方解释器,而且现在市面上还没有一个能兼容主流分支的 PHP 编译器。 之前我在网上看到有一个项目是 BPC(Binary PHP Compiler?)可以把 PHP 编译为二进制,但是限制也是很多很多。

加密保护代码的方向和编译也不是一回事,编译过后也可以通过逆向工程等方式拿到代码,真正保护还是通过加壳、加密代码等手段进行。

所以本项目(static-php-cli)、相关项目(lwmbs、swoole-cli)都是提供一个对 php-src 源码的便捷编译工具, 本项目和相关项目引用的 phpmicro 也仅仅是 PHP 的 sapi 接口封装,而不是 PHP 代码的编译工具。 PHP 代码的编译器是完全不同的项目,因此不会考虑额外的情况。如果你对加密感兴趣,可以考虑使用现有的加密技术,如 Swoole Compiler、Source Guardian 等。

无法使用 ssl

更新:该问题已在最新版本的 static-php-cli 中修复,现在默认读取系统的证书文件。如果你仍然遇到问题,再尝试下方的解决方案。

使用 curl、pgsql 等 请求 HTTPS 网站或建立 SSL 连接时,可能存在 error:80000002:system library::No such file or directory 错误, 这个错误是由于静态编译的 PHP 未通过 php.ini 指定 openssl.cafile 导致的。

你可以在使用 PHP 前指定 php.ini,并在 INI 内添加 openssl.cafile=/path/to/your-cert.pem 来解决这个问题。

对于 Linux 系统,你可以从 curl 官方网站下载 cacert.pem 文件,也可以使用系统自带的证书文件。 有关不同发行版的证书位置,可参考 Go 标准库

INI 配置 openssl.cafile 不可以使用 ini_set() 函数动态设置,因为 openssl.cafile 是一个 PHP_INI_SYSTEM 类型的配置,只能在 php.ini 文件中设置。

为什么不支持旧版本 PHP ?

因为旧版本的 PHP 有很多问题,比如安全问题、性能问题、功能问题等。此外,旧版本的 PHP 很多都无法与最新的依赖库兼容,这也是不支持旧版本 PHP 的原因之一。

你可以使用 static-php-cli 早期编译好的旧版本,如 PHP 8.0,但是不会明确支持早期版本。

`,35),c=[p];function d(l,n,t,h,r,k){return a(),e("div",null,c)}const b=i(o,[["render",d]]);export{P as __pageData,b as default}; diff --git a/assets/zh_faq_index.md.CGJwisr-.lean.js b/assets/zh_faq_index.md.CGJwisr-.lean.js deleted file mode 100644 index a5f534f9..00000000 --- a/assets/zh_faq_index.md.CGJwisr-.lean.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as i,c as e,o as a,a1 as s}from"./chunks/framework.gjrnbxUT.js";const P=JSON.parse('{"title":"常见问题","description":"","frontmatter":{},"headers":[],"relativePath":"zh/faq/index.md","filePath":"zh/faq/index.md"}'),o={name:"zh/faq/index.md"},p=s("",35),c=[p];function d(l,n,t,h,r,k){return a(),e("div",null,c)}const b=i(o,[["render",d]]);export{P as __pageData,b as default}; diff --git a/assets/zh_faq_index.md.CZztxXAs.js b/assets/zh_faq_index.md.CZztxXAs.js new file mode 100644 index 00000000..990f8225 --- /dev/null +++ b/assets/zh_faq_index.md.CZztxXAs.js @@ -0,0 +1,5 @@ +import{_ as e,c as a,o as s,af as p}from"./chunks/framework.PeLcR_tw.js";const k=JSON.parse('{"title":"常见问题","description":"","frontmatter":{},"headers":[],"relativePath":"zh/faq/index.md","filePath":"zh/faq/index.md"}'),o={name:"zh/faq/index.md"};function l(c,i,d,n,h,t){return s(),a("div",null,i[0]||(i[0]=[p(`

常见问题

这里将会编写一些你容易遇到的问题。目前有很多,但是我需要花时间来整理一下。

php.ini 的路径是什么?

在 Linux、macOS 和 FreeBSD 上,php.ini 的默认路径是 /usr/local/etc/php/php.ini。 在 Windows 中,路径是 C:\\windows\\php.iniphp.exe 所在的当前目录。 可以在 *nix 系统中使用手动构建选项 --with-config-file-path 来更改查找 php.ini 的目录。

此外,在 Linux、macOS 和 FreeBSD 上,/usr/local/etc/php/conf.d 目录中的 *.ini 文件也会被加载。 在 Windows 中,该路径默认为空。 可以使用手动构建选项 --with-config-file-scan-dir 更改该目录。

PHP 默认也会从 其他标准位置 中搜索 php.ini

静态编译的 PHP 可以安装扩展吗

因为传统架构下的 PHP 安装扩展的原理是使用 .so 类型的动态链接的库方式安装新扩展,而使用本项目编译的静态链接的 PHP。但是静态链接在不同操作系统有不同的定义。

首先对于 Linux 系统来说,静态链接的二进制文件是不会链接系统的动态链接库的,纯静态链接的二进制无法加载动态库,所以无法添加新的扩展。 同时,在纯静态模式下你也不能使用 ffi 等扩展加载外部的 .so 模块。

你可以通过命令 ldd buildroot/bin/php 来查看你在 Linux 下构建的二进制是否为纯静态链接的。

如果你 构建 GNU libc 兼容的 PHP,你可以使用 ffi 扩展加载外部的 .so 模块,并且加载具有相同 ABI 的 .so 扩展。

例如,你可以使用以下命令构建一个 glibc 动态链接的静态 PHP 二进制,同时支持 FFI 扩展和加载相同 PHP 版本和相同 TS 类型的 xdebug.so 扩展:

bash
bin/spc-gnu-docker download --for-extensions=ffi,xml --with-php=8.4
+bin/spc-gnu-docker build ffi,xml --build-cli --debug
+
+buildroot/bin/php -d "zend_extension=/path/to/php{PHP_VER}-{ts/nts}/xdebug.so" --ri xdebug

对于 macOS 平台来说,macOS 下的几乎所有二进制文件都无法真正纯静态链接,几乎所有二进制文件都会链接 macOS 的系统库:/usr/lib/libresolv.9.dylib/usr/lib/libSystem.B.dylib。 所以在 macOS 系统下,在特定的编译条件下可以使用静态编译的 php 二进制文件,可使用动态链接的扩展:

  1. 使用 --no-strip 参数,将不会对二进制文件去除调试符号等信息,以供使用 Xdebug 等外部 Zend 扩展。
  2. 如果要编译某些 Zend 扩展,使用 Homebrew、MacPorts、源码编译的形式,在所在的操作系统安装一个普通版本的 PHP。
  3. 使用 phpize && ./configure && make 命令编译想要使用的扩展。
  4. 将扩展文件 xxxx.so 拷贝到外部,使用静态编译的 PHP 二进制,例如使用 Xdebug 扩展:cd buildroot/bin/ && ./php -d "zend_extension=/path/to/xdebug.so"
bash
# 构建静态 php-cli
+bin/spc build ffi --build-cli --no-strip

可以支持 Oracle 数据库扩展吗

部分依赖库闭源的扩展,如 oci8sourceguardian 等,它们没有提供纯静态编译的依赖库文件(.a),仅提供了动态依赖库文件(.so), 这些扩展无法使用源码的形式编译到 static-php-cli 中,所以本项目可能永远也不会支持这些扩展。不过,理论上你可以根据上面的问题在 macOS 和 Linux 下接入和使用这类扩展。

如果你对此类扩展有需求,或者大部分人都对这些闭源扩展使用有需求, 可以看看有关 standalone-php-cli 的讨论。欢迎留言。

支持 Windows 吗

该项目目前已支持 Windows,但支持的扩展数量较少,Windows 的支持并不完美,主要有以下几个问题:

  1. Windows 的编译流程与 *nix 不同,使用的工具链也不同,编译各个扩展的依赖库使用的编译工具也几乎完全不同。
  2. Windows 版本的需求也会根据所有使用本项目的人的需求推进,如果有很多人需要,我会尽快支持相关扩展。

使用 micro 可以保护我的源码吗

不可以。micro.sfx 本质上是将 php 和 php 代码结合为一个文件,没有 PHP 代码编译或加密的过程。 首先 php-src 是 PHP 代码的官方解释器,而且现在市面上还没有一个能兼容主流分支的 PHP 编译器。 之前我在网上看到有一个项目是 BPC(Binary PHP Compiler?)可以把 PHP 编译为二进制,但是限制也是很多很多。

加密保护代码的方向和编译也不是一回事,编译过后也可以通过逆向工程等方式拿到代码,真正保护还是通过加壳、加密代码等手段进行。

所以本项目(static-php-cli)、相关项目(lwmbs、swoole-cli)都是提供一个对 php-src 源码的便捷编译工具, 本项目和相关项目引用的 phpmicro 也仅仅是 PHP 的 sapi 接口封装,而不是 PHP 代码的编译工具。 PHP 代码的编译器是完全不同的项目,因此不会考虑额外的情况。如果你对加密感兴趣,可以考虑使用现有的加密技术,如 Swoole Compiler、Source Guardian 等。

无法使用 ssl

更新:该问题已在最新版本的 static-php-cli 中修复,现在默认读取系统的证书文件。如果你仍然遇到问题,再尝试下方的解决方案。

使用 curl、pgsql 等 请求 HTTPS 网站或建立 SSL 连接时,可能存在 error:80000002:system library::No such file or directory 错误, 这个错误是由于静态编译的 PHP 未通过 php.ini 指定 openssl.cafile 导致的。

你可以在使用 PHP 前指定 php.ini,并在 INI 内添加 openssl.cafile=/path/to/your-cert.pem 来解决这个问题。

对于 Linux 系统,你可以从 curl 官方网站下载 cacert.pem 文件,也可以使用系统自带的证书文件。 有关不同发行版的证书位置,可参考 Go 标准库

INI 配置 openssl.cafile 不可以使用 ini_set() 函数动态设置,因为 openssl.cafile 是一个 PHP_INI_SYSTEM 类型的配置,只能在 php.ini 文件中设置。

为什么不支持旧版本 PHP ?

因为旧版本的 PHP 有很多问题,比如安全问题、性能问题、功能问题等。此外,旧版本的 PHP 很多都无法与最新的依赖库兼容,这也是不支持旧版本 PHP 的原因之一。

你可以使用 static-php-cli 早期编译好的旧版本,如 PHP 8.0,但是不会明确支持早期版本。

`,35)]))}const b=e(o,[["render",l]]);export{k as __pageData,b as default}; diff --git a/assets/zh_faq_index.md.CZztxXAs.lean.js b/assets/zh_faq_index.md.CZztxXAs.lean.js new file mode 100644 index 00000000..967e4215 --- /dev/null +++ b/assets/zh_faq_index.md.CZztxXAs.lean.js @@ -0,0 +1 @@ +import{_ as e,c as a,o as s,af as p}from"./chunks/framework.PeLcR_tw.js";const k=JSON.parse('{"title":"常见问题","description":"","frontmatter":{},"headers":[],"relativePath":"zh/faq/index.md","filePath":"zh/faq/index.md"}'),o={name:"zh/faq/index.md"};function l(c,i,d,n,h,t){return s(),a("div",null,i[0]||(i[0]=[p("",35)]))}const b=e(o,[["render",l]]);export{k as __pageData,b as default}; diff --git a/assets/zh_guide_action-build.md.BWFrjWwZ.js b/assets/zh_guide_action-build.md.BWFrjWwZ.js new file mode 100644 index 00000000..cdc3f192 --- /dev/null +++ b/assets/zh_guide_action-build.md.BWFrjWwZ.js @@ -0,0 +1 @@ +import{_ as t,c as a,o,af as i}from"./chunks/framework.PeLcR_tw.js";const u=JSON.parse('{"title":"Action 构建","description":"","frontmatter":{},"headers":[],"relativePath":"zh/guide/action-build.md","filePath":"zh/guide/action-build.md"}'),c={name:"zh/guide/action-build.md"};function r(l,e,n,d,h,p){return o(),a("div",null,e[0]||(e[0]=[i('

Action 构建

Action 构建指的是直接使用 GitHub Action 进行编译。

如果你不想自行编译,可以从本项目现有的 Action 下载 Artifact,也可以从自托管的服务器下载:进入

自托管的二进制也是由 Action 构建而来,项目仓库地址

构建方法

使用 GitHub Action 可以方便地构建一个静态编译的 PHP 和 phpmicro,同时可以自行定义要编译的扩展。

  1. Fork 本项目。
  2. 进入项目的 Actions,选择 CI 开头的 Workflow(根据你需要的操作系统选择)。
  3. 选择 Run workflow,填入你要编译的 PHP 版本、目标类型、扩展列表。(扩展列表使用英文逗号分割,例如 bcmath,curl,mbstring
  4. 等待大约一段时间后,进入对应的任务中,获取 Artifacts

如果你选择了 debug,则会在构建时输出所有日志,包括编译的日志,以供排查错误。

如果你需要在其他环境构建,可以使用 手动构建

扩展选择

你可以到 扩展列表 中查看目前你需要的扩展是否均支持, 然后到 在线命令生成 中选择你需要编译的扩展,复制扩展字符串到 Action 的 extensions 中,编译即可。

',11)]))}const f=t(c,[["render",r]]);export{u as __pageData,f as default}; diff --git a/assets/zh_guide_action-build.md.BWFrjWwZ.lean.js b/assets/zh_guide_action-build.md.BWFrjWwZ.lean.js new file mode 100644 index 00000000..ed629ca3 --- /dev/null +++ b/assets/zh_guide_action-build.md.BWFrjWwZ.lean.js @@ -0,0 +1 @@ +import{_ as t,c as a,o,af as i}from"./chunks/framework.PeLcR_tw.js";const u=JSON.parse('{"title":"Action 构建","description":"","frontmatter":{},"headers":[],"relativePath":"zh/guide/action-build.md","filePath":"zh/guide/action-build.md"}'),c={name:"zh/guide/action-build.md"};function r(l,e,n,d,h,p){return o(),a("div",null,e[0]||(e[0]=[i("",11)]))}const f=t(c,[["render",r]]);export{u as __pageData,f as default}; diff --git a/assets/zh_guide_action-build.md.DWMlBDvT.js b/assets/zh_guide_action-build.md.DWMlBDvT.js deleted file mode 100644 index dd8200ae..00000000 --- a/assets/zh_guide_action-build.md.DWMlBDvT.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as t,c as e,o,a1 as a}from"./chunks/framework.gjrnbxUT.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('

Action 构建

Action 构建指的是直接使用 GitHub Action 进行编译。

如果你不想自行编译,可以从本项目现有的 Action 下载 Artifact,也可以从自托管的服务器下载:进入

自托管的二进制也是由 Action 构建而来,项目仓库地址

构建方法

使用 GitHub Action 可以方便地构建一个静态编译的 PHP 和 phpmicro,同时可以自行定义要编译的扩展。

  1. Fork 本项目。
  2. 进入项目的 Actions,选择 CI 开头的 Workflow(根据你需要的操作系统选择)。
  3. 选择 Run workflow,填入你要编译的 PHP 版本、目标类型、扩展列表。(扩展列表使用英文逗号分割,例如 bcmath,curl,mbstring
  4. 等待大约一段时间后,进入对应的任务中,获取 Artifacts

如果你选择了 debug,则会在构建时输出所有日志,包括编译的日志,以供排查错误。

如果你需要在其他环境构建,可以使用 手动构建

扩展选择

你可以到 扩展列表 中查看目前你需要的扩展是否均支持, 然后到 在线命令生成 中选择你需要编译的扩展,复制扩展字符串到 Action 的 extensions 中,编译即可。

',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}; diff --git a/assets/zh_guide_action-build.md.DWMlBDvT.lean.js b/assets/zh_guide_action-build.md.DWMlBDvT.lean.js deleted file mode 100644 index 5dba4bb0..00000000 --- a/assets/zh_guide_action-build.md.DWMlBDvT.lean.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as t,c as e,o,a1 as a}from"./chunks/framework.gjrnbxUT.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}; diff --git a/assets/zh_guide_build-on-windows.md.6JBREABQ.js b/assets/zh_guide_build-on-windows.md.6JBREABQ.js new file mode 100644 index 00000000..99027b00 --- /dev/null +++ b/assets/zh_guide_build-on-windows.md.6JBREABQ.js @@ -0,0 +1,22 @@ +import{_ as s,c as a,o as e,af as l}from"./chunks/framework.PeLcR_tw.js";const k=JSON.parse('{"title":"在 Windows 上构建","description":"","frontmatter":{},"headers":[],"relativePath":"zh/guide/build-on-windows.md","filePath":"zh/guide/build-on-windows.md"}'),t={name:"zh/guide/build-on-windows.md"};function h(n,i,p,o,d,c){return e(),a("div",null,i[0]||(i[0]=[l(`

在 Windows 上构建

因为 Windows 系统是 NT 内核,与类 Unix 的操作系统使用的编译工具及操作系统接口几乎完全不同,所以在 Windows 上的构建流程会与 Unix 系统有些许不同。

GitHub Actions 构建

现在已支持从 Actions 构建 Windows 版本的 static-php 了。 和 Linux、macOS 一样,你需要先 Fork static-php-cli 仓库到你的 GitHub 账户中,然后你可以进入 扩展列表 选择要编译的扩展,然后进入自己仓库的 CI on Windows 选择 PHP 版本、填入扩展列表(逗号分割),点击 Run 即可。

如果你要在本地开发或构建,请继续向下阅读。

环境准备

在 Windows 上构建静态 PHP 所需要的工具与 PHP 官方的 Windows 构建工具是相同的。你可以阅读 官方文档

总结下来,你需要以下环境及工具:

  • Windows 10(需要 build 17063 或以后的更新)
  • Visual Studio 2019/2022(推荐 2022)
  • Visual Studio 的 C++ 桌面开发
  • Git for Windows
  • static-php-cli 仓库
  • PHP 和 Composer(static-php-cli 需要它们,可使用 bin/setup-runtime 自动安装)
  • php-sdk-binary-tools(可使用 doctor 自动安装)
  • strawberry-perl(可使用 doctor 自动安装)
  • nasm(可使用 doctor 自动安装)

TIP

static-php-cli 在 Windows 上的构建指的是使用 MSVC 构建 PHP,不基于 MinGW、Cygwin、WSL 等环境。

如果你更倾向使用 WSL,请参考在 Linux 上构建的章节。

在安装 Visual Studio 后,选择 C++ 桌面开发的工作负荷后,可能会下载 8GB 左右的编译工具,下载速度取决于你的网络状况。

安装 Git

Git for Windows 可以从 这里 下载并安装 Standalone Installer 64-bit 版本,安装在默认位置(C:\\Program Files\\Git\\)。 如果不想手动下载和安装,你也可以使用 Visual Studio Installer,在单个组件的选择列表中,勾选 Git。

准备 static-php-cli

static-php-cli 项目的下载方式很简单,只需要使用 git clone 即可。推荐将项目放在 C:\\spc-build\\ 或类似目录,路径最好不要有空格。

shell
mkdir "C:\\spc-build"
+cd C:\\spc-build
+git clone https://github.com/crazywhalecc/static-php-cli.git
+cd static-php-cli

static-php-cli 自身需要 PHP 环境,是有点奇怪,但现在可以通过脚本快速安装 PHP 环境。 一般你的电脑不会安装 Windows 版本的 PHP,所以我们建议你在下载 static-php-cli 后,直接使用 bin/setup-runtime,在当前目录安装 PHP 和 Composer。

shell
# 安装 PHP 和 Composer 到 ./runtime/ 目录
+bin/setup-runtime
+
+# 安装后,如需在全局命令中使用 PHP 和 Composer,使用下面的命令将 runtime/ 目录添加到 PATH
+bin/setup-runtime -action add-path
+# 删除 PATH 中的 runtime/ 目录
+bin/setup-runtime -action remove-path

在准备好 PHP 和 Composer 环境后,使用 composer 安装 static-php-cli 的依赖:

shell
cd C:\\spc-build\\static-php-cli
+runtime/composer install --no-dev

自动安装其他依赖

对于 php-sdk-binary-toolsstrawberry-perlnasm,我们更建议你直接使用命令 bin/spc doctor --auto-fix 检查并安装。

如果 doctor 成功自动安装,请跳过下方手动安装上述工具的步骤。

如果自动安装无法成功的话,再参考下方手动安装的方式。

手动安装 php-sdk-binary-tools

bat
cd C:\\spc-build\\static-php-cli
+git clone https://github.com/php/php-sdk-binary-tools.git

你也可以在 Windows 设置中设置全局变量 PHP_SDK_PATH,并将该项目克隆至变量对应的路径。一般情况下,默认即可。

手动安装 strawberry-perl

如果你不需要编译 openssl 扩展,可不安装 perl。

  1. GitHub 下载 strawberry-perl 最新版。
  2. 安装到 C:\\spc-build\\static-php-cli\\pkgroot\\perl\\ 目录。

你可以下载 -portable 版本,并直接解压到上述目录。 最后的 perl.exe 应该位于 C:\\spc-build\\static-php-cli\\pkgroot\\perl\\perl\\bin\\perl.exe

手动安装 nasm

如果你不需要编译 openssl 扩展,可不安装 nasm。

  1. 官网 下载 nasm 工具(x64)。
  2. nasm.exendisasm.exe 放在 C:\\spc-build\\static-php-cli\\php-sdk-binary-tools\\bin\\ 目录。

下载源码

本地构建 - download

编译 PHP

使用 build 命令可以开始构建静态 php 二进制,在执行 bin/spc build 命令前,务必先使用 download 命令下载资源,建议使用 doctor 检查环境。

基本用法

你需要先到 扩展列表命令生成器 选择你要加入的扩展,然后使用命令 bin/spc build 进行编译。你需要指定编译目标,从如下参数中选择:

  • --build-cli: 构建一个 cli sapi(命令行界面,可在命令行执行 PHP 代码)
  • --build-micro: 构建一个 micro sapi(用于构建一个包含 PHP 代码的独立可执行二进制)
shell
# 编译 PHP,附带 bcmath,openssl,zlib 扩展,编译目标为 cli
+bin/spc build "bcmath,openssl,zlib" --build-cli
+
+# 编译 PHP,附带 bcmath,openssl,zlib 扩展,编译目标为 micro 和 cli
+bin/spc build "bcmath,openssl,zlib" --build-micro --build-cli

WARNING

在Windows中,最好使用双引号包裹包含逗号的参数,例如 "bcmath,openssl,mbstring"

调试

如果你在编译过程中遇到了问题,或者想查看每个执行的 shell 命令,可以使用 --debug 开启 debug 模式,查看所有终端日志:

shell
bin/spc build "openssl" --build-cli --debug

编译运行选项

在编译过程中,有些特殊情况需要对编译器、编译目录的内容进行干预,可以尝试使用以下命令:

  • --with-clean: 编译 PHP 前先清理旧的 make 产生的文件
  • --enable-zts: 让编译的 PHP 为线程安全版本(默认为 NTS 版本)
  • --with-libs=XXX,YYY: 编译 PHP 前先编译指定的依赖库,激活部分扩展的可选功能
  • --with-config-file-scan-dir=XXX: 读取 php.ini 后扫描 .ini 文件的目录(在 这里 查看默认路径)
  • -I xxx=yyy: 编译前将 INI 选项硬编译到 PHP 内(支持多个选项,别名是 --with-hardcoded-ini
  • --with-micro-fake-cli: 在编译 micro 时,让 micro 的 SAPI 伪装为 cli(用于兼容一些检查 PHP_SAPI 的程序)
  • --disable-opcache-jit: 禁用 opcache jit(默认启用)
  • --without-micro-ext-test: 在构建 micro.sfx 后,禁用测试不同扩展在 micro.sfx 的运行结果
  • --with-suggested-exts: 编译时将 ext-suggests 也作为编译依赖加入
  • --with-suggested-libs: 编译时将 lib-suggests 也作为编译依赖加入
  • --with-upx-pack: 编译后使用 UPX 减小二进制文件体积(需先使用 bin/spc install-pkg upx 安装 upx)
  • --with-micro-logo=XXX.ico: 自定义 micro 构建组合后的 exe 可执行文件的图标(格式为 .ico

有关硬编码 INI 选项,下面是一个简单的例子,我们预设一个更大的 memory_limit,并且禁用 system 函数:

shell
bin/spc build "bcmath,openssl" --build-cli -I "memory_limit=4G" -I "disable_functions=system"

另一个例子:自定义 micro 构建后的 exe 程序图标:

shell
bin/spc build "ffi,bcmath" --build-micro --with-micro-logo=mylogo.ico --debug
+bin/spc micro:combine hello.php
+# Then we got \`my-app.exe\` with custom logo!
+my-app.exe

使用 php.exe

php.exe 编译后位于 buildroot\\bin\\ 目录,你可以将其拷贝到任意位置使用。

shell
.\\php -v

使用 micro

phpmicro 是一个提供自执行二进制 PHP 的项目,本项目依赖 phpmicro 进行编译自执行二进制。详见 dixyes/phpmicro

最后编译结果会输出一个 ./micro.sfx 的文件,此文件需要配合你的 PHP 源码使用。 该文件编译后会存放在 buildroot/bin/ 目录中。

使用时应准备好你的项目源码文件,可以是单个 PHP 文件,也可以是 Phar 文件。

如果要结合 phar 文件,编译时必须包含 phar 扩展!

shell
# code.php "<?php echo 'Hello world' . PHP_EOL;"
+bin/spc micro:combine code.php -O my-app.exe
+# Run it!!! Copy it to another computer!!!
+./my-app.exe

如果打包 PHAR 文件,仅需把 code.php 更换为 phar 文件路径即可。 你可以使用 box-project/box 将你的 CLI 项目打包为 Phar, 然后将它与 phpmicro 结合,生成独立可执行的二进制文件。

有关 micro:combine 命令的更多细节,请参考 Unix 系统上的 命令

`,64)]))}const b=s(t,[["render",h]]);export{k as __pageData,b as default}; diff --git a/assets/zh_guide_build-on-windows.md.6JBREABQ.lean.js b/assets/zh_guide_build-on-windows.md.6JBREABQ.lean.js new file mode 100644 index 00000000..8b250802 --- /dev/null +++ b/assets/zh_guide_build-on-windows.md.6JBREABQ.lean.js @@ -0,0 +1 @@ +import{_ as s,c as a,o as e,af as l}from"./chunks/framework.PeLcR_tw.js";const k=JSON.parse('{"title":"在 Windows 上构建","description":"","frontmatter":{},"headers":[],"relativePath":"zh/guide/build-on-windows.md","filePath":"zh/guide/build-on-windows.md"}'),t={name:"zh/guide/build-on-windows.md"};function h(n,i,p,o,d,c){return e(),a("div",null,i[0]||(i[0]=[l("",64)]))}const b=s(t,[["render",h]]);export{k as __pageData,b as default}; diff --git a/assets/zh_guide_build-on-windows.md.BxVEYT8r.js b/assets/zh_guide_build-on-windows.md.BxVEYT8r.js deleted file mode 100644 index 08a99e86..00000000 --- a/assets/zh_guide_build-on-windows.md.BxVEYT8r.js +++ /dev/null @@ -1,22 +0,0 @@ -import{_ as i,c as s,o as a,a1 as e}from"./chunks/framework.gjrnbxUT.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(`

在 Windows 上构建

因为 Windows 系统是 NT 内核,与类 Unix 的操作系统使用的编译工具及操作系统接口几乎完全不同,所以在 Windows 上的构建流程会与 Unix 系统有些许不同。

GitHub Actions 构建

现在已支持从 Actions 构建 Windows 版本的 static-php 了。 和 Linux、macOS 一样,你需要先 Fork static-php-cli 仓库到你的 GitHub 账户中,然后你可以进入 扩展列表 选择要编译的扩展,然后进入自己仓库的 CI on Windows 选择 PHP 版本、填入扩展列表(逗号分割),点击 Run 即可。

如果你要在本地开发或构建,请继续向下阅读。

环境准备

在 Windows 上构建静态 PHP 所需要的工具与 PHP 官方的 Windows 构建工具是相同的。你可以阅读 官方文档

总结下来,你需要以下环境及工具:

  • Windows 10(需要 build 17063 或以后的更新)
  • Visual Studio 2019/2022(推荐 2022)
  • Visual Studio 的 C++ 桌面开发
  • Git for Windows
  • static-php-cli 仓库
  • PHP 和 Composer(static-php-cli 需要它们,可使用 bin/setup-runtime 自动安装)
  • php-sdk-binary-tools(可使用 doctor 自动安装)
  • strawberry-perl(可使用 doctor 自动安装)
  • nasm(可使用 doctor 自动安装)

TIP

static-php-cli 在 Windows 上的构建指的是使用 MSVC 构建 PHP,不基于 MinGW、Cygwin、WSL 等环境。

如果你更倾向使用 WSL,请参考在 Linux 上构建的章节。

在安装 Visual Studio 后,选择 C++ 桌面开发的工作负荷后,可能会下载 8GB 左右的编译工具,下载速度取决于你的网络状况。

安装 Git

Git for Windows 可以从 这里 下载并安装 Standalone Installer 64-bit 版本,安装在默认位置(C:\\Program Files\\Git\\)。 如果不想手动下载和安装,你也可以使用 Visual Studio Installer,在单个组件的选择列表中,勾选 Git。

准备 static-php-cli

static-php-cli 项目的下载方式很简单,只需要使用 git clone 即可。推荐将项目放在 C:\\spc-build\\ 或类似目录,路径最好不要有空格。

shell
mkdir "C:\\spc-build"
-cd C:\\spc-build
-git clone https://github.com/crazywhalecc/static-php-cli.git
-cd static-php-cli

static-php-cli 自身需要 PHP 环境,是有点奇怪,但现在可以通过脚本快速安装 PHP 环境。 一般你的电脑不会安装 Windows 版本的 PHP,所以我们建议你在下载 static-php-cli 后,直接使用 bin/setup-runtime,在当前目录安装 PHP 和 Composer。

shell
# 安装 PHP 和 Composer 到 ./runtime/ 目录
-bin/setup-runtime
-
-# 安装后,如需在全局命令中使用 PHP 和 Composer,使用下面的命令将 runtime/ 目录添加到 PATH
-bin/setup-runtime -action add-path
-# 删除 PATH 中的 runtime/ 目录
-bin/setup-runtime -action remove-path

在准备好 PHP 和 Composer 环境后,使用 composer 安装 static-php-cli 的依赖:

shell
cd C:\\spc-build\\static-php-cli
-runtime/composer install --no-dev

自动安装其他依赖

对于 php-sdk-binary-toolsstrawberry-perlnasm,我们更建议你直接使用命令 bin/spc doctor --auto-fix 检查并安装。

如果 doctor 成功自动安装,请跳过下方手动安装上述工具的步骤。

如果自动安装无法成功的话,再参考下方手动安装的方式。

手动安装 php-sdk-binary-tools

bat
cd C:\\spc-build\\static-php-cli
-git clone https://github.com/php/php-sdk-binary-tools.git

你也可以在 Windows 设置中设置全局变量 PHP_SDK_PATH,并将该项目克隆至变量对应的路径。一般情况下,默认即可。

手动安装 strawberry-perl

如果你不需要编译 openssl 扩展,可不安装 perl。

  1. GitHub 下载 strawberry-perl 最新版。
  2. 安装到 C:\\spc-build\\static-php-cli\\pkgroot\\perl\\ 目录。

你可以下载 -portable 版本,并直接解压到上述目录。 最后的 perl.exe 应该位于 C:\\spc-build\\static-php-cli\\pkgroot\\perl\\perl\\bin\\perl.exe

手动安装 nasm

如果你不需要编译 openssl 扩展,可不安装 nasm。

  1. 官网 下载 nasm 工具(x64)。
  2. nasm.exendisasm.exe 放在 C:\\spc-build\\static-php-cli\\php-sdk-binary-tools\\bin\\ 目录。

下载源码

本地构建 - download

编译 PHP

使用 build 命令可以开始构建静态 php 二进制,在执行 bin/spc build 命令前,务必先使用 download 命令下载资源,建议使用 doctor 检查环境。

基本用法

你需要先到 扩展列表命令生成器 选择你要加入的扩展,然后使用命令 bin/spc build 进行编译。你需要指定编译目标,从如下参数中选择:

  • --build-cli: 构建一个 cli sapi(命令行界面,可在命令行执行 PHP 代码)
  • --build-micro: 构建一个 micro sapi(用于构建一个包含 PHP 代码的独立可执行二进制)
shell
# 编译 PHP,附带 bcmath,openssl,zlib 扩展,编译目标为 cli
-bin/spc build "bcmath,openssl,zlib" --build-cli
-
-# 编译 PHP,附带 bcmath,openssl,zlib 扩展,编译目标为 micro 和 cli
-bin/spc build "bcmath,openssl,zlib" --build-micro --build-cli

WARNING

在Windows中,最好使用双引号包裹包含逗号的参数,例如 "bcmath,openssl,mbstring"

调试

如果你在编译过程中遇到了问题,或者想查看每个执行的 shell 命令,可以使用 --debug 开启 debug 模式,查看所有终端日志:

shell
bin/spc build "openssl" --build-cli --debug

编译运行选项

在编译过程中,有些特殊情况需要对编译器、编译目录的内容进行干预,可以尝试使用以下命令:

  • --with-clean: 编译 PHP 前先清理旧的 make 产生的文件
  • --enable-zts: 让编译的 PHP 为线程安全版本(默认为 NTS 版本)
  • --with-libs=XXX,YYY: 编译 PHP 前先编译指定的依赖库,激活部分扩展的可选功能
  • --with-config-file-scan-dir=XXX: 读取 php.ini 后扫描 .ini 文件的目录(在 这里 查看默认路径)
  • -I xxx=yyy: 编译前将 INI 选项硬编译到 PHP 内(支持多个选项,别名是 --with-hardcoded-ini
  • --with-micro-fake-cli: 在编译 micro 时,让 micro 的 SAPI 伪装为 cli(用于兼容一些检查 PHP_SAPI 的程序)
  • --disable-opcache-jit: 禁用 opcache jit(默认启用)
  • --without-micro-ext-test: 在构建 micro.sfx 后,禁用测试不同扩展在 micro.sfx 的运行结果
  • --with-suggested-exts: 编译时将 ext-suggests 也作为编译依赖加入
  • --with-suggested-libs: 编译时将 lib-suggests 也作为编译依赖加入
  • --with-upx-pack: 编译后使用 UPX 减小二进制文件体积(需先使用 bin/spc install-pkg upx 安装 upx)
  • --with-micro-logo=XXX.ico: 自定义 micro 构建组合后的 exe 可执行文件的图标(格式为 .ico

有关硬编码 INI 选项,下面是一个简单的例子,我们预设一个更大的 memory_limit,并且禁用 system 函数:

shell
bin/spc build "bcmath,openssl" --build-cli -I "memory_limit=4G" -I "disable_functions=system"

另一个例子:自定义 micro 构建后的 exe 程序图标:

shell
bin/spc build "ffi,bcmath" --build-micro --with-micro-logo=mylogo.ico --debug
-bin/spc micro:combine hello.php
-# Then we got \`my-app.exe\` with custom logo!
-my-app.exe

使用 php.exe

php.exe 编译后位于 buildroot\\bin\\ 目录,你可以将其拷贝到任意位置使用。

shell
.\\php -v

使用 micro

phpmicro 是一个提供自执行二进制 PHP 的项目,本项目依赖 phpmicro 进行编译自执行二进制。详见 dixyes/phpmicro

最后编译结果会输出一个 ./micro.sfx 的文件,此文件需要配合你的 PHP 源码使用。 该文件编译后会存放在 buildroot/bin/ 目录中。

使用时应准备好你的项目源码文件,可以是单个 PHP 文件,也可以是 Phar 文件。

如果要结合 phar 文件,编译时必须包含 phar 扩展!

shell
# code.php "<?php echo 'Hello world' . PHP_EOL;"
-bin/spc micro:combine code.php -O my-app.exe
-# Run it!!! Copy it to another computer!!!
-./my-app.exe

如果打包 PHAR 文件,仅需把 code.php 更换为 phar 文件路径即可。 你可以使用 box-project/box 将你的 CLI 项目打包为 Phar, 然后将它与 phpmicro 结合,生成独立可执行的二进制文件。

有关 micro:combine 命令的更多细节,请参考 Unix 系统上的 命令

`,64),p=[t];function n(o,h,d,c,r,k){return a(),s("div",null,p)}const g=i(l,[["render",n]]);export{u as __pageData,g as default}; diff --git a/assets/zh_guide_build-on-windows.md.BxVEYT8r.lean.js b/assets/zh_guide_build-on-windows.md.BxVEYT8r.lean.js deleted file mode 100644 index 133ad43d..00000000 --- a/assets/zh_guide_build-on-windows.md.BxVEYT8r.lean.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as i,c as s,o as a,a1 as e}from"./chunks/framework.gjrnbxUT.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(o,h,d,c,r,k){return a(),s("div",null,p)}const g=i(l,[["render",n]]);export{u as __pageData,g as default}; diff --git a/assets/zh_guide_build-with-glibc.md.6Wr3xgOs.js b/assets/zh_guide_build-with-glibc.md.6Wr3xgOs.js deleted file mode 100644 index 46f30e07..00000000 --- a/assets/zh_guide_build-with-glibc.md.6Wr3xgOs.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as i,c as l,o as e,a1 as c}from"./chunks/framework.gjrnbxUT.js";const g=JSON.parse('{"title":"构建 glibc 兼容的 Linux 二进制","description":"","frontmatter":{},"headers":[],"relativePath":"zh/guide/build-with-glibc.md","filePath":"zh/guide/build-with-glibc.md"}'),s={name:"zh/guide/build-with-glibc.md"},a=c('

构建 glibc 兼容的 Linux 二进制

为什么要构建 glibc 兼容的二进制

目前,static-php-cli 在默认条件下在 Linux 系统构建的二进制都是基于 musl-libc(静态链接)的。 musl-libc 是一个轻量级的 libc 实现,它的目标是与 glibc 兼容,并且提供良好的纯静态链接支持。 这意味着,编译出来的静态 PHP 可执行文件在几乎任何 Linux 发行版都可以使用,而不需要考虑 libc、libstdc++ 等库的版本问题。

但是,Linux 系统的纯静态链接 musl-libc 二进制文件存在以下问题:

  • 无法使用 PHP 的 dl() 函数加载动态链接库和外部 PHP 扩展。
  • 无法使用 PHP 的 FFI 扩展。
  • 部分极端情况下,可能会出现性能问题,参见 musl-libc 的性能问题

对于不同的 Linux 发行版,它们使用的默认 libc 可能不同,比如 Alpine Linux 使用 musl libc,而大多数 Linux 发行版使用 glibc。 但即便如此,我们也不能直接使用任意的发行版和 glibc 构建便携的静态二进制文件,因为 glibc 有一些问题:

  • 基于新版本的发行版在使用 gcc 等工具构建的二进制,无法在旧版本的发行版上运行。
  • glibc 不推荐被静态链接,因为它的一些特性需要动态链接库的支持。

但是,我们可以使用 Docker 容器来解决这个问题,最终输出的结果是一个动态链接 glibc 和一些必要库的二进制,但它静态链接所有其他依赖。

  1. 使用一个旧版本的 Linux 发行版(如 CentOS 7.x),它的 glibc 版本比较旧,但是可以在大多数现代 Linux 发行版上运行。
  2. 在这个容器中构建 PHP 的静态二进制文件,这样就可以在大多数现代 Linux 发行版上运行了。

使用 glibc 的静态二进制文件,可以在大多数现代 Linux 发行版上运行,但是不能在 musl libc 的发行版上运行,如 CentOS 6、Alpine Linux 等。

构建 glibc 兼容的 Linux 二进制

最新版的 static-php-cli 内置了 bin/spc-gnu-docker 脚本,可以一键创建一个 CentOS 7.x (glibc-2.17) 的 Docker 容器,并在容器中构建 glibc 兼容的 PHP 静态二进制文件。

然后,先运行一次以下命令。首次运行时时间较长,因为需要下载 CentOS 7.x 的镜像和一些编译工具。

bash
bin/spc-gnu-docker

构建镜像完成后,你将看到和 bin/spc 一样的命令帮助菜单,这时说明容器已经准备好了。

在容器准备好后,你可以参考 本地构建 章节的内容,构建你的 PHP 静态二进制文件。仅需要把 bin/spc./spc 替换为 bin/spc-gnu-docker 即可。

bash
bin/spc-gnu-docker build bcmath,ctype,openssl,pdo,phar,posix,session,tokenizer,xml,zip --build-cli --debug

注意事项

极少数情况下,基于 glibc 的静态 PHP 可能会出现 segment fault 等错误,但目前例子较少,如果遇到问题请提交 issue。

glibc 构建为扩展的特性,不属于默认 static-php 的支持范围。如果有相关问题或需求,请在提交 Issue 时注明你是基于 glibc 构建的。

如果你需要不使用 Docker 构建基于 glibc 的二进制,请参考 bin/spc-gnu-docker 脚本,手动构建一个类似的环境。

由于 glibc 二进制不是项目的主要目标,一般情况下我们不会额外测试 glibc 下的各个库和扩展的兼容性。 任何特定库如果在 musl-libc 上构建成功,但在 glibc 上构建失败,请提交 issue,我们将会单独解决。

',22),t=[a];function n(p,o,b,d,h,u){return e(),l("div",null,t)}const k=i(s,[["render",n]]);export{g as __pageData,k as default}; diff --git a/assets/zh_guide_build-with-glibc.md.6Wr3xgOs.lean.js b/assets/zh_guide_build-with-glibc.md.6Wr3xgOs.lean.js deleted file mode 100644 index df72af5d..00000000 --- a/assets/zh_guide_build-with-glibc.md.6Wr3xgOs.lean.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as i,c as l,o as e,a1 as c}from"./chunks/framework.gjrnbxUT.js";const g=JSON.parse('{"title":"构建 glibc 兼容的 Linux 二进制","description":"","frontmatter":{},"headers":[],"relativePath":"zh/guide/build-with-glibc.md","filePath":"zh/guide/build-with-glibc.md"}'),s={name:"zh/guide/build-with-glibc.md"},a=c("",22),t=[a];function n(p,o,b,d,h,u){return e(),l("div",null,t)}const k=i(s,[["render",n]]);export{g as __pageData,k as default}; diff --git a/assets/zh_guide_build-with-glibc.md.D6LGMZUS.js b/assets/zh_guide_build-with-glibc.md.D6LGMZUS.js new file mode 100644 index 00000000..4479563e --- /dev/null +++ b/assets/zh_guide_build-with-glibc.md.D6LGMZUS.js @@ -0,0 +1 @@ +import{_ as l,c as e,o as s,af as a}from"./chunks/framework.PeLcR_tw.js";const o=JSON.parse('{"title":"构建 glibc 兼容的 Linux 二进制","description":"","frontmatter":{},"headers":[],"relativePath":"zh/guide/build-with-glibc.md","filePath":"zh/guide/build-with-glibc.md"}'),c={name:"zh/guide/build-with-glibc.md"};function t(n,i,p,b,h,d){return s(),e("div",null,i[0]||(i[0]=[a('

构建 glibc 兼容的 Linux 二进制

为什么要构建 glibc 兼容的二进制

目前,static-php-cli 在默认条件下在 Linux 系统构建的二进制都是基于 musl-libc(静态链接)的。 musl-libc 是一个轻量级的 libc 实现,它的目标是与 glibc 兼容,并且提供良好的纯静态链接支持。 这意味着,编译出来的静态 PHP 可执行文件在几乎任何 Linux 发行版都可以使用,而不需要考虑 libc、libstdc++ 等库的版本问题。

但是,Linux 系统的纯静态链接 musl-libc 二进制文件存在以下问题:

  • 无法使用 PHP 的 dl() 函数加载动态链接库和外部 PHP 扩展。
  • 无法使用 PHP 的 FFI 扩展。
  • 部分极端情况下,可能会出现性能问题,参见 musl-libc 的性能问题

对于不同的 Linux 发行版,它们使用的默认 libc 可能不同,比如 Alpine Linux 使用 musl libc,而大多数 Linux 发行版使用 glibc。 但即便如此,我们也不能直接使用任意的发行版和 glibc 构建便携的静态二进制文件,因为 glibc 有一些问题:

  • 基于新版本的发行版在使用 gcc 等工具构建的二进制,无法在旧版本的发行版上运行。
  • glibc 不推荐被静态链接,因为它的一些特性需要动态链接库的支持。

但是,我们可以使用 Docker 容器来解决这个问题,最终输出的结果是一个动态链接 glibc 和一些必要库的二进制,但它静态链接所有其他依赖。

  1. 使用一个旧版本的 Linux 发行版(如 CentOS 7.x),它的 glibc 版本比较旧,但是可以在大多数现代 Linux 发行版上运行。
  2. 在这个容器中构建 PHP 的静态二进制文件,这样就可以在大多数现代 Linux 发行版上运行了。

使用 glibc 的静态二进制文件,可以在大多数现代 Linux 发行版上运行,但是不能在 musl libc 的发行版上运行,如 CentOS 6、Alpine Linux 等。

构建 glibc 兼容的 Linux 二进制

最新版的 static-php-cli 内置了 bin/spc-gnu-docker 脚本,可以一键创建一个 CentOS 7.x (glibc-2.17) 的 Docker 容器,并在容器中构建 glibc 兼容的 PHP 静态二进制文件。

然后,先运行一次以下命令。首次运行时时间较长,因为需要下载 CentOS 7.x 的镜像和一些编译工具。

bash
bin/spc-gnu-docker

构建镜像完成后,你将看到和 bin/spc 一样的命令帮助菜单,这时说明容器已经准备好了。

在容器准备好后,你可以参考 本地构建 章节的内容,构建你的 PHP 静态二进制文件。仅需要把 bin/spc./spc 替换为 bin/spc-gnu-docker 即可。

bash
bin/spc-gnu-docker build bcmath,ctype,openssl,pdo,phar,posix,session,tokenizer,xml,zip --build-cli --debug

注意事项

极少数情况下,基于 glibc 的静态 PHP 可能会出现 segment fault 等错误,但目前例子较少,如果遇到问题请提交 issue。

glibc 构建为扩展的特性,不属于默认 static-php 的支持范围。如果有相关问题或需求,请在提交 Issue 时注明你是基于 glibc 构建的。

如果你需要不使用 Docker 构建基于 glibc 的二进制,请参考 bin/spc-gnu-docker 脚本,手动构建一个类似的环境。

由于 glibc 二进制不是项目的主要目标,一般情况下我们不会额外测试 glibc 下的各个库和扩展的兼容性。 任何特定库如果在 musl-libc 上构建成功,但在 glibc 上构建失败,请提交 issue,我们将会单独解决。

',22)]))}const g=l(c,[["render",t]]);export{o as __pageData,g as default}; diff --git a/assets/zh_guide_build-with-glibc.md.D6LGMZUS.lean.js b/assets/zh_guide_build-with-glibc.md.D6LGMZUS.lean.js new file mode 100644 index 00000000..e75edac0 --- /dev/null +++ b/assets/zh_guide_build-with-glibc.md.D6LGMZUS.lean.js @@ -0,0 +1 @@ +import{_ as l,c as e,o as s,af as a}from"./chunks/framework.PeLcR_tw.js";const o=JSON.parse('{"title":"构建 glibc 兼容的 Linux 二进制","description":"","frontmatter":{},"headers":[],"relativePath":"zh/guide/build-with-glibc.md","filePath":"zh/guide/build-with-glibc.md"}'),c={name:"zh/guide/build-with-glibc.md"};function t(n,i,p,b,h,d){return s(),e("div",null,i[0]||(i[0]=[a("",22)]))}const g=l(c,[["render",t]]);export{o as __pageData,g as default}; diff --git a/assets/zh_guide_cli-generator.md.B8M2jXl2.js b/assets/zh_guide_cli-generator.md.B8M2jXl2.js new file mode 100644 index 00000000..df0a86da --- /dev/null +++ b/assets/zh_guide_cli-generator.md.B8M2jXl2.js @@ -0,0 +1 @@ +import{C as a}from"./chunks/CliGenerator.D2FJpN3t.js";import{d as t,c as r,o,af as i,J as l}from"./chunks/framework.PeLcR_tw.js";const m=JSON.parse('{"title":"CLI 编译命令生成器","description":"","frontmatter":{"aside":false},"headers":[],"relativePath":"zh/guide/cli-generator.md","filePath":"zh/guide/cli-generator.md"}'),s={name:"zh/guide/cli-generator.md"},p=t({...s,setup(c){return(n,e)=>(o(),r("div",null,[e[0]||(e[0]=i('

CLI 编译命令生成器

TIP

下面选择扩展可能包含所选操作系统不支持的扩展,这可能导致编译失败。请先查阅 支持的扩展

',2)),l(a,{lang:"zh"})]))}});export{m as __pageData,p as default}; diff --git a/assets/zh_guide_cli-generator.md.B8M2jXl2.lean.js b/assets/zh_guide_cli-generator.md.B8M2jXl2.lean.js new file mode 100644 index 00000000..f38913c0 --- /dev/null +++ b/assets/zh_guide_cli-generator.md.B8M2jXl2.lean.js @@ -0,0 +1 @@ +import{C as a}from"./chunks/CliGenerator.D2FJpN3t.js";import{d as t,c as r,o,af as i,J as l}from"./chunks/framework.PeLcR_tw.js";const m=JSON.parse('{"title":"CLI 编译命令生成器","description":"","frontmatter":{"aside":false},"headers":[],"relativePath":"zh/guide/cli-generator.md","filePath":"zh/guide/cli-generator.md"}'),s={name:"zh/guide/cli-generator.md"},p=t({...s,setup(c){return(n,e)=>(o(),r("div",null,[e[0]||(e[0]=i("",2)),l(a,{lang:"zh"})]))}});export{m as __pageData,p as default}; diff --git a/assets/zh_guide_cli-generator.md.BQovOB62.js b/assets/zh_guide_cli-generator.md.BQovOB62.js deleted file mode 100644 index c893caa3..00000000 --- a/assets/zh_guide_cli-generator.md.BQovOB62.js +++ /dev/null @@ -1 +0,0 @@ -import{C as e}from"./chunks/CliGenerator.CaE8R34N.js";import{d as a,c as t,I as o,a1 as r,o as i}from"./chunks/framework.gjrnbxUT.js";const s=r('

CLI 编译命令生成器

TIP

下面选择扩展可能包含所选操作系统不支持的扩展,这可能导致编译失败。请先查阅 支持的扩展

',2),p=JSON.parse('{"title":"CLI 编译命令生成器","description":"","frontmatter":{"aside":false},"headers":[],"relativePath":"zh/guide/cli-generator.md","filePath":"zh/guide/cli-generator.md"}'),c={name:"zh/guide/cli-generator.md"},_=a({...c,setup(l){return(n,d)=>(i(),t("div",null,[s,o(e,{lang:"zh"})]))}});export{p as __pageData,_ as default}; diff --git a/assets/zh_guide_cli-generator.md.BQovOB62.lean.js b/assets/zh_guide_cli-generator.md.BQovOB62.lean.js deleted file mode 100644 index c893caa3..00000000 --- a/assets/zh_guide_cli-generator.md.BQovOB62.lean.js +++ /dev/null @@ -1 +0,0 @@ -import{C as e}from"./chunks/CliGenerator.CaE8R34N.js";import{d as a,c as t,I as o,a1 as r,o as i}from"./chunks/framework.gjrnbxUT.js";const s=r('

CLI 编译命令生成器

TIP

下面选择扩展可能包含所选操作系统不支持的扩展,这可能导致编译失败。请先查阅 支持的扩展

',2),p=JSON.parse('{"title":"CLI 编译命令生成器","description":"","frontmatter":{"aside":false},"headers":[],"relativePath":"zh/guide/cli-generator.md","filePath":"zh/guide/cli-generator.md"}'),c={name:"zh/guide/cli-generator.md"},_=a({...c,setup(l){return(n,d)=>(i(),t("div",null,[s,o(e,{lang:"zh"})]))}});export{p as __pageData,_ as default}; diff --git a/assets/zh_guide_deps-map.md.DQXDDLu_.js b/assets/zh_guide_deps-map.md.DQXDDLu_.js new file mode 100644 index 00000000..110f60f2 --- /dev/null +++ b/assets/zh_guide_deps-map.md.DQXDDLu_.js @@ -0,0 +1 @@ +import{_ as d,c as b,o as r,af as l}from"./chunks/framework.PeLcR_tw.js";const h=JSON.parse('{"title":"依赖关系图表","description":"","frontmatter":{"outline":"deep"},"headers":[],"relativePath":"zh/guide/deps-map.md","filePath":"zh/guide/deps-map.md"}'),i={name:"zh/guide/deps-map.md"};function e(s,t,o,a,p,n){return r(),b("div",null,t[0]||(t[0]=[l('

依赖关系图表

在编译 PHP 时,每个扩展、库都有依赖关系,这些依赖关系可能是必需的,也可能是可选的。在编译 PHP 时,可以选择是否包含这些可选的依赖关系。

例如,在 Linux 下编译 gd 扩展时,会强制编译 zlib,libpng 库和 zlib 扩展,而 libavif,libwebp,libjpeg,freetype 库都是可选的库,默认不会编译,除非通过 --with-libs=avif,webp,jpeg,freetype 选项指定。

  • 对于可选扩展(扩展的可选特性),需手动在编译时指定,例如启用 Redis 的 igbinary 支持:bin/spc build redis,igbinary
  • 对于可选库,需通过 --with-libs=XXX 选项编译指定。
  • 如果想启用所有的可选扩展,可以使用 bin/spc build redis --with-suggested-exts 参数。
  • 如果想启用所有的可选库,可以使用 --with-suggested-libs 参数。

扩展的依赖图

Linux

Extension NameRequired ExtensionsSuggested ExtensionsRequired LibrariesSuggested Libraries
amqplibrabbitmq
brotlibrotli
bz2bzip2
curlcurl
dbaqdbm
domlibxml2
zlib
evsockets
eventopensslsocketslibevent
ffilibffi
ftpopenssl
gdzlibzlib
libpng
libavif
libwebp
libjpeg
freetype
gettextgettext
gmpgmp
gmsslgmssl
grpcgrpc
iconvlibiconv
igbinarysession
apcu
imagickimagemagick
imapopensslimap
intlicu
ldapopensslldapgmp
libsodium
lz4liblz4
mbregexmbstringonig
memcachezlib
session
memcachedsession
zlib
libmemcached
fastlz
mongodbicu
openssl
zstd
zlib
msgpacksession
mysqlimysqlnd
mysqlndzlib
odbcunixodbc
opensslzlibopenssl
zlib
password-argon2libargon2
pdo_mysqlpdo
mysqlnd
pdo_odbcpdo
odbc
unixodbc
pdo_pgsqlpdo
pgsql
postgresql
pdo_sqlitepdo
sqlite3
sqlite
pdo_sqlsrvpdo
sqlsrv
pgsqlpostgresql
pharzlib
rdkafkalibrdkafka
readlinereadline
redissession
igbinary
zstd
liblz4
simplexmllibxml2
snappyapcusnappy
soaplibxml2
sodiumlibsodium
spxzlib
sqlite3sqlite
sqlsrvpcntlunixodbc
ssh2openssl
zlib
libssh2
swooleopenssl
curl
swoole-hook-pgsql
swoole-hook-mysql
swoole-hook-sqlite
libcares
brotli
nghttp2
zlib
swoole-hook-mysqlmysqlnd
pdo
pdo_mysql
mysqli
swoole-hook-pgsqlpgsql
pdo
swoole-hook-sqlitesqlite3
pdo
swowopenssl
curl
openssl
curl
tidytidy
uuidlibuuid
uvsocketslibuv
xhprofctype
xlswriterzlib
zip
openssl
xmllibxml2
xmlreaderlibxml2
xmlwriterlibxml2
xslxml
dom
libxslt
xzxz
yacigbinaryfastlz
yamllibyaml
ziplibzip
zlibzlib
zstdzstd

macOS

Extension NameRequired ExtensionsSuggested ExtensionsRequired LibrariesSuggested Libraries
amqplibrabbitmq
brotlibrotli
bz2bzip2
curlcurl
dbaqdbm
domlibxml2
zlib
evsockets
eventopensslsocketslibevent
ffilibffi
ftpopenssl
gdzlibzlib
libpng
libavif
libwebp
libjpeg
freetype
gettextgettext
glfwglfw
gmpgmp
gmsslgmssl
grpcgrpc
iconvlibiconv
igbinarysession
apcu
imagickimagemagick
imapopensslimap
intlicu
ldapopensslldapgmp
libsodium
lz4liblz4
mbregexmbstringonig
memcachezlib
session
memcachedsession
zlib
libmemcached
fastlz
mongodbicu
openssl
zstd
zlib
msgpacksession
mysqlimysqlnd
mysqlndzlib
odbcunixodbc
opensslzlibopenssl
zlib
password-argon2libargon2
pdo_mysqlpdo
mysqlnd
pdo_odbcpdo
odbc
unixodbc
pdo_pgsqlpdo
pgsql
postgresql
pdo_sqlitepdo
sqlite3
sqlite
pdo_sqlsrvpdo
sqlsrv
pgsqlpostgresql
pharzlib
rdkafkalibrdkafka
readlinereadline
redissession
igbinary
zstd
liblz4
simplexmllibxml2
snappyapcusnappy
soaplibxml2
sodiumlibsodium
spxzlib
sqlite3sqlite
sqlsrvunixodbc
ssh2openssl
zlib
libssh2
swooleopenssl
curl
swoole-hook-pgsql
swoole-hook-mysql
swoole-hook-sqlite
libcares
brotli
nghttp2
zlib
swoole-hook-mysqlmysqlnd
pdo
pdo_mysql
mysqli
swoole-hook-pgsqlpgsql
pdo
swoole-hook-sqlitesqlite3
pdo
swowopenssl
curl
openssl
curl
tidytidy
uuidlibuuid
uvsocketslibuv
xhprofctype
xlswriterzlib
zip
openssl
xmllibxml2
xmlreaderlibxml2
xmlwriterlibxml2
xslxml
dom
libxslt
xzxz
yacigbinaryfastlz
yamllibyaml
ziplibzip
zlibzlib
zstdzstd

Windows

Extension NameRequired ExtensionsSuggested ExtensionsRequired LibrariesSuggested Libraries
amqpopenssllibrabbitmq
brotlibrotli
bz2bzip2
curlzlib
openssl
curl
dbaqdbm
domxmllibxml2
zlib
evsockets
ffilibffi-win
ftpopenssl
gdzlibzlib
libpng
libavif
libwebp
libjpeg
freetype
gmsslgmssl
iconvlibiconv-win
igbinarysession
apcu
mbregexmbstringonig
msgpacksession
mysqlimysqlnd
mysqlndzlib
opensslzlibopenssl
zlib
parallelpthreads4w
pdo_mysqlpdo
mysqlnd
pdo_odbcpdo
odbc
pdo_pgsqlpdo
pgsql
postgresql-win
pdo_sqlitepdo
sqlite3
sqlite
pdo_sqlsrvpdo
sqlsrv
pgsqlpostgresql-win
pharzlib
redissession
igbinary
simplexmlxmllibxml2
soapxmllibxml2
sodiumlibsodium
sqlite3sqlite
ssh2openssl
zlib
libssh2
swowopenssl
curl
openssl
curl
xlswriterzlib
zip
openssl
xmliconvlibxml2
xmlreaderxml
dom
libxml2
xmlwriterxmllibxml2
xzxz
yamllibyaml
zipzlib
bz2
libzip
zlib
bzip2
xz
zlibzlib

FreeBSD

Extension NameRequired ExtensionsSuggested ExtensionsRequired LibrariesSuggested Libraries
brotlibrotli
bz2bzip2
curlcurl
dbaqdbm
evsockets
ftpopenssl
mbregexmbstringonig
mysqlimysqlnd
mysqlndzlib
opensslzlibopenssl
zlib
pdo_mysqlpdo
mysqlnd
pharzlib
xzxz
zlibzlib

库的依赖表

Linux

Library NameRequired LibrariesSuggested Libraries
curlopenssl
zlib
libssh2
brotli
nghttp2
nghttp3
ngtcp2
zstd
libcares
freetypezliblibpng
bzip2
brotli
gettextlibiconvncurses
libxml2
grpczlib
openssl
imagemagickzlib
libpng
libjpeg
libwebp
freetype
libtiff
libheif
bzip2
zstd
xz
libzip
libxml2
imapopenssl
ldapopenssl
zlib
gmp
libsodium
libaclattr
libeventopenssl
libheiflibde265
libwebp
libaom
zlib
brotli
libpngzlib
librabbitmqopenssl
librdkafkazstd
libssh2opensslzlib
libtiffzlib
libjpeg
libxml2libiconvxz
icu
zlib
libxsltlibxml2
libzipzlibbzip2
xz
zstd
openssl
nghttp2zlib
openssl
libxml2
nghttp3
ngtcp2
nghttp3openssl
ngtcp2opensslnghttp3
brotli
opensslzlib
postgresqllibiconv
libxml2
openssl
zlib
readline
icu
libxslt
ldap
zstd
readlinencurses
snappyzlib
unixodbclibiconv
xzlibiconv

macOS

Library NameRequired LibrariesSuggested Libraries
curlopenssl
zlib
libssh2
brotli
nghttp2
nghttp3
ngtcp2
zstd
libcares
freetypezliblibpng
bzip2
brotli
gettextlibiconvncurses
libxml2
grpczlib
openssl
imagemagickzlib
libpng
libjpeg
libwebp
freetype
libtiff
libheif
bzip2
zstd
xz
libzip
libxml2
imapopenssl
ldapopenssl
zlib
gmp
libsodium
libeventopenssl
libheiflibde265
libwebp
libaom
zlib
brotli
libpngzlib
librabbitmqopenssl
librdkafkazstd
libssh2opensslzlib
libtiffzlib
libjpeg
libxml2libiconvxz
icu
zlib
libxsltlibxml2
libzipzlibbzip2
xz
zstd
openssl
nghttp2zlib
openssl
libxml2
nghttp3
ngtcp2
nghttp3openssl
ngtcp2opensslnghttp3
brotli
opensslzlib
postgresqllibiconv
libxml2
openssl
zlib
readline
icu
libxslt
ldap
zstd
readlinencurses
snappyzlib
unixodbclibiconv
xzlibiconv

Windows

Library NameRequired LibrariesSuggested Libraries
curlzlib
libssh2
nghttp2
brotli
zstd
freetypezliblibpng
bzip2
brotli
libjpegzlib
libpngzlib
librabbitmqopenssl
libssh2opensslzlib
libxml2libiconv-winzlib
libzipzlib
bzip2
xz
zstd
openssl
nghttp2zlib
openssl
libxml2
nghttp3
ngtcp2
nghttp3openssl
ngtcp2opensslnghttp3
brotli
opensslzlib

FreeBSD

Library NameRequired LibrariesSuggested Libraries
curlopenssl
zlib
libssh2
brotli
nghttp2
nghttp3
ngtcp2
zstd
libcares
opensslzlib
',22)]))}const c=d(i,[["render",e]]);export{h as __pageData,c as default}; diff --git a/assets/zh_guide_deps-map.md.DQXDDLu_.lean.js b/assets/zh_guide_deps-map.md.DQXDDLu_.lean.js new file mode 100644 index 00000000..9ff7258c --- /dev/null +++ b/assets/zh_guide_deps-map.md.DQXDDLu_.lean.js @@ -0,0 +1 @@ +import{_ as d,c as b,o as r,af as l}from"./chunks/framework.PeLcR_tw.js";const h=JSON.parse('{"title":"依赖关系图表","description":"","frontmatter":{"outline":"deep"},"headers":[],"relativePath":"zh/guide/deps-map.md","filePath":"zh/guide/deps-map.md"}'),i={name:"zh/guide/deps-map.md"};function e(s,t,o,a,p,n){return r(),b("div",null,t[0]||(t[0]=[l("",22)]))}const c=d(i,[["render",e]]);export{h as __pageData,c as default}; diff --git a/assets/zh_guide_deps-map.md.DuTyzThf.js b/assets/zh_guide_deps-map.md.DuTyzThf.js deleted file mode 100644 index 8a390764..00000000 --- a/assets/zh_guide_deps-map.md.DuTyzThf.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as t,c as d,o as b,a1 as r}from"./chunks/framework.gjrnbxUT.js";const g=JSON.parse('{"title":"依赖关系图表","description":"","frontmatter":{"outline":"deep"},"headers":[],"relativePath":"zh/guide/deps-map.md","filePath":"zh/guide/deps-map.md"}'),l={name:"zh/guide/deps-map.md"},i=r('

依赖关系图表

在编译 PHP 时,每个扩展、库都有依赖关系,这些依赖关系可能是必需的,也可能是可选的。在编译 PHP 时,可以选择是否包含这些可选的依赖关系。

例如,在 Linux 下编译 gd 扩展时,会强制编译 zlib,libpng 库和 zlib 扩展,而 libavif,libwebp,libjpeg,freetype 库都是可选的库,默认不会编译,除非通过 --with-libs=avif,webp,jpeg,freetype 选项指定。

  • 对于可选扩展(扩展的可选特性),需手动在编译时指定,例如启用 Redis 的 igbinary 支持:bin/spc build redis,igbinary
  • 对于可选库,需通过 --with-libs=XXX 选项编译指定。
  • 如果想启用所有的可选扩展,可以使用 bin/spc build redis --with-suggested-exts 参数。
  • 如果想启用所有的可选库,可以使用 --with-suggested-libs 参数。

扩展的依赖图

Linux

Extension NameRequired ExtensionsSuggested ExtensionsRequired LibrariesSuggested Libraries
amqplibrabbitmq
bz2bzip2
curlcurl
dbaqdbm
domlibxml2
zlib
eventopensslsocketslibevent
ffilibffi
ftpopenssl
gdzlibzlib
libpng
libavif
libwebp
libjpeg
freetype
gettextgettext
gmpgmp
gmsslgmssl
grpcgrpc
iconvlibiconv
igbinarysession
apcu
imagickimagemagick
imapopensslimap
intlicu
ldapopensslldapgmp
libsodium
lz4liblz4
libxmlxml
mbregexmbstringonig
memcachezlib
session
mongodbicu
openssl
zstd
zlib
mysqlimysqlnd
mysqlndzlib
odbcunixodbc
opensslzlibopenssl
zlib
password-argon2libargon2
pdo_mysqlpdo
mysqlnd
pdo_odbcpdo
odbc
unixodbc
pdo_pgsqlpdo
pgsql
postgresql
pdo_sqlitepdo
sqlite3
sqlite
pdo_sqlsrvpdo
sqlsrv
pgsqlpostgresql
pharzlib
rdkafkalibrdkafka
readlinereadline
redissession
igbinary
zstd
liblz4
simplexmllibxml2
snappyapcusnappy
soaplibxml2
sodiumlibsodium
spxzlib
sqlite3sqlite
sqlsrvpcntlunixodbc
ssh2libssh2
swooleopenssl
curl
swoole-hook-pgsql
swoole-hook-mysql
swoole-hook-sqlite
libcares
brotli
nghttp2
zlib
swoole-hook-mysqlmysqlnd
pdo
pdo_mysql
mysqli
swoole-hook-pgsqlpgsql
pdo
swoole-hook-sqlitesqlite3
pdo
swowopenssl
curl
openssl
curl
tidytidy
uuidlibuuid
uvsocketslibuv
xhprofctype
xlswriterzlib
zip
openssl
xmllibxml2
xmlreaderlibxml2
xmlwriterlibxml2
xslxml
dom
libxslt
yacigbinary
yamllibyaml
ziplibzip
zlibzlib
zstdzstd

macOS

Extension NameRequired ExtensionsSuggested ExtensionsRequired LibrariesSuggested Libraries
amqplibrabbitmq
bz2bzip2
curlcurl
dbaqdbm
domlibxml2
zlib
eventopensslsocketslibevent
ffilibffi
ftpopenssl
gdzlibzlib
libpng
libavif
libwebp
libjpeg
freetype
gettextgettext
glfwglfw
gmpgmp
gmsslgmssl
grpcgrpc
iconvlibiconv
igbinarysession
apcu
imagickimagemagick
imapopensslimap
intlicu
ldapopensslldapgmp
libsodium
lz4liblz4
libxmlxml
mbregexmbstringonig
memcachezlib
session
memcachedsession
zlib
libmemcached
mongodbicu
openssl
zstd
zlib
mysqlimysqlnd
mysqlndzlib
odbcunixodbc
opensslzlibopenssl
zlib
password-argon2libargon2
pdo_mysqlpdo
mysqlnd
pdo_odbcpdo
odbc
unixodbc
pdo_pgsqlpdo
pgsql
postgresql
pdo_sqlitepdo
sqlite3
sqlite
pdo_sqlsrvpdo
sqlsrv
pgsqlpostgresql
pharzlib
rdkafkalibrdkafka
readlinereadline
redissession
igbinary
zstd
liblz4
simplexmllibxml2
snappyapcusnappy
soaplibxml2
sodiumlibsodium
spxzlib
sqlite3sqlite
sqlsrvunixodbc
ssh2libssh2
swooleopenssl
curl
swoole-hook-pgsql
swoole-hook-mysql
swoole-hook-sqlite
libcares
brotli
nghttp2
zlib
swoole-hook-mysqlmysqlnd
pdo
pdo_mysql
mysqli
swoole-hook-pgsqlpgsql
pdo
swoole-hook-sqlitesqlite3
pdo
swowopenssl
curl
openssl
curl
tidytidy
uuidlibuuid
uvsocketslibuv
xhprofctype
xlswriterzlib
zip
openssl
xmllibxml2
xmlreaderlibxml2
xmlwriterlibxml2
xslxml
dom
libxslt
yacigbinary
yamllibyaml
ziplibzip
zlibzlib
zstdzstd

Windows

Extension NameRequired ExtensionsSuggested ExtensionsRequired LibrariesSuggested Libraries
amqpopenssllibrabbitmq
bz2bzip2
curlzlib
openssl
curl
dbaqdbm
domxmllibxml2
zlib
ffilibffi-win
ftpopenssl
gdzlibzlib
libpng
libavif
libwebp
libjpeg
freetype
gmsslgmssl
iconvlibiconv-win
igbinarysession
apcu
libxmlxml
mbregexmbstringonig
mysqlimysqlnd
mysqlndzlib
opensslzlibopenssl
zlib
parallelpthreads4w
pdo_mysqlpdo
mysqlnd
pdo_odbcpdo
odbc
pdo_pgsqlpdo
pgsql
postgresql-win
pdo_sqlitepdo
sqlite3
sqlite
pdo_sqlsrvpdo
sqlsrv
pgsqlpostgresql-win
pharzlib
redissession
igbinary
simplexmlxmllibxml2
soapxmllibxml2
sodiumlibsodium
sqlite3sqlite
ssh2openssl
zlib
libssh2
swowopenssl
curl
openssl
curl
xlswriterzlib
zip
openssl
xmliconvlibxml2
xmlreaderxml
dom
libxml2
xmlwriterxmllibxml2
yamllibyaml
zipzlib
bz2
libzip
zlib
bzip2
xz
zlibzlib

FreeBSD

Extension NameRequired ExtensionsSuggested ExtensionsRequired LibrariesSuggested Libraries
bz2bzip2
curlcurl
dbaqdbm
ftpopenssl
mbregexmbstringonig
mysqlimysqlnd
mysqlndzlib
opensslzlibopenssl
zlib
pdo_mysqlpdo
mysqlnd
pharzlib
zlibzlib

库的依赖表

Linux

Library NameRequired LibrariesSuggested Libraries
curlopenssl
zlib
libssh2
brotli
nghttp2
nghttp3
ngtcp2
zstd
libcares
freetypezliblibpng
bzip2
brotli
gettextlibiconvncurses
libxml2
grpczlib
openssl
imagemagickzlib
libpng
libjpeg
libwebp
freetype
libtiff
libheif
bzip2
zstd
xz
libzip
libxml2
imapopenssl
ldapopenssl
zlib
gmp
libsodium
libaclattr
libeventopenssl
libheiflibde265
libwebp
libaom
zlib
brotli
libpngzlib
librabbitmqopenssl
librdkafkazstd
libssh2opensslzlib
libtiffzlib
libjpeg
libxml2libiconvxz
icu
zlib
libxsltlibxml2
libzipzlibbzip2
xz
zstd
openssl
nghttp2zlib
openssl
libxml2
nghttp3
ngtcp2
nghttp3openssl
ngtcp2opensslnghttp3
brotli
opensslzlib
postgresqllibiconv
libxml2
openssl
zlib
readline
icu
libxslt
ldap
zstd
readlinencurses
snappyzlib
unixodbclibiconv
xzlibiconv

macOS

Library NameRequired LibrariesSuggested Libraries
curlopenssl
zlib
libssh2
brotli
nghttp2
nghttp3
ngtcp2
zstd
libcares
freetypezliblibpng
bzip2
brotli
gettextlibiconvncurses
libxml2
grpczlib
openssl
imagemagickzlib
libpng
libjpeg
libwebp
freetype
libtiff
libheif
bzip2
zstd
xz
libzip
libxml2
imapopenssl
ldapopenssl
zlib
gmp
libsodium
libeventopenssl
libheiflibde265
libwebp
libaom
zlib
brotli
libpngzlib
librabbitmqopenssl
librdkafkazstd
libssh2opensslzlib
libtiffzlib
libjpeg
libxml2libiconvxz
icu
zlib
libxsltlibxml2
libzipzlibbzip2
xz
zstd
openssl
nghttp2zlib
openssl
libxml2
nghttp3
ngtcp2
nghttp3openssl
ngtcp2opensslnghttp3
brotli
opensslzlib
postgresqllibiconv
libxml2
openssl
zlib
readline
icu
libxslt
ldap
zstd
readlinencurses
snappyzlib
unixodbclibiconv
xzlibiconv

Windows

Library NameRequired LibrariesSuggested Libraries
curlzlib
libssh2
nghttp2
brotli
zstd
freetypezliblibpng
bzip2
brotli
libjpegzlib
libpngzlib
librabbitmqopenssl
libssh2opensslzlib
libxml2libiconv-winzlib
libzipzlib
bzip2
xz
zstd
openssl
nghttp2zlib
openssl
libxml2
nghttp3
ngtcp2
nghttp3openssl
ngtcp2opensslnghttp3
brotli
opensslzlib

FreeBSD

Library NameRequired LibrariesSuggested Libraries
curlopenssl
zlib
libssh2
brotli
nghttp2
nghttp3
ngtcp2
zstd
libcares
opensslzlib
',22),e=[i];function s(o,a,p,n,m,h){return b(),d("div",null,e)}const z=t(l,[["render",s]]);export{g as __pageData,z as default}; diff --git a/assets/zh_guide_deps-map.md.DuTyzThf.lean.js b/assets/zh_guide_deps-map.md.DuTyzThf.lean.js deleted file mode 100644 index d550da77..00000000 --- a/assets/zh_guide_deps-map.md.DuTyzThf.lean.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as t,c as d,o as b,a1 as r}from"./chunks/framework.gjrnbxUT.js";const g=JSON.parse('{"title":"依赖关系图表","description":"","frontmatter":{"outline":"deep"},"headers":[],"relativePath":"zh/guide/deps-map.md","filePath":"zh/guide/deps-map.md"}'),l={name:"zh/guide/deps-map.md"},i=r("",22),e=[i];function s(o,a,p,n,m,h){return b(),d("div",null,e)}const z=t(l,[["render",s]]);export{g as __pageData,z as default}; diff --git a/assets/zh_guide_env-vars.md.C-N0X5FV.js b/assets/zh_guide_env-vars.md.C-N0X5FV.js deleted file mode 100644 index 673be487..00000000 --- a/assets/zh_guide_env-vars.md.C-N0X5FV.js +++ /dev/null @@ -1,12 +0,0 @@ -import{_ as i,c as t,o as s,a1 as e}from"./chunks/framework.gjrnbxUT.js";const u=JSON.parse('{"title":"环境变量","description":"","frontmatter":{},"headers":[],"relativePath":"zh/guide/env-vars.md","filePath":"zh/guide/env-vars.md"}'),a={name:"zh/guide/env-vars.md"},n=e(`

环境变量

本页面的环境变量列表中所提到的所有环境变量都具有默认值,除非另有说明。你可以通过设置这些环境变量来覆盖默认值。

环境变量列表

在 2.3.5 版本之后,我们将环境变量集中到了 config/env.ini 文件中,你可以通过修改这个文件来设置环境变量。

我们将 static-php-cli 支持的环境变量分为三种:

  • 全局内部环境变量:在 static-php-cli 启动后即声明,你可以在 static-php-cli 的内部使用 getenv() 来获取他们,也可以在启动 static-php-cli 前覆盖。
  • 固定环境变量:在 static-php-cli 启动后声明,你仅可使用 getenv() 获取,但无法通过 shell 脚本对其覆盖。
  • 配置文件环境变量:在 static-php-cli 构建前声明,你可以通过修改 config/env.ini 文件或通过 shell 脚本来设置这些环境变量。

你可以阅读 config/env.ini 中每项参数的注释来了解其作用(仅限英文版)。

自定义环境变量

一般情况下,你不需要修改任何以下环境变量,因为它们已经被设置为最佳值。 但是,如果你有特殊需求,你可以通过设置这些环境变量来满足你的需求(比如你需要调试不同编译参数下的 PHP 性能表现)。

如需使用自定义环境变量,你可以在终端中使用 export 命令或者在命令前直接设置环境变量,例如:

shell
# export 方式
-export SPC_CONCURRENCY=4
-bin/spc build mbstring,pcntl --build-cli
-
-# 直接设置方式
-SPC_CONCURRENCY=4 bin/spc build mbstring,pcntl --build-cli

或者,如果你需要长期修改某个环境变量,你可以通过修改 config/env.ini 文件来实现。

config/env.ini 分为三段,其中 [global] 全局有效,[windows][macos][linux] 仅对应的操作系统有效。

例如,你需要修改编译 PHP 的 ./configure 命令,你可以在 config/env.ini 文件中找到 SPC_CMD_PREFIX_PHP_CONFIGURE 环境变量,然后修改其值即可。

但如果你的构建条件比较复杂,需要多种 env.ini 进行切换,我们推荐你使用 config/env.custom.ini 文件,这样你可以在不修改默认的 config/env.ini 文件的情况下, 通过写入额外的重载项目指定你的环境变量。

ini
; This is an example of \`config/env.custom.ini\` file, 
-; we modify the \`SPC_CONCURRENCY\` and linux default CFLAGS passing to libs and PHP
-[global]
-SPC_CONCURRENCY=4
-
-[linux]
-SPC_DEFAULT_C_FLAGS="-O3"

编译依赖库的环境变量(仅限 Unix 系统)

从 2.2.0 开始,static-php-cli 对所有 macOS、Linux、FreeBSD 等 Unix 系统的编译依赖库的命令均支持自定义环境变量。

这样你就可以随时通过环境变量来调整编译依赖库的行为。例如你可以通过 xxx_CFLAGS=-O0 来设置编译 xxx 库的优化参数。

当然,不是每个依赖库都支持注入环境变量,我们目前提供了三个通配的环境变量,后缀分别为:

  • _CFLAGS: C 编译器的参数
  • _LDFLAGS: 链接器的参数
  • _LIBS: 额外的链接库

前缀为依赖库的名称,具体依赖库的名称以 lib.json 为准。其中,带有 - 的依赖库名称需要将 - 替换为 _

下面是一个替换 openssl 库编译的优化选项示例:

shell
openssl_CFLAGS="-O0"

库名称使用同 lib.json 中列举的名称,区分大小写。

TIP

当未指定相关环境变量时,除以下变量外,其余值均默认为空:

var namevar default value
pkg_config_CFLAGSmacOS: $SPC_DEFAULT_C_FLAGS -Wimplicit-function-declaration -Wno-int-conversion, Other: empty
pkg_config_LDFLAGSLinux: --static, Other: empty
imagemagick_LDFLAGSLinux: -static, Other: empty
imagemagick_LIBSmacOS: -liconv, Other: empty
ldap_LDFLAGS-L$BUILD_LIB_PATH
openssl_CFLAGSLinux: $SPC_DEFAULT_C_FLAGS, Other: empty
others...empty

下表是支持自定义以上三种变量的依赖库名称列表:

lib name
brotli
bzip
curl
freetype
gettext
gmp
imagemagick
ldap
libargon2
libavif
libcares
libevent
openssl

TIP

因为给每个库适配自定义环境变量是一项特别繁琐的工作,且大部分情况下你都不需要这些库的自定义环境变量,所以我们目前只支持了部分库的自定义环境变量。

如果你需要自定义环境变量的库不在上方列表,可以通过 GitHub Issue 来提出需求。

`,29),d=[n];function l(p,c,o,h,r,k){return s(),t("div",null,d)}const b=i(a,[["render",l]]);export{u as __pageData,b as default}; diff --git a/assets/zh_guide_env-vars.md.C-N0X5FV.lean.js b/assets/zh_guide_env-vars.md.C-N0X5FV.lean.js deleted file mode 100644 index 01ae5c4c..00000000 --- a/assets/zh_guide_env-vars.md.C-N0X5FV.lean.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as i,c as t,o as s,a1 as e}from"./chunks/framework.gjrnbxUT.js";const u=JSON.parse('{"title":"环境变量","description":"","frontmatter":{},"headers":[],"relativePath":"zh/guide/env-vars.md","filePath":"zh/guide/env-vars.md"}'),a={name:"zh/guide/env-vars.md"},n=e("",29),d=[n];function l(p,c,o,h,r,k){return s(),t("div",null,d)}const b=i(a,[["render",l]]);export{u as __pageData,b as default}; diff --git a/assets/zh_guide_env-vars.md.DqYHbUfS.js b/assets/zh_guide_env-vars.md.DqYHbUfS.js new file mode 100644 index 00000000..fc92d517 --- /dev/null +++ b/assets/zh_guide_env-vars.md.DqYHbUfS.js @@ -0,0 +1,12 @@ +import{_ as t,c as s,o as e,af as a}from"./chunks/framework.PeLcR_tw.js";const k=JSON.parse('{"title":"环境变量","description":"","frontmatter":{},"headers":[],"relativePath":"zh/guide/env-vars.md","filePath":"zh/guide/env-vars.md"}'),n={name:"zh/guide/env-vars.md"};function l(d,i,c,p,h,o){return e(),s("div",null,i[0]||(i[0]=[a(`

环境变量

本页面的环境变量列表中所提到的所有环境变量都具有默认值,除非另有说明。你可以通过设置这些环境变量来覆盖默认值。

环境变量列表

在 2.3.5 版本之后,我们将环境变量集中到了 config/env.ini 文件中,你可以通过修改这个文件来设置环境变量。

我们将 static-php-cli 支持的环境变量分为三种:

  • 全局内部环境变量:在 static-php-cli 启动后即声明,你可以在 static-php-cli 的内部使用 getenv() 来获取他们,也可以在启动 static-php-cli 前覆盖。
  • 固定环境变量:在 static-php-cli 启动后声明,你仅可使用 getenv() 获取,但无法通过 shell 脚本对其覆盖。
  • 配置文件环境变量:在 static-php-cli 构建前声明,你可以通过修改 config/env.ini 文件或通过 shell 脚本来设置这些环境变量。

你可以阅读 config/env.ini 中每项参数的注释来了解其作用(仅限英文版)。

自定义环境变量

一般情况下,你不需要修改任何以下环境变量,因为它们已经被设置为最佳值。 但是,如果你有特殊需求,你可以通过设置这些环境变量来满足你的需求(比如你需要调试不同编译参数下的 PHP 性能表现)。

如需使用自定义环境变量,你可以在终端中使用 export 命令或者在命令前直接设置环境变量,例如:

shell
# export 方式
+export SPC_CONCURRENCY=4
+bin/spc build mbstring,pcntl --build-cli
+
+# 直接设置方式
+SPC_CONCURRENCY=4 bin/spc build mbstring,pcntl --build-cli

或者,如果你需要长期修改某个环境变量,你可以通过修改 config/env.ini 文件来实现。

config/env.ini 分为三段,其中 [global] 全局有效,[windows][macos][linux] 仅对应的操作系统有效。

例如,你需要修改编译 PHP 的 ./configure 命令,你可以在 config/env.ini 文件中找到 SPC_CMD_PREFIX_PHP_CONFIGURE 环境变量,然后修改其值即可。

但如果你的构建条件比较复杂,需要多种 env.ini 进行切换,我们推荐你使用 config/env.custom.ini 文件,这样你可以在不修改默认的 config/env.ini 文件的情况下, 通过写入额外的重载项目指定你的环境变量。

ini
; This is an example of \`config/env.custom.ini\` file, 
+; we modify the \`SPC_CONCURRENCY\` and linux default CFLAGS passing to libs and PHP
+[global]
+SPC_CONCURRENCY=4
+
+[linux]
+SPC_DEFAULT_C_FLAGS="-O3"

编译依赖库的环境变量(仅限 Unix 系统)

从 2.2.0 开始,static-php-cli 对所有 macOS、Linux、FreeBSD 等 Unix 系统的编译依赖库的命令均支持自定义环境变量。

这样你就可以随时通过环境变量来调整编译依赖库的行为。例如你可以通过 xxx_CFLAGS=-O0 来设置编译 xxx 库的优化参数。

当然,不是每个依赖库都支持注入环境变量,我们目前提供了三个通配的环境变量,后缀分别为:

  • _CFLAGS: C 编译器的参数
  • _LDFLAGS: 链接器的参数
  • _LIBS: 额外的链接库

前缀为依赖库的名称,具体依赖库的名称以 lib.json 为准。其中,带有 - 的依赖库名称需要将 - 替换为 _

下面是一个替换 openssl 库编译的优化选项示例:

shell
openssl_CFLAGS="-O0"

库名称使用同 lib.json 中列举的名称,区分大小写。

TIP

当未指定相关环境变量时,除以下变量外,其余值均默认为空:

var namevar default value
pkg_config_CFLAGSmacOS: $SPC_DEFAULT_C_FLAGS -Wimplicit-function-declaration -Wno-int-conversion, Other: empty
pkg_config_LDFLAGSLinux: --static, Other: empty
imagemagick_LDFLAGSLinux: -static, Other: empty
imagemagick_LIBSmacOS: -liconv, Other: empty
ldap_LDFLAGS-L$BUILD_LIB_PATH
openssl_CFLAGSLinux: $SPC_DEFAULT_C_FLAGS, Other: empty
others...empty

下表是支持自定义以上三种变量的依赖库名称列表:

lib name
brotli
bzip
curl
freetype
gettext
gmp
imagemagick
ldap
libargon2
libavif
libcares
libevent
openssl

TIP

因为给每个库适配自定义环境变量是一项特别繁琐的工作,且大部分情况下你都不需要这些库的自定义环境变量,所以我们目前只支持了部分库的自定义环境变量。

如果你需要自定义环境变量的库不在上方列表,可以通过 GitHub Issue 来提出需求。

`,29)]))}const g=t(n,[["render",l]]);export{k as __pageData,g as default}; diff --git a/assets/zh_guide_env-vars.md.DqYHbUfS.lean.js b/assets/zh_guide_env-vars.md.DqYHbUfS.lean.js new file mode 100644 index 00000000..10fd54a9 --- /dev/null +++ b/assets/zh_guide_env-vars.md.DqYHbUfS.lean.js @@ -0,0 +1 @@ +import{_ as t,c as s,o as e,af as a}from"./chunks/framework.PeLcR_tw.js";const k=JSON.parse('{"title":"环境变量","description":"","frontmatter":{},"headers":[],"relativePath":"zh/guide/env-vars.md","filePath":"zh/guide/env-vars.md"}'),n={name:"zh/guide/env-vars.md"};function l(d,i,c,p,h,o){return e(),s("div",null,i[0]||(i[0]=[a("",29)]))}const g=t(n,[["render",l]]);export{k as __pageData,g as default}; diff --git a/assets/zh_guide_extension-notes.md.BwAQ8Pky.js b/assets/zh_guide_extension-notes.md.BwAQ8Pky.js deleted file mode 100644 index 6cdb792a..00000000 --- a/assets/zh_guide_extension-notes.md.BwAQ8Pky.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as e,c as o,o as l,a1 as a}from"./chunks/framework.gjrnbxUT.js";const u=JSON.parse('{"title":"扩展注意事项","description":"","frontmatter":{},"headers":[],"relativePath":"zh/guide/extension-notes.md","filePath":"zh/guide/extension-notes.md"}'),i={name:"zh/guide/extension-notes.md"},r=a('

扩展注意事项

因为是静态编译,扩展不会 100% 完美编译,而且不同扩展对 PHP、环境都有不同的要求,这里将一一列举。

curl

HTTP3 支持默认未启用,需在编译时添加 --with-libs="nghttp2,nghttp3,ngtcp2" 以启用 PHP 8.4 及以上版本的 HTTP3 支持。

使用 curl 请求 HTTPS 时,可能存在 error:80000002:system library::No such file or directory 错误, 解决办法详见 FAQ - 无法使用 ssl

phpmicro

  1. phpmicro SAPI 仅支持 PHP >= 8.0 版本。

swoole

  1. swoole >= 5.0 版本仅支持 PHP >= 8.0 版本。
  2. swoole 目前不支持 PHP 8.0 版本 curl 的 hook(后续有可能会修复)。
  3. 编译时只包含 swoole 扩展时不会完整开启支持的 Swoole 数据库协程 hook,如需使用请加入对应的 swoole-hook-xxx 扩展。
  4. swoole 在部分扩展组合下可能出现 zend_mm_heap corrupted 问题,暂未找到是什么原因导致的。

swoole-hook-pgsql

swoole-hook-pgsql 不是一个扩展,而是 Swoole 的 Hook 特性。 如果你在编译时添加了 swoole,swoole-hook-pgsql,你将启用 Swoole 的 PostgreSQL 客户端和 pdo_pgsql 扩展的协程模式。

swoole-hook-pgsql 与 pdo_pgsql 扩展冲突。如需使用 Swoole 和 pdo_pgsql,请删除 pdo_pgsql 扩展,启用 swooleswoole-hook-pgsql 即可。 该扩展包含了 pdo_pgsql 的协程环境的实现。

在 macOS 系统,pdo_pgsql 可能无法正常连接到 postgresql 服务器,请谨慎使用。

swoole-hook-mysql

swoole-hook-mysql 不是一个扩展,而是 Swoole 的 Hook 特性。 如果你在编译时添加了 swoole,swoole-hook-mysql,你将启用 Swoole 的 mysqlndpdo_mysql 的协程模式。

swoole-hook-sqlite

swoole-hook-sqlite 不是一个扩展,而是 Swoole 的 Hook 特性。 如果你在编译时添加了 swoole,swoole-hook-sqlite,你将启用 Swoole 的 pdo_sqlite 的协程模式(Swoole 必须为 5.1 以上)。

swoole-hook-sqlite 与 pdo_sqlite 扩展冲突。如需使用 Swoole 和 pdo_sqlite,请删除 pdo_sqlite 扩展,启用 swooleswoole-hook-sqlite 即可。 该扩展包含了 pdo_sqlite 的协程环境的实现。

swow

  1. swow 仅支持 PHP 8.0 ~ 8.4 版本。

imagick

imagick 扩展目前仅在 musl libc 上支持 OpenMP(libgomp)。使用 glibc 方式构建的 imagick 扩展无法支持多线程特性。

imap

  1. 该扩展目前不支持 Kerberos。
  2. 由于底层的 c-client、ext-imap 不是线程安全的。 无法在 --enable-zts 构建中使用它。
  3. 由于该扩展可能会从未来的 PHP 中删除,因此我们建议您寻找替代实现,例如 Webklex/php-imap

gd

  1. gd 扩展依赖了较多的额外图形库,默认情况下,直接使用 bin/spc build gd 不会引入和支持部分图形库,例如 libjpeglibavif 等, 需要使用 --with-libs 参数补全。目前支持 freetype,libjpeg,libavif,libwebp 四个库的支持,所以这里可以使用以下命令来让 gd 库引入它们:
bash
bin/spc build gd --with-libs=freetype,libjpeg,libavif,libwebp --build-cli

mcrypt

  1. 目前未支持,未来也不计划支持此扩展。#32

oci8

  1. oci8 是 Oracle 数据库的扩展,因为 Oracle 提供的扩展所依赖的库未提供静态编译版本(.a)或源代码,无法使用静态链接的方式将此扩展编译到 php 内,故无法支持。

xdebug

  1. Xdebug 只能作为共享扩展进行构建。在 Linux 上,您需要使用 static-php-cli 并设置 SPC_LIBC=glibc。
  2. 使用 Linux/glibc 或 macOS 时,您可以使用 --build-shared=xdebug 将 Xdebug 编译为共享扩展。 编译后的 ./php 二进制文件可以通过指定 INI 文件进行配置和运行,例如 ./php -d 'zend_extension=/path/to/xdebug.so' your-code.php

xml

  1. xml包括 xmlreader、xmlwriter、dom、simplexml 等,添加 xml 扩展时最好同时启用这些扩展。
  2. libxml 包含在 xml 扩展中。 启用 xml 相当于启用 libxml。

glfw

  1. glfw 扩展依赖 OpenGL,在 Linux 平台还依赖 X11 等环境,这些库都无法被轻易地动态链接。
  2. 在 macOS 系统下,我们可以动态链接系统的 OpenGL 和一些相关的库。

rar

  1. rar 扩展目前在 macOS x86_64 环境下与 common 扩展集合编译 phpmicro 存在问题。

pgsql

pgsql ssl 连接与 openssl 3.2.0 不兼容。相关链接:

pgsql 16.2 修复了这个 Bug,现在正常工作了。

在 pgsql 使用 SSL 连接时,可能存在 error:80000002:system library::No such file or directory 错误, 解决办法详见 FAQ - 无法使用 ssl

openssl

使用基于 openssl 的扩展(如 curl、pgsql 等网络库)时,可能存在 error:80000002:system library::No such file or directory 错误, 解决办法详见 FAQ - 无法使用 ssl

password-argon2

  1. password-argon2不是一个标准的扩展,它是 password_hash 函数的额外算法。
  2. 在Linux系统,password-argon2 的依赖库 libargon2libsodium 库冲突。

ffi

  1. 由于 musl libc 静态链接的限制,无法加载动态库,因此无法使用 ffi。 如果您需要使用 ffi 扩展,请参阅 使用 GNU libc 编译 PHP
  2. macOS 支持 ffi 扩展,但某些内核不包含调试符号时会出现错误。
  3. Windows x64 支持 ffi 扩展。

xhprof

xhprof 扩展包含三部分:xhprof_extensionxhprof_htmlxhprof_libs。编译的二进制中只包含 xhprof_extension。 如果需要使用 xhprof,请到 pecl.php.net/package/xhprof 下载源码,指定 xhprof_libsxhprof_html 路径来使用。

event

event 扩展在 macOS 系统下编译后暂无法使用 openpty 特性。相关 Issue:

parallel

parallel 扩展只支持 PHP 8.0 及以上版本,并只支持 ZTS 构建(--enable-zts)。

spx

  1. SPX 扩展 只支持非线程模式。
  2. SPX 目前不支持 Windows,且官方仓库也不支持静态编译,static-php-cli 使用了 修改版本

mimalloc

  1. 从技术上讲,这不是扩展,而是一个库。
  2. 在 Linux 或 macOS 上使用 --with-libs="mimalloc" 进行构建将覆盖默认分配器。
  3. 目前,这还处于实验阶段,但建议在线程环境中使用。
',61),s=[r];function t(h,c,d,p,n,b){return l(),o("div",null,s)}const g=e(i,[["render",t]]);export{u as __pageData,g as default}; diff --git a/assets/zh_guide_extension-notes.md.BwAQ8Pky.lean.js b/assets/zh_guide_extension-notes.md.BwAQ8Pky.lean.js deleted file mode 100644 index 69d32087..00000000 --- a/assets/zh_guide_extension-notes.md.BwAQ8Pky.lean.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as e,c as o,o as l,a1 as a}from"./chunks/framework.gjrnbxUT.js";const u=JSON.parse('{"title":"扩展注意事项","description":"","frontmatter":{},"headers":[],"relativePath":"zh/guide/extension-notes.md","filePath":"zh/guide/extension-notes.md"}'),i={name:"zh/guide/extension-notes.md"},r=a("",61),s=[r];function t(h,c,d,p,n,b){return l(),o("div",null,s)}const g=e(i,[["render",t]]);export{u as __pageData,g as default}; diff --git a/assets/zh_guide_extension-notes.md.DoauYqMF.js b/assets/zh_guide_extension-notes.md.DoauYqMF.js new file mode 100644 index 00000000..e76d31d0 --- /dev/null +++ b/assets/zh_guide_extension-notes.md.DoauYqMF.js @@ -0,0 +1 @@ +import{_ as o,c as l,o as a,af as i}from"./chunks/framework.PeLcR_tw.js";const b=JSON.parse('{"title":"扩展注意事项","description":"","frontmatter":{},"headers":[],"relativePath":"zh/guide/extension-notes.md","filePath":"zh/guide/extension-notes.md"}'),r={name:"zh/guide/extension-notes.md"};function s(h,e,c,d,t,p){return a(),l("div",null,e[0]||(e[0]=[i('

扩展注意事项

因为是静态编译,扩展不会 100% 完美编译,而且不同扩展对 PHP、环境都有不同的要求,这里将一一列举。

curl

HTTP3 支持默认未启用,需在编译时添加 --with-libs="nghttp2,nghttp3,ngtcp2" 以启用 PHP 8.4 及以上版本的 HTTP3 支持。

使用 curl 请求 HTTPS 时,可能存在 error:80000002:system library::No such file or directory 错误, 解决办法详见 FAQ - 无法使用 ssl

phpmicro

  1. phpmicro SAPI 仅支持 PHP >= 8.0 版本。

swoole

  1. swoole >= 5.0 版本仅支持 PHP >= 8.0 版本。
  2. swoole 目前不支持 PHP 8.0 版本 curl 的 hook(后续有可能会修复)。
  3. 编译时只包含 swoole 扩展时不会完整开启支持的 Swoole 数据库协程 hook,如需使用请加入对应的 swoole-hook-xxx 扩展。
  4. swoole 在部分扩展组合下可能出现 zend_mm_heap corrupted 问题,暂未找到是什么原因导致的。

swoole-hook-pgsql

swoole-hook-pgsql 不是一个扩展,而是 Swoole 的 Hook 特性。 如果你在编译时添加了 swoole,swoole-hook-pgsql,你将启用 Swoole 的 PostgreSQL 客户端和 pdo_pgsql 扩展的协程模式。

swoole-hook-pgsql 与 pdo_pgsql 扩展冲突。如需使用 Swoole 和 pdo_pgsql,请删除 pdo_pgsql 扩展,启用 swooleswoole-hook-pgsql 即可。 该扩展包含了 pdo_pgsql 的协程环境的实现。

在 macOS 系统,pdo_pgsql 可能无法正常连接到 postgresql 服务器,请谨慎使用。

swoole-hook-mysql

swoole-hook-mysql 不是一个扩展,而是 Swoole 的 Hook 特性。 如果你在编译时添加了 swoole,swoole-hook-mysql,你将启用 Swoole 的 mysqlndpdo_mysql 的协程模式。

swoole-hook-sqlite

swoole-hook-sqlite 不是一个扩展,而是 Swoole 的 Hook 特性。 如果你在编译时添加了 swoole,swoole-hook-sqlite,你将启用 Swoole 的 pdo_sqlite 的协程模式(Swoole 必须为 5.1 以上)。

swoole-hook-sqlite 与 pdo_sqlite 扩展冲突。如需使用 Swoole 和 pdo_sqlite,请删除 pdo_sqlite 扩展,启用 swooleswoole-hook-sqlite 即可。 该扩展包含了 pdo_sqlite 的协程环境的实现。

swow

  1. swow 仅支持 PHP 8.0 ~ 8.4 版本。

imagick

imagick 扩展目前仅在 musl libc 上支持 OpenMP(libgomp)。使用 glibc 方式构建的 imagick 扩展无法支持多线程特性。

imap

  1. 该扩展目前不支持 Kerberos。
  2. 由于底层的 c-client、ext-imap 不是线程安全的。 无法在 --enable-zts 构建中使用它。
  3. 由于该扩展可能会从未来的 PHP 中删除,因此我们建议您寻找替代实现,例如 Webklex/php-imap

gd

  1. gd 扩展依赖了较多的额外图形库,默认情况下,直接使用 bin/spc build gd 不会引入和支持部分图形库,例如 libjpeglibavif 等, 需要使用 --with-libs 参数补全。目前支持 freetype,libjpeg,libavif,libwebp 四个库的支持,所以这里可以使用以下命令来让 gd 库引入它们:
bash
bin/spc build gd --with-libs=freetype,libjpeg,libavif,libwebp --build-cli

mcrypt

  1. 目前未支持,未来也不计划支持此扩展。#32

oci8

  1. oci8 是 Oracle 数据库的扩展,因为 Oracle 提供的扩展所依赖的库未提供静态编译版本(.a)或源代码,无法使用静态链接的方式将此扩展编译到 php 内,故无法支持。

xdebug

  1. Xdebug 只能作为共享扩展进行构建。在 Linux 上,您需要使用 static-php-cli 并设置 SPC_LIBC=glibc。
  2. 使用 Linux/glibc 或 macOS 时,您可以使用 --build-shared=xdebug 将 Xdebug 编译为共享扩展。 编译后的 ./php 二进制文件可以通过指定 INI 文件进行配置和运行,例如 ./php -d 'zend_extension=/path/to/xdebug.so' your-code.php

xml

  1. xml包括 xmlreader、xmlwriter、dom、simplexml 等,添加 xml 扩展时最好同时启用这些扩展。
  2. libxml 包含在 xml 扩展中。 启用 xml 相当于启用 libxml。

glfw

  1. glfw 扩展依赖 OpenGL,在 Linux 平台还依赖 X11 等环境,这些库都无法被轻易地动态链接。
  2. 在 macOS 系统下,我们可以动态链接系统的 OpenGL 和一些相关的库。

rar

  1. rar 扩展目前在 macOS x86_64 环境下与 common 扩展集合编译 phpmicro 存在问题。

pgsql

pgsql ssl 连接与 openssl 3.2.0 不兼容。相关链接:

pgsql 16.2 修复了这个 Bug,现在正常工作了。

在 pgsql 使用 SSL 连接时,可能存在 error:80000002:system library::No such file or directory 错误, 解决办法详见 FAQ - 无法使用 ssl

openssl

使用基于 openssl 的扩展(如 curl、pgsql 等网络库)时,可能存在 error:80000002:system library::No such file or directory 错误, 解决办法详见 FAQ - 无法使用 ssl

password-argon2

  1. password-argon2不是一个标准的扩展,它是 password_hash 函数的额外算法。
  2. 在Linux系统,password-argon2 的依赖库 libargon2libsodium 库冲突。

ffi

  1. 由于 musl libc 静态链接的限制,无法加载动态库,因此无法使用 ffi。 如果您需要使用 ffi 扩展,请参阅 使用 GNU libc 编译 PHP
  2. macOS 支持 ffi 扩展,但某些内核不包含调试符号时会出现错误。
  3. Windows x64 支持 ffi 扩展。

xhprof

xhprof 扩展包含三部分:xhprof_extensionxhprof_htmlxhprof_libs。编译的二进制中只包含 xhprof_extension。 如果需要使用 xhprof,请到 pecl.php.net/package/xhprof 下载源码,指定 xhprof_libsxhprof_html 路径来使用。

event

event 扩展在 macOS 系统下编译后暂无法使用 openpty 特性。相关 Issue:

parallel

parallel 扩展只支持 PHP 8.0 及以上版本,并只支持 ZTS 构建(--enable-zts)。

spx

  1. SPX 目前不支持 Windows,且官方仓库也不支持静态编译,static-php-cli 使用了 修改版本

mimalloc

  1. 从技术上讲,这不是扩展,而是一个库。
  2. 在 Linux 或 macOS 上使用 --with-libs="mimalloc" 进行构建将覆盖默认分配器。
  3. 目前,这还处于实验阶段,但建议在线程环境中使用。
',61)]))}const m=o(r,[["render",s]]);export{b as __pageData,m as default}; diff --git a/assets/zh_guide_extension-notes.md.DoauYqMF.lean.js b/assets/zh_guide_extension-notes.md.DoauYqMF.lean.js new file mode 100644 index 00000000..8746f71d --- /dev/null +++ b/assets/zh_guide_extension-notes.md.DoauYqMF.lean.js @@ -0,0 +1 @@ +import{_ as o,c as l,o as a,af as i}from"./chunks/framework.PeLcR_tw.js";const b=JSON.parse('{"title":"扩展注意事项","description":"","frontmatter":{},"headers":[],"relativePath":"zh/guide/extension-notes.md","filePath":"zh/guide/extension-notes.md"}'),r={name:"zh/guide/extension-notes.md"};function s(h,e,c,d,t,p){return a(),l("div",null,e[0]||(e[0]=[i("",61)]))}const m=o(r,[["render",s]]);export{b as __pageData,m as default}; diff --git a/assets/zh_guide_extensions.md.CvO7qoz0.js b/assets/zh_guide_extensions.md.CvO7qoz0.js new file mode 100644 index 00000000..713be1c7 --- /dev/null +++ b/assets/zh_guide_extensions.md.CvO7qoz0.js @@ -0,0 +1 @@ +import{_ as i}from"./chunks/SearchTable.B9T2e1C1.js";import{c as a,o as l,af as t,J as s}from"./chunks/framework.PeLcR_tw.js";const n=JSON.parse('{"title":"扩展列表","description":"","frontmatter":{},"headers":[],"relativePath":"zh/guide/extensions.md","filePath":"zh/guide/extensions.md"}'),o={name:"zh/guide/extensions.md"},p=Object.assign(o,{setup(c){return(r,e)=>(l(),a("div",null,[e[0]||(e[0]=t('

扩展列表

  • yes: 已支持
  • 空白: 目前还不支持,或正在支持中
  • no with issue link: 确定不支持或无法支持
  • partial with issue link: 已支持,但是无法完美工作
',2)),s(i),e[1]||(e[1]=t('

TIP

如果缺少您需要的扩展,您可以创建 功能请求

有些扩展或扩展依赖的库会有一些可选的特性,例如 gd 库可选支持 libwebp、freetype 等。 如果你只使用 bin/spc build gd --build-cli 是不会包含它们(static-php-cli 默认为最小依赖原则)。

有关编译可选库,请参考 扩展、库的依赖关系图表。对于可选的库,你也可以从 编译命令生成器 中选择扩展后展开选择可选库。

',1))]))}});export{n as __pageData,p as default}; diff --git a/assets/zh_guide_extensions.md.CvO7qoz0.lean.js b/assets/zh_guide_extensions.md.CvO7qoz0.lean.js new file mode 100644 index 00000000..a4699b6c --- /dev/null +++ b/assets/zh_guide_extensions.md.CvO7qoz0.lean.js @@ -0,0 +1 @@ +import{_ as i}from"./chunks/SearchTable.B9T2e1C1.js";import{c as a,o as l,af as t,J as s}from"./chunks/framework.PeLcR_tw.js";const n=JSON.parse('{"title":"扩展列表","description":"","frontmatter":{},"headers":[],"relativePath":"zh/guide/extensions.md","filePath":"zh/guide/extensions.md"}'),o={name:"zh/guide/extensions.md"},p=Object.assign(o,{setup(c){return(r,e)=>(l(),a("div",null,[e[0]||(e[0]=t("",2)),s(i),e[1]||(e[1]=t("",1))]))}});export{n as __pageData,p as default}; diff --git a/assets/zh_guide_extensions.md.HviYRhA7.js b/assets/zh_guide_extensions.md.HviYRhA7.js deleted file mode 100644 index e8259033..00000000 --- a/assets/zh_guide_extensions.md.HviYRhA7.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as t}from"./chunks/SearchTable.CnJN64_Q.js";import{c as a,I as i,a1 as e,o as s}from"./chunks/framework.gjrnbxUT.js";const c=e('

扩展列表

  • yes: 已支持
  • 空白: 目前还不支持,或正在支持中
  • no with issue link: 确定不支持或无法支持
  • partial with issue link: 已支持,但是无法完美工作
',2),o=e('

TIP

如果缺少您需要的扩展,您可以创建 功能请求

有些扩展或扩展依赖的库会有一些可选的特性,例如 gd 库可选支持 libwebp、freetype 等。 如果你只使用 bin/spc build gd --build-cli 是不会包含它们(static-php-cli 默认为最小依赖原则)。

有关编译可选库,请参考 扩展、库的依赖关系图表。对于可选的库,你也可以从 编译命令生成器 中选择扩展后展开选择可选库。

',1),h=JSON.parse('{"title":"扩展列表","description":"","frontmatter":{},"headers":[],"relativePath":"zh/guide/extensions.md","filePath":"zh/guide/extensions.md"}'),l={name:"zh/guide/extensions.md"},u=Object.assign(l,{setup(_){return(r,d)=>(s(),a("div",null,[c,i(t),o]))}});export{h as __pageData,u as default}; diff --git a/assets/zh_guide_extensions.md.HviYRhA7.lean.js b/assets/zh_guide_extensions.md.HviYRhA7.lean.js deleted file mode 100644 index 1ba5e412..00000000 --- a/assets/zh_guide_extensions.md.HviYRhA7.lean.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as t}from"./chunks/SearchTable.CnJN64_Q.js";import{c as a,I as i,a1 as e,o as s}from"./chunks/framework.gjrnbxUT.js";const c=e("",2),o=e("",1),h=JSON.parse('{"title":"扩展列表","description":"","frontmatter":{},"headers":[],"relativePath":"zh/guide/extensions.md","filePath":"zh/guide/extensions.md"}'),l={name:"zh/guide/extensions.md"},u=Object.assign(l,{setup(_){return(r,d)=>(s(),a("div",null,[c,i(t),o]))}});export{h as __pageData,u as default}; diff --git a/assets/zh_guide_index.md.20ged7P4.js b/assets/zh_guide_index.md.20ged7P4.js deleted file mode 100644 index c39e79c5..00000000 --- a/assets/zh_guide_index.md.20ged7P4.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as t,c as a,o as e,a1 as d}from"./chunks/framework.gjrnbxUT.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('

指南

static-php-cli 是一个用于构建静态编译的 PHP 二进制的工具,目前支持 Linux 和 macOS 系统。

在指南章节中,你将了解到如何使用 static-php-cli 构建独立的 php 程序。

编译环境

下面是架构支持情况,⚙️ 代表支持 GitHub Action 构建,💻 代表支持本地构建,空 代表暂不支持。

x86_64aarch64
macOS⚙️ 💻⚙️ 💻
Linux⚙️ 💻⚙️ 💻
Windows⚙️ 💻
FreeBSD💻💻

其中,Linux 目前仅在 Ubuntu、Debian、Alpine 发行版测试通过,其他发行版未进行测试,不能保证编译成功。 对于未经过测试的发行版,可以使用 Docker 等方式本地编译,避免环境导致的问题。

macOS 下支持 x86_64 和 Arm 两种架构,但在其中一个架构上编译的二进制无法直接在另一个架构上使用。 Rosetta 2 不能保证 Arm 架构编译的程序可以完全运行在 x86_64 环境下。

Windows 目前只支持 x86_64 架构,不支持 32 位 x86、不支持 arm64 架构。

PHP 支持版本

目前,static-php-cli 对 PHP 8.1 ~ 8.4 版本是支持的,对于 PHP 8.0 及更早版本理论上支持,只需下载时选择早期版本即可。 但由于部分扩展和特殊组件已对早期版本的 PHP 停止了支持,所以 static-php-cli 不会明确支持早期版本。 我们推荐你编译尽可能新的 PHP 版本,以获得更好的体验。

',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}; diff --git a/assets/zh_guide_index.md.20ged7P4.lean.js b/assets/zh_guide_index.md.20ged7P4.lean.js deleted file mode 100644 index b72e9343..00000000 --- a/assets/zh_guide_index.md.20ged7P4.lean.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as t,c as a,o as e,a1 as d}from"./chunks/framework.gjrnbxUT.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}; diff --git a/assets/zh_guide_index.md.DIAjAKH4.js b/assets/zh_guide_index.md.DIAjAKH4.js new file mode 100644 index 00000000..62968e33 --- /dev/null +++ b/assets/zh_guide_index.md.DIAjAKH4.js @@ -0,0 +1 @@ +import{_ as a,c as e,o as d,af as i}from"./chunks/framework.PeLcR_tw.js";const _=JSON.parse('{"title":"指南","description":"","frontmatter":{},"headers":[],"relativePath":"zh/guide/index.md","filePath":"zh/guide/index.md"}'),r={name:"zh/guide/index.md"};function n(h,t,l,p,c,o){return d(),e("div",null,t[0]||(t[0]=[i('

指南

static-php-cli 是一个用于构建静态编译的 PHP 二进制的工具,目前支持 Linux 和 macOS 系统。

在指南章节中,你将了解到如何使用 static-php-cli 构建独立的 php 程序。

编译环境

下面是架构支持情况,⚙️ 代表支持 GitHub Action 构建,💻 代表支持本地构建,空 代表暂不支持。

x86_64aarch64
macOS⚙️ 💻⚙️ 💻
Linux⚙️ 💻⚙️ 💻
Windows⚙️ 💻
FreeBSD💻💻

其中,Linux 目前仅在 Ubuntu、Debian、Alpine 发行版测试通过,其他发行版未进行测试,不能保证编译成功。 对于未经过测试的发行版,可以使用 Docker 等方式本地编译,避免环境导致的问题。

macOS 下支持 x86_64 和 Arm 两种架构,但在其中一个架构上编译的二进制无法直接在另一个架构上使用。 Rosetta 2 不能保证 Arm 架构编译的程序可以完全运行在 x86_64 环境下。

Windows 目前只支持 x86_64 架构,不支持 32 位 x86、不支持 arm64 架构。

PHP 支持版本

目前,static-php-cli 对 PHP 8.1 ~ 8.4 版本是支持的,对于 PHP 8.0 及更早版本理论上支持,只需下载时选择早期版本即可。 但由于部分扩展和特殊组件已对早期版本的 PHP 停止了支持,所以 static-php-cli 不会明确支持早期版本。 我们推荐你编译尽可能新的 PHP 版本,以获得更好的体验。

',12)]))}const m=a(r,[["render",n]]);export{_ as __pageData,m as default}; diff --git a/assets/zh_guide_index.md.DIAjAKH4.lean.js b/assets/zh_guide_index.md.DIAjAKH4.lean.js new file mode 100644 index 00000000..13545547 --- /dev/null +++ b/assets/zh_guide_index.md.DIAjAKH4.lean.js @@ -0,0 +1 @@ +import{_ as a,c as e,o as d,af as i}from"./chunks/framework.PeLcR_tw.js";const _=JSON.parse('{"title":"指南","description":"","frontmatter":{},"headers":[],"relativePath":"zh/guide/index.md","filePath":"zh/guide/index.md"}'),r={name:"zh/guide/index.md"};function n(h,t,l,p,c,o){return d(),e("div",null,t[0]||(t[0]=[i("",12)]))}const m=a(r,[["render",n]]);export{_ as __pageData,m as default}; diff --git a/assets/zh_guide_manual-build.md.Rx1xsyX8.js b/assets/zh_guide_manual-build.md.BjPCGg5B.js similarity index 55% rename from assets/zh_guide_manual-build.md.Rx1xsyX8.js rename to assets/zh_guide_manual-build.md.BjPCGg5B.js index fe8d4d40..5f9a124c 100644 --- a/assets/zh_guide_manual-build.md.Rx1xsyX8.js +++ b/assets/zh_guide_manual-build.md.BjPCGg5B.js @@ -1,4 +1,4 @@ -import{_ as s,c as i,o as a,a1 as n}from"./chunks/framework.gjrnbxUT.js";const g=JSON.parse('{"title":"本地构建(Linux、macOS、FreeBSD)","description":"","frontmatter":{"outline":"deep"},"headers":[],"relativePath":"zh/guide/manual-build.md","filePath":"zh/guide/manual-build.md"}'),p={name:"zh/guide/manual-build.md"},l=n(`

本地构建(Linux、macOS、FreeBSD)

本章节为 Linux、macOS、FreeBSD 的构建过程,如果你要在 Windows 上构建,请到 在 Windows 上构建

手动构建(使用 SPC 二进制)(推荐)

本项目提供了一个 static-php-cli 的二进制文件,你可以直接下载对应平台的二进制文件,然后使用它来构建静态的 PHP。目前 spc 二进制支持的平台有 Linux 和 macOS。

使用以下命令从自托管服务器下载:

bash
# Download from self-hosted nightly builds (sync with main branch)
+import{_ as i,c as a,o as n,af as l}from"./chunks/framework.PeLcR_tw.js";const o=JSON.parse('{"title":"本地构建(Linux、macOS、FreeBSD)","description":"","frontmatter":{"outline":"deep"},"headers":[],"relativePath":"zh/guide/manual-build.md","filePath":"zh/guide/manual-build.md"}'),e={name:"zh/guide/manual-build.md"};function p(t,s,h,k,d,c){return n(),a("div",null,s[0]||(s[0]=[l(`

本地构建(Linux、macOS、FreeBSD)

本章节为 Linux、macOS、FreeBSD 的构建过程,如果你要在 Windows 上构建,请到 在 Windows 上构建

手动构建(使用 SPC 二进制)(推荐)

本项目提供了一个 static-php-cli 的二进制文件,你可以直接下载对应平台的二进制文件,然后使用它来构建静态的 PHP。目前 spc 二进制支持的平台有 Linux 和 macOS。

使用以下命令从自托管服务器下载:

bash
# Download from self-hosted nightly builds (sync with main branch)
 # For Linux x86_64
 curl -fsSL -o spc https://dl.static-php.dev/static-php-cli/spc-bin/nightly/spc-linux-x86_64
 # For Linux aarch64
@@ -16,26 +16,26 @@ import{_ as s,c as i,o as a,a1 as n}from"./chunks/framework.gjrnbxUT.js";const g
 # Run (Linux and macOS)
 ./spc --version
 # Run (Windows powershell)
-.\\spc.exe --version

如果你使用的是打包好的 spc 二进制,你需要将下面所有命令中 bin/spc 开头替换为 ./spc

手动构建(使用源码)

如果使用 spc 二进制出现问题,或你有修改 static-php-cli 源码需求,请从源码下载 static-php-cli。

目前支持在 macOS、Linux 上构建,macOS 支持最新版操作系统和两种架构,Linux 支持 Debian、RHEL 及衍生发行版、Alpine Linux 等。

因为本项目本身采用 PHP 开发,所以在编译时也需要系统安装 PHP。本项目本身也提供了适用于本项目的静态二进制 php,可以根据实际情况自行选择使用。

下载本项目

bash
git clone https://github.com/crazywhalecc/static-php-cli.git --depth=1
+.\\spc.exe --version

如果你使用的是打包好的 spc 二进制,你需要将下面所有命令中 bin/spc 开头替换为 ./spc

手动构建(使用源码)

如果使用 spc 二进制出现问题,或你有修改 static-php-cli 源码需求,请从源码下载 static-php-cli。

目前支持在 macOS、Linux 上构建,macOS 支持最新版操作系统和两种架构,Linux 支持 Debian、RHEL 及衍生发行版、Alpine Linux 等。

因为本项目本身采用 PHP 开发,所以在编译时也需要系统安装 PHP。本项目本身也提供了适用于本项目的静态二进制 php,可以根据实际情况自行选择使用。

下载本项目

bash
git clone https://github.com/crazywhalecc/static-php-cli.git --depth=1
 cd static-php-cli
 
 # 你需要先安装 PHP 环境后再运行 Composer 和本项目,安装方式可参考下面。
-composer update

使用预编译静态 PHP 二进制运行 static-php-cli

如果你不想使用 Docker、在系统内安装 PHP,可以直接下载本项目自身编译好的 php 二进制 cli 程序。使用流程如下:

使用命令部署环境,此脚本会从 自托管的服务器 下载一个当前操作系统的 php-cli 包, 并从 getcomposerAliyun(镜像) 下载 Composer。

TIP

使用预编译静态 PHP 二进制目前仅支持 Linux 和 macOS。FreeBSD 环境因为缺少自动化构建环境,所以暂不支持。

bash
bin/setup-runtime
+composer update

使用预编译静态 PHP 二进制运行 static-php-cli

如果你不想使用 Docker、在系统内安装 PHP,可以直接下载本项目自身编译好的 php 二进制 cli 程序。使用流程如下:

使用命令部署环境,此脚本会从 自托管的服务器 下载一个当前操作系统的 php-cli 包, 并从 getcomposerAliyun(镜像) 下载 Composer。

TIP

使用预编译静态 PHP 二进制目前仅支持 Linux 和 macOS。FreeBSD 环境因为缺少自动化构建环境,所以暂不支持。

bash
bin/setup-runtime
 
 # 对于中国大陆地区等网络环境特殊的用户,可使用镜像站加快下载速度
-bin/setup-runtime --mirror china

此脚本总共会下载两个文件:bin/phpbin/composer,下载完成后,有两种使用方式:

  1. bin/ 目录添加到 PATH 路径中:export PATH="/path/to/your/static-php-cli/bin:$PATH",添加路径后,相当于系统安装了 PHP,可直接使用 composerphp -v 等命令,也可以直接使用 bin/spc
  2. 直接调用,比如执行 static-php-cli 命令:bin/php bin/spc --help,执行 Composer:bin/php bin/composer update

使用 Docker 环境

如果你不愿意在系统安装 PHP 和 Composer 运行环境,可以使用内置的 Docker 环境构建脚本。

bash
# 直接使用,将所有使用的命令中 \`bin/spc\` 替换为 \`bin/spc-alpine-docker\` 即可
-bin/spc-alpine-docker

首次执行命令会使用 docker build 构建一个 Docker 镜像,默认构建的 Docker 镜像为 x86_64 架构,镜像名称为 cwcc-spc-x86_64

如果你想在 x86_64 环境下构建 aarch64 的 static-php-cli,可以使用 qemu 模拟 arm 镜像运行 Docker,但速度会非常慢。使用参数:SPC_USE_ARCH=aarch64 bin/spc-alpine-docker

如果运行后提示需要 sudo 才能运行,执行一次以下命令可授予 static-php-cli 执行 sudo 的权限:

bash
export SPC_USE_SUDO=yes

使用系统 PHP 环境

下面是系统安装 PHP、Composer 的一些示例命令。具体安装方式建议自行搜索或询问 AI 搜索引擎获取答案,这里不多赘述。

bash
# [macOS], 需要先安装 Homebrew. See https://brew.sh/
+bin/setup-runtime --mirror china

此脚本总共会下载两个文件:bin/phpbin/composer,下载完成后,有两种使用方式:

  1. bin/ 目录添加到 PATH 路径中:export PATH="/path/to/your/static-php-cli/bin:$PATH",添加路径后,相当于系统安装了 PHP,可直接使用 composerphp -v 等命令,也可以直接使用 bin/spc
  2. 直接调用,比如执行 static-php-cli 命令:bin/php bin/spc --help,执行 Composer:bin/php bin/composer update

使用 Docker 环境

如果你不愿意在系统安装 PHP 和 Composer 运行环境,可以使用内置的 Docker 环境构建脚本。

bash
# 直接使用,将所有使用的命令中 \`bin/spc\` 替换为 \`bin/spc-alpine-docker\` 即可
+bin/spc-alpine-docker

首次执行命令会使用 docker build 构建一个 Docker 镜像,默认构建的 Docker 镜像为 x86_64 架构,镜像名称为 cwcc-spc-x86_64

如果你想在 x86_64 环境下构建 aarch64 的 static-php-cli,可以使用 qemu 模拟 arm 镜像运行 Docker,但速度会非常慢。使用参数:SPC_USE_ARCH=aarch64 bin/spc-alpine-docker

如果运行后提示需要 sudo 才能运行,执行一次以下命令可授予 static-php-cli 执行 sudo 的权限:

bash
export SPC_USE_SUDO=yes

使用系统 PHP 环境

下面是系统安装 PHP、Composer 的一些示例命令。具体安装方式建议自行搜索或询问 AI 搜索引擎获取答案,这里不多赘述。

bash
# [macOS], 需要先安装 Homebrew. See https://brew.sh/
 # Remember change your composer executable path. For M1/M2 Chip mac, "/opt/homebrew/bin/", for Intel mac, "/usr/local/bin/". Or add it to your own path.
 brew install php wget
 wget https://getcomposer.org/download/latest-stable/composer.phar -O /path/to/your/bin/composer && chmod +x /path/to/your/bin/composer
 
 # [Debian], you need to make sure your php version >= 8.4 and composer >= 2.0
-sudo apt install php-cli composer php-tokenizer

TIP

目前 Ubuntu 部分版本的 apt 安装的 php 版本较旧,故不提供安装命令。如有需要,建议先添加 ppa 等软件源后,安装最新版的 PHP 以及 tokenizer、xml、phar 扩展。

较老版本的 Debian 默认安装的可能为旧版本(<= 8.3)版本的 PHP,建议先升级 Debian 或使用 Docker 或自带的静态二进制环境。

使用 craft 构建(推荐)

使用 bin/spc craft 可以使用一个配置文件,一个命令实现自动检查环境、下载源代码、构建依赖库、构建 PHP 及扩展等。

你需要编写一个 craft.yml 文件,存放在当前工作目录下。craft.yml 可以由 命令生成器 生成,或者手动编写。

手动编写可参考 craft.yml 配置 中的注释来编写。我们下面假设你编译一个扩展组合,并选用 PHP 8.4,输出 clifpm

yaml
# path/to/craft.yml
+sudo apt install php-cli composer php-tokenizer

TIP

目前 Ubuntu 部分版本的 apt 安装的 php 版本较旧,故不提供安装命令。如有需要,建议先添加 ppa 等软件源后,安装最新版的 PHP 以及 tokenizer、xml、phar 扩展。

较老版本的 Debian 默认安装的可能为旧版本(<= 8.3)版本的 PHP,建议先升级 Debian 或使用 Docker 或自带的静态二进制环境。

使用 craft 构建(推荐)

使用 bin/spc craft 可以使用一个配置文件,一个命令实现自动检查环境、下载源代码、构建依赖库、构建 PHP 及扩展等。

你需要编写一个 craft.yml 文件,存放在当前工作目录下。craft.yml 可以由 命令生成器 生成,或者手动编写。

手动编写可参考 craft.yml 配置 中的注释来编写。我们下面假设你编译一个扩展组合,并选用 PHP 8.4,输出 clifpm

yaml
# path/to/craft.yml
 php-version: 8.4
 extensions: bcmath,posix,phar,zlib,openssl,curl,fileinfo,tokenizer
 sapi:
   - cli
-  - fpm

然后使用 bin/spc craft 命令来编译:

bash
bin/spc craft --debug

如果构建成功,你会在当前目录下看到 buildroot/bin 目录,里面包含了编译好的 PHP 二进制文件,或相应的 SAPI。

  • cli: Windows 下构建结果为 buildroot/bin/php.exe,其他平台为 buildroot/bin/php
  • fpm: 构建结果为 buildroot/bin/php-fpm
  • micro: 构建结果为 buildroot/bin/micro.sfx,如需进一步与 PHP 代码打包,请查看 打包 micro 二进制
  • embed: 参见 embed 使用

如果中途构建出错,你可以使用 --debug 参数查看详细的错误信息,或者使用 --with-clean 参数清除旧的编译结果,重新编译。

如使用以上方式仍构建失败,请提交一个 issue,附上你的 craft.ymlcraft.log

分步构建命令

如果你有定制化需求,或分开下载、编译 PHP 和依赖库的需求,可以使用 bin/spc 命令分步执行。

命令 download - 下载依赖包

使用命令 bin/spc download 可以下载编译需要的源代码,包括 php-src 以及依赖的各种库的源码。

bash
# 仅下载要编译的扩展及依赖库(使用扩展名,包含可选库)
+  - fpm

然后使用 bin/spc craft 命令来编译:

bash
bin/spc craft --debug

如果构建成功,你会在当前目录下看到 buildroot/bin 目录,里面包含了编译好的 PHP 二进制文件,或相应的 SAPI。

  • cli: Windows 下构建结果为 buildroot/bin/php.exe,其他平台为 buildroot/bin/php
  • fpm: 构建结果为 buildroot/bin/php-fpm
  • micro: 构建结果为 buildroot/bin/micro.sfx,如需进一步与 PHP 代码打包,请查看 打包 micro 二进制
  • embed: 参见 embed 使用

如果中途构建出错,你可以使用 --debug 参数查看详细的错误信息,或者使用 --with-clean 参数清除旧的编译结果,重新编译。

如使用以上方式仍构建失败,请提交一个 issue,附上你的 craft.ymlcraft.log

分步构建命令

如果你有定制化需求,或分开下载、编译 PHP 和依赖库的需求,可以使用 bin/spc 命令分步执行。

命令 download - 下载依赖包

使用命令 bin/spc download 可以下载编译需要的源代码,包括 php-src 以及依赖的各种库的源码。

bash
# 仅下载要编译的扩展及依赖库(使用扩展名,包含可选库)
 bin/spc download --for-extensions=openssl,swoole,zip,pcntl,zstd
 
 # 仅下载要编译的扩展及依赖库(使用扩展名,不包含可选库)
@@ -69,51 +69,51 @@ import{_ as s,c as i,o as a,a1 as n}from"./chunks/framework.gjrnbxUT.js";const g
 bin/spc download php-src,micro,zstd,ext-zstd
 
 # 设置重试次数
-bin/spc download --all --retry=2

如果你所在地区的网络不好,或者下载依赖包速度过于缓慢,可以从 GitHub Action 下载每周定时打包的 download.zip,并使用命令直接使用 zip 压缩包作为依赖。 依赖包可以从 Action 下载到本地。 进入 Action 并选择一个最新成功运行的 Workflow,下载 download-files-x.y 即可。

bash
bin/spc download --from-zip=/path/to/your/download.zip

如果某个 source 始终无法下载,或者你需要下载一些特定版本的包,例如下载测试版 PHP、旧版本库等,可以使用参数 -U--custom-url 重写下载链接, 让下载器强制使用你指定的链接下载此 source 的包。使用方法为 {source-name}:{url} 即可,可同时重写多个库的下载地址。在使用 --for-extensions 选项下载时同样可用。

bash
# 例如:指定下载测试版的 PHP8.3
+bin/spc download --all --retry=2

如果你所在地区的网络不好,或者下载依赖包速度过于缓慢,可以从 GitHub Action 下载每周定时打包的 download.zip,并使用命令直接使用 zip 压缩包作为依赖。 依赖包可以从 Action 下载到本地。 进入 Action 并选择一个最新成功运行的 Workflow,下载 download-files-x.y 即可。

bash
bin/spc download --from-zip=/path/to/your/download.zip

如果某个 source 始终无法下载,或者你需要下载一些特定版本的包,例如下载测试版 PHP、旧版本库等,可以使用参数 -U--custom-url 重写下载链接, 让下载器强制使用你指定的链接下载此 source 的包。使用方法为 {source-name}:{url} 即可,可同时重写多个库的下载地址。在使用 --for-extensions 选项下载时同样可用。

bash
# 例如:指定下载测试版的 PHP8.3
 bin/spc download --all -U "php-src:https://downloads.php.net/~eric/php-8.3.0beta1.tar.gz"
 
 # 指定下载旧版本的 curl 库
-bin/spc download --all -U "curl:https://curl.se/download/curl-7.88.1.tar.gz"

如果你下载的资源不是链接,而是一个 Git 仓库,你可以使用 -G--custom-git 重写下载链接,让下载器强制使用你指定的 Git 仓库下载此 source 的包。 使用方法为 {source-name}:{branch}:{url} 即可,可同时重写多个库的下载地址。在使用 --for-extensions 选项下载时同样可用。

bash
# 例如:下载 master 分支的 php-src
+bin/spc download --all -U "curl:https://curl.se/download/curl-7.88.1.tar.gz"

如果你下载的资源不是链接,而是一个 Git 仓库,你可以使用 -G--custom-git 重写下载链接,让下载器强制使用你指定的 Git 仓库下载此 source 的包。 使用方法为 {source-name}:{branch}:{url} 即可,可同时重写多个库的下载地址。在使用 --for-extensions 选项下载时同样可用。

bash
# 例如:下载 master 分支的 php-src
 bin/spc download --for-extensions=redis,phar -G "php-src:master:https://github.com/php/php-src.git"
 
 # 从 swoole-src 仓库下载 master 分支的最新代码,而不是发行版
-bin/spc download --for-extensions=swoole -G "swoole:master:https://github.com/swoole/swoole-src.git"

命令 doctor - 环境检查

如果你可以正常运行 bin/spc 但无法正常编译静态的 PHP 或依赖库,可以先运行 bin/spc doctor 检查系统自身是否缺少依赖。

bash
# 快速检查
+bin/spc download --for-extensions=swoole -G "swoole:master:https://github.com/swoole/swoole-src.git"

命令 doctor - 环境检查

如果你可以正常运行 bin/spc 但无法正常编译静态的 PHP 或依赖库,可以先运行 bin/spc doctor 检查系统自身是否缺少依赖。

bash
# 快速检查
 bin/spc doctor
 
 # 快速检查,并在可以自动修复的时候修复(使用包管理安装依赖包,仅支持上述提到的操作系统及发行版)
-bin/spc doctor --auto-fix

命令 build - 编译 PHP

使用 build 命令可以开始构建静态 php 二进制,在执行 bin/spc build 命令前,务必先使用 download 命令下载资源,建议使用 doctor 检查环境。

基本用法

你需要先到 扩展列表命令生成器 选择你要加入的扩展,然后使用命令 bin/spc build 进行编译。你需要指定一个编译目标,从如下参数中选择:

  • --build-cli: 构建一个 cli sapi(命令行界面,可在命令行执行 PHP 代码)
  • --build-fpm: 构建一个 fpm sapi(php-fpm,用于和其他传统的 fpm 架构的软件如 nginx 配合使用)
  • --build-micro: 构建一个 micro sapi(用于构建一个包含 PHP 代码的独立可执行二进制)
  • --build-embed: 构建一个 embed sapi(用于嵌入到其他 C 语言程序中)
  • --build-all: 构建以上所有 sapi
bash
# 编译 PHP,附带 bcmath,curl,openssl,ftp,posix,pcntl 扩展,编译目标为 cli
+bin/spc doctor --auto-fix

命令 build - 编译 PHP

使用 build 命令可以开始构建静态 php 二进制,在执行 bin/spc build 命令前,务必先使用 download 命令下载资源,建议使用 doctor 检查环境。

基本用法

你需要先到 扩展列表命令生成器 选择你要加入的扩展,然后使用命令 bin/spc build 进行编译。你需要指定一个编译目标,从如下参数中选择:

  • --build-cli: 构建一个 cli sapi(命令行界面,可在命令行执行 PHP 代码)
  • --build-fpm: 构建一个 fpm sapi(php-fpm,用于和其他传统的 fpm 架构的软件如 nginx 配合使用)
  • --build-micro: 构建一个 micro sapi(用于构建一个包含 PHP 代码的独立可执行二进制)
  • --build-embed: 构建一个 embed sapi(用于嵌入到其他 C 语言程序中)
  • --build-all: 构建以上所有 sapi
bash
# 编译 PHP,附带 bcmath,curl,openssl,ftp,posix,pcntl 扩展,编译目标为 cli
 bin/spc build bcmath,curl,openssl,ftp,posix,pcntl --build-cli
 
 # 编译 PHP,附带 phar,curl,posix,pcntl,tokenizer 扩展,编译目标为 micro
-bin/spc build phar,curl,posix,pcntl,tokenizer --build-micro

TIP

如果你需要重复构建、调试,你可以删除 buildroot/source/ 两个目录,这样你可以从已下载的源码压缩包重新解压并构建:

shell
# remove
+bin/spc build phar,curl,posix,pcntl,tokenizer --build-micro

TIP

如果你需要重复构建、调试,你可以删除 buildroot/source/ 两个目录,这样你可以从已下载的源码压缩包重新解压并构建:

shell
# remove
 rm -rf buildroot source
 # build again
-bin/spc build bcmath,curl,openssl,ftp,posix,pcntl --build-cli

TIP

如果你想构建多个版本的 PHP,且不想每次都重复构建其他依赖库,可以使用 switch-php-version 在编译好一个版本后快速切换至另一个版本并编译:

shell
# switch to 8.4
+bin/spc build bcmath,curl,openssl,ftp,posix,pcntl --build-cli

TIP

如果你想构建多个版本的 PHP,且不想每次都重复构建其他依赖库,可以使用 switch-php-version 在编译好一个版本后快速切换至另一个版本并编译:

shell
# switch to 8.4
 bin/spc switch-php-version 8.4
 # build
 bin/spc build bcmath,curl,openssl,ftp,posix,pcntl --build-cli
 # switch to 8.1
 bin/spc switch-php-version 8.1
 # build
-bin/spc build bcmath,curl,openssl,ftp,posix,pcntl --build-cli

编译运行选项

在编译过程中,有些特殊情况需要对编译器、编译目录的内容进行干预,可以尝试使用以下命令:

  • --cc=XXX: 指定 C 语言编译器的执行命令(Linux 默认 musl-gccgcc,macOS 默认 clang
  • --cxx=XXX: 指定 C++ 语言编译器的执行命令(Linux 默认 g++,macOS 默认 clang++
  • --with-clean: 编译 PHP 前先清理旧的 make 产生的文件
  • --enable-zts: 让编译的 PHP 为线程安全版本(默认为 NTS 版本)
  • --no-strip: 编译 PHP 库后不运行 strip 裁剪二进制文件缩小体积(不裁剪的 macOS 二进制文件可使用动态链接的第三方扩展)
  • --with-libs=XXX,YYY: 编译 PHP 前先编译指定的依赖库,激活部分扩展的可选功能(例如 gd 库的 libavif 等)
  • --with-config-file-path=XXX: 查找 php.ini 的路径(在 这里 查看默认路径)
  • --with-config-file-scan-dir=XXX: 读取 php.ini 后扫描 .ini 文件的目录(在 这里 查看默认路径)
  • -I xxx=yyy: 编译前将 INI 选项硬编译到 PHP 内(支持多个选项,别名是 --with-hardcoded-ini
  • --with-micro-fake-cli: 在编译 micro 时,让 micro 的 SAPI 伪装为 cli(用于兼容一些检查 PHP_SAPI 的程序)
  • --disable-opcache-jit: 禁用 opcache jit(默认启用)
  • -P xxx.php: 在 static-php-cli 编译过程中注入外部脚本(详见下方 注入外部脚本
  • --without-micro-ext-test: 在构建 micro.sfx 后,禁用测试不同扩展在 micro.sfx 的运行结果
  • --with-suggested-exts: 编译时将 ext-suggests 也作为编译依赖加入
  • --with-suggested-libs: 编译时将 lib-suggests 也作为编译依赖加入
  • --with-upx-pack: 编译后使用 UPX 减小二进制文件体积(需先使用 bin/spc install-pkg upx 安装 upx)
  • --build-shared=XXX,YYY: 编译时将指定的扩展编译为共享库(默认编译为静态库)

硬编码 INI 选项适用于 cli、micro、embed。有关硬编码 INI 选项,下面是一个简单的例子,我们预设一个更大的 memory_limit,并且禁用 system 函数:

bash
bin/spc build bcmath,pcntl,posix --build-all -I "memory_limit=4G" -I "disable_functions=system"

命令 micro:combine - 打包 micro 二进制

使用 micro:combine 命令可以将上面编译好的 micro.sfx 和你的代码(.php.phar 文件)构建为一个可执行二进制。 你也可以使用该命令直接构建一个注入了 ini 配置的 micro 自执行二进制文件。

TIP

注入 ini 配置指的是,在将 micro.sfx 和 PHP 源码结合前,在 micro.sfx 后追加一段特殊的结构用于保存 ini 配置项。

micro.sfx 可通过特殊的字节来标识 INI 文件头,通过 INI 文件头可以实现 micro 带 INI 启动。

此特性的原说明地址在 phpmicro - Wiki,这个特性也有可能在未来发生变化。

下面是常规用法,直接打包 php 源码到一个文件中:

bash
# 在做打包流程前,你应该先使用 \`build --build-micro\` 编译好 micro.sfx
+bin/spc build bcmath,curl,openssl,ftp,posix,pcntl --build-cli

编译运行选项

在编译过程中,有些特殊情况需要对编译器、编译目录的内容进行干预,可以尝试使用以下命令:

  • --cc=XXX: 指定 C 语言编译器的执行命令(Linux 默认 musl-gccgcc,macOS 默认 clang
  • --cxx=XXX: 指定 C++ 语言编译器的执行命令(Linux 默认 g++,macOS 默认 clang++
  • --with-clean: 编译 PHP 前先清理旧的 make 产生的文件
  • --enable-zts: 让编译的 PHP 为线程安全版本(默认为 NTS 版本)
  • --no-strip: 编译 PHP 库后不运行 strip 裁剪二进制文件缩小体积(不裁剪的 macOS 二进制文件可使用动态链接的第三方扩展)
  • --with-libs=XXX,YYY: 编译 PHP 前先编译指定的依赖库,激活部分扩展的可选功能(例如 gd 库的 libavif 等)
  • --with-config-file-path=XXX: 查找 php.ini 的路径(在 这里 查看默认路径)
  • --with-config-file-scan-dir=XXX: 读取 php.ini 后扫描 .ini 文件的目录(在 这里 查看默认路径)
  • -I xxx=yyy: 编译前将 INI 选项硬编译到 PHP 内(支持多个选项,别名是 --with-hardcoded-ini
  • --with-micro-fake-cli: 在编译 micro 时,让 micro 的 SAPI 伪装为 cli(用于兼容一些检查 PHP_SAPI 的程序)
  • --disable-opcache-jit: 禁用 opcache jit(默认启用)
  • -P xxx.php: 在 static-php-cli 编译过程中注入外部脚本(详见下方 注入外部脚本
  • --without-micro-ext-test: 在构建 micro.sfx 后,禁用测试不同扩展在 micro.sfx 的运行结果
  • --with-suggested-exts: 编译时将 ext-suggests 也作为编译依赖加入
  • --with-suggested-libs: 编译时将 lib-suggests 也作为编译依赖加入
  • --with-upx-pack: 编译后使用 UPX 减小二进制文件体积(需先使用 bin/spc install-pkg upx 安装 upx)
  • --build-shared=XXX,YYY: 编译时将指定的扩展编译为共享库(默认编译为静态库)

硬编码 INI 选项适用于 cli、micro、embed。有关硬编码 INI 选项,下面是一个简单的例子,我们预设一个更大的 memory_limit,并且禁用 system 函数:

bash
bin/spc build bcmath,pcntl,posix --build-all -I "memory_limit=4G" -I "disable_functions=system"

命令 micro:combine - 打包 micro 二进制

使用 micro:combine 命令可以将上面编译好的 micro.sfx 和你的代码(.php.phar 文件)构建为一个可执行二进制。 你也可以使用该命令直接构建一个注入了 ini 配置的 micro 自执行二进制文件。

TIP

注入 ini 配置指的是,在将 micro.sfx 和 PHP 源码结合前,在 micro.sfx 后追加一段特殊的结构用于保存 ini 配置项。

micro.sfx 可通过特殊的字节来标识 INI 文件头,通过 INI 文件头可以实现 micro 带 INI 启动。

此特性的原说明地址在 phpmicro - Wiki,这个特性也有可能在未来发生变化。

下面是常规用法,直接打包 php 源码到一个文件中:

bash
# 在做打包流程前,你应该先使用 \`build --build-micro\` 编译好 micro.sfx
 echo "<?php echo 'hello';" > a.php
 bin/spc micro:combine a.php
 
 # 使用
-./my-app

你可以使用以下参数指定要输出的文件名,你也可以指定其他路径的 micro.sfx 进行打包。

bash
# 指定输出文件名
+./my-app

你可以使用以下参数指定要输出的文件名,你也可以指定其他路径的 micro.sfx 进行打包。

bash
# 指定输出文件名
 bin/spc micro:combine a.php --output=custom-bin
 # 使用绝对路径,也可以使用简化参数名
 bin/spc micro:combine a.php -O /tmp/my-custom-app
 
 # 指定其他位置的 micro.sfx 进行打包
-bin/spc micro:combine a.app --with-micro=/path/to/your/micro.sfx

如果想注入 ini 配置项,可以使用下面的参数,从文件或命令行选项添加 ini 到可执行文件中。

bash
# 使用命令行选项指定(-I 是 --with-ini-set 的简写)
+bin/spc micro:combine a.app --with-micro=/path/to/your/micro.sfx

如果想注入 ini 配置项,可以使用下面的参数,从文件或命令行选项添加 ini 到可执行文件中。

bash
# 使用命令行选项指定(-I 是 --with-ini-set 的简写)
 bin/spc micro:combine a.php -I "a=b" -I "foo=bar"
 
 # 使用 ini 文件指定(-N 是 --with-ini-file 的简写)
-bin/spc micro:combine a.php -N /path/to/your/custom.ini

WARNING

注意,请不要直接使用 PHP 源码或系统安装的 PHP 中的 php.ini 文件,最好手动编写一个自己需要的参数配置文件,例如:

ini
; custom.ini
+bin/spc micro:combine a.php -N /path/to/your/custom.ini

WARNING

注意,请不要直接使用 PHP 源码或系统安装的 PHP 中的 php.ini 文件,最好手动编写一个自己需要的参数配置文件,例如:

ini
; custom.ini
 curl.cainfo=/path/to/your/cafile.pem
-memory_limit=1G

该命令的注入 ini 是通过在 micro.sfx 后追加一段特殊的结构来实现的,和编译时插入硬编码 INI 的功能不同。

如果要打包 phar,只需要将 a.php 替换为打包好的 phar 文件即可。但要注意,phar 下的 micro.sfx 需要额外注意路径问题,见 Developing - Phar 路径问题

调试

如果你在编译过程中遇到了问题,或者想查看每个执行的 shell 命令,可以使用 --debug 开启 debug 模式,查看所有终端日志:

bash
bin/spc build mysqlnd,pdo_mysql --build-all --debug

命令 extract - 手动解压某个库

使用命令 bin/spc extract 可以解包和拷贝编译需要的源代码,包括 php-src 以及依赖的各种库的源码(需要自己指定要解包的库名)。

例如,我们在下载好资源后,想分布执行构建流程,手动解包和拷贝包到指定位置,可以使用命令。

bash
# 解压 php-src 和 libxml2 的下载压缩包,解压的源码存放在 source 目录
-bin/spc extract php-src,libxml2

命令 dump-extensions - 导出项目扩展依赖

使用命令 bin/spc dump-extensions 可以导出当前项目的扩展依赖。

bash
# 打印项目的扩展列表,传入项目包含composer.json的根目录
+memory_limit=1G

该命令的注入 ini 是通过在 micro.sfx 后追加一段特殊的结构来实现的,和编译时插入硬编码 INI 的功能不同。

如果要打包 phar,只需要将 a.php 替换为打包好的 phar 文件即可。但要注意,phar 下的 micro.sfx 需要额外注意路径问题,见 Developing - Phar 路径问题

调试

如果你在编译过程中遇到了问题,或者想查看每个执行的 shell 命令,可以使用 --debug 开启 debug 模式,查看所有终端日志:

bash
bin/spc build mysqlnd,pdo_mysql --build-all --debug

命令 extract - 手动解压某个库

使用命令 bin/spc extract 可以解包和拷贝编译需要的源代码,包括 php-src 以及依赖的各种库的源码(需要自己指定要解包的库名)。

例如,我们在下载好资源后,想分布执行构建流程,手动解包和拷贝包到指定位置,可以使用命令。

bash
# 解压 php-src 和 libxml2 的下载压缩包,解压的源码存放在 source 目录
+bin/spc extract php-src,libxml2

命令 dump-extensions - 导出项目扩展依赖

使用命令 bin/spc dump-extensions 可以导出当前项目的扩展依赖。

bash
# 打印项目的扩展列表,传入项目包含composer.json的根目录
 bin/spc dump-extensions /path/to/your/project/
 
 # 打印项目的扩展列表,不包含开发依赖
@@ -129,7 +129,7 @@ import{_ as s,c as i,o as a,a1 as n}from"./chunks/framework.gjrnbxUT.js";const g
 bin/spc dump-extensions /path-to/your/project/ --no-ext-output=mbstring,posix,pcntl,phar
 
 # 输出时不排除 spc 不支持的扩展
-bin/spc dump-extensions /path/to/your/project/ --no-spc-filter

需要注意的是,项目的目录下必须包含 vendor/installed.jsoncomposer.lock 文件,否则无法正常获取。

调试命令 dev - 调试命令集合

调试命令指的是你在使用 static-php-cli 构建 PHP 或改造、增强 static-php-cli 项目本身的时候,可以辅助输出一些信息的命令集合。

  • dev:extensions: 输出目前所有支持的扩展信息,或者输出指定的扩展信息
  • dev:php-version: 输出当前编译的 PHP 版本(通过读取 php_version.h 实现)
  • dev:sort-config: 对 config/ 目录下的配置文件的列表按照字母表排序
  • dev:lib-ver <lib-name>: 从依赖库的源码中读取版本(仅特定依赖库可用)
  • dev:ext-ver <ext-name>: 从扩展的源码中读取对应版本(仅特定扩展可用)
  • dev:pack-lib <lib-name>: 打包指定的依赖库(仅发布者可用)
  • dev:gen-ext-docs: 生成扩展文档(仅发布者可用)
bash
# 输出所有扩展
+bin/spc dump-extensions /path/to/your/project/ --no-spc-filter

需要注意的是,项目的目录下必须包含 vendor/installed.jsoncomposer.lock 文件,否则无法正常获取。

调试命令 dev - 调试命令集合

调试命令指的是你在使用 static-php-cli 构建 PHP 或改造、增强 static-php-cli 项目本身的时候,可以辅助输出一些信息的命令集合。

  • dev:extensions: 输出目前所有支持的扩展信息,或者输出指定的扩展信息
  • dev:php-version: 输出当前编译的 PHP 版本(通过读取 php_version.h 实现)
  • dev:sort-config: 对 config/ 目录下的配置文件的列表按照字母表排序
  • dev:lib-ver <lib-name>: 从依赖库的源码中读取版本(仅特定依赖库可用)
  • dev:ext-ver <ext-name>: 从扩展的源码中读取对应版本(仅特定扩展可用)
  • dev:pack-lib <lib-name>: 打包指定的依赖库(仅发布者可用)
  • dev:gen-ext-docs: 生成扩展文档(仅发布者可用)
bash
# 输出所有扩展
 bin/spc dev:extensions
 
 # 输出指定扩展的信息
@@ -142,7 +142,7 @@ import{_ as s,c as i,o as a,a1 as n}from"./chunks/framework.gjrnbxUT.js";const g
 bin/spc dev:php-version
 
 # 排序配置文件 ext.json(也可以排序 lib、source)
-bin/spc dev:sort-config ext

命令 install-pkg - 下载二进制包

使用命令 bin/spc install-pkg 可以下载一些预编译或闭源的工具,并将其安装到 pkgroot 目录中。

bin/spc doctor 自动修复 Windows 环境时会下载 nasm、perl 等工具,使用的也是 install-pkg 的安装过程。

下面是安装工具的示例:

  • 下载安装 UPX(仅限 Linux 和 Windows): bin/spc install-pkg upx

命令 del-download - 删除已下载的资源

一些情况下,你需要删除单个或多个指定的下载源文件,并重新下载他们,例如切换 PHP 版本,2.1.0-beta.4 版本后提供了 bin/spc del-download 命令,可以删除指定源文件。

删除已下载的源文件包含预编译的包以及源代码,名称是 source.jsonpkg.json 中的键名。下面是一些例子:

  • 删除 PHP 8.2 源码并切换下载为 8.3 版本: bin/spc del-download php-src && bin/spc download php-src --with-php=8.3
  • 删除 redis 扩展的下载文件: bin/spc del-download redis
  • 删除下载好的 musl-toolchain x86_64: bin/spc del-download musl-toolchain-x86_64-linux

注入外部脚本

注入外部脚本指的是在 static-php-cli 编译过程中插入一个或多个脚本,用于更灵活地支持不同环境下的参数修改、源代码补丁。

一般情况下,该功能主要解决使用 spc 二进制进行编译时无法通过修改 static-php-cli 代码来实现修改补丁的功能。 还有一种情况:你的项目直接依赖了 crazywhalecc/static-php-cli 仓库并同步,但因为项目特性需要做出一些专有的修改,而这些特性并不适合合并到主分支。

鉴于以上情况,在 2.0.1 正式版本中,static-php-cli 加入了多个事件的触发点,你可以通过编写外部的 xx.php 脚本,并通过命令行参数 -P 传入并执行。

在编写注入外部脚本时,你一定会用到的方法是 builder()patch_point()。其中,patch_point() 获取的是当前正在执行的事件名称,builder() 获取的是 BuilderBase 对象。

因为传入的注入点不区分事件,所以你必须将你要执行的代码写在 if(patch_point() === 'your_event_name') 中,否则会重复在其他事件中执行。

下面是支持的 patch_point 事件名称及对应位置:

事件名称事件描述
before-libs-extract在编译的依赖库解压前触发
after-libs-extract在编译的依赖库解压后触发
before-php-extract在 PHP 源码解压前触发
after-php-extract在 PHP 源码解压后触发
before-micro-extract在 phpmicro 解压前触发
after-micro-extract在 phpmicro 解压后触发
before-exts-extract在要编译的扩展解压到 PHP 源码目录前触发
after-exts-extract在要编译的扩展解压到 PHP 源码目录后触发
before-library[name]-build在名称为 name 的库编译前触发(如 before-library[postgresql]-build
after-library[name]-build在名称为 name 的库编译后触发
before-php-buildconf在编译 PHP 命令 ./buildconf 前触发
before-php-configure在编译 PHP 命令 ./configure 前触发
before-php-make在编译 PHP 命令 make 前触发
before-sanity-check在编译 PHP 后,运行扩展检查前触发

下面是一个简单的临时修改 PHP 源码的例子,开启 CLI 下在当前工作目录查找 php.ini 配置的功能:

php
// a.php
+bin/spc dev:sort-config ext

命令 install-pkg - 下载二进制包

使用命令 bin/spc install-pkg 可以下载一些预编译或闭源的工具,并将其安装到 pkgroot 目录中。

bin/spc doctor 自动修复 Windows 环境时会下载 nasm、perl 等工具,使用的也是 install-pkg 的安装过程。

下面是安装工具的示例:

  • 下载安装 UPX(仅限 Linux 和 Windows): bin/spc install-pkg upx

命令 del-download - 删除已下载的资源

一些情况下,你需要删除单个或多个指定的下载源文件,并重新下载他们,例如切换 PHP 版本,2.1.0-beta.4 版本后提供了 bin/spc del-download 命令,可以删除指定源文件。

删除已下载的源文件包含预编译的包以及源代码,名称是 source.jsonpkg.json 中的键名。下面是一些例子:

  • 删除 PHP 8.2 源码并切换下载为 8.3 版本: bin/spc del-download php-src && bin/spc download php-src --with-php=8.3
  • 删除 redis 扩展的下载文件: bin/spc del-download redis
  • 删除下载好的 musl-toolchain x86_64: bin/spc del-download musl-toolchain-x86_64-linux

注入外部脚本

注入外部脚本指的是在 static-php-cli 编译过程中插入一个或多个脚本,用于更灵活地支持不同环境下的参数修改、源代码补丁。

一般情况下,该功能主要解决使用 spc 二进制进行编译时无法通过修改 static-php-cli 代码来实现修改补丁的功能。 还有一种情况:你的项目直接依赖了 crazywhalecc/static-php-cli 仓库并同步,但因为项目特性需要做出一些专有的修改,而这些特性并不适合合并到主分支。

鉴于以上情况,在 2.0.1 正式版本中,static-php-cli 加入了多个事件的触发点,你可以通过编写外部的 xx.php 脚本,并通过命令行参数 -P 传入并执行。

在编写注入外部脚本时,你一定会用到的方法是 builder()patch_point()。其中,patch_point() 获取的是当前正在执行的事件名称,builder() 获取的是 BuilderBase 对象。

因为传入的注入点不区分事件,所以你必须将你要执行的代码写在 if(patch_point() === 'your_event_name') 中,否则会重复在其他事件中执行。

下面是支持的 patch_point 事件名称及对应位置:

事件名称事件描述
before-libs-extract在编译的依赖库解压前触发
after-libs-extract在编译的依赖库解压后触发
before-php-extract在 PHP 源码解压前触发
after-php-extract在 PHP 源码解压后触发
before-micro-extract在 phpmicro 解压前触发
after-micro-extract在 phpmicro 解压后触发
before-exts-extract在要编译的扩展解压到 PHP 源码目录前触发
after-exts-extract在要编译的扩展解压到 PHP 源码目录后触发
before-library[name]-build在名称为 name 的库编译前触发(如 before-library[postgresql]-build
after-library[name]-build在名称为 name 的库编译后触发
before-php-buildconf在编译 PHP 命令 ./buildconf 前触发
before-php-configure在编译 PHP 命令 ./configure 前触发
before-php-make在编译 PHP 命令 make 前触发
before-sanity-check在编译 PHP 后,运行扩展检查前触发

下面是一个简单的临时修改 PHP 源码的例子,开启 CLI 下在当前工作目录查找 php.ini 配置的功能:

php
// a.php
 <?php
 if (patch_point() === 'before-php-buildconf') {
     // replace php source code
@@ -151,19 +151,19 @@ import{_ as s,c as i,o as a,a1 as n}from"./chunks/framework.gjrnbxUT.js";const g
         'sapi_module->php_ini_ignore_cwd = 1;',
         'sapi_module->php_ini_ignore_cwd = 0;'
     );
-}
bash
bin/spc build mbstring --build-cli -P a.php
-echo 'memory_limit=8G' > ./php.ini
$ buildroot/bin/php -i | grep Loaded
+}
bash
bin/spc build mbstring --build-cli -P a.php
+echo 'memory_limit=8G' > ./php.ini
$ buildroot/bin/php -i | grep Loaded
 Loaded Configuration File => /Users/jerry/project/git-project/static-php-cli/php.ini
 
 $ buildroot/bin/php -i | grep memory
-memory_limit => 8G => 8G

对于 static-php-cli 支持的对象、方法及接口,可以阅读源码,大部分的方法和对象都有相应的注释。

一般使用 -P 功能常用的对象及函数有:

  • SPC\\store\\FileSystem: 文件管理类
    • ::replaceFileStr(string $filename, string $search, $replace): 替换文件字符串内容
    • ::replaceFileStr(string $filename, string $pattern, $replace): 正则替换文件内容
    • ::replaceFileUser(string $filename, $callback): 用户自定义函数替换文件内容
    • ::copyDir(string $from, string $to): 递归拷贝某个目录到另一个位置
    • ::convertPath(string $path): 转换路径的分隔符为当前系统分隔符
    • ::scanDirFiles(string $dir, bool $recursive = true, bool|string $relative = false, bool $include_dir = false): 遍历目录文件
  • SPC\\builder\\BuilderBase: 构建对象
    • ->getPatchPoint(): 获取当前的注入点名称
    • ->getOption(string $key, $default = null): 获取命令行和编译时的选项
    • ->getPHPVersionID(): 获取当前编译的 PHP 版本 ID
    • ->getPHPVersion(): 获取当前编译的 PHP 版本号
    • ->setOption(string $key, $value): 设定选项
    • ->setOptionIfNotExists(string $key, $value): 如果选项不存在则设定选项

TIP

static-php-cli 开放的方法非常多,文档中无法一一列举,但只要是 public function 并且不被标注为 @internal,均可调用。

多次构建

如果你在本地要多次构建,以下方法可以为你节省下载资源、编译的时间。

  • 仅切换 PHP 版本,不更换依赖库版本时,可以使用 bin/spc switch-php-version 快速切换 PHP 版本,然后重新运行同样的 build 命令。
  • 如果你想重新构建一次,但不重新下载源码,可以先 rm -rf buildroot source 删除编译目录和源码目录,然后重新构建。
  • 如果你想更新某个依赖的版本,可以使用 bin/spc del-download <source-name> 删除指定的源码,然后使用 download <source-name> 重新下载。
  • 如果你想更新所有依赖的版本,可以使用 bin/spc download --clean 删除所有下载的源码,然后重新下载。

embed 使用

如果你想将 static-php 嵌入到其他 C 语言程序中,可以使用 --build-embed 构建一个 embed 版本的 PHP。

bash
bin/spc build {your extensions} --build-embed --debug

在通常的情况下,PHP embed 编译后会生成 php-config。对于 static-php,我们提供了 spc-config,用于获取编译时的参数。 另外,在使用 embed SAPI(libphp.a)时,你需要使用和编译 libphp 相同的编译器,否则会出现链接错误。

下面是 spc-config 的基本用法:

bash
# output all flags and options
+memory_limit => 8G => 8G

对于 static-php-cli 支持的对象、方法及接口,可以阅读源码,大部分的方法和对象都有相应的注释。

一般使用 -P 功能常用的对象及函数有:

  • SPC\\store\\FileSystem: 文件管理类
    • ::replaceFileStr(string $filename, string $search, $replace): 替换文件字符串内容
    • ::replaceFileStr(string $filename, string $pattern, $replace): 正则替换文件内容
    • ::replaceFileUser(string $filename, $callback): 用户自定义函数替换文件内容
    • ::copyDir(string $from, string $to): 递归拷贝某个目录到另一个位置
    • ::convertPath(string $path): 转换路径的分隔符为当前系统分隔符
    • ::scanDirFiles(string $dir, bool $recursive = true, bool|string $relative = false, bool $include_dir = false): 遍历目录文件
  • SPC\\builder\\BuilderBase: 构建对象
    • ->getPatchPoint(): 获取当前的注入点名称
    • ->getOption(string $key, $default = null): 获取命令行和编译时的选项
    • ->getPHPVersionID(): 获取当前编译的 PHP 版本 ID
    • ->getPHPVersion(): 获取当前编译的 PHP 版本号
    • ->setOption(string $key, $value): 设定选项
    • ->setOptionIfNotExists(string $key, $value): 如果选项不存在则设定选项

TIP

static-php-cli 开放的方法非常多,文档中无法一一列举,但只要是 public function 并且不被标注为 @internal,均可调用。

多次构建

如果你在本地要多次构建,以下方法可以为你节省下载资源、编译的时间。

  • 仅切换 PHP 版本,不更换依赖库版本时,可以使用 bin/spc switch-php-version 快速切换 PHP 版本,然后重新运行同样的 build 命令。
  • 如果你想重新构建一次,但不重新下载源码,可以先 rm -rf buildroot source 删除编译目录和源码目录,然后重新构建。
  • 如果你想更新某个依赖的版本,可以使用 bin/spc del-download <source-name> 删除指定的源码,然后使用 download <source-name> 重新下载。
  • 如果你想更新所有依赖的版本,可以使用 bin/spc download --clean 删除所有下载的源码,然后重新下载。

embed 使用

如果你想将 static-php 嵌入到其他 C 语言程序中,可以使用 --build-embed 构建一个 embed 版本的 PHP。

bash
bin/spc build {your extensions} --build-embed --debug

在通常的情况下,PHP embed 编译后会生成 php-config。对于 static-php,我们提供了 spc-config,用于获取编译时的参数。 另外,在使用 embed SAPI(libphp.a)时,你需要使用和编译 libphp 相同的编译器,否则会出现链接错误。

下面是 spc-config 的基本用法:

bash
# output all flags and options
 bin/spc spc-config curl,zlib,phar,openssl
 
 # output libs
 bin/spc spc-config curl,zlib,phar,openssl --libs
 
 # output includes
-bin/spc spc-config curl,zlib,phar,openssl --includes

默认情况下,static-php 在不同系统使用的编译器分别是:

  • macOS: clang
  • Linux (Alpine Linux): gcc
  • Linux (glibc based distros, x86_64): /usr/local/musl/bin/x86_64-linux-musl-gcc
  • Linux (glibc based distros, aarch64): /usr/local/musl/bin/aarch64-linux-musl-gcc
  • FreeBSD: clang

下面是一个使用 embed SAPI 的例子:

c
// embed.c
+bin/spc spc-config curl,zlib,phar,openssl --includes

默认情况下,static-php 在不同系统使用的编译器分别是:

  • macOS: clang
  • Linux (Alpine Linux): gcc
  • Linux (glibc based distros, x86_64): /usr/local/musl/bin/x86_64-linux-musl-gcc
  • Linux (glibc based distros, aarch64): /usr/local/musl/bin/aarch64-linux-musl-gcc
  • FreeBSD: clang

下面是一个使用 embed SAPI 的例子:

c
// embed.c
 #include <sapi/embed/php_embed.h>
 
 int main(int argc,char **argv){
@@ -180,12 +180,12 @@ import{_ as s,c as i,o as a,a1 as n}from"./chunks/framework.gjrnbxUT.js";const g
 
     PHP_EMBED_END_BLOCK()
     return 0;
-}
php
<?php 
+}
php
<?php 
 // embed.php
-echo "Hello world!\\n";
bash
# compile in debian/ubuntu x86_64
+echo "Hello world!\\n";
bash
# compile in debian/ubuntu x86_64
 /usr/local/musl/bin/x86_64-linux-musl-gcc embed.c $(bin/spc spc-config bcmath,zlib) -static -o embed
 # compile in macOS/FreeBSD
 clang embed.c $(bin/spc spc-config bcmath,zlib) -o embed
 
 ./embed
-# out: Hello world!
`,135),e=[l];function t(h,d,k,c,o,r){return a(),i("div",null,e)}const b=s(p,[["render",t]]);export{g as __pageData,b as default}; +# out: Hello world!
`,135)]))}const g=i(e,[["render",p]]);export{o as __pageData,g as default}; diff --git a/assets/zh_guide_manual-build.md.BjPCGg5B.lean.js b/assets/zh_guide_manual-build.md.BjPCGg5B.lean.js new file mode 100644 index 00000000..1ddcb1b0 --- /dev/null +++ b/assets/zh_guide_manual-build.md.BjPCGg5B.lean.js @@ -0,0 +1 @@ +import{_ as i,c as a,o as n,af as l}from"./chunks/framework.PeLcR_tw.js";const o=JSON.parse('{"title":"本地构建(Linux、macOS、FreeBSD)","description":"","frontmatter":{"outline":"deep"},"headers":[],"relativePath":"zh/guide/manual-build.md","filePath":"zh/guide/manual-build.md"}'),e={name:"zh/guide/manual-build.md"};function p(t,s,h,k,d,c){return n(),a("div",null,s[0]||(s[0]=[l("",135)]))}const g=i(e,[["render",p]]);export{o as __pageData,g as default}; diff --git a/assets/zh_guide_manual-build.md.Rx1xsyX8.lean.js b/assets/zh_guide_manual-build.md.Rx1xsyX8.lean.js deleted file mode 100644 index a8427726..00000000 --- a/assets/zh_guide_manual-build.md.Rx1xsyX8.lean.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as s,c as i,o as a,a1 as n}from"./chunks/framework.gjrnbxUT.js";const g=JSON.parse('{"title":"本地构建(Linux、macOS、FreeBSD)","description":"","frontmatter":{"outline":"deep"},"headers":[],"relativePath":"zh/guide/manual-build.md","filePath":"zh/guide/manual-build.md"}'),p={name:"zh/guide/manual-build.md"},l=n("",135),e=[l];function t(h,d,k,c,o,r){return a(),i("div",null,e)}const b=s(p,[["render",t]]);export{g as __pageData,b as default}; diff --git a/assets/zh_guide_troubleshooting.md.B9WGHMIU.js b/assets/zh_guide_troubleshooting.md.B9WGHMIU.js new file mode 100644 index 00000000..6f6cac61 --- /dev/null +++ b/assets/zh_guide_troubleshooting.md.B9WGHMIU.js @@ -0,0 +1 @@ +import{_ as o,c as t,o as a,af as r}from"./chunks/framework.PeLcR_tw.js";const u=JSON.parse('{"title":"故障排除","description":"","frontmatter":{},"headers":[],"relativePath":"zh/guide/troubleshooting.md","filePath":"zh/guide/troubleshooting.md"}'),s={name:"zh/guide/troubleshooting.md"};function d(c,e,i,n,l,p){return a(),t("div",null,e[0]||(e[0]=[r('

故障排除

使用 static-php-cli 过程中可能会碰到各种各样的故障,这里将讲述如何自行查看错误并反馈 Issue。

下载失败问题

下载资源问题是 spc 最常见的问题之一。主要是由于 spc 下载资源使用的地址一般均为对应项目的官方网站或 GitHub 等,而这些网站可能偶尔会宕机、屏蔽 IP 地址。 在遇到下载失败后,可以多次尝试调用下载命令。

当下载资源时,你可能最终会看到类似 curl: (56) The requested URL returned error: 403 的错误,这通常是由于 GitHub 限制导致的。 你可以通过在命令中添加 --debug 来验证,会看到类似 [DEBU] Running command (no output) : curl -sfSL "https://api.github.com/repos/openssl/openssl/releases" 的输出。

要解决这个问题,可以在 GitHub 上 创建 一个个人访问令牌,并将其设置为环境变量 GITHUB_TOKEN=<XXX>

如果确认地址确实无法正常访问,可以提交 Issue 或 PR 更新地址。

doctor 无法修复

在绝大部分情况下,doctor 模块都可以对缺失的系统环境进行自动修复和安装,但也存在特殊的环境无法正常使用自动修复功能。

部分项目由于系统局限(如 Windows 下无法自动安装 Visual Studio 等软件),无法使用自动修复功能。 在遇到无法自动修复功能时,如果遇到 Some check items can not be fixed 字样,则表明无法自动修复,请根据终端显示的方法提交 Issue 或自行修复环境。

编译错误

遇到编译错误时,如果没有开启 --debug 日志,请先开启调试日志,然后确定报错的命令。 报错的终端输出对于修复编译错误非常重要,请在提交 Issue 时一并将终端日志的最后报错片段(或整个终端日志输出)上传,并且包含使用的 spc 命令和参数。

如果你是重复构建,请参考 本地构建 - 多次构建 章节,清理构建缓存后再次构建。

',13)]))}const _=o(s,[["render",d]]);export{u as __pageData,_ as default}; diff --git a/assets/zh_guide_troubleshooting.md.B9WGHMIU.lean.js b/assets/zh_guide_troubleshooting.md.B9WGHMIU.lean.js new file mode 100644 index 00000000..c0badd64 --- /dev/null +++ b/assets/zh_guide_troubleshooting.md.B9WGHMIU.lean.js @@ -0,0 +1 @@ +import{_ as o,c as t,o as a,af as r}from"./chunks/framework.PeLcR_tw.js";const u=JSON.parse('{"title":"故障排除","description":"","frontmatter":{},"headers":[],"relativePath":"zh/guide/troubleshooting.md","filePath":"zh/guide/troubleshooting.md"}'),s={name:"zh/guide/troubleshooting.md"};function d(c,e,i,n,l,p){return a(),t("div",null,e[0]||(e[0]=[r("",13)]))}const _=o(s,[["render",d]]);export{u as __pageData,_ as default}; diff --git a/assets/zh_guide_troubleshooting.md.DAr4n5J3.js b/assets/zh_guide_troubleshooting.md.DAr4n5J3.js deleted file mode 100644 index 23856741..00000000 --- a/assets/zh_guide_troubleshooting.md.DAr4n5J3.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as e,c as o,o as t,a1 as a}from"./chunks/framework.gjrnbxUT.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=a('

故障排除

使用 static-php-cli 过程中可能会碰到各种各样的故障,这里将讲述如何自行查看错误并反馈 Issue。

下载失败问题

下载资源问题是 spc 最常见的问题之一。主要是由于 spc 下载资源使用的地址一般均为对应项目的官方网站或 GitHub 等,而这些网站可能偶尔会宕机、屏蔽 IP 地址。 在遇到下载失败后,可以多次尝试调用下载命令。

当下载资源时,你可能最终会看到类似 curl: (56) The requested URL returned error: 403 的错误,这通常是由于 GitHub 限制导致的。 你可以通过在命令中添加 --debug 来验证,会看到类似 [DEBU] Running command (no output) : curl -sfSL "https://api.github.com/repos/openssl/openssl/releases" 的输出。

要解决这个问题,可以在 GitHub 上 创建 一个个人访问令牌,并将其设置为环境变量 GITHUB_TOKEN=<XXX>

如果确认地址确实无法正常访问,可以提交 Issue 或 PR 更新地址。

doctor 无法修复

在绝大部分情况下,doctor 模块都可以对缺失的系统环境进行自动修复和安装,但也存在特殊的环境无法正常使用自动修复功能。

部分项目由于系统局限(如 Windows 下无法自动安装 Visual Studio 等软件),无法使用自动修复功能。 在遇到无法自动修复功能时,如果遇到 Some check items can not be fixed 字样,则表明无法自动修复,请根据终端显示的方法提交 Issue 或自行修复环境。

编译错误

遇到编译错误时,如果没有开启 --debug 日志,请先开启调试日志,然后确定报错的命令。 报错的终端输出对于修复编译错误非常重要,请在提交 Issue 时一并将终端日志的最后报错片段(或整个终端日志输出)上传,并且包含使用的 spc 命令和参数。

如果你是重复构建,请参考 本地构建 - 多次构建 章节,清理构建缓存后再次构建。

',13),c=[s];function d(i,n,u,h,l,p){return t(),o("div",null,c)}const m=e(r,[["render",d]]);export{b as __pageData,m as default}; diff --git a/assets/zh_guide_troubleshooting.md.DAr4n5J3.lean.js b/assets/zh_guide_troubleshooting.md.DAr4n5J3.lean.js deleted file mode 100644 index 34a9b673..00000000 --- a/assets/zh_guide_troubleshooting.md.DAr4n5J3.lean.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as e,c as o,o as t,a1 as a}from"./chunks/framework.gjrnbxUT.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=a("",13),c=[s];function d(i,n,u,h,l,p){return t(),o("div",null,c)}const m=e(r,[["render",d]]);export{b as __pageData,m as default}; diff --git a/assets/zh_index.md.LslJ1UMp.js b/assets/zh_index.md.DcikGFee.js similarity index 94% rename from assets/zh_index.md.LslJ1UMp.js rename to assets/zh_index.md.DcikGFee.js index ec67ebd5..0fb884f8 100644 --- a/assets/zh_index.md.LslJ1UMp.js +++ b/assets/zh_index.md.DcikGFee.js @@ -1 +1 @@ -import{_ as e,c as t,o as i}from"./chunks/framework.gjrnbxUT.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}; +import{_ as e,c as t,o as i}from"./chunks/framework.PeLcR_tw.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}; diff --git a/assets/zh_index.md.LslJ1UMp.lean.js b/assets/zh_index.md.DcikGFee.lean.js similarity index 94% rename from assets/zh_index.md.LslJ1UMp.lean.js rename to assets/zh_index.md.DcikGFee.lean.js index ec67ebd5..0fb884f8 100644 --- a/assets/zh_index.md.LslJ1UMp.lean.js +++ b/assets/zh_index.md.DcikGFee.lean.js @@ -1 +1 @@ -import{_ as e,c as t,o as i}from"./chunks/framework.gjrnbxUT.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}; +import{_ as e,c as t,o as i}from"./chunks/framework.PeLcR_tw.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}; diff --git a/deps-craft-yml.html b/deps-craft-yml.html index a0097b98..28ba972f 100644 --- a/deps-craft-yml.html +++ b/deps-craft-yml.html @@ -5,19 +5,20 @@ static-php-cli - - + + + - + - - - + + + -
Skip to content
yaml
# PHP version to build (default: 8.4)
+    
Skip to content
yaml
# PHP version to build (default: 8.4)
 php-version: 8.4
 # [REQUIRED] Static PHP extensions to build (list or comma-separated are both accepted)
 extensions: bcmath,fileinfo,phar,zlib,sodium,posix,pcntl
@@ -81,8 +82,8 @@
 # Extra environment variables
 extra-env:
   # e.g. Use github token to avoid rate limit
-  GITHUB_TOKEN: your-github-token
- + GITHUB_TOKEN: your-github-token
+ \ No newline at end of file diff --git a/deps-map-ext.html b/deps-map-ext.html index c7ae1465..4008db95 100644 --- a/deps-map-ext.html +++ b/deps-map-ext.html @@ -5,20 +5,21 @@ static-php-cli - - + + + - + - - - + + + -
Skip to content

Linux

Extension NameRequired ExtensionsSuggested ExtensionsRequired LibrariesSuggested Libraries
amqplibrabbitmq
bz2bzip2
curlcurl
dbaqdbm
domlibxml2
zlib
eventopensslsocketslibevent
ffilibffi
ftpopenssl
gdzlibzlib
libpng
libavif
libwebp
libjpeg
freetype
gettextgettext
gmpgmp
gmsslgmssl
grpcgrpc
iconvlibiconv
igbinarysession
apcu
imagickimagemagick
imapopensslimap
intlicu
ldapopensslldapgmp
libsodium
lz4liblz4
libxmlxml
mbregexmbstringonig
memcachezlib
session
mongodbicu
openssl
zstd
zlib
mysqlimysqlnd
mysqlndzlib
odbcunixodbc
opensslzlibopenssl
zlib
password-argon2libargon2
pdo_mysqlpdo
mysqlnd
pdo_odbcpdo
odbc
unixodbc
pdo_pgsqlpdo
pgsql
postgresql
pdo_sqlitepdo
sqlite3
sqlite
pdo_sqlsrvpdo
sqlsrv
pgsqlpostgresql
pharzlib
rdkafkalibrdkafka
readlinereadline
redissession
igbinary
zstd
liblz4
simplexmllibxml2
snappyapcusnappy
soaplibxml2
sodiumlibsodium
spxzlib
sqlite3sqlite
sqlsrvpcntlunixodbc
ssh2libssh2
swooleopenssl
curl
swoole-hook-pgsql
swoole-hook-mysql
swoole-hook-sqlite
libcares
brotli
nghttp2
zlib
swoole-hook-mysqlmysqlnd
pdo
pdo_mysql
mysqli
swoole-hook-pgsqlpgsql
pdo
swoole-hook-sqlitesqlite3
pdo
swowopenssl
curl
openssl
curl
tidytidy
uuidlibuuid
uvsocketslibuv
xhprofctype
xlswriterzlib
zip
openssl
xmllibxml2
xmlreaderlibxml2
xmlwriterlibxml2
xslxml
dom
libxslt
yacigbinary
yamllibyaml
ziplibzip
zlibzlib
zstdzstd

macOS

Extension NameRequired ExtensionsSuggested ExtensionsRequired LibrariesSuggested Libraries
amqplibrabbitmq
bz2bzip2
curlcurl
dbaqdbm
domlibxml2
zlib
eventopensslsocketslibevent
ffilibffi
ftpopenssl
gdzlibzlib
libpng
libavif
libwebp
libjpeg
freetype
gettextgettext
glfwglfw
gmpgmp
gmsslgmssl
grpcgrpc
iconvlibiconv
igbinarysession
apcu
imagickimagemagick
imapopensslimap
intlicu
ldapopensslldapgmp
libsodium
lz4liblz4
libxmlxml
mbregexmbstringonig
memcachezlib
session
memcachedsession
zlib
libmemcached
mongodbicu
openssl
zstd
zlib
mysqlimysqlnd
mysqlndzlib
odbcunixodbc
opensslzlibopenssl
zlib
password-argon2libargon2
pdo_mysqlpdo
mysqlnd
pdo_odbcpdo
odbc
unixodbc
pdo_pgsqlpdo
pgsql
postgresql
pdo_sqlitepdo
sqlite3
sqlite
pdo_sqlsrvpdo
sqlsrv
pgsqlpostgresql
pharzlib
rdkafkalibrdkafka
readlinereadline
redissession
igbinary
zstd
liblz4
simplexmllibxml2
snappyapcusnappy
soaplibxml2
sodiumlibsodium
spxzlib
sqlite3sqlite
sqlsrvunixodbc
ssh2libssh2
swooleopenssl
curl
swoole-hook-pgsql
swoole-hook-mysql
swoole-hook-sqlite
libcares
brotli
nghttp2
zlib
swoole-hook-mysqlmysqlnd
pdo
pdo_mysql
mysqli
swoole-hook-pgsqlpgsql
pdo
swoole-hook-sqlitesqlite3
pdo
swowopenssl
curl
openssl
curl
tidytidy
uuidlibuuid
uvsocketslibuv
xhprofctype
xlswriterzlib
zip
openssl
xmllibxml2
xmlreaderlibxml2
xmlwriterlibxml2
xslxml
dom
libxslt
yacigbinary
yamllibyaml
ziplibzip
zlibzlib
zstdzstd

Windows

Extension NameRequired ExtensionsSuggested ExtensionsRequired LibrariesSuggested Libraries
amqpopenssllibrabbitmq
bz2bzip2
curlzlib
openssl
curl
dbaqdbm
domxmllibxml2
zlib
ffilibffi-win
ftpopenssl
gdzlibzlib
libpng
libavif
libwebp
libjpeg
freetype
gmsslgmssl
iconvlibiconv-win
igbinarysession
apcu
libxmlxml
mbregexmbstringonig
mysqlimysqlnd
mysqlndzlib
opensslzlibopenssl
zlib
parallelpthreads4w
pdo_mysqlpdo
mysqlnd
pdo_odbcpdo
odbc
pdo_pgsqlpdo
pgsql
postgresql-win
pdo_sqlitepdo
sqlite3
sqlite
pdo_sqlsrvpdo
sqlsrv
pgsqlpostgresql-win
pharzlib
redissession
igbinary
simplexmlxmllibxml2
soapxmllibxml2
sodiumlibsodium
sqlite3sqlite
ssh2openssl
zlib
libssh2
swowopenssl
curl
openssl
curl
xlswriterzlib
zip
openssl
xmliconvlibxml2
xmlreaderxml
dom
libxml2
xmlwriterxmllibxml2
yamllibyaml
zipzlib
bz2
libzip
zlib
bzip2
xz
zlibzlib

FreeBSD

Extension NameRequired ExtensionsSuggested ExtensionsRequired LibrariesSuggested Libraries
bz2bzip2
curlcurl
dbaqdbm
ftpopenssl
mbregexmbstringonig
mysqlimysqlnd
mysqlndzlib
opensslzlibopenssl
zlib
pdo_mysqlpdo
mysqlnd
pharzlib
zlibzlib
- +
Skip to content

Linux

Extension NameRequired ExtensionsSuggested ExtensionsRequired LibrariesSuggested Libraries
amqplibrabbitmq
brotlibrotli
bz2bzip2
curlcurl
dbaqdbm
domlibxml2
zlib
evsockets
eventopensslsocketslibevent
ffilibffi
ftpopenssl
gdzlibzlib
libpng
libavif
libwebp
libjpeg
freetype
gettextgettext
gmpgmp
gmsslgmssl
grpcgrpc
iconvlibiconv
igbinarysession
apcu
imagickimagemagick
imapopensslimap
intlicu
ldapopensslldapgmp
libsodium
lz4liblz4
mbregexmbstringonig
memcachezlib
session
memcachedsession
zlib
libmemcached
fastlz
mongodbicu
openssl
zstd
zlib
msgpacksession
mysqlimysqlnd
mysqlndzlib
odbcunixodbc
opensslzlibopenssl
zlib
password-argon2libargon2
pdo_mysqlpdo
mysqlnd
pdo_odbcpdo
odbc
unixodbc
pdo_pgsqlpdo
pgsql
postgresql
pdo_sqlitepdo
sqlite3
sqlite
pdo_sqlsrvpdo
sqlsrv
pgsqlpostgresql
pharzlib
rdkafkalibrdkafka
readlinereadline
redissession
igbinary
zstd
liblz4
simplexmllibxml2
snappyapcusnappy
soaplibxml2
sodiumlibsodium
spxzlib
sqlite3sqlite
sqlsrvpcntlunixodbc
ssh2openssl
zlib
libssh2
swooleopenssl
curl
swoole-hook-pgsql
swoole-hook-mysql
swoole-hook-sqlite
libcares
brotli
nghttp2
zlib
swoole-hook-mysqlmysqlnd
pdo
pdo_mysql
mysqli
swoole-hook-pgsqlpgsql
pdo
swoole-hook-sqlitesqlite3
pdo
swowopenssl
curl
openssl
curl
tidytidy
uuidlibuuid
uvsocketslibuv
xhprofctype
xlswriterzlib
zip
openssl
xmllibxml2
xmlreaderlibxml2
xmlwriterlibxml2
xslxml
dom
libxslt
xzxz
yacigbinaryfastlz
yamllibyaml
ziplibzip
zlibzlib
zstdzstd

macOS

Extension NameRequired ExtensionsSuggested ExtensionsRequired LibrariesSuggested Libraries
amqplibrabbitmq
brotlibrotli
bz2bzip2
curlcurl
dbaqdbm
domlibxml2
zlib
evsockets
eventopensslsocketslibevent
ffilibffi
ftpopenssl
gdzlibzlib
libpng
libavif
libwebp
libjpeg
freetype
gettextgettext
glfwglfw
gmpgmp
gmsslgmssl
grpcgrpc
iconvlibiconv
igbinarysession
apcu
imagickimagemagick
imapopensslimap
intlicu
ldapopensslldapgmp
libsodium
lz4liblz4
mbregexmbstringonig
memcachezlib
session
memcachedsession
zlib
libmemcached
fastlz
mongodbicu
openssl
zstd
zlib
msgpacksession
mysqlimysqlnd
mysqlndzlib
odbcunixodbc
opensslzlibopenssl
zlib
password-argon2libargon2
pdo_mysqlpdo
mysqlnd
pdo_odbcpdo
odbc
unixodbc
pdo_pgsqlpdo
pgsql
postgresql
pdo_sqlitepdo
sqlite3
sqlite
pdo_sqlsrvpdo
sqlsrv
pgsqlpostgresql
pharzlib
rdkafkalibrdkafka
readlinereadline
redissession
igbinary
zstd
liblz4
simplexmllibxml2
snappyapcusnappy
soaplibxml2
sodiumlibsodium
spxzlib
sqlite3sqlite
sqlsrvunixodbc
ssh2openssl
zlib
libssh2
swooleopenssl
curl
swoole-hook-pgsql
swoole-hook-mysql
swoole-hook-sqlite
libcares
brotli
nghttp2
zlib
swoole-hook-mysqlmysqlnd
pdo
pdo_mysql
mysqli
swoole-hook-pgsqlpgsql
pdo
swoole-hook-sqlitesqlite3
pdo
swowopenssl
curl
openssl
curl
tidytidy
uuidlibuuid
uvsocketslibuv
xhprofctype
xlswriterzlib
zip
openssl
xmllibxml2
xmlreaderlibxml2
xmlwriterlibxml2
xslxml
dom
libxslt
xzxz
yacigbinaryfastlz
yamllibyaml
ziplibzip
zlibzlib
zstdzstd

Windows

Extension NameRequired ExtensionsSuggested ExtensionsRequired LibrariesSuggested Libraries
amqpopenssllibrabbitmq
brotlibrotli
bz2bzip2
curlzlib
openssl
curl
dbaqdbm
domxmllibxml2
zlib
evsockets
ffilibffi-win
ftpopenssl
gdzlibzlib
libpng
libavif
libwebp
libjpeg
freetype
gmsslgmssl
iconvlibiconv-win
igbinarysession
apcu
mbregexmbstringonig
msgpacksession
mysqlimysqlnd
mysqlndzlib
opensslzlibopenssl
zlib
parallelpthreads4w
pdo_mysqlpdo
mysqlnd
pdo_odbcpdo
odbc
pdo_pgsqlpdo
pgsql
postgresql-win
pdo_sqlitepdo
sqlite3
sqlite
pdo_sqlsrvpdo
sqlsrv
pgsqlpostgresql-win
pharzlib
redissession
igbinary
simplexmlxmllibxml2
soapxmllibxml2
sodiumlibsodium
sqlite3sqlite
ssh2openssl
zlib
libssh2
swowopenssl
curl
openssl
curl
xlswriterzlib
zip
openssl
xmliconvlibxml2
xmlreaderxml
dom
libxml2
xmlwriterxmllibxml2
xzxz
yamllibyaml
zipzlib
bz2
libzip
zlib
bzip2
xz
zlibzlib

FreeBSD

Extension NameRequired ExtensionsSuggested ExtensionsRequired LibrariesSuggested Libraries
brotlibrotli
bz2bzip2
curlcurl
dbaqdbm
evsockets
ftpopenssl
mbregexmbstringonig
mysqlimysqlnd
mysqlndzlib
opensslzlibopenssl
zlib
pdo_mysqlpdo
mysqlnd
pharzlib
xzxz
zlibzlib
+ \ No newline at end of file diff --git a/deps-map-lib.html b/deps-map-lib.html index 4c673b11..681a5a1f 100644 --- a/deps-map-lib.html +++ b/deps-map-lib.html @@ -5,20 +5,21 @@ static-php-cli - - + + + - + - - - + + + -
Skip to content

Linux

Library NameRequired LibrariesSuggested Libraries
curlopenssl
zlib
libssh2
brotli
nghttp2
nghttp3
ngtcp2
zstd
libcares
freetypezliblibpng
bzip2
brotli
gettextlibiconvncurses
libxml2
grpczlib
openssl
imagemagickzlib
libpng
libjpeg
libwebp
freetype
libtiff
libheif
bzip2
zstd
xz
libzip
libxml2
imapopenssl
ldapopenssl
zlib
gmp
libsodium
libaclattr
libeventopenssl
libheiflibde265
libwebp
libaom
zlib
brotli
libpngzlib
librabbitmqopenssl
librdkafkazstd
libssh2opensslzlib
libtiffzlib
libjpeg
libxml2libiconvxz
icu
zlib
libxsltlibxml2
libzipzlibbzip2
xz
zstd
openssl
nghttp2zlib
openssl
libxml2
nghttp3
ngtcp2
nghttp3openssl
ngtcp2opensslnghttp3
brotli
opensslzlib
postgresqllibiconv
libxml2
openssl
zlib
readline
icu
libxslt
ldap
zstd
readlinencurses
snappyzlib
unixodbclibiconv
xzlibiconv

macOS

Library NameRequired LibrariesSuggested Libraries
curlopenssl
zlib
libssh2
brotli
nghttp2
nghttp3
ngtcp2
zstd
libcares
freetypezliblibpng
bzip2
brotli
gettextlibiconvncurses
libxml2
grpczlib
openssl
imagemagickzlib
libpng
libjpeg
libwebp
freetype
libtiff
libheif
bzip2
zstd
xz
libzip
libxml2
imapopenssl
ldapopenssl
zlib
gmp
libsodium
libeventopenssl
libheiflibde265
libwebp
libaom
zlib
brotli
libpngzlib
librabbitmqopenssl
librdkafkazstd
libssh2opensslzlib
libtiffzlib
libjpeg
libxml2libiconvxz
icu
zlib
libxsltlibxml2
libzipzlibbzip2
xz
zstd
openssl
nghttp2zlib
openssl
libxml2
nghttp3
ngtcp2
nghttp3openssl
ngtcp2opensslnghttp3
brotli
opensslzlib
postgresqllibiconv
libxml2
openssl
zlib
readline
icu
libxslt
ldap
zstd
readlinencurses
snappyzlib
unixodbclibiconv
xzlibiconv

Windows

Library NameRequired LibrariesSuggested Libraries
curlzlib
libssh2
nghttp2
brotli
zstd
freetypezliblibpng
bzip2
brotli
libjpegzlib
libpngzlib
librabbitmqopenssl
libssh2opensslzlib
libxml2libiconv-winzlib
libzipzlib
bzip2
xz
zstd
openssl
nghttp2zlib
openssl
libxml2
nghttp3
ngtcp2
nghttp3openssl
ngtcp2opensslnghttp3
brotli
opensslzlib

FreeBSD

Library NameRequired LibrariesSuggested Libraries
curlopenssl
zlib
libssh2
brotli
nghttp2
nghttp3
ngtcp2
zstd
libcares
opensslzlib
- +
Skip to content

Linux

Library NameRequired LibrariesSuggested Libraries
curlopenssl
zlib
libssh2
brotli
nghttp2
nghttp3
ngtcp2
zstd
libcares
freetypezliblibpng
bzip2
brotli
gettextlibiconvncurses
libxml2
grpczlib
openssl
imagemagickzlib
libpng
libjpeg
libwebp
freetype
libtiff
libheif
bzip2
zstd
xz
libzip
libxml2
imapopenssl
ldapopenssl
zlib
gmp
libsodium
libaclattr
libeventopenssl
libheiflibde265
libwebp
libaom
zlib
brotli
libpngzlib
librabbitmqopenssl
librdkafkazstd
libssh2opensslzlib
libtiffzlib
libjpeg
libxml2libiconvxz
icu
zlib
libxsltlibxml2
libzipzlibbzip2
xz
zstd
openssl
nghttp2zlib
openssl
libxml2
nghttp3
ngtcp2
nghttp3openssl
ngtcp2opensslnghttp3
brotli
opensslzlib
postgresqllibiconv
libxml2
openssl
zlib
readline
icu
libxslt
ldap
zstd
readlinencurses
snappyzlib
unixodbclibiconv
xzlibiconv

macOS

Library NameRequired LibrariesSuggested Libraries
curlopenssl
zlib
libssh2
brotli
nghttp2
nghttp3
ngtcp2
zstd
libcares
freetypezliblibpng
bzip2
brotli
gettextlibiconvncurses
libxml2
grpczlib
openssl
imagemagickzlib
libpng
libjpeg
libwebp
freetype
libtiff
libheif
bzip2
zstd
xz
libzip
libxml2
imapopenssl
ldapopenssl
zlib
gmp
libsodium
libeventopenssl
libheiflibde265
libwebp
libaom
zlib
brotli
libpngzlib
librabbitmqopenssl
librdkafkazstd
libssh2opensslzlib
libtiffzlib
libjpeg
libxml2libiconvxz
icu
zlib
libxsltlibxml2
libzipzlibbzip2
xz
zstd
openssl
nghttp2zlib
openssl
libxml2
nghttp3
ngtcp2
nghttp3openssl
ngtcp2opensslnghttp3
brotli
opensslzlib
postgresqllibiconv
libxml2
openssl
zlib
readline
icu
libxslt
ldap
zstd
readlinencurses
snappyzlib
unixodbclibiconv
xzlibiconv

Windows

Library NameRequired LibrariesSuggested Libraries
curlzlib
libssh2
nghttp2
brotli
zstd
freetypezliblibpng
bzip2
brotli
libjpegzlib
libpngzlib
librabbitmqopenssl
libssh2opensslzlib
libxml2libiconv-winzlib
libzipzlib
bzip2
xz
zstd
openssl
nghttp2zlib
openssl
libxml2
nghttp3
ngtcp2
nghttp3openssl
ngtcp2opensslnghttp3
brotli
opensslzlib

FreeBSD

Library NameRequired LibrariesSuggested Libraries
curlopenssl
zlib
libssh2
brotli
nghttp2
nghttp3
ngtcp2
zstd
libcares
opensslzlib
+ \ No newline at end of file diff --git a/en/contributing/index.html b/en/contributing/index.html index 43e2f997..2999a8e9 100644 --- a/en/contributing/index.html +++ b/en/contributing/index.html @@ -5,20 +5,21 @@ Contributing | static-php-cli - - + + + - + - - - + + + -
Skip to content

Contributing

Thank you for being here, this project welcomes your contributions!

Contribution Guide

If you have code or documentation to contribute, here's what you need to know first.

  1. What type of code are you contributing? (new extensions, bug fixes, security issues, project framework optimizations, documentation)
  2. If you contribute new files or new snippets, is your code checked by php-cs-fixer and phpstan?
  3. Have you fully read the Developer Guide before contributing code?

If you can answer the above questions and have made changes to the code, you can initiate a Pull Request in the project GitHub repository in time. After the code review is completed, the code can be modified according to the suggestion, or directly merged into the main branch.

Contribution Type

The main purpose of this project is to compile statically linked PHP binaries, and the command line processing function is written based on symfony/console. Before development, if you are not familiar with it, Check out the symfony/console documentation first.

Security Update

Because this project is basically a PHP project running locally, generally speaking, there will be no remote attacks. But if you find such a problem, please **DO NOT submit a PR or Issue in the GitHub repository, You need to contact the project maintainer (crazywhalecc) via mail.

Fix Bugs

Fixing bugs generally does not involve modification of the project structure and framework, so if you can locate the wrong code and fix it directly, please submit a PR directly.

New Extensions

For adding a new extension, you need to understand some basic structure of the project and how to add a new extension according to the existing logic. It will be covered in detail in the next section on this page. In general, you will need:

  1. Evaluate whether the extension can be compiled inline into PHP.
  2. Evaluate whether the extension's dependent libraries (if any) can be compiled statically.
  3. Write library compile commands on different platforms.
  4. Verify that the extension and its dependencies are compatible with existing extensions and dependencies.
  5. Verify that the extension works normally in cli, micro, fpm, embed SAPIs.
  6. Write documentation and add your extension.

Project Framework Optimization

If you are already familiar with the working principle of symfony/console, and at the same time want to make some modifications or optimizations to the framework of the project, please understand the following things first:

  1. Adding extensions does not belong to project framework optimization, but if you find that you have to optimize the framework when adding new extensions, you need to modify the framework itself before adding extensions.
  2. For some large-scale logical modifications (such as those involving LibraryBase, Extension objects, etc.), it is recommended to submit an Issue or Draft PR for discussion first.
  3. In the early stage of the project, it was a pure private development project, and there were some Chinese comments in the code. After internationalizing your project you can submit a PR to translate these comments into English.
  4. Please do not submit more useless code fragments in the code, such as a large number of unused variables, methods, classes, and code that has been rewritten many times.

Released under the MIT License.

- +
Skip to content

Contributing

Thank you for being here, this project welcomes your contributions!

Contribution Guide

If you have code or documentation to contribute, here's what you need to know first.

  1. What type of code are you contributing? (new extensions, bug fixes, security issues, project framework optimizations, documentation)
  2. If you contribute new files or new snippets, is your code checked by php-cs-fixer and phpstan?
  3. Have you fully read the Developer Guide before contributing code?

If you can answer the above questions and have made changes to the code, you can initiate a Pull Request in the project GitHub repository in time. After the code review is completed, the code can be modified according to the suggestion, or directly merged into the main branch.

Contribution Type

The main purpose of this project is to compile statically linked PHP binaries, and the command line processing function is written based on symfony/console. Before development, if you are not familiar with it, Check out the symfony/console documentation first.

Security Update

Because this project is basically a PHP project running locally, generally speaking, there will be no remote attacks. But if you find such a problem, please **DO NOT submit a PR or Issue in the GitHub repository, You need to contact the project maintainer (crazywhalecc) via mail.

Fix Bugs

Fixing bugs generally does not involve modification of the project structure and framework, so if you can locate the wrong code and fix it directly, please submit a PR directly.

New Extensions

For adding a new extension, you need to understand some basic structure of the project and how to add a new extension according to the existing logic. It will be covered in detail in the next section on this page. In general, you will need:

  1. Evaluate whether the extension can be compiled inline into PHP.
  2. Evaluate whether the extension's dependent libraries (if any) can be compiled statically.
  3. Write library compile commands on different platforms.
  4. Verify that the extension and its dependencies are compatible with existing extensions and dependencies.
  5. Verify that the extension works normally in cli, micro, fpm, embed SAPIs.
  6. Write documentation and add your extension.

Project Framework Optimization

If you are already familiar with the working principle of symfony/console, and at the same time want to make some modifications or optimizations to the framework of the project, please understand the following things first:

  1. Adding extensions does not belong to project framework optimization, but if you find that you have to optimize the framework when adding new extensions, you need to modify the framework itself before adding extensions.
  2. For some large-scale logical modifications (such as those involving LibraryBase, Extension objects, etc.), it is recommended to submit an Issue or Draft PR for discussion first.
  3. In the early stage of the project, it was a pure private development project, and there were some Chinese comments in the code. After internationalizing your project you can submit a PR to translate these comments into English.
  4. Please do not submit more useless code fragments in the code, such as a large number of unused variables, methods, classes, and code that has been rewritten many times.

Released under the MIT License.

+ \ No newline at end of file diff --git a/en/develop/craft-yml.html b/en/develop/craft-yml.html index 0456ef01..5c7713ca 100644 --- a/en/develop/craft-yml.html +++ b/en/develop/craft-yml.html @@ -5,19 +5,20 @@ craft.yml Configuration | static-php-cli - - + + + - + - - - + + + -
Skip to content

craft.yml Configuration

yaml
# PHP version to build (default: 8.4)
+    
Skip to content

craft.yml Configuration

yaml
# PHP version to build (default: 8.4)
 php-version: 8.4
 # [REQUIRED] Static PHP extensions to build (list or comma-separated are both accepted)
 extensions: bcmath,fileinfo,phar,zlib,sodium,posix,pcntl
@@ -81,8 +82,8 @@
 # Extra environment variables
 extra-env:
   # e.g. Use github token to avoid rate limit
-  GITHUB_TOKEN: your-github-token

Released under the MIT License.

- + GITHUB_TOKEN: your-github-token

Released under the MIT License.

+ \ No newline at end of file diff --git a/en/develop/doctor-module.html b/en/develop/doctor-module.html index 69b82130..7212ad44 100644 --- a/en/develop/doctor-module.html +++ b/en/develop/doctor-module.html @@ -5,19 +5,20 @@ Doctor module | static-php-cli - - + + + - + - - - + + + -
Skip to content

Doctor module

The Doctor module is a relatively independent module used to check the system environment, which can be entered with the command bin/spc doctor, and the entry command class is in DoctorCommand.php.

The Doctor module is a checklist with a series of check items and automatic repair items. These items are stored in the src/SPC/doctor/item/ directory, And two Attributes are used as check item tags and auto-fix item tags: #[AsCheckItem] and #[AsFixItem].

Take the existing check item if necessary tools are installed, which is used to check whether the packages necessary for compilation are installed in the macOS system. The following is its source code:

php
use SPC\doctor\AsCheckItem;
+    
Skip to content

Doctor module

The Doctor module is a relatively independent module used to check the system environment, which can be entered with the command bin/spc doctor, and the entry command class is in DoctorCommand.php.

The Doctor module is a checklist with a series of check items and automatic repair items. These items are stored in the src/SPC/doctor/item/ directory, And two Attributes are used as check item tags and auto-fix item tags: #[AsCheckItem] and #[AsFixItem].

Take the existing check item if necessary tools are installed, which is used to check whether the packages necessary for compilation are installed in the macOS system. The following is its source code:

php
use SPC\doctor\AsCheckItem;
 use SPC\doctor\AsFixItem;
 use SPC\doctor\CheckResult;
 
@@ -34,7 +35,7 @@
         return CheckResult::fail('missing system commands: ' . implode(', ', $missing), 'build-tools', [$missing]);
     }
     return CheckResult::ok();
-}

The first parameter of the attribute is the name of the check item, and the following limit_os parameter restricts the check item to be triggered only under the specified system, and level is the priority of executing the check item, the larger the number, the higher the priority higher.

The $this->findCommand() method used in it is the method of SPC\builder\traits\UnixSystemUtilTrait, the purpose is to find the location of the system command, and return NULL if it cannot be found.

Each check item method should return a SPC\doctor\CheckResult:

  • When returning CheckResult::fail(), 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.
  • When CheckResult::ok() is returned, the check passed. You can also pass a parameter to return the check result, for example: CheckResult::ok('OS supported').
  • When returning CheckResult::fail(), if the third parameter is included, the array of the third parameter will be used as the parameter of AsFixItem.

The following is the method for automatically repairing items corresponding to this check item:

php
#[AsFixItem('build-tools')]
+}

The first parameter of the attribute is the name of the check item, and the following limit_os parameter restricts the check item to be triggered only under the specified system, and level is the priority of executing the check item, the larger the number, the higher the priority higher.

The $this->findCommand() method used in it is the method of SPC\builder\traits\UnixSystemUtilTrait, the purpose is to find the location of the system command, and return NULL if it cannot be found.

Each check item method should return a SPC\doctor\CheckResult:

  • When returning CheckResult::fail(), 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.
  • When CheckResult::ok() is returned, the check passed. You can also pass a parameter to return the check result, for example: CheckResult::ok('OS supported').
  • When returning CheckResult::fail(), if the third parameter is included, the array of the third parameter will be used as the parameter of AsFixItem.

The following is the method for automatically repairing items corresponding to this check item:

php
#[AsFixItem('build-tools')]
 public function fixBuildTools(array $missing): bool
 {
     foreach ($missing as $cmd) {
@@ -45,8 +46,8 @@
         }
     }
     return true;
-}

#[AsFixItem()] 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.

In the code here, shell()->exec() is the method of executing commands of the project, which is used to replace exec() and system(), and also provides debugging, obtaining execution status, entering directories, etc. characteristic.

Released under the MIT License.

- +}

#[AsFixItem()] 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.

In the code here, shell()->exec() is the method of executing commands of the project, which is used to replace exec() and system(), and also provides debugging, obtaining execution status, entering directories, etc. characteristic.

Released under the MIT License.

+ \ No newline at end of file diff --git a/en/develop/index.html b/en/develop/index.html index 0c661450..b42eb92d 100644 --- a/en/develop/index.html +++ b/en/develop/index.html @@ -5,20 +5,21 @@ Start Developing | static-php-cli - - + + + - + - - - + + + -
Skip to content

Start Developing

Developing this project requires the installation and deployment of a PHP environment, as well as some extensions and Composer commonly used in PHP projects.

The development environment and running environment of the project are almost exactly the same. You can refer to the Manual Build 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.

Regardless of its purpose, this project itself is actually a php-cli 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.

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.

Environment preparation

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.

Regardless of which PHP you use, in your development environment you need to install these extensions:

curl,dom,filter,mbstring,openssl,pcntl,phar,posix,sodium,tokenizer,xml,xmlwriter

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.

For micro self-executing binaries built by static-php-cli itself, only pcntl,posix,mbstring,tokenizer,phar is required.

Start development

Continuing down to see the project structure documentation, you can learn how static-php-cli works.

Released under the MIT License.

- +
Skip to content

Start Developing

Developing this project requires the installation and deployment of a PHP environment, as well as some extensions and Composer commonly used in PHP projects.

The development environment and running environment of the project are almost exactly the same. You can refer to the Manual Build 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.

Regardless of its purpose, this project itself is actually a php-cli 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.

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.

Environment preparation

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.

Regardless of which PHP you use, in your development environment you need to install these extensions:

curl,dom,filter,mbstring,openssl,pcntl,phar,posix,sodium,tokenizer,xml,xmlwriter

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.

For micro self-executing binaries built by static-php-cli itself, only pcntl,posix,mbstring,tokenizer,phar is required.

Start development

Continuing down to see the project structure documentation, you can learn how static-php-cli works.

Released under the MIT License.

+ \ No newline at end of file diff --git a/en/develop/php-src-changes.html b/en/develop/php-src-changes.html index 4946a5fb..ef2f685a 100644 --- a/en/develop/php-src-changes.html +++ b/en/develop/php-src-changes.html @@ -5,20 +5,21 @@ Modifications to PHP source code | static-php-cli - - + + + - + - - - + + + -
Skip to content

Modifications to PHP source code

During the static compilation process, static-php-cli made some modifications to the PHP source code in order to achieve good compatibility, performance, and security. The following is a description of the current modifications to the PHP source code.

Based on the patches provided by the phpmicro project, static-php-cli has made some modifications to the PHP source code to meet the needs of static compilation. The patches currently used by static-php-cli during compilation in the patch list are:

  • static_opcache
  • static_extensions_win32
  • cli_checks
  • disable_huge_page
  • vcruntime140
  • win32
  • zend_stream
  • cli_static
  • macos_iconv
  • phar

PHP <= 8.1 libxml patch

Because PHP only provides security updates for 8.1 and stops updating older versions, static-php-cli applies the libxml compilation patch that has been applied in newer versions of PHP to PHP 8.1 and below.

gd extension Windows patch

Compiling the gd extension under Windows requires major changes to the config.w32 file. static-php-cli has made some changes to the gd extension to make it easier to compile under Windows.

YAML extension Windows patch

YAML extension needs to modify the config.w32 file to compile under Windows. static-php-cli has made some modifications to the YAML extension to make it easier to compile under Windows.

static-php-cli version information insertion

When compiling, static-php-cli will insert the static-php-cli version information into the PHP version information for easy identification.

Add option to hardcode INI

When using the -I parameter to hardcode INI into static PHP functionality, static-php-cli will modify the PHP source code to insert the hardcoded content.

Linux system repair patch

Some compilation environments may lack some system header files or libraries. static-php-cli will automatically fix these problems during compilation, such as:

  • HAVE_STRLCAT missing problem
  • HAVE_STRLCPY missing problem

Fiber issue fix patch for Windows

When compiling PHP on Windows, there will be some issues with the Fiber extension. static-php-cli will automatically fix these issues during compilation (modify config.w32 in php-src).

Released under the MIT License.

- +
Skip to content

Modifications to PHP source code

During the static compilation process, static-php-cli made some modifications to the PHP source code in order to achieve good compatibility, performance, and security. The following is a description of the current modifications to the PHP source code.

Based on the patches provided by the phpmicro project, static-php-cli has made some modifications to the PHP source code to meet the needs of static compilation. The patches currently used by static-php-cli during compilation in the patch list are:

  • static_opcache
  • static_extensions_win32
  • cli_checks
  • disable_huge_page
  • vcruntime140
  • win32
  • zend_stream
  • cli_static
  • macos_iconv
  • phar

PHP <= 8.1 libxml patch

Because PHP only provides security updates for 8.1 and stops updating older versions, static-php-cli applies the libxml compilation patch that has been applied in newer versions of PHP to PHP 8.1 and below.

gd extension Windows patch

Compiling the gd extension under Windows requires major changes to the config.w32 file. static-php-cli has made some changes to the gd extension to make it easier to compile under Windows.

YAML extension Windows patch

YAML extension needs to modify the config.w32 file to compile under Windows. static-php-cli has made some modifications to the YAML extension to make it easier to compile under Windows.

static-php-cli version information insertion

When compiling, static-php-cli will insert the static-php-cli version information into the PHP version information for easy identification.

Add option to hardcode INI

When using the -I parameter to hardcode INI into static PHP functionality, static-php-cli will modify the PHP source code to insert the hardcoded content.

Linux system repair patch

Some compilation environments may lack some system header files or libraries. static-php-cli will automatically fix these problems during compilation, such as:

  • HAVE_STRLCAT missing problem
  • HAVE_STRLCPY missing problem

Fiber issue fix patch for Windows

When compiling PHP on Windows, there will be some issues with the Fiber extension. static-php-cli will automatically fix these issues during compilation (modify config.w32 in php-src).

Released under the MIT License.

+ \ No newline at end of file diff --git a/en/develop/source-module.html b/en/develop/source-module.html index 29a44404..9a86e130 100644 --- a/en/develop/source-module.html +++ b/en/develop/source-module.html @@ -5,19 +5,20 @@ Source module | static-php-cli - - + + + - + - - - + + + -
Skip to content

Source module

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 source.json and pkg.json file, which records the download method of all downloadable sources.

The main commands involved in the download function are bin/spc download and bin/spc extract. The download command is a downloader that downloads sources according to the configuration file, and the extract command is an extractor that extract sources from downloaded files.

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.

The configuration file of the downloader is source.json, which contains the download methods of all sources. You can add the source download methods you need, or modify the existing source download methods.

The download configuration structure of each source is as follows. The following is the source download configuration corresponding to the libevent extension:

json
{
+    
Skip to content

Source module

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 source.json and pkg.json file, which records the download method of all downloadable sources.

The main commands involved in the download function are bin/spc download and bin/spc extract. The download command is a downloader that downloads sources according to the configuration file, and the extract command is an extractor that extract sources from downloaded files.

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.

The configuration file of the downloader is source.json, which contains the download methods of all sources. You can add the source download methods you need, or modify the existing source download methods.

The download configuration structure of each source is as follows. The following is the source download configuration corresponding to the libevent extension:

json
{
   "libevent": {
     "type": "ghrel",
     "repo": "libevent/libevent",
@@ -28,7 +29,7 @@
       "path": "LICENSE"
     }
   }
-}

The most important field here is type. Currently, the types it supports are:

  • url: Directly use URL to download, for example: https://download.libsodium.org/libsodium/releases/libsodium-1.0.18.tar.gz.
  • ghrel: Use the GitHub Release API to download, download the artifacts uploaded from the latest version released by maintainers.
  • ghtar: Use the GitHub Release API to download. Different from ghrel, ghtar is downloaded from the source code (tar.gz) in the latest Release of the project.
  • ghtagtar: Use GitHub Release API to download. Compared with ghtar, ghtagtar can find the latest one from the tags list and download the source code in tar.gz format (because some projects only use tag release version).
  • bitbuckettag: Download using BitBucket API, basically the same as ghtagtar, except this one applies to BitBucket.
  • git: Clone the project directly from a Git address to download sources, applicable to any public Git repository.
  • filelist: 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.
  • custom: If none of the above download methods are satisfactory, you can write custom, create a new class under src/SPC/store/source/, extends CustomSourceBase, and write the download script yourself.

source.json Common parameters

Each source file in source.json has the following params:

  • license: the open source license of the source code, see Open Source License section below
  • type: must be one of the types mentioned above
  • path (optional): release the source code to the specified directory instead of source/{name}
  • provide-pre-built (optional): whether to provide precompiled binary files. If true, it will automatically try to download precompiled binary files when running bin/spc download

TIP

The path parameter in source.json can specify a relative or absolute path. When specified as a relative path, the path is based on source/.

Download type - url

URL type sources refer to downloading files directly from the URL.

The parameters included are:

  • url: The download address of the file, such as https://example.com/file.tgz
  • filename (optional): The file name saved to the local area. If not specified, the file name of the url will be used.

Example (download the imagick extension and extract it to the extension storage path of the php source code):

json
{
+}

The most important field here is type. Currently, the types it supports are:

  • url: Directly use URL to download, for example: https://download.libsodium.org/libsodium/releases/libsodium-1.0.18.tar.gz.
  • ghrel: Use the GitHub Release API to download, download the artifacts uploaded from the latest version released by maintainers.
  • ghtar: Use the GitHub Release API to download. Different from ghrel, ghtar is downloaded from the source code (tar.gz) in the latest Release of the project.
  • ghtagtar: Use GitHub Release API to download. Compared with ghtar, ghtagtar can find the latest one from the tags list and download the source code in tar.gz format (because some projects only use tag release version).
  • bitbuckettag: Download using BitBucket API, basically the same as ghtagtar, except this one applies to BitBucket.
  • git: Clone the project directly from a Git address to download sources, applicable to any public Git repository.
  • filelist: 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.
  • custom: If none of the above download methods are satisfactory, you can write custom, create a new class under src/SPC/store/source/, extends CustomSourceBase, and write the download script yourself.

source.json Common parameters

Each source file in source.json has the following params:

  • license: the open source license of the source code, see Open Source License section below
  • type: must be one of the types mentioned above
  • path (optional): release the source code to the specified directory instead of source/{name}
  • provide-pre-built (optional): whether to provide precompiled binary files. If true, it will automatically try to download precompiled binary files when running bin/spc download

TIP

The path parameter in source.json can specify a relative or absolute path. When specified as a relative path, the path is based on source/.

Download type - url

URL type sources refer to downloading files directly from the URL.

The parameters included are:

  • url: The download address of the file, such as https://example.com/file.tgz
  • filename (optional): The file name saved to the local area. If not specified, the file name of the url will be used.

Example (download the imagick extension and extract it to the extension storage path of the php source code):

json
{
    "ext-imagick": {
      "type": "url",
      "url": "https://pecl.php.net/get/imagick",
@@ -39,7 +40,7 @@
        "path": "LICENSE"
      }
    }
-}

Download type - ghrel

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.

The parameters included are:

  • repo: GitHub repository name
  • match: regular expression matching Assets files
  • prefer-stable: Whether to download stable versions first (default is false)

Example (download the libsodium library, matching the libsodium-x.y.tar.gz file in Release):

json
{
+}

Download type - ghrel

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.

The parameters included are:

  • repo: GitHub repository name
  • match: regular expression matching Assets files
  • prefer-stable: Whether to download stable versions first (default is false)

Example (download the libsodium library, matching the libsodium-x.y.tar.gz file in Release):

json
{
    "libsodium": {
      "type": "ghrel",
      "repo": "jedisct1/libsodium",
@@ -49,7 +50,7 @@
        "path": "LICENSE"
      }
    }
-}

Download type - ghtar

ghtar will download the file from the GitHub Release Tag. Unlike ghrel, ghtar will download the source code (tar.gz) from the latest Release of the project.

The parameters included are:

  • repo: GitHub repository name
  • prefer-stable: Whether to download stable versions first (default is false)

Example (brotli library):

json
{
+}

Download type - ghtar

ghtar will download the file from the GitHub Release Tag. Unlike ghrel, ghtar will download the source code (tar.gz) from the latest Release of the project.

The parameters included are:

  • repo: GitHub repository name
  • prefer-stable: Whether to download stable versions first (default is false)

Example (brotli library):

json
{
    "brotli": {
      "type": "ghtar",
      "repo": "google/brotli",
@@ -58,7 +59,7 @@
        "path": "LICENSE"
      }
    }
-}

Download type - ghtagtar

Use the GitHub Release API to download. Compared with ghtar, ghtagtar can find the latest one from the tags list and download the source code in tar.gz format (because some projects only use the tag version).

The parameters included are:

  • repo: GitHub repository name
  • prefer-stable: Whether to download stable versions first (default is false)

Example (gmp library):

json
{
+}

Download type - ghtagtar

Use the GitHub Release API to download. Compared with ghtar, ghtagtar can find the latest one from the tags list and download the source code in tar.gz format (because some projects only use the tag version).

The parameters included are:

  • repo: GitHub repository name
  • prefer-stable: Whether to download stable versions first (default is false)

Example (gmp library):

json
{
    "gmp": {
      "type": "ghtagtar",
      "repo": "alisw/GMP",
@@ -67,7 +68,7 @@
        "text": "EXAMPLE LICENSE"
      }
    }
-}

Download Type - bitbuckettag

Download using BitBucket API, basically the same as ghtagtar, except this one works with BitBucket.

The parameters included are:

  • repo: BitBucket repository name

Download type - git

Clone the project directly from a Git address to download sources, applicable to any public Git repository.

The parameters included are:

  • url: Git link (HTTPS only)
  • rev: branch name
json
{
+}

Download Type - bitbuckettag

Download using BitBucket API, basically the same as ghtagtar, except this one works with BitBucket.

The parameters included are:

  • repo: BitBucket repository name

Download type - git

Clone the project directly from a Git address to download sources, applicable to any public Git repository.

The parameters included are:

  • url: Git link (HTTPS only)
  • rev: branch name
json
{
    "imap": {
      "type": "git",
      "url": "https://github.com/static-php/imap.git",
@@ -77,7 +78,7 @@
        "path": "LICENSE"
      }
    }
-}

Download type - filelist

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.

Note that this method is only applicable to static sites with page index functions such as mirror sites and GNU official websites.

The parameters included are:

  • url: The URL of the page to crawl the latest version of the file
  • regex: regular expression matching file names and download links

Example (download the libiconv library from the GNU official website):

json
{
+}

Download type - filelist

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.

Note that this method is only applicable to static sites with page index functions such as mirror sites and GNU official websites.

The parameters included are:

  • url: The URL of the page to crawl the latest version of the file
  • regex: regular expression matching file names and download links

Example (download the libiconv library from the GNU official website):

json
{
    "libiconv": {
      "type": "filelist",
      "url": "https://ftp.gnu.org/gnu/libiconv/",
@@ -87,7 +88,7 @@
        "path": "COPYING"
      }
    }
-}

Download type - custom

If the above downloading methods are not satisfactory, you can write custom, create a new class under src/SPC/store/source/, extends CustomSourceBase, and write the download script yourself.

I won’t go into details here, you can look at src/SPC/store/source/PhpSource.php or src/SPC/store/source/PostgreSQLSource.php as examples.

pkg.json General parameters

pkg.json stores non-source-code files, such as precompiled tools musl-toolchain and UPX. It includes:

  • type: The same type as source.json and different kinds of parameters.
  • extract (optional): The path to decompress after downloading, the default is pkgroot/{pkg_name}.
  • extract-files (optional): Extract only the specified files to the specified location after downloading.

It should be noted that pkg.json does not involve compilation, modification and distribution of source code, so there is no license open source license field. And you cannot use the extract and extract-files parameters at the same time.

Example (download nasm locally and extract only program files to PHP SDK):

json
{
+}

Download type - custom

If the above downloading methods are not satisfactory, you can write custom, create a new class under src/SPC/store/source/, extends CustomSourceBase, and write the download script yourself.

I won’t go into details here, you can look at src/SPC/store/source/PhpSource.php or src/SPC/store/source/PostgreSQLSource.php as examples.

pkg.json General parameters

pkg.json stores non-source-code files, such as precompiled tools musl-toolchain and UPX. It includes:

  • type: The same type as source.json and different kinds of parameters.
  • extract (optional): The path to decompress after downloading, the default is pkgroot/{pkg_name}.
  • extract-files (optional): Extract only the specified files to the specified location after downloading.

It should be noted that pkg.json does not involve compilation, modification and distribution of source code, so there is no license open source license field. And you cannot use the extract and extract-files parameters at the same time.

Example (download nasm locally and extract only program files to PHP SDK):

json
{
    "nasm-x86_64-win": {
      "type": "url",
      "url": "https://www.nasm.us/pub/nasm/releasebuilds/2.16.01/win64/nasm-2.16.01-win64.zip",
@@ -96,7 +97,7 @@
        "nasm-2.16.01/ndisasm.exe": "{php_sdk_path}/bin/ndisasm.exe"
      }
    }
-}

The key name in extract-files is the file in the source folder, and the key value is the storage path. The storage path can use the following variables:

  • {php_sdk_path}: (Windows only) PHP SDK path
  • {pkg_root_path}: pkgroot/
  • {working_dir}: current working directory
  • {download_path}: download directory
  • {source_path}: source code decompression directory

When extract-files does not use variables and is a relative path, the directory of the relative path is {working_dir}.

Open source license

For source.json, each source file should contain an open source license. The license field stores the open source license information.

Each license contains the following parameters:

  • type: file or text
  • path: the license file in the source code directory (required when type is file)
  • text: License text (required when type is text)

Example (yaml extension source code with LICENSE file):

json
{
+}

The key name in extract-files is the file in the source folder, and the key value is the storage path. The storage path can use the following variables:

  • {php_sdk_path}: (Windows only) PHP SDK path
  • {pkg_root_path}: pkgroot/
  • {working_dir}: current working directory
  • {download_path}: download directory
  • {source_path}: source code decompression directory

When extract-files does not use variables and is a relative path, the directory of the relative path is {working_dir}.

Open source license

For source.json, each source file should contain an open source license. The license field stores the open source license information.

Each license contains the following parameters:

  • type: file or text
  • path: the license file in the source code directory (required when type is file)
  • text: License text (required when type is text)

Example (yaml extension source code with LICENSE file):

json
{
    "yaml": {
      "type": "git",
      "path": "php-src/ext/yaml",
@@ -107,7 +108,7 @@
        "path": "LICENSE"
      }
    }
-}

When an open source project has multiple licenses, multiple files can be specified:

json
{
+}

When an open source project has multiple licenses, multiple files can be specified:

json
{
    "libuv": {
      "type": "ghtar",
      "repo": "libuv/libuv",
@@ -122,7 +123,7 @@
        }
      ]
    }
-}

When the license of an open source project uses different files between versions, path can be used as an array to list the possible license files:

json
{
+}

When the license of an open source project uses different files between versions, path can be used as an array to list the possible license files:

json
{
   "redis": {
     "type": "git",
     "path": "php-src/ext/redis",
@@ -136,8 +137,8 @@
       ]
     }
   }
-}

Released under the MIT License.

- +}

Released under the MIT License.

+ \ No newline at end of file diff --git a/en/develop/structure.html b/en/develop/structure.html index 00d63203..ceca67f5 100644 --- a/en/develop/structure.html +++ b/en/develop/structure.html @@ -5,29 +5,30 @@ Introduction to project structure | static-php-cli - - + + + - + - - - + + + -
Skip to content

Introduction to project structure

static-php-cli mainly contains three logical components: sources, dependent libraries, and extensions. These components contains 4 configuration files: source.json, pkg.json, lib.json, and ext.json.

A complete process for building standalone static PHP is:

  1. Use the source download module Downloader to download specified or all source codes. These sources include PHP source code, dependent library source code, and extension source code.
  2. Use the source decompression module SourceExtractor to decompress the downloaded sources to the compilation directory.
  3. Use the dependency tool to calculate the dependent extensions and dependent libraries of the currently added extension, and then compile each library that needs to be compiled in the order of dependencies.
  4. After building each dependent library using Builder under the corresponding operating system, install it to the buildroot directory.
  5. If external extensions are included (the source code does not contain extensions within PHP), copy the external extensions to the source/php-src/ext/ directory.
  6. Use Builder to build the PHP source code and build target to the buildroot directory.

The project is mainly divided into several folders:

  • bin/: used to store program entry files, including bin/spc, bin/spc-alpine-docker, bin/setup-runtime.
  • config/: Contains all the extensions and dependent libraries supported by the project, as well as the download link and download methods of these sources. It is divided into files: lib.json, ext.json, source.json, pkg.json, pre-built.json .
  • src/: The core code of the project, including the entire framework and commands for compiling various extensions and libraries.
  • vendor/: The directory that Composer depends on, you do not need to make any modifications to it.

The operating principle is to start a ConsoleApplication of symfony/console, and then parse the commands entered by the user in the terminal.

Basic command line structure

bin/spc is an entry file, including the Unix common #!/usr/bin/env php, which is used to allow the system to automatically execute with the PHP interpreter installed on the system. After the project executes new ConsoleApplication(), the framework will automatically register them as commands.

The project does not directly use the Command registration method and command execution method recommended by Symfony. Here are small changes:

  1. Each command uses the #[AsCommand()] Attribute to register the name and description.
  2. Abstract execute() so that all commands are based on BaseCommand (which is based on Symfony\Component\Console\Command\Command), and the execution code of each command itself is written in the handle() method .
  3. Added variable $no_motd to BaseCommand, which is used to display the Figlet greeting when the command is executed.
  4. BaseCommand saves InputInterface and OutputInterface as member variables. You can use $this->input and $this->output within the command class.

Basic source code structure

The source code of the project is located in the src/SPC directory, supports automatic loading of the PSR-4 standard, and contains the following subdirectories and classes:

  • src/SPC/builder/: The core compilation command code used to build libraries, PHP and related extensions under different operating systems, and also includes some compilation system tool methods.
  • src/SPC/command/: All commands of the project are here.
  • src/SPC/doctor/: Doctor module, which is a relatively independent module used to check the system environment. It can be entered using the command bin/spc doctor.
  • src/SPC/exception/: exception class.
  • src/SPC/store/: Classes related to storage, files and sources are all here.
  • src/SPC/util/: Some reusable tool methods are here.
  • src/SPC/ConsoleApplication.php: command line program entry file.

If you have read the source code, you may find that there is also a src/globals/ directory, which is used to store some global variables, global methods, and non-PSR-4 standard PHP source code that is relied upon during the build process, such as extension sanity check code etc.

Phar application directory issue

Like other php-cli projects, spc itself has additional considerations for paths. Because spc can run in multiple modes such as php-cli directly, micro SAPI, php-cli with Phar, vendor with Phar, etc., there are ambiguities in various root directories. A complete explanation is given here. This problem is generally common in the base class path selection problem of accessing files in PHP projects, especially when used with micro.sfx.

Note that this may only be useful for you when developing Phar projects or PHP frameworks.

Next, we will treat static-php-cli (that is, spc) as a normal php command line program. You can understand spc as any of your own php-cli applications for reference.

There are three basic constant theoretical values below. We recommend that you introduce these three constants when writing PHP projects:

  • WORKING_DIR: the working directory when executing PHP scripts

  • SOURCE_ROOT_DIR or ROOT_DIR: the root directory of the project folder, generally the directory where composer.json is located

  • FRAMEWORK_ROOT_DIR: the root directory of the framework used, which may be used by self-developed frameworks. Generally, the framework directory is read-only

You can define these constants in your framework entry or cli applications to facilitate the use of paths in your project.

The following are PHP built-in constant values, which have been defined inside the PHP interpreter:

  • __DIR__: the directory where the file of the currently executed script is located

  • __FILE__: the file path of the currently executed script

Git project mode (source)

Git project mode refers to a framework or program itself stored in plain text in the current folder, and running through php path/to/entry.php.

Assume that your project is stored in the /home/example/static-php-cli/ directory, or your project is the framework itself, which contains project files such as composer.json:

composer.json
+    
Skip to content

Introduction to project structure

static-php-cli mainly contains three logical components: sources, dependent libraries, and extensions. These components contains 4 configuration files: source.json, pkg.json, lib.json, and ext.json.

A complete process for building standalone static PHP is:

  1. Use the source download module Downloader to download specified or all source codes. These sources include PHP source code, dependent library source code, and extension source code.
  2. Use the source decompression module SourceExtractor to decompress the downloaded sources to the compilation directory.
  3. Use the dependency tool to calculate the dependent extensions and dependent libraries of the currently added extension, and then compile each library that needs to be compiled in the order of dependencies.
  4. After building each dependent library using Builder under the corresponding operating system, install it to the buildroot directory.
  5. If external extensions are included (the source code does not contain extensions within PHP), copy the external extensions to the source/php-src/ext/ directory.
  6. Use Builder to build the PHP source code and build target to the buildroot directory.

The project is mainly divided into several folders:

  • bin/: used to store program entry files, including bin/spc, bin/spc-alpine-docker, bin/setup-runtime.
  • config/: Contains all the extensions and dependent libraries supported by the project, as well as the download link and download methods of these sources. It is divided into files: lib.json, ext.json, source.json, pkg.json, pre-built.json .
  • src/: The core code of the project, including the entire framework and commands for compiling various extensions and libraries.
  • vendor/: The directory that Composer depends on, you do not need to make any modifications to it.

The operating principle is to start a ConsoleApplication of symfony/console, and then parse the commands entered by the user in the terminal.

Basic command line structure

bin/spc is an entry file, including the Unix common #!/usr/bin/env php, which is used to allow the system to automatically execute with the PHP interpreter installed on the system. After the project executes new ConsoleApplication(), the framework will automatically register them as commands.

The project does not directly use the Command registration method and command execution method recommended by Symfony. Here are small changes:

  1. Each command uses the #[AsCommand()] Attribute to register the name and description.
  2. Abstract execute() so that all commands are based on BaseCommand (which is based on Symfony\Component\Console\Command\Command), and the execution code of each command itself is written in the handle() method .
  3. Added variable $no_motd to BaseCommand, which is used to display the Figlet greeting when the command is executed.
  4. BaseCommand saves InputInterface and OutputInterface as member variables. You can use $this->input and $this->output within the command class.

Basic source code structure

The source code of the project is located in the src/SPC directory, supports automatic loading of the PSR-4 standard, and contains the following subdirectories and classes:

  • src/SPC/builder/: The core compilation command code used to build libraries, PHP and related extensions under different operating systems, and also includes some compilation system tool methods.
  • src/SPC/command/: All commands of the project are here.
  • src/SPC/doctor/: Doctor module, which is a relatively independent module used to check the system environment. It can be entered using the command bin/spc doctor.
  • src/SPC/exception/: exception class.
  • src/SPC/store/: Classes related to storage, files and sources are all here.
  • src/SPC/util/: Some reusable tool methods are here.
  • src/SPC/ConsoleApplication.php: command line program entry file.

If you have read the source code, you may find that there is also a src/globals/ directory, which is used to store some global variables, global methods, and non-PSR-4 standard PHP source code that is relied upon during the build process, such as extension sanity check code etc.

Phar application directory issue

Like other php-cli projects, spc itself has additional considerations for paths. Because spc can run in multiple modes such as php-cli directly, micro SAPI, php-cli with Phar, vendor with Phar, etc., there are ambiguities in various root directories. A complete explanation is given here. This problem is generally common in the base class path selection problem of accessing files in PHP projects, especially when used with micro.sfx.

Note that this may only be useful for you when developing Phar projects or PHP frameworks.

Next, we will treat static-php-cli (that is, spc) as a normal php command line program. You can understand spc as any of your own php-cli applications for reference.

There are three basic constant theoretical values below. We recommend that you introduce these three constants when writing PHP projects:

  • WORKING_DIR: the working directory when executing PHP scripts

  • SOURCE_ROOT_DIR or ROOT_DIR: the root directory of the project folder, generally the directory where composer.json is located

  • FRAMEWORK_ROOT_DIR: the root directory of the framework used, which may be used by self-developed frameworks. Generally, the framework directory is read-only

You can define these constants in your framework entry or cli applications to facilitate the use of paths in your project.

The following are PHP built-in constant values, which have been defined inside the PHP interpreter:

  • __DIR__: the directory where the file of the currently executed script is located

  • __FILE__: the file path of the currently executed script

Git project mode (source)

Git project mode refers to a framework or program itself stored in plain text in the current folder, and running through php path/to/entry.php.

Assume that your project is stored in the /home/example/static-php-cli/ directory, or your project is the framework itself, which contains project files such as composer.json:

composer.json
 src/App/MyCommand.app
 vendor/*
-bin/entry.php

We assume that the above constants are obtained from src/App/MyCommand.php:

ConstantValue
WORKING_DIR/home/example/static-php-cli
SOURCE_ROOT_DIR/home/example/static-php-cli
FRAMEWORK_ROOT_DIR/home/example/static-php-cli
__DIR__/home/example/static-php-cli/src/App
__FILE__/home/example/static-php-cli/src/App/MyCommand.php

In this case, the values of WORKING_DIR, SOURCE_ROOT_DIR, and FRAMEWORK_ROOT_DIR are exactly the same: /home/example/static-php-cli.

The source code of the framework and the source code of the application are both in the current path.

Vendor library mode (vendor)

The vendor library mode generally means that your project is a framework or is installed into the project as a composer dependency by other applications, and the storage location is in the vendor/author/XXX directory.

Suppose your project is crazywhalecc/static-php-cli, and you or others install this project in another project using composer require.

We assume that static-php-cli contains all files except the vendor directory with the same Git mode, and get the constant value from src/App/MyCommand, Directory constant should be:

ConstantValue
WORKING_DIR/home/example/another-app
SOURCE_ROOT_DIR/home/example/another-app
FRAMEWORK_ROOT_DIR/home/example/another-app/vendor/crazywhalecc/static-php-cli
__DIR__/home/example/another-app/vendor/crazywhalecc/static-php-cli/src/App
__FILE__/home/example/another-app/vendor/crazywhalecc/static-php-cli/src/App/MyCommand.php

Here SOURCE_ROOT_DIR refers to the root directory of the project using static-php-cli.

Git project Phar mode (source-phar)

Git project Phar mode refers to the mode of packaging the project directory of the Git project mode into a phar file. We assume that /home/example/static-php-cli will be packaged into a Phar file, and the directory has the following files:

composer.json
+bin/entry.php

We assume that the above constants are obtained from src/App/MyCommand.php:

ConstantValue
WORKING_DIR/home/example/static-php-cli
SOURCE_ROOT_DIR/home/example/static-php-cli
FRAMEWORK_ROOT_DIR/home/example/static-php-cli
__DIR__/home/example/static-php-cli/src/App
__FILE__/home/example/static-php-cli/src/App/MyCommand.php

In this case, the values of WORKING_DIR, SOURCE_ROOT_DIR, and FRAMEWORK_ROOT_DIR are exactly the same: /home/example/static-php-cli.

The source code of the framework and the source code of the application are both in the current path.

Vendor library mode (vendor)

The vendor library mode generally means that your project is a framework or is installed into the project as a composer dependency by other applications, and the storage location is in the vendor/author/XXX directory.

Suppose your project is crazywhalecc/static-php-cli, and you or others install this project in another project using composer require.

We assume that static-php-cli contains all files except the vendor directory with the same Git mode, and get the constant value from src/App/MyCommand, Directory constant should be:

ConstantValue
WORKING_DIR/home/example/another-app
SOURCE_ROOT_DIR/home/example/another-app
FRAMEWORK_ROOT_DIR/home/example/another-app/vendor/crazywhalecc/static-php-cli
__DIR__/home/example/another-app/vendor/crazywhalecc/static-php-cli/src/App
__FILE__/home/example/another-app/vendor/crazywhalecc/static-php-cli/src/App/MyCommand.php

Here SOURCE_ROOT_DIR refers to the root directory of the project using static-php-cli.

Git project Phar mode (source-phar)

Git project Phar mode refers to the mode of packaging the project directory of the Git project mode into a phar file. We assume that /home/example/static-php-cli will be packaged into a Phar file, and the directory has the following files:

composer.json
 src/App/MyCommand.app
 vendor/*
-bin/entry.php

When packaged into app.phar and stored in the /home/example/static-php-cli directory, app.phar is executed at this time. Assuming that the src/App/MyCommand code is executed, the constant is obtained in the file:

ConstantValue
WORKING_DIR/home/example/static-php-cli
SOURCE_ROOT_DIRphar:///home/example/static-php-cli/app.phar/
FRAMEWORK_ROOT_DIRphar:///home/example/static-php-cli/app.phar/
__DIR__phar:///home/example/static-php-cli/app.phar/src/App
__FILE__phar:///home/example/static-php-cli/app.phar/src/App/MyCommand.php

Because the phar:// protocol is required to read files in the phar itself, the project root directory and the framework directory will be different from WORKING_DIR.

Vendor Library Phar Mode (vendor-phar)

Vendor Library Phar Mode means that your project is installed as a framework in other projects and stored in the vendor directory.

We assume that your project directory structure is as follows:

composer.json                           # Composer configuration file of the current project
+bin/entry.php

When packaged into app.phar and stored in the /home/example/static-php-cli directory, app.phar is executed at this time. Assuming that the src/App/MyCommand code is executed, the constant is obtained in the file:

ConstantValue
WORKING_DIR/home/example/static-php-cli
SOURCE_ROOT_DIRphar:///home/example/static-php-cli/app.phar/
FRAMEWORK_ROOT_DIRphar:///home/example/static-php-cli/app.phar/
__DIR__phar:///home/example/static-php-cli/app.phar/src/App
__FILE__phar:///home/example/static-php-cli/app.phar/src/App/MyCommand.php

Because the phar:// protocol is required to read files in the phar itself, the project root directory and the framework directory will be different from WORKING_DIR.

Vendor Library Phar Mode (vendor-phar)

Vendor Library Phar Mode means that your project is installed as a framework in other projects and stored in the vendor directory.

We assume that your project directory structure is as follows:

composer.json                           # Composer configuration file of the current project
 box.json                                # Configuration file for packaging Phar
 another-app.php                         # Entry file of another project
-vendor/crazywhalecc/static-php-cli/*    # Your project is used as a dependent library

When packaging these files under the directory /home/example/another-app/ into app.phar, the value of the following constant for your project should be:

ConstantValue
WORKING_DIR/home/example/another-app
SOURCE_ROOT_DIRphar:///home/example/another-app/app.phar/
FRAMEWORK_ROOT_DIRphar:///home/example/another-app/app.phar/vendor/crazywhalecc/static-php-cli
__DIR__phar:///home/example/another-app/app.phar/vendor/crazywhalecc/static-php-cli/src/App
__FILE__phar:///home/example/another-app/app.phar/vendor/crazywhalecc/static-php-cli/src/App/MyCommand.php

Released under the MIT License.

- +vendor/crazywhalecc/static-php-cli/* # Your project is used as a dependent library

When packaging these files under the directory /home/example/another-app/ into app.phar, the value of the following constant for your project should be:

ConstantValue
WORKING_DIR/home/example/another-app
SOURCE_ROOT_DIRphar:///home/example/another-app/app.phar/
FRAMEWORK_ROOT_DIRphar:///home/example/another-app/app.phar/vendor/crazywhalecc/static-php-cli
__DIR__phar:///home/example/another-app/app.phar/vendor/crazywhalecc/static-php-cli/src/App
__FILE__phar:///home/example/another-app/app.phar/vendor/crazywhalecc/static-php-cli/src/App/MyCommand.php

Released under the MIT License.

+ \ No newline at end of file diff --git a/en/develop/system-build-tools.html b/en/develop/system-build-tools.html index b6971538..ed12b270 100644 --- a/en/develop/system-build-tools.html +++ b/en/develop/system-build-tools.html @@ -5,19 +5,20 @@ Compilation Tools | static-php-cli - - + + + - + - - - + + + -
Skip to content

Compilation Tools

static-php-cli uses many system compilation tools when building static PHP. These tools mainly include:

  • autoconf: used to generate configure scripts.
  • make: used to execute Makefile.
  • cmake: used to execute CMakeLists.txt.
  • pkg-config: Used to find the installation path of dependent libraries.
  • gcc: used to compile C/C++ projects under Linux.
  • clang: used to compile C/C++ projects under macOS.

For Linux and macOS operating systems, these tools can usually be installed through the package manager, which is written in the doctor module. Theoretically we can also compile and download these tools manually, but this will increase the complexity of compilation, so we do not recommend this.

Linux Compilation Tools

For Linux systems, different distributions have different installation methods for compilation tools. And for static compilation, the package management of some distributions cannot install libraries and tools for pure static compilation. Therefore, for the Linux platform and its different distributions, we currently provide a variety of compilation environment preparations.

Glibc Environment

The glibc environment refers to the underlying libc library of the system (that is, the C standard library that all programs written in C language are dynamically linked to) uses glibc, which is the default environment for most distributions. For example: Ubuntu, Debian, CentOS, RHEL, openSUSE, Arch Linux, etc.

In the glibc environment, the package management and compiler we use point to glibc by default, and glibc cannot be statically linked well. One of the reasons it cannot be statically linked is that its network library nss cannot be compiled statically.

For the glibc environment, in static-php-cli and spc in 2.0-RC8 and later, you can choose two ways to build static PHP:

  1. Use Docker to build, you can use bin/spc-alpine-docker to build, it will build an Alpine Linux docker image.
  2. Use bin/spc doctor --auto-fix to install the musl-wrapper and musl-cross-make packages, and then build directly. (Related source code)

Generally speaking, the build results in these two environments are consistent, and you can choose according to actual needs.

In the doctor module, static-php-cli will first detect the current Linux distribution. If the current distribution is a glibc environment, you will be prompted to install the musl-wrapper and musl-cross-make packages.

The process of installing musl-wrapper in the glibc environment is as follows:

  1. Download the specific version of musl-wrapper source code from the musl official website.
  2. Use gcc installed from the package management to compile the musl-wrapper source code and generate musl-libc and other libraries: ./configure --disable-gcc-wrapper && make -j && sudo make install.
  3. The musl-wrapper related libraries will be installed in the /usr/local/musl directory.

The process of installing musl-cross-make in the glibc environment is as follows:

  1. Download the precompiled musl-cross-make compressed package from dl.static-php.dev .
  2. Unzip to the /usr/local/musl directory.

TIP

In the glibc environment, static compilation can be achieved by directly installing musl-wrapper, but musl-wrapper only contains musl-gcc and not musl-g++, which means that C++ code cannot be compiled. So we need musl-cross-make to provide musl-g++.

The reason why the musl-cross-make package cannot be compiled directly locally is that its compilation environment requirements are relatively high (requires more than 36GB of memory, compiled under Alpine Linux), so we provide precompiled binary packages that can be used for all Linux distributions.

At the same time, the package management of some distributions provides musl-wrapper, but musl-cross-make needs to match the corresponding musl-wrapper version, so we do not use package management to install musl-wrapper.

Compiling musl-cross-make will be introduced in the musl-cross-make Toolchain Compilation section of this chapter.

Musl Environment

The musl environment refers to the system's underlying libc library that uses musl, which is a lightweight C standard library that can be well statically linked.

For the currently popular Linux distributions, Alpine Linux uses the musl environment, so static-php-cli can directly build static PHP under Alpine Linux. You only need to install basic compilation tools (such as gcc, cmake, etc.) directly from the package management.

For other distributions, if your distribution uses the musl environment, you can also use static-php-cli to build static PHP directly after installing the necessary compilation tools.

TIP

In the musl environment, static-php-cli will automatically skip the installation of musl-wrapper and musl-cross-make.

Docker Environment

The Docker environment refers to using Docker containers to build static PHP. You can use bin/spc-alpine-docker to build. Before executing this command, you need to install Docker first, and then execute bin/spc-alpine-docker in the project root directory.

After executing bin/spc-alpine-docker, static-php-cli will automatically download the Alpine Linux image and then build a cwcc-spc-x86_64 or cwcc-spc-aarch64 image. Then all build process is performed within this image, which is equivalent to compiling in Alpine Linux.

musl-cross-make Toolchain Compilation

In Linux, although you do not need to manually compile the musl-cross-make tool, if you want to understand its compilation process, you can refer here. Another important reason is that this may not be compiled using automated tools such as CI and Actions, because the existing CI service compilation environment does not meet the compilation requirements of musl-cross-make, and the configuration that meets the requirements is too expensive.

The compilation process of musl-cross-make is as follows:

Prepare an Alpine Linux environment (either directly installed or using Docker). The compilation process requires more than 36GB of memory, so you need to compile on a machine with larger memory. Without this much memory, compilation may fail.

Then write the following content into the config.mak file:

makefile
STAT = -static --static
+    
Skip to content

Compilation Tools

static-php-cli uses many system compilation tools when building static PHP. These tools mainly include:

  • autoconf: used to generate configure scripts.
  • make: used to execute Makefile.
  • cmake: used to execute CMakeLists.txt.
  • pkg-config: Used to find the installation path of dependent libraries.
  • gcc: used to compile C/C++ projects under Linux.
  • clang: used to compile C/C++ projects under macOS.

For Linux and macOS operating systems, these tools can usually be installed through the package manager, which is written in the doctor module. Theoretically we can also compile and download these tools manually, but this will increase the complexity of compilation, so we do not recommend this.

Linux Compilation Tools

For Linux systems, different distributions have different installation methods for compilation tools. And for static compilation, the package management of some distributions cannot install libraries and tools for pure static compilation. Therefore, for the Linux platform and its different distributions, we currently provide a variety of compilation environment preparations.

Glibc Environment

The glibc environment refers to the underlying libc library of the system (that is, the C standard library that all programs written in C language are dynamically linked to) uses glibc, which is the default environment for most distributions. For example: Ubuntu, Debian, CentOS, RHEL, openSUSE, Arch Linux, etc.

In the glibc environment, the package management and compiler we use point to glibc by default, and glibc cannot be statically linked well. One of the reasons it cannot be statically linked is that its network library nss cannot be compiled statically.

For the glibc environment, in static-php-cli and spc in 2.0-RC8 and later, you can choose two ways to build static PHP:

  1. Use Docker to build, you can use bin/spc-alpine-docker to build, it will build an Alpine Linux docker image.
  2. Use bin/spc doctor --auto-fix to install the musl-wrapper and musl-cross-make packages, and then build directly. (Related source code)

Generally speaking, the build results in these two environments are consistent, and you can choose according to actual needs.

In the doctor module, static-php-cli will first detect the current Linux distribution. If the current distribution is a glibc environment, you will be prompted to install the musl-wrapper and musl-cross-make packages.

The process of installing musl-wrapper in the glibc environment is as follows:

  1. Download the specific version of musl-wrapper source code from the musl official website.
  2. Use gcc installed from the package management to compile the musl-wrapper source code and generate musl-libc and other libraries: ./configure --disable-gcc-wrapper && make -j && sudo make install.
  3. The musl-wrapper related libraries will be installed in the /usr/local/musl directory.

The process of installing musl-cross-make in the glibc environment is as follows:

  1. Download the precompiled musl-cross-make compressed package from dl.static-php.dev .
  2. Unzip to the /usr/local/musl directory.

TIP

In the glibc environment, static compilation can be achieved by directly installing musl-wrapper, but musl-wrapper only contains musl-gcc and not musl-g++, which means that C++ code cannot be compiled. So we need musl-cross-make to provide musl-g++.

The reason why the musl-cross-make package cannot be compiled directly locally is that its compilation environment requirements are relatively high (requires more than 36GB of memory, compiled under Alpine Linux), so we provide precompiled binary packages that can be used for all Linux distributions.

At the same time, the package management of some distributions provides musl-wrapper, but musl-cross-make needs to match the corresponding musl-wrapper version, so we do not use package management to install musl-wrapper.

Compiling musl-cross-make will be introduced in the musl-cross-make Toolchain Compilation section of this chapter.

Musl Environment

The musl environment refers to the system's underlying libc library that uses musl, which is a lightweight C standard library that can be well statically linked.

For the currently popular Linux distributions, Alpine Linux uses the musl environment, so static-php-cli can directly build static PHP under Alpine Linux. You only need to install basic compilation tools (such as gcc, cmake, etc.) directly from the package management.

For other distributions, if your distribution uses the musl environment, you can also use static-php-cli to build static PHP directly after installing the necessary compilation tools.

TIP

In the musl environment, static-php-cli will automatically skip the installation of musl-wrapper and musl-cross-make.

Docker Environment

The Docker environment refers to using Docker containers to build static PHP. You can use bin/spc-alpine-docker to build. Before executing this command, you need to install Docker first, and then execute bin/spc-alpine-docker in the project root directory.

After executing bin/spc-alpine-docker, static-php-cli will automatically download the Alpine Linux image and then build a cwcc-spc-x86_64 or cwcc-spc-aarch64 image. Then all build process is performed within this image, which is equivalent to compiling in Alpine Linux.

musl-cross-make Toolchain Compilation

In Linux, although you do not need to manually compile the musl-cross-make tool, if you want to understand its compilation process, you can refer here. Another important reason is that this may not be compiled using automated tools such as CI and Actions, because the existing CI service compilation environment does not meet the compilation requirements of musl-cross-make, and the configuration that meets the requirements is too expensive.

The compilation process of musl-cross-make is as follows:

Prepare an Alpine Linux environment (either directly installed or using Docker). The compilation process requires more than 36GB of memory, so you need to compile on a machine with larger memory. Without this much memory, compilation may fail.

Then write the following content into the config.mak file:

makefile
STAT = -static --static
 FLAG = -g0 -Os -Wno-error
 
 ifneq ($(NATIVE),)
@@ -39,7 +40,7 @@
 GMP_VER = 6.2.1
 MPC_VER = 1.2.1
 MPFR_VER = 4.2.0
-LINUX_VER = 6.1.36

And also you need to add gcc-13.2.0.tar.xz.sha1 file, contents here:

5f95b6d042fb37d45c6cbebfc91decfbc4fb493c  gcc-13.2.0.tar.xz

If you are using Docker to build, create a new Dockerfile file and write the following content:

dockerfile
FROM alpine:edge
+LINUX_VER = 6.1.36

And also you need to add gcc-13.2.0.tar.xz.sha1 file, contents here:

5f95b6d042fb37d45c6cbebfc91decfbc4fb493c  gcc-13.2.0.tar.xz

If you are using Docker to build, create a new Dockerfile file and write the following content:

dockerfile
FROM alpine:edge
 
 RUN apk add --no-cache \
 gcc g++ git make curl perl \
@@ -63,7 +64,7 @@
 RUN sed -i 's/poison calloc/poison/g' ./gcc-13.2.0/gcc/system.h
 RUN make TARGET=x86_64-linux-musl -j
 RUN make TARGET=x86_64-linux-musl install -j
-RUN tar cvzf x86_64-musl-toolchain.tgz output/*

If you are using Alpine Linux in a non-Docker environment, you can directly execute the commands in the Dockerfile, for example:

bash
apk add --no-cache \
+RUN tar cvzf x86_64-musl-toolchain.tgz output/*

If you are using Alpine Linux in a non-Docker environment, you can directly execute the commands in the Dockerfile, for example:

bash
apk add --no-cache \
 gcc g++ git make curl perl \
 rsync patch wget libtool \
 texinfo autoconf automake \
@@ -84,8 +85,8 @@
 sed -i 's/poison calloc/poison/g' ./gcc-13.2.0/gcc/system.h
 make TARGET=x86_64-linux-musl -j
 make TARGET=x86_64-linux-musl install -j
-tar cvzf x86_64-musl-toolchain.tgz output/*

TIP

All the above scripts are suitable for x86_64 architecture Linux. If you need to build musl-cross-make for the ARM environment, just replace all x86_64 above with aarch64.

This compilation process may fail due to insufficient memory, network problems, etc. You can try a few more times, or use a machine with larger memory to compile. If you encounter problems or you have better improvement solutions, go to Discussion.

macOS Environment

For macOS systems, the main compilation tool we use is clang, which is the default compiler for macOS systems and is also the compiler of Xcode.

Compiling under macOS mainly relies on Xcode or Xcode Command Line Tools. You can download Xcode from the App Store, or execute xcode-select --install in the terminal to install Xcode Command Line Tools.

In addition, in the doctor environment check module, static-php-cli will check whether Homebrew, compilation tools, etc. are installed on the macOS system. If not, you will be prompted to install them. I will not go into details here.

FreeBSD Environment

FreeBSD is also a Unix system, and its compilation tools are similar to macOS. You can directly use the package management pkg to install clang and other compilation tools through the doctor command.

pkg-config Compilation (*nix only)

If you observe the compilation log when using static-php-cli to build static PHP, you will find that no matter what is compiled, pkg-config will be compiled first. This is because pkg-config is a library used to find dependencies. In earlier versions of static-php-cli, we directly used the pkg-config tool installed by package management, but this would cause some problems, such as:

  • Even if PKG_CONFIG_PATH is specified, pkg-config will try to find dependent packages from the system path.
  • Since pkg-config will look for dependent packages from the system path, if a dependent package with the same name exists in the system, compilation may fail.

In order to avoid the above problems, we compile pkg-config into buildroot/bin in user mode and use it. We use parameters such as --without-sysroot to avoid looking for dependent packages from the system path.

Released under the MIT License.

- +tar cvzf x86_64-musl-toolchain.tgz output/*

TIP

All the above scripts are suitable for x86_64 architecture Linux. If you need to build musl-cross-make for the ARM environment, just replace all x86_64 above with aarch64.

This compilation process may fail due to insufficient memory, network problems, etc. You can try a few more times, or use a machine with larger memory to compile. If you encounter problems or you have better improvement solutions, go to Discussion.

macOS Environment

For macOS systems, the main compilation tool we use is clang, which is the default compiler for macOS systems and is also the compiler of Xcode.

Compiling under macOS mainly relies on Xcode or Xcode Command Line Tools. You can download Xcode from the App Store, or execute xcode-select --install in the terminal to install Xcode Command Line Tools.

In addition, in the doctor environment check module, static-php-cli will check whether Homebrew, compilation tools, etc. are installed on the macOS system. If not, you will be prompted to install them. I will not go into details here.

FreeBSD Environment

FreeBSD is also a Unix system, and its compilation tools are similar to macOS. You can directly use the package management pkg to install clang and other compilation tools through the doctor command.

pkg-config Compilation (*nix only)

If you observe the compilation log when using static-php-cli to build static PHP, you will find that no matter what is compiled, pkg-config will be compiled first. This is because pkg-config is a library used to find dependencies. In earlier versions of static-php-cli, we directly used the pkg-config tool installed by package management, but this would cause some problems, such as:

  • Even if PKG_CONFIG_PATH is specified, pkg-config will try to find dependent packages from the system path.
  • Since pkg-config will look for dependent packages from the system path, if a dependent package with the same name exists in the system, compilation may fail.

In order to avoid the above problems, we compile pkg-config into buildroot/bin in user mode and use it. We use parameters such as --without-sysroot to avoid looking for dependent packages from the system path.

Released under the MIT License.

+ \ No newline at end of file diff --git a/en/faq/index.html b/en/faq/index.html index 2dd4bd4a..2ec26764 100644 --- a/en/faq/index.html +++ b/en/faq/index.html @@ -5,24 +5,25 @@ FAQ | static-php-cli - - + + + - + - - - + + + -
Skip to content

FAQ

Here will be some questions that you may encounter easily. There are currently many, but I need to take time to organize them.

What is the path of php.ini ?

On Linux, macOS and FreeBSD, the path of php.ini is /usr/local/etc/php/php.ini. On Windows, the path is C:\windows\php.ini or the current directory of php.exe. The directory where to look for php.ini can be changed on *nix using the manual build option --with-config-file-path.

In addition, on Linux, macOS and FreeBSD, .ini files present in the /usr/local/etc/php/conf.d directory will also be loaded. On Windows, this path is empty by default. The directory can be changed using the manual build option --with-config-file-scan-dir.

php.ini will also be searched for in the other standard locations.

Can statically-compiled PHP install extensions?

Because the principle of installing PHP extensions under the normal mode is to use .so type dynamic link library to install new extensions, and we use the static link PHP compiled by this project. However, static linking has different definitions in different operating systems.

First of all, for Linux systems, statically linked binaries will not link the system's dynamic link library. Purely statically linked binaries (build with -all-static) cannot load dynamic libraries, so new extensions cannot be added. At the same time, in pure static mode, you cannot use extensions such as ffi to load external .so modules.

You can use the command ldd buildroot/bin/php to check whether the binary you built under Linux is purely statically linked.

If you build GNU libc based PHP, you can use the ffi extension to load external .so modules and load .so extensions with the same ABI.

For example, you can use the following command to build a static PHP binary dynamically linked with glibc, supporting FFI extensions and loading the xdebug.so extension of the same PHP version and the same TS type:

bash
bin/spc-gnu-docker download --for-extensions=ffi,xml --with-php=8.4
+    
Skip to content

FAQ

Here will be some questions that you may encounter easily. There are currently many, but I need to take time to organize them.

What is the path of php.ini ?

On Linux, macOS and FreeBSD, the path of php.ini is /usr/local/etc/php/php.ini. On Windows, the path is C:\windows\php.ini or the current directory of php.exe. The directory where to look for php.ini can be changed on *nix using the manual build option --with-config-file-path.

In addition, on Linux, macOS and FreeBSD, .ini files present in the /usr/local/etc/php/conf.d directory will also be loaded. On Windows, this path is empty by default. The directory can be changed using the manual build option --with-config-file-scan-dir.

php.ini will also be searched for in the other standard locations.

Can statically-compiled PHP install extensions?

Because the principle of installing PHP extensions under the normal mode is to use .so type dynamic link library to install new extensions, and we use the static link PHP compiled by this project. However, static linking has different definitions in different operating systems.

First of all, for Linux systems, statically linked binaries will not link the system's dynamic link library. Purely statically linked binaries (build with -all-static) cannot load dynamic libraries, so new extensions cannot be added. At the same time, in pure static mode, you cannot use extensions such as ffi to load external .so modules.

You can use the command ldd buildroot/bin/php to check whether the binary you built under Linux is purely statically linked.

If you build GNU libc based PHP, you can use the ffi extension to load external .so modules and load .so extensions with the same ABI.

For example, you can use the following command to build a static PHP binary dynamically linked with glibc, supporting FFI extensions and loading the xdebug.so extension of the same PHP version and the same TS type:

bash
bin/spc-gnu-docker download --for-extensions=ffi,xml --with-php=8.4
 bin/spc-gnu-docker build ffi,xml --build-cli --debug
 
-buildroot/bin/php -d "zend_extension=/path/to/php{PHP_VER}-{ts/nts}/xdebug.so" --ri xdebug

For macOS platform, almost all binaries under macOS cannot be truly purely statically linked, and almost all binaries will link macOS system libraries: /usr/lib/libresolv.9.dylib and /usr/lib/libSystem.B.dylib. So on macOS, you can use statically compiled PHP binaries under certain compilation conditions, and dynamically linked extensions:

  1. Using the --no-strip parameter will not strip information such as debugging symbols from the binary file for use with external Zend extensions such as Xdebug.
  2. If you want to compile some Zend extensions, use Homebrew, MacPorts, source code compilation, and install a normal version of PHP on your operating system.
  3. Use the phpize && ./configure && make command to compile the extensions you want to use.
  4. Copy the extension file xxxx.so to the outside, use the statically compiled PHP binary, for example to use the Xdebug extension: cd buildroot/bin/ && ./php -d "zend_extension=/path/to/xdebug.so".
bash
# build statically linked php-cli but not stripped
-bin/spc build ffi --build-cli --no-strip

Can it support Oracle database extension?

Some extensions that rely on closed source libraries, such as oci8, sourceguardian, etc., they do not provide purely statically compiled dependent library files (.a), only dynamic dependent library files (.so). These extensions cannot be compiled into static-php-cli using source code, so this project may never support these extensions. However, in theory you can access and use such extensions under macOS and Linux according to the above questions.

If you have a need for such extensions, or most people have needs for these closed-source extensions, see the discussion on standalone-php-cli. Welcome to leave a message.

Does it support Windows?

The project currently supports Windows, but the number of supported extensions is small. Windows support is not perfect. There are mainly the following problems:

  1. The compilation process of Windows is different from that of *nix, and the toolchain used is also different. The compilation tools used to compile the dependent libraries of each extension are almost completely different.
  2. The demand for the Windows version will also be advanced based on the needs of all people who use this project. If many people need it, I will support related extensions as soon as possible.

Can I protect my source code with micro?

You can't. micro.sfx is essentially combining php and php code into one file, there is no process of compiling or encrypting the PHP code.

First of all, php-src is the official interpreter of PHP code, and there is no PHP compiler compatible with mainstream branches on the market. I saw on the Internet that there is a project called BPC (Binary PHP Compiler?) that can compile PHP into binary, but there are many restrictions.

The direction of encrypting and protecting the code is not the same as compiling. After compiling, the code can also be obtained through reverse engineering and other methods. The real protection is still carried out by means of packing and encrypting the code.

Therefore, this project (static-php-cli) and related projects (lwmbs, swoole-cli) all provide a convenient compilation tool for php-src source code. The phpmicro referenced by this project and related projects is only a package of PHP's sapi interface, not a compilation tool for PHP code. The compiler for PHP code is a completely different project, so the extra cases are not taken into account. If you are interested in encryption, you can consider using existing encryption technologies, such as Swoole Compiler, Source Guardian, etc.

Unable to use ssl

Update: This issue has been fixed in the latest version of static-php-cli, which now reads the system's certificate file by default. If you still have problems, try the solution below.

When using curl, pgsql, etc. to request an HTTPS website or establish an SSL connection, there may be an error:80000002:system library::No such file or directory error. This error is caused by statically compiled PHP without specifying openssl.cafile via php.ini.

You can solve this problem by specifying php.ini before using PHP and adding openssl.cafile=/path/to/your-cert.pem in the INI.

For Linux systems, you can download the cacert.pem file from the curl official website, or you can use the certificate file that comes with the system. For the certificate locations of different distros, please refer to Golang docs.

INI configuration openssl.cafile cannot be set dynamically using the ini_set() function, because openssl.cafile is a PHP_INI_SYSTEM type configuration and can only be set in the php.ini file.

Why don't we support older versions of PHP?

Because older versions of PHP have many problems, such as security issues, performance issues, and functional issues. In addition, many older versions of PHP are not compatible with the latest dependency libraries, which is one of the reasons why older versions of PHP are not supported.

You can use older versions compiled earlier by static-php-cli, such as PHP 8.0, but earlier versions will not be explicitly supported.

Released under the MIT License.

- +buildroot/bin/php -d "zend_extension=/path/to/php{PHP_VER}-{ts/nts}/xdebug.so" --ri xdebug

For macOS platform, almost all binaries under macOS cannot be truly purely statically linked, and almost all binaries will link macOS system libraries: /usr/lib/libresolv.9.dylib and /usr/lib/libSystem.B.dylib. So on macOS, you can use statically compiled PHP binaries under certain compilation conditions, and dynamically linked extensions:

  1. Using the --no-strip parameter will not strip information such as debugging symbols from the binary file for use with external Zend extensions such as Xdebug.
  2. If you want to compile some Zend extensions, use Homebrew, MacPorts, source code compilation, and install a normal version of PHP on your operating system.
  3. Use the phpize && ./configure && make command to compile the extensions you want to use.
  4. Copy the extension file xxxx.so to the outside, use the statically compiled PHP binary, for example to use the Xdebug extension: cd buildroot/bin/ && ./php -d "zend_extension=/path/to/xdebug.so".
bash
# build statically linked php-cli but not stripped
+bin/spc build ffi --build-cli --no-strip

Can it support Oracle database extension?

Some extensions that rely on closed source libraries, such as oci8, sourceguardian, etc., they do not provide purely statically compiled dependent library files (.a), only dynamic dependent library files (.so). These extensions cannot be compiled into static-php-cli using source code, so this project may never support these extensions. However, in theory you can access and use such extensions under macOS and Linux according to the above questions.

If you have a need for such extensions, or most people have needs for these closed-source extensions, see the discussion on standalone-php-cli. Welcome to leave a message.

Does it support Windows?

The project currently supports Windows, but the number of supported extensions is small. Windows support is not perfect. There are mainly the following problems:

  1. The compilation process of Windows is different from that of *nix, and the toolchain used is also different. The compilation tools used to compile the dependent libraries of each extension are almost completely different.
  2. The demand for the Windows version will also be advanced based on the needs of all people who use this project. If many people need it, I will support related extensions as soon as possible.

Can I protect my source code with micro?

You can't. micro.sfx is essentially combining php and php code into one file, there is no process of compiling or encrypting the PHP code.

First of all, php-src is the official interpreter of PHP code, and there is no PHP compiler compatible with mainstream branches on the market. I saw on the Internet that there is a project called BPC (Binary PHP Compiler?) that can compile PHP into binary, but there are many restrictions.

The direction of encrypting and protecting the code is not the same as compiling. After compiling, the code can also be obtained through reverse engineering and other methods. The real protection is still carried out by means of packing and encrypting the code.

Therefore, this project (static-php-cli) and related projects (lwmbs, swoole-cli) all provide a convenient compilation tool for php-src source code. The phpmicro referenced by this project and related projects is only a package of PHP's sapi interface, not a compilation tool for PHP code. The compiler for PHP code is a completely different project, so the extra cases are not taken into account. If you are interested in encryption, you can consider using existing encryption technologies, such as Swoole Compiler, Source Guardian, etc.

Unable to use ssl

Update: This issue has been fixed in the latest version of static-php-cli, which now reads the system's certificate file by default. If you still have problems, try the solution below.

When using curl, pgsql, etc. to request an HTTPS website or establish an SSL connection, there may be an error:80000002:system library::No such file or directory error. This error is caused by statically compiled PHP without specifying openssl.cafile via php.ini.

You can solve this problem by specifying php.ini before using PHP and adding openssl.cafile=/path/to/your-cert.pem in the INI.

For Linux systems, you can download the cacert.pem file from the curl official website, or you can use the certificate file that comes with the system. For the certificate locations of different distros, please refer to Golang docs.

INI configuration openssl.cafile cannot be set dynamically using the ini_set() function, because openssl.cafile is a PHP_INI_SYSTEM type configuration and can only be set in the php.ini file.

Why don't we support older versions of PHP?

Because older versions of PHP have many problems, such as security issues, performance issues, and functional issues. In addition, many older versions of PHP are not compatible with the latest dependency libraries, which is one of the reasons why older versions of PHP are not supported.

You can use older versions compiled earlier by static-php-cli, such as PHP 8.0, but earlier versions will not be explicitly supported.

Released under the MIT License.

+ \ No newline at end of file diff --git a/en/guide/action-build.html b/en/guide/action-build.html index c42c3d4e..45cfc437 100644 --- a/en/guide/action-build.html +++ b/en/guide/action-build.html @@ -5,20 +5,21 @@ GitHub Action Build | static-php-cli - - + + + - + - - - + + + -
Skip to content

GitHub Action Build

Action Build refers to compiling directly using GitHub Action.

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:Enter.

Self-hosted binaries are also built from Actions: repo. 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

Build Guide

Using GitHub Action makes it easy to build a statically compiled PHP and phpmicro, while also defining the extensions to compile.

  1. Fork project.
  2. Go to the Actions of the project and select CI.
  3. Select Run workflow, fill in the PHP version you want to compile, the target type, and the list of extensions. (extensions comma separated, e.g. bcmath,curl,mbstring)
  4. After waiting for about a period of time, enter the corresponding task and get Artifacts.

If you enable debug, all logs will be output at build time, including compiled logs, for troubleshooting.

If you need to build in other environments, you can use manual build.

Extensions

You can go to extensions check here to see if all the extensions you need currently support. and then go to command generator select the extension you need to compile, copy the extensions string to extensions option.

Released under the MIT License.

- +
Skip to content

GitHub Action Build

Action Build refers to compiling directly using GitHub Action.

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:Enter.

Self-hosted binaries are also built from Actions: repo. 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

Build Guide

Using GitHub Action makes it easy to build a statically compiled PHP and phpmicro, while also defining the extensions to compile.

  1. Fork project.
  2. Go to the Actions of the project and select CI.
  3. Select Run workflow, fill in the PHP version you want to compile, the target type, and the list of extensions. (extensions comma separated, e.g. bcmath,curl,mbstring)
  4. After waiting for about a period of time, enter the corresponding task and get Artifacts.

If you enable debug, all logs will be output at build time, including compiled logs, for troubleshooting.

If you need to build in other environments, you can use manual build.

Extensions

You can go to extensions check here to see if all the extensions you need currently support. and then go to command generator select the extension you need to compile, copy the extensions string to extensions option.

Released under the MIT License.

+ \ No newline at end of file diff --git a/en/guide/build-on-windows.html b/en/guide/build-on-windows.html index 1ca7bf51..9d3a3f89 100644 --- a/en/guide/build-on-windows.html +++ b/en/guide/build-on-windows.html @@ -5,22 +5,23 @@ Build on Windows | static-php-cli - - + + + - + - - - + + + -
Skip to content

Build on Windows

Because the Windows system is an NT kernel, the compilation tools and operating system interfaces used by Unix-like operating systems are almost completely different, so the build process on Windows will be slightly different from that of Unix systems.

GitHub Actions Build

Building the Windows version of static-php from Actions is now supported. Like Linux and macOS, you need to Fork the static-php-cli repository to your GitHub account first, then you can enter Extension List to select the extension to be compiled, and then go to your own CI on Windows select the PHP version, fill in the extension list (comma separated), and click Run.

If you're going to develop or build locally, please read on.

Requirements

The tools required to build static PHP on Windows are the same as PHP's official Windows build tools. You can read Official Documentation.

To sum up, you need the following environment and tools:

  • Windows 10/11 (requires build 17063 or later)
  • Visual Studio 2019/2022 (recommended 2022)
  • C++ desktop development for Visual Studio
  • Git for Windows
  • php-sdk-binary-tools (can be installed automatically using doctor)
  • strawberry-perl (can be installed automatically using doctor)
  • nasm (can be installed automatically using doctor)

TIP

The construction of static-php-cli on Windows refers to using MSVC to build PHP and is not based on MinGW, Cygwin, WSL and other environments.

If you prefer to use WSL, please refer to the chapter on Building on Linux.

After installing Visual Studio and selecting the C++ desktop development workload, you may download about 8GB of compilation tools, and the download speed depends on your network conditions.

Install Git

Git for Windows can be downloaded and installed from here Standalone Installer 64-bit version, installed in the default location (C:\Program Files\Git\). If you don't want to download and install manually, you can also use Visual Studio Installer and check Git in the Individual component tab.

Prepare static-php-cli

Downloading the static-php-cli project is very simple, just use git clone. It is recommended to place the project in C:\spc-build\ or a similar directory. It is best not to have spaces in the path.

shell
mkdir "C:\spc-build"
+    
Skip to content

Build on Windows

Because the Windows system is an NT kernel, the compilation tools and operating system interfaces used by Unix-like operating systems are almost completely different, so the build process on Windows will be slightly different from that of Unix systems.

GitHub Actions Build

Building the Windows version of static-php from Actions is now supported. Like Linux and macOS, you need to Fork the static-php-cli repository to your GitHub account first, then you can enter Extension List to select the extension to be compiled, and then go to your own CI on Windows select the PHP version, fill in the extension list (comma separated), and click Run.

If you're going to develop or build locally, please read on.

Requirements

The tools required to build static PHP on Windows are the same as PHP's official Windows build tools. You can read Official Documentation.

To sum up, you need the following environment and tools:

  • Windows 10/11 (requires build 17063 or later)
  • Visual Studio 2019/2022 (recommended 2022)
  • C++ desktop development for Visual Studio
  • Git for Windows
  • php-sdk-binary-tools (can be installed automatically using doctor)
  • strawberry-perl (can be installed automatically using doctor)
  • nasm (can be installed automatically using doctor)

TIP

The construction of static-php-cli on Windows refers to using MSVC to build PHP and is not based on MinGW, Cygwin, WSL and other environments.

If you prefer to use WSL, please refer to the chapter on Building on Linux.

After installing Visual Studio and selecting the C++ desktop development workload, you may download about 8GB of compilation tools, and the download speed depends on your network conditions.

Install Git

Git for Windows can be downloaded and installed from here Standalone Installer 64-bit version, installed in the default location (C:\Program Files\Git\). If you don't want to download and install manually, you can also use Visual Studio Installer and check Git in the Individual component tab.

Prepare static-php-cli

Downloading the static-php-cli project is very simple, just use git clone. It is recommended to place the project in C:\spc-build\ or a similar directory. It is best not to have spaces in the path.

shell
mkdir "C:\spc-build"
 cd C:\spc-build
 git clone https://github.com/crazywhalecc/static-php-cli.git
-cd static-php-cli

It is a bit strange that static-php-cli itself requires a PHP environment, but now you can quickly install the PHP environment through a script. Generally, your computer will not have the Windows version of PHP installed, so we recommend that you use bin/setup-runtime directly after downloading static-php-cli to install PHP and Composer in the current directory.

shell
# Install PHP and Composer to the ./runtime/ directory
+cd static-php-cli

It is a bit strange that static-php-cli itself requires a PHP environment, but now you can quickly install the PHP environment through a script. Generally, your computer will not have the Windows version of PHP installed, so we recommend that you use bin/setup-runtime directly after downloading static-php-cli to install PHP and Composer in the current directory.

shell
# Install PHP and Composer to the ./runtime/ directory
 bin/setup-runtime
 
 # After installation, if you need to use PHP and Composer in global commands, 
@@ -28,19 +29,19 @@
 bin/setup-runtime -action add-path
 
 # Delete the runtime/ directory in PATH
-bin/setup-runtime -action remove-path

Finally, now that you have PHP and Composer installed, you need to install static-php-cli's Composer dependencies:

shell
composer install

Install other Tools (automatic)

For php-sdk-binary-tools, strawberry-perl, and nasm, we recommend that you directly use the command bin/spc doctor to check and install them.

If doctor successfully installs automatically, please skip the steps below to manually install the above tools.

But if the automatic installation fails, please refer to the manual installation method below.

Install php-sdk-binary-tools (manual)

shell
cd C:\spc-build\static-php-cli
-git clone https://github.com/php/php-sdk-binary-tools.git

You can also set the global variable PHP_SDK_PATH in Windows settings and clone the project to the path corresponding to the variable. Under normal circumstances, you don't need to change it.

Install strawberry-perl (manual)

If you don't need to compile the openssl extension, you don't need to install perl.

  1. Download the latest version of strawberry-perl from GitHub.
  2. Install to the C:\spc-build\static-php-cli\pkgroot\perl\ directory.

You can download the -portable version and extract it directly to the above directory. The last perl.exe should be located at C:\spc-build\static-php-cli\pkgroot\perl\perl\bin\perl.exe.

Install nasm (manual)

If you don't need to compile openssl extension, you don't need to install nasm.

  1. Download the nasm tool (x64) from official website.
  2. Place nasm.exe and ndisasm.exe in the C:\spc-build\static-php-cli\php-sdk-binary-tools\bin\ directory.

Download required sources

Same as Manual build - Download

Build PHP

Use the build command to start building the static php binary. Before executing the bin/spc build command, be sure to use the download command to download sources. It is recommended to use doctor to check the environment.

Build SAPI

You need to go to Extension List or Command Generator to select the extension you want to add, and then use the command bin/spc build to compile. You need to specify targets, choose from the following parameters (at least one):

  • --build-cli: Build a cli sapi (command line interface, which can execute PHP code on the command line)
  • --build-micro: Build a micro sapi (used to build a standalone executable binary containing PHP code)
shell
# Compile PHP with bcmath,openssl,zlib extensions, the compilation target is cli
+bin/setup-runtime -action remove-path

Finally, now that you have PHP and Composer installed, you need to install static-php-cli's Composer dependencies:

shell
composer install

Install other Tools (automatic)

For php-sdk-binary-tools, strawberry-perl, and nasm, we recommend that you directly use the command bin/spc doctor to check and install them.

If doctor successfully installs automatically, please skip the steps below to manually install the above tools.

But if the automatic installation fails, please refer to the manual installation method below.

Install php-sdk-binary-tools (manual)

shell
cd C:\spc-build\static-php-cli
+git clone https://github.com/php/php-sdk-binary-tools.git

You can also set the global variable PHP_SDK_PATH in Windows settings and clone the project to the path corresponding to the variable. Under normal circumstances, you don't need to change it.

Install strawberry-perl (manual)

If you don't need to compile the openssl extension, you don't need to install perl.

  1. Download the latest version of strawberry-perl from GitHub.
  2. Install to the C:\spc-build\static-php-cli\pkgroot\perl\ directory.

You can download the -portable version and extract it directly to the above directory. The last perl.exe should be located at C:\spc-build\static-php-cli\pkgroot\perl\perl\bin\perl.exe.

Install nasm (manual)

If you don't need to compile openssl extension, you don't need to install nasm.

  1. Download the nasm tool (x64) from official website.
  2. Place nasm.exe and ndisasm.exe in the C:\spc-build\static-php-cli\php-sdk-binary-tools\bin\ directory.

Download required sources

Same as Manual build - Download

Build PHP

Use the build command to start building the static php binary. Before executing the bin/spc build command, be sure to use the download command to download sources. It is recommended to use doctor to check the environment.

Build SAPI

You need to go to Extension List or Command Generator to select the extension you want to add, and then use the command bin/spc build to compile. You need to specify targets, choose from the following parameters (at least one):

  • --build-cli: Build a cli sapi (command line interface, which can execute PHP code on the command line)
  • --build-micro: Build a micro sapi (used to build a standalone executable binary containing PHP code)
shell
# Compile PHP with bcmath,openssl,zlib extensions, the compilation target is cli
 bin/spc build "bcmath,openssl,zlib" --build-cli
 
 # Compile PHP with phar,curl,posix,pcntl,tokenizer extensions, compile target is micro and cli
-bin/spc build "bcmath,openssl,zlib" --build-micro --build-cli

WARNING

In Windows, it is best to use double quotes to wrap parameters containing commas, such as "bcmath,openssl,mbstring".

Debug

If you encounter problems during the compilation process, or want to view each executing shell command, you can use --debug to enable debug mode and view all terminal logs:

shell
bin/spc build "openssl" --build-cli --debug

Build Options

During the compilation process, in some special cases, the compiler and the content of the compilation directory need to be intervened. You can try to use the following commands:

  • --with-clean: clean up old make files before compiling PHP
  • --enable-zts: Make compiled PHP thread-safe version (default is NTS version)
  • --with-libs=XXX,YYY: Compile the specified dependent library before compiling PHP, and activate some extension optional functions
  • --with-config-file-scan-dir=XXX: Set the directory to scan for .ini files after reading php.ini (Check here for default paths)
  • -I xxx=yyy: Hard compile INI options into PHP before compiling (support multiple options, alias is --with-hardcoded-ini)
  • --with-micro-fake-cli: When compiling micro, let micro's PHP_SAPI pretend to be cli (for compatibility with some programs that check PHP_SAPI)
  • --disable-opcache-jit: Disable opcache jit (enabled by default)
  • --without-micro-ext-test: After building micro.sfx, do not test the running results of different extensions in micro.sfx
  • --with-suggested-exts: Add ext-suggests as dependencies when compiling
  • --with-suggested-libs: Add lib-suggests as dependencies when compiling
  • --with-upx-pack: Use UPX to reduce the size of the binary file after compilation (you need to use bin/spc install-pkg upx to install upx first)
  • --with-micro-logo=XXX.ico: Customize the icon of the exe executable file after customizing the micro build (in the format of .ico)

Here is a simple example where we preset a larger memory_limit and disable the system function:

shell
bin/spc build "bcmath,openssl" --build-cli -I "memory_limit=4G" -I "disable_functions=system"

Another example: Customize our hello-world.exe program logo:

shell
bin/spc build "ffi,bcmath" --build-micro --with-micro-logo=mylogo.ico --debug
+bin/spc build "bcmath,openssl,zlib" --build-micro --build-cli

WARNING

In Windows, it is best to use double quotes to wrap parameters containing commas, such as "bcmath,openssl,mbstring".

Debug

If you encounter problems during the compilation process, or want to view each executing shell command, you can use --debug to enable debug mode and view all terminal logs:

shell
bin/spc build "openssl" --build-cli --debug

Build Options

During the compilation process, in some special cases, the compiler and the content of the compilation directory need to be intervened. You can try to use the following commands:

  • --with-clean: clean up old make files before compiling PHP
  • --enable-zts: Make compiled PHP thread-safe version (default is NTS version)
  • --with-libs=XXX,YYY: Compile the specified dependent library before compiling PHP, and activate some extension optional functions
  • --with-config-file-scan-dir=XXX: Set the directory to scan for .ini files after reading php.ini (Check here for default paths)
  • -I xxx=yyy: Hard compile INI options into PHP before compiling (support multiple options, alias is --with-hardcoded-ini)
  • --with-micro-fake-cli: When compiling micro, let micro's PHP_SAPI pretend to be cli (for compatibility with some programs that check PHP_SAPI)
  • --disable-opcache-jit: Disable opcache jit (enabled by default)
  • --without-micro-ext-test: After building micro.sfx, do not test the running results of different extensions in micro.sfx
  • --with-suggested-exts: Add ext-suggests as dependencies when compiling
  • --with-suggested-libs: Add lib-suggests as dependencies when compiling
  • --with-upx-pack: Use UPX to reduce the size of the binary file after compilation (you need to use bin/spc install-pkg upx to install upx first)
  • --with-micro-logo=XXX.ico: Customize the icon of the exe executable file after customizing the micro build (in the format of .ico)

Here is a simple example where we preset a larger memory_limit and disable the system function:

shell
bin/spc build "bcmath,openssl" --build-cli -I "memory_limit=4G" -I "disable_functions=system"

Another example: Customize our hello-world.exe program logo:

shell
bin/spc build "ffi,bcmath" --build-micro --with-micro-logo=mylogo.ico --debug
 bin/spc micro:combine hello.php
 # Then we got `my-app.exe` with custom logo!
-my-app.exe

Use php.exe

After php.exe is compiled, it is located in the buildroot\bin\ directory. You can copy it to any location for use.

shell
.\php -v

Use micro.sfx

phpmicro is a SelF-extracted eXecutable SAPI module, provided by phpmicro project. But this project is using a fork of phpmicro, because we need to add some features to it. It can put php runtime and your source code together.

The final compilation result will output a file named ./micro.sfx, which needs to be used with your PHP source code like code.php. This file will be located in the path buildroot/bin/micro.sfx.

Prepare your project source code, which can be a single PHP file or a Phar file, for use.

If you want to combine phar files, you must add phar extension when compiling!

shell
# code.php "<?php echo 'Hello world' . PHP_EOL;"
+my-app.exe

Use php.exe

After php.exe is compiled, it is located in the buildroot\bin\ directory. You can copy it to any location for use.

shell
.\php -v

Use micro.sfx

phpmicro is a SelF-extracted eXecutable SAPI module, provided by phpmicro project. But this project is using a fork of phpmicro, because we need to add some features to it. It can put php runtime and your source code together.

The final compilation result will output a file named ./micro.sfx, which needs to be used with your PHP source code like code.php. This file will be located in the path buildroot/bin/micro.sfx.

Prepare your project source code, which can be a single PHP file or a Phar file, for use.

If you want to combine phar files, you must add phar extension when compiling!

shell
# code.php "<?php echo 'Hello world' . PHP_EOL;"
 bin/spc micro:combine code.php -O my-app.exe
 # Run it!!! Copy it to another computer!!!
-./my-app.exe

If you package a PHAR file, just replace code.php with the phar file path. You can use box-project/box to package your CLI project as Phar, It is then combined with phpmicro to produce a standalone executable binary.

For more details on the micro:combine command, refer to command on Unix systems.

Released under the MIT License.

- +./my-app.exe

If you package a PHAR file, just replace code.php with the phar file path. You can use box-project/box to package your CLI project as Phar, It is then combined with phpmicro to produce a standalone executable binary.

For more details on the micro:combine command, refer to command on Unix systems.

Released under the MIT License.

+ \ No newline at end of file diff --git a/en/guide/build-with-glibc.html b/en/guide/build-with-glibc.html index d9a37db2..110d4d3f 100644 --- a/en/guide/build-with-glibc.html +++ b/en/guide/build-with-glibc.html @@ -5,20 +5,21 @@ Build glibc Compatible Linux Binary | static-php-cli - - + + + - + - - - + + + -
Skip to content

Build glibc Compatible Linux Binary

Why Build glibc Compatible Binary

Currently, the binaries built by static-php-cli on Linux by default are based on musl-libc (statically linked). musl-libc is a lightweight libc implementation that aims to be compatible with glibc and provides good support for pure static linking. This means that the compiled static PHP executable can be used on almost any Linux distribution without worrying about the versions of libc, libstdc++, etc.

However, there are some issues with pure static linking of musl-libc binaries on Linux:

  • The dl() function in PHP cannot be used to load dynamic libraries and external PHP extensions.
  • The FFI extension in PHP cannot be used.
  • In some extreme cases, performance issues may occur. See musl-libc performance issues.

Different Linux distributions use different default libc. For example, Alpine Linux uses musl libc, while most Linux distributions use glibc. However, even so, we cannot directly use any distribution using glibc to build portable static binaries because glibc has some issues:

  • Binaries built with gcc and other tools on newer versions of distributions cannot run on older versions of distributions.
  • glibc is not recommended to be statically linked because some of its features require the support of dynamic libraries.

However, we can use Docker to solve this problem. The final output is a binary dynamically linked with glibc and some necessary libraries, but statically linked with all other dependencies.

  1. Use an older version of a Linux distribution (such as CentOS 7.x), which has an older version of glibc but can run on most modern Linux distributions.
  2. Build the static binary of PHP in this container so that it can run on most modern Linux distributions.

Using glibc static binaries can run on most modern Linux distributions but cannot run on musl libc distributions, such as CentOS 6, Alpine Linux, etc.

Build glibc Compatible Linux Binary

The latest version of static-php-cli includes the bin/spc-gnu-docker script, which can create a CentOS 7.x (glibc-2.17) Docker container with one click and build a glibc compatible PHP static binary in the container.

Then, run the following command once. The first run will take a long time because it needs to download the CentOS 7.x image and some build tools.

bash
bin/spc-gnu-docker

After the image is built, you will see the same command help menu as bin/spc, which means the container is ready.

After the container is ready, you can refer to the local build section to build your PHP static binary. Just replace bin/spc or ./spc with bin/spc-gnu-docker.

bash
bin/spc-gnu-docker build bcmath,ctype,openssl,pdo,phar,posix,session,tokenizer,xml,zip --build-cli --debug

Notes

In rare cases, glibc-based static PHP may encounter segment faults and other errors, but there are currently few examples. If you encounter any issues, please submit an issue.

glibc build is an extended feature and is not part of the default static-php support. If you have related issues or requirements, please indicate that you are building based on glibc when submitting an issue.

If you need to build glibc-based binaries without using Docker, please refer to the bin/spc-gnu-docker script to manually create a similar environment.

Since glibc binaries are not the main goal of the project, we generally do not test the compatibility of various libraries and extensions under glibc. If any specific library builds successfully on musl-libc but fails on glibc, please submit an issue.

Released under the MIT License.

- +
Skip to content

Build glibc Compatible Linux Binary

Why Build glibc Compatible Binary

Currently, the binaries built by static-php-cli on Linux by default are based on musl-libc (statically linked). musl-libc is a lightweight libc implementation that aims to be compatible with glibc and provides good support for pure static linking. This means that the compiled static PHP executable can be used on almost any Linux distribution without worrying about the versions of libc, libstdc++, etc.

However, there are some issues with pure static linking of musl-libc binaries on Linux:

  • The dl() function in PHP cannot be used to load dynamic libraries and external PHP extensions.
  • The FFI extension in PHP cannot be used.
  • In some extreme cases, performance issues may occur. See musl-libc performance issues.

Different Linux distributions use different default libc. For example, Alpine Linux uses musl libc, while most Linux distributions use glibc. However, even so, we cannot directly use any distribution using glibc to build portable static binaries because glibc has some issues:

  • Binaries built with gcc and other tools on newer versions of distributions cannot run on older versions of distributions.
  • glibc is not recommended to be statically linked because some of its features require the support of dynamic libraries.

However, we can use Docker to solve this problem. The final output is a binary dynamically linked with glibc and some necessary libraries, but statically linked with all other dependencies.

  1. Use an older version of a Linux distribution (such as CentOS 7.x), which has an older version of glibc but can run on most modern Linux distributions.
  2. Build the static binary of PHP in this container so that it can run on most modern Linux distributions.

Using glibc static binaries can run on most modern Linux distributions but cannot run on musl libc distributions, such as CentOS 6, Alpine Linux, etc.

Build glibc Compatible Linux Binary

The latest version of static-php-cli includes the bin/spc-gnu-docker script, which can create a CentOS 7.x (glibc-2.17) Docker container with one click and build a glibc compatible PHP static binary in the container.

Then, run the following command once. The first run will take a long time because it needs to download the CentOS 7.x image and some build tools.

bash
bin/spc-gnu-docker

After the image is built, you will see the same command help menu as bin/spc, which means the container is ready.

After the container is ready, you can refer to the local build section to build your PHP static binary. Just replace bin/spc or ./spc with bin/spc-gnu-docker.

bash
bin/spc-gnu-docker build bcmath,ctype,openssl,pdo,phar,posix,session,tokenizer,xml,zip --build-cli --debug

Notes

In rare cases, glibc-based static PHP may encounter segment faults and other errors, but there are currently few examples. If you encounter any issues, please submit an issue.

glibc build is an extended feature and is not part of the default static-php support. If you have related issues or requirements, please indicate that you are building based on glibc when submitting an issue.

If you need to build glibc-based binaries without using Docker, please refer to the bin/spc-gnu-docker script to manually create a similar environment.

Since glibc binaries are not the main goal of the project, we generally do not test the compatibility of various libraries and extensions under glibc. If any specific library builds successfully on musl-libc but fails on glibc, please submit an issue.

Released under the MIT License.

+ \ No newline at end of file diff --git a/en/guide/cli-generator.html b/en/guide/cli-generator.html index 4bc4c343..e73c1f6a 100644 --- a/en/guide/cli-generator.html +++ b/en/guide/cli-generator.html @@ -5,26 +5,27 @@ CLI Build Command Generator | static-php-cli - - + + + - + - - - - + + + + -
Skip to content

CLI Build Command Generator

TIP

The extensions selected below may contain extensions that are not supported by the selected operating system, which may cause compilation to fail. Please check Supported Extensions first.

Select Build OS

Select Extensions


Select common extensions
Unselect all
Select Dependencies

TIP

After selecting the extensions, the unselectable items are essential dependencies. In the compiled dependencies list, optional dependencies consist of existing extensions and optional dependencies of libraries. Optional dependencies will be added in --with-libs parameter.

Build Target

Build Options

Build Environment
Download PHP version
Enable debug message
Enable ZTS
Download with corresponding extension dependencies
Download pre-built dependencies if possible (reduce compile time)
Enable UPX compression (reduce binary size)

Hardcoded INI options

Result

Download spc binary command
curl -fsSL -o spc.tgz https://dl.static-php.dev/static-php-cli/spc-bin/nightly/spc-linux-x86_64.tar.gz && tar -zxvf spc.tgz && rm spc.tgz
Download sources by extensions command
./spc download --with-php=8.2 --for-extensions "" --prefer-pre-built
Compile command
./spc build --build-cli ""
craft.yml
php-version: 8.2 +
Skip to content

CLI Build Command Generator

TIP

The extensions selected below may contain extensions that are not supported by the selected operating system, which may cause compilation to fail. Please check Supported Extensions first.

Select Build OS

Select Extensions


Select common extensions
Select all
Unselect all
Select Dependencies

TIP

After selecting the extensions, the unselectable items are essential dependencies. In the compiled dependencies list, optional dependencies consist of existing extensions and optional dependencies of libraries. Optional dependencies will be added in --with-libs parameter.

It is not possible to build all extensions at the same time, as some extensions conflict with each other. Please select the extensions you need.

Build Target

Build Options

Build Environment
Download PHP version
Enable debug message
Enable ZTS
Download with corresponding extension dependencies
Download pre-built dependencies if possible (reduce compile time)
Enable UPX compression (reduce binary size)

Hardcoded INI options

Result

Download spc binary command
curl -fsSL -o spc.tgz https://dl.static-php.dev/static-php-cli/spc-bin/nightly/spc-linux-x86_64.tar.gz && tar -zxvf spc.tgz && rm spc.tgz
Download sources by extensions command
./spc download --with-php=8.4 --for-extensions "" --prefer-pre-built
Compile command
./spc build --build-cli ""
craft.yml
php-version: 8.4 extensions: "" sapi: cli build-options: prefer-pre-built: true -

Released under the MIT License.

- +

Released under the MIT License.

+ \ No newline at end of file diff --git a/en/guide/deps-map.html b/en/guide/deps-map.html index da39fb91..2db9a326 100644 --- a/en/guide/deps-map.html +++ b/en/guide/deps-map.html @@ -5,20 +5,21 @@ Dependency Table | static-php-cli - - + + + - + - - - + + + -
Skip to content

Dependency Table

When compiling PHP, each extension and library has dependencies, which may be required or optional. You can choose whether to include these optional dependencies.

For example, when compiling the gd extension under Linux, the zlib,libpng libraries and the zlib extension are forced to be compiled, while the libavif,libwebp,libjpeg,freetype libraries are optional libraries and will not be compiled by default unless specified by the --with-libs=avif,webp,jpeg,freetype option.

  • For optional extensions (optional features of extensions), you need to specify them manually at compile time, for example, to enable igbinary support for Redis: bin/spc build redis,igbinary.
  • For optional libraries, you need to compile and specify them through the --with-libs=XXX option.
  • If you want to enable all optional extensions, you can use bin/spc build redis --with-suggested-exts.
  • If you want to enable all optional libraries, you can use --with-suggested-libs.

Extension Dependency Table

Linux

Extension NameRequired ExtensionsSuggested ExtensionsRequired LibrariesSuggested Libraries
amqplibrabbitmq
bz2bzip2
curlcurl
dbaqdbm
domlibxml2
zlib
eventopensslsocketslibevent
ffilibffi
ftpopenssl
gdzlibzlib
libpng
libavif
libwebp
libjpeg
freetype
gettextgettext
gmpgmp
gmsslgmssl
grpcgrpc
iconvlibiconv
igbinarysession
apcu
imagickimagemagick
imapopensslimap
intlicu
ldapopensslldapgmp
libsodium
lz4liblz4
libxmlxml
mbregexmbstringonig
memcachezlib
session
mongodbicu
openssl
zstd
zlib
mysqlimysqlnd
mysqlndzlib
odbcunixodbc
opensslzlibopenssl
zlib
password-argon2libargon2
pdo_mysqlpdo
mysqlnd
pdo_odbcpdo
odbc
unixodbc
pdo_pgsqlpdo
pgsql
postgresql
pdo_sqlitepdo
sqlite3
sqlite
pdo_sqlsrvpdo
sqlsrv
pgsqlpostgresql
pharzlib
rdkafkalibrdkafka
readlinereadline
redissession
igbinary
zstd
liblz4
simplexmllibxml2
snappyapcusnappy
soaplibxml2
sodiumlibsodium
spxzlib
sqlite3sqlite
sqlsrvpcntlunixodbc
ssh2libssh2
swooleopenssl
curl
swoole-hook-pgsql
swoole-hook-mysql
swoole-hook-sqlite
libcares
brotli
nghttp2
zlib
swoole-hook-mysqlmysqlnd
pdo
pdo_mysql
mysqli
swoole-hook-pgsqlpgsql
pdo
swoole-hook-sqlitesqlite3
pdo
swowopenssl
curl
openssl
curl
tidytidy
uuidlibuuid
uvsocketslibuv
xhprofctype
xlswriterzlib
zip
openssl
xmllibxml2
xmlreaderlibxml2
xmlwriterlibxml2
xslxml
dom
libxslt
yacigbinary
yamllibyaml
ziplibzip
zlibzlib
zstdzstd

macOS

Extension NameRequired ExtensionsSuggested ExtensionsRequired LibrariesSuggested Libraries
amqplibrabbitmq
bz2bzip2
curlcurl
dbaqdbm
domlibxml2
zlib
eventopensslsocketslibevent
ffilibffi
ftpopenssl
gdzlibzlib
libpng
libavif
libwebp
libjpeg
freetype
gettextgettext
glfwglfw
gmpgmp
gmsslgmssl
grpcgrpc
iconvlibiconv
igbinarysession
apcu
imagickimagemagick
imapopensslimap
intlicu
ldapopensslldapgmp
libsodium
lz4liblz4
libxmlxml
mbregexmbstringonig
memcachezlib
session
memcachedsession
zlib
libmemcached
mongodbicu
openssl
zstd
zlib
mysqlimysqlnd
mysqlndzlib
odbcunixodbc
opensslzlibopenssl
zlib
password-argon2libargon2
pdo_mysqlpdo
mysqlnd
pdo_odbcpdo
odbc
unixodbc
pdo_pgsqlpdo
pgsql
postgresql
pdo_sqlitepdo
sqlite3
sqlite
pdo_sqlsrvpdo
sqlsrv
pgsqlpostgresql
pharzlib
rdkafkalibrdkafka
readlinereadline
redissession
igbinary
zstd
liblz4
simplexmllibxml2
snappyapcusnappy
soaplibxml2
sodiumlibsodium
spxzlib
sqlite3sqlite
sqlsrvunixodbc
ssh2libssh2
swooleopenssl
curl
swoole-hook-pgsql
swoole-hook-mysql
swoole-hook-sqlite
libcares
brotli
nghttp2
zlib
swoole-hook-mysqlmysqlnd
pdo
pdo_mysql
mysqli
swoole-hook-pgsqlpgsql
pdo
swoole-hook-sqlitesqlite3
pdo
swowopenssl
curl
openssl
curl
tidytidy
uuidlibuuid
uvsocketslibuv
xhprofctype
xlswriterzlib
zip
openssl
xmllibxml2
xmlreaderlibxml2
xmlwriterlibxml2
xslxml
dom
libxslt
yacigbinary
yamllibyaml
ziplibzip
zlibzlib
zstdzstd

Windows

Extension NameRequired ExtensionsSuggested ExtensionsRequired LibrariesSuggested Libraries
amqpopenssllibrabbitmq
bz2bzip2
curlzlib
openssl
curl
dbaqdbm
domxmllibxml2
zlib
ffilibffi-win
ftpopenssl
gdzlibzlib
libpng
libavif
libwebp
libjpeg
freetype
gmsslgmssl
iconvlibiconv-win
igbinarysession
apcu
libxmlxml
mbregexmbstringonig
mysqlimysqlnd
mysqlndzlib
opensslzlibopenssl
zlib
parallelpthreads4w
pdo_mysqlpdo
mysqlnd
pdo_odbcpdo
odbc
pdo_pgsqlpdo
pgsql
postgresql-win
pdo_sqlitepdo
sqlite3
sqlite
pdo_sqlsrvpdo
sqlsrv
pgsqlpostgresql-win
pharzlib
redissession
igbinary
simplexmlxmllibxml2
soapxmllibxml2
sodiumlibsodium
sqlite3sqlite
ssh2openssl
zlib
libssh2
swowopenssl
curl
openssl
curl
xlswriterzlib
zip
openssl
xmliconvlibxml2
xmlreaderxml
dom
libxml2
xmlwriterxmllibxml2
yamllibyaml
zipzlib
bz2
libzip
zlib
bzip2
xz
zlibzlib

FreeBSD

Extension NameRequired ExtensionsSuggested ExtensionsRequired LibrariesSuggested Libraries
bz2bzip2
curlcurl
dbaqdbm
ftpopenssl
mbregexmbstringonig
mysqlimysqlnd
mysqlndzlib
opensslzlibopenssl
zlib
pdo_mysqlpdo
mysqlnd
pharzlib
zlibzlib

Library Dependency Table

Linux

Library NameRequired LibrariesSuggested Libraries
curlopenssl
zlib
libssh2
brotli
nghttp2
nghttp3
ngtcp2
zstd
libcares
freetypezliblibpng
bzip2
brotli
gettextlibiconvncurses
libxml2
grpczlib
openssl
imagemagickzlib
libpng
libjpeg
libwebp
freetype
libtiff
libheif
bzip2
zstd
xz
libzip
libxml2
imapopenssl
ldapopenssl
zlib
gmp
libsodium
libaclattr
libeventopenssl
libheiflibde265
libwebp
libaom
zlib
brotli
libpngzlib
librabbitmqopenssl
librdkafkazstd
libssh2opensslzlib
libtiffzlib
libjpeg
libxml2libiconvxz
icu
zlib
libxsltlibxml2
libzipzlibbzip2
xz
zstd
openssl
nghttp2zlib
openssl
libxml2
nghttp3
ngtcp2
nghttp3openssl
ngtcp2opensslnghttp3
brotli
opensslzlib
postgresqllibiconv
libxml2
openssl
zlib
readline
icu
libxslt
ldap
zstd
readlinencurses
snappyzlib
unixodbclibiconv
xzlibiconv

macOS

Library NameRequired LibrariesSuggested Libraries
curlopenssl
zlib
libssh2
brotli
nghttp2
nghttp3
ngtcp2
zstd
libcares
freetypezliblibpng
bzip2
brotli
gettextlibiconvncurses
libxml2
grpczlib
openssl
imagemagickzlib
libpng
libjpeg
libwebp
freetype
libtiff
libheif
bzip2
zstd
xz
libzip
libxml2
imapopenssl
ldapopenssl
zlib
gmp
libsodium
libeventopenssl
libheiflibde265
libwebp
libaom
zlib
brotli
libpngzlib
librabbitmqopenssl
librdkafkazstd
libssh2opensslzlib
libtiffzlib
libjpeg
libxml2libiconvxz
icu
zlib
libxsltlibxml2
libzipzlibbzip2
xz
zstd
openssl
nghttp2zlib
openssl
libxml2
nghttp3
ngtcp2
nghttp3openssl
ngtcp2opensslnghttp3
brotli
opensslzlib
postgresqllibiconv
libxml2
openssl
zlib
readline
icu
libxslt
ldap
zstd
readlinencurses
snappyzlib
unixodbclibiconv
xzlibiconv

Windows

Library NameRequired LibrariesSuggested Libraries
curlzlib
libssh2
nghttp2
brotli
zstd
freetypezliblibpng
bzip2
brotli
libjpegzlib
libpngzlib
librabbitmqopenssl
libssh2opensslzlib
libxml2libiconv-winzlib
libzipzlib
bzip2
xz
zstd
openssl
nghttp2zlib
openssl
libxml2
nghttp3
ngtcp2
nghttp3openssl
ngtcp2opensslnghttp3
brotli
opensslzlib

FreeBSD

Library NameRequired LibrariesSuggested Libraries
curlopenssl
zlib
libssh2
brotli
nghttp2
nghttp3
ngtcp2
zstd
libcares
opensslzlib

Released under the MIT License.

- +
Skip to content

Dependency Table

When compiling PHP, each extension and library has dependencies, which may be required or optional. You can choose whether to include these optional dependencies.

For example, when compiling the gd extension under Linux, the zlib,libpng libraries and the zlib extension are forced to be compiled, while the libavif,libwebp,libjpeg,freetype libraries are optional libraries and will not be compiled by default unless specified by the --with-libs=avif,webp,jpeg,freetype option.

  • For optional extensions (optional features of extensions), you need to specify them manually at compile time, for example, to enable igbinary support for Redis: bin/spc build redis,igbinary.
  • For optional libraries, you need to compile and specify them through the --with-libs=XXX option.
  • If you want to enable all optional extensions, you can use bin/spc build redis --with-suggested-exts.
  • If you want to enable all optional libraries, you can use --with-suggested-libs.

Extension Dependency Table

Linux

Extension NameRequired ExtensionsSuggested ExtensionsRequired LibrariesSuggested Libraries
amqplibrabbitmq
brotlibrotli
bz2bzip2
curlcurl
dbaqdbm
domlibxml2
zlib
evsockets
eventopensslsocketslibevent
ffilibffi
ftpopenssl
gdzlibzlib
libpng
libavif
libwebp
libjpeg
freetype
gettextgettext
gmpgmp
gmsslgmssl
grpcgrpc
iconvlibiconv
igbinarysession
apcu
imagickimagemagick
imapopensslimap
intlicu
ldapopensslldapgmp
libsodium
lz4liblz4
mbregexmbstringonig
memcachezlib
session
memcachedsession
zlib
libmemcached
fastlz
mongodbicu
openssl
zstd
zlib
msgpacksession
mysqlimysqlnd
mysqlndzlib
odbcunixodbc
opensslzlibopenssl
zlib
password-argon2libargon2
pdo_mysqlpdo
mysqlnd
pdo_odbcpdo
odbc
unixodbc
pdo_pgsqlpdo
pgsql
postgresql
pdo_sqlitepdo
sqlite3
sqlite
pdo_sqlsrvpdo
sqlsrv
pgsqlpostgresql
pharzlib
rdkafkalibrdkafka
readlinereadline
redissession
igbinary
zstd
liblz4
simplexmllibxml2
snappyapcusnappy
soaplibxml2
sodiumlibsodium
spxzlib
sqlite3sqlite
sqlsrvpcntlunixodbc
ssh2openssl
zlib
libssh2
swooleopenssl
curl
swoole-hook-pgsql
swoole-hook-mysql
swoole-hook-sqlite
libcares
brotli
nghttp2
zlib
swoole-hook-mysqlmysqlnd
pdo
pdo_mysql
mysqli
swoole-hook-pgsqlpgsql
pdo
swoole-hook-sqlitesqlite3
pdo
swowopenssl
curl
openssl
curl
tidytidy
uuidlibuuid
uvsocketslibuv
xhprofctype
xlswriterzlib
zip
openssl
xmllibxml2
xmlreaderlibxml2
xmlwriterlibxml2
xslxml
dom
libxslt
xzxz
yacigbinaryfastlz
yamllibyaml
ziplibzip
zlibzlib
zstdzstd

macOS

Extension NameRequired ExtensionsSuggested ExtensionsRequired LibrariesSuggested Libraries
amqplibrabbitmq
brotlibrotli
bz2bzip2
curlcurl
dbaqdbm
domlibxml2
zlib
evsockets
eventopensslsocketslibevent
ffilibffi
ftpopenssl
gdzlibzlib
libpng
libavif
libwebp
libjpeg
freetype
gettextgettext
glfwglfw
gmpgmp
gmsslgmssl
grpcgrpc
iconvlibiconv
igbinarysession
apcu
imagickimagemagick
imapopensslimap
intlicu
ldapopensslldapgmp
libsodium
lz4liblz4
mbregexmbstringonig
memcachezlib
session
memcachedsession
zlib
libmemcached
fastlz
mongodbicu
openssl
zstd
zlib
msgpacksession
mysqlimysqlnd
mysqlndzlib
odbcunixodbc
opensslzlibopenssl
zlib
password-argon2libargon2
pdo_mysqlpdo
mysqlnd
pdo_odbcpdo
odbc
unixodbc
pdo_pgsqlpdo
pgsql
postgresql
pdo_sqlitepdo
sqlite3
sqlite
pdo_sqlsrvpdo
sqlsrv
pgsqlpostgresql
pharzlib
rdkafkalibrdkafka
readlinereadline
redissession
igbinary
zstd
liblz4
simplexmllibxml2
snappyapcusnappy
soaplibxml2
sodiumlibsodium
spxzlib
sqlite3sqlite
sqlsrvunixodbc
ssh2openssl
zlib
libssh2
swooleopenssl
curl
swoole-hook-pgsql
swoole-hook-mysql
swoole-hook-sqlite
libcares
brotli
nghttp2
zlib
swoole-hook-mysqlmysqlnd
pdo
pdo_mysql
mysqli
swoole-hook-pgsqlpgsql
pdo
swoole-hook-sqlitesqlite3
pdo
swowopenssl
curl
openssl
curl
tidytidy
uuidlibuuid
uvsocketslibuv
xhprofctype
xlswriterzlib
zip
openssl
xmllibxml2
xmlreaderlibxml2
xmlwriterlibxml2
xslxml
dom
libxslt
xzxz
yacigbinaryfastlz
yamllibyaml
ziplibzip
zlibzlib
zstdzstd

Windows

Extension NameRequired ExtensionsSuggested ExtensionsRequired LibrariesSuggested Libraries
amqpopenssllibrabbitmq
brotlibrotli
bz2bzip2
curlzlib
openssl
curl
dbaqdbm
domxmllibxml2
zlib
evsockets
ffilibffi-win
ftpopenssl
gdzlibzlib
libpng
libavif
libwebp
libjpeg
freetype
gmsslgmssl
iconvlibiconv-win
igbinarysession
apcu
mbregexmbstringonig
msgpacksession
mysqlimysqlnd
mysqlndzlib
opensslzlibopenssl
zlib
parallelpthreads4w
pdo_mysqlpdo
mysqlnd
pdo_odbcpdo
odbc
pdo_pgsqlpdo
pgsql
postgresql-win
pdo_sqlitepdo
sqlite3
sqlite
pdo_sqlsrvpdo
sqlsrv
pgsqlpostgresql-win
pharzlib
redissession
igbinary
simplexmlxmllibxml2
soapxmllibxml2
sodiumlibsodium
sqlite3sqlite
ssh2openssl
zlib
libssh2
swowopenssl
curl
openssl
curl
xlswriterzlib
zip
openssl
xmliconvlibxml2
xmlreaderxml
dom
libxml2
xmlwriterxmllibxml2
xzxz
yamllibyaml
zipzlib
bz2
libzip
zlib
bzip2
xz
zlibzlib

FreeBSD

Extension NameRequired ExtensionsSuggested ExtensionsRequired LibrariesSuggested Libraries
brotlibrotli
bz2bzip2
curlcurl
dbaqdbm
evsockets
ftpopenssl
mbregexmbstringonig
mysqlimysqlnd
mysqlndzlib
opensslzlibopenssl
zlib
pdo_mysqlpdo
mysqlnd
pharzlib
xzxz
zlibzlib

Library Dependency Table

Linux

Library NameRequired LibrariesSuggested Libraries
curlopenssl
zlib
libssh2
brotli
nghttp2
nghttp3
ngtcp2
zstd
libcares
freetypezliblibpng
bzip2
brotli
gettextlibiconvncurses
libxml2
grpczlib
openssl
imagemagickzlib
libpng
libjpeg
libwebp
freetype
libtiff
libheif
bzip2
zstd
xz
libzip
libxml2
imapopenssl
ldapopenssl
zlib
gmp
libsodium
libaclattr
libeventopenssl
libheiflibde265
libwebp
libaom
zlib
brotli
libpngzlib
librabbitmqopenssl
librdkafkazstd
libssh2opensslzlib
libtiffzlib
libjpeg
libxml2libiconvxz
icu
zlib
libxsltlibxml2
libzipzlibbzip2
xz
zstd
openssl
nghttp2zlib
openssl
libxml2
nghttp3
ngtcp2
nghttp3openssl
ngtcp2opensslnghttp3
brotli
opensslzlib
postgresqllibiconv
libxml2
openssl
zlib
readline
icu
libxslt
ldap
zstd
readlinencurses
snappyzlib
unixodbclibiconv
xzlibiconv

macOS

Library NameRequired LibrariesSuggested Libraries
curlopenssl
zlib
libssh2
brotli
nghttp2
nghttp3
ngtcp2
zstd
libcares
freetypezliblibpng
bzip2
brotli
gettextlibiconvncurses
libxml2
grpczlib
openssl
imagemagickzlib
libpng
libjpeg
libwebp
freetype
libtiff
libheif
bzip2
zstd
xz
libzip
libxml2
imapopenssl
ldapopenssl
zlib
gmp
libsodium
libeventopenssl
libheiflibde265
libwebp
libaom
zlib
brotli
libpngzlib
librabbitmqopenssl
librdkafkazstd
libssh2opensslzlib
libtiffzlib
libjpeg
libxml2libiconvxz
icu
zlib
libxsltlibxml2
libzipzlibbzip2
xz
zstd
openssl
nghttp2zlib
openssl
libxml2
nghttp3
ngtcp2
nghttp3openssl
ngtcp2opensslnghttp3
brotli
opensslzlib
postgresqllibiconv
libxml2
openssl
zlib
readline
icu
libxslt
ldap
zstd
readlinencurses
snappyzlib
unixodbclibiconv
xzlibiconv

Windows

Library NameRequired LibrariesSuggested Libraries
curlzlib
libssh2
nghttp2
brotli
zstd
freetypezliblibpng
bzip2
brotli
libjpegzlib
libpngzlib
librabbitmqopenssl
libssh2opensslzlib
libxml2libiconv-winzlib
libzipzlib
bzip2
xz
zstd
openssl
nghttp2zlib
openssl
libxml2
nghttp3
ngtcp2
nghttp3openssl
ngtcp2opensslnghttp3
brotli
opensslzlib

FreeBSD

Library NameRequired LibrariesSuggested Libraries
curlopenssl
zlib
libssh2
brotli
nghttp2
nghttp3
ngtcp2
zstd
libcares
opensslzlib

Released under the MIT License.

+ \ No newline at end of file diff --git a/en/guide/env-vars.html b/en/guide/env-vars.html index 995499fb..3a943abd 100644 --- a/en/guide/env-vars.html +++ b/en/guide/env-vars.html @@ -5,31 +5,32 @@ Environment variables | static-php-cli - - + + + - + - - - + + + -
Skip to content

Environment variables

All environment variables mentioned in the list on this page have default values unless otherwise noted. You can override the default values by setting these environment variables.

Environment variables list

Starting from version 2.3.5, we have centralized the environment variables in the config/env.ini file. You can set environment variables by modifying this file.

We divide the environment variables supported by static-php-cli into three types:

  • Global internal environment variables: declared after static-php-cli starts, you can use getenv() to get them internally in static-php-cli, and you can override them before starting static-php-cli.
  • Fixed environment variables: declared after static-php-cli starts, you can only use getenv() to get them, but you cannot override them through shell scripts.
  • Config file environment variables: declared before static-php-cli build, you can set these environment variables by modifying the config/env.ini file or through shell scripts.

You can read the comments for each parameter in config/env.ini to understand its purpose.

Custom environment variables

Generally, you don't need to modify any of the following environment variables as they are already set to optimal values. However, if you have special needs, you can set these environment variables to meet your needs (for example, you need to debug PHP performance under different compilation parameters).

If you want to use custom environment variables, you can use the export command in the terminal or set the environment variables directly before the command, for example:

shell
# export first
+    
Skip to content

Environment variables

All environment variables mentioned in the list on this page have default values unless otherwise noted. You can override the default values by setting these environment variables.

Environment variables list

Starting from version 2.3.5, we have centralized the environment variables in the config/env.ini file. You can set environment variables by modifying this file.

We divide the environment variables supported by static-php-cli into three types:

  • Global internal environment variables: declared after static-php-cli starts, you can use getenv() to get them internally in static-php-cli, and you can override them before starting static-php-cli.
  • Fixed environment variables: declared after static-php-cli starts, you can only use getenv() to get them, but you cannot override them through shell scripts.
  • Config file environment variables: declared before static-php-cli build, you can set these environment variables by modifying the config/env.ini file or through shell scripts.

You can read the comments for each parameter in config/env.ini to understand its purpose.

Custom environment variables

Generally, you don't need to modify any of the following environment variables as they are already set to optimal values. However, if you have special needs, you can set these environment variables to meet your needs (for example, you need to debug PHP performance under different compilation parameters).

If you want to use custom environment variables, you can use the export command in the terminal or set the environment variables directly before the command, for example:

shell
# export first
 export SPC_CONCURRENCY=4
 bin/spc build mbstring,pcntl --build-cli
 
 # or direct use
-SPC_CONCURRENCY=4 bin/spc build mbstring,pcntl --build-cli

Or, if you need to modify an environment variable for a long time, you can modify the config/env.ini file.

config/env.ini is divided into three sections, [global] is globally effective, [windows], [macos], [linux] are only effective for the corresponding operating system.

For example, if you need to modify the ./configure command for compiling PHP, you can find the SPC_CMD_PREFIX_PHP_CONFIGURE environment variable in the config/env.ini file, and then modify its value.

If your build conditions are more complex and require multiple env.ini files to switch, we recommend that you use the config/env.custom.ini file. In this way, you can specify your environment variables by writing additional override items without modifying the default config/env.ini file.

ini
; This is an example of `config/env.custom.ini` file, 
+SPC_CONCURRENCY=4 bin/spc build mbstring,pcntl --build-cli

Or, if you need to modify an environment variable for a long time, you can modify the config/env.ini file.

config/env.ini is divided into three sections, [global] is globally effective, [windows], [macos], [linux] are only effective for the corresponding operating system.

For example, if you need to modify the ./configure command for compiling PHP, you can find the SPC_CMD_PREFIX_PHP_CONFIGURE environment variable in the config/env.ini file, and then modify its value.

If your build conditions are more complex and require multiple env.ini files to switch, we recommend that you use the config/env.custom.ini file. In this way, you can specify your environment variables by writing additional override items without modifying the default config/env.ini file.

ini
; This is an example of `config/env.custom.ini` file, 
 ; we modify the `SPC_CONCURRENCY` and linux default CFLAGS passing to libs and PHP
 [global]
 SPC_CONCURRENCY=4
 
 [linux]
-SPC_DEFAULT_C_FLAGS="-O3"

Library environment variables (Unix only)

Starting from 2.2.0, static-php-cli supports custom environment variables for all compilation dependent library commands of macOS, Linux, FreeBSD and other Unix systems.

In this way, you can adjust the behavior of compiling dependent libraries through environment variables at any time. For example, you can set the optimization parameters for compiling the xxx library through xxx_CFLAGS=-O0.

Of course, not every library supports the injection of environment variables. We currently provide three wildcard environment variables with the suffixes:

  • _CFLAGS: CFLAGS for the compiler
  • _LDFLAGS: LDFLAGS for the linker
  • _LIBS: LIBS for the linker

The prefix is the name of the dependent library, and the specific name of the library is subject to lib.json. Among them, the library name with - needs to replace - with _.

Here is an example of an optimization option that replaces the openssl library compilation:

shell
openssl_CFLAGS="-O0"

The library name uses the same name listed in lib.json and is case-sensitive.

TIP

When no relevant environment variables are specified, except for the following variables, the remaining values are empty by default:

var namevar default value
pkg_config_CFLAGSmacOS: $SPC_DEFAULT_C_FLAGS -Wimplicit-function-declaration -Wno-int-conversion, Other: empty
pkg_config_LDFLAGSLinux: --static, Other: empty
imagemagick_LDFLAGSLinux: -static, Other: empty
imagemagick_LIBSmacOS: -liconv, Other: empty
ldap_LDFLAGS-L$BUILD_LIB_PATH
openssl_CFLAGSLinux: $SPC_DEFAULT_C_FLAGS, Other: empty
others...empty

The following table is a list of library names that support customizing the above three variables:

lib name
brotli
bzip
curl
freetype
gettext
gmp
imagemagick
ldap
libargon2
libavif
libcares
libevent
openssl

TIP

Because adapting custom environment variables to each library is a particularly tedious task, and in most cases you do not need custom environment variables for these libraries, so we currently only support custom environment variables for some libraries.

If the library you need to customize environment variables is not listed above, you can submit your request through GitHub Issue.

Released under the MIT License.

- +SPC_DEFAULT_C_FLAGS="-O3"

Library environment variables (Unix only)

Starting from 2.2.0, static-php-cli supports custom environment variables for all compilation dependent library commands of macOS, Linux, FreeBSD and other Unix systems.

In this way, you can adjust the behavior of compiling dependent libraries through environment variables at any time. For example, you can set the optimization parameters for compiling the xxx library through xxx_CFLAGS=-O0.

Of course, not every library supports the injection of environment variables. We currently provide three wildcard environment variables with the suffixes:

  • _CFLAGS: CFLAGS for the compiler
  • _LDFLAGS: LDFLAGS for the linker
  • _LIBS: LIBS for the linker

The prefix is the name of the dependent library, and the specific name of the library is subject to lib.json. Among them, the library name with - needs to replace - with _.

Here is an example of an optimization option that replaces the openssl library compilation:

shell
openssl_CFLAGS="-O0"

The library name uses the same name listed in lib.json and is case-sensitive.

TIP

When no relevant environment variables are specified, except for the following variables, the remaining values are empty by default:

var namevar default value
pkg_config_CFLAGSmacOS: $SPC_DEFAULT_C_FLAGS -Wimplicit-function-declaration -Wno-int-conversion, Other: empty
pkg_config_LDFLAGSLinux: --static, Other: empty
imagemagick_LDFLAGSLinux: -static, Other: empty
imagemagick_LIBSmacOS: -liconv, Other: empty
ldap_LDFLAGS-L$BUILD_LIB_PATH
openssl_CFLAGSLinux: $SPC_DEFAULT_C_FLAGS, Other: empty
others...empty

The following table is a list of library names that support customizing the above three variables:

lib name
brotli
bzip
curl
freetype
gettext
gmp
imagemagick
ldap
libargon2
libavif
libcares
libevent
openssl

TIP

Because adapting custom environment variables to each library is a particularly tedious task, and in most cases you do not need custom environment variables for these libraries, so we currently only support custom environment variables for some libraries.

If the library you need to customize environment variables is not listed above, you can submit your request through GitHub Issue.

Released under the MIT License.

+ \ No newline at end of file diff --git a/en/guide/extension-notes.html b/en/guide/extension-notes.html index 1ea8a4c8..6e793b9b 100644 --- a/en/guide/extension-notes.html +++ b/en/guide/extension-notes.html @@ -5,20 +5,21 @@ Extension Notes | static-php-cli - - + + + - + - - - + + + -
Skip to content

Extension Notes

Because it is a static compilation, extensions will not compile 100% perfectly, and different extensions have different requirements for PHP and the environment, which will be listed one by one here.

curl

HTTP3 support is not enabled by default, compile with --with-libs="nghttp2,nghttp3,ngtcp2" to enable HTTP3 support for PHP >= 8.4.

When using curl to request HTTPS, there may be an error:80000002:system library::No such file or directory error. For details on the solution, see FAQ - Unable to use ssl.

phpmicro

  1. Only PHP >= 8.0 is supported.

swoole

  1. swoole >= 5.0 Only PHP >= 8.0 is supported.
  2. swoole Currently, curl hooks are not supported for PHP 8.0.x (which may be fixed in the future).
  3. When compiling, if only swoole extension is included, the supported Swoole database coroutine hook will not be fully enabled. If you need to use it, please add the corresponding swoole-hook-xxx extension.
  4. The zend_mm_heap corrupted problem may occur in swoole under some extension combinations. The cause has not yet been found.

swoole-hook-pgsql

swoole-hook-pgsql is not an extension, it's a Hook feature of Swoole. If you use swoole,swoole-hook-pgsql, you will enable Swoole's PostgreSQL client and the coroutine mode of the pdo_pgsql extension.

swoole-hook-pgsql conflicts with the pdo_pgsql extension. If you want to use Swoole and pdo_pgsql, please delete the pdo_pgsql extension and enable swoole and swoole-hook-pgsql. This extension contains an implementation of the coroutine environment for pdo_pgsql.

On macOS systems, pdo_pgsql may not be able to connect to the postgresql server normally, please use it with caution.

swoole-hook-mysql

swoole-hook-mysql is not an extension, it's a Hook feature of Swoole. If you use swoole,swoole-hook-mysql, you will enable the coroutine mode of Swoole's mysqlnd and pdo_mysql.

swoole-hook-sqlite

swoole-hook-sqlite is not an extension, it's a Hook feature of Swoole. If you use swoole,swoole-hook-sqlite, you will enable the coroutine mode of Swoole's pdo_sqlite (Swoole must be 5.1 or above).

swoole-hook-sqlite conflicts with the pdo_sqlite extension. If you want to use Swoole and pdo_sqlite, please delete the pdo_sqlite extension and enable swoole and swoole-hook-sqlite. This extension contains an implementation of the coroutine environment for pdo_sqlite.

swow

  1. Only PHP 8.0 ~ 8.4 is supported.

imagick

  1. The imagick extension currently only has openmp support on musl libc. This means that multithreading is disabled on glibc or other operating systems. The extension is still fully functional.

imap

  1. Kerberos is not supported
  2. ext-imap is not thread safe due to the underlying c-client. It's not possible to use it in --enable-zts builds.
  3. Because the extension may be dropped from php, we recommend you look for an alternative implementation, such as Webklex/php-imap

gd

  1. gd Extension relies on more additional Graphics library. By default, using bin/spc build gd directly will not support some Graphics library, such as libjpeg, libavif, etc. Currently, it supports four libraries: freetype,libjpeg,libavif,libwebp. Therefore, the following command can be used to introduce them into the gd library:
bash
bin/spc build gd --with-libs=freetype,libjpeg,libavif,libwebp --build-cli

mcrypt

  1. Currently not supported, and this extension will not be supported in the future. #32

oci8

  1. oci8 is an extension of the Oracle database, because the library on which the extension provided by Oracle does not provide a statically compiled version (.a) or source code, and this extension cannot be compiled into php by static linking, so it cannot be supported.

xdebug

  1. Xdebug is only buildable as a shared extension. On Linux, you need to use static-php-cli with SPC_LIBC=glibc.
  2. When using Linux/glibc or macOS, you can compile Xdebug as a shared extension using --build-shared="xdebug". The compiled ./php binary can be configured and run by specifying the INI, eg ./php -d 'zend_extension=/path/to/xdebug.so' your-code.php.

xml

  1. xml includes xml, xmlreader, xmlwriter, xsl, dom, simplexml, etc. When adding xml extensions, it is best to enable these extensions at the same time.
  2. libxml is included in xml extension. Enabling xml is equivalent to enabling libxml.

glfw

  1. glfw depends on OpenGL, and linux environment also needs X11, which cannot be linked statically.
  2. macOS platform, we can compile and link system builtin OpenGL and related libraries dynamically.

rar

  1. The rar extension currently has a problem when compiling phpmicro with the common extension collection in the macOS x86_64 environment.

pgsql

pgsql ssl connection is not compatible with openssl 3.2.0. See:

pgsql 16.2 has fixed this bug, now it's working.

When pgsql uses SSL connection, there may be error:80000002:system library::No such file or directory error, For details on the solution, see FAQ - Unable to use ssl.

openssl

When using openssl-based extensions (such as curl, pgsql and other network libraries), there may be an error:80000002:system library::No such file or directory error. For details on the solution, see FAQ - Unable to use ssl.

password-argon2

  1. password-argon2 is not a standard extension, it is an additional algorithm for the password_hash function.
  2. On Linux systems, password-argon2 dependency libargon2 conflicts with the libsodium library.

ffi

  1. Due to the limitation of musl libc's static linkage, you cannot use ffi because dynamic libraries cannot be loaded. If you need to use the ffi extension, see Compile PHP with GNU libc.
  2. macOS supports the ffi extension, but errors will occur when some kernels do not contain debugging symbols.
  3. Windows x64 supports the ffi extension.

xhprof

The xhprof extension consists of three parts: xhprof_extension, xhprof_html, xhprof_libs. Only xhprof_extension is included in the compiled binary. If you need to use xhprof, please download the source code from pecl.php.net/package/xhprof and specify the xhprof_libs and xhprof_html paths for use.

event

If you enable event extension on macOS, the openpty will be disabled due to issue:

parallel

Parallel is only supported on PHP 8.0 ZTS and above.

spx

  1. The SPX extension only supports NTS mode.
  2. SPX does not support Windows, and the official repository does not support static compilation. static-php-cli uses a modified version.

mimalloc

  1. This is not technically an extension, but a library.
  2. Building with --with-libs="mimalloc" on Linux or macOS will override the default allocator.
  3. This is experimental for now, but is recommended in threaded environments.

Released under the MIT License.

- +
Skip to content

Extension Notes

Because it is a static compilation, extensions will not compile 100% perfectly, and different extensions have different requirements for PHP and the environment, which will be listed one by one here.

curl

HTTP3 support is not enabled by default, compile with --with-libs="nghttp2,nghttp3,ngtcp2" to enable HTTP3 support for PHP >= 8.4.

When using curl to request HTTPS, there may be an error:80000002:system library::No such file or directory error. For details on the solution, see FAQ - Unable to use ssl.

phpmicro

  1. Only PHP >= 8.0 is supported.

swoole

  1. swoole >= 5.0 Only PHP >= 8.0 is supported.
  2. swoole Currently, curl hooks are not supported for PHP 8.0.x (which may be fixed in the future).
  3. When compiling, if only swoole extension is included, the supported Swoole database coroutine hook will not be fully enabled. If you need to use it, please add the corresponding swoole-hook-xxx extension.
  4. The zend_mm_heap corrupted problem may occur in swoole under some extension combinations. The cause has not yet been found.

swoole-hook-pgsql

swoole-hook-pgsql is not an extension, it's a Hook feature of Swoole. If you use swoole,swoole-hook-pgsql, you will enable Swoole's PostgreSQL client and the coroutine mode of the pdo_pgsql extension.

swoole-hook-pgsql conflicts with the pdo_pgsql extension. If you want to use Swoole and pdo_pgsql, please delete the pdo_pgsql extension and enable swoole and swoole-hook-pgsql. This extension contains an implementation of the coroutine environment for pdo_pgsql.

On macOS systems, pdo_pgsql may not be able to connect to the postgresql server normally, please use it with caution.

swoole-hook-mysql

swoole-hook-mysql is not an extension, it's a Hook feature of Swoole. If you use swoole,swoole-hook-mysql, you will enable the coroutine mode of Swoole's mysqlnd and pdo_mysql.

swoole-hook-sqlite

swoole-hook-sqlite is not an extension, it's a Hook feature of Swoole. If you use swoole,swoole-hook-sqlite, you will enable the coroutine mode of Swoole's pdo_sqlite (Swoole must be 5.1 or above).

swoole-hook-sqlite conflicts with the pdo_sqlite extension. If you want to use Swoole and pdo_sqlite, please delete the pdo_sqlite extension and enable swoole and swoole-hook-sqlite. This extension contains an implementation of the coroutine environment for pdo_sqlite.

swow

  1. Only PHP 8.0 ~ 8.4 is supported.

imagick

  1. The imagick extension currently only has openmp support on musl libc. This means that multithreading is disabled on glibc or other operating systems. The extension is still fully functional.

imap

  1. Kerberos is not supported
  2. ext-imap is not thread safe due to the underlying c-client. It's not possible to use it in --enable-zts builds.
  3. Because the extension may be dropped from php, we recommend you look for an alternative implementation, such as Webklex/php-imap

gd

  1. gd Extension relies on more additional Graphics library. By default, using bin/spc build gd directly will not support some Graphics library, such as libjpeg, libavif, etc. Currently, it supports four libraries: freetype,libjpeg,libavif,libwebp. Therefore, the following command can be used to introduce them into the gd library:
bash
bin/spc build gd --with-libs=freetype,libjpeg,libavif,libwebp --build-cli

mcrypt

  1. Currently not supported, and this extension will not be supported in the future. #32

oci8

  1. oci8 is an extension of the Oracle database, because the library on which the extension provided by Oracle does not provide a statically compiled version (.a) or source code, and this extension cannot be compiled into php by static linking, so it cannot be supported.

xdebug

  1. Xdebug is only buildable as a shared extension. On Linux, you need to use static-php-cli with SPC_LIBC=glibc.
  2. When using Linux/glibc or macOS, you can compile Xdebug as a shared extension using --build-shared="xdebug". The compiled ./php binary can be configured and run by specifying the INI, eg ./php -d 'zend_extension=/path/to/xdebug.so' your-code.php.

xml

  1. xml includes xml, xmlreader, xmlwriter, xsl, dom, simplexml, etc. When adding xml extensions, it is best to enable these extensions at the same time.
  2. libxml is included in xml extension. Enabling xml is equivalent to enabling libxml.

glfw

  1. glfw depends on OpenGL, and linux environment also needs X11, which cannot be linked statically.
  2. macOS platform, we can compile and link system builtin OpenGL and related libraries dynamically.

rar

  1. The rar extension currently has a problem when compiling phpmicro with the common extension collection in the macOS x86_64 environment.

pgsql

pgsql ssl connection is not compatible with openssl 3.2.0. See:

pgsql 16.2 has fixed this bug, now it's working.

When pgsql uses SSL connection, there may be error:80000002:system library::No such file or directory error, For details on the solution, see FAQ - Unable to use ssl.

openssl

When using openssl-based extensions (such as curl, pgsql and other network libraries), there may be an error:80000002:system library::No such file or directory error. For details on the solution, see FAQ - Unable to use ssl.

password-argon2

  1. password-argon2 is not a standard extension, it is an additional algorithm for the password_hash function.
  2. On Linux systems, password-argon2 dependency libargon2 conflicts with the libsodium library.

ffi

  1. Due to the limitation of musl libc's static linkage, you cannot use ffi because dynamic libraries cannot be loaded. If you need to use the ffi extension, see Compile PHP with GNU libc.
  2. macOS supports the ffi extension, but errors will occur when some kernels do not contain debugging symbols.
  3. Windows x64 supports the ffi extension.

xhprof

The xhprof extension consists of three parts: xhprof_extension, xhprof_html, xhprof_libs. Only xhprof_extension is included in the compiled binary. If you need to use xhprof, please download the source code from pecl.php.net/package/xhprof and specify the xhprof_libs and xhprof_html paths for use.

event

If you enable event extension on macOS, the openpty will be disabled due to issue:

parallel

Parallel is only supported on PHP 8.0 ZTS and above.

spx

  1. SPX does not support Windows, and the official repository does not support static compilation. static-php-cli uses a modified version.

mimalloc

  1. This is not technically an extension, but a library.
  2. Building with --with-libs="mimalloc" on Linux or macOS will override the default allocator.
  3. This is experimental for now, but is recommended in threaded environments.

Released under the MIT License.

+ \ No newline at end of file diff --git a/en/guide/extensions.html b/en/guide/extensions.html index 083ec54e..690872d4 100644 --- a/en/guide/extensions.html +++ b/en/guide/extensions.html @@ -5,21 +5,22 @@ Extensions | static-php-cli - - + + + - + - - - - + + + + -
Skip to content

Extensions

  • yes: supported
  • blank: not supported yet, or WIP
  • no with issue link: confirmed to be unavailable due to issue
  • partial with issue link: supported but not perfect due to issue
Extension NameLinuxmacOSFreeBSDWindows
amqpyesyesyes
apcuyesyesyesyes
astyesyesyesyes
bcmathyesyesyesyes
bz2yesyesyesyes
calendaryesyesyesyes
ctypeyesyesyesyes
curlyesyesyesyes
dbayesyesyesyes
dioyesyesyes
domyesyesyes
dsyesyesyesyes
enchant
evyesyesyesyes
eventyesyes
exifyesyesyesyes
ffipartialyesyes
fileinfoyesyesyesyes
filteryesyesyesyes
ftpyesyesyesyes
gdyesyesyes
gettextyesyes
glfwnoyesno
gmpyesyes
gmsslyesyesyes
grpcyesyes
iconvyesyesyes
igbinaryyesyesyes
imagickyesyes
imapyesyes
inotifyyesnono
intlyesyesno
ldapyesyes
lz4yesyes
libxmlyesyesyes
mbregexyesyesyesyes
mbstringyesyesyesyes
mcryptnononono
memcacheyesyes
memcachednoyes
mongodbyesyes
msgpackyesyesyes
mysqliyesyesyesyes
mysqlndyesyesyesyes
oci8nonono
odbcyesyes
opcacheyesyesyesyes
opensslyesyesyesyes
opentelemetryyesyesyes
parallelyesyesyes
password-argon2yesyes
pcntlyesyesyesno
pdoyesyesyesyes
pdo_mysqlyesyesyesyes
pdo_odbcyesyesyes
pdo_pgsqlyesyesyes
pdo_sqliteyesyesyes
pdo_sqlsrvyesyesyes
pgsqlyesyesyes
pharyesyesyesyes
posixyesyesyesno
protobufyesyes
raryespartialyes
rdkafkayesyes
readlineyesyes
redisyesyesyes
sessionyesyesyesyes
shmopyesyesyesyes
simdjsonyesyesyesyes
simplexmlyesyesyes
snappyyesyes
soapyesyesyes
socketsyesyesyesyes
sodiumyesyesyes
spxyesyesno
sqlite3yesyesyes
sqlsrvyesyesyes
ssh2yesyesyes
swooleyesyesno
swoole-hook-mysqlyesyesno
swoole-hook-pgsqlyespartialno
swoole-hook-sqliteyesyesno
swowyesyesyes
sysvmsgyesyesno
sysvsemyesyesno
sysvshmyesyesyes
tidyyesyes
tokenizeryesyesyesyes
uuidyesyes
uvyesyes
xdebugpartialpartialno
xhprofyesyes
xlswriteryesyesyes
xmlyesyesyes
xmlreaderyesyesyes
xmlwriteryesyesyes
xslyesyes
yacyesyesyes
yamlyesyesyes
zipyesyesyes
zlibyesyesyesyes
zstdyesyes

TIP

If an extension you need is missing, you can create a Feature Request.

Some extensions or libraries that the extension depends on will have some optional features. For example, the gd library optionally supports libwebp, freetype, etc. If you only use bin/spc build gd --build-cli they will not be included (static-php-cli defaults to the minimum dependency principle).

For more information about optional libraries, see Extensions, Library Dependency Map. For optional libraries, you can also select an extension from the Command Generator and then select optional libraries.

Released under the MIT License.

- +
Skip to content

Extensions

  • yes: supported
  • blank: not supported yet, or WIP
  • no with issue link: confirmed to be unavailable due to issue
  • partial with issue link: supported but not perfect due to issue
Extension NameLinuxmacOSFreeBSDWindows
amqpyesyesyes
apcuyesyesyesyes
astyesyesyesyes
bcmathyesyesyesyes
brotliyesyesyesyes
bz2yesyesyesyes
calendaryesyesyesyes
ctypeyesyesyesyes
curlyesyesyesyes
dbayesyesyesyes
dioyesyesyes
domyesyesyes
dsyesyesyesyes
enchant
evyesyesyesyes
eventyesyes
exifyesyesyesyes
ffipartialyesyes
fileinfoyesyesyesyes
filteryesyesyesyes
ftpyesyesyesyes
gdyesyesyes
gettextyesyes
glfwnoyesno
gmpyesyes
gmsslyesyesyes
grpcyesyes
iconvyesyesyes
igbinaryyesyesyes
imagickyesyes
imapyesyes
inotifyyesnono
intlyesyesno
ldapyesyes
libxmlyesyesyes
lz4yesyes
mbregexyesyesyesyes
mbstringyesyesyesyes
mcryptnononono
memcacheyesyes
memcachedyesyes
mongodbyesyes
msgpackyesyesyes
mysqliyesyesyesyes
mysqlndyesyesyesyes
oci8nonono
odbcyesyes
opcacheyesyesyesyes
opensslyesyesyesyes
opentelemetryyesyesyes
parallelyesyesyes
password-argon2yesyes
pcntlyesyesyesno
pdoyesyesyesyes
pdo_mysqlyesyesyesyes
pdo_odbcyesyesyes
pdo_pgsqlyesyesyes
pdo_sqliteyesyesyes
pdo_sqlsrvyesyesyes
pgsqlyesyesyes
pharyesyesyesyes
posixyesyesyesno
protobufyesyes
raryespartialyes
rdkafkayesyes
readlineyesyes
redisyesyesyes
sessionyesyesyesyes
shmopyesyesyesyes
simdjsonyesyesyesyes
simplexmlyesyesyes
snappyyesyes
soapyesyesyes
socketsyesyesyesyes
sodiumyesyesyes
spxyesyesno
sqlite3yesyesyes
sqlsrvyesyesyes
ssh2yesyesyes
swooleyesyesno
swoole-hook-mysqlyesyesno
swoole-hook-pgsqlyespartialno
swoole-hook-sqliteyesyesno
swowyesyesyes
sysvmsgyesyesno
sysvsemyesyesno
sysvshmyesyesyes
tidyyesyes
tokenizeryesyesyesyes
uuidyesyes
uvyesyes
xdebugpartialpartialno
xhprofyesyes
xlswriteryesyesyes
xmlyesyesyes
xmlreaderyesyesyes
xmlwriteryesyesyes
xslyesyes
xzyesyesyesyes
yacyesyesyes
yamlyesyesyes
zipyesyesyes
zlibyesyesyesyes
zstdyesyes

TIP

If an extension you need is missing, you can create a Feature Request.

Some extensions or libraries that the extension depends on will have some optional features. For example, the gd library optionally supports libwebp, freetype, etc. If you only use bin/spc build gd --build-cli they will not be included (static-php-cli defaults to the minimum dependency principle).

For more information about optional libraries, see Extensions, Library Dependency Map. For optional libraries, you can also select an extension from the Command Generator and then select optional libraries.

Released under the MIT License.

+ \ No newline at end of file diff --git a/en/guide/index.html b/en/guide/index.html index eaae98d1..50a8bd44 100644 --- a/en/guide/index.html +++ b/en/guide/index.html @@ -5,20 +5,21 @@ Guide | static-php-cli - - + + + - + - - - + + + -
Skip to content

Guide

Static php cli is a tool used to build statically compiled PHP binaries, currently supporting Linux and macOS systems.

In the guide section, you will learn how to use static php cli to build standalone PHP programs.

Compilation Environment

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.

x86_64aarch64
macOS⚙️ 💻⚙️ 💻
Linux⚙️ 💻⚙️ 💻
Windows⚙️ 💻
FreeBSD💻💻

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.

There are two architectures for macOS: x86_64 and Arm, but binaries compiled on one architecture cannot be directly used on the other architecture. Rosetta 2 cannot guarantee that programs compiled with Arm architecture can fully run on x86_64 environment.

Windows currently only supports the x86_64 architecture, and does not support 32-bit x86 or arm64 architecture.

Supported PHP Version

Currently, static php cli supports PHP versions 8.1 to 8.4, and theoretically supports PHP 8.0 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.

Released under the MIT License.

- +
Skip to content

Guide

Static php cli is a tool used to build statically compiled PHP binaries, currently supporting Linux and macOS systems.

In the guide section, you will learn how to use static php cli to build standalone PHP programs.

Compilation Environment

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.

x86_64aarch64
macOS⚙️ 💻⚙️ 💻
Linux⚙️ 💻⚙️ 💻
Windows⚙️ 💻
FreeBSD💻💻

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.

There are two architectures for macOS: x86_64 and Arm, but binaries compiled on one architecture cannot be directly used on the other architecture. Rosetta 2 cannot guarantee that programs compiled with Arm architecture can fully run on x86_64 environment.

Windows currently only supports the x86_64 architecture, and does not support 32-bit x86 or arm64 architecture.

Supported PHP Version

Currently, static php cli supports PHP versions 8.1 to 8.4, and theoretically supports PHP 8.0 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.

Released under the MIT License.

+ \ No newline at end of file diff --git a/en/guide/manual-build.html b/en/guide/manual-build.html index c993eaf4..f55e00aa 100644 --- a/en/guide/manual-build.html +++ b/en/guide/manual-build.html @@ -5,19 +5,20 @@ Build (Linux, macOS, FreeBSD) | static-php-cli - - + + + - + - - - + + + -
Skip to content

Build (Linux, macOS, FreeBSD)

This section covers the build process for Linux, macOS, and FreeBSD. If you want to build on Windows, also need to read Build on Windows.

This project provides a binary file of static-php-cli. You can directly download the binary file of the corresponding platform and then use it to build static PHP. Currently, the platforms supported by spc binary are Linux and macOS.

Here's how to download from self-hosted server:

bash
# Download from self-hosted nightly builds (sync with main branch)
+    
Skip to content

Build (Linux, macOS, FreeBSD)

This section covers the build process for Linux, macOS, and FreeBSD. If you want to build on Windows, also need to read Build on Windows.

This project provides a binary file of static-php-cli. You can directly download the binary file of the corresponding platform and then use it to build static PHP. Currently, the platforms supported by spc binary are Linux and macOS.

Here's how to download from self-hosted server:

bash
# Download from self-hosted nightly builds (sync with main branch)
 # For Linux x86_64
 curl -fsSL -o spc https://dl.static-php.dev/static-php-cli/spc-bin/nightly/spc-linux-x86_64
 # For Linux aarch64
@@ -35,16 +36,16 @@
 # Run (Linux and macOS)
 ./spc --version
 # Run (Windows powershell)
-.\spc.exe --version

If you are using the packaged spc binary, you will need to replace the leading bin/spc with ./spc in all the commands below.

Build locally (using source code)

If you have problems using the spc binary, or if you need to modify the static-php-cli source code, download static-php-cli from the source code.

Currently, it supports building on macOS and Linux. macOS supports the latest version of the operating system and two architectures, while Linux supports Debian and derivative distributions, as well as Alpine Linux.

Because this project itself is developed using PHP, it is also necessary to install PHP on the system during compilation. This project also provides static binary PHP suitable for this project, which can be selected and used according to actual situations.

bash
# clone repo
+.\spc.exe --version

If you are using the packaged spc binary, you will need to replace the leading bin/spc with ./spc in all the commands below.

Build locally (using source code)

If you have problems using the spc binary, or if you need to modify the static-php-cli source code, download static-php-cli from the source code.

Currently, it supports building on macOS and Linux. macOS supports the latest version of the operating system and two architectures, while Linux supports Debian and derivative distributions, as well as Alpine Linux.

Because this project itself is developed using PHP, it is also necessary to install PHP on the system during compilation. This project also provides static binary PHP suitable for this project, which can be selected and used according to actual situations.

bash
# clone repo
 git clone https://github.com/crazywhalecc/static-php-cli.git --depth=1
 cd static-php-cli
 
 # You need to install the PHP environment first before running Composer and this project. The installation method can be referred to below.
-composer update

Use Precompiled Static PHP Binaries

If you don't want to use Docker and install PHP in the system, you can directly download the php binary cli program compiled by this project itself. The usage process is as follows:

Deploy the environment using the command, the command will download a static php-cli binary from self-hosted server. Next, it will automatically download Composer from getcomposer or Aliyun mirror.

TIP

Using precompiled static PHP binaries is currently only supported on Linux and macOS. The FreeBSD environment is currently not supported due to the lack of an automated build environment.

bash
bin/setup-runtime
+composer update

Use Precompiled Static PHP Binaries

If you don't want to use Docker and install PHP in the system, you can directly download the php binary cli program compiled by this project itself. The usage process is as follows:

Deploy the environment using the command, the command will download a static php-cli binary from self-hosted server. Next, it will automatically download Composer from getcomposer or Aliyun mirror.

TIP

Using precompiled static PHP binaries is currently only supported on Linux and macOS. The FreeBSD environment is currently not supported due to the lack of an automated build environment.

bash
bin/setup-runtime
 
 # For users with special network environments such as mainland China, you can use mirror sites (aliyun) to speed up the download speed
-bin/setup-runtime --mirror china

This script will download two files in total: bin/php and bin/composer. After the download is complete, there are two ways to use it:

  1. Add the bin/ directory to the PATH: export PATH="/path/to/your/static-php-cli/bin:$PATH", after adding the path, it is equivalent to installing PHP in the system, you can directly Use commands such as composer, php -v, or directly use bin/spc.
  2. Direct call, such as executing static-php-cli command: bin/php bin/spc --help, executing Composer: bin/php bin/composer update.

Use Docker

If you don't want to install PHP and Composer runtime environment on your system, you can use the built-in Docker environment build script.

bash
# To use directly, replace `bin/spc` with `bin/spc-alpine-docker` in all used commands
-bin/spc-alpine-docker

The first time the command is executed, docker build will be used to build a Docker image. The default built Docker image is the x86_64 architecture, and the image name is cwcc-spc-x86_64.

If you want to build aarch64 static-php-cli in x86_64 environment, you can use qemu to emulate the arm image to run Docker, but the speed will be very slow. Use command: SPC_USE_ARCH=aarch64 bin/spc-alpine-docker.

If it prompts that sudo is required to run after running, execute the following command once to grant static-php-cli permission to execute sudo:

bash
export SPC_USE_SUDO=yes

Use System PHP

Below are some example commands for installing PHP and Composer in the system. It is recommended to search for the specific installation method yourself or ask the AI search engine to obtain the answer, which will not be elaborated here.

bash
# [macOS], need install Homebrew first. See https://brew.sh/
+bin/setup-runtime --mirror china

This script will download two files in total: bin/php and bin/composer. After the download is complete, there are two ways to use it:

  1. Add the bin/ directory to the PATH: export PATH="/path/to/your/static-php-cli/bin:$PATH", after adding the path, it is equivalent to installing PHP in the system, you can directly Use commands such as composer, php -v, or directly use bin/spc.
  2. Direct call, such as executing static-php-cli command: bin/php bin/spc --help, executing Composer: bin/php bin/composer update.

Use Docker

If you don't want to install PHP and Composer runtime environment on your system, you can use the built-in Docker environment build script.

bash
# To use directly, replace `bin/spc` with `bin/spc-alpine-docker` in all used commands
+bin/spc-alpine-docker

The first time the command is executed, docker build will be used to build a Docker image. The default built Docker image is the x86_64 architecture, and the image name is cwcc-spc-x86_64.

If you want to build aarch64 static-php-cli in x86_64 environment, you can use qemu to emulate the arm image to run Docker, but the speed will be very slow. Use command: SPC_USE_ARCH=aarch64 bin/spc-alpine-docker.

If it prompts that sudo is required to run after running, execute the following command once to grant static-php-cli permission to execute sudo:

bash
export SPC_USE_SUDO=yes

Use System PHP

Below are some example commands for installing PHP and Composer in the system. It is recommended to search for the specific installation method yourself or ask the AI search engine to obtain the answer, which will not be elaborated here.

bash
# [macOS], need install Homebrew first. See https://brew.sh/
 # Remember change your composer executable path. For M1/M2 Chip mac, "/opt/homebrew/bin/", for Intel mac, "/usr/local/bin/". Or add it to your own path.
 brew install php wget
 wget https://getcomposer.org/download/latest-stable/composer.phar -O /path/to/your/bin/composer && chmod +x /path/to/your/bin/composer
@@ -53,12 +54,12 @@
 sudo apt install php-cli composer php-tokenizer
 
 # [Alpine]
-apk add bash file wget xz php81 php81-common php81-pcntl php81-tokenizer php81-phar php81-posix php81-xml composer

TIP

Currently, some versions of Ubuntu install older PHP versions, so no installation commands are provided. If necessary, it is recommended to add software sources such as ppa first, and then install the latest version of PHP and tokenizer, XML, and phar extensions.

Older versions of Debian may have an older (<= 7.4) version of PHP installed by default, it is recommended to upgrade Debian first.

Using bin/spc craft, you can use a configuration file and a command to automatically check the environment, download source code, build dependency libraries, build PHP and extensions, etc.

You need to write a craft.yml file and save it in the current working directory. craft.yml can be generated by command generator or written manually.

For manual writing, please refer to the comments in craft.yml configuration to write it. Let's assume that you compile an extension combination and choose PHP 8.4, outputting cli and fpm:

yaml
# path/to/craft.yml
+apk add bash file wget xz php81 php81-common php81-pcntl php81-tokenizer php81-phar php81-posix php81-xml composer

TIP

Currently, some versions of Ubuntu install older PHP versions, so no installation commands are provided. If necessary, it is recommended to add software sources such as ppa first, and then install the latest version of PHP and tokenizer, XML, and phar extensions.

Older versions of Debian may have an older (<= 7.4) version of PHP installed by default, it is recommended to upgrade Debian first.

Using bin/spc craft, you can use a configuration file and a command to automatically check the environment, download source code, build dependency libraries, build PHP and extensions, etc.

You need to write a craft.yml file and save it in the current working directory. craft.yml can be generated by command generator or written manually.

For manual writing, please refer to the comments in craft.yml configuration to write it. Let's assume that you compile an extension combination and choose PHP 8.4, outputting cli and fpm:

yaml
# path/to/craft.yml
 php-version: 8.4
 extensions: bcmath,posix,phar,zlib,openssl,curl,fileinfo,tokenizer
 sapi:
   - cli
-  - fpm

Then use the bin/spc craft command to compile:

bash
bin/spc craft --debug

If the build is successful, you will see the buildroot/bin directory in the current directory, which contains the compiled PHP binary file, or the corresponding SAPI.

  • cli: The build result is buildroot/bin/php.exe on Windows and buildroot/bin/php on other platforms.
  • fpm: The build result is buildroot/bin/php-fpm.
  • micro: The build result is buildroot/bin/micro.sfx. If you need to further package it with PHP code, please refer to Packaging micro binary.
  • embed: See Using embed.

If the build fails, you can use the --debug parameter to view detailed error information, or use the --with-clean to clear the old compilation results and recompile.

If the build still fails to use the above method, please submit an issue and attach your craft.yml and craft.log.

Step-by-step build command

If you have customized requirements, or the need to download and compile PHP and dependent libraries separately, you can use the bin/spc command to execute step by step.

Command download - Download dependency packages

Use the command bin/spc download to download the source code required for compilation, including php-src and the source code of various dependent libraries.

bash
# Download all dependencies, defaults to php 8.4
+  - fpm

Then use the bin/spc craft command to compile:

bash
bin/spc craft --debug

If the build is successful, you will see the buildroot/bin directory in the current directory, which contains the compiled PHP binary file, or the corresponding SAPI.

  • cli: The build result is buildroot/bin/php.exe on Windows and buildroot/bin/php on other platforms.
  • fpm: The build result is buildroot/bin/php-fpm.
  • micro: The build result is buildroot/bin/micro.sfx. If you need to further package it with PHP code, please refer to Packaging micro binary.
  • embed: See Using embed.

If the build fails, you can use the --debug parameter to view detailed error information, or use the --with-clean to clear the old compilation results and recompile.

If the build still fails to use the above method, please submit an issue and attach your craft.yml and craft.log.

Step-by-step build command

If you have customized requirements, or the need to download and compile PHP and dependent libraries separately, you can use the bin/spc command to execute step by step.

Command download - Download dependency packages

Use the command bin/spc download to download the source code required for compilation, including php-src and the source code of various dependent libraries.

bash
# Download all dependencies, defaults to php 8.4
 bin/spc download --all
 
 # Download all dependent packages, and specify the main version of PHP to download, optional: 8.1, 8.2, 8.3, 8.4
@@ -93,51 +94,51 @@
 bin/spc download --for-extensions=curl,pcntl,xml --ignore-cache-sources=php-src --with-php=8.3.10
 
 # Set retry times (default is 0)
-bin/spc download --all --retry=2

If the network in your area is not good, or the speed of downloading the dependency package is too slow, you can download download.zip which is packaged regularly every week from GitHub Action, and use the command to directly use the zip archive as a dependency.

Dependent packages can be downloaded locally from Action. Enter Action and select the latest Workflow that has been successfully run, and download download-files-x.y.

bash
bin/spc download --from-zip=/path/to/your/download.zip

If a source cannot be downloaded all the time, or you need to download some specific version of the package, such as downloading the beta version of PHP, the old version of the library, etc., you can use the parameter -U or --custom-url to rewrite the download link, Make the downloader force the link you specify to download packages from this source. The method of use is {source-name}:{url}, which can rewrite the download URLs of multiple libraries at the same time. Also, it is available when downloading with the --for-extensions option.

bash
# Specifying to download a beta version of PHP8.3
+bin/spc download --all --retry=2

If the network in your area is not good, or the speed of downloading the dependency package is too slow, you can download download.zip which is packaged regularly every week from GitHub Action, and use the command to directly use the zip archive as a dependency.

Dependent packages can be downloaded locally from Action. Enter Action and select the latest Workflow that has been successfully run, and download download-files-x.y.

bash
bin/spc download --from-zip=/path/to/your/download.zip

If a source cannot be downloaded all the time, or you need to download some specific version of the package, such as downloading the beta version of PHP, the old version of the library, etc., you can use the parameter -U or --custom-url to rewrite the download link, Make the downloader force the link you specify to download packages from this source. The method of use is {source-name}:{url}, which can rewrite the download URLs of multiple libraries at the same time. Also, it is available when downloading with the --for-extensions option.

bash
# Specifying to download a beta version of PHP8.3
 bin/spc download --all -U "php-src:https://downloads.php.net/~eric/php-8.3.0beta1.tar.gz"
 
 # Specifying to download an older version of the curl library
-bin/spc download --all -U "curl:https://curl.se/download/curl-7.88.1.tar.gz"

If the source you download is not a link, but a git repository, you can use -G or --custom-git to rewrite the download link, so that the downloader can force the use of the specified git repository to download packages from this source. The usage method is {source-name}:{branch}:{url}, which can rewrite the download link of multiple libraries at the same time. It is also available when downloading with the --for-extensions option.

bash
# Specifying to download the source code of the PHP extension from the specified branch of the git repository
+bin/spc download --all -U "curl:https://curl.se/download/curl-7.88.1.tar.gz"

If the source you download is not a link, but a git repository, you can use -G or --custom-git to rewrite the download link, so that the downloader can force the use of the specified git repository to download packages from this source. The usage method is {source-name}:{branch}:{url}, which can rewrite the download link of multiple libraries at the same time. It is also available when downloading with the --for-extensions option.

bash
# Specifying to download the source code of the PHP extension from the specified branch of the git repository
 bin/spc download --for-extensions=redis -G "php-src:master:https://github.com/php/php-src.git"
 
 # Download the latest code from the master branch of the swoole-src repository instead of PECL release version
-bin/spc download --for-extensions=swoole -G "swoole:master:https://github.com/swoole/swoole-src.git"

Command - doctor

If you can run bin/spc normally but cannot compile static PHP or dependent libraries normally, you can run bin/spc doctor first to check whether the system itself lacks dependencies.

bash
# Quick check
+bin/spc download --for-extensions=swoole -G "swoole:master:https://github.com/swoole/swoole-src.git"

Command - doctor

If you can run bin/spc normally but cannot compile static PHP or dependent libraries normally, you can run bin/spc doctor first to check whether the system itself lacks dependencies.

bash
# Quick check
 bin/spc doctor
 
 # Quickly check and fix when it can be automatically repaired (use package management to install dependent packages, only support the above-mentioned operating systems and distributions)
-bin/spc doctor --auto-fix

Command - build

Use the build command to start building the static php binary. Before executing the bin/spc build command, be sure to use the download command to download sources. It is recommended to use doctor to check the environment.

Basic build

You need to go to Extension List or Command Generator to select the extension you want to add, and then use the command bin/spc build to compile. You need to specify a compilation target, choose from the following parameters:

  • --build-cli: Build a cli sapi (command line interface, which can execute PHP code on the command line)
  • --build-fpm: Build a fpm sapi (php-fpm, used in conjunction with other traditional fpm architecture software such as nginx)
  • --build-micro: Build a micro sapi (used to build a standalone executable binary containing PHP code)
  • --build-embed: Build an embed sapi (used to embed into other C language programs)
  • --build-all: build all above sapi
bash
# Compile PHP with bcmath,curl,openssl,ftp,posix,pcntl extensions, the compilation target is cli
+bin/spc doctor --auto-fix

Command - build

Use the build command to start building the static php binary. Before executing the bin/spc build command, be sure to use the download command to download sources. It is recommended to use doctor to check the environment.

Basic build

You need to go to Extension List or Command Generator to select the extension you want to add, and then use the command bin/spc build to compile. You need to specify a compilation target, choose from the following parameters:

  • --build-cli: Build a cli sapi (command line interface, which can execute PHP code on the command line)
  • --build-fpm: Build a fpm sapi (php-fpm, used in conjunction with other traditional fpm architecture software such as nginx)
  • --build-micro: Build a micro sapi (used to build a standalone executable binary containing PHP code)
  • --build-embed: Build an embed sapi (used to embed into other C language programs)
  • --build-all: build all above sapi
bash
# Compile PHP with bcmath,curl,openssl,ftp,posix,pcntl extensions, the compilation target is cli
 bin/spc build bcmath,curl,openssl,ftp,posix,pcntl --build-cli
 
 # Compile PHP with phar,curl,posix,pcntl,tokenizer extensions, compile target is micro
-bin/spc build phar,curl,posix,pcntl,tokenizer --build-micro

TIP

If you need to repeatedly build and debug, you can delete the buildroot/ and source/ directories so that you can re-extract and build all you need from the downloaded source code package:

shell
# remove
+bin/spc build phar,curl,posix,pcntl,tokenizer --build-micro

TIP

If you need to repeatedly build and debug, you can delete the buildroot/ and source/ directories so that you can re-extract and build all you need from the downloaded source code package:

shell
# remove
 rm -rf buildroot source
 # build again
-bin/spc build bcmath,curl,openssl,ftp,posix,pcntl --build-cli

TIP

If you want to build multiple versions of PHP and don't want to build other dependent libraries repeatedly each time, you can use switch-php-version to quickly switch to another version and compile after compiling one version:

shell
# switch to 8.4
+bin/spc build bcmath,curl,openssl,ftp,posix,pcntl --build-cli

TIP

If you want to build multiple versions of PHP and don't want to build other dependent libraries repeatedly each time, you can use switch-php-version to quickly switch to another version and compile after compiling one version:

shell
# switch to 8.4
 bin/spc switch-php-version 8.4
 # build
 bin/spc build bcmath,curl,openssl,ftp,posix,pcntl --build-cli
 # switch to 8.1
 bin/spc switch-php-version 8.1
 # build
-bin/spc build bcmath,curl,openssl,ftp,posix,pcntl --build-cli

Build Options

During the compilation process, in some special cases, the compiler and the content of the compilation directory need to be intervened. You can try to use the following commands:

  • --cc=XXX: Specifies the execution command of the C language compiler (Linux default musl-gcc or gcc, macOS default clang)
  • --cxx=XXX: Specifies the execution command of the C++ language compiler (Linux defaults to g++, macOS defaults to clang++)
  • --with-clean: clean up old make files before compiling PHP
  • --enable-zts: Make compiled PHP thread-safe version (default is NTS version)
  • --no-strip: Do not run strip after compiling the PHP library to trim the binary file to reduce its size (the macOS binary file without trim can use dynamically linked third-party extensions)
  • --with-libs=XXX,YYY: Compile the specified dependent library before compiling PHP, and activate some extended optional functions (such as libavif of the gd library, etc.)
  • --with-config-file-path=XXX: Set the path in which to look for php.ini (Check here for default paths)
  • --with-config-file-scan-dir=XXX: Set the directory to scan for .ini files after reading php.ini (Check here for default paths)
  • -I xxx=yyy: Hard compile INI options into PHP before compiling (support multiple options, alias is --with-hardcoded-ini)
  • --with-micro-fake-cli: When compiling micro, let micro's PHP_SAPI pretend to be cli (for compatibility with some programs that check PHP_SAPI)
  • --disable-opcache-jit: Disable opcache jit (enabled by default)
  • -P xxx.php: Inject external scripts during static-php-cli compilation (see Inject external scripts below for details)
  • --without-micro-ext-test: After building micro.sfx, do not test the running results of different extensions in micro.sfx
  • --with-suggested-exts: Add ext-suggests as dependencies when compiling
  • --with-suggested-libs: Add lib-suggests as dependencies when compiling
  • --with-upx-pack: Use UPX to reduce the size of the binary file after compilation (you need to use bin/spc install-pkg upx to install upx first)
  • --build-shared=XXX,YYY: compile the specified extension into a shared library (the default is to compile into a static library)

For hardcoding INI options, it works for cli, micro, embed sapi. Here is a simple example where we preset a larger memory_limit and disable the system function:

bash
bin/spc build bcmath,pcntl,posix --build-all -I "memory_limit=4G" -I "disable_functions=system"

Debug

If you encounter problems during the compilation process, or want to view each executing shell command, you can use --debug to enable debug mode and view all terminal logs:

bash
bin/spc build mysqlnd,pdo_mysql --build-all --debug

Command - micro:combine

Use the micro:combine command to build the compiled micro.sfx and your code (.php or .phar file) into an executable binary. You can also use this command to directly build a micro binary injected with ini configuration.

TIP

Injecting ini configuration refers to adding a special structure after micro.sfx to save ini configuration items before combining micro.sfx with PHP source code.

micro.sfx can identify the INI file header through a special byte, and the micro can be started with INI through the INI file header.

The original wiki of this feature is in phpmicro - Wiki, and this feature may change in the future.

The following is the general usage, directly packaging the php source code into a file:

bash
# Before doing the packaging process, you should use `build --build-micro` to compile micro.sfx
+bin/spc build bcmath,curl,openssl,ftp,posix,pcntl --build-cli

Build Options

During the compilation process, in some special cases, the compiler and the content of the compilation directory need to be intervened. You can try to use the following commands:

  • --cc=XXX: Specifies the execution command of the C language compiler (Linux default musl-gcc or gcc, macOS default clang)
  • --cxx=XXX: Specifies the execution command of the C++ language compiler (Linux defaults to g++, macOS defaults to clang++)
  • --with-clean: clean up old make files before compiling PHP
  • --enable-zts: Make compiled PHP thread-safe version (default is NTS version)
  • --no-strip: Do not run strip after compiling the PHP library to trim the binary file to reduce its size (the macOS binary file without trim can use dynamically linked third-party extensions)
  • --with-libs=XXX,YYY: Compile the specified dependent library before compiling PHP, and activate some extended optional functions (such as libavif of the gd library, etc.)
  • --with-config-file-path=XXX: Set the path in which to look for php.ini (Check here for default paths)
  • --with-config-file-scan-dir=XXX: Set the directory to scan for .ini files after reading php.ini (Check here for default paths)
  • -I xxx=yyy: Hard compile INI options into PHP before compiling (support multiple options, alias is --with-hardcoded-ini)
  • --with-micro-fake-cli: When compiling micro, let micro's PHP_SAPI pretend to be cli (for compatibility with some programs that check PHP_SAPI)
  • --disable-opcache-jit: Disable opcache jit (enabled by default)
  • -P xxx.php: Inject external scripts during static-php-cli compilation (see Inject external scripts below for details)
  • --without-micro-ext-test: After building micro.sfx, do not test the running results of different extensions in micro.sfx
  • --with-suggested-exts: Add ext-suggests as dependencies when compiling
  • --with-suggested-libs: Add lib-suggests as dependencies when compiling
  • --with-upx-pack: Use UPX to reduce the size of the binary file after compilation (you need to use bin/spc install-pkg upx to install upx first)
  • --build-shared=XXX,YYY: compile the specified extension into a shared library (the default is to compile into a static library)

For hardcoding INI options, it works for cli, micro, embed sapi. Here is a simple example where we preset a larger memory_limit and disable the system function:

bash
bin/spc build bcmath,pcntl,posix --build-all -I "memory_limit=4G" -I "disable_functions=system"

Debug

If you encounter problems during the compilation process, or want to view each executing shell command, you can use --debug to enable debug mode and view all terminal logs:

bash
bin/spc build mysqlnd,pdo_mysql --build-all --debug

Command - micro:combine

Use the micro:combine command to build the compiled micro.sfx and your code (.php or .phar file) into an executable binary. You can also use this command to directly build a micro binary injected with ini configuration.

TIP

Injecting ini configuration refers to adding a special structure after micro.sfx to save ini configuration items before combining micro.sfx with PHP source code.

micro.sfx can identify the INI file header through a special byte, and the micro can be started with INI through the INI file header.

The original wiki of this feature is in phpmicro - Wiki, and this feature may change in the future.

The following is the general usage, directly packaging the php source code into a file:

bash
# Before doing the packaging process, you should use `build --build-micro` to compile micro.sfx
 echo "<?php echo 'hello';" > a.php
 bin/spc micro:combine a.php
 
 # Just use it
-./my-app

You can use the following options to specify the file name to be output, and you can also specify micro.sfx in other paths for packaging.

bash
# specify the output filename
+./my-app

You can use the following options to specify the file name to be output, and you can also specify micro.sfx in other paths for packaging.

bash
# specify the output filename
 bin/spc micro:combine a.php --output=custom-bin
 # Use absolute path
 bin/spc micro:combine a.php -O /tmp/my-custom-app
 
 # Specify micro.sfx in other locations for packaging
-bin/spc micro:combine a.app --with-micro=/path/to/your/micro.sfx

If you want to inject ini configuration items, you can use the following parameters to add ini to the executable file from a file or command line option.

bash
# Specified using command-line options (-I is shorthand for --with-ini-set)
+bin/spc micro:combine a.app --with-micro=/path/to/your/micro.sfx

If you want to inject ini configuration items, you can use the following parameters to add ini to the executable file from a file or command line option.

bash
# Specified using command-line options (-I is shorthand for --with-ini-set)
 bin/spc micro:combine a.php -I "a=b" -I "foo=bar"
 
 # Use ini file specification (-N is shorthand for --with-ini-file)
-bin/spc micro:combine a.php -N /path/to/your/custom.ini

WARNING

Note, please do not directly use the PHP source code or the php.ini file in the system-installed PHP, it is best to manually write an ini configuration file that you need, for example:

ini
; custom.ini
+bin/spc micro:combine a.php -N /path/to/your/custom.ini

WARNING

Note, please do not directly use the PHP source code or the php.ini file in the system-installed PHP, it is best to manually write an ini configuration file that you need, for example:

ini
; custom.ini
 curl.cainfo=/path/to/your/cafile.pem
-memory_limit=1G

The ini injection of this command is achieved by appending a special structure after micro.sfx, which is different from the function of inserting hard-coded INI during compilation.

If you want to package phar, just replace a.php with the packaged phar file. But please note that micro.sfx under phar needs extra attention to the path problem, see Developing - Phar directory issue.

Command - extract

Use the command bin/spc extract to unpack and copy the source code required for compilation, including php-src and the source code of various dependent libraries (you need to specify the name of the library to be unpacked).

For example, after we have downloaded sources, we want to distribute and execute the build process, manually unpack and copy the package to a specified location, and we can use commands.

bash
# Unzip the downloaded compressed package of php-src and libxml2, and store the decompressed source code in the source directory
-bin/spc extract php-src,libxml2

Command - dump-extensions

Use the command bin/spc dump-extensions to export required extensions of the current project.

bash
# Print the extension list of the project, pass in the root directory of the project containing composer.json
+memory_limit=1G

The ini injection of this command is achieved by appending a special structure after micro.sfx, which is different from the function of inserting hard-coded INI during compilation.

If you want to package phar, just replace a.php with the packaged phar file. But please note that micro.sfx under phar needs extra attention to the path problem, see Developing - Phar directory issue.

Command - extract

Use the command bin/spc extract to unpack and copy the source code required for compilation, including php-src and the source code of various dependent libraries (you need to specify the name of the library to be unpacked).

For example, after we have downloaded sources, we want to distribute and execute the build process, manually unpack and copy the package to a specified location, and we can use commands.

bash
# Unzip the downloaded compressed package of php-src and libxml2, and store the decompressed source code in the source directory
+bin/spc extract php-src,libxml2

Command - dump-extensions

Use the command bin/spc dump-extensions to export required extensions of the current project.

bash
# Print the extension list of the project, pass in the root directory of the project containing composer.json
 bin/spc dump-extensions /path/to/your/project/
 
 # Print the extension list of the project, excluding development dependencies
@@ -153,7 +154,7 @@
 bin/spc dump-extensions /path-to/your/project/ --no-ext-output=mbstring,posix,pcntl,phar
 
 # Do not exclude extensions not supported by spc when outputting
-bin/spc dump-extensions /path/to/your/project/ --no-spc-filter

It should be noted that the project directory must contain the vendor/installed.json and composer.lock files, otherwise they cannot be found normally.

Dev Command - dev

Debug commands refer to a collection of commands that can assist in outputting some information when you use static-php-cli to build PHP or modify and enhance the static-php-cli project itself.

  • dev:extensions: output all currently supported extension names, or output the specified extension information
  • dev:php-version: output the currently compiled PHP version (by reading php_version.h)
  • dev:sort-config: Sort the list of configuration files in the config/ directory in alphabetical order
  • dev:lib-ver <lib-name>: Read the version from the source code of the dependency library (only available for specific dependency libraries)
  • dev:ext-ver <ext-name>: Read the corresponding version from the source code of the extension (only available for specific extensions)
  • dev:pack-lib <lib-name>: Package the specified library into a tar.gz file (maintainer only)
  • dev:gen-ext-docs: Generate extension documentation (maintainer only)
bash
# output all extensions information
+bin/spc dump-extensions /path/to/your/project/ --no-spc-filter

It should be noted that the project directory must contain the vendor/installed.json and composer.lock files, otherwise they cannot be found normally.

Dev Command - dev

Debug commands refer to a collection of commands that can assist in outputting some information when you use static-php-cli to build PHP or modify and enhance the static-php-cli project itself.

  • dev:extensions: output all currently supported extension names, or output the specified extension information
  • dev:php-version: output the currently compiled PHP version (by reading php_version.h)
  • dev:sort-config: Sort the list of configuration files in the config/ directory in alphabetical order
  • dev:lib-ver <lib-name>: Read the version from the source code of the dependency library (only available for specific dependency libraries)
  • dev:ext-ver <ext-name>: Read the corresponding version from the source code of the extension (only available for specific extensions)
  • dev:pack-lib <lib-name>: Package the specified library into a tar.gz file (maintainer only)
  • dev:gen-ext-docs: Generate extension documentation (maintainer only)
bash
# output all extensions information
 bin/spc dev:extensions
 
 # Output the meta information of the specified extension
@@ -169,7 +170,7 @@
 bin/spc dev:php-version
 
 # Sort the configuration files in the config/ directory in alphabetical order (e.g. ext.json)
-bin/spc dev:sort-config ext

Command - install-pkg

Use the command bin/spc install-pkg to download some precompiled or closed source tools and install them into the pkgroot directory.

When bin/spc doctor automatically repairs the Windows environment, tools such as nasm and perl will be downloaded, and the installation process of install-pkg will also be used.

Here is an example of installing the tool:

  • Download and install UPX (Linux and Windows only): bin/spc install-pkg upx

Command - del-download

In some cases, you need to delete single or multiple specified download source files and re-download them, such as switching PHP versions. The bin/spc del-download command is provided after the 2.1.0-beta.4 version. Specified source files can be deleted.

Deletes downloaded source files containing precompiled packages and source code named as keys in source.json or pkg.json. Here are some examples:

  • Delete the old PHP source code and switch to download the 8.3 version: bin/spc del-download php-src && bin/spc download php-src --with-php=8.3
  • Delete the download file of redis extension: bin/spc del-download redis
  • Delete the downloaded musl-toolchain x86_64: bin/spc del-download musl-toolchain-x86_64-linux

Inject External Script

Injecting external scripts refers to inserting one or more scripts during the static-php-cli compilation process to more flexibly support parameter modifications and source code patches in different environments.

Under normal circumstances, this function mainly solves the problem that the patch cannot be modified by modifying the static-php-cli code when compiling with spc binary.

There is another situation: your project directly depends on the crazywhalecc/static-php-cli repository and is synchronized with main branch, but some proprietary modifications are required, and these feature are not suitable for merging into the main branch.

In view of the above situation, in the official version 2.0.0, static-php-cli has added multiple event trigger points. You can write an external xx.php script and pass it in through the command line parameter -P and execute.

When writing to inject external scripts, the methods you will use are builder() and patch_point(). Among them, patch_point() obtains the name of the current event, and builder() obtains the BuilderBase object.

Because the incoming patch point does not distinguish between events, you must write the code you want to execute in if(patch_point() === 'your_event_name'), otherwise it will be executed repeatedly in other events.

The following are the supported patch_point event names and corresponding locations:

Event nameEvent description
before-libs-extractTriggered before the dependent libraries extracted
after-libs-extractTriggered after the compiled dependent libraries extracted
before-php-extractTriggered before PHP source code extracted
after-php-extractTriggered after PHP source code extracted
before-micro-extractTriggered before phpmicro extract
after-micro-extractTriggered after phpmicro extracted
before-exts-extractTriggered before the extension (to be compiled) extracted to the PHP source directory
after-exts-extractTriggered after the extension extracted to the PHP source directory
before-library[name]-buildTriggered before the library named name is compiled (such as before-library[postgresql]-build)
after-library[name]-buildTriggered after the library named name is compiled
before-php-buildconfTriggered before compiling PHP command ./buildconf
before-php-configureTriggered before compiling PHP command ./configure
before-php-makeTriggered before compiling PHP command make
before-sanity-checkTriggered after compiling PHP but before running extended checks

The following is a simple example of temporarily modifying the PHP source code. Enable the CLI function to search for the php.ini configuration in the current working directory:

php
// a.php
+bin/spc dev:sort-config ext

Command - install-pkg

Use the command bin/spc install-pkg to download some precompiled or closed source tools and install them into the pkgroot directory.

When bin/spc doctor automatically repairs the Windows environment, tools such as nasm and perl will be downloaded, and the installation process of install-pkg will also be used.

Here is an example of installing the tool:

  • Download and install UPX (Linux and Windows only): bin/spc install-pkg upx

Command - del-download

In some cases, you need to delete single or multiple specified download source files and re-download them, such as switching PHP versions. The bin/spc del-download command is provided after the 2.1.0-beta.4 version. Specified source files can be deleted.

Deletes downloaded source files containing precompiled packages and source code named as keys in source.json or pkg.json. Here are some examples:

  • Delete the old PHP source code and switch to download the 8.3 version: bin/spc del-download php-src && bin/spc download php-src --with-php=8.3
  • Delete the download file of redis extension: bin/spc del-download redis
  • Delete the downloaded musl-toolchain x86_64: bin/spc del-download musl-toolchain-x86_64-linux

Inject External Script

Injecting external scripts refers to inserting one or more scripts during the static-php-cli compilation process to more flexibly support parameter modifications and source code patches in different environments.

Under normal circumstances, this function mainly solves the problem that the patch cannot be modified by modifying the static-php-cli code when compiling with spc binary.

There is another situation: your project directly depends on the crazywhalecc/static-php-cli repository and is synchronized with main branch, but some proprietary modifications are required, and these feature are not suitable for merging into the main branch.

In view of the above situation, in the official version 2.0.0, static-php-cli has added multiple event trigger points. You can write an external xx.php script and pass it in through the command line parameter -P and execute.

When writing to inject external scripts, the methods you will use are builder() and patch_point(). Among them, patch_point() obtains the name of the current event, and builder() obtains the BuilderBase object.

Because the incoming patch point does not distinguish between events, you must write the code you want to execute in if(patch_point() === 'your_event_name'), otherwise it will be executed repeatedly in other events.

The following are the supported patch_point event names and corresponding locations:

Event nameEvent description
before-libs-extractTriggered before the dependent libraries extracted
after-libs-extractTriggered after the compiled dependent libraries extracted
before-php-extractTriggered before PHP source code extracted
after-php-extractTriggered after PHP source code extracted
before-micro-extractTriggered before phpmicro extract
after-micro-extractTriggered after phpmicro extracted
before-exts-extractTriggered before the extension (to be compiled) extracted to the PHP source directory
after-exts-extractTriggered after the extension extracted to the PHP source directory
before-library[name]-buildTriggered before the library named name is compiled (such as before-library[postgresql]-build)
after-library[name]-buildTriggered after the library named name is compiled
before-php-buildconfTriggered before compiling PHP command ./buildconf
before-php-configureTriggered before compiling PHP command ./configure
before-php-makeTriggered before compiling PHP command make
before-sanity-checkTriggered after compiling PHP but before running extended checks

The following is a simple example of temporarily modifying the PHP source code. Enable the CLI function to search for the php.ini configuration in the current working directory:

php
// a.php
 <?php
 // patch it before `./buildconf` executed
 if (patch_point() === 'before-php-buildconf') {
@@ -178,20 +179,20 @@
         'sapi_module->php_ini_ignore_cwd = 1;',
         'sapi_module->php_ini_ignore_cwd = 0;'
     );
-}
bash
bin/spc build mbstring --build-cli -P a.php
+}
bash
bin/spc build mbstring --build-cli -P a.php
 # Write in ./
-echo 'memory_limit=8G' > ./php.ini
$ buildroot/bin/php -i | grep Loaded
+echo 'memory_limit=8G' > ./php.ini
$ buildroot/bin/php -i | grep Loaded
 Loaded Configuration File => /Users/jerry/project/git-project/static-php-cli/php.ini
 
 $ buildroot/bin/php -i | grep memory
-memory_limit => 8G => 8G

For the objects, methods and interfaces supported by static-php-cli, you can read the source code. Most methods and objects have corresponding comments.

Commonly used objects and functions using the -P function are:

  • SPC\store\FileSystem: file management class
    • ::replaceFileStr(string $filename, string $search, $replace): Replace file string content
    • ::replaceFileStr(string $filename, string $pattern, $replace): Regularly replace file content
    • ::replaceFileUser(string $filename, $callback): User-defined function replaces file content
    • ::copyDir(string $from, string $to): Recursively copy a directory to another location
    • ::convertPath(string $path): Convert the path delimiter to the current system delimiter
    • ::scanDirFiles(string $dir, bool $recursive = true, bool|string $relative = false, bool $include_dir = false): Traverse directory files
  • SPC\builder\BuilderBase: Build object
    • ->getPatchPoint(): Get the current injection point name
    • ->getOption(string $key, $default = null): Get command line and compile-time options
    • ->getPHPVersionID(): Get the currently compiled PHP version ID
    • ->getPHPVersion(): Get the currently compiled PHP version number
    • ->setOption(string $key, $value): Set options
    • ->setOptionIfNotExists(string $key, $value): Set option if option does not exist

TIP

static-php-cli has many open methods, which cannot be listed in the docs, but as long as it is a public function and is not marked as @internal, it theoretically can be called.

Multiple builds

If you need to build multiple times locally, the following method can save you time downloading resources and compiling.

  • If you only switch the PHP version without changing the dependent libraries, you can use bin/spc switch-php-version to quickly switch the PHP version, and then re-run the same build command.
  • If you want to rebuild once, but do not re-download the source code, you can first rm -rf buildroot source to delete the compilation directory and source code directory, and then rebuild.
  • If you want to update a version of a dependency, you can use bin/spc del-download <source-name> to delete the specified source code, and then use download <source-name> to download it again.
  • If you want to update all dependent versions, you can use bin/spc download --clean to delete all downloaded sources, and then download them again.

embed usage

If you want to embed static-php into other C language programs, you can use --build-embed to build an embed version of PHP.

bash
bin/spc build {your extensions} --build-embed --debug

Under normal circumstances, PHP embed will generate php-config after compilation. For static-php, we provide spc-config to obtain the parameters during compilation. In addition, when using embed SAPI (libphp.a), you need to use the same compiler as libphp, otherwise there will be a link error.

Here is the basic usage of spc-config:

bash
# output all flags and options
+memory_limit => 8G => 8G

For the objects, methods and interfaces supported by static-php-cli, you can read the source code. Most methods and objects have corresponding comments.

Commonly used objects and functions using the -P function are:

  • SPC\store\FileSystem: file management class
    • ::replaceFileStr(string $filename, string $search, $replace): Replace file string content
    • ::replaceFileStr(string $filename, string $pattern, $replace): Regularly replace file content
    • ::replaceFileUser(string $filename, $callback): User-defined function replaces file content
    • ::copyDir(string $from, string $to): Recursively copy a directory to another location
    • ::convertPath(string $path): Convert the path delimiter to the current system delimiter
    • ::scanDirFiles(string $dir, bool $recursive = true, bool|string $relative = false, bool $include_dir = false): Traverse directory files
  • SPC\builder\BuilderBase: Build object
    • ->getPatchPoint(): Get the current injection point name
    • ->getOption(string $key, $default = null): Get command line and compile-time options
    • ->getPHPVersionID(): Get the currently compiled PHP version ID
    • ->getPHPVersion(): Get the currently compiled PHP version number
    • ->setOption(string $key, $value): Set options
    • ->setOptionIfNotExists(string $key, $value): Set option if option does not exist

TIP

static-php-cli has many open methods, which cannot be listed in the docs, but as long as it is a public function and is not marked as @internal, it theoretically can be called.

Multiple builds

If you need to build multiple times locally, the following method can save you time downloading resources and compiling.

  • If you only switch the PHP version without changing the dependent libraries, you can use bin/spc switch-php-version to quickly switch the PHP version, and then re-run the same build command.
  • If you want to rebuild once, but do not re-download the source code, you can first rm -rf buildroot source to delete the compilation directory and source code directory, and then rebuild.
  • If you want to update a version of a dependency, you can use bin/spc del-download <source-name> to delete the specified source code, and then use download <source-name> to download it again.
  • If you want to update all dependent versions, you can use bin/spc download --clean to delete all downloaded sources, and then download them again.

embed usage

If you want to embed static-php into other C language programs, you can use --build-embed to build an embed version of PHP.

bash
bin/spc build {your extensions} --build-embed --debug

Under normal circumstances, PHP embed will generate php-config after compilation. For static-php, we provide spc-config to obtain the parameters during compilation. In addition, when using embed SAPI (libphp.a), you need to use the same compiler as libphp, otherwise there will be a link error.

Here is the basic usage of spc-config:

bash
# output all flags and options
 bin/spc spc-config curl,zlib,phar,openssl
 
 # output libs
 bin/spc spc-config curl,zlib,phar,openssl --libs
 
 # output includes
-bin/spc spc-config curl,zlib,phar,openssl --includes

By default, static-php uses the following compilers on different systems:

  • macOS: clang
  • Linux (Alpine Linux): gcc
  • Linux (glibc based distros, x86_64): /usr/local/musl/bin/x86_64-linux-musl-gcc
  • Linux (glibc based distros, aarch64): /usr/local/musl/bin/aarch64-linux-musl-gcc
  • FreeBSD: clang

Here is an example of using embed SAPI:

c
// embed.c
+bin/spc spc-config curl,zlib,phar,openssl --includes

By default, static-php uses the following compilers on different systems:

  • macOS: clang
  • Linux (Alpine Linux): gcc
  • Linux (glibc based distros, x86_64): /usr/local/musl/bin/x86_64-linux-musl-gcc
  • Linux (glibc based distros, aarch64): /usr/local/musl/bin/aarch64-linux-musl-gcc
  • FreeBSD: clang

Here is an example of using embed SAPI:

c
// embed.c
 #include <sapi/embed/php_embed.h>
 
 int main(int argc,char **argv){
@@ -208,16 +209,16 @@
 
     PHP_EMBED_END_BLOCK()
     return 0;
-}
php
<?php 
+}
php
<?php 
 // embed.php
-echo "Hello world!\n";
bash
# compile in debian/ubuntu x86_64
+echo "Hello world!\n";
bash
# compile in debian/ubuntu x86_64
 /usr/local/musl/bin/x86_64-linux-musl-gcc embed.c $(bin/spc spc-config bcmath,zlib) -static -o embed
 # compile in macOS/FreeBSD
 clang embed.c $(bin/spc spc-config bcmath,zlib) -o embed
 
 ./embed
-# out: Hello world!

Released under the MIT License.

- +# out: Hello world!

Released under the MIT License.

+ \ No newline at end of file diff --git a/en/guide/troubleshooting.html b/en/guide/troubleshooting.html index 517e6da4..ace2fedb 100644 --- a/en/guide/troubleshooting.html +++ b/en/guide/troubleshooting.html @@ -5,20 +5,21 @@ Troubleshooting | static-php-cli - - + + + - + - - - + + + -
Skip to content

Troubleshooting

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.

Download Failure

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. After encountering a download failure, you can try to call the download command multiple times.

When downloading extensions, you may eventually see errors like curl: (56) The requested URL returned error: 403 which are often caused by github rate limiting. You can verify this by adding --debug to the command and will see something like [DEBU] Running command (no output) : curl -sfSL "https://api.github.com/repos/openssl/openssl/releases".

To fix this, create a personal access token on GitHub and set it as an environment variable GITHUB_TOKEN=<XXX>.

If you confirm that the address is indeed inaccessible, you can submit an Issue or PR to update the url or download type.

Doctor Can't Fix Something

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.

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 Some check items can not be fixed, 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.

Compile Error

When you encounter a compilation error, if the --debug 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 spc command and parameters used.

If you are rebuilding, please refer to the Local Build - Multiple Builds section.

Released under the MIT License.

- +
Skip to content

Troubleshooting

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.

Download Failure

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. After encountering a download failure, you can try to call the download command multiple times.

When downloading extensions, you may eventually see errors like curl: (56) The requested URL returned error: 403 which are often caused by github rate limiting. You can verify this by adding --debug to the command and will see something like [DEBU] Running command (no output) : curl -sfSL "https://api.github.com/repos/openssl/openssl/releases".

To fix this, create a personal access token on GitHub and set it as an environment variable GITHUB_TOKEN=<XXX>.

If you confirm that the address is indeed inaccessible, you can submit an Issue or PR to update the url or download type.

Doctor Can't Fix Something

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.

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 Some check items can not be fixed, 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.

Compile Error

When you encounter a compilation error, if the --debug 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 spc command and parameters used.

If you are rebuilding, please refer to the Local Build - Multiple Builds section.

Released under the MIT License.

+ \ No newline at end of file diff --git a/en/index.html b/en/index.html index 21db406c..86fef077 100644 --- a/en/index.html +++ b/en/index.html @@ -5,20 +5,21 @@ static-php-cli - - + + + - + - - - + + + -
Skip to content

static-php-cli

Build standalone PHP binary on Linux, macOS, FreeBSD, Windows, with PHP project together, with popular extensions included.

Released under the MIT License.

- +
Skip to content

static-php-cli

Build standalone PHP binary on Linux, macOS, FreeBSD, Windows, with PHP project together, with popular extensions included.

Released under the MIT License.

+ \ No newline at end of file diff --git a/extension-notes.html b/extension-notes.html index 31243e5e..2cd9138e 100644 --- a/extension-notes.html +++ b/extension-notes.html @@ -5,20 +5,21 @@ static-php-cli - - + + + - + - - - + + + -
Skip to content
- +
Skip to content
+ \ No newline at end of file diff --git a/extensions.html b/extensions.html index e602476a..efbd638a 100644 --- a/extensions.html +++ b/extensions.html @@ -5,20 +5,21 @@ static-php-cli - - + + + - + - - - + + + -
Skip to content
Extension NameLinuxmacOSFreeBSDWindows
amqpyesyesyes
apcuyesyesyesyes
astyesyesyesyes
bcmathyesyesyesyes
bz2yesyesyesyes
calendaryesyesyesyes
ctypeyesyesyesyes
curlyesyesyesyes
dbayesyesyesyes
dioyesyesyes
domyesyesyes
dsyesyesyesyes
enchant
evyesyesyesyes
eventyesyes
exifyesyesyesyes
ffipartialyesyes
fileinfoyesyesyesyes
filteryesyesyesyes
ftpyesyesyesyes
gdyesyesyes
gettextyesyes
glfwnoyesno
gmpyesyes
gmsslyesyesyes
grpcyesyes
iconvyesyesyes
igbinaryyesyesyes
imagickyesyes
imapyesyes
inotifyyesnono
intlyesyesno
ldapyesyes
lz4yesyes
libxmlyesyesyes
mbregexyesyesyesyes
mbstringyesyesyesyes
mcryptnononono
memcacheyesyes
memcachednoyes
mongodbyesyes
msgpackyesyesyes
mysqliyesyesyesyes
mysqlndyesyesyesyes
oci8nonono
odbcyesyes
opcacheyesyesyesyes
opensslyesyesyesyes
opentelemetryyesyesyes
parallelyesyesyes
password-argon2yesyes
pcntlyesyesyesno
pdoyesyesyesyes
pdo_mysqlyesyesyesyes
pdo_odbcyesyesyes
pdo_pgsqlyesyesyes
pdo_sqliteyesyesyes
pdo_sqlsrvyesyesyes
pgsqlyesyesyes
pharyesyesyesyes
posixyesyesyesno
protobufyesyes
raryespartialyes
rdkafkayesyes
readlineyesyes
redisyesyesyes
sessionyesyesyesyes
shmopyesyesyesyes
simdjsonyesyesyesyes
simplexmlyesyesyes
snappyyesyes
soapyesyesyes
socketsyesyesyesyes
sodiumyesyesyes
spxyesyesno
sqlite3yesyesyes
sqlsrvyesyesyes
ssh2yesyesyes
swooleyesyesno
swoole-hook-mysqlyesyesno
swoole-hook-pgsqlyespartialno
swoole-hook-sqliteyesyesno
swowyesyesyes
sysvmsgyesyesno
sysvsemyesyesno
sysvshmyesyesyes
tidyyesyes
tokenizeryesyesyesyes
uuidyesyes
uvyesyes
xdebugpartialpartialno
xhprofyesyes
xlswriteryesyesyes
xmlyesyesyes
xmlreaderyesyesyes
xmlwriteryesyesyes
xslyesyes
yacyesyesyes
yamlyesyesyes
zipyesyesyes
zlibyesyesyesyes
zstdyesyes
- +
Skip to content
Extension NameLinuxmacOSFreeBSDWindows
amqpyesyesyes
apcuyesyesyesyes
astyesyesyesyes
bcmathyesyesyesyes
brotliyesyesyesyes
bz2yesyesyesyes
calendaryesyesyesyes
ctypeyesyesyesyes
curlyesyesyesyes
dbayesyesyesyes
dioyesyesyes
domyesyesyes
dsyesyesyesyes
enchant
evyesyesyesyes
eventyesyes
exifyesyesyesyes
ffipartialyesyes
fileinfoyesyesyesyes
filteryesyesyesyes
ftpyesyesyesyes
gdyesyesyes
gettextyesyes
glfwnoyesno
gmpyesyes
gmsslyesyesyes
grpcyesyes
iconvyesyesyes
igbinaryyesyesyes
imagickyesyes
imapyesyes
inotifyyesnono
intlyesyesno
ldapyesyes
libxmlyesyesyes
lz4yesyes
mbregexyesyesyesyes
mbstringyesyesyesyes
mcryptnononono
memcacheyesyes
memcachedyesyes
mongodbyesyes
msgpackyesyesyes
mysqliyesyesyesyes
mysqlndyesyesyesyes
oci8nonono
odbcyesyes
opcacheyesyesyesyes
opensslyesyesyesyes
opentelemetryyesyesyes
parallelyesyesyes
password-argon2yesyes
pcntlyesyesyesno
pdoyesyesyesyes
pdo_mysqlyesyesyesyes
pdo_odbcyesyesyes
pdo_pgsqlyesyesyes
pdo_sqliteyesyesyes
pdo_sqlsrvyesyesyes
pgsqlyesyesyes
pharyesyesyesyes
posixyesyesyesno
protobufyesyes
raryespartialyes
rdkafkayesyes
readlineyesyes
redisyesyesyes
sessionyesyesyesyes
shmopyesyesyesyes
simdjsonyesyesyesyes
simplexmlyesyesyes
snappyyesyes
soapyesyesyes
socketsyesyesyesyes
sodiumyesyesyes
spxyesyesno
sqlite3yesyesyes
sqlsrvyesyesyes
ssh2yesyesyes
swooleyesyesno
swoole-hook-mysqlyesyesno
swoole-hook-pgsqlyespartialno
swoole-hook-sqliteyesyesno
swowyesyesyes
sysvmsgyesyesno
sysvsemyesyesno
sysvshmyesyesyes
tidyyesyes
tokenizeryesyesyesyes
uuidyesyes
uvyesyes
xdebugpartialpartialno
xhprofyesyes
xlswriteryesyesyes
xmlyesyesyes
xmlreaderyesyesyes
xmlwriteryesyesyes
xslyesyes
xzyesyesyesyes
yacyesyesyes
yamlyesyesyes
zipyesyesyes
zlibyesyesyesyes
zstdyesyes
+ \ No newline at end of file diff --git a/hashmap.json b/hashmap.json index 2710be7e..fa522c62 100644 --- a/hashmap.json +++ b/hashmap.json @@ -1 +1 @@ -{"en_contributing_index.md":"CsY8mx8F","en_develop_php-src-changes.md":"DLlooohw","en_develop_system-build-tools.md":"D6vaAwN3","en_develop_source-module.md":"CdOHR0ez","deps-craft-yml.md":"DdOLH9fb","en_develop_doctor-module.md":"DGd8PeM_","en_guide_build-on-windows.md":"0XosmiyO","en_guide_env-vars.md":"CMHjddfB","zh_guide_action-build.md":"DWMlBDvT","zh_develop_structure.md":"B-0RMSSw","en_guide_build-with-glibc.md":"CR2nDLf8","en_guide_action-build.md":"BKamBazh","en_guide_cli-generator.md":"BVb63i-q","en_develop_index.md":"B7_c9YYa","deps-map-lib.md":"D13FvK2Q","en_develop_structure.md":"BA5PDIse","en_faq_index.md":"Dk3Q4ZlV","deps-map-ext.md":"CKpfVu5J","en_index.md":"Cbpb4iAg","en_guide_extension-notes.md":"D_szqpv1","zh_index.md":"LslJ1UMp","en_guide_extensions.md":"CvNq1b9J","zh_develop_doctor-module.md":"DgFAPT6E","zh_guide_extension-notes.md":"BwAQ8Pky","zh_develop_system-build-tools.md":"Ds53VEw1","zh_guide_cli-generator.md":"BQovOB62","zh_guide_build-on-windows.md":"BxVEYT8r","zh_guide_deps-map.md":"DuTyzThf","zh_guide_env-vars.md":"C-N0X5FV","zh_develop_php-src-changes.md":"Df0-NcBw","en_develop_craft-yml.md":"B3k-Nl-b","en_guide_manual-build.md":"BU7HLqGh","zh_develop_source-module.md":"D0odLsHX","en_guide_index.md":"BScdGPaV","extensions.md":"B7vVUihc","en_guide_troubleshooting.md":"CTxnPJxK","index.md":"mKXtywCA","zh_contributing_index.md":"BvgdahxO","zh_guide_extensions.md":"HviYRhA7","zh_develop_craft-yml.md":"Crgeurk7","zh_develop_index.md":"-CPpDfMx","en_guide_deps-map.md":"C7t3AggN","zh_faq_index.md":"CGJwisr-","zh_guide_build-with-glibc.md":"6Wr3xgOs","zh_guide_manual-build.md":"Rx1xsyX8","extension-notes.md":"Bw8xYOie","zh_guide_index.md":"20ged7P4","zh_guide_troubleshooting.md":"DAr4n5J3"} +{"deps-craft-yml.md":"Bb12IlRQ","deps-map-ext.md":"BxLeBUVK","deps-map-lib.md":"DlxAq0L9","en_contributing_index.md":"C8tXDL1f","en_develop_craft-yml.md":"C4TSxsAG","en_develop_doctor-module.md":"DYVfKght","en_develop_index.md":"DSlquryN","en_develop_php-src-changes.md":"DadHFaGC","en_develop_source-module.md":"CeJEgS_j","en_develop_structure.md":"D1kBTweh","en_develop_system-build-tools.md":"DK4AaCy_","en_faq_index.md":"3yHOajzp","en_guide_action-build.md":"BCJvLz8l","en_guide_build-on-windows.md":"CG23CkLK","en_guide_build-with-glibc.md":"i6uYM8tR","en_guide_cli-generator.md":"Dbqc05Q2","en_guide_deps-map.md":"DqPbUPJ0","en_guide_env-vars.md":"DzVATbtO","en_guide_extension-notes.md":"DadE5Bxb","en_guide_extensions.md":"Bh08P1y7","en_guide_index.md":"BE1G5v55","en_guide_manual-build.md":"BCHDiDxK","en_guide_troubleshooting.md":"BvJgQKvb","en_index.md":"kO-e39M0","extension-notes.md":"DkpYDq7p","extensions.md":"pYqpfHc4","index.md":"Dnq-iVNo","zh_contributing_index.md":"7JN5xgrv","zh_develop_craft-yml.md":"BerY4loY","zh_develop_doctor-module.md":"B8r2lbU8","zh_develop_index.md":"BFWliVJD","zh_develop_php-src-changes.md":"CkjaMIky","zh_develop_source-module.md":"DoBnezP5","zh_develop_structure.md":"DStJTsYD","zh_develop_system-build-tools.md":"CxPkPV_h","zh_faq_index.md":"CZztxXAs","zh_guide_action-build.md":"BWFrjWwZ","zh_guide_build-on-windows.md":"6JBREABQ","zh_guide_build-with-glibc.md":"D6LGMZUS","zh_guide_cli-generator.md":"B8M2jXl2","zh_guide_deps-map.md":"DQXDDLu_","zh_guide_env-vars.md":"DqYHbUfS","zh_guide_extension-notes.md":"DoauYqMF","zh_guide_extensions.md":"CvO7qoz0","zh_guide_index.md":"DIAjAKH4","zh_guide_manual-build.md":"BjPCGg5B","zh_guide_troubleshooting.md":"B9WGHMIU","zh_index.md":"DcikGFee"} diff --git a/index.html b/index.html index c3b459b1..5f3191f9 100644 --- a/index.html +++ b/index.html @@ -5,20 +5,21 @@ static-php-cli - - + + + - + - - - + + + -
Skip to content

static-php-cli

Build standalone PHP binary on Linux, macOS, FreeBSD, Windows, with PHP project together, with popular extensions included.

- +
Skip to content

static-php-cli

Build standalone PHP binary on Linux, macOS, FreeBSD, Windows, with PHP project together, with popular extensions included.

+ \ No newline at end of file diff --git a/vp-icons.css b/vp-icons.css new file mode 100644 index 00000000..ddc5bd8e --- /dev/null +++ b/vp-icons.css @@ -0,0 +1 @@ +.vpi-social-github{--icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='24' height='24'%3E%3Cpath fill='black' d='M12 .297c-6.63 0-12 5.373-12 12c0 5.303 3.438 9.8 8.205 11.385c.6.113.82-.258.82-.577c0-.285-.01-1.04-.015-2.04c-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729c1.205.084 1.838 1.236 1.838 1.236c1.07 1.835 2.809 1.305 3.495.998c.108-.776.417-1.305.76-1.605c-2.665-.3-5.466-1.332-5.466-5.93c0-1.31.465-2.38 1.235-3.22c-.135-.303-.54-1.523.105-3.176c0 0 1.005-.322 3.3 1.23c.96-.267 1.98-.399 3-.405c1.02.006 2.04.138 3 .405c2.28-1.552 3.285-1.23 3.285-1.23c.645 1.653.24 2.873.12 3.176c.765.84 1.23 1.91 1.23 3.22c0 4.61-2.805 5.625-5.475 5.92c.42.36.81 1.096.81 2.22c0 1.606-.015 2.896-.015 3.286c0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12'/%3E%3C/svg%3E")} \ No newline at end of file diff --git a/zh/contributing/index.html b/zh/contributing/index.html index 5586fbf9..e5a7af64 100644 --- a/zh/contributing/index.html +++ b/zh/contributing/index.html @@ -5,20 +5,21 @@ 贡献指南 | static-php-cli - - + + + - + - - - + + + -
Skip to content

贡献指南

感谢你能够看到这里,本项目非常欢迎你的贡献!

贡献方法

如果你有代码或文档想要贡献,需要先了解以下内容。

  1. 你要贡献什么类型的代码?(新扩展、修复 Bug、安全问题、项目框架优化、文档)
  2. 如果你贡献了新文件或新片段,你的代码是否经过 php-cs-fixerphpstan 的检查?
  3. 在贡献代码前是否充分阅读了 开发指南

如果你可以回答以上问题,并已经对代码做出了修改,可以及时在项目 GitHub 仓库发起 Pull Request。待代码审查完毕后,可根据建议修改代码,或直接合并到主分支。

贡献类型

本项目主要用途是编译静态链接的 PHP 二进制,基于 symfony/console 编写了命令行处理功能。在开发之前,如果你对它不够熟悉, 可以先查看 symfony/console 文档

安全问题

因为本项目基本上是属于本地运行的 PHP 项目,一般来说不会存在远程攻击行为。但如果你发现了此类问题,请不要在 GitHub 仓库提交 PR 或 Issue, 你需要通过 邮件 的方式联系项目维护者(crazywhalecc)。

修复 Bug

修复 Bug 一般不涉及项目结构和框架的修改,所以如果你可以定位到错误代码并直接修复它,请直接提交 PR。

新扩展

对于添加一个新扩展来说,你需要先了解一些本项目的基本结构,以及如何根据现有的逻辑添加新扩展。在本页的下一章节将会详细介绍。 总的来说,你需要:

  1. 评估扩展是否可以内联编译到 PHP 中。
  2. 评估扩展的依赖库(如果有)是否可以静态编译。
  3. 写出扩展的依赖库在不同平台编译命令。
  4. 验证扩展及其依赖库能否与现有扩展和依赖库兼容。
  5. 验证扩展在 climicrofpmembed 几种 SAPI 中均正常工作。
  6. 编写文档,加入你的扩展。

项目框架优化

如果你已经熟悉 symfony/console 的工作原理,并同时要对项目的框架进行一些修改或优化,请先了解以下事情:

  1. 加入扩展不属于项目框架优化,但如果你在加入新的扩展时发现不得不优化框架,则需先对框架本身进行修改,然后再加入扩展。
  2. 对于一些大规模逻辑修改(例如涉及 LibraryBase、Extension 对象等的修改)时,建议先提交 Issue 或 Draft PR 进行讨论方案。
  3. 项目早期为纯中文开发项目,代码中存在一部分中文的注释。国际化项目后你可以提交 PR 将这些注释翻译为英语。
  4. 请不要在代码中提交包含较多无用的代码片段,例如大量未被使用的变量、方法、类、重复写了很多次的代码。

Released under the MIT License.

- +
Skip to content

贡献指南

感谢你能够看到这里,本项目非常欢迎你的贡献!

贡献方法

如果你有代码或文档想要贡献,需要先了解以下内容。

  1. 你要贡献什么类型的代码?(新扩展、修复 Bug、安全问题、项目框架优化、文档)
  2. 如果你贡献了新文件或新片段,你的代码是否经过 php-cs-fixerphpstan 的检查?
  3. 在贡献代码前是否充分阅读了 开发指南

如果你可以回答以上问题,并已经对代码做出了修改,可以及时在项目 GitHub 仓库发起 Pull Request。待代码审查完毕后,可根据建议修改代码,或直接合并到主分支。

贡献类型

本项目主要用途是编译静态链接的 PHP 二进制,基于 symfony/console 编写了命令行处理功能。在开发之前,如果你对它不够熟悉, 可以先查看 symfony/console 文档

安全问题

因为本项目基本上是属于本地运行的 PHP 项目,一般来说不会存在远程攻击行为。但如果你发现了此类问题,请不要在 GitHub 仓库提交 PR 或 Issue, 你需要通过 邮件 的方式联系项目维护者(crazywhalecc)。

修复 Bug

修复 Bug 一般不涉及项目结构和框架的修改,所以如果你可以定位到错误代码并直接修复它,请直接提交 PR。

新扩展

对于添加一个新扩展来说,你需要先了解一些本项目的基本结构,以及如何根据现有的逻辑添加新扩展。在本页的下一章节将会详细介绍。 总的来说,你需要:

  1. 评估扩展是否可以内联编译到 PHP 中。
  2. 评估扩展的依赖库(如果有)是否可以静态编译。
  3. 写出扩展的依赖库在不同平台编译命令。
  4. 验证扩展及其依赖库能否与现有扩展和依赖库兼容。
  5. 验证扩展在 climicrofpmembed 几种 SAPI 中均正常工作。
  6. 编写文档,加入你的扩展。

项目框架优化

如果你已经熟悉 symfony/console 的工作原理,并同时要对项目的框架进行一些修改或优化,请先了解以下事情:

  1. 加入扩展不属于项目框架优化,但如果你在加入新的扩展时发现不得不优化框架,则需先对框架本身进行修改,然后再加入扩展。
  2. 对于一些大规模逻辑修改(例如涉及 LibraryBase、Extension 对象等的修改)时,建议先提交 Issue 或 Draft PR 进行讨论方案。
  3. 项目早期为纯中文开发项目,代码中存在一部分中文的注释。国际化项目后你可以提交 PR 将这些注释翻译为英语。
  4. 请不要在代码中提交包含较多无用的代码片段,例如大量未被使用的变量、方法、类、重复写了很多次的代码。

Released under the MIT License.

+ \ No newline at end of file diff --git a/zh/develop/craft-yml.html b/zh/develop/craft-yml.html index a92a1156..befa87cb 100644 --- a/zh/develop/craft-yml.html +++ b/zh/develop/craft-yml.html @@ -5,19 +5,20 @@ craft.yml 配置 | static-php-cli - - + + + - + - - - + + + -
Skip to content

craft.yml 配置

yaml
# PHP version to build (default: 8.4)
+    
Skip to content

craft.yml 配置

yaml
# PHP version to build (default: 8.4)
 php-version: 8.4
 # [REQUIRED] Static PHP extensions to build (list or comma-separated are both accepted)
 extensions: bcmath,fileinfo,phar,zlib,sodium,posix,pcntl
@@ -81,8 +82,8 @@
 # Extra environment variables
 extra-env:
   # e.g. Use github token to avoid rate limit
-  GITHUB_TOKEN: your-github-token

Released under the MIT License.

- + GITHUB_TOKEN: your-github-token

Released under the MIT License.

+ \ No newline at end of file diff --git a/zh/develop/doctor-module.html b/zh/develop/doctor-module.html index 36986f90..86b91322 100644 --- a/zh/develop/doctor-module.html +++ b/zh/develop/doctor-module.html @@ -5,19 +5,20 @@ Doctor 模块 | static-php-cli - - + + + - + - - - + + + -
Skip to content

Doctor 模块

Doctor 模块是一个较为独立的用于检查系统环境的模块,可使用命令 bin/spc doctor 进入,入口的命令类在 DoctorCommand.php 中。

Doctor 模块是一个检查单,里面有一系列的检查项目和自动修复项目。这些项目都存放在 src/SPC/doctor/item/ 目录中, 并且使用了两种 Attribute 用作检查项标记和自动修复项目标记:#[AsCheckItem]#[AsFixItem]

以现有的检查项 if necessary tools are installed,它是用于检查编译必需的包是否安装在 macOS 系统内,下面是它的源码:

php
use SPC\doctor\AsCheckItem;
+    
Skip to content

Doctor 模块

Doctor 模块是一个较为独立的用于检查系统环境的模块,可使用命令 bin/spc doctor 进入,入口的命令类在 DoctorCommand.php 中。

Doctor 模块是一个检查单,里面有一系列的检查项目和自动修复项目。这些项目都存放在 src/SPC/doctor/item/ 目录中, 并且使用了两种 Attribute 用作检查项标记和自动修复项目标记:#[AsCheckItem]#[AsFixItem]

以现有的检查项 if necessary tools are installed,它是用于检查编译必需的包是否安装在 macOS 系统内,下面是它的源码:

php
use SPC\doctor\AsCheckItem;
 use SPC\doctor\AsFixItem;
 use SPC\doctor\CheckResult;
 
@@ -34,7 +35,7 @@
         return CheckResult::fail('missing system commands: ' . implode(', ', $missing), 'build-tools', [$missing]);
     }
     return CheckResult::ok();
-}

属性的第一个参数就是检查项目的名称,后面的 limit_os 参数是限制了该检查项仅在指定的系统下触发,level 是执行该检查项的优先级,数字越大,优先级越高。

里面用到的 $this->findCommand() 方法为 SPC\builder\traits\UnixSystemUtilTrait 的方法,用途是查找系统命令所在位置,找不到时返回 NULL。

每个检查项的方法都应该返回一个 SPC\doctor\CheckResult

  • 在返回 CheckResult::fail() 时,第一个参数用于输出终端的错误提示,第二个参数是在这个检查项可自动修复时的修复项目名称。
  • 在返回 CheckResult::ok() 时,表明检查通过。你也可以传递一个参数,用于返回检查结果,例如:CheckResult::ok('OS supported')
  • 在返回 CheckResult::fail() 时,如果包含了第三个参数,第三个参数的数组将被当作 AsFixItem 的参数。

下面是这个检查项对应的自动修复项的方法:

php
#[AsFixItem('build-tools')]
+}

属性的第一个参数就是检查项目的名称,后面的 limit_os 参数是限制了该检查项仅在指定的系统下触发,level 是执行该检查项的优先级,数字越大,优先级越高。

里面用到的 $this->findCommand() 方法为 SPC\builder\traits\UnixSystemUtilTrait 的方法,用途是查找系统命令所在位置,找不到时返回 NULL。

每个检查项的方法都应该返回一个 SPC\doctor\CheckResult

  • 在返回 CheckResult::fail() 时,第一个参数用于输出终端的错误提示,第二个参数是在这个检查项可自动修复时的修复项目名称。
  • 在返回 CheckResult::ok() 时,表明检查通过。你也可以传递一个参数,用于返回检查结果,例如:CheckResult::ok('OS supported')
  • 在返回 CheckResult::fail() 时,如果包含了第三个参数,第三个参数的数组将被当作 AsFixItem 的参数。

下面是这个检查项对应的自动修复项的方法:

php
#[AsFixItem('build-tools')]
 public function fixBuildTools(array $missing): bool
 {
     foreach ($missing as $cmd) {
@@ -45,8 +46,8 @@
         }
     }
     return true;
-}

#[AsFixItem()] 属性传入的参数即修复项的名称,该方法必须返回 True 或 False。当返回 False 时,表明自动修复失败,需要手动处理。

此处的代码中 shell()->exec() 是项目的执行命令的方法,用于替代 exec()system(),同时提供了 debug、获取执行状态、进入目录等特性。

Released under the MIT License.

- +}

#[AsFixItem()] 属性传入的参数即修复项的名称,该方法必须返回 True 或 False。当返回 False 时,表明自动修复失败,需要手动处理。

此处的代码中 shell()->exec() 是项目的执行命令的方法,用于替代 exec()system(),同时提供了 debug、获取执行状态、进入目录等特性。

Released under the MIT License.

+ \ No newline at end of file diff --git a/zh/develop/index.html b/zh/develop/index.html index 0eb5ae3f..2524c9a4 100644 --- a/zh/develop/index.html +++ b/zh/develop/index.html @@ -5,20 +5,21 @@ 开发简介 | static-php-cli - - + + + - + - - - + + + -
Skip to content

开发简介

开发本项目需要安装部署 PHP 环境,以及一些 PHP 项目常用的扩展和 Composer。

项目的开发环境和运行环境几乎完全一致,你可以参照 指南-本地构建 部分安装系统 PHP 或使用本项目预构建的静态 PHP 作为环境,这里不再赘述。

抛开用途,本项目本身其实就是一个 php-cli 程序,你可以将它当作一个正常的 PHP 项目进行编辑和开发,同时你需要了解不同系统的 Shell 命令行。

本项目目前的目的就是为了编译静态编译的独立 PHP,但主体部分也包含编译很多依赖库的静态版本,所以你可以复用这套编译逻辑,用于构建其他程序的独立二进制版本,例如 Nginx 等。

环境准备

开发本项目需要 PHP 环境。你可以使用系统自带的 PHP,也可以使用本项目构建的静态 PHP。

无论是使用哪种 PHP,在开发环境,你需要安装这些扩展:

curl,dom,filter,mbstring,openssl,pcntl,phar,posix,sodium,tokenizer,xml,xmlwriter

static-php-cli 项目本身不需要这么多扩展,但在开发过程中,你会用到 Composer、PHPUnit 等工具,它们需要这些扩展。

对于 static-php-cli 自身构建的 micro 自执行二进制,仅需要 pcntl,posix,mbstring,tokenizer,phar

开始开发

继续向下查看项目结构的文档,你可以从中了解 static-php-cli 是如何运作的。

Released under the MIT License.

- +
Skip to content

开发简介

开发本项目需要安装部署 PHP 环境,以及一些 PHP 项目常用的扩展和 Composer。

项目的开发环境和运行环境几乎完全一致,你可以参照 指南-本地构建 部分安装系统 PHP 或使用本项目预构建的静态 PHP 作为环境,这里不再赘述。

抛开用途,本项目本身其实就是一个 php-cli 程序,你可以将它当作一个正常的 PHP 项目进行编辑和开发,同时你需要了解不同系统的 Shell 命令行。

本项目目前的目的就是为了编译静态编译的独立 PHP,但主体部分也包含编译很多依赖库的静态版本,所以你可以复用这套编译逻辑,用于构建其他程序的独立二进制版本,例如 Nginx 等。

环境准备

开发本项目需要 PHP 环境。你可以使用系统自带的 PHP,也可以使用本项目构建的静态 PHP。

无论是使用哪种 PHP,在开发环境,你需要安装这些扩展:

curl,dom,filter,mbstring,openssl,pcntl,phar,posix,sodium,tokenizer,xml,xmlwriter

static-php-cli 项目本身不需要这么多扩展,但在开发过程中,你会用到 Composer、PHPUnit 等工具,它们需要这些扩展。

对于 static-php-cli 自身构建的 micro 自执行二进制,仅需要 pcntl,posix,mbstring,tokenizer,phar

开始开发

继续向下查看项目结构的文档,你可以从中了解 static-php-cli 是如何运作的。

Released under the MIT License.

+ \ No newline at end of file diff --git a/zh/develop/php-src-changes.html b/zh/develop/php-src-changes.html index aab5f458..bcada720 100644 --- a/zh/develop/php-src-changes.html +++ b/zh/develop/php-src-changes.html @@ -5,20 +5,21 @@ 对 PHP 源码的修改 | static-php-cli - - + + + - + - - - + + + -
Skip to content

对 PHP 源码的修改

由于 static-php-cli 在静态编译过程中为了实现良好的兼容性、性能和安全性,对 PHP 源码进行了一些修改。下面是目前对 PHP 源码修改的说明。

micro 相关补丁

基于 phpmicro 项目提供的补丁,static-php-cli 对 PHP 源码进行了一些修改,以适应静态编译的需求。补丁列表 包含:

目前 static-php-cli 在编译时用到的补丁有:

  • static_opcache
  • static_extensions_win32
  • cli_checks
  • disable_huge_page
  • vcruntime140
  • win32
  • zend_stream
  • cli_static
  • macos_iconv
  • phar

PHP <= 8.1 libxml 补丁

因为 PHP 官方仅对 8.1 进行安全更新,旧版本停止更新,所以 static-php-cli 对 PHP 8.1 及以下版本应用了在新版本 PHP 中已经应用的 libxml 编译补丁。

gd 扩展 Windows 补丁

在 Windows 下编译 gd 扩展需要大幅改动 config.w32 文件,static-php-cli 对 gd 扩展进行了一些修改,使其在 Windows 下编译更加方便。

yaml 扩展 Windows 补丁

yaml 扩展在 Windows 下编译需要修改 config.w32 文件,static-php-cli 对 yaml 扩展进行了一些修改,使其在 Windows 下编译更加方便。

static-php-cli 版本信息插入

static-php-cli 在编译时会在 PHP 版本信息中插入 static-php-cli 的版本信息,以便于识别。

加入硬编码 INI 的选项

在使用 -I 参数硬编码 INI 到静态 PHP 的功能中,static-php-cli 会修改 PHP 源码以插入硬编码内容。

Linux 系统修复补丁

部分编译环境可能缺少一些头文件或库,static-php-cli 会在编译时自动修复这些问题,如:

  • HAVE_STRLCAT missing problem
  • HAVE_STRLCPY missing problem

Windows 系统下 Fiber 问题修复补丁

在 Windows 下编译 PHP 时,Fiber 扩展会出现一些问题,static-php-cli 会在编译时自动修复这些问题(修改 php-src 的 config.w32)。

Released under the MIT License.

- +
Skip to content

对 PHP 源码的修改

由于 static-php-cli 在静态编译过程中为了实现良好的兼容性、性能和安全性,对 PHP 源码进行了一些修改。下面是目前对 PHP 源码修改的说明。

micro 相关补丁

基于 phpmicro 项目提供的补丁,static-php-cli 对 PHP 源码进行了一些修改,以适应静态编译的需求。补丁列表 包含:

目前 static-php-cli 在编译时用到的补丁有:

  • static_opcache
  • static_extensions_win32
  • cli_checks
  • disable_huge_page
  • vcruntime140
  • win32
  • zend_stream
  • cli_static
  • macos_iconv
  • phar

PHP <= 8.1 libxml 补丁

因为 PHP 官方仅对 8.1 进行安全更新,旧版本停止更新,所以 static-php-cli 对 PHP 8.1 及以下版本应用了在新版本 PHP 中已经应用的 libxml 编译补丁。

gd 扩展 Windows 补丁

在 Windows 下编译 gd 扩展需要大幅改动 config.w32 文件,static-php-cli 对 gd 扩展进行了一些修改,使其在 Windows 下编译更加方便。

yaml 扩展 Windows 补丁

yaml 扩展在 Windows 下编译需要修改 config.w32 文件,static-php-cli 对 yaml 扩展进行了一些修改,使其在 Windows 下编译更加方便。

static-php-cli 版本信息插入

static-php-cli 在编译时会在 PHP 版本信息中插入 static-php-cli 的版本信息,以便于识别。

加入硬编码 INI 的选项

在使用 -I 参数硬编码 INI 到静态 PHP 的功能中,static-php-cli 会修改 PHP 源码以插入硬编码内容。

Linux 系统修复补丁

部分编译环境可能缺少一些头文件或库,static-php-cli 会在编译时自动修复这些问题,如:

  • HAVE_STRLCAT missing problem
  • HAVE_STRLCPY missing problem

Windows 系统下 Fiber 问题修复补丁

在 Windows 下编译 PHP 时,Fiber 扩展会出现一些问题,static-php-cli 会在编译时自动修复这些问题(修改 php-src 的 config.w32)。

Released under the MIT License.

+ \ No newline at end of file diff --git a/zh/develop/source-module.html b/zh/develop/source-module.html index 3780ccb1..75e99e57 100644 --- a/zh/develop/source-module.html +++ b/zh/develop/source-module.html @@ -5,19 +5,20 @@ 资源模块 | static-php-cli - - + + + - + - - - + + + -
Skip to content

资源模块

static-php-cli 的下载资源模块是一个主要的功能,它包含了所依赖的库、外部扩展、PHP 源码的下载方式和资源解压方式。 下载的配置文件主要涉及 source.jsonpkg.json 文件,这个文件记录了所有可下载的资源的下载方式。

下载功能主要涉及的命令有 bin/spc downloadbin/spc extract。其中 download 命令是一个下载器,它会根据配置文件下载资源; extract 命令是一个解压器,它会根据配置文件解压资源。

一般来说,下载资源可能会比较慢,因为这些资源来源于各个官网、GitHub 等不同位置,同时它们也占用了较大空间,所以你可以在一次下载资源后,可重复使用。

下载器的配置文件是 source.json,它包含了所有资源的下载方式,你可以在其中添加你需要的资源下载方式,也可以修改已有的资源下载方式。

每个资源的下载配置结构如下,下面是 libevent 扩展对应的资源下载配置:

json
{
+    
Skip to content

资源模块

static-php-cli 的下载资源模块是一个主要的功能,它包含了所依赖的库、外部扩展、PHP 源码的下载方式和资源解压方式。 下载的配置文件主要涉及 source.jsonpkg.json 文件,这个文件记录了所有可下载的资源的下载方式。

下载功能主要涉及的命令有 bin/spc downloadbin/spc extract。其中 download 命令是一个下载器,它会根据配置文件下载资源; extract 命令是一个解压器,它会根据配置文件解压资源。

一般来说,下载资源可能会比较慢,因为这些资源来源于各个官网、GitHub 等不同位置,同时它们也占用了较大空间,所以你可以在一次下载资源后,可重复使用。

下载器的配置文件是 source.json,它包含了所有资源的下载方式,你可以在其中添加你需要的资源下载方式,也可以修改已有的资源下载方式。

每个资源的下载配置结构如下,下面是 libevent 扩展对应的资源下载配置:

json
{
   "libevent": {
     "type": "ghrel",
     "repo": "libevent/libevent",
@@ -28,7 +29,7 @@
       "path": "LICENSE"
     }
   }
-}

这里最主要的字段是 type,目前它支持的类型有:

  • url: 直接使用 URL 下载,例如:https://download.libsodium.org/libsodium/releases/libsodium-1.0.18.tar.gz
  • ghrel: 使用 GitHub Release API 下载,即从 GitHub 项目发布的最新版本中上传的附件下载。
  • ghtar: 使用 GitHub Release API 下载,与 ghrel 不同的是,ghtar 是从项目的最新 Release 中找 source code (tar.gz) 下载的。
  • ghtagtar: 使用 GitHub Release API 下载,与 ghtar 相比,ghtagtar 可以从 tags 列表找最新的,并下载 tar.gz 格式的源码(因为有些项目只使用了 tag 发布版本)。
  • bitbuckettag: 使用 BitBucket API 下载,基本和 ghtagtar 相同,只是这个适用于 BitBucket。
  • git: 直接从一个 Git 地址克隆项目来下载资源,适用于任何公开 Git 仓库。
  • filelist: 使用爬虫爬取提供文件索引的 Web 下载站点,并获取最新版本的文件名并下载。
  • custom: 如果以上下载方式都不能满足,你可以编写 custom 后,在 src/SPC/store/source/ 下新建一个类,并继承 CustomSourceBase,自己编写下载脚本。

source.json 通用参数

source.json 中每个源文件拥有以下字段:

  • license: 源代码的开源许可证,见下方 开源许可证 章节
  • type: 必须为上面提到的类型之一
  • path(可选): 释放源码到指定目录而非 source/{name}
  • provide-pre-built(可选): 是否提供预编译的二进制文件,如果为 true,则会在 bin/spc download 时尝试自动下载预编译的二进制文件

TIP

source.json 中的 path 参数可指定相对路径或绝对路径。当指定为相对路径时,路径基于 source/

下载类型 - url

url 类型的资源指的是从 URL 直接下载文件。

包含的参数有:

  • url: 文件的下载地址,如 https://example.com/file.tgz
  • filename(可选): 保存到本地的文件名,如不指定,则使用 url 的文件名

例子(下载 imagick 扩展,并解压缩到 php 源码的扩展存放路径):

json
{
+}

这里最主要的字段是 type,目前它支持的类型有:

  • url: 直接使用 URL 下载,例如:https://download.libsodium.org/libsodium/releases/libsodium-1.0.18.tar.gz
  • ghrel: 使用 GitHub Release API 下载,即从 GitHub 项目发布的最新版本中上传的附件下载。
  • ghtar: 使用 GitHub Release API 下载,与 ghrel 不同的是,ghtar 是从项目的最新 Release 中找 source code (tar.gz) 下载的。
  • ghtagtar: 使用 GitHub Release API 下载,与 ghtar 相比,ghtagtar 可以从 tags 列表找最新的,并下载 tar.gz 格式的源码(因为有些项目只使用了 tag 发布版本)。
  • bitbuckettag: 使用 BitBucket API 下载,基本和 ghtagtar 相同,只是这个适用于 BitBucket。
  • git: 直接从一个 Git 地址克隆项目来下载资源,适用于任何公开 Git 仓库。
  • filelist: 使用爬虫爬取提供文件索引的 Web 下载站点,并获取最新版本的文件名并下载。
  • custom: 如果以上下载方式都不能满足,你可以编写 custom 后,在 src/SPC/store/source/ 下新建一个类,并继承 CustomSourceBase,自己编写下载脚本。

source.json 通用参数

source.json 中每个源文件拥有以下字段:

  • license: 源代码的开源许可证,见下方 开源许可证 章节
  • type: 必须为上面提到的类型之一
  • path(可选): 释放源码到指定目录而非 source/{name}
  • provide-pre-built(可选): 是否提供预编译的二进制文件,如果为 true,则会在 bin/spc download 时尝试自动下载预编译的二进制文件

TIP

source.json 中的 path 参数可指定相对路径或绝对路径。当指定为相对路径时,路径基于 source/

下载类型 - url

url 类型的资源指的是从 URL 直接下载文件。

包含的参数有:

  • url: 文件的下载地址,如 https://example.com/file.tgz
  • filename(可选): 保存到本地的文件名,如不指定,则使用 url 的文件名

例子(下载 imagick 扩展,并解压缩到 php 源码的扩展存放路径):

json
{
   "ext-imagick": {
     "type": "url",
     "url": "https://pecl.php.net/get/imagick",
@@ -39,7 +40,7 @@
       "path": "LICENSE"
     }
   }
-}

下载类型 - ghrel

ghrel 会从 GitHub Release 中上传的 Assets 下载文件。首先使用 GitHub Release API 获取最新版本,然后根据正则匹配方式下载相应的文件。

包含的参数有:

  • repo: GitHub 仓库名称
  • match: 匹配 Assets 文件的正则表达式
  • prefer-stable: 是否优先下载稳定版本(默认为 false

例子(下载 libsodium 库,匹配 Release 中的 libsodium-x.y.tar.gz 文件):

json
{
+}

下载类型 - ghrel

ghrel 会从 GitHub Release 中上传的 Assets 下载文件。首先使用 GitHub Release API 获取最新版本,然后根据正则匹配方式下载相应的文件。

包含的参数有:

  • repo: GitHub 仓库名称
  • match: 匹配 Assets 文件的正则表达式
  • prefer-stable: 是否优先下载稳定版本(默认为 false

例子(下载 libsodium 库,匹配 Release 中的 libsodium-x.y.tar.gz 文件):

json
{
   "libsodium": {
     "type": "ghrel",
     "repo": "jedisct1/libsodium",
@@ -49,7 +50,7 @@
       "path": "LICENSE"
     }
   }
-}

下载类型 - ghtar

ghtar 会从 GitHub Release Tag 下载文件,与 ghrel 不同的是,ghtar 是从项目的最新 Release 中找 source code (tar.gz) 下载的。

包含的参数有:

  • repo: GitHub 仓库名称
  • prefer-stable: 是否优先下载稳定版本(默认为 false

例子(brotli 库):

json
{
+}

下载类型 - ghtar

ghtar 会从 GitHub Release Tag 下载文件,与 ghrel 不同的是,ghtar 是从项目的最新 Release 中找 source code (tar.gz) 下载的。

包含的参数有:

  • repo: GitHub 仓库名称
  • prefer-stable: 是否优先下载稳定版本(默认为 false

例子(brotli 库):

json
{
   "brotli": {
     "type": "ghtar",
     "repo": "google/brotli",
@@ -58,7 +59,7 @@
       "path": "LICENSE"
     }
   }
-}

下载类型 - ghtagtar

使用 GitHub Release API 下载,与 ghtar 相比,ghtagtar 可以从 tags 列表找最新的,并下载 tar.gz 格式的源码(因为有些项目只使用了 tag 发布版本)。

包含的参数有:

  • repo: GitHub 仓库名称
  • prefer-stable: 是否优先下载稳定版本(默认为 false

例子(gmp 库):

json
{
+}

下载类型 - ghtagtar

使用 GitHub Release API 下载,与 ghtar 相比,ghtagtar 可以从 tags 列表找最新的,并下载 tar.gz 格式的源码(因为有些项目只使用了 tag 发布版本)。

包含的参数有:

  • repo: GitHub 仓库名称
  • prefer-stable: 是否优先下载稳定版本(默认为 false

例子(gmp 库):

json
{
   "gmp": {
     "type": "ghtagtar",
     "repo": "alisw/GMP",
@@ -67,7 +68,7 @@
       "text": "EXAMPLE LICENSE"
     }
   }
-}

下载类型 - bitbuckettag

使用 BitBucket API 下载,基本和 ghtagtar 相同,只是这个适用于 BitBucket。

包含的参数有:

  • repo: BitBucket 仓库名称

下载类型 - git

直接从一个 Git 地址克隆项目来下载资源,适用于任何公开 Git 仓库。

包含的参数有:

  • url: Git 链接(仅限 HTTPS)
  • rev: 分支名称
json
{
+}

下载类型 - bitbuckettag

使用 BitBucket API 下载,基本和 ghtagtar 相同,只是这个适用于 BitBucket。

包含的参数有:

  • repo: BitBucket 仓库名称

下载类型 - git

直接从一个 Git 地址克隆项目来下载资源,适用于任何公开 Git 仓库。

包含的参数有:

  • url: Git 链接(仅限 HTTPS)
  • rev: 分支名称
json
{
   "imap": {
     "type": "git",
     "url": "https://github.com/static-php/imap.git",
@@ -77,7 +78,7 @@
       "path": "LICENSE"
     }
   }
-}

下载类型 - filelist

使用爬虫爬取提供文件索引的 Web 下载站点,并获取最新版本的文件名并下载。

注意,该方法仅限于镜像站、GNU 官网等具有页面 index 功能的静态站点使用。

包含的参数有:

  • url: 要爬取文件最新版本的页面 URL
  • regex: 匹配文件名及下载链接的正则表达式

例子(从 GNU 官网下载 libiconv 库):

json
{
+}

下载类型 - filelist

使用爬虫爬取提供文件索引的 Web 下载站点,并获取最新版本的文件名并下载。

注意,该方法仅限于镜像站、GNU 官网等具有页面 index 功能的静态站点使用。

包含的参数有:

  • url: 要爬取文件最新版本的页面 URL
  • regex: 匹配文件名及下载链接的正则表达式

例子(从 GNU 官网下载 libiconv 库):

json
{
   "libiconv": {
     "type": "filelist",
     "url": "https://ftp.gnu.org/gnu/libiconv/",
@@ -87,7 +88,7 @@
       "path": "COPYING"
     }
   }
-}

下载类型 - custom

如果以上下载方式都不能满足,你可以编写 custom 后,在 src/SPC/store/source/ 下新建一个类,并继承 CustomSourceBase,自己编写下载脚本。

这里不再赘述,你可以查看 src/SPC/store/source/PhpSource.phpsrc/SPC/store/source/PostgreSQLSource.php 作为例子。

pkg.json 通用参数

pkg.json 存放的是非源码类型的文件资源,例如 musl-toolchain、UPX 等预编译的工具。它的使用包含:

  • type: 与 source.json 相同的类型及不同种类的参数。
  • extract(可选): 下载后解压缩的路径,默认为 pkgroot/{pkg_name}
  • extract-files(可选): 下载后仅解压指定的文件到指定位置。

需要注意的是,pkg.json 不涉及源代码的编译和修改分发,所以没有 license 开源许可证字段。并且你不能同时使用 extractextract-files 参数。

例子(下载 nasm 到本地,并只提取程序文件到 PHP SDK):

json
{
+}

下载类型 - custom

如果以上下载方式都不能满足,你可以编写 custom 后,在 src/SPC/store/source/ 下新建一个类,并继承 CustomSourceBase,自己编写下载脚本。

这里不再赘述,你可以查看 src/SPC/store/source/PhpSource.phpsrc/SPC/store/source/PostgreSQLSource.php 作为例子。

pkg.json 通用参数

pkg.json 存放的是非源码类型的文件资源,例如 musl-toolchain、UPX 等预编译的工具。它的使用包含:

  • type: 与 source.json 相同的类型及不同种类的参数。
  • extract(可选): 下载后解压缩的路径,默认为 pkgroot/{pkg_name}
  • extract-files(可选): 下载后仅解压指定的文件到指定位置。

需要注意的是,pkg.json 不涉及源代码的编译和修改分发,所以没有 license 开源许可证字段。并且你不能同时使用 extractextract-files 参数。

例子(下载 nasm 到本地,并只提取程序文件到 PHP SDK):

json
{
   "nasm-x86_64-win": {
     "type": "url",
     "url": "https://www.nasm.us/pub/nasm/releasebuilds/2.16.01/win64/nasm-2.16.01-win64.zip",
@@ -96,7 +97,7 @@
       "nasm-2.16.01/ndisasm.exe": "{php_sdk_path}/bin/ndisasm.exe"
     }
   }
-}

extract-files 中的键名为源文件夹下的文件,键值为存放的路径。存放的路径可以使用以下变量:

  • {php_sdk_path}: (仅限 Windows)PHP SDK 路径
  • {pkg_root_path}: pkgroot/
  • {working_dir}: 当前工作目录
  • {download_path}: 下载目录
  • {source_path}: 源码解压缩目录

extract-files 不使用变量且为相对路径时,相对路径的目录为 {working_dir}

开源许可证

对于 source.json 而言,每个源文件都应包含开源许可证。license 字段存放了开源许可证的信息。

每个 license 包含的参数有:

  • type: filetext
  • path: 源代码目录中的许可证文件(当 typefile 时,此项必填)
  • text: 许可证文本(当 typetext 时,此项必填)

例子(yaml 扩展的源代码中带有 LICENSE 文件):

json
{
+}

extract-files 中的键名为源文件夹下的文件,键值为存放的路径。存放的路径可以使用以下变量:

  • {php_sdk_path}: (仅限 Windows)PHP SDK 路径
  • {pkg_root_path}: pkgroot/
  • {working_dir}: 当前工作目录
  • {download_path}: 下载目录
  • {source_path}: 源码解压缩目录

extract-files 不使用变量且为相对路径时,相对路径的目录为 {working_dir}

开源许可证

对于 source.json 而言,每个源文件都应包含开源许可证。license 字段存放了开源许可证的信息。

每个 license 包含的参数有:

  • type: filetext
  • path: 源代码目录中的许可证文件(当 typefile 时,此项必填)
  • text: 许可证文本(当 typetext 时,此项必填)

例子(yaml 扩展的源代码中带有 LICENSE 文件):

json
{
   "yaml": {
     "type": "git",
     "path": "php-src/ext/yaml",
@@ -107,7 +108,7 @@
       "path": "LICENSE"
     }
   }
-}

当开源项目拥有多个许可证时,可指定多个文件:

json
{
+}

当开源项目拥有多个许可证时,可指定多个文件:

json
{
   "libuv": {
     "type": "ghtar",
     "repo": "libuv/libuv",
@@ -122,7 +123,7 @@
       }
     ]
   }
-}

当一个开源项目的许可证在不同版本间使用不同的文件,path 参数可以使用数组将可能的许可证文件列出:

json
{
+}

当一个开源项目的许可证在不同版本间使用不同的文件,path 参数可以使用数组将可能的许可证文件列出:

json
{
   "redis": {
     "type": "git",
     "path": "php-src/ext/redis",
@@ -136,8 +137,8 @@
       ]
     }
   }
-}

Released under the MIT License.

- +}

Released under the MIT License.

+ \ No newline at end of file diff --git a/zh/develop/structure.html b/zh/develop/structure.html index 5449db42..9a9a3235 100644 --- a/zh/develop/structure.html +++ b/zh/develop/structure.html @@ -5,29 +5,30 @@ 项目结构简介 | static-php-cli - - + + + - + - - - + + + -
Skip to content

项目结构简介

static-php-cli 主要包含三种逻辑组件:资源、依赖库、扩展。这三种组件四个配置文件:source.jsonlib.jsonext.jsonpkg.json

一个完整的构建静态 PHP 流程是:

  1. 使用资源下载模块 Downloader 下载指定或所有资源,这些资源包含 PHP 源码、依赖库源码、扩展源码。
  2. 使用资源解压模块 SourceExtractor 解压下载的资源到编译目录。
  3. 使用依赖工具计算出当前加入的扩展的依赖扩展、依赖库,然后对每个需要编译的依赖库进行编译,按照依赖顺序。
  4. 使用对应操作系统下的 Builder 构建每个依赖库后,将其安装到 buildroot 目录。
  5. 如果包含外部扩展(源码没有包含在 PHP 内的扩展),将外部扩展拷贝到 source/php-src/ext/ 目录。
  6. 使用 Builder 构建 PHP 源码,将其安装到 buildroot 目录。

项目主要分为几个文件夹:

  • bin/: 用于存放程序入口文件,包含 bin/spcbin/spc-alpine-dockerbin/setup-runtime
  • config/: 包含了所有项目支持的扩展、依赖库以及这些资源下载的地址、下载方式等,:lib.jsonext.jsonsource.jsonpkg.jsonpre-built.json
  • src/SPC/: 项目的核心代码,包含了整个框架以及编译各种扩展和库的命令。
  • src/globals/: 项目的全局方法和常量、运行时需要的测试文件(例如:扩展的可用性检查代码)。
  • vendor/: Composer 依赖的目录,你无需对它做出任何修改。

其中运行原理就是启动一个 symfony/consoleConsoleApplication,然后解析用户在终端输入的命令。

基本命令行结构

bin/spc 是一个 PHP 代码入口文件,包含了 Unix 通用的 #!/usr/bin/env php 用来让系统自动以系统安装好的 PHP 解释器执行。 在项目执行了 new ConsoleApplication() 后,框架会自动使用反射的方式,解析 src/SPC/command 目录下的所有类,并将其注册成为命令。

项目并没有直接使用 Symfony 推荐的 Command 注册方式和命令执行方式,这里做出了一点小变动:

  1. 每个命令都使用 #[AsCommand()] Attribute 来注册名称和简介。
  2. execute() 抽象化,让所有命令基于 BaseCommand(它基于 Symfony\Component\Console\Command\Command),每个命令本身的执行代码写到了 handle() 方法中。
  3. BaseCommand 添加了变量 $no_motd,用于是否在该命令执行时显示 Figlet 欢迎词。
  4. BaseCommandInputInterfaceOutputInterface 保存为成员变量,你可以在命令的类内使用 $this->input$this->output

基本源码结构

项目的源码位于 src/SPC 目录,支持 PSR-4 标准的自动加载,包含以下子目录和类:

  • src/SPC/builder/: 用于不同操作系统下构建依赖库、PHP 及相关扩展的核心编译命令代码,还包含了一些编译的系统工具方法。
  • src/SPC/command/: 项目的所有命令都在这里。
  • src/SPC/doctor/: Doctor 模块,它是一个较为独立的用于检查系统环境的模块,可使用命令 bin/spc doctor 进入。
  • src/SPC/exception/: 异常类。
  • src/SPC/store/: 有关存储、文件和资源的类都在这里。
  • src/SPC/util/: 一些可以复用的工具方法都在这里。
  • src/SPC/ConsoleApplication.php: 命令行程序入口文件。

如果你阅读过源码,你可能会发现还有一个 src/globals/ 目录,它是用于存放一些全局变量、全局方法、构建过程中依赖的非 PSR-4 标准的 PHP 源码,例如测试扩展代码等。

Phar 应用目录问题

和其他 php-cli 项目一样,spc 自身对路径有额外的考虑。 因为 spc 可以在 php-cli directlymicro SAPIphp-cli with Pharvendor with Phar 等多种模式下运行,各类根目录存在歧义。这里会进行一个完整的说明。 此问题一般常见于 PHP 项目中存取文件的基类路径选择问题,尤其是在配合 micro.sfx 使用时容易出现路径问题。

注意,此处仅对你在开发 Phar 项目或 PHP 框架时可能有用。

接下来我们都将 static-php-cli(也就是 spc)当作一个普通的 php 命令行程序来看,你可以将 spc 理解为你自己的任何 php-cli 应用以参考。

下面主要有三个基本的常量理论值,我们建议你在编写 php 项目时引入这三种常量:

  • WORKING_DIR:执行 PHP 脚本时的工作目录
  • SOURCE_ROOT_DIRROOT_DIR:项目文件夹的根目录,一般为 composer.json 所在目录
  • FRAMEWORK_ROOT_DIR:使用框架的根目录,自行开发的框架可能会用到,一般框架目录为只读

你可以在你的框架或者 cli 应用程序入口中定义这些常量,以方便在你的项目中使用路径。

下面是 PHP 内置的常量值,在 PHP 解释器内部已被定义:

  • __DIR__:当前执行脚本的文件所在目录
  • __FILE__:当前执行脚本的文件路径

Git 项目模式(source)

Git 项目模式指的是一个框架或程序本身在当前文件夹以纯文本形式存放,运行通过 php path/to/entry.php 方式。

假设你的项目存放在 /home/example/static-php-cli/ 目录下,或你的项目就是框架本身,里面包含 composer.json 等项目文件:

composer.json
+    
Skip to content

项目结构简介

static-php-cli 主要包含三种逻辑组件:资源、依赖库、扩展。这三种组件四个配置文件:source.jsonlib.jsonext.jsonpkg.json

一个完整的构建静态 PHP 流程是:

  1. 使用资源下载模块 Downloader 下载指定或所有资源,这些资源包含 PHP 源码、依赖库源码、扩展源码。
  2. 使用资源解压模块 SourceExtractor 解压下载的资源到编译目录。
  3. 使用依赖工具计算出当前加入的扩展的依赖扩展、依赖库,然后对每个需要编译的依赖库进行编译,按照依赖顺序。
  4. 使用对应操作系统下的 Builder 构建每个依赖库后,将其安装到 buildroot 目录。
  5. 如果包含外部扩展(源码没有包含在 PHP 内的扩展),将外部扩展拷贝到 source/php-src/ext/ 目录。
  6. 使用 Builder 构建 PHP 源码,将其安装到 buildroot 目录。

项目主要分为几个文件夹:

  • bin/: 用于存放程序入口文件,包含 bin/spcbin/spc-alpine-dockerbin/setup-runtime
  • config/: 包含了所有项目支持的扩展、依赖库以及这些资源下载的地址、下载方式等,:lib.jsonext.jsonsource.jsonpkg.jsonpre-built.json
  • src/SPC/: 项目的核心代码,包含了整个框架以及编译各种扩展和库的命令。
  • src/globals/: 项目的全局方法和常量、运行时需要的测试文件(例如:扩展的可用性检查代码)。
  • vendor/: Composer 依赖的目录,你无需对它做出任何修改。

其中运行原理就是启动一个 symfony/consoleConsoleApplication,然后解析用户在终端输入的命令。

基本命令行结构

bin/spc 是一个 PHP 代码入口文件,包含了 Unix 通用的 #!/usr/bin/env php 用来让系统自动以系统安装好的 PHP 解释器执行。 在项目执行了 new ConsoleApplication() 后,框架会自动使用反射的方式,解析 src/SPC/command 目录下的所有类,并将其注册成为命令。

项目并没有直接使用 Symfony 推荐的 Command 注册方式和命令执行方式,这里做出了一点小变动:

  1. 每个命令都使用 #[AsCommand()] Attribute 来注册名称和简介。
  2. execute() 抽象化,让所有命令基于 BaseCommand(它基于 Symfony\Component\Console\Command\Command),每个命令本身的执行代码写到了 handle() 方法中。
  3. BaseCommand 添加了变量 $no_motd,用于是否在该命令执行时显示 Figlet 欢迎词。
  4. BaseCommandInputInterfaceOutputInterface 保存为成员变量,你可以在命令的类内使用 $this->input$this->output

基本源码结构

项目的源码位于 src/SPC 目录,支持 PSR-4 标准的自动加载,包含以下子目录和类:

  • src/SPC/builder/: 用于不同操作系统下构建依赖库、PHP 及相关扩展的核心编译命令代码,还包含了一些编译的系统工具方法。
  • src/SPC/command/: 项目的所有命令都在这里。
  • src/SPC/doctor/: Doctor 模块,它是一个较为独立的用于检查系统环境的模块,可使用命令 bin/spc doctor 进入。
  • src/SPC/exception/: 异常类。
  • src/SPC/store/: 有关存储、文件和资源的类都在这里。
  • src/SPC/util/: 一些可以复用的工具方法都在这里。
  • src/SPC/ConsoleApplication.php: 命令行程序入口文件。

如果你阅读过源码,你可能会发现还有一个 src/globals/ 目录,它是用于存放一些全局变量、全局方法、构建过程中依赖的非 PSR-4 标准的 PHP 源码,例如测试扩展代码等。

Phar 应用目录问题

和其他 php-cli 项目一样,spc 自身对路径有额外的考虑。 因为 spc 可以在 php-cli directlymicro SAPIphp-cli with Pharvendor with Phar 等多种模式下运行,各类根目录存在歧义。这里会进行一个完整的说明。 此问题一般常见于 PHP 项目中存取文件的基类路径选择问题,尤其是在配合 micro.sfx 使用时容易出现路径问题。

注意,此处仅对你在开发 Phar 项目或 PHP 框架时可能有用。

接下来我们都将 static-php-cli(也就是 spc)当作一个普通的 php 命令行程序来看,你可以将 spc 理解为你自己的任何 php-cli 应用以参考。

下面主要有三个基本的常量理论值,我们建议你在编写 php 项目时引入这三种常量:

  • WORKING_DIR:执行 PHP 脚本时的工作目录
  • SOURCE_ROOT_DIRROOT_DIR:项目文件夹的根目录,一般为 composer.json 所在目录
  • FRAMEWORK_ROOT_DIR:使用框架的根目录,自行开发的框架可能会用到,一般框架目录为只读

你可以在你的框架或者 cli 应用程序入口中定义这些常量,以方便在你的项目中使用路径。

下面是 PHP 内置的常量值,在 PHP 解释器内部已被定义:

  • __DIR__:当前执行脚本的文件所在目录
  • __FILE__:当前执行脚本的文件路径

Git 项目模式(source)

Git 项目模式指的是一个框架或程序本身在当前文件夹以纯文本形式存放,运行通过 php path/to/entry.php 方式。

假设你的项目存放在 /home/example/static-php-cli/ 目录下,或你的项目就是框架本身,里面包含 composer.json 等项目文件:

composer.json
 src/App/MyCommand.app
 vendor/*
-bin/entry.php

我们假设从 src/App/MyCommand.php 中获取以上常量:

ConstantValue
WORKING_DIR/home/example/static-php-cli
SOURCE_ROOT_DIR/home/example/static-php-cli
FRAMEWORK_ROOT_DIR/home/example/static-php-cli
__DIR__/home/example/static-php-cli/src/App
__FILE__/home/example/static-php-cli/src/App/MyCommand.php

这种情况下,WORKING_DIRSOURCE_ROOT_DIRFRAMEWORK_ROOT_DIR 的值是完全一致的:/home/example/static-php-cli。 框架的源码和应用的源码都在当前路径下。

Vendor 库模式(vendor)

Vendor 库模式一般是指你的项目为框架类或者被其他应用作为 composer 依赖项安装到项目中,存放位置在 vendor/author/XXX 目录。

假设你的项目是 crazywhalecc/static-php-cli,你或其他人在另一个项目使用 composer require 安装了这个项目。

我们假设 static-php-cli 中包含同 Git 模式 的除 vendor 目录外的所有文件,并从 src/App/MyCommand 中获取常量值, 目录常量应该是:

ConstantValue
WORKING_DIR/home/example/another-app
SOURCE_ROOT_DIR/home/example/another-app
FRAMEWORK_ROOT_DIR/home/example/another-app/vendor/crazywhalecc/static-php-cli
__DIR__/home/example/another-app/vendor/crazywhalecc/static-php-cli/src/App
__FILE__/home/example/another-app/vendor/crazywhalecc/static-php-cli/src/App/MyCommand.php

这里的 SOURCE_ROOT_DIR 就指的是使用 static-php-cli 的项目的根目录。

Git 项目 Phar 模式(source-phar)

Git 项目 Phar 模式指的是将 Git 项目模式的项目目录打包为一个 phar 文件的模式。我们假设 /home/example/static-php-cli 将打包为一个 Phar 文件,目录有以下文件:

composer.json
+bin/entry.php

我们假设从 src/App/MyCommand.php 中获取以上常量:

ConstantValue
WORKING_DIR/home/example/static-php-cli
SOURCE_ROOT_DIR/home/example/static-php-cli
FRAMEWORK_ROOT_DIR/home/example/static-php-cli
__DIR__/home/example/static-php-cli/src/App
__FILE__/home/example/static-php-cli/src/App/MyCommand.php

这种情况下,WORKING_DIRSOURCE_ROOT_DIRFRAMEWORK_ROOT_DIR 的值是完全一致的:/home/example/static-php-cli。 框架的源码和应用的源码都在当前路径下。

Vendor 库模式(vendor)

Vendor 库模式一般是指你的项目为框架类或者被其他应用作为 composer 依赖项安装到项目中,存放位置在 vendor/author/XXX 目录。

假设你的项目是 crazywhalecc/static-php-cli,你或其他人在另一个项目使用 composer require 安装了这个项目。

我们假设 static-php-cli 中包含同 Git 模式 的除 vendor 目录外的所有文件,并从 src/App/MyCommand 中获取常量值, 目录常量应该是:

ConstantValue
WORKING_DIR/home/example/another-app
SOURCE_ROOT_DIR/home/example/another-app
FRAMEWORK_ROOT_DIR/home/example/another-app/vendor/crazywhalecc/static-php-cli
__DIR__/home/example/another-app/vendor/crazywhalecc/static-php-cli/src/App
__FILE__/home/example/another-app/vendor/crazywhalecc/static-php-cli/src/App/MyCommand.php

这里的 SOURCE_ROOT_DIR 就指的是使用 static-php-cli 的项目的根目录。

Git 项目 Phar 模式(source-phar)

Git 项目 Phar 模式指的是将 Git 项目模式的项目目录打包为一个 phar 文件的模式。我们假设 /home/example/static-php-cli 将打包为一个 Phar 文件,目录有以下文件:

composer.json
 src/App/MyCommand.app
 vendor/*
-bin/entry.php

打包为 app.phar 并存放到 /home/example/static-php-cli 目录下时,此时执行 app.phar,假设执行了 src/App/MyCommand 代码,常量在该文件内获取:

ConstantValue
WORKING_DIR/home/example/static-php-cli
SOURCE_ROOT_DIRphar:///home/example/static-php-cli/app.phar/
FRAMEWORK_ROOT_DIRphar:///home/example/static-php-cli/app.phar/
__DIR__phar:///home/example/static-php-cli/app.phar/src/App
__FILE__phar:///home/example/static-php-cli/app.phar/src/App/MyCommand.php

因为在 phar 内读取自身 phar 的文件需要 phar:// 协议进行,所以项目根目录和框架目录将会和 WORKING_DIR 不同。

Vendor 库 Phar 模式(vendor-phar)

Vendor 库 Phar 模式指的是你的项目作为框架安装在其他项目内,存储于 vendor 目录下。

我们假设你的项目目录结构如下:

composer.json # 当前项目的 Composer 配置文件
+bin/entry.php

打包为 app.phar 并存放到 /home/example/static-php-cli 目录下时,此时执行 app.phar,假设执行了 src/App/MyCommand 代码,常量在该文件内获取:

ConstantValue
WORKING_DIR/home/example/static-php-cli
SOURCE_ROOT_DIRphar:///home/example/static-php-cli/app.phar/
FRAMEWORK_ROOT_DIRphar:///home/example/static-php-cli/app.phar/
__DIR__phar:///home/example/static-php-cli/app.phar/src/App
__FILE__phar:///home/example/static-php-cli/app.phar/src/App/MyCommand.php

因为在 phar 内读取自身 phar 的文件需要 phar:// 协议进行,所以项目根目录和框架目录将会和 WORKING_DIR 不同。

Vendor 库 Phar 模式(vendor-phar)

Vendor 库 Phar 模式指的是你的项目作为框架安装在其他项目内,存储于 vendor 目录下。

我们假设你的项目目录结构如下:

composer.json # 当前项目的 Composer 配置文件
 box.json # 打包 Phar 的配置文件
 another-app.php # 另一个项目的入口文件
-vendor/crazywhalecc/static-php-cli/* # 你的项目被作为依赖库

将该目录 /home/example/another-app/ 下的这些文件打包为 app.phar 时,对于你的项目而言,下面常量的值应为:

ConstantValue
WORKING_DIR/home/example/another-app
SOURCE_ROOT_DIRphar:///home/example/another-app/app.phar/
FRAMEWORK_ROOT_DIRphar:///home/example/another-app/app.phar/vendor/crazywhalecc/static-php-cli
__DIR__phar:///home/example/another-app/app.phar/vendor/crazywhalecc/static-php-cli/src/App
__FILE__phar:///home/example/another-app/app.phar/vendor/crazywhalecc/static-php-cli/src/App/MyCommand.php

Released under the MIT License.

- +vendor/crazywhalecc/static-php-cli/* # 你的项目被作为依赖库

将该目录 /home/example/another-app/ 下的这些文件打包为 app.phar 时,对于你的项目而言,下面常量的值应为:

ConstantValue
WORKING_DIR/home/example/another-app
SOURCE_ROOT_DIRphar:///home/example/another-app/app.phar/
FRAMEWORK_ROOT_DIRphar:///home/example/another-app/app.phar/vendor/crazywhalecc/static-php-cli
__DIR__phar:///home/example/another-app/app.phar/vendor/crazywhalecc/static-php-cli/src/App
__FILE__phar:///home/example/another-app/app.phar/vendor/crazywhalecc/static-php-cli/src/App/MyCommand.php

Released under the MIT License.

+ \ No newline at end of file diff --git a/zh/develop/system-build-tools.html b/zh/develop/system-build-tools.html index 4be1bb49..44db74ff 100644 --- a/zh/develop/system-build-tools.html +++ b/zh/develop/system-build-tools.html @@ -5,19 +5,20 @@ 系统编译工具 | static-php-cli - - + + + - + - - - + + + -
Skip to content

系统编译工具

static-php-cli 在构建静态 PHP 时使用了许多系统编译工具,这些工具主要包括:

  • autoconf: 用于生成 configure 脚本。
  • make: 用于执行 Makefile
  • cmake: 用于执行 CMakeLists.txt
  • pkg-config: 用于查找依赖库的安装路径。
  • gcc: 用于在 Linux 下编译 C/C++ 语言代码。
  • clang: 用于在 macOS 下编译 C/C++ 语言代码。

对于 Linux 和 macOS 操作系统,这些工具通常可以通过包管理安装,这部分在 doctor 模块中编写了。 理论上我们也可以通过编译和手动下载这些工具,但这样会增加编译的复杂度,所以我们不推荐这样做。

Linux 环境编译工具

对于 Linux 系统来说,不同发行版的编译工具安装方式不同。而且对于静态编译来说,某些发行版的包管理无法安装用于纯静态编译的库和工具, 所以对于 Linux 平台及其不同发行版,我们目前提供了多种编译环境的部署措施。

glibc 环境

glibc 环境指的是系统底层的 libc 库(即所有 C 语言编写的程序动态链接的 C 标准库)使用的是 glibc,这是大多数发行版的默认环境。 例如:Ubuntu、Debian、CentOS、RHEL、openSUSE、Arch Linux 等。

而 glibc 环境下,我们使用的包管理、编译器都是默认指向 glibc 的,glibc 不能被良好地静态链接。它不能被静态链接的原因之一是它的网络库 nss 无法静态编译。

对于 glibc 环境,在 2.0 RC8 及以后的 static-php-cli 及 spc 中,你可以选择两种方式来构建静态 PHP:

  1. 使用 Docker 构建,这是最简单的方式,你可以使用 bin/spc-alpine-docker 来构建,它会在 Alpine Linux 环境下构建。
  2. 使用 bin/spc doctor 安装 musl-wrapper 和 musl-cross-make 套件,然后直接正常构建。(相关源码

一般来说,这两种构建方式的构建结果是一致的,你可以根据实际需求选择。

在 doctor 模块中,static-php-cli 会先检测当前的 Linux 发行版。如果当前发行版是 glibc 环境,会提示需要安装 musl-wrapper 和 musl-cross-make 套件。

在 glibc 环境下安装 musl-wrapper 的过程如下:

  1. 从 musl 官网下载特定版本的 musl-wrapper 源码
  2. 使用从包管理安装的 gcc 编译 musl-wrapper 源码,生成 musl-libc 等库:./configure --disable-gcc-wrapper && make -j && sudo make install
  3. musl-wrapper 相关库将被安装在 /usr/local/musl 目录。

在 glibc 环境下安装 musl-cross-make 的过程如下:

  1. 从 dl.static-php.dev 下载预编译好的 musl-cross-make 压缩包。
  2. 解压到 /usr/local/musl 目录。

TIP

在 glibc 环境下,静态编译可以通过直接安装 musl-wrapper 来实现,但是 musl-wrapper 仅包含了 musl-gcc,而没有 musl-g++,这也就意味着无法编译 C++ 代码。 所以我们需要 musl-cross-make 来提供 musl-g++

而 musl-cross-make 套件无法在本地直接编译的原因是它的编译环境要求比较高(需要 36GB 以上内存,Alpine Linux 下编译),所以我们提供了预编译好的二进制包,可用于所有 Linux 发行版。

同时,部分发行版的包管理提供了 musl-wrapper,但 musl-cross-make 需要匹配对应的 musl-wrapper 版本,所以我们不使用包管理安装 musl-wrapper。

对于如何编译 musl-cross-make,将在本章节内的 编译 musl-cross-make 小节中介绍。

musl 环境

musl 环境指的是系统底层的 libc 库使用的是 musl,这是一种轻量级的 C 标准库,它的特点是可以被良好地静态链接。

对于目前流行的 Linux 发行版,Alpine Linux 使用的就是 musl 环境,所以 static-php-cli 在 Alpine Linux 下可以直接构建静态 PHP,仅需直接从包管理安装基础编译工具(如 gcc、cmake 等)即可。

对于其他发行版,如果你的发行版使用的是 musl 环境,那么你也可以在安装必要的编译工具后直接使用 static-php-cli 构建静态 PHP。

TIP

在 musl 环境下,static-php-cli 会自动跳过 musl-wrapper 和 musl-cross-make 的安装。

Docker 环境

Docker 环境指的是使用 Docker 容器来构建静态 PHP,你可以使用 bin/spc-alpine-docker 来构建。 执行这个命令前需要先安装 Docker,然后在项目根目录执行 bin/spc-alpine-docker 即可。

在执行 bin/spc-alpine-docker 后,static-php-cli 会自动下载 Alpine Linux 镜像,然后构建一个 cwcc-spc-x86_64cwcc-spc-aarch64 的镜像。 然后一切的构建都在这个镜像内进行,相当于在 Alpine Linux 内编译。总的来说,Docker 环境就是 musl 环境。

musl-cross-make 工具链编译

在 Linux 中,尽管你不需要手动编译 musl-cross-make 工具,但是如果你想了解它的编译过程,可以参考这里。 还有一个重要的原因就是,这个可能无法使用 CI、Actions 等自动化工具编译,因为现有的 CI 服务编译环境不满足 musl-cross-make 的编译要求,满足要求的配置价格太高。

musl-cross-make 的编译过程如下:

准备一个 Alpine Linux 环境(直接安装或使用 Docker 均可),编译的过程需要 36GB 以上内存,所以你需要在内存较大的机器上编译。如果没有这么多内存,可能会导致编译失败。

然后将以下内容写入 config.mak 文件内:

makefile
STAT = -static --static
+    
Skip to content

系统编译工具

static-php-cli 在构建静态 PHP 时使用了许多系统编译工具,这些工具主要包括:

  • autoconf: 用于生成 configure 脚本。
  • make: 用于执行 Makefile
  • cmake: 用于执行 CMakeLists.txt
  • pkg-config: 用于查找依赖库的安装路径。
  • gcc: 用于在 Linux 下编译 C/C++ 语言代码。
  • clang: 用于在 macOS 下编译 C/C++ 语言代码。

对于 Linux 和 macOS 操作系统,这些工具通常可以通过包管理安装,这部分在 doctor 模块中编写了。 理论上我们也可以通过编译和手动下载这些工具,但这样会增加编译的复杂度,所以我们不推荐这样做。

Linux 环境编译工具

对于 Linux 系统来说,不同发行版的编译工具安装方式不同。而且对于静态编译来说,某些发行版的包管理无法安装用于纯静态编译的库和工具, 所以对于 Linux 平台及其不同发行版,我们目前提供了多种编译环境的部署措施。

glibc 环境

glibc 环境指的是系统底层的 libc 库(即所有 C 语言编写的程序动态链接的 C 标准库)使用的是 glibc,这是大多数发行版的默认环境。 例如:Ubuntu、Debian、CentOS、RHEL、openSUSE、Arch Linux 等。

而 glibc 环境下,我们使用的包管理、编译器都是默认指向 glibc 的,glibc 不能被良好地静态链接。它不能被静态链接的原因之一是它的网络库 nss 无法静态编译。

对于 glibc 环境,在 2.0 RC8 及以后的 static-php-cli 及 spc 中,你可以选择两种方式来构建静态 PHP:

  1. 使用 Docker 构建,这是最简单的方式,你可以使用 bin/spc-alpine-docker 来构建,它会在 Alpine Linux 环境下构建。
  2. 使用 bin/spc doctor 安装 musl-wrapper 和 musl-cross-make 套件,然后直接正常构建。(相关源码

一般来说,这两种构建方式的构建结果是一致的,你可以根据实际需求选择。

在 doctor 模块中,static-php-cli 会先检测当前的 Linux 发行版。如果当前发行版是 glibc 环境,会提示需要安装 musl-wrapper 和 musl-cross-make 套件。

在 glibc 环境下安装 musl-wrapper 的过程如下:

  1. 从 musl 官网下载特定版本的 musl-wrapper 源码
  2. 使用从包管理安装的 gcc 编译 musl-wrapper 源码,生成 musl-libc 等库:./configure --disable-gcc-wrapper && make -j && sudo make install
  3. musl-wrapper 相关库将被安装在 /usr/local/musl 目录。

在 glibc 环境下安装 musl-cross-make 的过程如下:

  1. 从 dl.static-php.dev 下载预编译好的 musl-cross-make 压缩包。
  2. 解压到 /usr/local/musl 目录。

TIP

在 glibc 环境下,静态编译可以通过直接安装 musl-wrapper 来实现,但是 musl-wrapper 仅包含了 musl-gcc,而没有 musl-g++,这也就意味着无法编译 C++ 代码。 所以我们需要 musl-cross-make 来提供 musl-g++

而 musl-cross-make 套件无法在本地直接编译的原因是它的编译环境要求比较高(需要 36GB 以上内存,Alpine Linux 下编译),所以我们提供了预编译好的二进制包,可用于所有 Linux 发行版。

同时,部分发行版的包管理提供了 musl-wrapper,但 musl-cross-make 需要匹配对应的 musl-wrapper 版本,所以我们不使用包管理安装 musl-wrapper。

对于如何编译 musl-cross-make,将在本章节内的 编译 musl-cross-make 小节中介绍。

musl 环境

musl 环境指的是系统底层的 libc 库使用的是 musl,这是一种轻量级的 C 标准库,它的特点是可以被良好地静态链接。

对于目前流行的 Linux 发行版,Alpine Linux 使用的就是 musl 环境,所以 static-php-cli 在 Alpine Linux 下可以直接构建静态 PHP,仅需直接从包管理安装基础编译工具(如 gcc、cmake 等)即可。

对于其他发行版,如果你的发行版使用的是 musl 环境,那么你也可以在安装必要的编译工具后直接使用 static-php-cli 构建静态 PHP。

TIP

在 musl 环境下,static-php-cli 会自动跳过 musl-wrapper 和 musl-cross-make 的安装。

Docker 环境

Docker 环境指的是使用 Docker 容器来构建静态 PHP,你可以使用 bin/spc-alpine-docker 来构建。 执行这个命令前需要先安装 Docker,然后在项目根目录执行 bin/spc-alpine-docker 即可。

在执行 bin/spc-alpine-docker 后,static-php-cli 会自动下载 Alpine Linux 镜像,然后构建一个 cwcc-spc-x86_64cwcc-spc-aarch64 的镜像。 然后一切的构建都在这个镜像内进行,相当于在 Alpine Linux 内编译。总的来说,Docker 环境就是 musl 环境。

musl-cross-make 工具链编译

在 Linux 中,尽管你不需要手动编译 musl-cross-make 工具,但是如果你想了解它的编译过程,可以参考这里。 还有一个重要的原因就是,这个可能无法使用 CI、Actions 等自动化工具编译,因为现有的 CI 服务编译环境不满足 musl-cross-make 的编译要求,满足要求的配置价格太高。

musl-cross-make 的编译过程如下:

准备一个 Alpine Linux 环境(直接安装或使用 Docker 均可),编译的过程需要 36GB 以上内存,所以你需要在内存较大的机器上编译。如果没有这么多内存,可能会导致编译失败。

然后将以下内容写入 config.mak 文件内:

makefile
STAT = -static --static
 FLAG = -g0 -Os -Wno-error
 
 ifneq ($(NATIVE),)
@@ -39,7 +40,7 @@
 GMP_VER = 6.2.1
 MPC_VER = 1.2.1
 MPFR_VER = 4.2.0
-LINUX_VER = 6.1.36

同时,你需要新建一个 gcc-13.2.0.tar.xz.sha1 文件,文件内容如下:

5f95b6d042fb37d45c6cbebfc91decfbc4fb493c  gcc-13.2.0.tar.xz

如果你使用的是 Docker 构建,新建一个 Dockerfile 文件,写入以下内容:

dockerfile
FROM alpine:edge
+LINUX_VER = 6.1.36

同时,你需要新建一个 gcc-13.2.0.tar.xz.sha1 文件,文件内容如下:

5f95b6d042fb37d45c6cbebfc91decfbc4fb493c  gcc-13.2.0.tar.xz

如果你使用的是 Docker 构建,新建一个 Dockerfile 文件,写入以下内容:

dockerfile
FROM alpine:edge
 
 RUN apk add --no-cache \
 gcc g++ git make curl perl \
@@ -63,7 +64,7 @@
 RUN sed -i 's/poison calloc/poison/g' ./gcc-13.2.0/gcc/system.h
 RUN make TARGET=x86_64-linux-musl -j
 RUN make TARGET=x86_64-linux-musl install -j
-RUN tar cvzf x86_64-musl-toolchain.tgz output/*

如果你使用的是非 Docker 环境的 Alpine Linux,可以直接执行 Dockerfile 中的命令,例如:

bash
apk add --no-cache \
+RUN tar cvzf x86_64-musl-toolchain.tgz output/*

如果你使用的是非 Docker 环境的 Alpine Linux,可以直接执行 Dockerfile 中的命令,例如:

bash
apk add --no-cache \
 gcc g++ git make curl perl \
 rsync patch wget libtool \
 texinfo autoconf automake \
@@ -83,8 +84,8 @@
 sed -i 's/poison calloc/poison/g' ./gcc-13.2.0/gcc/system.h
 make TARGET=x86_64-linux-musl -j
 make TARGET=x86_64-linux-musl install -j
-tar cvzf x86_64-musl-toolchain.tgz output/*

TIP

以上所有脚本都适用于 x86_64 架构的 Linux。如果你需要构建 ARM 环境的 musl-cross-make,只需要将上方所有 x86_64 替换为 aarch64 即可。

这个编译过程可能会因为内存不足、网络问题等原因导致编译失败,你可以多尝试几次,或者使用更大内存的机器来编译。 如果遇到了问题,或者你有更好的改进方案,可以在 讨论 中提出。

macOS 环境编译工具

对于 macOS 系统来说,我们使用的编译工具主要是 clang,它是 macOS 系统默认的编译器,同时也是 Xcode 的编译器。

在 macOS 下编译,主要依赖于 Xcode 或 Xcode Command Line Tools,你可以在 App Store 下载 Xcode,或者在终端执行 xcode-select --install 来安装 Xcode Command Line Tools。

此外,在 doctor 环境检查模块中,static-php-cli 会检查 macOS 系统是否安装了 Homebrew、编译工具等,如果没有,会提示你安装,这里不再赘述。

FreeBSD 环境编译工具

FreeBSD 也是 Unix 系统,它的编译工具和 macOS 类似,你可以直接使用包管理 pkg 安装 clang 等编译工具,通过 doctor 命令。

pkg-config 编译

如果你在使用 static-php-cli 构建静态 PHP 时仔细观察编译的日志,你会发现无论编译什么,都会先编译 pkg-config,这是因为 pkg-config 是一个用于查找依赖库的工具。 在早期的 static-php-cli 版本中,我们直接使用了包管理安装的 pkg-config 工具,但是这样会导致一些问题,例如:

  • 即使指定了 PKG_CONFIG_PATHpkg-config 也会尝试从系统路径中查找依赖包。
  • 由于 pkg-config 会从系统路径中查找依赖包,所以如果系统中存在同名的依赖包,可能会导致编译失败。

为了避免以上问题,我们将 pkg-config 编译到用户态的 buildroot/bin 内并使用,使用了 --without-sysroot 等参数来避免从系统路径中查找依赖包。

Released under the MIT License.

- +tar cvzf x86_64-musl-toolchain.tgz output/*

TIP

以上所有脚本都适用于 x86_64 架构的 Linux。如果你需要构建 ARM 环境的 musl-cross-make,只需要将上方所有 x86_64 替换为 aarch64 即可。

这个编译过程可能会因为内存不足、网络问题等原因导致编译失败,你可以多尝试几次,或者使用更大内存的机器来编译。 如果遇到了问题,或者你有更好的改进方案,可以在 讨论 中提出。

macOS 环境编译工具

对于 macOS 系统来说,我们使用的编译工具主要是 clang,它是 macOS 系统默认的编译器,同时也是 Xcode 的编译器。

在 macOS 下编译,主要依赖于 Xcode 或 Xcode Command Line Tools,你可以在 App Store 下载 Xcode,或者在终端执行 xcode-select --install 来安装 Xcode Command Line Tools。

此外,在 doctor 环境检查模块中,static-php-cli 会检查 macOS 系统是否安装了 Homebrew、编译工具等,如果没有,会提示你安装,这里不再赘述。

FreeBSD 环境编译工具

FreeBSD 也是 Unix 系统,它的编译工具和 macOS 类似,你可以直接使用包管理 pkg 安装 clang 等编译工具,通过 doctor 命令。

pkg-config 编译

如果你在使用 static-php-cli 构建静态 PHP 时仔细观察编译的日志,你会发现无论编译什么,都会先编译 pkg-config,这是因为 pkg-config 是一个用于查找依赖库的工具。 在早期的 static-php-cli 版本中,我们直接使用了包管理安装的 pkg-config 工具,但是这样会导致一些问题,例如:

  • 即使指定了 PKG_CONFIG_PATHpkg-config 也会尝试从系统路径中查找依赖包。
  • 由于 pkg-config 会从系统路径中查找依赖包,所以如果系统中存在同名的依赖包,可能会导致编译失败。

为了避免以上问题,我们将 pkg-config 编译到用户态的 buildroot/bin 内并使用,使用了 --without-sysroot 等参数来避免从系统路径中查找依赖包。

Released under the MIT License.

+ \ No newline at end of file diff --git a/zh/faq/index.html b/zh/faq/index.html index f1dd72ba..09d0c69b 100644 --- a/zh/faq/index.html +++ b/zh/faq/index.html @@ -5,24 +5,25 @@ 常见问题 | static-php-cli - - + + + - + - - - + + + -
Skip to content

常见问题

这里将会编写一些你容易遇到的问题。目前有很多,但是我需要花时间来整理一下。

php.ini 的路径是什么?

在 Linux、macOS 和 FreeBSD 上,php.ini 的默认路径是 /usr/local/etc/php/php.ini。 在 Windows 中,路径是 C:\windows\php.iniphp.exe 所在的当前目录。 可以在 *nix 系统中使用手动构建选项 --with-config-file-path 来更改查找 php.ini 的目录。

此外,在 Linux、macOS 和 FreeBSD 上,/usr/local/etc/php/conf.d 目录中的 *.ini 文件也会被加载。 在 Windows 中,该路径默认为空。 可以使用手动构建选项 --with-config-file-scan-dir 更改该目录。

PHP 默认也会从 其他标准位置 中搜索 php.ini

静态编译的 PHP 可以安装扩展吗

因为传统架构下的 PHP 安装扩展的原理是使用 .so 类型的动态链接的库方式安装新扩展,而使用本项目编译的静态链接的 PHP。但是静态链接在不同操作系统有不同的定义。

首先对于 Linux 系统来说,静态链接的二进制文件是不会链接系统的动态链接库的,纯静态链接的二进制无法加载动态库,所以无法添加新的扩展。 同时,在纯静态模式下你也不能使用 ffi 等扩展加载外部的 .so 模块。

你可以通过命令 ldd buildroot/bin/php 来查看你在 Linux 下构建的二进制是否为纯静态链接的。

如果你 构建 GNU libc 兼容的 PHP,你可以使用 ffi 扩展加载外部的 .so 模块,并且加载具有相同 ABI 的 .so 扩展。

例如,你可以使用以下命令构建一个 glibc 动态链接的静态 PHP 二进制,同时支持 FFI 扩展和加载相同 PHP 版本和相同 TS 类型的 xdebug.so 扩展:

bash
bin/spc-gnu-docker download --for-extensions=ffi,xml --with-php=8.4
+    
Skip to content

常见问题

这里将会编写一些你容易遇到的问题。目前有很多,但是我需要花时间来整理一下。

php.ini 的路径是什么?

在 Linux、macOS 和 FreeBSD 上,php.ini 的默认路径是 /usr/local/etc/php/php.ini。 在 Windows 中,路径是 C:\windows\php.iniphp.exe 所在的当前目录。 可以在 *nix 系统中使用手动构建选项 --with-config-file-path 来更改查找 php.ini 的目录。

此外,在 Linux、macOS 和 FreeBSD 上,/usr/local/etc/php/conf.d 目录中的 *.ini 文件也会被加载。 在 Windows 中,该路径默认为空。 可以使用手动构建选项 --with-config-file-scan-dir 更改该目录。

PHP 默认也会从 其他标准位置 中搜索 php.ini

静态编译的 PHP 可以安装扩展吗

因为传统架构下的 PHP 安装扩展的原理是使用 .so 类型的动态链接的库方式安装新扩展,而使用本项目编译的静态链接的 PHP。但是静态链接在不同操作系统有不同的定义。

首先对于 Linux 系统来说,静态链接的二进制文件是不会链接系统的动态链接库的,纯静态链接的二进制无法加载动态库,所以无法添加新的扩展。 同时,在纯静态模式下你也不能使用 ffi 等扩展加载外部的 .so 模块。

你可以通过命令 ldd buildroot/bin/php 来查看你在 Linux 下构建的二进制是否为纯静态链接的。

如果你 构建 GNU libc 兼容的 PHP,你可以使用 ffi 扩展加载外部的 .so 模块,并且加载具有相同 ABI 的 .so 扩展。

例如,你可以使用以下命令构建一个 glibc 动态链接的静态 PHP 二进制,同时支持 FFI 扩展和加载相同 PHP 版本和相同 TS 类型的 xdebug.so 扩展:

bash
bin/spc-gnu-docker download --for-extensions=ffi,xml --with-php=8.4
 bin/spc-gnu-docker build ffi,xml --build-cli --debug
 
-buildroot/bin/php -d "zend_extension=/path/to/php{PHP_VER}-{ts/nts}/xdebug.so" --ri xdebug

对于 macOS 平台来说,macOS 下的几乎所有二进制文件都无法真正纯静态链接,几乎所有二进制文件都会链接 macOS 的系统库:/usr/lib/libresolv.9.dylib/usr/lib/libSystem.B.dylib。 所以在 macOS 系统下,在特定的编译条件下可以使用静态编译的 php 二进制文件,可使用动态链接的扩展:

  1. 使用 --no-strip 参数,将不会对二进制文件去除调试符号等信息,以供使用 Xdebug 等外部 Zend 扩展。
  2. 如果要编译某些 Zend 扩展,使用 Homebrew、MacPorts、源码编译的形式,在所在的操作系统安装一个普通版本的 PHP。
  3. 使用 phpize && ./configure && make 命令编译想要使用的扩展。
  4. 将扩展文件 xxxx.so 拷贝到外部,使用静态编译的 PHP 二进制,例如使用 Xdebug 扩展:cd buildroot/bin/ && ./php -d "zend_extension=/path/to/xdebug.so"
bash
# 构建静态 php-cli
-bin/spc build ffi --build-cli --no-strip

可以支持 Oracle 数据库扩展吗

部分依赖库闭源的扩展,如 oci8sourceguardian 等,它们没有提供纯静态编译的依赖库文件(.a),仅提供了动态依赖库文件(.so), 这些扩展无法使用源码的形式编译到 static-php-cli 中,所以本项目可能永远也不会支持这些扩展。不过,理论上你可以根据上面的问题在 macOS 和 Linux 下接入和使用这类扩展。

如果你对此类扩展有需求,或者大部分人都对这些闭源扩展使用有需求, 可以看看有关 standalone-php-cli 的讨论。欢迎留言。

支持 Windows 吗

该项目目前已支持 Windows,但支持的扩展数量较少,Windows 的支持并不完美,主要有以下几个问题:

  1. Windows 的编译流程与 *nix 不同,使用的工具链也不同,编译各个扩展的依赖库使用的编译工具也几乎完全不同。
  2. Windows 版本的需求也会根据所有使用本项目的人的需求推进,如果有很多人需要,我会尽快支持相关扩展。

使用 micro 可以保护我的源码吗

不可以。micro.sfx 本质上是将 php 和 php 代码结合为一个文件,没有 PHP 代码编译或加密的过程。 首先 php-src 是 PHP 代码的官方解释器,而且现在市面上还没有一个能兼容主流分支的 PHP 编译器。 之前我在网上看到有一个项目是 BPC(Binary PHP Compiler?)可以把 PHP 编译为二进制,但是限制也是很多很多。

加密保护代码的方向和编译也不是一回事,编译过后也可以通过逆向工程等方式拿到代码,真正保护还是通过加壳、加密代码等手段进行。

所以本项目(static-php-cli)、相关项目(lwmbs、swoole-cli)都是提供一个对 php-src 源码的便捷编译工具, 本项目和相关项目引用的 phpmicro 也仅仅是 PHP 的 sapi 接口封装,而不是 PHP 代码的编译工具。 PHP 代码的编译器是完全不同的项目,因此不会考虑额外的情况。如果你对加密感兴趣,可以考虑使用现有的加密技术,如 Swoole Compiler、Source Guardian 等。

无法使用 ssl

更新:该问题已在最新版本的 static-php-cli 中修复,现在默认读取系统的证书文件。如果你仍然遇到问题,再尝试下方的解决方案。

使用 curl、pgsql 等 请求 HTTPS 网站或建立 SSL 连接时,可能存在 error:80000002:system library::No such file or directory 错误, 这个错误是由于静态编译的 PHP 未通过 php.ini 指定 openssl.cafile 导致的。

你可以在使用 PHP 前指定 php.ini,并在 INI 内添加 openssl.cafile=/path/to/your-cert.pem 来解决这个问题。

对于 Linux 系统,你可以从 curl 官方网站下载 cacert.pem 文件,也可以使用系统自带的证书文件。 有关不同发行版的证书位置,可参考 Go 标准库

INI 配置 openssl.cafile 不可以使用 ini_set() 函数动态设置,因为 openssl.cafile 是一个 PHP_INI_SYSTEM 类型的配置,只能在 php.ini 文件中设置。

为什么不支持旧版本 PHP ?

因为旧版本的 PHP 有很多问题,比如安全问题、性能问题、功能问题等。此外,旧版本的 PHP 很多都无法与最新的依赖库兼容,这也是不支持旧版本 PHP 的原因之一。

你可以使用 static-php-cli 早期编译好的旧版本,如 PHP 8.0,但是不会明确支持早期版本。

Released under the MIT License.

- +buildroot/bin/php -d "zend_extension=/path/to/php{PHP_VER}-{ts/nts}/xdebug.so" --ri xdebug

对于 macOS 平台来说,macOS 下的几乎所有二进制文件都无法真正纯静态链接,几乎所有二进制文件都会链接 macOS 的系统库:/usr/lib/libresolv.9.dylib/usr/lib/libSystem.B.dylib。 所以在 macOS 系统下,在特定的编译条件下可以使用静态编译的 php 二进制文件,可使用动态链接的扩展:

  1. 使用 --no-strip 参数,将不会对二进制文件去除调试符号等信息,以供使用 Xdebug 等外部 Zend 扩展。
  2. 如果要编译某些 Zend 扩展,使用 Homebrew、MacPorts、源码编译的形式,在所在的操作系统安装一个普通版本的 PHP。
  3. 使用 phpize && ./configure && make 命令编译想要使用的扩展。
  4. 将扩展文件 xxxx.so 拷贝到外部,使用静态编译的 PHP 二进制,例如使用 Xdebug 扩展:cd buildroot/bin/ && ./php -d "zend_extension=/path/to/xdebug.so"
bash
# 构建静态 php-cli
+bin/spc build ffi --build-cli --no-strip

可以支持 Oracle 数据库扩展吗

部分依赖库闭源的扩展,如 oci8sourceguardian 等,它们没有提供纯静态编译的依赖库文件(.a),仅提供了动态依赖库文件(.so), 这些扩展无法使用源码的形式编译到 static-php-cli 中,所以本项目可能永远也不会支持这些扩展。不过,理论上你可以根据上面的问题在 macOS 和 Linux 下接入和使用这类扩展。

如果你对此类扩展有需求,或者大部分人都对这些闭源扩展使用有需求, 可以看看有关 standalone-php-cli 的讨论。欢迎留言。

支持 Windows 吗

该项目目前已支持 Windows,但支持的扩展数量较少,Windows 的支持并不完美,主要有以下几个问题:

  1. Windows 的编译流程与 *nix 不同,使用的工具链也不同,编译各个扩展的依赖库使用的编译工具也几乎完全不同。
  2. Windows 版本的需求也会根据所有使用本项目的人的需求推进,如果有很多人需要,我会尽快支持相关扩展。

使用 micro 可以保护我的源码吗

不可以。micro.sfx 本质上是将 php 和 php 代码结合为一个文件,没有 PHP 代码编译或加密的过程。 首先 php-src 是 PHP 代码的官方解释器,而且现在市面上还没有一个能兼容主流分支的 PHP 编译器。 之前我在网上看到有一个项目是 BPC(Binary PHP Compiler?)可以把 PHP 编译为二进制,但是限制也是很多很多。

加密保护代码的方向和编译也不是一回事,编译过后也可以通过逆向工程等方式拿到代码,真正保护还是通过加壳、加密代码等手段进行。

所以本项目(static-php-cli)、相关项目(lwmbs、swoole-cli)都是提供一个对 php-src 源码的便捷编译工具, 本项目和相关项目引用的 phpmicro 也仅仅是 PHP 的 sapi 接口封装,而不是 PHP 代码的编译工具。 PHP 代码的编译器是完全不同的项目,因此不会考虑额外的情况。如果你对加密感兴趣,可以考虑使用现有的加密技术,如 Swoole Compiler、Source Guardian 等。

无法使用 ssl

更新:该问题已在最新版本的 static-php-cli 中修复,现在默认读取系统的证书文件。如果你仍然遇到问题,再尝试下方的解决方案。

使用 curl、pgsql 等 请求 HTTPS 网站或建立 SSL 连接时,可能存在 error:80000002:system library::No such file or directory 错误, 这个错误是由于静态编译的 PHP 未通过 php.ini 指定 openssl.cafile 导致的。

你可以在使用 PHP 前指定 php.ini,并在 INI 内添加 openssl.cafile=/path/to/your-cert.pem 来解决这个问题。

对于 Linux 系统,你可以从 curl 官方网站下载 cacert.pem 文件,也可以使用系统自带的证书文件。 有关不同发行版的证书位置,可参考 Go 标准库

INI 配置 openssl.cafile 不可以使用 ini_set() 函数动态设置,因为 openssl.cafile 是一个 PHP_INI_SYSTEM 类型的配置,只能在 php.ini 文件中设置。

为什么不支持旧版本 PHP ?

因为旧版本的 PHP 有很多问题,比如安全问题、性能问题、功能问题等。此外,旧版本的 PHP 很多都无法与最新的依赖库兼容,这也是不支持旧版本 PHP 的原因之一。

你可以使用 static-php-cli 早期编译好的旧版本,如 PHP 8.0,但是不会明确支持早期版本。

Released under the MIT License.

+ \ No newline at end of file diff --git a/zh/guide/action-build.html b/zh/guide/action-build.html index e1297862..34813210 100644 --- a/zh/guide/action-build.html +++ b/zh/guide/action-build.html @@ -5,20 +5,21 @@ Action 构建 | static-php-cli - - + + + - + - - - + + + -
Skip to content

Action 构建

Action 构建指的是直接使用 GitHub Action 进行编译。

如果你不想自行编译,可以从本项目现有的 Action 下载 Artifact,也可以从自托管的服务器下载:进入

自托管的二进制也是由 Action 构建而来,项目仓库地址

构建方法

使用 GitHub Action 可以方便地构建一个静态编译的 PHP 和 phpmicro,同时可以自行定义要编译的扩展。

  1. Fork 本项目。
  2. 进入项目的 Actions,选择 CI 开头的 Workflow(根据你需要的操作系统选择)。
  3. 选择 Run workflow,填入你要编译的 PHP 版本、目标类型、扩展列表。(扩展列表使用英文逗号分割,例如 bcmath,curl,mbstring
  4. 等待大约一段时间后,进入对应的任务中,获取 Artifacts

如果你选择了 debug,则会在构建时输出所有日志,包括编译的日志,以供排查错误。

如果你需要在其他环境构建,可以使用 手动构建

扩展选择

你可以到 扩展列表 中查看目前你需要的扩展是否均支持, 然后到 在线命令生成 中选择你需要编译的扩展,复制扩展字符串到 Action 的 extensions 中,编译即可。

Released under the MIT License.

- +
Skip to content

Action 构建

Action 构建指的是直接使用 GitHub Action 进行编译。

如果你不想自行编译,可以从本项目现有的 Action 下载 Artifact,也可以从自托管的服务器下载:进入

自托管的二进制也是由 Action 构建而来,项目仓库地址

构建方法

使用 GitHub Action 可以方便地构建一个静态编译的 PHP 和 phpmicro,同时可以自行定义要编译的扩展。

  1. Fork 本项目。
  2. 进入项目的 Actions,选择 CI 开头的 Workflow(根据你需要的操作系统选择)。
  3. 选择 Run workflow,填入你要编译的 PHP 版本、目标类型、扩展列表。(扩展列表使用英文逗号分割,例如 bcmath,curl,mbstring
  4. 等待大约一段时间后,进入对应的任务中,获取 Artifacts

如果你选择了 debug,则会在构建时输出所有日志,包括编译的日志,以供排查错误。

如果你需要在其他环境构建,可以使用 手动构建

扩展选择

你可以到 扩展列表 中查看目前你需要的扩展是否均支持, 然后到 在线命令生成 中选择你需要编译的扩展,复制扩展字符串到 Action 的 extensions 中,编译即可。

Released under the MIT License.

+ \ No newline at end of file diff --git a/zh/guide/build-on-windows.html b/zh/guide/build-on-windows.html index dbc98e70..7d82ca8a 100644 --- a/zh/guide/build-on-windows.html +++ b/zh/guide/build-on-windows.html @@ -5,41 +5,42 @@ 在 Windows 上构建 | static-php-cli - - + + + - + - - - + + + -
Skip to content

在 Windows 上构建

因为 Windows 系统是 NT 内核,与类 Unix 的操作系统使用的编译工具及操作系统接口几乎完全不同,所以在 Windows 上的构建流程会与 Unix 系统有些许不同。

GitHub Actions 构建

现在已支持从 Actions 构建 Windows 版本的 static-php 了。 和 Linux、macOS 一样,你需要先 Fork static-php-cli 仓库到你的 GitHub 账户中,然后你可以进入 扩展列表 选择要编译的扩展,然后进入自己仓库的 CI on Windows 选择 PHP 版本、填入扩展列表(逗号分割),点击 Run 即可。

如果你要在本地开发或构建,请继续向下阅读。

环境准备

在 Windows 上构建静态 PHP 所需要的工具与 PHP 官方的 Windows 构建工具是相同的。你可以阅读 官方文档

总结下来,你需要以下环境及工具:

  • Windows 10(需要 build 17063 或以后的更新)
  • Visual Studio 2019/2022(推荐 2022)
  • Visual Studio 的 C++ 桌面开发
  • Git for Windows
  • static-php-cli 仓库
  • PHP 和 Composer(static-php-cli 需要它们,可使用 bin/setup-runtime 自动安装)
  • php-sdk-binary-tools(可使用 doctor 自动安装)
  • strawberry-perl(可使用 doctor 自动安装)
  • nasm(可使用 doctor 自动安装)

TIP

static-php-cli 在 Windows 上的构建指的是使用 MSVC 构建 PHP,不基于 MinGW、Cygwin、WSL 等环境。

如果你更倾向使用 WSL,请参考在 Linux 上构建的章节。

在安装 Visual Studio 后,选择 C++ 桌面开发的工作负荷后,可能会下载 8GB 左右的编译工具,下载速度取决于你的网络状况。

安装 Git

Git for Windows 可以从 这里 下载并安装 Standalone Installer 64-bit 版本,安装在默认位置(C:\Program Files\Git\)。 如果不想手动下载和安装,你也可以使用 Visual Studio Installer,在单个组件的选择列表中,勾选 Git。

准备 static-php-cli

static-php-cli 项目的下载方式很简单,只需要使用 git clone 即可。推荐将项目放在 C:\spc-build\ 或类似目录,路径最好不要有空格。

shell
mkdir "C:\spc-build"
+    
Skip to content

在 Windows 上构建

因为 Windows 系统是 NT 内核,与类 Unix 的操作系统使用的编译工具及操作系统接口几乎完全不同,所以在 Windows 上的构建流程会与 Unix 系统有些许不同。

GitHub Actions 构建

现在已支持从 Actions 构建 Windows 版本的 static-php 了。 和 Linux、macOS 一样,你需要先 Fork static-php-cli 仓库到你的 GitHub 账户中,然后你可以进入 扩展列表 选择要编译的扩展,然后进入自己仓库的 CI on Windows 选择 PHP 版本、填入扩展列表(逗号分割),点击 Run 即可。

如果你要在本地开发或构建,请继续向下阅读。

环境准备

在 Windows 上构建静态 PHP 所需要的工具与 PHP 官方的 Windows 构建工具是相同的。你可以阅读 官方文档

总结下来,你需要以下环境及工具:

  • Windows 10(需要 build 17063 或以后的更新)
  • Visual Studio 2019/2022(推荐 2022)
  • Visual Studio 的 C++ 桌面开发
  • Git for Windows
  • static-php-cli 仓库
  • PHP 和 Composer(static-php-cli 需要它们,可使用 bin/setup-runtime 自动安装)
  • php-sdk-binary-tools(可使用 doctor 自动安装)
  • strawberry-perl(可使用 doctor 自动安装)
  • nasm(可使用 doctor 自动安装)

TIP

static-php-cli 在 Windows 上的构建指的是使用 MSVC 构建 PHP,不基于 MinGW、Cygwin、WSL 等环境。

如果你更倾向使用 WSL,请参考在 Linux 上构建的章节。

在安装 Visual Studio 后,选择 C++ 桌面开发的工作负荷后,可能会下载 8GB 左右的编译工具,下载速度取决于你的网络状况。

安装 Git

Git for Windows 可以从 这里 下载并安装 Standalone Installer 64-bit 版本,安装在默认位置(C:\Program Files\Git\)。 如果不想手动下载和安装,你也可以使用 Visual Studio Installer,在单个组件的选择列表中,勾选 Git。

准备 static-php-cli

static-php-cli 项目的下载方式很简单,只需要使用 git clone 即可。推荐将项目放在 C:\spc-build\ 或类似目录,路径最好不要有空格。

shell
mkdir "C:\spc-build"
 cd C:\spc-build
 git clone https://github.com/crazywhalecc/static-php-cli.git
-cd static-php-cli

static-php-cli 自身需要 PHP 环境,是有点奇怪,但现在可以通过脚本快速安装 PHP 环境。 一般你的电脑不会安装 Windows 版本的 PHP,所以我们建议你在下载 static-php-cli 后,直接使用 bin/setup-runtime,在当前目录安装 PHP 和 Composer。

shell
# 安装 PHP 和 Composer 到 ./runtime/ 目录
+cd static-php-cli

static-php-cli 自身需要 PHP 环境,是有点奇怪,但现在可以通过脚本快速安装 PHP 环境。 一般你的电脑不会安装 Windows 版本的 PHP,所以我们建议你在下载 static-php-cli 后,直接使用 bin/setup-runtime,在当前目录安装 PHP 和 Composer。

shell
# 安装 PHP 和 Composer 到 ./runtime/ 目录
 bin/setup-runtime
 
 # 安装后,如需在全局命令中使用 PHP 和 Composer,使用下面的命令将 runtime/ 目录添加到 PATH
 bin/setup-runtime -action add-path
 # 删除 PATH 中的 runtime/ 目录
-bin/setup-runtime -action remove-path

在准备好 PHP 和 Composer 环境后,使用 composer 安装 static-php-cli 的依赖:

shell
cd C:\spc-build\static-php-cli
-runtime/composer install --no-dev

自动安装其他依赖

对于 php-sdk-binary-toolsstrawberry-perlnasm,我们更建议你直接使用命令 bin/spc doctor --auto-fix 检查并安装。

如果 doctor 成功自动安装,请跳过下方手动安装上述工具的步骤。

如果自动安装无法成功的话,再参考下方手动安装的方式。

手动安装 php-sdk-binary-tools

bat
cd C:\spc-build\static-php-cli
-git clone https://github.com/php/php-sdk-binary-tools.git

你也可以在 Windows 设置中设置全局变量 PHP_SDK_PATH,并将该项目克隆至变量对应的路径。一般情况下,默认即可。

手动安装 strawberry-perl

如果你不需要编译 openssl 扩展,可不安装 perl。

  1. GitHub 下载 strawberry-perl 最新版。
  2. 安装到 C:\spc-build\static-php-cli\pkgroot\perl\ 目录。

你可以下载 -portable 版本,并直接解压到上述目录。 最后的 perl.exe 应该位于 C:\spc-build\static-php-cli\pkgroot\perl\perl\bin\perl.exe

手动安装 nasm

如果你不需要编译 openssl 扩展,可不安装 nasm。

  1. 官网 下载 nasm 工具(x64)。
  2. nasm.exendisasm.exe 放在 C:\spc-build\static-php-cli\php-sdk-binary-tools\bin\ 目录。

下载源码

本地构建 - download

编译 PHP

使用 build 命令可以开始构建静态 php 二进制,在执行 bin/spc build 命令前,务必先使用 download 命令下载资源,建议使用 doctor 检查环境。

基本用法

你需要先到 扩展列表命令生成器 选择你要加入的扩展,然后使用命令 bin/spc build 进行编译。你需要指定编译目标,从如下参数中选择:

  • --build-cli: 构建一个 cli sapi(命令行界面,可在命令行执行 PHP 代码)
  • --build-micro: 构建一个 micro sapi(用于构建一个包含 PHP 代码的独立可执行二进制)
shell
# 编译 PHP,附带 bcmath,openssl,zlib 扩展,编译目标为 cli
+bin/setup-runtime -action remove-path

在准备好 PHP 和 Composer 环境后,使用 composer 安装 static-php-cli 的依赖:

shell
cd C:\spc-build\static-php-cli
+runtime/composer install --no-dev

自动安装其他依赖

对于 php-sdk-binary-toolsstrawberry-perlnasm,我们更建议你直接使用命令 bin/spc doctor --auto-fix 检查并安装。

如果 doctor 成功自动安装,请跳过下方手动安装上述工具的步骤。

如果自动安装无法成功的话,再参考下方手动安装的方式。

手动安装 php-sdk-binary-tools

bat
cd C:\spc-build\static-php-cli
+git clone https://github.com/php/php-sdk-binary-tools.git

你也可以在 Windows 设置中设置全局变量 PHP_SDK_PATH,并将该项目克隆至变量对应的路径。一般情况下,默认即可。

手动安装 strawberry-perl

如果你不需要编译 openssl 扩展,可不安装 perl。

  1. GitHub 下载 strawberry-perl 最新版。
  2. 安装到 C:\spc-build\static-php-cli\pkgroot\perl\ 目录。

你可以下载 -portable 版本,并直接解压到上述目录。 最后的 perl.exe 应该位于 C:\spc-build\static-php-cli\pkgroot\perl\perl\bin\perl.exe

手动安装 nasm

如果你不需要编译 openssl 扩展,可不安装 nasm。

  1. 官网 下载 nasm 工具(x64)。
  2. nasm.exendisasm.exe 放在 C:\spc-build\static-php-cli\php-sdk-binary-tools\bin\ 目录。

下载源码

本地构建 - download

编译 PHP

使用 build 命令可以开始构建静态 php 二进制,在执行 bin/spc build 命令前,务必先使用 download 命令下载资源,建议使用 doctor 检查环境。

基本用法

你需要先到 扩展列表命令生成器 选择你要加入的扩展,然后使用命令 bin/spc build 进行编译。你需要指定编译目标,从如下参数中选择:

  • --build-cli: 构建一个 cli sapi(命令行界面,可在命令行执行 PHP 代码)
  • --build-micro: 构建一个 micro sapi(用于构建一个包含 PHP 代码的独立可执行二进制)
shell
# 编译 PHP,附带 bcmath,openssl,zlib 扩展,编译目标为 cli
 bin/spc build "bcmath,openssl,zlib" --build-cli
 
 # 编译 PHP,附带 bcmath,openssl,zlib 扩展,编译目标为 micro 和 cli
-bin/spc build "bcmath,openssl,zlib" --build-micro --build-cli

WARNING

在Windows中,最好使用双引号包裹包含逗号的参数,例如 "bcmath,openssl,mbstring"

调试

如果你在编译过程中遇到了问题,或者想查看每个执行的 shell 命令,可以使用 --debug 开启 debug 模式,查看所有终端日志:

shell
bin/spc build "openssl" --build-cli --debug

编译运行选项

在编译过程中,有些特殊情况需要对编译器、编译目录的内容进行干预,可以尝试使用以下命令:

  • --with-clean: 编译 PHP 前先清理旧的 make 产生的文件
  • --enable-zts: 让编译的 PHP 为线程安全版本(默认为 NTS 版本)
  • --with-libs=XXX,YYY: 编译 PHP 前先编译指定的依赖库,激活部分扩展的可选功能
  • --with-config-file-scan-dir=XXX: 读取 php.ini 后扫描 .ini 文件的目录(在 这里 查看默认路径)
  • -I xxx=yyy: 编译前将 INI 选项硬编译到 PHP 内(支持多个选项,别名是 --with-hardcoded-ini
  • --with-micro-fake-cli: 在编译 micro 时,让 micro 的 SAPI 伪装为 cli(用于兼容一些检查 PHP_SAPI 的程序)
  • --disable-opcache-jit: 禁用 opcache jit(默认启用)
  • --without-micro-ext-test: 在构建 micro.sfx 后,禁用测试不同扩展在 micro.sfx 的运行结果
  • --with-suggested-exts: 编译时将 ext-suggests 也作为编译依赖加入
  • --with-suggested-libs: 编译时将 lib-suggests 也作为编译依赖加入
  • --with-upx-pack: 编译后使用 UPX 减小二进制文件体积(需先使用 bin/spc install-pkg upx 安装 upx)
  • --with-micro-logo=XXX.ico: 自定义 micro 构建组合后的 exe 可执行文件的图标(格式为 .ico

有关硬编码 INI 选项,下面是一个简单的例子,我们预设一个更大的 memory_limit,并且禁用 system 函数:

shell
bin/spc build "bcmath,openssl" --build-cli -I "memory_limit=4G" -I "disable_functions=system"

另一个例子:自定义 micro 构建后的 exe 程序图标:

shell
bin/spc build "ffi,bcmath" --build-micro --with-micro-logo=mylogo.ico --debug
+bin/spc build "bcmath,openssl,zlib" --build-micro --build-cli

WARNING

在Windows中,最好使用双引号包裹包含逗号的参数,例如 "bcmath,openssl,mbstring"

调试

如果你在编译过程中遇到了问题,或者想查看每个执行的 shell 命令,可以使用 --debug 开启 debug 模式,查看所有终端日志:

shell
bin/spc build "openssl" --build-cli --debug

编译运行选项

在编译过程中,有些特殊情况需要对编译器、编译目录的内容进行干预,可以尝试使用以下命令:

  • --with-clean: 编译 PHP 前先清理旧的 make 产生的文件
  • --enable-zts: 让编译的 PHP 为线程安全版本(默认为 NTS 版本)
  • --with-libs=XXX,YYY: 编译 PHP 前先编译指定的依赖库,激活部分扩展的可选功能
  • --with-config-file-scan-dir=XXX: 读取 php.ini 后扫描 .ini 文件的目录(在 这里 查看默认路径)
  • -I xxx=yyy: 编译前将 INI 选项硬编译到 PHP 内(支持多个选项,别名是 --with-hardcoded-ini
  • --with-micro-fake-cli: 在编译 micro 时,让 micro 的 SAPI 伪装为 cli(用于兼容一些检查 PHP_SAPI 的程序)
  • --disable-opcache-jit: 禁用 opcache jit(默认启用)
  • --without-micro-ext-test: 在构建 micro.sfx 后,禁用测试不同扩展在 micro.sfx 的运行结果
  • --with-suggested-exts: 编译时将 ext-suggests 也作为编译依赖加入
  • --with-suggested-libs: 编译时将 lib-suggests 也作为编译依赖加入
  • --with-upx-pack: 编译后使用 UPX 减小二进制文件体积(需先使用 bin/spc install-pkg upx 安装 upx)
  • --with-micro-logo=XXX.ico: 自定义 micro 构建组合后的 exe 可执行文件的图标(格式为 .ico

有关硬编码 INI 选项,下面是一个简单的例子,我们预设一个更大的 memory_limit,并且禁用 system 函数:

shell
bin/spc build "bcmath,openssl" --build-cli -I "memory_limit=4G" -I "disable_functions=system"

另一个例子:自定义 micro 构建后的 exe 程序图标:

shell
bin/spc build "ffi,bcmath" --build-micro --with-micro-logo=mylogo.ico --debug
 bin/spc micro:combine hello.php
 # Then we got `my-app.exe` with custom logo!
-my-app.exe

使用 php.exe

php.exe 编译后位于 buildroot\bin\ 目录,你可以将其拷贝到任意位置使用。

shell
.\php -v

使用 micro

phpmicro 是一个提供自执行二进制 PHP 的项目,本项目依赖 phpmicro 进行编译自执行二进制。详见 dixyes/phpmicro

最后编译结果会输出一个 ./micro.sfx 的文件,此文件需要配合你的 PHP 源码使用。 该文件编译后会存放在 buildroot/bin/ 目录中。

使用时应准备好你的项目源码文件,可以是单个 PHP 文件,也可以是 Phar 文件。

如果要结合 phar 文件,编译时必须包含 phar 扩展!

shell
# code.php "<?php echo 'Hello world' . PHP_EOL;"
+my-app.exe

使用 php.exe

php.exe 编译后位于 buildroot\bin\ 目录,你可以将其拷贝到任意位置使用。

shell
.\php -v

使用 micro

phpmicro 是一个提供自执行二进制 PHP 的项目,本项目依赖 phpmicro 进行编译自执行二进制。详见 dixyes/phpmicro

最后编译结果会输出一个 ./micro.sfx 的文件,此文件需要配合你的 PHP 源码使用。 该文件编译后会存放在 buildroot/bin/ 目录中。

使用时应准备好你的项目源码文件,可以是单个 PHP 文件,也可以是 Phar 文件。

如果要结合 phar 文件,编译时必须包含 phar 扩展!

shell
# code.php "<?php echo 'Hello world' . PHP_EOL;"
 bin/spc micro:combine code.php -O my-app.exe
 # Run it!!! Copy it to another computer!!!
-./my-app.exe

如果打包 PHAR 文件,仅需把 code.php 更换为 phar 文件路径即可。 你可以使用 box-project/box 将你的 CLI 项目打包为 Phar, 然后将它与 phpmicro 结合,生成独立可执行的二进制文件。

有关 micro:combine 命令的更多细节,请参考 Unix 系统上的 命令

Released under the MIT License.

- +./my-app.exe

如果打包 PHAR 文件,仅需把 code.php 更换为 phar 文件路径即可。 你可以使用 box-project/box 将你的 CLI 项目打包为 Phar, 然后将它与 phpmicro 结合,生成独立可执行的二进制文件。

有关 micro:combine 命令的更多细节,请参考 Unix 系统上的 命令

Released under the MIT License.

+ \ No newline at end of file diff --git a/zh/guide/build-with-glibc.html b/zh/guide/build-with-glibc.html index b6086c15..3d67d041 100644 --- a/zh/guide/build-with-glibc.html +++ b/zh/guide/build-with-glibc.html @@ -5,20 +5,21 @@ 构建 glibc 兼容的 Linux 二进制 | static-php-cli - - + + + - + - - - + + + -
Skip to content

构建 glibc 兼容的 Linux 二进制

为什么要构建 glibc 兼容的二进制

目前,static-php-cli 在默认条件下在 Linux 系统构建的二进制都是基于 musl-libc(静态链接)的。 musl-libc 是一个轻量级的 libc 实现,它的目标是与 glibc 兼容,并且提供良好的纯静态链接支持。 这意味着,编译出来的静态 PHP 可执行文件在几乎任何 Linux 发行版都可以使用,而不需要考虑 libc、libstdc++ 等库的版本问题。

但是,Linux 系统的纯静态链接 musl-libc 二进制文件存在以下问题:

  • 无法使用 PHP 的 dl() 函数加载动态链接库和外部 PHP 扩展。
  • 无法使用 PHP 的 FFI 扩展。
  • 部分极端情况下,可能会出现性能问题,参见 musl-libc 的性能问题

对于不同的 Linux 发行版,它们使用的默认 libc 可能不同,比如 Alpine Linux 使用 musl libc,而大多数 Linux 发行版使用 glibc。 但即便如此,我们也不能直接使用任意的发行版和 glibc 构建便携的静态二进制文件,因为 glibc 有一些问题:

  • 基于新版本的发行版在使用 gcc 等工具构建的二进制,无法在旧版本的发行版上运行。
  • glibc 不推荐被静态链接,因为它的一些特性需要动态链接库的支持。

但是,我们可以使用 Docker 容器来解决这个问题,最终输出的结果是一个动态链接 glibc 和一些必要库的二进制,但它静态链接所有其他依赖。

  1. 使用一个旧版本的 Linux 发行版(如 CentOS 7.x),它的 glibc 版本比较旧,但是可以在大多数现代 Linux 发行版上运行。
  2. 在这个容器中构建 PHP 的静态二进制文件,这样就可以在大多数现代 Linux 发行版上运行了。

使用 glibc 的静态二进制文件,可以在大多数现代 Linux 发行版上运行,但是不能在 musl libc 的发行版上运行,如 CentOS 6、Alpine Linux 等。

构建 glibc 兼容的 Linux 二进制

最新版的 static-php-cli 内置了 bin/spc-gnu-docker 脚本,可以一键创建一个 CentOS 7.x (glibc-2.17) 的 Docker 容器,并在容器中构建 glibc 兼容的 PHP 静态二进制文件。

然后,先运行一次以下命令。首次运行时时间较长,因为需要下载 CentOS 7.x 的镜像和一些编译工具。

bash
bin/spc-gnu-docker

构建镜像完成后,你将看到和 bin/spc 一样的命令帮助菜单,这时说明容器已经准备好了。

在容器准备好后,你可以参考 本地构建 章节的内容,构建你的 PHP 静态二进制文件。仅需要把 bin/spc./spc 替换为 bin/spc-gnu-docker 即可。

bash
bin/spc-gnu-docker build bcmath,ctype,openssl,pdo,phar,posix,session,tokenizer,xml,zip --build-cli --debug

注意事项

极少数情况下,基于 glibc 的静态 PHP 可能会出现 segment fault 等错误,但目前例子较少,如果遇到问题请提交 issue。

glibc 构建为扩展的特性,不属于默认 static-php 的支持范围。如果有相关问题或需求,请在提交 Issue 时注明你是基于 glibc 构建的。

如果你需要不使用 Docker 构建基于 glibc 的二进制,请参考 bin/spc-gnu-docker 脚本,手动构建一个类似的环境。

由于 glibc 二进制不是项目的主要目标,一般情况下我们不会额外测试 glibc 下的各个库和扩展的兼容性。 任何特定库如果在 musl-libc 上构建成功,但在 glibc 上构建失败,请提交 issue,我们将会单独解决。

Released under the MIT License.

- +
Skip to content

构建 glibc 兼容的 Linux 二进制

为什么要构建 glibc 兼容的二进制

目前,static-php-cli 在默认条件下在 Linux 系统构建的二进制都是基于 musl-libc(静态链接)的。 musl-libc 是一个轻量级的 libc 实现,它的目标是与 glibc 兼容,并且提供良好的纯静态链接支持。 这意味着,编译出来的静态 PHP 可执行文件在几乎任何 Linux 发行版都可以使用,而不需要考虑 libc、libstdc++ 等库的版本问题。

但是,Linux 系统的纯静态链接 musl-libc 二进制文件存在以下问题:

  • 无法使用 PHP 的 dl() 函数加载动态链接库和外部 PHP 扩展。
  • 无法使用 PHP 的 FFI 扩展。
  • 部分极端情况下,可能会出现性能问题,参见 musl-libc 的性能问题

对于不同的 Linux 发行版,它们使用的默认 libc 可能不同,比如 Alpine Linux 使用 musl libc,而大多数 Linux 发行版使用 glibc。 但即便如此,我们也不能直接使用任意的发行版和 glibc 构建便携的静态二进制文件,因为 glibc 有一些问题:

  • 基于新版本的发行版在使用 gcc 等工具构建的二进制,无法在旧版本的发行版上运行。
  • glibc 不推荐被静态链接,因为它的一些特性需要动态链接库的支持。

但是,我们可以使用 Docker 容器来解决这个问题,最终输出的结果是一个动态链接 glibc 和一些必要库的二进制,但它静态链接所有其他依赖。

  1. 使用一个旧版本的 Linux 发行版(如 CentOS 7.x),它的 glibc 版本比较旧,但是可以在大多数现代 Linux 发行版上运行。
  2. 在这个容器中构建 PHP 的静态二进制文件,这样就可以在大多数现代 Linux 发行版上运行了。

使用 glibc 的静态二进制文件,可以在大多数现代 Linux 发行版上运行,但是不能在 musl libc 的发行版上运行,如 CentOS 6、Alpine Linux 等。

构建 glibc 兼容的 Linux 二进制

最新版的 static-php-cli 内置了 bin/spc-gnu-docker 脚本,可以一键创建一个 CentOS 7.x (glibc-2.17) 的 Docker 容器,并在容器中构建 glibc 兼容的 PHP 静态二进制文件。

然后,先运行一次以下命令。首次运行时时间较长,因为需要下载 CentOS 7.x 的镜像和一些编译工具。

bash
bin/spc-gnu-docker

构建镜像完成后,你将看到和 bin/spc 一样的命令帮助菜单,这时说明容器已经准备好了。

在容器准备好后,你可以参考 本地构建 章节的内容,构建你的 PHP 静态二进制文件。仅需要把 bin/spc./spc 替换为 bin/spc-gnu-docker 即可。

bash
bin/spc-gnu-docker build bcmath,ctype,openssl,pdo,phar,posix,session,tokenizer,xml,zip --build-cli --debug

注意事项

极少数情况下,基于 glibc 的静态 PHP 可能会出现 segment fault 等错误,但目前例子较少,如果遇到问题请提交 issue。

glibc 构建为扩展的特性,不属于默认 static-php 的支持范围。如果有相关问题或需求,请在提交 Issue 时注明你是基于 glibc 构建的。

如果你需要不使用 Docker 构建基于 glibc 的二进制,请参考 bin/spc-gnu-docker 脚本,手动构建一个类似的环境。

由于 glibc 二进制不是项目的主要目标,一般情况下我们不会额外测试 glibc 下的各个库和扩展的兼容性。 任何特定库如果在 musl-libc 上构建成功,但在 glibc 上构建失败,请提交 issue,我们将会单独解决。

Released under the MIT License.

+ \ No newline at end of file diff --git a/zh/guide/cli-generator.html b/zh/guide/cli-generator.html index 4a1f6871..6c7539dd 100644 --- a/zh/guide/cli-generator.html +++ b/zh/guide/cli-generator.html @@ -5,26 +5,27 @@ CLI 编译命令生成器 | static-php-cli - - + + + - + - - - - + + + + -
Skip to content

CLI 编译命令生成器

TIP

下面选择扩展可能包含所选操作系统不支持的扩展,这可能导致编译失败。请先查阅 支持的扩展

选择操作系统

选择扩展


选择常用扩展
全部取消选择
要构建的库

TIP

选择扩展后,不可选中的项目为必需的依赖,编译的依赖库列表中可选的为现有扩展和依赖库的可选依赖。选择可选依赖后,将生成 --with-libs 参数。

选择编译目标

编译选项

编译环境
下载 PHP 版本
是否开启调试输出
是否编译线程安全版
是否展示仅下载对应扩展依赖的命令
如果可能,下载预编译的依赖库(减少编译时间)
是否开启 UPX 压缩(减小二进制体积)

硬编码 INI 选项

结果展示

下载 spc 二进制命令
curl -fsSL -o spc.tgz https://dl.static-php.dev/static-php-cli/spc-bin/nightly/spc-linux-x86_64.tar.gz && tar -zxvf spc.tgz && rm spc.tgz
只下载对应扩展的依赖包命令
./spc download --with-php=8.2 --for-extensions "" --prefer-pre-built
编译命令
./spc build --build-cli ""
craft.yml
php-version: 8.2 +
Skip to content

CLI 编译命令生成器

TIP

下面选择扩展可能包含所选操作系统不支持的扩展,这可能导致编译失败。请先查阅 支持的扩展

选择操作系统

选择扩展


选择常用扩展
选择全部
全部取消选择
要构建的库

TIP

选择扩展后,不可选中的项目为必需的依赖,编译的依赖库列表中可选的为现有扩展和依赖库的可选依赖。选择可选依赖后,将生成 --with-libs 参数。

无法同时构建所有扩展,因为有些扩展之间相互冲突。请根据需要选择扩展。

选择编译目标

编译选项

编译环境
下载 PHP 版本
是否开启调试输出
是否编译线程安全版
是否展示仅下载对应扩展依赖的命令
如果可能,下载预编译的依赖库(减少编译时间)
是否开启 UPX 压缩(减小二进制体积)

硬编码 INI 选项

结果展示

下载 spc 二进制命令
curl -fsSL -o spc.tgz https://dl.static-php.dev/static-php-cli/spc-bin/nightly/spc-linux-x86_64.tar.gz && tar -zxvf spc.tgz && rm spc.tgz
只下载对应扩展的依赖包命令
./spc download --with-php=8.4 --for-extensions "" --prefer-pre-built
编译命令
./spc build --build-cli ""
craft.yml
php-version: 8.4 extensions: "" sapi: cli build-options: prefer-pre-built: true -

Released under the MIT License.

- +

Released under the MIT License.

+ \ No newline at end of file diff --git a/zh/guide/deps-map.html b/zh/guide/deps-map.html index 72f44a28..e845f6b3 100644 --- a/zh/guide/deps-map.html +++ b/zh/guide/deps-map.html @@ -5,20 +5,21 @@ 依赖关系图表 | static-php-cli - - + + + - + - - - + + + -
Skip to content

依赖关系图表

在编译 PHP 时,每个扩展、库都有依赖关系,这些依赖关系可能是必需的,也可能是可选的。在编译 PHP 时,可以选择是否包含这些可选的依赖关系。

例如,在 Linux 下编译 gd 扩展时,会强制编译 zlib,libpng 库和 zlib 扩展,而 libavif,libwebp,libjpeg,freetype 库都是可选的库,默认不会编译,除非通过 --with-libs=avif,webp,jpeg,freetype 选项指定。

  • 对于可选扩展(扩展的可选特性),需手动在编译时指定,例如启用 Redis 的 igbinary 支持:bin/spc build redis,igbinary
  • 对于可选库,需通过 --with-libs=XXX 选项编译指定。
  • 如果想启用所有的可选扩展,可以使用 bin/spc build redis --with-suggested-exts 参数。
  • 如果想启用所有的可选库,可以使用 --with-suggested-libs 参数。

扩展的依赖图

Linux

Extension NameRequired ExtensionsSuggested ExtensionsRequired LibrariesSuggested Libraries
amqplibrabbitmq
bz2bzip2
curlcurl
dbaqdbm
domlibxml2
zlib
eventopensslsocketslibevent
ffilibffi
ftpopenssl
gdzlibzlib
libpng
libavif
libwebp
libjpeg
freetype
gettextgettext
gmpgmp
gmsslgmssl
grpcgrpc
iconvlibiconv
igbinarysession
apcu
imagickimagemagick
imapopensslimap
intlicu
ldapopensslldapgmp
libsodium
lz4liblz4
libxmlxml
mbregexmbstringonig
memcachezlib
session
mongodbicu
openssl
zstd
zlib
mysqlimysqlnd
mysqlndzlib
odbcunixodbc
opensslzlibopenssl
zlib
password-argon2libargon2
pdo_mysqlpdo
mysqlnd
pdo_odbcpdo
odbc
unixodbc
pdo_pgsqlpdo
pgsql
postgresql
pdo_sqlitepdo
sqlite3
sqlite
pdo_sqlsrvpdo
sqlsrv
pgsqlpostgresql
pharzlib
rdkafkalibrdkafka
readlinereadline
redissession
igbinary
zstd
liblz4
simplexmllibxml2
snappyapcusnappy
soaplibxml2
sodiumlibsodium
spxzlib
sqlite3sqlite
sqlsrvpcntlunixodbc
ssh2libssh2
swooleopenssl
curl
swoole-hook-pgsql
swoole-hook-mysql
swoole-hook-sqlite
libcares
brotli
nghttp2
zlib
swoole-hook-mysqlmysqlnd
pdo
pdo_mysql
mysqli
swoole-hook-pgsqlpgsql
pdo
swoole-hook-sqlitesqlite3
pdo
swowopenssl
curl
openssl
curl
tidytidy
uuidlibuuid
uvsocketslibuv
xhprofctype
xlswriterzlib
zip
openssl
xmllibxml2
xmlreaderlibxml2
xmlwriterlibxml2
xslxml
dom
libxslt
yacigbinary
yamllibyaml
ziplibzip
zlibzlib
zstdzstd

macOS

Extension NameRequired ExtensionsSuggested ExtensionsRequired LibrariesSuggested Libraries
amqplibrabbitmq
bz2bzip2
curlcurl
dbaqdbm
domlibxml2
zlib
eventopensslsocketslibevent
ffilibffi
ftpopenssl
gdzlibzlib
libpng
libavif
libwebp
libjpeg
freetype
gettextgettext
glfwglfw
gmpgmp
gmsslgmssl
grpcgrpc
iconvlibiconv
igbinarysession
apcu
imagickimagemagick
imapopensslimap
intlicu
ldapopensslldapgmp
libsodium
lz4liblz4
libxmlxml
mbregexmbstringonig
memcachezlib
session
memcachedsession
zlib
libmemcached
mongodbicu
openssl
zstd
zlib
mysqlimysqlnd
mysqlndzlib
odbcunixodbc
opensslzlibopenssl
zlib
password-argon2libargon2
pdo_mysqlpdo
mysqlnd
pdo_odbcpdo
odbc
unixodbc
pdo_pgsqlpdo
pgsql
postgresql
pdo_sqlitepdo
sqlite3
sqlite
pdo_sqlsrvpdo
sqlsrv
pgsqlpostgresql
pharzlib
rdkafkalibrdkafka
readlinereadline
redissession
igbinary
zstd
liblz4
simplexmllibxml2
snappyapcusnappy
soaplibxml2
sodiumlibsodium
spxzlib
sqlite3sqlite
sqlsrvunixodbc
ssh2libssh2
swooleopenssl
curl
swoole-hook-pgsql
swoole-hook-mysql
swoole-hook-sqlite
libcares
brotli
nghttp2
zlib
swoole-hook-mysqlmysqlnd
pdo
pdo_mysql
mysqli
swoole-hook-pgsqlpgsql
pdo
swoole-hook-sqlitesqlite3
pdo
swowopenssl
curl
openssl
curl
tidytidy
uuidlibuuid
uvsocketslibuv
xhprofctype
xlswriterzlib
zip
openssl
xmllibxml2
xmlreaderlibxml2
xmlwriterlibxml2
xslxml
dom
libxslt
yacigbinary
yamllibyaml
ziplibzip
zlibzlib
zstdzstd

Windows

Extension NameRequired ExtensionsSuggested ExtensionsRequired LibrariesSuggested Libraries
amqpopenssllibrabbitmq
bz2bzip2
curlzlib
openssl
curl
dbaqdbm
domxmllibxml2
zlib
ffilibffi-win
ftpopenssl
gdzlibzlib
libpng
libavif
libwebp
libjpeg
freetype
gmsslgmssl
iconvlibiconv-win
igbinarysession
apcu
libxmlxml
mbregexmbstringonig
mysqlimysqlnd
mysqlndzlib
opensslzlibopenssl
zlib
parallelpthreads4w
pdo_mysqlpdo
mysqlnd
pdo_odbcpdo
odbc
pdo_pgsqlpdo
pgsql
postgresql-win
pdo_sqlitepdo
sqlite3
sqlite
pdo_sqlsrvpdo
sqlsrv
pgsqlpostgresql-win
pharzlib
redissession
igbinary
simplexmlxmllibxml2
soapxmllibxml2
sodiumlibsodium
sqlite3sqlite
ssh2openssl
zlib
libssh2
swowopenssl
curl
openssl
curl
xlswriterzlib
zip
openssl
xmliconvlibxml2
xmlreaderxml
dom
libxml2
xmlwriterxmllibxml2
yamllibyaml
zipzlib
bz2
libzip
zlib
bzip2
xz
zlibzlib

FreeBSD

Extension NameRequired ExtensionsSuggested ExtensionsRequired LibrariesSuggested Libraries
bz2bzip2
curlcurl
dbaqdbm
ftpopenssl
mbregexmbstringonig
mysqlimysqlnd
mysqlndzlib
opensslzlibopenssl
zlib
pdo_mysqlpdo
mysqlnd
pharzlib
zlibzlib

库的依赖表

Linux

Library NameRequired LibrariesSuggested Libraries
curlopenssl
zlib
libssh2
brotli
nghttp2
nghttp3
ngtcp2
zstd
libcares
freetypezliblibpng
bzip2
brotli
gettextlibiconvncurses
libxml2
grpczlib
openssl
imagemagickzlib
libpng
libjpeg
libwebp
freetype
libtiff
libheif
bzip2
zstd
xz
libzip
libxml2
imapopenssl
ldapopenssl
zlib
gmp
libsodium
libaclattr
libeventopenssl
libheiflibde265
libwebp
libaom
zlib
brotli
libpngzlib
librabbitmqopenssl
librdkafkazstd
libssh2opensslzlib
libtiffzlib
libjpeg
libxml2libiconvxz
icu
zlib
libxsltlibxml2
libzipzlibbzip2
xz
zstd
openssl
nghttp2zlib
openssl
libxml2
nghttp3
ngtcp2
nghttp3openssl
ngtcp2opensslnghttp3
brotli
opensslzlib
postgresqllibiconv
libxml2
openssl
zlib
readline
icu
libxslt
ldap
zstd
readlinencurses
snappyzlib
unixodbclibiconv
xzlibiconv

macOS

Library NameRequired LibrariesSuggested Libraries
curlopenssl
zlib
libssh2
brotli
nghttp2
nghttp3
ngtcp2
zstd
libcares
freetypezliblibpng
bzip2
brotli
gettextlibiconvncurses
libxml2
grpczlib
openssl
imagemagickzlib
libpng
libjpeg
libwebp
freetype
libtiff
libheif
bzip2
zstd
xz
libzip
libxml2
imapopenssl
ldapopenssl
zlib
gmp
libsodium
libeventopenssl
libheiflibde265
libwebp
libaom
zlib
brotli
libpngzlib
librabbitmqopenssl
librdkafkazstd
libssh2opensslzlib
libtiffzlib
libjpeg
libxml2libiconvxz
icu
zlib
libxsltlibxml2
libzipzlibbzip2
xz
zstd
openssl
nghttp2zlib
openssl
libxml2
nghttp3
ngtcp2
nghttp3openssl
ngtcp2opensslnghttp3
brotli
opensslzlib
postgresqllibiconv
libxml2
openssl
zlib
readline
icu
libxslt
ldap
zstd
readlinencurses
snappyzlib
unixodbclibiconv
xzlibiconv

Windows

Library NameRequired LibrariesSuggested Libraries
curlzlib
libssh2
nghttp2
brotli
zstd
freetypezliblibpng
bzip2
brotli
libjpegzlib
libpngzlib
librabbitmqopenssl
libssh2opensslzlib
libxml2libiconv-winzlib
libzipzlib
bzip2
xz
zstd
openssl
nghttp2zlib
openssl
libxml2
nghttp3
ngtcp2
nghttp3openssl
ngtcp2opensslnghttp3
brotli
opensslzlib

FreeBSD

Library NameRequired LibrariesSuggested Libraries
curlopenssl
zlib
libssh2
brotli
nghttp2
nghttp3
ngtcp2
zstd
libcares
opensslzlib

Released under the MIT License.

- +
Skip to content

依赖关系图表

在编译 PHP 时,每个扩展、库都有依赖关系,这些依赖关系可能是必需的,也可能是可选的。在编译 PHP 时,可以选择是否包含这些可选的依赖关系。

例如,在 Linux 下编译 gd 扩展时,会强制编译 zlib,libpng 库和 zlib 扩展,而 libavif,libwebp,libjpeg,freetype 库都是可选的库,默认不会编译,除非通过 --with-libs=avif,webp,jpeg,freetype 选项指定。

  • 对于可选扩展(扩展的可选特性),需手动在编译时指定,例如启用 Redis 的 igbinary 支持:bin/spc build redis,igbinary
  • 对于可选库,需通过 --with-libs=XXX 选项编译指定。
  • 如果想启用所有的可选扩展,可以使用 bin/spc build redis --with-suggested-exts 参数。
  • 如果想启用所有的可选库,可以使用 --with-suggested-libs 参数。

扩展的依赖图

Linux

Extension NameRequired ExtensionsSuggested ExtensionsRequired LibrariesSuggested Libraries
amqplibrabbitmq
brotlibrotli
bz2bzip2
curlcurl
dbaqdbm
domlibxml2
zlib
evsockets
eventopensslsocketslibevent
ffilibffi
ftpopenssl
gdzlibzlib
libpng
libavif
libwebp
libjpeg
freetype
gettextgettext
gmpgmp
gmsslgmssl
grpcgrpc
iconvlibiconv
igbinarysession
apcu
imagickimagemagick
imapopensslimap
intlicu
ldapopensslldapgmp
libsodium
lz4liblz4
mbregexmbstringonig
memcachezlib
session
memcachedsession
zlib
libmemcached
fastlz
mongodbicu
openssl
zstd
zlib
msgpacksession
mysqlimysqlnd
mysqlndzlib
odbcunixodbc
opensslzlibopenssl
zlib
password-argon2libargon2
pdo_mysqlpdo
mysqlnd
pdo_odbcpdo
odbc
unixodbc
pdo_pgsqlpdo
pgsql
postgresql
pdo_sqlitepdo
sqlite3
sqlite
pdo_sqlsrvpdo
sqlsrv
pgsqlpostgresql
pharzlib
rdkafkalibrdkafka
readlinereadline
redissession
igbinary
zstd
liblz4
simplexmllibxml2
snappyapcusnappy
soaplibxml2
sodiumlibsodium
spxzlib
sqlite3sqlite
sqlsrvpcntlunixodbc
ssh2openssl
zlib
libssh2
swooleopenssl
curl
swoole-hook-pgsql
swoole-hook-mysql
swoole-hook-sqlite
libcares
brotli
nghttp2
zlib
swoole-hook-mysqlmysqlnd
pdo
pdo_mysql
mysqli
swoole-hook-pgsqlpgsql
pdo
swoole-hook-sqlitesqlite3
pdo
swowopenssl
curl
openssl
curl
tidytidy
uuidlibuuid
uvsocketslibuv
xhprofctype
xlswriterzlib
zip
openssl
xmllibxml2
xmlreaderlibxml2
xmlwriterlibxml2
xslxml
dom
libxslt
xzxz
yacigbinaryfastlz
yamllibyaml
ziplibzip
zlibzlib
zstdzstd

macOS

Extension NameRequired ExtensionsSuggested ExtensionsRequired LibrariesSuggested Libraries
amqplibrabbitmq
brotlibrotli
bz2bzip2
curlcurl
dbaqdbm
domlibxml2
zlib
evsockets
eventopensslsocketslibevent
ffilibffi
ftpopenssl
gdzlibzlib
libpng
libavif
libwebp
libjpeg
freetype
gettextgettext
glfwglfw
gmpgmp
gmsslgmssl
grpcgrpc
iconvlibiconv
igbinarysession
apcu
imagickimagemagick
imapopensslimap
intlicu
ldapopensslldapgmp
libsodium
lz4liblz4
mbregexmbstringonig
memcachezlib
session
memcachedsession
zlib
libmemcached
fastlz
mongodbicu
openssl
zstd
zlib
msgpacksession
mysqlimysqlnd
mysqlndzlib
odbcunixodbc
opensslzlibopenssl
zlib
password-argon2libargon2
pdo_mysqlpdo
mysqlnd
pdo_odbcpdo
odbc
unixodbc
pdo_pgsqlpdo
pgsql
postgresql
pdo_sqlitepdo
sqlite3
sqlite
pdo_sqlsrvpdo
sqlsrv
pgsqlpostgresql
pharzlib
rdkafkalibrdkafka
readlinereadline
redissession
igbinary
zstd
liblz4
simplexmllibxml2
snappyapcusnappy
soaplibxml2
sodiumlibsodium
spxzlib
sqlite3sqlite
sqlsrvunixodbc
ssh2openssl
zlib
libssh2
swooleopenssl
curl
swoole-hook-pgsql
swoole-hook-mysql
swoole-hook-sqlite
libcares
brotli
nghttp2
zlib
swoole-hook-mysqlmysqlnd
pdo
pdo_mysql
mysqli
swoole-hook-pgsqlpgsql
pdo
swoole-hook-sqlitesqlite3
pdo
swowopenssl
curl
openssl
curl
tidytidy
uuidlibuuid
uvsocketslibuv
xhprofctype
xlswriterzlib
zip
openssl
xmllibxml2
xmlreaderlibxml2
xmlwriterlibxml2
xslxml
dom
libxslt
xzxz
yacigbinaryfastlz
yamllibyaml
ziplibzip
zlibzlib
zstdzstd

Windows

Extension NameRequired ExtensionsSuggested ExtensionsRequired LibrariesSuggested Libraries
amqpopenssllibrabbitmq
brotlibrotli
bz2bzip2
curlzlib
openssl
curl
dbaqdbm
domxmllibxml2
zlib
evsockets
ffilibffi-win
ftpopenssl
gdzlibzlib
libpng
libavif
libwebp
libjpeg
freetype
gmsslgmssl
iconvlibiconv-win
igbinarysession
apcu
mbregexmbstringonig
msgpacksession
mysqlimysqlnd
mysqlndzlib
opensslzlibopenssl
zlib
parallelpthreads4w
pdo_mysqlpdo
mysqlnd
pdo_odbcpdo
odbc
pdo_pgsqlpdo
pgsql
postgresql-win
pdo_sqlitepdo
sqlite3
sqlite
pdo_sqlsrvpdo
sqlsrv
pgsqlpostgresql-win
pharzlib
redissession
igbinary
simplexmlxmllibxml2
soapxmllibxml2
sodiumlibsodium
sqlite3sqlite
ssh2openssl
zlib
libssh2
swowopenssl
curl
openssl
curl
xlswriterzlib
zip
openssl
xmliconvlibxml2
xmlreaderxml
dom
libxml2
xmlwriterxmllibxml2
xzxz
yamllibyaml
zipzlib
bz2
libzip
zlib
bzip2
xz
zlibzlib

FreeBSD

Extension NameRequired ExtensionsSuggested ExtensionsRequired LibrariesSuggested Libraries
brotlibrotli
bz2bzip2
curlcurl
dbaqdbm
evsockets
ftpopenssl
mbregexmbstringonig
mysqlimysqlnd
mysqlndzlib
opensslzlibopenssl
zlib
pdo_mysqlpdo
mysqlnd
pharzlib
xzxz
zlibzlib

库的依赖表

Linux

Library NameRequired LibrariesSuggested Libraries
curlopenssl
zlib
libssh2
brotli
nghttp2
nghttp3
ngtcp2
zstd
libcares
freetypezliblibpng
bzip2
brotli
gettextlibiconvncurses
libxml2
grpczlib
openssl
imagemagickzlib
libpng
libjpeg
libwebp
freetype
libtiff
libheif
bzip2
zstd
xz
libzip
libxml2
imapopenssl
ldapopenssl
zlib
gmp
libsodium
libaclattr
libeventopenssl
libheiflibde265
libwebp
libaom
zlib
brotli
libpngzlib
librabbitmqopenssl
librdkafkazstd
libssh2opensslzlib
libtiffzlib
libjpeg
libxml2libiconvxz
icu
zlib
libxsltlibxml2
libzipzlibbzip2
xz
zstd
openssl
nghttp2zlib
openssl
libxml2
nghttp3
ngtcp2
nghttp3openssl
ngtcp2opensslnghttp3
brotli
opensslzlib
postgresqllibiconv
libxml2
openssl
zlib
readline
icu
libxslt
ldap
zstd
readlinencurses
snappyzlib
unixodbclibiconv
xzlibiconv

macOS

Library NameRequired LibrariesSuggested Libraries
curlopenssl
zlib
libssh2
brotli
nghttp2
nghttp3
ngtcp2
zstd
libcares
freetypezliblibpng
bzip2
brotli
gettextlibiconvncurses
libxml2
grpczlib
openssl
imagemagickzlib
libpng
libjpeg
libwebp
freetype
libtiff
libheif
bzip2
zstd
xz
libzip
libxml2
imapopenssl
ldapopenssl
zlib
gmp
libsodium
libeventopenssl
libheiflibde265
libwebp
libaom
zlib
brotli
libpngzlib
librabbitmqopenssl
librdkafkazstd
libssh2opensslzlib
libtiffzlib
libjpeg
libxml2libiconvxz
icu
zlib
libxsltlibxml2
libzipzlibbzip2
xz
zstd
openssl
nghttp2zlib
openssl
libxml2
nghttp3
ngtcp2
nghttp3openssl
ngtcp2opensslnghttp3
brotli
opensslzlib
postgresqllibiconv
libxml2
openssl
zlib
readline
icu
libxslt
ldap
zstd
readlinencurses
snappyzlib
unixodbclibiconv
xzlibiconv

Windows

Library NameRequired LibrariesSuggested Libraries
curlzlib
libssh2
nghttp2
brotli
zstd
freetypezliblibpng
bzip2
brotli
libjpegzlib
libpngzlib
librabbitmqopenssl
libssh2opensslzlib
libxml2libiconv-winzlib
libzipzlib
bzip2
xz
zstd
openssl
nghttp2zlib
openssl
libxml2
nghttp3
ngtcp2
nghttp3openssl
ngtcp2opensslnghttp3
brotli
opensslzlib

FreeBSD

Library NameRequired LibrariesSuggested Libraries
curlopenssl
zlib
libssh2
brotli
nghttp2
nghttp3
ngtcp2
zstd
libcares
opensslzlib

Released under the MIT License.

+ \ No newline at end of file diff --git a/zh/guide/env-vars.html b/zh/guide/env-vars.html index ec334120..d0351d79 100644 --- a/zh/guide/env-vars.html +++ b/zh/guide/env-vars.html @@ -5,31 +5,32 @@ 环境变量 | static-php-cli - - + + + - + - - - + + + -
Skip to content

环境变量

本页面的环境变量列表中所提到的所有环境变量都具有默认值,除非另有说明。你可以通过设置这些环境变量来覆盖默认值。

环境变量列表

在 2.3.5 版本之后,我们将环境变量集中到了 config/env.ini 文件中,你可以通过修改这个文件来设置环境变量。

我们将 static-php-cli 支持的环境变量分为三种:

  • 全局内部环境变量:在 static-php-cli 启动后即声明,你可以在 static-php-cli 的内部使用 getenv() 来获取他们,也可以在启动 static-php-cli 前覆盖。
  • 固定环境变量:在 static-php-cli 启动后声明,你仅可使用 getenv() 获取,但无法通过 shell 脚本对其覆盖。
  • 配置文件环境变量:在 static-php-cli 构建前声明,你可以通过修改 config/env.ini 文件或通过 shell 脚本来设置这些环境变量。

你可以阅读 config/env.ini 中每项参数的注释来了解其作用(仅限英文版)。

自定义环境变量

一般情况下,你不需要修改任何以下环境变量,因为它们已经被设置为最佳值。 但是,如果你有特殊需求,你可以通过设置这些环境变量来满足你的需求(比如你需要调试不同编译参数下的 PHP 性能表现)。

如需使用自定义环境变量,你可以在终端中使用 export 命令或者在命令前直接设置环境变量,例如:

shell
# export 方式
+    
Skip to content

环境变量

本页面的环境变量列表中所提到的所有环境变量都具有默认值,除非另有说明。你可以通过设置这些环境变量来覆盖默认值。

环境变量列表

在 2.3.5 版本之后,我们将环境变量集中到了 config/env.ini 文件中,你可以通过修改这个文件来设置环境变量。

我们将 static-php-cli 支持的环境变量分为三种:

  • 全局内部环境变量:在 static-php-cli 启动后即声明,你可以在 static-php-cli 的内部使用 getenv() 来获取他们,也可以在启动 static-php-cli 前覆盖。
  • 固定环境变量:在 static-php-cli 启动后声明,你仅可使用 getenv() 获取,但无法通过 shell 脚本对其覆盖。
  • 配置文件环境变量:在 static-php-cli 构建前声明,你可以通过修改 config/env.ini 文件或通过 shell 脚本来设置这些环境变量。

你可以阅读 config/env.ini 中每项参数的注释来了解其作用(仅限英文版)。

自定义环境变量

一般情况下,你不需要修改任何以下环境变量,因为它们已经被设置为最佳值。 但是,如果你有特殊需求,你可以通过设置这些环境变量来满足你的需求(比如你需要调试不同编译参数下的 PHP 性能表现)。

如需使用自定义环境变量,你可以在终端中使用 export 命令或者在命令前直接设置环境变量,例如:

shell
# export 方式
 export SPC_CONCURRENCY=4
 bin/spc build mbstring,pcntl --build-cli
 
 # 直接设置方式
-SPC_CONCURRENCY=4 bin/spc build mbstring,pcntl --build-cli

或者,如果你需要长期修改某个环境变量,你可以通过修改 config/env.ini 文件来实现。

config/env.ini 分为三段,其中 [global] 全局有效,[windows][macos][linux] 仅对应的操作系统有效。

例如,你需要修改编译 PHP 的 ./configure 命令,你可以在 config/env.ini 文件中找到 SPC_CMD_PREFIX_PHP_CONFIGURE 环境变量,然后修改其值即可。

但如果你的构建条件比较复杂,需要多种 env.ini 进行切换,我们推荐你使用 config/env.custom.ini 文件,这样你可以在不修改默认的 config/env.ini 文件的情况下, 通过写入额外的重载项目指定你的环境变量。

ini
; This is an example of `config/env.custom.ini` file, 
+SPC_CONCURRENCY=4 bin/spc build mbstring,pcntl --build-cli

或者,如果你需要长期修改某个环境变量,你可以通过修改 config/env.ini 文件来实现。

config/env.ini 分为三段,其中 [global] 全局有效,[windows][macos][linux] 仅对应的操作系统有效。

例如,你需要修改编译 PHP 的 ./configure 命令,你可以在 config/env.ini 文件中找到 SPC_CMD_PREFIX_PHP_CONFIGURE 环境变量,然后修改其值即可。

但如果你的构建条件比较复杂,需要多种 env.ini 进行切换,我们推荐你使用 config/env.custom.ini 文件,这样你可以在不修改默认的 config/env.ini 文件的情况下, 通过写入额外的重载项目指定你的环境变量。

ini
; This is an example of `config/env.custom.ini` file, 
 ; we modify the `SPC_CONCURRENCY` and linux default CFLAGS passing to libs and PHP
 [global]
 SPC_CONCURRENCY=4
 
 [linux]
-SPC_DEFAULT_C_FLAGS="-O3"

编译依赖库的环境变量(仅限 Unix 系统)

从 2.2.0 开始,static-php-cli 对所有 macOS、Linux、FreeBSD 等 Unix 系统的编译依赖库的命令均支持自定义环境变量。

这样你就可以随时通过环境变量来调整编译依赖库的行为。例如你可以通过 xxx_CFLAGS=-O0 来设置编译 xxx 库的优化参数。

当然,不是每个依赖库都支持注入环境变量,我们目前提供了三个通配的环境变量,后缀分别为:

  • _CFLAGS: C 编译器的参数
  • _LDFLAGS: 链接器的参数
  • _LIBS: 额外的链接库

前缀为依赖库的名称,具体依赖库的名称以 lib.json 为准。其中,带有 - 的依赖库名称需要将 - 替换为 _

下面是一个替换 openssl 库编译的优化选项示例:

shell
openssl_CFLAGS="-O0"

库名称使用同 lib.json 中列举的名称,区分大小写。

TIP

当未指定相关环境变量时,除以下变量外,其余值均默认为空:

var namevar default value
pkg_config_CFLAGSmacOS: $SPC_DEFAULT_C_FLAGS -Wimplicit-function-declaration -Wno-int-conversion, Other: empty
pkg_config_LDFLAGSLinux: --static, Other: empty
imagemagick_LDFLAGSLinux: -static, Other: empty
imagemagick_LIBSmacOS: -liconv, Other: empty
ldap_LDFLAGS-L$BUILD_LIB_PATH
openssl_CFLAGSLinux: $SPC_DEFAULT_C_FLAGS, Other: empty
others...empty

下表是支持自定义以上三种变量的依赖库名称列表:

lib name
brotli
bzip
curl
freetype
gettext
gmp
imagemagick
ldap
libargon2
libavif
libcares
libevent
openssl

TIP

因为给每个库适配自定义环境变量是一项特别繁琐的工作,且大部分情况下你都不需要这些库的自定义环境变量,所以我们目前只支持了部分库的自定义环境变量。

如果你需要自定义环境变量的库不在上方列表,可以通过 GitHub Issue 来提出需求。

Released under the MIT License.

- +SPC_DEFAULT_C_FLAGS="-O3"

编译依赖库的环境变量(仅限 Unix 系统)

从 2.2.0 开始,static-php-cli 对所有 macOS、Linux、FreeBSD 等 Unix 系统的编译依赖库的命令均支持自定义环境变量。

这样你就可以随时通过环境变量来调整编译依赖库的行为。例如你可以通过 xxx_CFLAGS=-O0 来设置编译 xxx 库的优化参数。

当然,不是每个依赖库都支持注入环境变量,我们目前提供了三个通配的环境变量,后缀分别为:

  • _CFLAGS: C 编译器的参数
  • _LDFLAGS: 链接器的参数
  • _LIBS: 额外的链接库

前缀为依赖库的名称,具体依赖库的名称以 lib.json 为准。其中,带有 - 的依赖库名称需要将 - 替换为 _

下面是一个替换 openssl 库编译的优化选项示例:

shell
openssl_CFLAGS="-O0"

库名称使用同 lib.json 中列举的名称,区分大小写。

TIP

当未指定相关环境变量时,除以下变量外,其余值均默认为空:

var namevar default value
pkg_config_CFLAGSmacOS: $SPC_DEFAULT_C_FLAGS -Wimplicit-function-declaration -Wno-int-conversion, Other: empty
pkg_config_LDFLAGSLinux: --static, Other: empty
imagemagick_LDFLAGSLinux: -static, Other: empty
imagemagick_LIBSmacOS: -liconv, Other: empty
ldap_LDFLAGS-L$BUILD_LIB_PATH
openssl_CFLAGSLinux: $SPC_DEFAULT_C_FLAGS, Other: empty
others...empty

下表是支持自定义以上三种变量的依赖库名称列表:

lib name
brotli
bzip
curl
freetype
gettext
gmp
imagemagick
ldap
libargon2
libavif
libcares
libevent
openssl

TIP

因为给每个库适配自定义环境变量是一项特别繁琐的工作,且大部分情况下你都不需要这些库的自定义环境变量,所以我们目前只支持了部分库的自定义环境变量。

如果你需要自定义环境变量的库不在上方列表,可以通过 GitHub Issue 来提出需求。

Released under the MIT License.

+ \ No newline at end of file diff --git a/zh/guide/extension-notes.html b/zh/guide/extension-notes.html index 0ecffe9b..90cedbcb 100644 --- a/zh/guide/extension-notes.html +++ b/zh/guide/extension-notes.html @@ -5,20 +5,21 @@ 扩展注意事项 | static-php-cli - - + + + - + - - - + + + -
Skip to content

扩展注意事项

因为是静态编译,扩展不会 100% 完美编译,而且不同扩展对 PHP、环境都有不同的要求,这里将一一列举。

curl

HTTP3 支持默认未启用,需在编译时添加 --with-libs="nghttp2,nghttp3,ngtcp2" 以启用 PHP 8.4 及以上版本的 HTTP3 支持。

使用 curl 请求 HTTPS 时,可能存在 error:80000002:system library::No such file or directory 错误, 解决办法详见 FAQ - 无法使用 ssl

phpmicro

  1. phpmicro SAPI 仅支持 PHP >= 8.0 版本。

swoole

  1. swoole >= 5.0 版本仅支持 PHP >= 8.0 版本。
  2. swoole 目前不支持 PHP 8.0 版本 curl 的 hook(后续有可能会修复)。
  3. 编译时只包含 swoole 扩展时不会完整开启支持的 Swoole 数据库协程 hook,如需使用请加入对应的 swoole-hook-xxx 扩展。
  4. swoole 在部分扩展组合下可能出现 zend_mm_heap corrupted 问题,暂未找到是什么原因导致的。

swoole-hook-pgsql

swoole-hook-pgsql 不是一个扩展,而是 Swoole 的 Hook 特性。 如果你在编译时添加了 swoole,swoole-hook-pgsql,你将启用 Swoole 的 PostgreSQL 客户端和 pdo_pgsql 扩展的协程模式。

swoole-hook-pgsql 与 pdo_pgsql 扩展冲突。如需使用 Swoole 和 pdo_pgsql,请删除 pdo_pgsql 扩展,启用 swooleswoole-hook-pgsql 即可。 该扩展包含了 pdo_pgsql 的协程环境的实现。

在 macOS 系统,pdo_pgsql 可能无法正常连接到 postgresql 服务器,请谨慎使用。

swoole-hook-mysql

swoole-hook-mysql 不是一个扩展,而是 Swoole 的 Hook 特性。 如果你在编译时添加了 swoole,swoole-hook-mysql,你将启用 Swoole 的 mysqlndpdo_mysql 的协程模式。

swoole-hook-sqlite

swoole-hook-sqlite 不是一个扩展,而是 Swoole 的 Hook 特性。 如果你在编译时添加了 swoole,swoole-hook-sqlite,你将启用 Swoole 的 pdo_sqlite 的协程模式(Swoole 必须为 5.1 以上)。

swoole-hook-sqlite 与 pdo_sqlite 扩展冲突。如需使用 Swoole 和 pdo_sqlite,请删除 pdo_sqlite 扩展,启用 swooleswoole-hook-sqlite 即可。 该扩展包含了 pdo_sqlite 的协程环境的实现。

swow

  1. swow 仅支持 PHP 8.0 ~ 8.4 版本。

imagick

imagick 扩展目前仅在 musl libc 上支持 OpenMP(libgomp)。使用 glibc 方式构建的 imagick 扩展无法支持多线程特性。

imap

  1. 该扩展目前不支持 Kerberos。
  2. 由于底层的 c-client、ext-imap 不是线程安全的。 无法在 --enable-zts 构建中使用它。
  3. 由于该扩展可能会从未来的 PHP 中删除,因此我们建议您寻找替代实现,例如 Webklex/php-imap

gd

  1. gd 扩展依赖了较多的额外图形库,默认情况下,直接使用 bin/spc build gd 不会引入和支持部分图形库,例如 libjpeglibavif 等, 需要使用 --with-libs 参数补全。目前支持 freetype,libjpeg,libavif,libwebp 四个库的支持,所以这里可以使用以下命令来让 gd 库引入它们:
bash
bin/spc build gd --with-libs=freetype,libjpeg,libavif,libwebp --build-cli

mcrypt

  1. 目前未支持,未来也不计划支持此扩展。#32

oci8

  1. oci8 是 Oracle 数据库的扩展,因为 Oracle 提供的扩展所依赖的库未提供静态编译版本(.a)或源代码,无法使用静态链接的方式将此扩展编译到 php 内,故无法支持。

xdebug

  1. Xdebug 只能作为共享扩展进行构建。在 Linux 上,您需要使用 static-php-cli 并设置 SPC_LIBC=glibc。
  2. 使用 Linux/glibc 或 macOS 时,您可以使用 --build-shared=xdebug 将 Xdebug 编译为共享扩展。 编译后的 ./php 二进制文件可以通过指定 INI 文件进行配置和运行,例如 ./php -d 'zend_extension=/path/to/xdebug.so' your-code.php

xml

  1. xml包括 xmlreader、xmlwriter、dom、simplexml 等,添加 xml 扩展时最好同时启用这些扩展。
  2. libxml 包含在 xml 扩展中。 启用 xml 相当于启用 libxml。

glfw

  1. glfw 扩展依赖 OpenGL,在 Linux 平台还依赖 X11 等环境,这些库都无法被轻易地动态链接。
  2. 在 macOS 系统下,我们可以动态链接系统的 OpenGL 和一些相关的库。

rar

  1. rar 扩展目前在 macOS x86_64 环境下与 common 扩展集合编译 phpmicro 存在问题。

pgsql

pgsql ssl 连接与 openssl 3.2.0 不兼容。相关链接:

pgsql 16.2 修复了这个 Bug,现在正常工作了。

在 pgsql 使用 SSL 连接时,可能存在 error:80000002:system library::No such file or directory 错误, 解决办法详见 FAQ - 无法使用 ssl

openssl

使用基于 openssl 的扩展(如 curl、pgsql 等网络库)时,可能存在 error:80000002:system library::No such file or directory 错误, 解决办法详见 FAQ - 无法使用 ssl

password-argon2

  1. password-argon2不是一个标准的扩展,它是 password_hash 函数的额外算法。
  2. 在Linux系统,password-argon2 的依赖库 libargon2libsodium 库冲突。

ffi

  1. 由于 musl libc 静态链接的限制,无法加载动态库,因此无法使用 ffi。 如果您需要使用 ffi 扩展,请参阅 使用 GNU libc 编译 PHP
  2. macOS 支持 ffi 扩展,但某些内核不包含调试符号时会出现错误。
  3. Windows x64 支持 ffi 扩展。

xhprof

xhprof 扩展包含三部分:xhprof_extensionxhprof_htmlxhprof_libs。编译的二进制中只包含 xhprof_extension。 如果需要使用 xhprof,请到 pecl.php.net/package/xhprof 下载源码,指定 xhprof_libsxhprof_html 路径来使用。

event

event 扩展在 macOS 系统下编译后暂无法使用 openpty 特性。相关 Issue:

parallel

parallel 扩展只支持 PHP 8.0 及以上版本,并只支持 ZTS 构建(--enable-zts)。

spx

  1. SPX 扩展 只支持非线程模式。
  2. SPX 目前不支持 Windows,且官方仓库也不支持静态编译,static-php-cli 使用了 修改版本

mimalloc

  1. 从技术上讲,这不是扩展,而是一个库。
  2. 在 Linux 或 macOS 上使用 --with-libs="mimalloc" 进行构建将覆盖默认分配器。
  3. 目前,这还处于实验阶段,但建议在线程环境中使用。

Released under the MIT License.

- +
Skip to content

扩展注意事项

因为是静态编译,扩展不会 100% 完美编译,而且不同扩展对 PHP、环境都有不同的要求,这里将一一列举。

curl

HTTP3 支持默认未启用,需在编译时添加 --with-libs="nghttp2,nghttp3,ngtcp2" 以启用 PHP 8.4 及以上版本的 HTTP3 支持。

使用 curl 请求 HTTPS 时,可能存在 error:80000002:system library::No such file or directory 错误, 解决办法详见 FAQ - 无法使用 ssl

phpmicro

  1. phpmicro SAPI 仅支持 PHP >= 8.0 版本。

swoole

  1. swoole >= 5.0 版本仅支持 PHP >= 8.0 版本。
  2. swoole 目前不支持 PHP 8.0 版本 curl 的 hook(后续有可能会修复)。
  3. 编译时只包含 swoole 扩展时不会完整开启支持的 Swoole 数据库协程 hook,如需使用请加入对应的 swoole-hook-xxx 扩展。
  4. swoole 在部分扩展组合下可能出现 zend_mm_heap corrupted 问题,暂未找到是什么原因导致的。

swoole-hook-pgsql

swoole-hook-pgsql 不是一个扩展,而是 Swoole 的 Hook 特性。 如果你在编译时添加了 swoole,swoole-hook-pgsql,你将启用 Swoole 的 PostgreSQL 客户端和 pdo_pgsql 扩展的协程模式。

swoole-hook-pgsql 与 pdo_pgsql 扩展冲突。如需使用 Swoole 和 pdo_pgsql,请删除 pdo_pgsql 扩展,启用 swooleswoole-hook-pgsql 即可。 该扩展包含了 pdo_pgsql 的协程环境的实现。

在 macOS 系统,pdo_pgsql 可能无法正常连接到 postgresql 服务器,请谨慎使用。

swoole-hook-mysql

swoole-hook-mysql 不是一个扩展,而是 Swoole 的 Hook 特性。 如果你在编译时添加了 swoole,swoole-hook-mysql,你将启用 Swoole 的 mysqlndpdo_mysql 的协程模式。

swoole-hook-sqlite

swoole-hook-sqlite 不是一个扩展,而是 Swoole 的 Hook 特性。 如果你在编译时添加了 swoole,swoole-hook-sqlite,你将启用 Swoole 的 pdo_sqlite 的协程模式(Swoole 必须为 5.1 以上)。

swoole-hook-sqlite 与 pdo_sqlite 扩展冲突。如需使用 Swoole 和 pdo_sqlite,请删除 pdo_sqlite 扩展,启用 swooleswoole-hook-sqlite 即可。 该扩展包含了 pdo_sqlite 的协程环境的实现。

swow

  1. swow 仅支持 PHP 8.0 ~ 8.4 版本。

imagick

imagick 扩展目前仅在 musl libc 上支持 OpenMP(libgomp)。使用 glibc 方式构建的 imagick 扩展无法支持多线程特性。

imap

  1. 该扩展目前不支持 Kerberos。
  2. 由于底层的 c-client、ext-imap 不是线程安全的。 无法在 --enable-zts 构建中使用它。
  3. 由于该扩展可能会从未来的 PHP 中删除,因此我们建议您寻找替代实现,例如 Webklex/php-imap

gd

  1. gd 扩展依赖了较多的额外图形库,默认情况下,直接使用 bin/spc build gd 不会引入和支持部分图形库,例如 libjpeglibavif 等, 需要使用 --with-libs 参数补全。目前支持 freetype,libjpeg,libavif,libwebp 四个库的支持,所以这里可以使用以下命令来让 gd 库引入它们:
bash
bin/spc build gd --with-libs=freetype,libjpeg,libavif,libwebp --build-cli

mcrypt

  1. 目前未支持,未来也不计划支持此扩展。#32

oci8

  1. oci8 是 Oracle 数据库的扩展,因为 Oracle 提供的扩展所依赖的库未提供静态编译版本(.a)或源代码,无法使用静态链接的方式将此扩展编译到 php 内,故无法支持。

xdebug

  1. Xdebug 只能作为共享扩展进行构建。在 Linux 上,您需要使用 static-php-cli 并设置 SPC_LIBC=glibc。
  2. 使用 Linux/glibc 或 macOS 时,您可以使用 --build-shared=xdebug 将 Xdebug 编译为共享扩展。 编译后的 ./php 二进制文件可以通过指定 INI 文件进行配置和运行,例如 ./php -d 'zend_extension=/path/to/xdebug.so' your-code.php

xml

  1. xml包括 xmlreader、xmlwriter、dom、simplexml 等,添加 xml 扩展时最好同时启用这些扩展。
  2. libxml 包含在 xml 扩展中。 启用 xml 相当于启用 libxml。

glfw

  1. glfw 扩展依赖 OpenGL,在 Linux 平台还依赖 X11 等环境,这些库都无法被轻易地动态链接。
  2. 在 macOS 系统下,我们可以动态链接系统的 OpenGL 和一些相关的库。

rar

  1. rar 扩展目前在 macOS x86_64 环境下与 common 扩展集合编译 phpmicro 存在问题。

pgsql

pgsql ssl 连接与 openssl 3.2.0 不兼容。相关链接:

pgsql 16.2 修复了这个 Bug,现在正常工作了。

在 pgsql 使用 SSL 连接时,可能存在 error:80000002:system library::No such file or directory 错误, 解决办法详见 FAQ - 无法使用 ssl

openssl

使用基于 openssl 的扩展(如 curl、pgsql 等网络库)时,可能存在 error:80000002:system library::No such file or directory 错误, 解决办法详见 FAQ - 无法使用 ssl

password-argon2

  1. password-argon2不是一个标准的扩展,它是 password_hash 函数的额外算法。
  2. 在Linux系统,password-argon2 的依赖库 libargon2libsodium 库冲突。

ffi

  1. 由于 musl libc 静态链接的限制,无法加载动态库,因此无法使用 ffi。 如果您需要使用 ffi 扩展,请参阅 使用 GNU libc 编译 PHP
  2. macOS 支持 ffi 扩展,但某些内核不包含调试符号时会出现错误。
  3. Windows x64 支持 ffi 扩展。

xhprof

xhprof 扩展包含三部分:xhprof_extensionxhprof_htmlxhprof_libs。编译的二进制中只包含 xhprof_extension。 如果需要使用 xhprof,请到 pecl.php.net/package/xhprof 下载源码,指定 xhprof_libsxhprof_html 路径来使用。

event

event 扩展在 macOS 系统下编译后暂无法使用 openpty 特性。相关 Issue:

parallel

parallel 扩展只支持 PHP 8.0 及以上版本,并只支持 ZTS 构建(--enable-zts)。

spx

  1. SPX 目前不支持 Windows,且官方仓库也不支持静态编译,static-php-cli 使用了 修改版本

mimalloc

  1. 从技术上讲,这不是扩展,而是一个库。
  2. 在 Linux 或 macOS 上使用 --with-libs="mimalloc" 进行构建将覆盖默认分配器。
  3. 目前,这还处于实验阶段,但建议在线程环境中使用。

Released under the MIT License.

+ \ No newline at end of file diff --git a/zh/guide/extensions.html b/zh/guide/extensions.html index 45587e54..ea450d7f 100644 --- a/zh/guide/extensions.html +++ b/zh/guide/extensions.html @@ -5,21 +5,22 @@ 扩展列表 | static-php-cli - - + + + - + - - - - + + + + -
Skip to content

扩展列表

  • yes: 已支持
  • 空白: 目前还不支持,或正在支持中
  • no with issue link: 确定不支持或无法支持
  • partial with issue link: 已支持,但是无法完美工作
Extension NameLinuxmacOSFreeBSDWindows
amqpyesyesyes
apcuyesyesyesyes
astyesyesyesyes
bcmathyesyesyesyes
bz2yesyesyesyes
calendaryesyesyesyes
ctypeyesyesyesyes
curlyesyesyesyes
dbayesyesyesyes
dioyesyesyes
domyesyesyes
dsyesyesyesyes
enchant
evyesyesyesyes
eventyesyes
exifyesyesyesyes
ffipartialyesyes
fileinfoyesyesyesyes
filteryesyesyesyes
ftpyesyesyesyes
gdyesyesyes
gettextyesyes
glfwnoyesno
gmpyesyes
gmsslyesyesyes
grpcyesyes
iconvyesyesyes
igbinaryyesyesyes
imagickyesyes
imapyesyes
inotifyyesnono
intlyesyesno
ldapyesyes
lz4yesyes
libxmlyesyesyes
mbregexyesyesyesyes
mbstringyesyesyesyes
mcryptnononono
memcacheyesyes
memcachednoyes
mongodbyesyes
msgpackyesyesyes
mysqliyesyesyesyes
mysqlndyesyesyesyes
oci8nonono
odbcyesyes
opcacheyesyesyesyes
opensslyesyesyesyes
opentelemetryyesyesyes
parallelyesyesyes
password-argon2yesyes
pcntlyesyesyesno
pdoyesyesyesyes
pdo_mysqlyesyesyesyes
pdo_odbcyesyesyes
pdo_pgsqlyesyesyes
pdo_sqliteyesyesyes
pdo_sqlsrvyesyesyes
pgsqlyesyesyes
pharyesyesyesyes
posixyesyesyesno
protobufyesyes
raryespartialyes
rdkafkayesyes
readlineyesyes
redisyesyesyes
sessionyesyesyesyes
shmopyesyesyesyes
simdjsonyesyesyesyes
simplexmlyesyesyes
snappyyesyes
soapyesyesyes
socketsyesyesyesyes
sodiumyesyesyes
spxyesyesno
sqlite3yesyesyes
sqlsrvyesyesyes
ssh2yesyesyes
swooleyesyesno
swoole-hook-mysqlyesyesno
swoole-hook-pgsqlyespartialno
swoole-hook-sqliteyesyesno
swowyesyesyes
sysvmsgyesyesno
sysvsemyesyesno
sysvshmyesyesyes
tidyyesyes
tokenizeryesyesyesyes
uuidyesyes
uvyesyes
xdebugpartialpartialno
xhprofyesyes
xlswriteryesyesyes
xmlyesyesyes
xmlreaderyesyesyes
xmlwriteryesyesyes
xslyesyes
yacyesyesyes
yamlyesyesyes
zipyesyesyes
zlibyesyesyesyes
zstdyesyes

TIP

如果缺少您需要的扩展,您可以创建 功能请求

有些扩展或扩展依赖的库会有一些可选的特性,例如 gd 库可选支持 libwebp、freetype 等。 如果你只使用 bin/spc build gd --build-cli 是不会包含它们(static-php-cli 默认为最小依赖原则)。

有关编译可选库,请参考 扩展、库的依赖关系图表。对于可选的库,你也可以从 编译命令生成器 中选择扩展后展开选择可选库。

Released under the MIT License.

- +
Skip to content

扩展列表

  • yes: 已支持
  • 空白: 目前还不支持,或正在支持中
  • no with issue link: 确定不支持或无法支持
  • partial with issue link: 已支持,但是无法完美工作
Extension NameLinuxmacOSFreeBSDWindows
amqpyesyesyes
apcuyesyesyesyes
astyesyesyesyes
bcmathyesyesyesyes
brotliyesyesyesyes
bz2yesyesyesyes
calendaryesyesyesyes
ctypeyesyesyesyes
curlyesyesyesyes
dbayesyesyesyes
dioyesyesyes
domyesyesyes
dsyesyesyesyes
enchant
evyesyesyesyes
eventyesyes
exifyesyesyesyes
ffipartialyesyes
fileinfoyesyesyesyes
filteryesyesyesyes
ftpyesyesyesyes
gdyesyesyes
gettextyesyes
glfwnoyesno
gmpyesyes
gmsslyesyesyes
grpcyesyes
iconvyesyesyes
igbinaryyesyesyes
imagickyesyes
imapyesyes
inotifyyesnono
intlyesyesno
ldapyesyes
libxmlyesyesyes
lz4yesyes
mbregexyesyesyesyes
mbstringyesyesyesyes
mcryptnononono
memcacheyesyes
memcachedyesyes
mongodbyesyes
msgpackyesyesyes
mysqliyesyesyesyes
mysqlndyesyesyesyes
oci8nonono
odbcyesyes
opcacheyesyesyesyes
opensslyesyesyesyes
opentelemetryyesyesyes
parallelyesyesyes
password-argon2yesyes
pcntlyesyesyesno
pdoyesyesyesyes
pdo_mysqlyesyesyesyes
pdo_odbcyesyesyes
pdo_pgsqlyesyesyes
pdo_sqliteyesyesyes
pdo_sqlsrvyesyesyes
pgsqlyesyesyes
pharyesyesyesyes
posixyesyesyesno
protobufyesyes
raryespartialyes
rdkafkayesyes
readlineyesyes
redisyesyesyes
sessionyesyesyesyes
shmopyesyesyesyes
simdjsonyesyesyesyes
simplexmlyesyesyes
snappyyesyes
soapyesyesyes
socketsyesyesyesyes
sodiumyesyesyes
spxyesyesno
sqlite3yesyesyes
sqlsrvyesyesyes
ssh2yesyesyes
swooleyesyesno
swoole-hook-mysqlyesyesno
swoole-hook-pgsqlyespartialno
swoole-hook-sqliteyesyesno
swowyesyesyes
sysvmsgyesyesno
sysvsemyesyesno
sysvshmyesyesyes
tidyyesyes
tokenizeryesyesyesyes
uuidyesyes
uvyesyes
xdebugpartialpartialno
xhprofyesyes
xlswriteryesyesyes
xmlyesyesyes
xmlreaderyesyesyes
xmlwriteryesyesyes
xslyesyes
xzyesyesyesyes
yacyesyesyes
yamlyesyesyes
zipyesyesyes
zlibyesyesyesyes
zstdyesyes

TIP

如果缺少您需要的扩展,您可以创建 功能请求

有些扩展或扩展依赖的库会有一些可选的特性,例如 gd 库可选支持 libwebp、freetype 等。 如果你只使用 bin/spc build gd --build-cli 是不会包含它们(static-php-cli 默认为最小依赖原则)。

有关编译可选库,请参考 扩展、库的依赖关系图表。对于可选的库,你也可以从 编译命令生成器 中选择扩展后展开选择可选库。

Released under the MIT License.

+ \ No newline at end of file diff --git a/zh/guide/index.html b/zh/guide/index.html index 66a9fe58..4c87dd1e 100644 --- a/zh/guide/index.html +++ b/zh/guide/index.html @@ -5,20 +5,21 @@ 指南 | static-php-cli - - + + + - + - - - + + + -
Skip to content

指南

static-php-cli 是一个用于构建静态编译的 PHP 二进制的工具,目前支持 Linux 和 macOS 系统。

在指南章节中,你将了解到如何使用 static-php-cli 构建独立的 php 程序。

编译环境

下面是架构支持情况,⚙️ 代表支持 GitHub Action 构建,💻 代表支持本地构建,空 代表暂不支持。

x86_64aarch64
macOS⚙️ 💻⚙️ 💻
Linux⚙️ 💻⚙️ 💻
Windows⚙️ 💻
FreeBSD💻💻

其中,Linux 目前仅在 Ubuntu、Debian、Alpine 发行版测试通过,其他发行版未进行测试,不能保证编译成功。 对于未经过测试的发行版,可以使用 Docker 等方式本地编译,避免环境导致的问题。

macOS 下支持 x86_64 和 Arm 两种架构,但在其中一个架构上编译的二进制无法直接在另一个架构上使用。 Rosetta 2 不能保证 Arm 架构编译的程序可以完全运行在 x86_64 环境下。

Windows 目前只支持 x86_64 架构,不支持 32 位 x86、不支持 arm64 架构。

PHP 支持版本

目前,static-php-cli 对 PHP 8.1 ~ 8.4 版本是支持的,对于 PHP 8.0 及更早版本理论上支持,只需下载时选择早期版本即可。 但由于部分扩展和特殊组件已对早期版本的 PHP 停止了支持,所以 static-php-cli 不会明确支持早期版本。 我们推荐你编译尽可能新的 PHP 版本,以获得更好的体验。

Released under the MIT License.

- +
Skip to content

指南

static-php-cli 是一个用于构建静态编译的 PHP 二进制的工具,目前支持 Linux 和 macOS 系统。

在指南章节中,你将了解到如何使用 static-php-cli 构建独立的 php 程序。

编译环境

下面是架构支持情况,⚙️ 代表支持 GitHub Action 构建,💻 代表支持本地构建,空 代表暂不支持。

x86_64aarch64
macOS⚙️ 💻⚙️ 💻
Linux⚙️ 💻⚙️ 💻
Windows⚙️ 💻
FreeBSD💻💻

其中,Linux 目前仅在 Ubuntu、Debian、Alpine 发行版测试通过,其他发行版未进行测试,不能保证编译成功。 对于未经过测试的发行版,可以使用 Docker 等方式本地编译,避免环境导致的问题。

macOS 下支持 x86_64 和 Arm 两种架构,但在其中一个架构上编译的二进制无法直接在另一个架构上使用。 Rosetta 2 不能保证 Arm 架构编译的程序可以完全运行在 x86_64 环境下。

Windows 目前只支持 x86_64 架构,不支持 32 位 x86、不支持 arm64 架构。

PHP 支持版本

目前,static-php-cli 对 PHP 8.1 ~ 8.4 版本是支持的,对于 PHP 8.0 及更早版本理论上支持,只需下载时选择早期版本即可。 但由于部分扩展和特殊组件已对早期版本的 PHP 停止了支持,所以 static-php-cli 不会明确支持早期版本。 我们推荐你编译尽可能新的 PHP 版本,以获得更好的体验。

Released under the MIT License.

+ \ No newline at end of file diff --git a/zh/guide/manual-build.html b/zh/guide/manual-build.html index 60a9ab74..75787a7e 100644 --- a/zh/guide/manual-build.html +++ b/zh/guide/manual-build.html @@ -5,19 +5,20 @@ 本地构建(Linux、macOS、FreeBSD) | static-php-cli - - + + + - + - - - + + + -
Skip to content

本地构建(Linux、macOS、FreeBSD)

本章节为 Linux、macOS、FreeBSD 的构建过程,如果你要在 Windows 上构建,请到 在 Windows 上构建

手动构建(使用 SPC 二进制)(推荐)

本项目提供了一个 static-php-cli 的二进制文件,你可以直接下载对应平台的二进制文件,然后使用它来构建静态的 PHP。目前 spc 二进制支持的平台有 Linux 和 macOS。

使用以下命令从自托管服务器下载:

bash
# Download from self-hosted nightly builds (sync with main branch)
+    
Skip to content

本地构建(Linux、macOS、FreeBSD)

本章节为 Linux、macOS、FreeBSD 的构建过程,如果你要在 Windows 上构建,请到 在 Windows 上构建

手动构建(使用 SPC 二进制)(推荐)

本项目提供了一个 static-php-cli 的二进制文件,你可以直接下载对应平台的二进制文件,然后使用它来构建静态的 PHP。目前 spc 二进制支持的平台有 Linux 和 macOS。

使用以下命令从自托管服务器下载:

bash
# Download from self-hosted nightly builds (sync with main branch)
 # For Linux x86_64
 curl -fsSL -o spc https://dl.static-php.dev/static-php-cli/spc-bin/nightly/spc-linux-x86_64
 # For Linux aarch64
@@ -35,26 +36,26 @@
 # Run (Linux and macOS)
 ./spc --version
 # Run (Windows powershell)
-.\spc.exe --version

如果你使用的是打包好的 spc 二进制,你需要将下面所有命令中 bin/spc 开头替换为 ./spc

手动构建(使用源码)

如果使用 spc 二进制出现问题,或你有修改 static-php-cli 源码需求,请从源码下载 static-php-cli。

目前支持在 macOS、Linux 上构建,macOS 支持最新版操作系统和两种架构,Linux 支持 Debian、RHEL 及衍生发行版、Alpine Linux 等。

因为本项目本身采用 PHP 开发,所以在编译时也需要系统安装 PHP。本项目本身也提供了适用于本项目的静态二进制 php,可以根据实际情况自行选择使用。

下载本项目

bash
git clone https://github.com/crazywhalecc/static-php-cli.git --depth=1
+.\spc.exe --version

如果你使用的是打包好的 spc 二进制,你需要将下面所有命令中 bin/spc 开头替换为 ./spc

手动构建(使用源码)

如果使用 spc 二进制出现问题,或你有修改 static-php-cli 源码需求,请从源码下载 static-php-cli。

目前支持在 macOS、Linux 上构建,macOS 支持最新版操作系统和两种架构,Linux 支持 Debian、RHEL 及衍生发行版、Alpine Linux 等。

因为本项目本身采用 PHP 开发,所以在编译时也需要系统安装 PHP。本项目本身也提供了适用于本项目的静态二进制 php,可以根据实际情况自行选择使用。

下载本项目

bash
git clone https://github.com/crazywhalecc/static-php-cli.git --depth=1
 cd static-php-cli
 
 # 你需要先安装 PHP 环境后再运行 Composer 和本项目,安装方式可参考下面。
-composer update

使用预编译静态 PHP 二进制运行 static-php-cli

如果你不想使用 Docker、在系统内安装 PHP,可以直接下载本项目自身编译好的 php 二进制 cli 程序。使用流程如下:

使用命令部署环境,此脚本会从 自托管的服务器 下载一个当前操作系统的 php-cli 包, 并从 getcomposerAliyun(镜像) 下载 Composer。

TIP

使用预编译静态 PHP 二进制目前仅支持 Linux 和 macOS。FreeBSD 环境因为缺少自动化构建环境,所以暂不支持。

bash
bin/setup-runtime
+composer update

使用预编译静态 PHP 二进制运行 static-php-cli

如果你不想使用 Docker、在系统内安装 PHP,可以直接下载本项目自身编译好的 php 二进制 cli 程序。使用流程如下:

使用命令部署环境,此脚本会从 自托管的服务器 下载一个当前操作系统的 php-cli 包, 并从 getcomposerAliyun(镜像) 下载 Composer。

TIP

使用预编译静态 PHP 二进制目前仅支持 Linux 和 macOS。FreeBSD 环境因为缺少自动化构建环境,所以暂不支持。

bash
bin/setup-runtime
 
 # 对于中国大陆地区等网络环境特殊的用户,可使用镜像站加快下载速度
-bin/setup-runtime --mirror china

此脚本总共会下载两个文件:bin/phpbin/composer,下载完成后,有两种使用方式:

  1. bin/ 目录添加到 PATH 路径中:export PATH="/path/to/your/static-php-cli/bin:$PATH",添加路径后,相当于系统安装了 PHP,可直接使用 composerphp -v 等命令,也可以直接使用 bin/spc
  2. 直接调用,比如执行 static-php-cli 命令:bin/php bin/spc --help,执行 Composer:bin/php bin/composer update

使用 Docker 环境

如果你不愿意在系统安装 PHP 和 Composer 运行环境,可以使用内置的 Docker 环境构建脚本。

bash
# 直接使用,将所有使用的命令中 `bin/spc` 替换为 `bin/spc-alpine-docker` 即可
-bin/spc-alpine-docker

首次执行命令会使用 docker build 构建一个 Docker 镜像,默认构建的 Docker 镜像为 x86_64 架构,镜像名称为 cwcc-spc-x86_64

如果你想在 x86_64 环境下构建 aarch64 的 static-php-cli,可以使用 qemu 模拟 arm 镜像运行 Docker,但速度会非常慢。使用参数:SPC_USE_ARCH=aarch64 bin/spc-alpine-docker

如果运行后提示需要 sudo 才能运行,执行一次以下命令可授予 static-php-cli 执行 sudo 的权限:

bash
export SPC_USE_SUDO=yes

使用系统 PHP 环境

下面是系统安装 PHP、Composer 的一些示例命令。具体安装方式建议自行搜索或询问 AI 搜索引擎获取答案,这里不多赘述。

bash
# [macOS], 需要先安装 Homebrew. See https://brew.sh/
+bin/setup-runtime --mirror china

此脚本总共会下载两个文件:bin/phpbin/composer,下载完成后,有两种使用方式:

  1. bin/ 目录添加到 PATH 路径中:export PATH="/path/to/your/static-php-cli/bin:$PATH",添加路径后,相当于系统安装了 PHP,可直接使用 composerphp -v 等命令,也可以直接使用 bin/spc
  2. 直接调用,比如执行 static-php-cli 命令:bin/php bin/spc --help,执行 Composer:bin/php bin/composer update

使用 Docker 环境

如果你不愿意在系统安装 PHP 和 Composer 运行环境,可以使用内置的 Docker 环境构建脚本。

bash
# 直接使用,将所有使用的命令中 `bin/spc` 替换为 `bin/spc-alpine-docker` 即可
+bin/spc-alpine-docker

首次执行命令会使用 docker build 构建一个 Docker 镜像,默认构建的 Docker 镜像为 x86_64 架构,镜像名称为 cwcc-spc-x86_64

如果你想在 x86_64 环境下构建 aarch64 的 static-php-cli,可以使用 qemu 模拟 arm 镜像运行 Docker,但速度会非常慢。使用参数:SPC_USE_ARCH=aarch64 bin/spc-alpine-docker

如果运行后提示需要 sudo 才能运行,执行一次以下命令可授予 static-php-cli 执行 sudo 的权限:

bash
export SPC_USE_SUDO=yes

使用系统 PHP 环境

下面是系统安装 PHP、Composer 的一些示例命令。具体安装方式建议自行搜索或询问 AI 搜索引擎获取答案,这里不多赘述。

bash
# [macOS], 需要先安装 Homebrew. See https://brew.sh/
 # Remember change your composer executable path. For M1/M2 Chip mac, "/opt/homebrew/bin/", for Intel mac, "/usr/local/bin/". Or add it to your own path.
 brew install php wget
 wget https://getcomposer.org/download/latest-stable/composer.phar -O /path/to/your/bin/composer && chmod +x /path/to/your/bin/composer
 
 # [Debian], you need to make sure your php version >= 8.4 and composer >= 2.0
-sudo apt install php-cli composer php-tokenizer

TIP

目前 Ubuntu 部分版本的 apt 安装的 php 版本较旧,故不提供安装命令。如有需要,建议先添加 ppa 等软件源后,安装最新版的 PHP 以及 tokenizer、xml、phar 扩展。

较老版本的 Debian 默认安装的可能为旧版本(<= 8.3)版本的 PHP,建议先升级 Debian 或使用 Docker 或自带的静态二进制环境。

使用 craft 构建(推荐)

使用 bin/spc craft 可以使用一个配置文件,一个命令实现自动检查环境、下载源代码、构建依赖库、构建 PHP 及扩展等。

你需要编写一个 craft.yml 文件,存放在当前工作目录下。craft.yml 可以由 命令生成器 生成,或者手动编写。

手动编写可参考 craft.yml 配置 中的注释来编写。我们下面假设你编译一个扩展组合,并选用 PHP 8.4,输出 clifpm

yaml
# path/to/craft.yml
+sudo apt install php-cli composer php-tokenizer

TIP

目前 Ubuntu 部分版本的 apt 安装的 php 版本较旧,故不提供安装命令。如有需要,建议先添加 ppa 等软件源后,安装最新版的 PHP 以及 tokenizer、xml、phar 扩展。

较老版本的 Debian 默认安装的可能为旧版本(<= 8.3)版本的 PHP,建议先升级 Debian 或使用 Docker 或自带的静态二进制环境。

使用 craft 构建(推荐)

使用 bin/spc craft 可以使用一个配置文件,一个命令实现自动检查环境、下载源代码、构建依赖库、构建 PHP 及扩展等。

你需要编写一个 craft.yml 文件,存放在当前工作目录下。craft.yml 可以由 命令生成器 生成,或者手动编写。

手动编写可参考 craft.yml 配置 中的注释来编写。我们下面假设你编译一个扩展组合,并选用 PHP 8.4,输出 clifpm

yaml
# path/to/craft.yml
 php-version: 8.4
 extensions: bcmath,posix,phar,zlib,openssl,curl,fileinfo,tokenizer
 sapi:
   - cli
-  - fpm

然后使用 bin/spc craft 命令来编译:

bash
bin/spc craft --debug

如果构建成功,你会在当前目录下看到 buildroot/bin 目录,里面包含了编译好的 PHP 二进制文件,或相应的 SAPI。

  • cli: Windows 下构建结果为 buildroot/bin/php.exe,其他平台为 buildroot/bin/php
  • fpm: 构建结果为 buildroot/bin/php-fpm
  • micro: 构建结果为 buildroot/bin/micro.sfx,如需进一步与 PHP 代码打包,请查看 打包 micro 二进制
  • embed: 参见 embed 使用

如果中途构建出错,你可以使用 --debug 参数查看详细的错误信息,或者使用 --with-clean 参数清除旧的编译结果,重新编译。

如使用以上方式仍构建失败,请提交一个 issue,附上你的 craft.ymlcraft.log

分步构建命令

如果你有定制化需求,或分开下载、编译 PHP 和依赖库的需求,可以使用 bin/spc 命令分步执行。

命令 download - 下载依赖包

使用命令 bin/spc download 可以下载编译需要的源代码,包括 php-src 以及依赖的各种库的源码。

bash
# 仅下载要编译的扩展及依赖库(使用扩展名,包含可选库)
+  - fpm

然后使用 bin/spc craft 命令来编译:

bash
bin/spc craft --debug

如果构建成功,你会在当前目录下看到 buildroot/bin 目录,里面包含了编译好的 PHP 二进制文件,或相应的 SAPI。

  • cli: Windows 下构建结果为 buildroot/bin/php.exe,其他平台为 buildroot/bin/php
  • fpm: 构建结果为 buildroot/bin/php-fpm
  • micro: 构建结果为 buildroot/bin/micro.sfx,如需进一步与 PHP 代码打包,请查看 打包 micro 二进制
  • embed: 参见 embed 使用

如果中途构建出错,你可以使用 --debug 参数查看详细的错误信息,或者使用 --with-clean 参数清除旧的编译结果,重新编译。

如使用以上方式仍构建失败,请提交一个 issue,附上你的 craft.ymlcraft.log

分步构建命令

如果你有定制化需求,或分开下载、编译 PHP 和依赖库的需求,可以使用 bin/spc 命令分步执行。

命令 download - 下载依赖包

使用命令 bin/spc download 可以下载编译需要的源代码,包括 php-src 以及依赖的各种库的源码。

bash
# 仅下载要编译的扩展及依赖库(使用扩展名,包含可选库)
 bin/spc download --for-extensions=openssl,swoole,zip,pcntl,zstd
 
 # 仅下载要编译的扩展及依赖库(使用扩展名,不包含可选库)
@@ -88,51 +89,51 @@
 bin/spc download php-src,micro,zstd,ext-zstd
 
 # 设置重试次数
-bin/spc download --all --retry=2

如果你所在地区的网络不好,或者下载依赖包速度过于缓慢,可以从 GitHub Action 下载每周定时打包的 download.zip,并使用命令直接使用 zip 压缩包作为依赖。 依赖包可以从 Action 下载到本地。 进入 Action 并选择一个最新成功运行的 Workflow,下载 download-files-x.y 即可。

bash
bin/spc download --from-zip=/path/to/your/download.zip

如果某个 source 始终无法下载,或者你需要下载一些特定版本的包,例如下载测试版 PHP、旧版本库等,可以使用参数 -U--custom-url 重写下载链接, 让下载器强制使用你指定的链接下载此 source 的包。使用方法为 {source-name}:{url} 即可,可同时重写多个库的下载地址。在使用 --for-extensions 选项下载时同样可用。

bash
# 例如:指定下载测试版的 PHP8.3
+bin/spc download --all --retry=2

如果你所在地区的网络不好,或者下载依赖包速度过于缓慢,可以从 GitHub Action 下载每周定时打包的 download.zip,并使用命令直接使用 zip 压缩包作为依赖。 依赖包可以从 Action 下载到本地。 进入 Action 并选择一个最新成功运行的 Workflow,下载 download-files-x.y 即可。

bash
bin/spc download --from-zip=/path/to/your/download.zip

如果某个 source 始终无法下载,或者你需要下载一些特定版本的包,例如下载测试版 PHP、旧版本库等,可以使用参数 -U--custom-url 重写下载链接, 让下载器强制使用你指定的链接下载此 source 的包。使用方法为 {source-name}:{url} 即可,可同时重写多个库的下载地址。在使用 --for-extensions 选项下载时同样可用。

bash
# 例如:指定下载测试版的 PHP8.3
 bin/spc download --all -U "php-src:https://downloads.php.net/~eric/php-8.3.0beta1.tar.gz"
 
 # 指定下载旧版本的 curl 库
-bin/spc download --all -U "curl:https://curl.se/download/curl-7.88.1.tar.gz"

如果你下载的资源不是链接,而是一个 Git 仓库,你可以使用 -G--custom-git 重写下载链接,让下载器强制使用你指定的 Git 仓库下载此 source 的包。 使用方法为 {source-name}:{branch}:{url} 即可,可同时重写多个库的下载地址。在使用 --for-extensions 选项下载时同样可用。

bash
# 例如:下载 master 分支的 php-src
+bin/spc download --all -U "curl:https://curl.se/download/curl-7.88.1.tar.gz"

如果你下载的资源不是链接,而是一个 Git 仓库,你可以使用 -G--custom-git 重写下载链接,让下载器强制使用你指定的 Git 仓库下载此 source 的包。 使用方法为 {source-name}:{branch}:{url} 即可,可同时重写多个库的下载地址。在使用 --for-extensions 选项下载时同样可用。

bash
# 例如:下载 master 分支的 php-src
 bin/spc download --for-extensions=redis,phar -G "php-src:master:https://github.com/php/php-src.git"
 
 # 从 swoole-src 仓库下载 master 分支的最新代码,而不是发行版
-bin/spc download --for-extensions=swoole -G "swoole:master:https://github.com/swoole/swoole-src.git"

命令 doctor - 环境检查

如果你可以正常运行 bin/spc 但无法正常编译静态的 PHP 或依赖库,可以先运行 bin/spc doctor 检查系统自身是否缺少依赖。

bash
# 快速检查
+bin/spc download --for-extensions=swoole -G "swoole:master:https://github.com/swoole/swoole-src.git"

命令 doctor - 环境检查

如果你可以正常运行 bin/spc 但无法正常编译静态的 PHP 或依赖库,可以先运行 bin/spc doctor 检查系统自身是否缺少依赖。

bash
# 快速检查
 bin/spc doctor
 
 # 快速检查,并在可以自动修复的时候修复(使用包管理安装依赖包,仅支持上述提到的操作系统及发行版)
-bin/spc doctor --auto-fix

命令 build - 编译 PHP

使用 build 命令可以开始构建静态 php 二进制,在执行 bin/spc build 命令前,务必先使用 download 命令下载资源,建议使用 doctor 检查环境。

基本用法

你需要先到 扩展列表命令生成器 选择你要加入的扩展,然后使用命令 bin/spc build 进行编译。你需要指定一个编译目标,从如下参数中选择:

  • --build-cli: 构建一个 cli sapi(命令行界面,可在命令行执行 PHP 代码)
  • --build-fpm: 构建一个 fpm sapi(php-fpm,用于和其他传统的 fpm 架构的软件如 nginx 配合使用)
  • --build-micro: 构建一个 micro sapi(用于构建一个包含 PHP 代码的独立可执行二进制)
  • --build-embed: 构建一个 embed sapi(用于嵌入到其他 C 语言程序中)
  • --build-all: 构建以上所有 sapi
bash
# 编译 PHP,附带 bcmath,curl,openssl,ftp,posix,pcntl 扩展,编译目标为 cli
+bin/spc doctor --auto-fix

命令 build - 编译 PHP

使用 build 命令可以开始构建静态 php 二进制,在执行 bin/spc build 命令前,务必先使用 download 命令下载资源,建议使用 doctor 检查环境。

基本用法

你需要先到 扩展列表命令生成器 选择你要加入的扩展,然后使用命令 bin/spc build 进行编译。你需要指定一个编译目标,从如下参数中选择:

  • --build-cli: 构建一个 cli sapi(命令行界面,可在命令行执行 PHP 代码)
  • --build-fpm: 构建一个 fpm sapi(php-fpm,用于和其他传统的 fpm 架构的软件如 nginx 配合使用)
  • --build-micro: 构建一个 micro sapi(用于构建一个包含 PHP 代码的独立可执行二进制)
  • --build-embed: 构建一个 embed sapi(用于嵌入到其他 C 语言程序中)
  • --build-all: 构建以上所有 sapi
bash
# 编译 PHP,附带 bcmath,curl,openssl,ftp,posix,pcntl 扩展,编译目标为 cli
 bin/spc build bcmath,curl,openssl,ftp,posix,pcntl --build-cli
 
 # 编译 PHP,附带 phar,curl,posix,pcntl,tokenizer 扩展,编译目标为 micro
-bin/spc build phar,curl,posix,pcntl,tokenizer --build-micro

TIP

如果你需要重复构建、调试,你可以删除 buildroot/source/ 两个目录,这样你可以从已下载的源码压缩包重新解压并构建:

shell
# remove
+bin/spc build phar,curl,posix,pcntl,tokenizer --build-micro

TIP

如果你需要重复构建、调试,你可以删除 buildroot/source/ 两个目录,这样你可以从已下载的源码压缩包重新解压并构建:

shell
# remove
 rm -rf buildroot source
 # build again
-bin/spc build bcmath,curl,openssl,ftp,posix,pcntl --build-cli

TIP

如果你想构建多个版本的 PHP,且不想每次都重复构建其他依赖库,可以使用 switch-php-version 在编译好一个版本后快速切换至另一个版本并编译:

shell
# switch to 8.4
+bin/spc build bcmath,curl,openssl,ftp,posix,pcntl --build-cli

TIP

如果你想构建多个版本的 PHP,且不想每次都重复构建其他依赖库,可以使用 switch-php-version 在编译好一个版本后快速切换至另一个版本并编译:

shell
# switch to 8.4
 bin/spc switch-php-version 8.4
 # build
 bin/spc build bcmath,curl,openssl,ftp,posix,pcntl --build-cli
 # switch to 8.1
 bin/spc switch-php-version 8.1
 # build
-bin/spc build bcmath,curl,openssl,ftp,posix,pcntl --build-cli

编译运行选项

在编译过程中,有些特殊情况需要对编译器、编译目录的内容进行干预,可以尝试使用以下命令:

  • --cc=XXX: 指定 C 语言编译器的执行命令(Linux 默认 musl-gccgcc,macOS 默认 clang
  • --cxx=XXX: 指定 C++ 语言编译器的执行命令(Linux 默认 g++,macOS 默认 clang++
  • --with-clean: 编译 PHP 前先清理旧的 make 产生的文件
  • --enable-zts: 让编译的 PHP 为线程安全版本(默认为 NTS 版本)
  • --no-strip: 编译 PHP 库后不运行 strip 裁剪二进制文件缩小体积(不裁剪的 macOS 二进制文件可使用动态链接的第三方扩展)
  • --with-libs=XXX,YYY: 编译 PHP 前先编译指定的依赖库,激活部分扩展的可选功能(例如 gd 库的 libavif 等)
  • --with-config-file-path=XXX: 查找 php.ini 的路径(在 这里 查看默认路径)
  • --with-config-file-scan-dir=XXX: 读取 php.ini 后扫描 .ini 文件的目录(在 这里 查看默认路径)
  • -I xxx=yyy: 编译前将 INI 选项硬编译到 PHP 内(支持多个选项,别名是 --with-hardcoded-ini
  • --with-micro-fake-cli: 在编译 micro 时,让 micro 的 SAPI 伪装为 cli(用于兼容一些检查 PHP_SAPI 的程序)
  • --disable-opcache-jit: 禁用 opcache jit(默认启用)
  • -P xxx.php: 在 static-php-cli 编译过程中注入外部脚本(详见下方 注入外部脚本
  • --without-micro-ext-test: 在构建 micro.sfx 后,禁用测试不同扩展在 micro.sfx 的运行结果
  • --with-suggested-exts: 编译时将 ext-suggests 也作为编译依赖加入
  • --with-suggested-libs: 编译时将 lib-suggests 也作为编译依赖加入
  • --with-upx-pack: 编译后使用 UPX 减小二进制文件体积(需先使用 bin/spc install-pkg upx 安装 upx)
  • --build-shared=XXX,YYY: 编译时将指定的扩展编译为共享库(默认编译为静态库)

硬编码 INI 选项适用于 cli、micro、embed。有关硬编码 INI 选项,下面是一个简单的例子,我们预设一个更大的 memory_limit,并且禁用 system 函数:

bash
bin/spc build bcmath,pcntl,posix --build-all -I "memory_limit=4G" -I "disable_functions=system"

命令 micro:combine - 打包 micro 二进制

使用 micro:combine 命令可以将上面编译好的 micro.sfx 和你的代码(.php.phar 文件)构建为一个可执行二进制。 你也可以使用该命令直接构建一个注入了 ini 配置的 micro 自执行二进制文件。

TIP

注入 ini 配置指的是,在将 micro.sfx 和 PHP 源码结合前,在 micro.sfx 后追加一段特殊的结构用于保存 ini 配置项。

micro.sfx 可通过特殊的字节来标识 INI 文件头,通过 INI 文件头可以实现 micro 带 INI 启动。

此特性的原说明地址在 phpmicro - Wiki,这个特性也有可能在未来发生变化。

下面是常规用法,直接打包 php 源码到一个文件中:

bash
# 在做打包流程前,你应该先使用 `build --build-micro` 编译好 micro.sfx
+bin/spc build bcmath,curl,openssl,ftp,posix,pcntl --build-cli

编译运行选项

在编译过程中,有些特殊情况需要对编译器、编译目录的内容进行干预,可以尝试使用以下命令:

  • --cc=XXX: 指定 C 语言编译器的执行命令(Linux 默认 musl-gccgcc,macOS 默认 clang
  • --cxx=XXX: 指定 C++ 语言编译器的执行命令(Linux 默认 g++,macOS 默认 clang++
  • --with-clean: 编译 PHP 前先清理旧的 make 产生的文件
  • --enable-zts: 让编译的 PHP 为线程安全版本(默认为 NTS 版本)
  • --no-strip: 编译 PHP 库后不运行 strip 裁剪二进制文件缩小体积(不裁剪的 macOS 二进制文件可使用动态链接的第三方扩展)
  • --with-libs=XXX,YYY: 编译 PHP 前先编译指定的依赖库,激活部分扩展的可选功能(例如 gd 库的 libavif 等)
  • --with-config-file-path=XXX: 查找 php.ini 的路径(在 这里 查看默认路径)
  • --with-config-file-scan-dir=XXX: 读取 php.ini 后扫描 .ini 文件的目录(在 这里 查看默认路径)
  • -I xxx=yyy: 编译前将 INI 选项硬编译到 PHP 内(支持多个选项,别名是 --with-hardcoded-ini
  • --with-micro-fake-cli: 在编译 micro 时,让 micro 的 SAPI 伪装为 cli(用于兼容一些检查 PHP_SAPI 的程序)
  • --disable-opcache-jit: 禁用 opcache jit(默认启用)
  • -P xxx.php: 在 static-php-cli 编译过程中注入外部脚本(详见下方 注入外部脚本
  • --without-micro-ext-test: 在构建 micro.sfx 后,禁用测试不同扩展在 micro.sfx 的运行结果
  • --with-suggested-exts: 编译时将 ext-suggests 也作为编译依赖加入
  • --with-suggested-libs: 编译时将 lib-suggests 也作为编译依赖加入
  • --with-upx-pack: 编译后使用 UPX 减小二进制文件体积(需先使用 bin/spc install-pkg upx 安装 upx)
  • --build-shared=XXX,YYY: 编译时将指定的扩展编译为共享库(默认编译为静态库)

硬编码 INI 选项适用于 cli、micro、embed。有关硬编码 INI 选项,下面是一个简单的例子,我们预设一个更大的 memory_limit,并且禁用 system 函数:

bash
bin/spc build bcmath,pcntl,posix --build-all -I "memory_limit=4G" -I "disable_functions=system"

命令 micro:combine - 打包 micro 二进制

使用 micro:combine 命令可以将上面编译好的 micro.sfx 和你的代码(.php.phar 文件)构建为一个可执行二进制。 你也可以使用该命令直接构建一个注入了 ini 配置的 micro 自执行二进制文件。

TIP

注入 ini 配置指的是,在将 micro.sfx 和 PHP 源码结合前,在 micro.sfx 后追加一段特殊的结构用于保存 ini 配置项。

micro.sfx 可通过特殊的字节来标识 INI 文件头,通过 INI 文件头可以实现 micro 带 INI 启动。

此特性的原说明地址在 phpmicro - Wiki,这个特性也有可能在未来发生变化。

下面是常规用法,直接打包 php 源码到一个文件中:

bash
# 在做打包流程前,你应该先使用 `build --build-micro` 编译好 micro.sfx
 echo "<?php echo 'hello';" > a.php
 bin/spc micro:combine a.php
 
 # 使用
-./my-app

你可以使用以下参数指定要输出的文件名,你也可以指定其他路径的 micro.sfx 进行打包。

bash
# 指定输出文件名
+./my-app

你可以使用以下参数指定要输出的文件名,你也可以指定其他路径的 micro.sfx 进行打包。

bash
# 指定输出文件名
 bin/spc micro:combine a.php --output=custom-bin
 # 使用绝对路径,也可以使用简化参数名
 bin/spc micro:combine a.php -O /tmp/my-custom-app
 
 # 指定其他位置的 micro.sfx 进行打包
-bin/spc micro:combine a.app --with-micro=/path/to/your/micro.sfx

如果想注入 ini 配置项,可以使用下面的参数,从文件或命令行选项添加 ini 到可执行文件中。

bash
# 使用命令行选项指定(-I 是 --with-ini-set 的简写)
+bin/spc micro:combine a.app --with-micro=/path/to/your/micro.sfx

如果想注入 ini 配置项,可以使用下面的参数,从文件或命令行选项添加 ini 到可执行文件中。

bash
# 使用命令行选项指定(-I 是 --with-ini-set 的简写)
 bin/spc micro:combine a.php -I "a=b" -I "foo=bar"
 
 # 使用 ini 文件指定(-N 是 --with-ini-file 的简写)
-bin/spc micro:combine a.php -N /path/to/your/custom.ini

WARNING

注意,请不要直接使用 PHP 源码或系统安装的 PHP 中的 php.ini 文件,最好手动编写一个自己需要的参数配置文件,例如:

ini
; custom.ini
+bin/spc micro:combine a.php -N /path/to/your/custom.ini

WARNING

注意,请不要直接使用 PHP 源码或系统安装的 PHP 中的 php.ini 文件,最好手动编写一个自己需要的参数配置文件,例如:

ini
; custom.ini
 curl.cainfo=/path/to/your/cafile.pem
-memory_limit=1G

该命令的注入 ini 是通过在 micro.sfx 后追加一段特殊的结构来实现的,和编译时插入硬编码 INI 的功能不同。

如果要打包 phar,只需要将 a.php 替换为打包好的 phar 文件即可。但要注意,phar 下的 micro.sfx 需要额外注意路径问题,见 Developing - Phar 路径问题

调试

如果你在编译过程中遇到了问题,或者想查看每个执行的 shell 命令,可以使用 --debug 开启 debug 模式,查看所有终端日志:

bash
bin/spc build mysqlnd,pdo_mysql --build-all --debug

命令 extract - 手动解压某个库

使用命令 bin/spc extract 可以解包和拷贝编译需要的源代码,包括 php-src 以及依赖的各种库的源码(需要自己指定要解包的库名)。

例如,我们在下载好资源后,想分布执行构建流程,手动解包和拷贝包到指定位置,可以使用命令。

bash
# 解压 php-src 和 libxml2 的下载压缩包,解压的源码存放在 source 目录
-bin/spc extract php-src,libxml2

命令 dump-extensions - 导出项目扩展依赖

使用命令 bin/spc dump-extensions 可以导出当前项目的扩展依赖。

bash
# 打印项目的扩展列表,传入项目包含composer.json的根目录
+memory_limit=1G

该命令的注入 ini 是通过在 micro.sfx 后追加一段特殊的结构来实现的,和编译时插入硬编码 INI 的功能不同。

如果要打包 phar,只需要将 a.php 替换为打包好的 phar 文件即可。但要注意,phar 下的 micro.sfx 需要额外注意路径问题,见 Developing - Phar 路径问题

调试

如果你在编译过程中遇到了问题,或者想查看每个执行的 shell 命令,可以使用 --debug 开启 debug 模式,查看所有终端日志:

bash
bin/spc build mysqlnd,pdo_mysql --build-all --debug

命令 extract - 手动解压某个库

使用命令 bin/spc extract 可以解包和拷贝编译需要的源代码,包括 php-src 以及依赖的各种库的源码(需要自己指定要解包的库名)。

例如,我们在下载好资源后,想分布执行构建流程,手动解包和拷贝包到指定位置,可以使用命令。

bash
# 解压 php-src 和 libxml2 的下载压缩包,解压的源码存放在 source 目录
+bin/spc extract php-src,libxml2

命令 dump-extensions - 导出项目扩展依赖

使用命令 bin/spc dump-extensions 可以导出当前项目的扩展依赖。

bash
# 打印项目的扩展列表,传入项目包含composer.json的根目录
 bin/spc dump-extensions /path/to/your/project/
 
 # 打印项目的扩展列表,不包含开发依赖
@@ -148,7 +149,7 @@
 bin/spc dump-extensions /path-to/your/project/ --no-ext-output=mbstring,posix,pcntl,phar
 
 # 输出时不排除 spc 不支持的扩展
-bin/spc dump-extensions /path/to/your/project/ --no-spc-filter

需要注意的是,项目的目录下必须包含 vendor/installed.jsoncomposer.lock 文件,否则无法正常获取。

调试命令 dev - 调试命令集合

调试命令指的是你在使用 static-php-cli 构建 PHP 或改造、增强 static-php-cli 项目本身的时候,可以辅助输出一些信息的命令集合。

  • dev:extensions: 输出目前所有支持的扩展信息,或者输出指定的扩展信息
  • dev:php-version: 输出当前编译的 PHP 版本(通过读取 php_version.h 实现)
  • dev:sort-config: 对 config/ 目录下的配置文件的列表按照字母表排序
  • dev:lib-ver <lib-name>: 从依赖库的源码中读取版本(仅特定依赖库可用)
  • dev:ext-ver <ext-name>: 从扩展的源码中读取对应版本(仅特定扩展可用)
  • dev:pack-lib <lib-name>: 打包指定的依赖库(仅发布者可用)
  • dev:gen-ext-docs: 生成扩展文档(仅发布者可用)
bash
# 输出所有扩展
+bin/spc dump-extensions /path/to/your/project/ --no-spc-filter

需要注意的是,项目的目录下必须包含 vendor/installed.jsoncomposer.lock 文件,否则无法正常获取。

调试命令 dev - 调试命令集合

调试命令指的是你在使用 static-php-cli 构建 PHP 或改造、增强 static-php-cli 项目本身的时候,可以辅助输出一些信息的命令集合。

  • dev:extensions: 输出目前所有支持的扩展信息,或者输出指定的扩展信息
  • dev:php-version: 输出当前编译的 PHP 版本(通过读取 php_version.h 实现)
  • dev:sort-config: 对 config/ 目录下的配置文件的列表按照字母表排序
  • dev:lib-ver <lib-name>: 从依赖库的源码中读取版本(仅特定依赖库可用)
  • dev:ext-ver <ext-name>: 从扩展的源码中读取对应版本(仅特定扩展可用)
  • dev:pack-lib <lib-name>: 打包指定的依赖库(仅发布者可用)
  • dev:gen-ext-docs: 生成扩展文档(仅发布者可用)
bash
# 输出所有扩展
 bin/spc dev:extensions
 
 # 输出指定扩展的信息
@@ -161,7 +162,7 @@
 bin/spc dev:php-version
 
 # 排序配置文件 ext.json(也可以排序 lib、source)
-bin/spc dev:sort-config ext

命令 install-pkg - 下载二进制包

使用命令 bin/spc install-pkg 可以下载一些预编译或闭源的工具,并将其安装到 pkgroot 目录中。

bin/spc doctor 自动修复 Windows 环境时会下载 nasm、perl 等工具,使用的也是 install-pkg 的安装过程。

下面是安装工具的示例:

  • 下载安装 UPX(仅限 Linux 和 Windows): bin/spc install-pkg upx

命令 del-download - 删除已下载的资源

一些情况下,你需要删除单个或多个指定的下载源文件,并重新下载他们,例如切换 PHP 版本,2.1.0-beta.4 版本后提供了 bin/spc del-download 命令,可以删除指定源文件。

删除已下载的源文件包含预编译的包以及源代码,名称是 source.jsonpkg.json 中的键名。下面是一些例子:

  • 删除 PHP 8.2 源码并切换下载为 8.3 版本: bin/spc del-download php-src && bin/spc download php-src --with-php=8.3
  • 删除 redis 扩展的下载文件: bin/spc del-download redis
  • 删除下载好的 musl-toolchain x86_64: bin/spc del-download musl-toolchain-x86_64-linux

注入外部脚本

注入外部脚本指的是在 static-php-cli 编译过程中插入一个或多个脚本,用于更灵活地支持不同环境下的参数修改、源代码补丁。

一般情况下,该功能主要解决使用 spc 二进制进行编译时无法通过修改 static-php-cli 代码来实现修改补丁的功能。 还有一种情况:你的项目直接依赖了 crazywhalecc/static-php-cli 仓库并同步,但因为项目特性需要做出一些专有的修改,而这些特性并不适合合并到主分支。

鉴于以上情况,在 2.0.1 正式版本中,static-php-cli 加入了多个事件的触发点,你可以通过编写外部的 xx.php 脚本,并通过命令行参数 -P 传入并执行。

在编写注入外部脚本时,你一定会用到的方法是 builder()patch_point()。其中,patch_point() 获取的是当前正在执行的事件名称,builder() 获取的是 BuilderBase 对象。

因为传入的注入点不区分事件,所以你必须将你要执行的代码写在 if(patch_point() === 'your_event_name') 中,否则会重复在其他事件中执行。

下面是支持的 patch_point 事件名称及对应位置:

事件名称事件描述
before-libs-extract在编译的依赖库解压前触发
after-libs-extract在编译的依赖库解压后触发
before-php-extract在 PHP 源码解压前触发
after-php-extract在 PHP 源码解压后触发
before-micro-extract在 phpmicro 解压前触发
after-micro-extract在 phpmicro 解压后触发
before-exts-extract在要编译的扩展解压到 PHP 源码目录前触发
after-exts-extract在要编译的扩展解压到 PHP 源码目录后触发
before-library[name]-build在名称为 name 的库编译前触发(如 before-library[postgresql]-build
after-library[name]-build在名称为 name 的库编译后触发
before-php-buildconf在编译 PHP 命令 ./buildconf 前触发
before-php-configure在编译 PHP 命令 ./configure 前触发
before-php-make在编译 PHP 命令 make 前触发
before-sanity-check在编译 PHP 后,运行扩展检查前触发

下面是一个简单的临时修改 PHP 源码的例子,开启 CLI 下在当前工作目录查找 php.ini 配置的功能:

php
// a.php
+bin/spc dev:sort-config ext

命令 install-pkg - 下载二进制包

使用命令 bin/spc install-pkg 可以下载一些预编译或闭源的工具,并将其安装到 pkgroot 目录中。

bin/spc doctor 自动修复 Windows 环境时会下载 nasm、perl 等工具,使用的也是 install-pkg 的安装过程。

下面是安装工具的示例:

  • 下载安装 UPX(仅限 Linux 和 Windows): bin/spc install-pkg upx

命令 del-download - 删除已下载的资源

一些情况下,你需要删除单个或多个指定的下载源文件,并重新下载他们,例如切换 PHP 版本,2.1.0-beta.4 版本后提供了 bin/spc del-download 命令,可以删除指定源文件。

删除已下载的源文件包含预编译的包以及源代码,名称是 source.jsonpkg.json 中的键名。下面是一些例子:

  • 删除 PHP 8.2 源码并切换下载为 8.3 版本: bin/spc del-download php-src && bin/spc download php-src --with-php=8.3
  • 删除 redis 扩展的下载文件: bin/spc del-download redis
  • 删除下载好的 musl-toolchain x86_64: bin/spc del-download musl-toolchain-x86_64-linux

注入外部脚本

注入外部脚本指的是在 static-php-cli 编译过程中插入一个或多个脚本,用于更灵活地支持不同环境下的参数修改、源代码补丁。

一般情况下,该功能主要解决使用 spc 二进制进行编译时无法通过修改 static-php-cli 代码来实现修改补丁的功能。 还有一种情况:你的项目直接依赖了 crazywhalecc/static-php-cli 仓库并同步,但因为项目特性需要做出一些专有的修改,而这些特性并不适合合并到主分支。

鉴于以上情况,在 2.0.1 正式版本中,static-php-cli 加入了多个事件的触发点,你可以通过编写外部的 xx.php 脚本,并通过命令行参数 -P 传入并执行。

在编写注入外部脚本时,你一定会用到的方法是 builder()patch_point()。其中,patch_point() 获取的是当前正在执行的事件名称,builder() 获取的是 BuilderBase 对象。

因为传入的注入点不区分事件,所以你必须将你要执行的代码写在 if(patch_point() === 'your_event_name') 中,否则会重复在其他事件中执行。

下面是支持的 patch_point 事件名称及对应位置:

事件名称事件描述
before-libs-extract在编译的依赖库解压前触发
after-libs-extract在编译的依赖库解压后触发
before-php-extract在 PHP 源码解压前触发
after-php-extract在 PHP 源码解压后触发
before-micro-extract在 phpmicro 解压前触发
after-micro-extract在 phpmicro 解压后触发
before-exts-extract在要编译的扩展解压到 PHP 源码目录前触发
after-exts-extract在要编译的扩展解压到 PHP 源码目录后触发
before-library[name]-build在名称为 name 的库编译前触发(如 before-library[postgresql]-build
after-library[name]-build在名称为 name 的库编译后触发
before-php-buildconf在编译 PHP 命令 ./buildconf 前触发
before-php-configure在编译 PHP 命令 ./configure 前触发
before-php-make在编译 PHP 命令 make 前触发
before-sanity-check在编译 PHP 后,运行扩展检查前触发

下面是一个简单的临时修改 PHP 源码的例子,开启 CLI 下在当前工作目录查找 php.ini 配置的功能:

php
// a.php
 <?php
 if (patch_point() === 'before-php-buildconf') {
     // replace php source code
@@ -170,19 +171,19 @@
         'sapi_module->php_ini_ignore_cwd = 1;',
         'sapi_module->php_ini_ignore_cwd = 0;'
     );
-}
bash
bin/spc build mbstring --build-cli -P a.php
-echo 'memory_limit=8G' > ./php.ini
$ buildroot/bin/php -i | grep Loaded
+}
bash
bin/spc build mbstring --build-cli -P a.php
+echo 'memory_limit=8G' > ./php.ini
$ buildroot/bin/php -i | grep Loaded
 Loaded Configuration File => /Users/jerry/project/git-project/static-php-cli/php.ini
 
 $ buildroot/bin/php -i | grep memory
-memory_limit => 8G => 8G

对于 static-php-cli 支持的对象、方法及接口,可以阅读源码,大部分的方法和对象都有相应的注释。

一般使用 -P 功能常用的对象及函数有:

  • SPC\store\FileSystem: 文件管理类
    • ::replaceFileStr(string $filename, string $search, $replace): 替换文件字符串内容
    • ::replaceFileStr(string $filename, string $pattern, $replace): 正则替换文件内容
    • ::replaceFileUser(string $filename, $callback): 用户自定义函数替换文件内容
    • ::copyDir(string $from, string $to): 递归拷贝某个目录到另一个位置
    • ::convertPath(string $path): 转换路径的分隔符为当前系统分隔符
    • ::scanDirFiles(string $dir, bool $recursive = true, bool|string $relative = false, bool $include_dir = false): 遍历目录文件
  • SPC\builder\BuilderBase: 构建对象
    • ->getPatchPoint(): 获取当前的注入点名称
    • ->getOption(string $key, $default = null): 获取命令行和编译时的选项
    • ->getPHPVersionID(): 获取当前编译的 PHP 版本 ID
    • ->getPHPVersion(): 获取当前编译的 PHP 版本号
    • ->setOption(string $key, $value): 设定选项
    • ->setOptionIfNotExists(string $key, $value): 如果选项不存在则设定选项

TIP

static-php-cli 开放的方法非常多,文档中无法一一列举,但只要是 public function 并且不被标注为 @internal,均可调用。

多次构建

如果你在本地要多次构建,以下方法可以为你节省下载资源、编译的时间。

  • 仅切换 PHP 版本,不更换依赖库版本时,可以使用 bin/spc switch-php-version 快速切换 PHP 版本,然后重新运行同样的 build 命令。
  • 如果你想重新构建一次,但不重新下载源码,可以先 rm -rf buildroot source 删除编译目录和源码目录,然后重新构建。
  • 如果你想更新某个依赖的版本,可以使用 bin/spc del-download <source-name> 删除指定的源码,然后使用 download <source-name> 重新下载。
  • 如果你想更新所有依赖的版本,可以使用 bin/spc download --clean 删除所有下载的源码,然后重新下载。

embed 使用

如果你想将 static-php 嵌入到其他 C 语言程序中,可以使用 --build-embed 构建一个 embed 版本的 PHP。

bash
bin/spc build {your extensions} --build-embed --debug

在通常的情况下,PHP embed 编译后会生成 php-config。对于 static-php,我们提供了 spc-config,用于获取编译时的参数。 另外,在使用 embed SAPI(libphp.a)时,你需要使用和编译 libphp 相同的编译器,否则会出现链接错误。

下面是 spc-config 的基本用法:

bash
# output all flags and options
+memory_limit => 8G => 8G

对于 static-php-cli 支持的对象、方法及接口,可以阅读源码,大部分的方法和对象都有相应的注释。

一般使用 -P 功能常用的对象及函数有:

  • SPC\store\FileSystem: 文件管理类
    • ::replaceFileStr(string $filename, string $search, $replace): 替换文件字符串内容
    • ::replaceFileStr(string $filename, string $pattern, $replace): 正则替换文件内容
    • ::replaceFileUser(string $filename, $callback): 用户自定义函数替换文件内容
    • ::copyDir(string $from, string $to): 递归拷贝某个目录到另一个位置
    • ::convertPath(string $path): 转换路径的分隔符为当前系统分隔符
    • ::scanDirFiles(string $dir, bool $recursive = true, bool|string $relative = false, bool $include_dir = false): 遍历目录文件
  • SPC\builder\BuilderBase: 构建对象
    • ->getPatchPoint(): 获取当前的注入点名称
    • ->getOption(string $key, $default = null): 获取命令行和编译时的选项
    • ->getPHPVersionID(): 获取当前编译的 PHP 版本 ID
    • ->getPHPVersion(): 获取当前编译的 PHP 版本号
    • ->setOption(string $key, $value): 设定选项
    • ->setOptionIfNotExists(string $key, $value): 如果选项不存在则设定选项

TIP

static-php-cli 开放的方法非常多,文档中无法一一列举,但只要是 public function 并且不被标注为 @internal,均可调用。

多次构建

如果你在本地要多次构建,以下方法可以为你节省下载资源、编译的时间。

  • 仅切换 PHP 版本,不更换依赖库版本时,可以使用 bin/spc switch-php-version 快速切换 PHP 版本,然后重新运行同样的 build 命令。
  • 如果你想重新构建一次,但不重新下载源码,可以先 rm -rf buildroot source 删除编译目录和源码目录,然后重新构建。
  • 如果你想更新某个依赖的版本,可以使用 bin/spc del-download <source-name> 删除指定的源码,然后使用 download <source-name> 重新下载。
  • 如果你想更新所有依赖的版本,可以使用 bin/spc download --clean 删除所有下载的源码,然后重新下载。

embed 使用

如果你想将 static-php 嵌入到其他 C 语言程序中,可以使用 --build-embed 构建一个 embed 版本的 PHP。

bash
bin/spc build {your extensions} --build-embed --debug

在通常的情况下,PHP embed 编译后会生成 php-config。对于 static-php,我们提供了 spc-config,用于获取编译时的参数。 另外,在使用 embed SAPI(libphp.a)时,你需要使用和编译 libphp 相同的编译器,否则会出现链接错误。

下面是 spc-config 的基本用法:

bash
# output all flags and options
 bin/spc spc-config curl,zlib,phar,openssl
 
 # output libs
 bin/spc spc-config curl,zlib,phar,openssl --libs
 
 # output includes
-bin/spc spc-config curl,zlib,phar,openssl --includes

默认情况下,static-php 在不同系统使用的编译器分别是:

  • macOS: clang
  • Linux (Alpine Linux): gcc
  • Linux (glibc based distros, x86_64): /usr/local/musl/bin/x86_64-linux-musl-gcc
  • Linux (glibc based distros, aarch64): /usr/local/musl/bin/aarch64-linux-musl-gcc
  • FreeBSD: clang

下面是一个使用 embed SAPI 的例子:

c
// embed.c
+bin/spc spc-config curl,zlib,phar,openssl --includes

默认情况下,static-php 在不同系统使用的编译器分别是:

  • macOS: clang
  • Linux (Alpine Linux): gcc
  • Linux (glibc based distros, x86_64): /usr/local/musl/bin/x86_64-linux-musl-gcc
  • Linux (glibc based distros, aarch64): /usr/local/musl/bin/aarch64-linux-musl-gcc
  • FreeBSD: clang

下面是一个使用 embed SAPI 的例子:

c
// embed.c
 #include <sapi/embed/php_embed.h>
 
 int main(int argc,char **argv){
@@ -199,16 +200,16 @@
 
     PHP_EMBED_END_BLOCK()
     return 0;
-}
php
<?php 
+}
php
<?php 
 // embed.php
-echo "Hello world!\n";
bash
# compile in debian/ubuntu x86_64
+echo "Hello world!\n";
bash
# compile in debian/ubuntu x86_64
 /usr/local/musl/bin/x86_64-linux-musl-gcc embed.c $(bin/spc spc-config bcmath,zlib) -static -o embed
 # compile in macOS/FreeBSD
 clang embed.c $(bin/spc spc-config bcmath,zlib) -o embed
 
 ./embed
-# out: Hello world!

Released under the MIT License.

- +# out: Hello world!

Released under the MIT License.

+ \ No newline at end of file diff --git a/zh/guide/troubleshooting.html b/zh/guide/troubleshooting.html index 70ea9023..9f1a08ad 100644 --- a/zh/guide/troubleshooting.html +++ b/zh/guide/troubleshooting.html @@ -5,20 +5,21 @@ 故障排除 | static-php-cli - - + + + - + - - - + + + -
Skip to content

故障排除

使用 static-php-cli 过程中可能会碰到各种各样的故障,这里将讲述如何自行查看错误并反馈 Issue。

下载失败问题

下载资源问题是 spc 最常见的问题之一。主要是由于 spc 下载资源使用的地址一般均为对应项目的官方网站或 GitHub 等,而这些网站可能偶尔会宕机、屏蔽 IP 地址。 在遇到下载失败后,可以多次尝试调用下载命令。

当下载资源时,你可能最终会看到类似 curl: (56) The requested URL returned error: 403 的错误,这通常是由于 GitHub 限制导致的。 你可以通过在命令中添加 --debug 来验证,会看到类似 [DEBU] Running command (no output) : curl -sfSL "https://api.github.com/repos/openssl/openssl/releases" 的输出。

要解决这个问题,可以在 GitHub 上 创建 一个个人访问令牌,并将其设置为环境变量 GITHUB_TOKEN=<XXX>

如果确认地址确实无法正常访问,可以提交 Issue 或 PR 更新地址。

doctor 无法修复

在绝大部分情况下,doctor 模块都可以对缺失的系统环境进行自动修复和安装,但也存在特殊的环境无法正常使用自动修复功能。

部分项目由于系统局限(如 Windows 下无法自动安装 Visual Studio 等软件),无法使用自动修复功能。 在遇到无法自动修复功能时,如果遇到 Some check items can not be fixed 字样,则表明无法自动修复,请根据终端显示的方法提交 Issue 或自行修复环境。

编译错误

遇到编译错误时,如果没有开启 --debug 日志,请先开启调试日志,然后确定报错的命令。 报错的终端输出对于修复编译错误非常重要,请在提交 Issue 时一并将终端日志的最后报错片段(或整个终端日志输出)上传,并且包含使用的 spc 命令和参数。

如果你是重复构建,请参考 本地构建 - 多次构建 章节,清理构建缓存后再次构建。

Released under the MIT License.

- +
Skip to content

故障排除

使用 static-php-cli 过程中可能会碰到各种各样的故障,这里将讲述如何自行查看错误并反馈 Issue。

下载失败问题

下载资源问题是 spc 最常见的问题之一。主要是由于 spc 下载资源使用的地址一般均为对应项目的官方网站或 GitHub 等,而这些网站可能偶尔会宕机、屏蔽 IP 地址。 在遇到下载失败后,可以多次尝试调用下载命令。

当下载资源时,你可能最终会看到类似 curl: (56) The requested URL returned error: 403 的错误,这通常是由于 GitHub 限制导致的。 你可以通过在命令中添加 --debug 来验证,会看到类似 [DEBU] Running command (no output) : curl -sfSL "https://api.github.com/repos/openssl/openssl/releases" 的输出。

要解决这个问题,可以在 GitHub 上 创建 一个个人访问令牌,并将其设置为环境变量 GITHUB_TOKEN=<XXX>

如果确认地址确实无法正常访问,可以提交 Issue 或 PR 更新地址。

doctor 无法修复

在绝大部分情况下,doctor 模块都可以对缺失的系统环境进行自动修复和安装,但也存在特殊的环境无法正常使用自动修复功能。

部分项目由于系统局限(如 Windows 下无法自动安装 Visual Studio 等软件),无法使用自动修复功能。 在遇到无法自动修复功能时,如果遇到 Some check items can not be fixed 字样,则表明无法自动修复,请根据终端显示的方法提交 Issue 或自行修复环境。

编译错误

遇到编译错误时,如果没有开启 --debug 日志,请先开启调试日志,然后确定报错的命令。 报错的终端输出对于修复编译错误非常重要,请在提交 Issue 时一并将终端日志的最后报错片段(或整个终端日志输出)上传,并且包含使用的 spc 命令和参数。

如果你是重复构建,请参考 本地构建 - 多次构建 章节,清理构建缓存后再次构建。

Released under the MIT License.

+ \ No newline at end of file diff --git a/zh/index.html b/zh/index.html index 4386370b..0030a993 100644 --- a/zh/index.html +++ b/zh/index.html @@ -5,20 +5,21 @@ static-php-cli - - + + + - + - - - + + + -
Skip to content

static-php-cli

在 Linux、macOS、FreeBSD、Windows 上与 PHP 项目一起构建独立的 PHP 二进制文件,并包含流行的扩展。

Released under the MIT License.

- +
Skip to content

static-php-cli

在 Linux、macOS、FreeBSD、Windows 上与 PHP 项目一起构建独立的 PHP 二进制文件,并包含流行的扩展。

Released under the MIT License.

+ \ No newline at end of file