mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-03 06:45:39 +08:00
Compare commits
1228 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
085abd635e | ||
|
|
3789c7c335 | ||
|
|
4fb4e42896 | ||
|
|
81e7a0c554 | ||
|
|
4cbe4ea82d | ||
|
|
ea4905cd0d | ||
|
|
3c09ba59d7 | ||
|
|
430f436b79 | ||
|
|
93001dce88 | ||
|
|
2d6d25cadf | ||
|
|
b644da8210 | ||
|
|
f1a9a28ed7 | ||
|
|
643926886c | ||
|
|
9a5a59d876 | ||
|
|
e7fe91faef | ||
|
|
e6cf05ddff | ||
|
|
c3e9a2816b | ||
|
|
0bb8e83d68 | ||
|
|
d0053534ab | ||
|
|
38725c2bb4 | ||
|
|
b8fe70e5ee | ||
|
|
3960a21e05 | ||
|
|
e14301d991 | ||
|
|
65f74044d8 | ||
|
|
f6eba32be5 | ||
|
|
af62e55da8 | ||
|
|
22a8191b97 | ||
|
|
17ff5f63bf | ||
|
|
48a7d814f8 | ||
|
|
2c5cf07e9c | ||
|
|
cace504a63 | ||
|
|
efa47af347 | ||
|
|
1c9fbdb032 | ||
|
|
ac2eb3adae | ||
|
|
d6081ee10f | ||
|
|
8b9b72958e | ||
|
|
34edb6e329 | ||
|
|
9487051796 | ||
|
|
7d0577460f | ||
|
|
6b23f4b34a | ||
|
|
451de4a6f6 | ||
|
|
33d587ee9e | ||
|
|
6b381238fe | ||
|
|
07d66ade85 | ||
|
|
e1c9240698 | ||
|
|
d3e8af23bc | ||
|
|
5f9fe2948c | ||
|
|
4c54d99621 | ||
|
|
72beba76c3 | ||
|
|
1047d471ed | ||
|
|
0496af47df | ||
|
|
0ae4bcbd6f | ||
|
|
c58bc038f4 | ||
|
|
ecaa31f38d | ||
|
|
96a7aabda0 | ||
|
|
be857913cd | ||
|
|
601444d0a5 | ||
|
|
3c972ac905 | ||
|
|
6984c29a3a | ||
|
|
cb0ea67a28 | ||
|
|
fcdb029b10 | ||
|
|
5f33a07f4c | ||
|
|
357c04def0 | ||
|
|
0dfa6e63bd | ||
|
|
af10cacdff | ||
|
|
5f5d934d58 | ||
|
|
fda637bb03 | ||
|
|
76d17ebef0 | ||
|
|
df76ecb60f | ||
|
|
83dae09208 | ||
|
|
430364aacd | ||
|
|
81f359dbcf | ||
|
|
9ed3c8b498 | ||
|
|
72abd63b69 | ||
|
|
ed67393d33 | ||
|
|
e8bc892d8b | ||
|
|
fafe7d5778 | ||
|
|
a968b19be0 | ||
|
|
e9dbeb1e34 | ||
|
|
feaff0a08c | ||
|
|
342192fd67 | ||
|
|
4efb3dfc9a | ||
|
|
b9bec5b526 | ||
|
|
1ae0752933 | ||
|
|
0696acb9c5 | ||
|
|
3087dc86f8 | ||
|
|
973c8f082f | ||
|
|
85e89e4326 | ||
|
|
fb106a3d41 | ||
|
|
fb2d676293 | ||
|
|
944cca709f | ||
|
|
5b4cbbb669 | ||
|
|
a8492f06bb | ||
|
|
b6f673cd68 | ||
|
|
42b4272965 | ||
|
|
5beb083c55 | ||
|
|
cf529adc79 | ||
|
|
5a4da8ed5d | ||
|
|
bd3092ae90 | ||
|
|
76094fd305 | ||
|
|
e1edaa24cc | ||
|
|
d0d51ccf82 | ||
|
|
05053b5cd6 | ||
|
|
978552136c | ||
|
|
fb62a0e338 | ||
|
|
630f861c62 | ||
|
|
c2b3b78846 | ||
|
|
6e74dabc1c | ||
|
|
2cb1a95132 | ||
|
|
70a9ffe4a2 | ||
|
|
3cbd52c1f9 | ||
|
|
753c720716 | ||
|
|
d627363132 | ||
|
|
da8c38575e | ||
|
|
a355e4d0e7 | ||
|
|
5482f130ba | ||
|
|
18a5215da9 | ||
|
|
a3efe86cac | ||
|
|
ed3a78b56d | ||
|
|
af63723794 | ||
|
|
a0edca5e5b | ||
|
|
a9fab86269 | ||
|
|
821411cfd6 | ||
|
|
a8be88d771 | ||
|
|
b4392aded7 | ||
|
|
37a453b3cd | ||
|
|
51fcc6b231 | ||
|
|
199b3b5582 | ||
|
|
6c3ff7da32 | ||
|
|
a375ab9780 | ||
|
|
f47c3a2d20 | ||
|
|
029f2db620 | ||
|
|
0acf238c74 | ||
|
|
27a4d5af54 | ||
|
|
ea56e460d0 | ||
|
|
00e78dd84f | ||
|
|
7eb5fb4520 | ||
|
|
8ff52e2e36 | ||
|
|
8c5dc91895 | ||
|
|
155e22a9f9 | ||
|
|
7177afd7f8 | ||
|
|
eca7a43a01 | ||
|
|
dd99f258c1 | ||
|
|
5c9a3e236b | ||
|
|
7b07137b5b | ||
|
|
eb898a8867 | ||
|
|
c86360c9c4 | ||
|
|
1d6b2bd002 | ||
|
|
41bb3e7319 | ||
|
|
f500945298 | ||
|
|
6da3f78df6 | ||
|
|
407f6d4671 | ||
|
|
6c76187f5d | ||
|
|
8c8800f156 | ||
|
|
b3f1103143 | ||
|
|
84e470d213 | ||
|
|
52a623f31e | ||
|
|
abd7d3cfb4 | ||
|
|
f543b55f19 | ||
|
|
f2a3ae409f | ||
|
|
4e4cf4bbc7 | ||
|
|
d532b57810 | ||
|
|
aa337c0c84 | ||
|
|
cc1f899948 | ||
|
|
848c30547c | ||
|
|
c8cc0131da | ||
|
|
b0c0ecb59c | ||
|
|
45f257ef14 | ||
|
|
fa38fa1410 | ||
|
|
ee492dcde1 | ||
|
|
22bec873a8 | ||
|
|
958fd0cdcb | ||
|
|
0d0c789d8b | ||
|
|
3d19299d30 | ||
|
|
4c56c96326 | ||
|
|
42e2f6a89d | ||
|
|
c715f20fe3 | ||
|
|
e02ce4c151 | ||
|
|
9f7a7a5703 | ||
|
|
147fd396cf | ||
|
|
293a95da6d | ||
|
|
952ecb2eec | ||
|
|
31e7cd31c1 | ||
|
|
51ec8199e4 | ||
|
|
f75c58b7d2 | ||
|
|
f8970a21be | ||
|
|
b6be20727d | ||
|
|
9c4a6b46b6 | ||
|
|
779c7cec30 | ||
|
|
154a21fbaf | ||
|
|
a2e0efaed3 | ||
|
|
0d408e0df1 | ||
|
|
b5ceda5955 | ||
|
|
ffa5219d23 | ||
|
|
099425abc8 | ||
|
|
dea3c4afeb | ||
|
|
4cdafe2497 | ||
|
|
a88f9933d2 | ||
|
|
a095d489f3 | ||
|
|
2c81ca2bf8 | ||
|
|
f2ccabf062 | ||
|
|
6dd4406782 | ||
|
|
062cc84d51 | ||
|
|
dfbc9a7fff | ||
|
|
1888b735d1 | ||
|
|
a44dc0a5f6 | ||
|
|
6634ade6b4 | ||
|
|
6962d24b52 | ||
|
|
eb56690684 | ||
|
|
4b7020fbbb | ||
|
|
f9a8231820 | ||
|
|
7e977414a7 | ||
|
|
c96d503dae | ||
|
|
8c603d59c6 | ||
|
|
bdb705e89a | ||
|
|
9172c39a26 | ||
|
|
3ca7c15208 | ||
|
|
cfda1e93a0 | ||
|
|
8f8a493b20 | ||
|
|
5aa9255909 | ||
|
|
107fb08e34 | ||
|
|
95a94da66f | ||
|
|
c8eb62e8f0 | ||
|
|
4010a84d88 | ||
|
|
c0db3a69d7 | ||
|
|
5dbf401615 | ||
|
|
c5811ae947 | ||
|
|
e1595e1091 | ||
|
|
aa366d4213 | ||
|
|
20ab4afb4b | ||
|
|
1300919c44 | ||
|
|
81b96c2b30 | ||
|
|
a98f72cc32 | ||
|
|
9ba9b87405 | ||
|
|
1e42ef042b | ||
|
|
206bc95ee2 | ||
|
|
b746e50233 | ||
|
|
a8dcfce99e | ||
|
|
f69f8d1e4a | ||
|
|
9c9ffb615f | ||
|
|
62a58d410f | ||
|
|
9e7e2e30a4 | ||
|
|
3350888af6 | ||
|
|
22552262b3 | ||
|
|
a0f474db20 | ||
|
|
d5cd42b0e7 | ||
|
|
307d3dda20 | ||
|
|
86e3e51b5a | ||
|
|
4fc081fcc6 | ||
|
|
ff30e0f99a | ||
|
|
6594f6b653 | ||
|
|
0942637d12 | ||
|
|
bb96db4395 | ||
|
|
f31f0d6168 | ||
|
|
1f4a3e4b8f | ||
|
|
b30f2bc193 | ||
|
|
b43d0746f4 | ||
|
|
227210209c | ||
|
|
3dd3cf2814 | ||
|
|
e98e221d93 | ||
|
|
81a59be0c4 | ||
|
|
8eb7723114 | ||
|
|
45d96734dd | ||
|
|
915ffd84c8 | ||
|
|
161a92aff7 | ||
|
|
9b207807eb | ||
|
|
0bdafed92f | ||
|
|
2ebd230a08 | ||
|
|
6d60000952 | ||
|
|
1b6422eed3 | ||
|
|
a643c44ac6 | ||
|
|
02732036de | ||
|
|
c0483b4b34 | ||
|
|
eff6c0666b | ||
|
|
ed97669d9e | ||
|
|
ddb14e2db7 | ||
|
|
c452252a7d | ||
|
|
6fcd301cf5 | ||
|
|
52862a3d63 | ||
|
|
ff092b4e9d | ||
|
|
0d6453751d | ||
|
|
082b9a907b | ||
|
|
5675a1e2ad | ||
|
|
8601c26f2d | ||
|
|
ece7a04437 | ||
|
|
9d2d3d2d0a | ||
|
|
cec445eab5 | ||
|
|
8116e8898e | ||
|
|
be0dbcd9eb | ||
|
|
5c44703f53 | ||
|
|
c364970e05 | ||
|
|
b2385cf80c | ||
|
|
2b1d03d9d4 | ||
|
|
5b6f33a2a1 | ||
|
|
352955d608 | ||
|
|
e07b281577 | ||
|
|
71f4e45256 | ||
|
|
828f51500d | ||
|
|
4a0a7e0df3 | ||
|
|
3c8b588312 | ||
|
|
711d61d120 | ||
|
|
bce363e543 | ||
|
|
d66d7b3a73 | ||
|
|
024542d361 | ||
|
|
7d85aacace | ||
|
|
31b2e6779d | ||
|
|
2b39a6d535 | ||
|
|
e490a1763a | ||
|
|
bf4b35aa0a | ||
|
|
1f7d3ec91d | ||
|
|
23412d6bfa | ||
|
|
bd0042f079 | ||
|
|
0ccf1a1c5d | ||
|
|
76d7002646 | ||
|
|
38cc4cfe7e | ||
|
|
d91b476f33 | ||
|
|
f7080c61d5 | ||
|
|
26842fba27 | ||
|
|
dce1065af5 | ||
|
|
f0af17abe4 | ||
|
|
fbd56da7ad | ||
|
|
0ef8b8c175 | ||
|
|
230879a0db | ||
|
|
2ef64e4597 | ||
|
|
6c18862fd1 | ||
|
|
6c109c52f6 | ||
|
|
f3400b8756 | ||
|
|
b79b1f5750 | ||
|
|
9b72f57463 | ||
|
|
6f9a45b54a | ||
|
|
683461d918 | ||
|
|
ada203c00c | ||
|
|
01887d652c | ||
|
|
fff23649cf | ||
|
|
c7762a5b65 | ||
|
|
d07fadde76 | ||
|
|
ac7a09edd1 | ||
|
|
f30f095f00 | ||
|
|
d91a66ee8d | ||
|
|
7db7ed97ee | ||
|
|
6b9d49eb71 | ||
|
|
7c9e8e3e40 | ||
|
|
5586f627d3 | ||
|
|
04f3f0872d | ||
|
|
e4921087d9 | ||
|
|
005b78413c | ||
|
|
c752f4d4b5 | ||
|
|
991e2dee5a | ||
|
|
33d974bb3d | ||
|
|
0a1677af95 | ||
|
|
7ffbb10587 | ||
|
|
3d45890a2d | ||
|
|
bb5eb64b28 | ||
|
|
e6a050de82 | ||
|
|
7e7eb844a7 | ||
|
|
e56c628bec | ||
|
|
c604f88685 | ||
|
|
83db186972 | ||
|
|
e675af9a18 | ||
|
|
ca8cd7ff3d | ||
|
|
b05002ee9b | ||
|
|
b3c665907b | ||
|
|
64776e3868 | ||
|
|
df4d66ad4b | ||
|
|
f0612591be | ||
|
|
5838c87140 | ||
|
|
1ce3ba0f30 | ||
|
|
dc8f7de75a | ||
|
|
d3f8e94fe9 | ||
|
|
88cf0184cc | ||
|
|
b9e096abfa | ||
|
|
ec959f6239 | ||
|
|
5f2459ae43 | ||
|
|
9af3b745a2 | ||
|
|
a5cd5fcb31 | ||
|
|
ec153fa6ff | ||
|
|
dd72b32559 | ||
|
|
4f4e1ca80d | ||
|
|
dd6c1d9607 | ||
|
|
7b5f4e9dd0 | ||
|
|
9cd17fca1c | ||
|
|
385a46b96f | ||
|
|
04cbba3f4e | ||
|
|
5ab5908ef5 | ||
|
|
9bf65ffe83 | ||
|
|
10c8fe1f26 | ||
|
|
01517f82b8 | ||
|
|
67277ccc21 | ||
|
|
b12cb3350f | ||
|
|
3ff8c504f8 | ||
|
|
939b9eb8a8 | ||
|
|
9935eba336 | ||
|
|
4024f9d6dd | ||
|
|
a097484a51 | ||
|
|
b0cfb4b2c4 | ||
|
|
05f3abe944 | ||
|
|
a191c136dc | ||
|
|
e31e228d10 | ||
|
|
47cbdf555f | ||
|
|
26aca723cb | ||
|
|
93d6a45a78 | ||
|
|
2ac20cf3af | ||
|
|
112f607d6e | ||
|
|
c9d33bffc8 | ||
|
|
59f9143a3c | ||
|
|
d7f3005b69 | ||
|
|
5f8cd972cd | ||
|
|
013a19e25b | ||
|
|
94c38df1ba | ||
|
|
d65d82ff0a | ||
|
|
3070376fb6 | ||
|
|
e019b65ef7 | ||
|
|
ccdb6a031f | ||
|
|
e5c5b77a9a | ||
|
|
3444e308fd | ||
|
|
8b37c64088 | ||
|
|
f6a1065cd7 | ||
|
|
4a2b28e88c | ||
|
|
6355a97b47 | ||
|
|
20c4056561 | ||
|
|
a5a87b975b | ||
|
|
456d12fb58 | ||
|
|
c735960ff8 | ||
|
|
cebd95b2c7 | ||
|
|
aff3373b78 | ||
|
|
420fe497a5 | ||
|
|
f6a292b57b | ||
|
|
39ffb8d99d | ||
|
|
2ac5438f6b | ||
|
|
76b36cef35 | ||
|
|
4b38da76b1 | ||
|
|
cc285ae8d8 | ||
|
|
a5a020eef1 | ||
|
|
6f68d7b7f1 | ||
|
|
abe27598de | ||
|
|
5577cd0fab | ||
|
|
0695fb9381 | ||
|
|
b5aa7fc213 | ||
|
|
b16638d813 | ||
|
|
a0564628c4 | ||
|
|
719bde87b7 | ||
|
|
d8ee308a5f | ||
|
|
a5d26d6517 | ||
|
|
8b3a22cbe4 | ||
|
|
8d47e56010 | ||
|
|
a6d68b9ecf | ||
|
|
d275d6cc69 | ||
|
|
e5ea32e9c0 | ||
|
|
5bc4504e37 | ||
|
|
fd89e83798 | ||
|
|
88f9172866 | ||
|
|
27f57cc23a | ||
|
|
f6c6011061 | ||
|
|
408b3b4060 | ||
|
|
55fd7ba8e6 | ||
|
|
e34eb502db | ||
|
|
292df38c10 | ||
|
|
a483c42893 | ||
|
|
bebcb978f6 | ||
|
|
ba7f994a71 | ||
|
|
9c7e2171f6 | ||
|
|
b7e8587608 | ||
|
|
0a33fba23e | ||
|
|
5370af4a84 | ||
|
|
df0d5fdbe8 | ||
|
|
7b33ee79dd | ||
|
|
ad8322b6a6 | ||
|
|
c43a10027b | ||
|
|
2ebdc4509c | ||
|
|
4cb4c9c6a5 | ||
|
|
9190335a70 | ||
|
|
4e244789a2 | ||
|
|
6de7b8e63b | ||
|
|
68e500eea0 | ||
|
|
840e09a684 | ||
|
|
d00a5223d3 | ||
|
|
3965a899c7 | ||
|
|
956667bf08 | ||
|
|
51e23d21cd | ||
|
|
44c6d6288e | ||
|
|
e5848086c3 | ||
|
|
138e5588e9 | ||
|
|
ab5828a560 | ||
|
|
1839f13149 | ||
|
|
320c21d272 | ||
|
|
e1e48922de | ||
|
|
3940f032af | ||
|
|
956688d9f4 | ||
|
|
7f45f4aeec | ||
|
|
78666ff7de | ||
|
|
dbdf10c75a | ||
|
|
2564da2615 | ||
|
|
bd25de15cc | ||
|
|
fcaa7c5f42 | ||
|
|
e36800b951 | ||
|
|
977fbaa8ef | ||
|
|
6ed62aa05c | ||
|
|
1d29ac228c | ||
|
|
a44d90671c | ||
|
|
d6b0912492 | ||
|
|
d588e6e4fd | ||
|
|
19ddddf618 | ||
|
|
a7bf1e9676 | ||
|
|
02f2837f86 | ||
|
|
0598eff9c5 | ||
|
|
a6364389ba | ||
|
|
9e9474a026 | ||
|
|
c23c5ae614 | ||
|
|
de3cb2f686 | ||
|
|
454b5a77ad | ||
|
|
4a493f3f6d | ||
|
|
61274cb865 | ||
|
|
8145a7536b | ||
|
|
e41d7899c7 | ||
|
|
88d99a7dea | ||
|
|
90823e3b17 | ||
|
|
3357f286ab | ||
|
|
ad080da026 | ||
|
|
25c2def710 | ||
|
|
604131b31d | ||
|
|
924da6ae69 | ||
|
|
12aadf18cc | ||
|
|
aa516522aa | ||
|
|
efb1ff5a93 | ||
|
|
aff9ff20e8 | ||
|
|
4c8a173213 | ||
|
|
b6240f16fb | ||
|
|
f5281535d9 | ||
|
|
96babd0939 | ||
|
|
464c2dca85 | ||
|
|
43dc04b4d0 | ||
|
|
e92f043cfa | ||
|
|
ff95b464ce | ||
|
|
69e1acd5ae | ||
|
|
e162a0ecd6 | ||
|
|
383045d1c0 | ||
|
|
e6bec8eb57 | ||
|
|
d2dea83c63 | ||
|
|
797aaf1ea8 | ||
|
|
5a7fd8c24e | ||
|
|
cc4ec4b598 | ||
|
|
55d78579c8 | ||
|
|
d94542049c | ||
|
|
6dec25b4f4 | ||
|
|
8c7049913b | ||
|
|
7edd8e6e19 | ||
|
|
2b4eb7127d | ||
|
|
9a3ce775a8 | ||
|
|
2ff78e531e | ||
|
|
03a33d87ff | ||
|
|
176e5627e5 | ||
|
|
5801d05047 | ||
|
|
815ba75c76 | ||
|
|
fff16b4019 | ||
|
|
e408a2cf1d | ||
|
|
b535600297 | ||
|
|
762c554468 | ||
|
|
a8c7057aba | ||
|
|
935f3fc37c | ||
|
|
fae2878c41 | ||
|
|
d30ccb810c | ||
|
|
8d75a85d6d | ||
|
|
625bfd1bec | ||
|
|
b04ffadf13 | ||
|
|
b142610800 | ||
|
|
5681722c09 | ||
|
|
9a3a536479 | ||
|
|
55f01149e4 | ||
|
|
6f5fc43490 | ||
|
|
cb62ffdfc2 | ||
|
|
40ac705c46 | ||
|
|
3ac4a71085 | ||
|
|
2963ced1d5 | ||
|
|
175aafee50 | ||
|
|
b75a3d6e81 | ||
|
|
5334727528 | ||
|
|
253206de22 | ||
|
|
5a60f4c02b | ||
|
|
63fcdd9db4 | ||
|
|
832c0230e2 | ||
|
|
e1028b0348 | ||
|
|
2433752273 | ||
|
|
1b0b551fc6 | ||
|
|
74849a8d48 | ||
|
|
ee0de6933f | ||
|
|
bd863dba34 | ||
|
|
f9af24e246 | ||
|
|
864c55feaf | ||
|
|
7628847a46 | ||
|
|
955b586908 | ||
|
|
32a1fd45df | ||
|
|
15fbde29d4 | ||
|
|
2cce02bfa9 | ||
|
|
7e35de8a0e | ||
|
|
9a98fd9cff | ||
|
|
f6d25153c6 | ||
|
|
1409d1b47b | ||
|
|
853294e168 | ||
|
|
1a4296386a | ||
|
|
c464f78340 | ||
|
|
8992c96014 | ||
|
|
62a13f2da6 | ||
|
|
f9005757bd | ||
|
|
cd6aca832d | ||
|
|
1b4eb039ae | ||
|
|
6c47065686 | ||
|
|
9bfcea6feb | ||
|
|
58d979712e | ||
|
|
a0f99858e3 | ||
|
|
2abbb75f98 | ||
|
|
3f92df0865 | ||
|
|
be0b98c467 | ||
|
|
7d45415990 | ||
|
|
f3f581fe2d | ||
|
|
f6837079d3 | ||
|
|
5cd987ba3a | ||
|
|
8293160a01 | ||
|
|
625ee2703d | ||
|
|
c3b520c3d4 | ||
|
|
80687dfea3 | ||
|
|
7f9da6478f | ||
|
|
056971fcbc | ||
|
|
ba26359dde | ||
|
|
a2f0640b1b | ||
|
|
16a4245ad7 | ||
|
|
608a5559ac | ||
|
|
dfac385d21 | ||
|
|
40d602c82e | ||
|
|
fbd6360bda | ||
|
|
a0047e3ad7 | ||
|
|
437d6810b7 | ||
|
|
82ec7733ba | ||
|
|
1357990c4c | ||
|
|
61a9264802 | ||
|
|
4a70f260f3 | ||
|
|
bcea2007bd | ||
|
|
fcf2c967ab | ||
|
|
2f8e225abd | ||
|
|
5f3f999222 | ||
|
|
2bc9fef758 | ||
|
|
aec03b2f24 | ||
|
|
ba6ed137c6 | ||
|
|
32dc5d3cdb | ||
|
|
597db25178 | ||
|
|
c2d6b9ad2c | ||
|
|
4977286936 | ||
|
|
cc09184183 | ||
|
|
a9713c3bfa | ||
|
|
3af40a66dd | ||
|
|
6e70f16e1b | ||
|
|
16fccf8184 | ||
|
|
804468f7b9 | ||
|
|
7dc3b7c8ac | ||
|
|
b42409efd1 | ||
|
|
cb010d81ac | ||
|
|
15979d4636 | ||
|
|
1a164fa057 | ||
|
|
a76f49f927 | ||
|
|
becee5b426 | ||
|
|
4ecaffd908 | ||
|
|
74b1dda884 | ||
|
|
d6858e18df | ||
|
|
92284e92c9 | ||
|
|
f709f3bb18 | ||
|
|
8e2dffc3b5 | ||
|
|
ae569316ff | ||
|
|
eee2ff6d61 | ||
|
|
65b828c424 | ||
|
|
f10ba86218 | ||
|
|
24e19deb58 | ||
|
|
f7a3f80689 | ||
|
|
b4168d09b5 | ||
|
|
ba0ea5b40a | ||
|
|
04cefda66c | ||
|
|
8c6a708764 | ||
|
|
a1e76d9d02 | ||
|
|
82ee6f0dee | ||
|
|
d58534b07d | ||
|
|
f37c863092 | ||
|
|
e71f76288b | ||
|
|
d094824d76 | ||
|
|
d635b10e24 | ||
|
|
dca43d6d8d | ||
|
|
abf3bfb98e | ||
|
|
c46f8513dd | ||
|
|
92338d478e | ||
|
|
c1e68323c7 | ||
|
|
f64eb0dea5 | ||
|
|
c1870af1b1 | ||
|
|
71783088c0 | ||
|
|
7057a135cf | ||
|
|
5cb107b844 | ||
|
|
57b22782d3 | ||
|
|
cb0a90d1d9 | ||
|
|
1c439a01a1 | ||
|
|
2bfc8e92ef | ||
|
|
68548cf248 | ||
|
|
3a64feefd0 | ||
|
|
da75d2d707 | ||
|
|
3a85d96fa4 | ||
|
|
883cc4b6fd | ||
|
|
aa61a9e77b | ||
|
|
9de5c62136 | ||
|
|
7b3ea7e12e | ||
|
|
bafa67c8de | ||
|
|
0d3a80e582 | ||
|
|
5a401a5f92 | ||
|
|
0e88cdb258 | ||
|
|
e5cd3adf97 | ||
|
|
6253b7a912 | ||
|
|
fe455bf901 | ||
|
|
3a0d21eb44 | ||
|
|
45ec0cef24 | ||
|
|
1468bb99f0 | ||
|
|
3efabee153 | ||
|
|
962de5b25f | ||
|
|
b265d6dd56 | ||
|
|
302cf8345d | ||
|
|
d249391816 | ||
|
|
0a24a6af1f | ||
|
|
52f40b7f9f | ||
|
|
8fbe6ee8ff | ||
|
|
5a3a8db772 | ||
|
|
56cd6711ce | ||
|
|
29339b962c | ||
|
|
d9cd4d7e36 | ||
|
|
56080f40ef | ||
|
|
bb0a3589c1 | ||
|
|
db109e3586 | ||
|
|
289f4b300a | ||
|
|
0ee9a0cfa4 | ||
|
|
d9f7aa760e | ||
|
|
01ab0d3530 | ||
|
|
8bd7794a2e | ||
|
|
fcfbb59637 | ||
|
|
089b94d753 | ||
|
|
bfba598ef4 | ||
|
|
e2efaab2b2 | ||
|
|
28e5e584b4 | ||
|
|
e0734fe848 | ||
|
|
2ea8a7e662 | ||
|
|
c0ea47ce75 | ||
|
|
84fb354bc0 | ||
|
|
9f35c954ac | ||
|
|
78b3778442 | ||
|
|
0e092284eb | ||
|
|
4be1e75128 | ||
|
|
62a581393d | ||
|
|
cec5274ea3 | ||
|
|
80f2912026 | ||
|
|
70b91867cb | ||
|
|
a1ccddb53c | ||
|
|
5a7db86471 | ||
|
|
518ed3a7fd | ||
|
|
d322be1666 | ||
|
|
a503aaa8a0 | ||
|
|
a7771e95f2 | ||
|
|
311de9381c | ||
|
|
c3aa7356ec | ||
|
|
63656cf383 | ||
|
|
6d3e2d9316 | ||
|
|
dcdd167db3 | ||
|
|
9ed62b02b6 | ||
|
|
6b330fa869 | ||
|
|
5cc753dec4 | ||
|
|
f7a0f50f87 | ||
|
|
8466970a1f | ||
|
|
48cb87ada2 | ||
|
|
145fe7ce13 | ||
|
|
b320eb853a | ||
|
|
474fe63ad3 | ||
|
|
da45aa7f15 | ||
|
|
11f21304f9 | ||
|
|
6cb2cdd5a2 | ||
|
|
9e8119e69c | ||
|
|
25c2bafa88 | ||
|
|
ae56bed032 | ||
|
|
4c8f9e154d | ||
|
|
0ed6f2924e | ||
|
|
8896d477aa | ||
|
|
1b08a250f6 | ||
|
|
8b09e1a446 | ||
|
|
720251458f | ||
|
|
a48680c26f | ||
|
|
684b5d4534 | ||
|
|
aedcc86fc5 | ||
|
|
978975d396 | ||
|
|
c9e9119bff | ||
|
|
20f222d19e | ||
|
|
187d51e501 | ||
|
|
fa744bb802 | ||
|
|
bed5b9d4ef | ||
|
|
13540c8008 | ||
|
|
48df491c31 | ||
|
|
3fbf8fcfb8 | ||
|
|
104038bc7e | ||
|
|
bb37c0058e | ||
|
|
f4e1d7d4c1 | ||
|
|
e6c9a82cd3 | ||
|
|
0ca71b62db | ||
|
|
936c4d8696 | ||
|
|
1c1f7b19dd | ||
|
|
0558d67240 | ||
|
|
3bb9a7b1f8 | ||
|
|
123cc92756 | ||
|
|
9babe7f1d2 | ||
|
|
f46b714990 | ||
|
|
3497b2a760 | ||
|
|
acd10bd978 | ||
|
|
802950d941 | ||
|
|
f158fba48d | ||
|
|
059d134990 | ||
|
|
f7871c0036 | ||
|
|
42943b315c | ||
|
|
37b9ccfaa8 | ||
|
|
1cf2a3dd3f | ||
|
|
1718806042 | ||
|
|
7d26aa533a | ||
|
|
521af84797 | ||
|
|
53eb6dcc80 | ||
|
|
6ed440d861 | ||
|
|
a99c4a3fee | ||
|
|
0ebd44bc4f | ||
|
|
2f53915064 | ||
|
|
08d3849c43 | ||
|
|
bb1f086674 | ||
|
|
f4771b4f21 | ||
|
|
2093b4ec85 | ||
|
|
e5f483de1d | ||
|
|
23be5484e3 | ||
|
|
0b8543e6dd | ||
|
|
a3025479e7 | ||
|
|
a6ea49981d | ||
|
|
2a39fb0bd5 | ||
|
|
2dde53760a | ||
|
|
a7e48a8d3b | ||
|
|
4fae158a3c | ||
|
|
7d87856f4a | ||
|
|
cfa525351a | ||
|
|
f9de43c7d4 | ||
|
|
e00227f0c6 | ||
|
|
e31942bf1e | ||
|
|
111de20a57 | ||
|
|
635fbae3c9 | ||
|
|
f29ee95176 | ||
|
|
0d91ad7d94 | ||
|
|
715650c4db | ||
|
|
a68212672b | ||
|
|
fce115d39c | ||
|
|
301f2d8a97 | ||
|
|
500c19d900 | ||
|
|
617b0de31f | ||
|
|
92ad792eff | ||
|
|
560f684f7f | ||
|
|
a0c0555089 | ||
|
|
9fa1fb7b44 | ||
|
|
f5fa49338d | ||
|
|
df7cfa0d6a | ||
|
|
a0579efbc2 | ||
|
|
b6a1182876 | ||
|
|
4582e1f508 | ||
|
|
621e396373 | ||
|
|
300723419b | ||
|
|
f75ab9f428 | ||
|
|
dbc7ff5de7 | ||
|
|
856db3df08 | ||
|
|
1479bef00d | ||
|
|
3761a9c8ba | ||
|
|
7c4c8c6275 | ||
|
|
3b9670c202 | ||
|
|
861010af0e | ||
|
|
57b527c886 | ||
|
|
31652e8b04 | ||
|
|
8b94a7174f | ||
|
|
01a79fcc6e | ||
|
|
17b4c18830 | ||
|
|
86541b1aa8 | ||
|
|
e022a45048 | ||
|
|
94e31f1953 | ||
|
|
ad8581db97 | ||
|
|
e2191113b0 | ||
|
|
161a553948 | ||
|
|
80f63e66c3 | ||
|
|
2f25409475 | ||
|
|
67320d3eb3 | ||
|
|
92aeb2d816 | ||
|
|
3420f6ca42 | ||
|
|
8e5efb923f | ||
|
|
ab4e0bc406 | ||
|
|
8993b3f4f0 | ||
|
|
499c281931 | ||
|
|
bb7e0f6f89 | ||
|
|
8919a2fcca | ||
|
|
ba0796c9ea | ||
|
|
1b7404f194 | ||
|
|
5add534848 | ||
|
|
ef7ebdfd1f | ||
|
|
42f356d322 | ||
|
|
dabf52511f | ||
|
|
df85f97646 | ||
|
|
a9d37bb2a2 | ||
|
|
6b689f1584 | ||
|
|
4b0fa94b3c | ||
|
|
c53b06c3d2 | ||
|
|
ed87a7cd67 | ||
|
|
108bf34cca | ||
|
|
8b98792ccf | ||
|
|
7c009b6dce | ||
|
|
5ae5a3d75d | ||
|
|
396ddd3e6f | ||
|
|
da7a125faf | ||
|
|
febf9b1815 | ||
|
|
55b4ba5832 | ||
|
|
3bc5ac28be | ||
|
|
93eb6378ba | ||
|
|
61837f0d68 | ||
|
|
c44b8b1029 | ||
|
|
8312ce4d4c | ||
|
|
3052b1cca5 | ||
|
|
ad3860981a | ||
|
|
2dbcbc6963 | ||
|
|
8767181a80 | ||
|
|
4c64707138 | ||
|
|
764fdd4d08 | ||
|
|
4c124770ed | ||
|
|
78b2a89b0a | ||
|
|
6147721314 | ||
|
|
2a5915f4b6 | ||
|
|
5382362168 | ||
|
|
3867b9933d | ||
|
|
4299abf68b | ||
|
|
b68701f51b | ||
|
|
c551efb75c | ||
|
|
92acb95a58 | ||
|
|
e2ea10d2eb | ||
|
|
d833d8946c | ||
|
|
3662e079ac | ||
|
|
c972a94876 | ||
|
|
234df8d11f | ||
|
|
14ca782672 | ||
|
|
9665473669 | ||
|
|
a8987d48ed | ||
|
|
f83715c370 | ||
|
|
a9d5dcf4a2 | ||
|
|
e568041143 | ||
|
|
4ce7374ac9 | ||
|
|
ed35b65390 | ||
|
|
15dc672bcf | ||
|
|
51891478e4 | ||
|
|
c2d5afc4e9 | ||
|
|
835fc1e360 | ||
|
|
2a70b998e3 | ||
|
|
5eecd14ce0 | ||
|
|
0afe0e5f46 | ||
|
|
396d4b341f | ||
|
|
bc002d500e | ||
|
|
6a86b28977 | ||
|
|
b91c83b6cd | ||
|
|
4b8412dfdb | ||
|
|
3713ae8c93 | ||
|
|
310be957b6 | ||
|
|
c29ca9722f | ||
|
|
64b6f98ce7 | ||
|
|
4a44282556 | ||
|
|
e3d7969b96 | ||
|
|
b68d71b7b7 | ||
|
|
b376d1682f | ||
|
|
af51469b62 | ||
|
|
fc7df585bd | ||
|
|
3ff31d20cf | ||
|
|
11c116480f | ||
|
|
fd5bc54cd0 | ||
|
|
95380168ef | ||
|
|
d349627fa1 | ||
|
|
3f8d297fb1 | ||
|
|
aae6c2c98b | ||
|
|
7698ceb108 | ||
|
|
495e868a71 | ||
|
|
95a2f4600b | ||
|
|
c43423a7d0 | ||
|
|
fa285ecc82 | ||
|
|
f47daac3cc | ||
|
|
03ca3f4f59 | ||
|
|
a9f81dd38e | ||
|
|
93c6928624 | ||
|
|
1e50dac5a6 | ||
|
|
545a653c0d | ||
|
|
20b6870f90 | ||
|
|
ca6f19f77d | ||
|
|
14a0e1a6cc | ||
|
|
38dfcdabd0 | ||
|
|
683371adaa | ||
|
|
7ba1948101 | ||
|
|
5bd53ed714 | ||
|
|
bff99fa537 | ||
|
|
54ff71798c | ||
|
|
81474336c1 | ||
|
|
6b50700d8c | ||
|
|
f708907d99 | ||
|
|
117923791a | ||
|
|
ea7c145c62 | ||
|
|
bdd764218b | ||
|
|
1fbd2c1adc | ||
|
|
2ff300970a | ||
|
|
f88c10d4aa | ||
|
|
eab8c27e4a | ||
|
|
c1e91e1ccb | ||
|
|
05e9129a66 | ||
|
|
76a9be2167 | ||
|
|
872673655e | ||
|
|
1ae27c7b5a | ||
|
|
b402b735d6 | ||
|
|
22001792cd | ||
|
|
9557c9ef21 | ||
|
|
6fe8b591ce | ||
|
|
23ae3f60f3 | ||
|
|
03b634b961 | ||
|
|
2897fdda04 | ||
|
|
f5fffafd43 | ||
|
|
e884f97621 | ||
|
|
e4028da886 | ||
|
|
a65bc95091 | ||
|
|
14563417a7 | ||
|
|
a3ee3e5a24 | ||
|
|
16a36b8315 | ||
|
|
861c49c9bc | ||
|
|
b3dacf9c5a | ||
|
|
2c13eb257b | ||
|
|
348decf72f | ||
|
|
92483cf188 | ||
|
|
8143b1d768 | ||
|
|
e7d6f37e98 | ||
|
|
d275a44895 | ||
|
|
f755d66342 | ||
|
|
22a438ed5e | ||
|
|
a014294d58 | ||
|
|
39953b5223 | ||
|
|
bd341db54a | ||
|
|
455ed7d503 | ||
|
|
637ae89583 | ||
|
|
7fd858b472 | ||
|
|
74d8377400 | ||
|
|
a29992b907 | ||
|
|
57097d1275 | ||
|
|
b21c62c11d | ||
|
|
0b3421e3cd | ||
|
|
a7adec1341 | ||
|
|
a236ee3ac3 | ||
|
|
d7b9e5a7d4 | ||
|
|
3d1738b14b | ||
|
|
f0e634a4fa | ||
|
|
0f5f60e477 | ||
|
|
9fe09f57f6 | ||
|
|
cf24b88bc8 | ||
|
|
d34fa0ba4e | ||
|
|
f40170ee6f | ||
|
|
2da750d5f9 | ||
|
|
720e700701 | ||
|
|
b452f7f32a | ||
|
|
7bfb8d6f53 | ||
|
|
b06db1f920 | ||
|
|
61eafa48ff | ||
|
|
8b07b15f6c | ||
|
|
5e67133495 | ||
|
|
30b740b7f0 | ||
|
|
7501ae4b4d | ||
|
|
4391c30299 | ||
|
|
536641eadd | ||
|
|
21594cd4c0 | ||
|
|
d4b263bc9f | ||
|
|
4e4eaed123 | ||
|
|
610843398e | ||
|
|
615e680b9b | ||
|
|
4e67c63808 | ||
|
|
f556f375ee | ||
|
|
f21f833aed | ||
|
|
0c6dd7a577 | ||
|
|
fc4872c5d6 | ||
|
|
3fe50e9ca3 | ||
|
|
a5e4d6a5ec | ||
|
|
0524129b64 | ||
|
|
7ce13751a0 | ||
|
|
e149ee0d70 | ||
|
|
2f3c71e55a | ||
|
|
5c04638cb4 | ||
|
|
6dd6d807b6 | ||
|
|
237d39f09c | ||
|
|
7a2f77193f | ||
|
|
d21980170e | ||
|
|
7dec34bdfe | ||
|
|
62d619b6cd | ||
|
|
67afffeb96 | ||
|
|
c58ea0c3bd | ||
|
|
acb8cea437 | ||
|
|
11f0957963 | ||
|
|
2d7c052fd9 | ||
|
|
23bd216cc7 | ||
|
|
50cfc5899b | ||
|
|
01d3cb4b11 | ||
|
|
a940200164 | ||
|
|
4e5c0f0a48 | ||
|
|
8e5657eff0 | ||
|
|
631a1b5864 | ||
|
|
67d2ad5511 | ||
|
|
ab4d7fae7d | ||
|
|
0e4a3f5e2b | ||
|
|
87c0535624 | ||
|
|
5648681ecc | ||
|
|
2c0bb1f7ba | ||
|
|
16d82212dd | ||
|
|
6ea1d06460 | ||
|
|
936413a6d9 | ||
|
|
88ce2eafab | ||
|
|
3915c8410b | ||
|
|
4115e42dc6 | ||
|
|
48f257f85a | ||
|
|
acdec64144 | ||
|
|
0beb97648a | ||
|
|
5564559192 | ||
|
|
8cb93bc1fe | ||
|
|
ae23b721b3 | ||
|
|
df06a4bb2c | ||
|
|
f37110605e | ||
|
|
8459754692 | ||
|
|
fc08e5cf23 | ||
|
|
6dec44bdc3 | ||
|
|
8cd69b2b70 | ||
|
|
625a03e799 | ||
|
|
aa4d4db11f | ||
|
|
76c353e790 | ||
|
|
8909b62dc4 | ||
|
|
371a588396 | ||
|
|
ee54b6d347 | ||
|
|
3ba215c35c | ||
|
|
161a3924d2 | ||
|
|
7b6fae6d92 | ||
|
|
71b52e58b2 | ||
|
|
d0a66ab16b | ||
|
|
9d75265e25 | ||
|
|
744e066d5f | ||
|
|
1791b443bc | ||
|
|
e850df505c | ||
|
|
918223e7da | ||
|
|
1552d992df | ||
|
|
f0a895691b | ||
|
|
1f7c805da4 | ||
|
|
1ad33556e9 | ||
|
|
6b5e83b98e | ||
|
|
6fb9c2df3b | ||
|
|
1b29803ed2 | ||
|
|
3477857584 | ||
|
|
0ce2c894e9 | ||
|
|
92470a35da | ||
|
|
6447fec028 | ||
|
|
0bc143cac3 | ||
|
|
8a4ba7a876 | ||
|
|
146a4d334b | ||
|
|
d86b7c4cec | ||
|
|
b1931059a5 | ||
|
|
a2476690c2 | ||
|
|
99be7b078b | ||
|
|
8925e97e62 | ||
|
|
4558204962 | ||
|
|
b4f3657323 | ||
|
|
91a3a01c39 | ||
|
|
4cc985a39b | ||
|
|
39a66daf04 | ||
|
|
2681a88488 | ||
|
|
e1162606f5 | ||
|
|
c6d4934dd6 | ||
|
|
21265cd561 | ||
|
|
a6b843f4dd | ||
|
|
d643051759 | ||
|
|
58eafe5100 | ||
|
|
74edcb7d6f | ||
|
|
e7bac8f78d | ||
|
|
5caf5b7694 | ||
|
|
76ac57edf4 | ||
|
|
d15b387bea | ||
|
|
b534cdce11 | ||
|
|
f246125677 | ||
|
|
2c644d5c18 | ||
|
|
ec3c0dc934 | ||
|
|
09c0e43501 | ||
|
|
878e17ddb4 | ||
|
|
c52ab62fa6 | ||
|
|
40ea306008 | ||
|
|
be3d68cebe | ||
|
|
4e32ff47df | ||
|
|
c6552f6800 | ||
|
|
511fd0e301 | ||
|
|
77bbc7fcaa | ||
|
|
53f82d286c | ||
|
|
bed40c3d05 | ||
|
|
29a0f2facb | ||
|
|
4bc4c2ff05 | ||
|
|
460699c48c | ||
|
|
89e8c152dc | ||
|
|
5caaa4d1d4 | ||
|
|
939fd88789 | ||
|
|
067b02f6d7 | ||
|
|
2afd39fbf1 | ||
|
|
1ce1c326b2 | ||
|
|
b6324fd71e | ||
|
|
7e462d6625 | ||
|
|
2a9cd436b6 | ||
|
|
4eeb48cdc2 | ||
|
|
23bfad6f87 | ||
|
|
36dc18012a | ||
|
|
d30d1fc447 | ||
|
|
15c7e41501 | ||
|
|
b6243d8478 | ||
|
|
cf30418be9 | ||
|
|
a95d034e98 | ||
|
|
29ea46bd17 | ||
|
|
8a17e2384e | ||
|
|
60dbb18504 | ||
|
|
5f53b34fae | ||
|
|
6b227d88ac | ||
|
|
34934368a2 | ||
|
|
d047176fc9 | ||
|
|
7b1e2fb89e | ||
|
|
cb73222e21 | ||
|
|
9c878ce613 | ||
|
|
4beea4ad39 | ||
|
|
0aab10ba31 | ||
|
|
daa6196afc | ||
|
|
75ee69b07d |
15
.editorconfig
Normal file
15
.editorconfig
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
root = true
|
||||||
|
|
||||||
|
[*]
|
||||||
|
charset = utf-8
|
||||||
|
end_of_line = lf
|
||||||
|
insert_final_newline = true
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 4
|
||||||
|
trim_trailing_whitespace = true
|
||||||
|
|
||||||
|
[*.md]
|
||||||
|
trim_trailing_whitespace = false
|
||||||
|
|
||||||
|
[*.{yml,yaml, vue}]
|
||||||
|
indent_size = 2
|
||||||
8
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
8
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
---
|
||||||
|
name: Bug report
|
||||||
|
about: Build PHP or library failed, download failed, doesn't seem to work...
|
||||||
|
title: ''
|
||||||
|
labels: bug
|
||||||
|
assignees: crazywhalecc
|
||||||
|
|
||||||
|
---
|
||||||
8
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
8
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
---
|
||||||
|
name: Feature request
|
||||||
|
about: Suggest an idea for this project
|
||||||
|
title: ''
|
||||||
|
labels: new feature
|
||||||
|
assignees: ''
|
||||||
|
|
||||||
|
---
|
||||||
10
.github/ISSUE_TEMPLATE/something-want-to-know.md
vendored
Normal file
10
.github/ISSUE_TEMPLATE/something-want-to-know.md
vendored
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
---
|
||||||
|
name: Something want to know
|
||||||
|
about: Describe your question about static-php, we will reply ASAP
|
||||||
|
title: ''
|
||||||
|
labels: question
|
||||||
|
assignees: ''
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
|
||||||
11
.github/pull_request_template.md
vendored
11
.github/pull_request_template.md
vendored
@@ -7,6 +7,11 @@
|
|||||||
> If your PR involves the changes mentioned below and completed the action, please tick the corresponding option.
|
> If your PR involves the changes mentioned below and completed the action, please tick the corresponding option.
|
||||||
> If a modification is not involved, please skip it directly.
|
> If a modification is not involved, please skip it directly.
|
||||||
|
|
||||||
- [ ] If it's an extension or dependency update, make sure adding related extensions in `src/global/test-extensions.php`.
|
- If you modified `*.php` or `*.json`, run them locally to ensure your changes are valid:
|
||||||
- [ ] If you changed the behavior of static-php-cli, update docs in `./docs/`.
|
- [ ] `composer cs-fix`
|
||||||
- [ ] If you updated `config/xxx.json` content, run `bin/spc dev:sort-config xxx`.
|
- [ ] `composer analyse`
|
||||||
|
- [ ] `composer test`
|
||||||
|
- [ ] `bin/spc dev:sort-config`
|
||||||
|
- If it's an extension or dependency update, please ensure the following:
|
||||||
|
- [ ] Add your test combination to `src/globals/test-extensions.php`.
|
||||||
|
- [ ] If adding new or fixing bugs, add commit message containing `extension test` or `test extensions` to trigger full test suite.
|
||||||
|
|||||||
75
.github/workflows/build-unix.yml
vendored
75
.github/workflows/build-unix.yml
vendored
@@ -6,23 +6,65 @@ on:
|
|||||||
os:
|
os:
|
||||||
required: true
|
required: true
|
||||||
description: Build target OS
|
description: Build target OS
|
||||||
|
default: 'linux-x86_64'
|
||||||
type: choice
|
type: choice
|
||||||
options:
|
options:
|
||||||
- 'linux-x86_64'
|
- 'linux-x86_64'
|
||||||
- 'linux-aarch64'
|
- 'linux-aarch64'
|
||||||
|
- 'linux-x86_64-glibc'
|
||||||
|
- 'linux-aarch64-glibc'
|
||||||
- 'macos-x86_64'
|
- 'macos-x86_64'
|
||||||
- 'macos-aarch64'
|
- 'macos-aarch64'
|
||||||
php-version:
|
php-version:
|
||||||
required: true
|
required: true
|
||||||
description: PHP version to compile
|
description: PHP version to compile
|
||||||
default: '8.3'
|
default: '8.4'
|
||||||
type: choice
|
type: choice
|
||||||
options:
|
options:
|
||||||
- '8.4'
|
- '8.4'
|
||||||
- '8.3'
|
- '8.3'
|
||||||
- '8.2'
|
- '8.2'
|
||||||
- '8.1'
|
- '8.1'
|
||||||
- '8.0'
|
extensions:
|
||||||
|
description: Extensions to build (comma separated)
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
extra-libs:
|
||||||
|
description: Extra libraries to build (optional, comma separated)
|
||||||
|
type: string
|
||||||
|
build-cli:
|
||||||
|
description: Build cli binary
|
||||||
|
default: true
|
||||||
|
type: boolean
|
||||||
|
build-micro:
|
||||||
|
description: Build phpmicro binary
|
||||||
|
type: boolean
|
||||||
|
build-fpm:
|
||||||
|
description: Build fpm binary
|
||||||
|
type: boolean
|
||||||
|
prefer-pre-built:
|
||||||
|
description: Prefer pre-built binaries (reduce build time)
|
||||||
|
type: boolean
|
||||||
|
default: true
|
||||||
|
debug:
|
||||||
|
description: Show full build logs
|
||||||
|
type: boolean
|
||||||
|
no-strip:
|
||||||
|
description: Keep debug symbols for debugging
|
||||||
|
type: boolean
|
||||||
|
default: false
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
os:
|
||||||
|
required: true
|
||||||
|
description: Build target OS
|
||||||
|
default: 'linux-x86_64'
|
||||||
|
type: string
|
||||||
|
php-version:
|
||||||
|
required: true
|
||||||
|
description: PHP version to compile
|
||||||
|
default: '8.4'
|
||||||
|
type: string
|
||||||
extensions:
|
extensions:
|
||||||
description: Extensions to build (comma separated)
|
description: Extensions to build (comma separated)
|
||||||
required: true
|
required: true
|
||||||
@@ -77,9 +119,19 @@ jobs:
|
|||||||
RUNS_ON="ubuntu-latest"
|
RUNS_ON="ubuntu-latest"
|
||||||
;;
|
;;
|
||||||
linux-aarch64)
|
linux-aarch64)
|
||||||
DOWN_CMD="SPC_USE_ARCH=aarch64 ./bin/spc-alpine-docker download"
|
DOWN_CMD="./bin/spc-alpine-docker download"
|
||||||
BUILD_CMD="SPC_USE_ARCH=aarch64 ./bin/spc-alpine-docker build"
|
BUILD_CMD="./bin/spc-alpine-docker build"
|
||||||
RUNS_ON="ubuntu-latest"
|
RUNS_ON="ubuntu-24.04-arm"
|
||||||
|
;;
|
||||||
|
linux-x86_64-glibc)
|
||||||
|
DOWN_CMD="./bin/spc-gnu-docker download"
|
||||||
|
BUILD_CMD="./bin/spc-gnu-docker build"
|
||||||
|
RUNS_ON="ubuntu-22.04"
|
||||||
|
;;
|
||||||
|
linux-aarch64-glibc)
|
||||||
|
DOWN_CMD="./bin/spc-gnu-docker download"
|
||||||
|
BUILD_CMD="./bin/spc-gnu-docker build"
|
||||||
|
RUNS_ON="ubuntu-22.04-arm"
|
||||||
;;
|
;;
|
||||||
macos-x86_64)
|
macos-x86_64)
|
||||||
DOWN_CMD="composer update --no-dev --classmap-authoritative && ./bin/spc doctor --auto-fix && ./bin/spc download"
|
DOWN_CMD="composer update --no-dev --classmap-authoritative && ./bin/spc doctor --auto-fix && ./bin/spc download"
|
||||||
@@ -129,7 +181,7 @@ jobs:
|
|||||||
- name: "Setup PHP"
|
- name: "Setup PHP"
|
||||||
uses: shivammathur/setup-php@v2
|
uses: shivammathur/setup-php@v2
|
||||||
with:
|
with:
|
||||||
php-version: ${{ inputs.php-version }}
|
php-version: 8.4
|
||||||
tools: pecl, composer
|
tools: pecl, composer
|
||||||
extensions: curl, openssl, mbstring
|
extensions: curl, openssl, mbstring
|
||||||
ini-values: memory_limit=-1
|
ini-values: memory_limit=-1
|
||||||
@@ -142,14 +194,13 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
path: downloads
|
path: downloads
|
||||||
key: php-dependencies-${{ inputs.os }}
|
key: php-dependencies-${{ inputs.os }}
|
||||||
|
|
||||||
- name: "Download sources"
|
- name: "Download sources"
|
||||||
run: ${{ needs.define-build.outputs.download }}
|
run: ${{ needs.define-build.outputs.download }}
|
||||||
- name: "Build PHP"
|
- name: "Build PHP"
|
||||||
run: ${{ needs.define-build.outputs.build }}
|
run: ${{ needs.define-build.outputs.build }}
|
||||||
#- name: Setup tmate session
|
# - name: Setup tmate session
|
||||||
# if: ${{ failure() }}
|
# if: ${{ failure() }}
|
||||||
# uses: mxschmitt/action-tmate@v3
|
# uses: mxschmitt/action-tmate@v3
|
||||||
|
|
||||||
# Upload cli executable
|
# Upload cli executable
|
||||||
- if: ${{ inputs.build-cli == true }}
|
- if: ${{ inputs.build-cli == true }}
|
||||||
@@ -179,12 +230,12 @@ jobs:
|
|||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v4
|
||||||
name: "Upload License Files"
|
name: "Upload License Files"
|
||||||
with:
|
with:
|
||||||
name: license-files
|
name: license-files-${{ inputs.php-version }}-${{ inputs.os }}
|
||||||
path: buildroot/license/
|
path: buildroot/license/
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v4
|
||||||
name: "Upload Build Metadata"
|
name: "Upload Build Metadata"
|
||||||
with:
|
with:
|
||||||
name: build-meta
|
name: build-meta-${{ inputs.php-version }}-${{ inputs.os }}
|
||||||
path: |
|
path: |
|
||||||
buildroot/build-extensions.json
|
buildroot/build-extensions.json
|
||||||
buildroot/build-libraries.json
|
buildroot/build-libraries.json
|
||||||
|
|||||||
2
.github/workflows/build-windows-x86_64.yml
vendored
2
.github/workflows/build-windows-x86_64.yml
vendored
@@ -6,7 +6,7 @@ on:
|
|||||||
version:
|
version:
|
||||||
required: true
|
required: true
|
||||||
description: php version to compile
|
description: php version to compile
|
||||||
default: '8.2'
|
default: '8.4'
|
||||||
type: choice
|
type: choice
|
||||||
options:
|
options:
|
||||||
- '8.4'
|
- '8.4'
|
||||||
|
|||||||
21
.github/workflows/ext-matrix-tests.yml
vendored
21
.github/workflows/ext-matrix-tests.yml
vendored
@@ -1,16 +1,14 @@
|
|||||||
name: "Extension matrix tests"
|
name: "Extension Matrix Tests"
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
pull_request:
|
push:
|
||||||
branches: [ "main" ]
|
|
||||||
paths:
|
|
||||||
- '.github/workflows/ext-matrix-tests.yml'
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
name: "${{ matrix.extension }} (PHP ${{ matrix.php-version }} on ${{ matrix.operating-system }})"
|
name: "${{ matrix.extension }} (PHP ${{ matrix.php-version }} on ${{ matrix.operating-system }})"
|
||||||
runs-on: ${{ matrix.operating-system }}
|
runs-on: ${{ matrix.operating-system }}
|
||||||
|
if: contains(github.event.head_commit.message, 'extension test') || contains(github.event.head_commit.message, 'test extensions')
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
@@ -84,7 +82,7 @@ jobs:
|
|||||||
- zlib
|
- zlib
|
||||||
- zstd
|
- zstd
|
||||||
php-version:
|
php-version:
|
||||||
- "8.4"
|
- "git"
|
||||||
operating-system:
|
operating-system:
|
||||||
- "ubuntu-latest"
|
- "ubuntu-latest"
|
||||||
#- "macos-13"
|
#- "macos-13"
|
||||||
@@ -113,7 +111,7 @@ jobs:
|
|||||||
- name: "Setup PHP"
|
- name: "Setup PHP"
|
||||||
uses: shivammathur/setup-php@v2
|
uses: shivammathur/setup-php@v2
|
||||||
with:
|
with:
|
||||||
php-version: 8.2
|
php-version: 8.4
|
||||||
tools: pecl, composer
|
tools: pecl, composer
|
||||||
extensions: curl, openssl, mbstring
|
extensions: curl, openssl, mbstring
|
||||||
ini-values: memory_limit=-1
|
ini-values: memory_limit=-1
|
||||||
@@ -138,11 +136,4 @@ jobs:
|
|||||||
- name: "Build library: ${{ matrix.library }}"
|
- name: "Build library: ${{ matrix.library }}"
|
||||||
run: |
|
run: |
|
||||||
SPC_USE_SUDO=yes ./bin/spc doctor --auto-fix
|
SPC_USE_SUDO=yes ./bin/spc doctor --auto-fix
|
||||||
if [ "${{ env.OS }}" = "linux-x86_64" ]; then
|
./bin/spc build --build-cli --build-micro --build-fpm ${{ matrix.extension }} --debug --with-suggested-libs --with-suggested-exts
|
||||||
./bin/spc install-pkg upx
|
|
||||||
UPX=--with-upx-pack
|
|
||||||
elif [ "${{ env.OS }}" = "linux-aarch64" ]; then
|
|
||||||
./bin/spc install-pkg upx
|
|
||||||
UPX=--with-upx-pack
|
|
||||||
fi
|
|
||||||
./bin/spc build --build-cli --build-micro --build-fpm ${{ matrix.extension }} --debug $UPX --with-suggested-libs --with-suggested-exts
|
|
||||||
|
|||||||
7
.github/workflows/release-build.yml
vendored
7
.github/workflows/release-build.yml
vendored
@@ -9,8 +9,8 @@ on:
|
|||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
env:
|
env:
|
||||||
PHP_VERSION: 8.2
|
PHP_VERSION: 8.4
|
||||||
MICRO_VERSION: 8.2.18
|
MICRO_VERSION: 8.4.10
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-release-artifacts:
|
build-release-artifacts:
|
||||||
@@ -42,12 +42,13 @@ jobs:
|
|||||||
run: echo "SPC_BUILD_DEBUG=--debug" >> $GITHUB_ENV
|
run: echo "SPC_BUILD_DEBUG=--debug" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: "Install PHP for official runners"
|
- name: "Install PHP for official runners"
|
||||||
uses: "shivammathur/setup-php@v2"
|
uses: shivammathur/setup-php@v2
|
||||||
with:
|
with:
|
||||||
coverage: none
|
coverage: none
|
||||||
tools: composer:v2
|
tools: composer:v2
|
||||||
php-version: "${{ env.PHP_VERSION }}"
|
php-version: "${{ env.PHP_VERSION }}"
|
||||||
ini-values: memory_limit=-1
|
ini-values: memory_limit=-1
|
||||||
|
extensions: curl, openssl, mbstring
|
||||||
|
|
||||||
- name: "Get Composer Cache Directory"
|
- name: "Get Composer Cache Directory"
|
||||||
id: composer-cache
|
id: composer-cache
|
||||||
|
|||||||
44
.github/workflows/tests.yml
vendored
44
.github/workflows/tests.yml
vendored
@@ -17,8 +17,7 @@ on:
|
|||||||
- 'box.json'
|
- 'box.json'
|
||||||
- '.php-cs-fixer.php'
|
- '.php-cs-fixer.php'
|
||||||
|
|
||||||
permissions:
|
permissions: read-all
|
||||||
contents: read
|
|
||||||
|
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
@@ -34,7 +33,7 @@ jobs:
|
|||||||
- name: "Setup PHP"
|
- name: "Setup PHP"
|
||||||
uses: shivammathur/setup-php@v2
|
uses: shivammathur/setup-php@v2
|
||||||
with:
|
with:
|
||||||
php-version: '8.1'
|
php-version: '8.4'
|
||||||
extensions: curl, openssl, mbstring
|
extensions: curl, openssl, mbstring
|
||||||
ini-values: memory_limit=-1
|
ini-values: memory_limit=-1
|
||||||
tools: pecl, composer, php-cs-fixer
|
tools: pecl, composer, php-cs-fixer
|
||||||
@@ -52,10 +51,12 @@ jobs:
|
|||||||
- name: "Setup PHP"
|
- name: "Setup PHP"
|
||||||
uses: shivammathur/setup-php@v2
|
uses: shivammathur/setup-php@v2
|
||||||
with:
|
with:
|
||||||
php-version: '8.1'
|
php-version: '8.4'
|
||||||
extensions: curl, openssl, mbstring
|
extensions: curl, openssl, mbstring
|
||||||
ini-values: memory_limit=-1
|
ini-values: memory_limit=-1
|
||||||
tools: composer
|
tools: composer
|
||||||
|
env:
|
||||||
|
phpts: zts
|
||||||
|
|
||||||
- name: "Cache Composer packages"
|
- name: "Cache Composer packages"
|
||||||
id: composer-cache
|
id: composer-cache
|
||||||
@@ -79,9 +80,6 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- php: '8.1'
|
|
||||||
- php: '8.2'
|
|
||||||
- php: '8.3'
|
|
||||||
- php: '8.4'
|
- php: '8.4'
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
@@ -103,14 +101,13 @@ jobs:
|
|||||||
path: vendor
|
path: vendor
|
||||||
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
|
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-php-
|
${{ runner.os }}-php
|
||||||
|
|
||||||
- name: "Install Dependencies"
|
- name: "Install Dependencies"
|
||||||
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
|
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
|
||||||
|
|
||||||
- name: "Run PHPUnit Tests"
|
- name: "Run PHPUnit Tests"
|
||||||
run: |
|
run: SPC_LIBC=glibc vendor/bin/phpunit tests/ --no-coverage
|
||||||
SPC_NO_MUSL_PATH=yes vendor/bin/phpunit tests/ --no-coverage
|
|
||||||
|
|
||||||
define-matrix:
|
define-matrix:
|
||||||
name: "Define Matrix"
|
name: "Define Matrix"
|
||||||
@@ -125,7 +122,8 @@ jobs:
|
|||||||
- name: "Setup PHP"
|
- name: "Setup PHP"
|
||||||
uses: shivammathur/setup-php@v2
|
uses: shivammathur/setup-php@v2
|
||||||
with:
|
with:
|
||||||
php-version: 8.2
|
php-version: 8.4
|
||||||
|
extensions: curl, openssl, mbstring
|
||||||
|
|
||||||
- name: Define
|
- name: Define
|
||||||
id: gendef
|
id: gendef
|
||||||
@@ -139,7 +137,7 @@ jobs:
|
|||||||
build:
|
build:
|
||||||
name: "Build PHP Test (PHP ${{ matrix.php }} ${{ matrix.os }})"
|
name: "Build PHP Test (PHP ${{ matrix.php }} ${{ matrix.os }})"
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
needs: define-matrix
|
needs: [define-matrix, php-cs-fixer, phpstan, phpunit]
|
||||||
timeout-minutes: 120
|
timeout-minutes: 120
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
@@ -147,13 +145,17 @@ jobs:
|
|||||||
os: ${{ fromJSON(needs.define-matrix.outputs.os) }}
|
os: ${{ fromJSON(needs.define-matrix.outputs.os) }}
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
steps:
|
steps:
|
||||||
|
- name: "Update runner packages"
|
||||||
|
if: ${{ startsWith(matrix.os, 'ubuntu-') }}
|
||||||
|
run: sudo apt-get update && sudo apt-get install -y ca-certificates
|
||||||
|
|
||||||
- name: "Checkout"
|
- name: "Checkout"
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: "Setup PHP"
|
- name: "Setup PHP"
|
||||||
uses: shivammathur/setup-php@v2
|
uses: shivammathur/setup-php@v2
|
||||||
with:
|
with:
|
||||||
php-version: 8.2
|
php-version: 8.4
|
||||||
tools: pecl, composer
|
tools: pecl, composer
|
||||||
extensions: curl, openssl, mbstring
|
extensions: curl, openssl, mbstring
|
||||||
ini-values: memory_limit=-1
|
ini-values: memory_limit=-1
|
||||||
@@ -180,18 +182,18 @@ jobs:
|
|||||||
run: composer update -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
|
run: composer update -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
|
||||||
|
|
||||||
- name: "Run Build Tests (doctor)"
|
- name: "Run Build Tests (doctor)"
|
||||||
run: bin/spc doctor --auto-fix --debug
|
run: php src/globals/test-extensions.php doctor_cmd ${{ matrix.os }} ${{ matrix.php }}
|
||||||
|
|
||||||
- name: "Prepare UPX for Windows"
|
- name: "Prepare UPX for Windows"
|
||||||
if: matrix.os == 'windows-latest'
|
if: ${{ startsWith(matrix.os, 'windows-') }}
|
||||||
run: |
|
run: |
|
||||||
bin/spc install-pkg upx
|
php src/globals/test-extensions.php install_upx_cmd ${{ matrix.os }} ${{ matrix.php }}
|
||||||
echo "UPX_CMD=$(php src/globals/test-extensions.php upx)" >> $env:GITHUB_ENV
|
echo "UPX_CMD=$(php src/globals/test-extensions.php upx)" >> $env:GITHUB_ENV
|
||||||
|
|
||||||
- name: "Prepare UPX for Linux"
|
- name: "Prepare UPX for Linux"
|
||||||
if: matrix.os == 'ubunut-latest'
|
if: ${{ startsWith(matrix.os, 'ubuntu-') }}
|
||||||
run: |
|
run: |
|
||||||
bin/spc install-pkg upx
|
php src/globals/test-extensions.php install_upx_cmd ${{ matrix.os }} ${{ matrix.php }}
|
||||||
echo "UPX_CMD=$(php src/globals/test-extensions.php upx)" >> $GITHUB_ENV
|
echo "UPX_CMD=$(php src/globals/test-extensions.php upx)" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: "Run Build Tests (download)"
|
- name: "Run Build Tests (download)"
|
||||||
@@ -201,5 +203,9 @@ jobs:
|
|||||||
run: php src/globals/test-extensions.php build_cmd ${{ matrix.os }} ${{ matrix.php }}
|
run: php src/globals/test-extensions.php build_cmd ${{ matrix.os }} ${{ matrix.php }}
|
||||||
|
|
||||||
- name: "Run Build Tests (build - embed for non-windows)"
|
- name: "Run Build Tests (build - embed for non-windows)"
|
||||||
if: matrix.os != 'windows-latest'
|
if: ${{ !startsWith(matrix.os, 'windows-') }}
|
||||||
run: php src/globals/test-extensions.php build_embed_cmd ${{ matrix.os }} ${{ matrix.php }}
|
run: php src/globals/test-extensions.php build_embed_cmd ${{ matrix.os }} ${{ matrix.php }}
|
||||||
|
|
||||||
|
# - name: Setup tmate session
|
||||||
|
# if: ${{ failure() }}
|
||||||
|
# uses: mxschmitt/action-tmate@v3
|
||||||
|
|||||||
5
.github/workflows/vitepress-deploy.yml
vendored
5
.github/workflows/vitepress-deploy.yml
vendored
@@ -32,12 +32,13 @@ jobs:
|
|||||||
cp -r config/* docs/.vitepress/config/
|
cp -r config/* docs/.vitepress/config/
|
||||||
|
|
||||||
- name: "Install PHP for official runners"
|
- name: "Install PHP for official runners"
|
||||||
uses: "shivammathur/setup-php@v2"
|
uses: shivammathur/setup-php@v2
|
||||||
with:
|
with:
|
||||||
coverage: none
|
coverage: none
|
||||||
tools: composer:v2
|
tools: composer:v2
|
||||||
php-version: 8.2
|
php-version: 8.4
|
||||||
ini-values: memory_limit=-1
|
ini-values: memory_limit=-1
|
||||||
|
extensions: curl, openssl, mbstring
|
||||||
|
|
||||||
- name: "Get Composer Cache Directory"
|
- name: "Get Composer Cache Directory"
|
||||||
id: composer-cache
|
id: composer-cache
|
||||||
|
|||||||
20
.gitignore
vendored
20
.gitignore
vendored
@@ -5,22 +5,25 @@ docker/extensions/
|
|||||||
docker/source/
|
docker/source/
|
||||||
|
|
||||||
# Vendor files
|
# Vendor files
|
||||||
/vendor/
|
/vendor/**
|
||||||
|
|
||||||
# default source extract directory
|
# default source extract directory
|
||||||
/source/
|
/source/**
|
||||||
|
|
||||||
|
# built by shared embed tests
|
||||||
|
/locale/
|
||||||
|
|
||||||
# default source download directory
|
# default source download directory
|
||||||
/downloads/
|
/downloads/**
|
||||||
|
|
||||||
# default source build root directory
|
# default source build root directory
|
||||||
/buildroot/
|
/buildroot/**
|
||||||
|
|
||||||
# default package root directory
|
# default package root directory
|
||||||
/pkgroot/
|
/pkgroot/**
|
||||||
|
|
||||||
# default pack:lib and release directory
|
# default pack:lib and release directory
|
||||||
/dist/
|
/dist/**
|
||||||
packlib_files.txt
|
packlib_files.txt
|
||||||
|
|
||||||
# tools cache files
|
# tools cache files
|
||||||
@@ -31,7 +34,6 @@ packlib_files.txt
|
|||||||
/bin/*
|
/bin/*
|
||||||
!/bin/spc*
|
!/bin/spc*
|
||||||
!/bin/setup-runtime*
|
!/bin/setup-runtime*
|
||||||
!/bin/spc-alpine-docker
|
|
||||||
|
|
||||||
# exclude windows build tools
|
# exclude windows build tools
|
||||||
/php-sdk-binary-tools/
|
/php-sdk-binary-tools/
|
||||||
@@ -45,3 +47,7 @@ packlib_files.txt
|
|||||||
/docs/.vitepress/cache/
|
/docs/.vitepress/cache/
|
||||||
package-lock.json
|
package-lock.json
|
||||||
pnpm-lock.yaml
|
pnpm-lock.yaml
|
||||||
|
|
||||||
|
# craft.log
|
||||||
|
craft.log
|
||||||
|
craft.yml
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
return (new PhpCsFixer\Config())
|
return (new PhpCsFixer\Config())
|
||||||
->setRiskyAllowed(true)
|
->setRiskyAllowed(true)
|
||||||
|
->setUnsupportedPhpVersionAllowed(true)
|
||||||
->setRules([
|
->setRules([
|
||||||
'@PSR12' => true,
|
'@PSR12' => true,
|
||||||
'@Symfony' => true,
|
'@Symfony' => true,
|
||||||
@@ -64,7 +65,10 @@ return (new PhpCsFixer\Config())
|
|||||||
'php_unit_test_class_requires_covers' => false,
|
'php_unit_test_class_requires_covers' => false,
|
||||||
'phpdoc_var_without_name' => false,
|
'phpdoc_var_without_name' => false,
|
||||||
'fully_qualified_strict_types' => false,
|
'fully_qualified_strict_types' => false,
|
||||||
|
'operator_linebreak' => false,
|
||||||
|
'php_unit_data_provider_method_order' => false,
|
||||||
])
|
])
|
||||||
->setFinder(
|
->setFinder(
|
||||||
PhpCsFixer\Finder::create()->in([__DIR__ . '/src', __DIR__ . '/tests/SPC'])
|
PhpCsFixer\Finder::create()->in([__DIR__ . '/src', __DIR__ . '/tests/SPC'])
|
||||||
);
|
)
|
||||||
|
->setParallelConfig(PhpCsFixer\Runner\Parallel\ParallelConfigFactory::detect());
|
||||||
|
|||||||
38
README-zh.md
38
README-zh.md
@@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
**static-php-cli**是一个用于静态编译、构建 PHP 解释器的工具,支持众多流行扩展。
|
**static-php-cli**是一个用于静态编译、构建 PHP 解释器的工具,支持众多流行扩展。
|
||||||
|
|
||||||
目前 static-php-cli 支持 `cli`、`fpm`、`embed` 和 `micro` SAPI。
|
目前 static-php-cli 支持 `cli`、`fpm`、`embed`、`micro` 和 `frankenphp` SAPI。
|
||||||
|
|
||||||
**static-php-cli**也支持将 PHP 代码和 PHP 运行时打包为一个文件并运行。
|
**static-php-cli**也支持将 PHP 代码和 PHP 运行时打包为一个文件并运行。
|
||||||
|
|
||||||
@@ -58,7 +58,7 @@ static-php-cli(简称 `spc`)有许多特性:
|
|||||||
|
|
||||||
### 编译环境需求
|
### 编译环境需求
|
||||||
|
|
||||||
- PHP >= 8.1(这是 spc 自身需要的版本,不是支持的构建版本)
|
- PHP >= 8.4(这是 spc 自身需要的版本,不是支持的构建版本)
|
||||||
- 扩展:`mbstring,tokenizer,phar`
|
- 扩展:`mbstring,tokenizer,phar`
|
||||||
- 系统安装了 `curl` 和 `git`
|
- 系统安装了 `curl` 和 `git`
|
||||||
|
|
||||||
@@ -76,22 +76,23 @@ static-php-cli(简称 `spc`)有许多特性:
|
|||||||
|
|
||||||
当前支持编译的 PHP 版本:
|
当前支持编译的 PHP 版本:
|
||||||
|
|
||||||
> :warning: 支持,但 static-php-cli 作者可能不再提供补丁修复
|
> :warning: 部分支持,对于新的测试版和旧版本可能存在问题。
|
||||||
>
|
>
|
||||||
> :heavy_check_mark: 支持
|
> :heavy_check_mark: 支持
|
||||||
>
|
>
|
||||||
> :x: 不支持
|
> :x: 不支持
|
||||||
|
|
||||||
| PHP Version | Status | Comment |
|
| PHP Version | Status | Comment |
|
||||||
|-------------|--------------------|----------------------------------------------|
|
|-------------|--------------------|---------------------------------------------------------|
|
||||||
| 7.2 | :x: | |
|
| 7.2 | :x: | |
|
||||||
| 7.3 | :x: | phpmicro 和许多扩展不支持 7.3、7.4 版本 |
|
| 7.3 | :x: | phpmicro 和许多扩展不支持 7.3、7.4 版本 |
|
||||||
| 7.4 | :x: | phpmicro 和许多扩展不支持 7.3、7.4 版本 |
|
| 7.4 | :x: | phpmicro 和许多扩展不支持 7.3、7.4 版本 |
|
||||||
| 8.0 | :warning: | PHP 官方已停止 8.0 的维护,我们不再处理 8.0 相关的 backport 支持 |
|
| 8.0 | :warning: | PHP 官方已停止 8.0 的维护,我们不再处理 8.0 相关的 backport 支持 |
|
||||||
| 8.1 | :heavy_check_mark: | PHP 官方仅对 8.1 提供安全更新 |
|
| 8.1 | :heavy_check_mark: | PHP 官方仅对 8.1 提供安全更新,在 8.5 发布后我们不再处理 8.1 相关的 backport 支持 |
|
||||||
| 8.2 | :heavy_check_mark: | |
|
| 8.2 | :heavy_check_mark: | |
|
||||||
| 8.3 | :heavy_check_mark: | |
|
| 8.3 | :heavy_check_mark: | |
|
||||||
| 8.4 | :heavy_check_mark: | |
|
| 8.4 | :heavy_check_mark: | |
|
||||||
|
| 8.5 (alpha) | :warning: | PHP 8.5 目前处于 alpha 阶段 |
|
||||||
|
|
||||||
> 这个表格的支持状态是 static-php-cli 对构建对应版本的支持情况,不是 PHP 官方对该版本的支持情况。
|
> 这个表格的支持状态是 static-php-cli 对构建对应版本的支持情况,不是 PHP 官方对该版本的支持情况。
|
||||||
|
|
||||||
@@ -180,6 +181,9 @@ bin/spc --version
|
|||||||
# 检查环境依赖,并根据尝试自动安装缺失的编译工具
|
# 检查环境依赖,并根据尝试自动安装缺失的编译工具
|
||||||
./bin/spc doctor --auto-fix
|
./bin/spc doctor --auto-fix
|
||||||
|
|
||||||
|
# 输出目标项目依赖的扩展列表
|
||||||
|
./bin/spc dump-extensions /path/to/your/project --format=text
|
||||||
|
|
||||||
# 拉取所有依赖库
|
# 拉取所有依赖库
|
||||||
./bin/spc download --all
|
./bin/spc download --all
|
||||||
# 只拉取编译指定扩展需要的所有依赖(推荐)
|
# 只拉取编译指定扩展需要的所有依赖(推荐)
|
||||||
@@ -275,7 +279,7 @@ bin/spc micro:combine my-app.phar -I "memory_limit=4G" -I "disable_functions=sys
|
|||||||
|
|
||||||
如果你知道 [embed SAPI](https://github.com/php/php-src/tree/master/sapi/embed),你应该知道如何使用它。对于有可能编译用到引入其他库的问题,你可以使用 `buildroot/bin/php-config` 来获取编译时的配置。
|
如果你知道 [embed SAPI](https://github.com/php/php-src/tree/master/sapi/embed),你应该知道如何使用它。对于有可能编译用到引入其他库的问题,你可以使用 `buildroot/bin/php-config` 来获取编译时的配置。
|
||||||
|
|
||||||
另外,有关如何使用此功能的高级示例,请查看[如何使用它构建 FrankenPHP 的静态版本](https://github.com/dunglas/frankenphp/blob/main/docs/static.md)。
|
另外,有关如何使用此功能的高级示例,请查看[如何使用它构建 FrankenPHP 的静态版本](https://github.com/php/frankenphp/blob/main/docs/static.md)。
|
||||||
|
|
||||||
## 贡献
|
## 贡献
|
||||||
|
|
||||||
@@ -289,6 +293,12 @@ bin/spc micro:combine my-app.phar -I "memory_limit=4G" -I "disable_functions=sys
|
|||||||
|
|
||||||
你可以在 [我的个人赞助页](https://github.com/crazywhalecc/crazywhalecc/blob/master/FUNDING.md) 支持我和我的项目。你捐赠的一部分将会被用于维护 **static-php.dev** 服务器。
|
你可以在 [我的个人赞助页](https://github.com/crazywhalecc/crazywhalecc/blob/master/FUNDING.md) 支持我和我的项目。你捐赠的一部分将会被用于维护 **static-php.dev** 服务器。
|
||||||
|
|
||||||
|
**特别赞助商**:
|
||||||
|
|
||||||
|
<a href="https://beyondco.de/"><img src="/docs/public/images/beyondcode-seeklogo.png" width="300" alt="Beyond Code Logo" /></a>
|
||||||
|
|
||||||
|
<a href="https://nativephp.com/"><img src="/docs/public/images/nativephp-logo.svg" width="300" alt="NativePHP Logo" /></a>
|
||||||
|
|
||||||
## 开源协议
|
## 开源协议
|
||||||
|
|
||||||
本项目采用 MIT License 许可开源,下面是类似的项目:
|
本项目采用 MIT License 许可开源,下面是类似的项目:
|
||||||
|
|||||||
21
README.md
21
README.md
@@ -10,7 +10,7 @@
|
|||||||
**static-php-cli** is a powerful tool designed for building static, standalone PHP runtime
|
**static-php-cli** is a powerful tool designed for building static, standalone PHP runtime
|
||||||
with popular extensions.
|
with popular extensions.
|
||||||
|
|
||||||
Static PHP built by **static-php-cli** supports `cli`, `fpm`, `embed` and `micro` SAPI.
|
Static PHP built by **static-php-cli** supports `cli`, `fpm`, `embed`, `micro` and `frankenphp` SAPI.
|
||||||
|
|
||||||
**static-php-cli** also has the ability to package PHP projects
|
**static-php-cli** also has the ability to package PHP projects
|
||||||
along with the PHP interpreter into one single executable file.
|
along with the PHP interpreter into one single executable file.
|
||||||
@@ -67,7 +67,7 @@ which can be downloaded directly according to your needs.
|
|||||||
You can say I made a PHP builder written in PHP, pretty funny.
|
You can say I made a PHP builder written in PHP, pretty funny.
|
||||||
But static-php-cli runtime only requires an environment above PHP 8.1 and extensions mentioned below.
|
But static-php-cli runtime only requires an environment above PHP 8.1 and extensions mentioned below.
|
||||||
|
|
||||||
- PHP >= 8.1 (This is the version required by spc itself, not the build version)
|
- PHP >= 8.4 (This is the version required by spc itself, not the build version)
|
||||||
- Extension: `mbstring,tokenizer,phar`
|
- Extension: `mbstring,tokenizer,phar`
|
||||||
- Supported OS with `curl` and `git` installed
|
- Supported OS with `curl` and `git` installed
|
||||||
|
|
||||||
@@ -83,7 +83,7 @@ Here is the supported OS and arch, where :octocat: represents support for GitHub
|
|||||||
|
|
||||||
Currently supported PHP versions for compilation:
|
Currently supported PHP versions for compilation:
|
||||||
|
|
||||||
> :warning: supported but not maintained by static-php-cli authors
|
> :warning: Partial support, there may be issues with newer test versions or older versions.
|
||||||
>
|
>
|
||||||
> :heavy_check_mark: supported
|
> :heavy_check_mark: supported
|
||||||
>
|
>
|
||||||
@@ -95,10 +95,11 @@ Currently supported PHP versions for compilation:
|
|||||||
| 7.3 | :x: | phpmicro and some extensions not supported on 7.x |
|
| 7.3 | :x: | phpmicro and some extensions not supported on 7.x |
|
||||||
| 7.4 | :x: | phpmicro and some extensions not supported on 7.x |
|
| 7.4 | :x: | phpmicro and some extensions not supported on 7.x |
|
||||||
| 8.0 | :warning: | PHP official has stopped maintenance of 8.0, we no longer provide backport support for version 8.0 |
|
| 8.0 | :warning: | PHP official has stopped maintenance of 8.0, we no longer provide backport support for version 8.0 |
|
||||||
| 8.1 | :heavy_check_mark: | PHP official has security fixes only |
|
| 8.1 | :heavy_check_mark: | PHP official has security fixes only, we no longer provide backport support when 8.5 released |
|
||||||
| 8.2 | :heavy_check_mark: | |
|
| 8.2 | :heavy_check_mark: | |
|
||||||
| 8.3 | :heavy_check_mark: | |
|
| 8.3 | :heavy_check_mark: | |
|
||||||
| 8.4 | :heavy_check_mark: | |
|
| 8.4 | :heavy_check_mark: | |
|
||||||
|
| 8.5 (alpha) | :warning: | PHP 8.5 is in alpha |
|
||||||
|
|
||||||
> This table shows the support status for static-php-cli in building the corresponding version,
|
> This table shows the support status for static-php-cli in building the corresponding version,
|
||||||
> not the official PHP support status for that version.
|
> not the official PHP support status for that version.
|
||||||
@@ -194,11 +195,13 @@ Basic usage for building php with some extensions:
|
|||||||
|
|
||||||
# fetch all libraries
|
# fetch all libraries
|
||||||
./bin/spc download --all
|
./bin/spc download --all
|
||||||
|
# dump a list of extensions required by your project
|
||||||
|
./bin/spc dump-extensions /path/to/your/project --format=text
|
||||||
# only fetch necessary sources by needed extensions (recommended)
|
# only fetch necessary sources by needed extensions (recommended)
|
||||||
./bin/spc download --for-extensions="openssl,pcntl,mbstring,pdo_sqlite"
|
./bin/spc download --for-extensions="openssl,pcntl,mbstring,pdo_sqlite"
|
||||||
# download pre-built libraries first (save time for compiling dependencies)
|
# download pre-built libraries first (save time for compiling dependencies)
|
||||||
./bin/spc download --for-extensions="openssl,curl,mbstring,mbregex" --prefer-pre-built
|
./bin/spc download --for-extensions="openssl,curl,mbstring,mbregex" --prefer-pre-built
|
||||||
# download different PHP version (--with-php=x.y or --with-php=x.y.z, recommend 8.1 ~ 8.3)
|
# download different PHP version (--with-php=x.y or --with-php=x.y.z, recommend 8.3 ~ 8.4)
|
||||||
./bin/spc download --for-extensions="openssl,curl,mbstring" --with-php=8.1
|
./bin/spc download --for-extensions="openssl,curl,mbstring" --with-php=8.1
|
||||||
|
|
||||||
# with bcmath,openssl,tokenizer,sqlite3,pdo_sqlite,ftp,curl extension, build both CLI and phpmicro SAPI
|
# with bcmath,openssl,tokenizer,sqlite3,pdo_sqlite,ftp,curl extension, build both CLI and phpmicro SAPI
|
||||||
@@ -300,7 +303,7 @@ If you know [embed SAPI](https://github.com/php/php-src/tree/master/sapi/embed),
|
|||||||
You may require the introduction of other libraries during compilation,
|
You may require the introduction of other libraries during compilation,
|
||||||
you can use `buildroot/bin/php-config` to obtain the compile-time configuration.
|
you can use `buildroot/bin/php-config` to obtain the compile-time configuration.
|
||||||
|
|
||||||
For an advanced example of how to use this feature, take a look at [how to use it to build a static version of FrankenPHP](https://github.com/dunglas/frankenphp/blob/main/docs/static.md).
|
For an advanced example of how to use this feature, take a look at [how to use it to build a static version of FrankenPHP](https://github.com/php/frankenphp/blob/main/docs/static.md).
|
||||||
|
|
||||||
## Contribution
|
## Contribution
|
||||||
|
|
||||||
@@ -315,6 +318,12 @@ Now there is a [static-php](https://github.com/static-php) organization, which i
|
|||||||
|
|
||||||
You can sponsor me or my project from [GitHub Sponsor](https://github.com/crazywhalecc). A portion of your donation will be used to maintain the **static-php.dev** server.
|
You can sponsor me or my project from [GitHub Sponsor](https://github.com/crazywhalecc). A portion of your donation will be used to maintain the **static-php.dev** server.
|
||||||
|
|
||||||
|
**Special thanks to sponsors below**:
|
||||||
|
|
||||||
|
<a href="https://beyondco.de/"><img src="/docs/public/images/beyondcode-seeklogo.png" width="300" alt="Beyond Code Logo" /></a>
|
||||||
|
|
||||||
|
<a href="https://nativephp.com/"><img src="/docs/public/images/nativephp-logo.svg" width="300" alt="NativePHP Logo" /></a>
|
||||||
|
|
||||||
## Open-Source License
|
## Open-Source License
|
||||||
|
|
||||||
This project itself is based on MIT License,
|
This project itself is based on MIT License,
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ __DIR__=$(cd "$(dirname "$0")" && pwd)
|
|||||||
__PROJECT__=$(cd "${__DIR__}"/../ && pwd)
|
__PROJECT__=$(cd "${__DIR__}"/../ && pwd)
|
||||||
|
|
||||||
# set download dir
|
# set download dir
|
||||||
__PHP_RUNTIME_URL__="https://dl.static-php.dev/static-php-cli/bulk/php-8.2.13-cli-${__OS_FIXED__}-${__ARCH__}.tar.gz"
|
__PHP_RUNTIME_URL__="https://dl.static-php.dev/static-php-cli/bulk/php-8.4.4-cli-${__OS_FIXED__}-${__ARCH__}.tar.gz"
|
||||||
__COMPOSER_URL__="https://getcomposer.org/download/latest-stable/composer.phar"
|
__COMPOSER_URL__="https://getcomposer.org/download/latest-stable/composer.phar"
|
||||||
|
|
||||||
# use china mirror
|
# use china mirror
|
||||||
@@ -45,7 +45,7 @@ done
|
|||||||
|
|
||||||
case "$mirror" in
|
case "$mirror" in
|
||||||
china)
|
china)
|
||||||
__PHP_RUNTIME_URL__="https://dl.static-php.dev/static-php-cli/bulk/php-8.2.13-cli-${__OS_FIXED__}-${__ARCH__}.tar.gz"
|
__PHP_RUNTIME_URL__="https://dl.static-php.dev/static-php-cli/bulk/php-8.4.4-cli-${__OS_FIXED__}-${__ARCH__}.tar.gz"
|
||||||
__COMPOSER_URL__="https://mirrors.tencent.com/composer/composer.phar"
|
__COMPOSER_URL__="https://mirrors.tencent.com/composer/composer.phar"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
@@ -61,7 +61,7 @@ test -f "${__PROJECT__}"/downloads/runtime.tar.gz || { echo "Downloading $__PHP_
|
|||||||
test -f "${__DIR__}"/php || { tar -xf "${__PROJECT__}"/downloads/runtime.tar.gz -C "${__DIR__}"/ ; }
|
test -f "${__DIR__}"/php || { tar -xf "${__PROJECT__}"/downloads/runtime.tar.gz -C "${__DIR__}"/ ; }
|
||||||
chmod +x "${__DIR__}"/php
|
chmod +x "${__DIR__}"/php
|
||||||
# download composer
|
# download composer
|
||||||
test -f "${__DIR__}"/composer || curl -#fSL -o "${__DIR__}"/composer "$__COMPOSER_URL__"
|
test -f "${__DIR__}"/composer || { echo "Downloading Composer from $__COMPOSER_URL__" && curl -#fSL -o "${__DIR__}"/composer "$__COMPOSER_URL__" ; }
|
||||||
chmod +x "${__DIR__}"/composer
|
chmod +x "${__DIR__}"/composer
|
||||||
# sanity check for php and composer
|
# sanity check for php and composer
|
||||||
"${__DIR__}"/php -v >/dev/null || { echo "Failed to run php" && exit 1; }
|
"${__DIR__}"/php -v >/dev/null || { echo "Failed to run php" && exit 1; }
|
||||||
|
|||||||
@@ -51,10 +51,11 @@ if ($action -eq 'add-path') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# get php 8.1 specific version
|
# get php 8.1 specific version
|
||||||
$API = (Invoke-WebRequest -Uri "https://www.php.net/releases/index.php?json&version=8.3") | ConvertFrom-Json
|
|
||||||
|
|
||||||
# php windows download
|
# php windows download
|
||||||
$PHPRuntimeUrl = "https://windows.php.net/downloads/releases/php-" + $API.version + "-nts-Win32-vs16-x64.zip"
|
$PHPRuntimeUrl = "https://windows.php.net/downloads/releases/archives/php-8.4.4-nts-Win32-vs17-x64.zip"
|
||||||
|
Write-Host "Downloading PHP from: " -NoNewline
|
||||||
|
Write-Host $PHPRuntimeUrl -ForegroundColor Cyan
|
||||||
$ComposerUrl = "https://getcomposer.org/download/latest-stable/composer.phar"
|
$ComposerUrl = "https://getcomposer.org/download/latest-stable/composer.phar"
|
||||||
|
|
||||||
# create dir
|
# create dir
|
||||||
|
|||||||
10
bin/spc
10
bin/spc
@@ -4,6 +4,11 @@
|
|||||||
use SPC\ConsoleApplication;
|
use SPC\ConsoleApplication;
|
||||||
use SPC\exception\ExceptionHandler;
|
use SPC\exception\ExceptionHandler;
|
||||||
|
|
||||||
|
// Load custom php if exists
|
||||||
|
if (PHP_OS_FAMILY !== 'Windows' && PHP_BINARY !== (__DIR__ . '/php') && file_exists(__DIR__ . '/php') && is_executable(__DIR__ . '/php')) {
|
||||||
|
pcntl_exec(__DIR__ . '/php', $argv);
|
||||||
|
}
|
||||||
|
|
||||||
if (file_exists(dirname(__DIR__) . '/vendor/autoload.php')) {
|
if (file_exists(dirname(__DIR__) . '/vendor/autoload.php')) {
|
||||||
// Current: ./bin (git/project mode)
|
// Current: ./bin (git/project mode)
|
||||||
require_once dirname(__DIR__) . '/vendor/autoload.php';
|
require_once dirname(__DIR__) . '/vendor/autoload.php';
|
||||||
@@ -17,6 +22,11 @@ if (PHP_OS_FAMILY === 'Windows' && Phar::running()) {
|
|||||||
exec('CHCP 65001');
|
exec('CHCP 65001');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Print deprecation notice on PHP < 8.4, use red and highlight background
|
||||||
|
if (PHP_VERSION_ID < 80400) {
|
||||||
|
echo "\e[43mDeprecation Notice: PHP < 8.4 is deprecated, please upgrade your PHP version.\e[0m\n";
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
(new ConsoleApplication())->run();
|
(new ConsoleApplication())->run();
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
|
|||||||
@@ -1,11 +1,14 @@
|
|||||||
#!/usr/bin/env sh
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
# This file is using docker to run commands
|
# This file is using docker to run commands
|
||||||
|
SPC_DOCKER_VERSION=v5
|
||||||
|
|
||||||
# Detect docker can run
|
# Detect docker can run
|
||||||
if ! which docker >/dev/null; then
|
if ! which docker >/dev/null; then
|
||||||
echo "Docker is not installed, please install docker first !"
|
echo "Docker is not installed, please install docker first !"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
DOCKER_EXECUTABLE="docker"
|
DOCKER_EXECUTABLE="docker"
|
||||||
# shellcheck disable=SC2046
|
# shellcheck disable=SC2046
|
||||||
@@ -21,27 +24,48 @@ if [ $(id -u) -ne 0 ]; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Convert uname to gnu arch
|
||||||
|
CURRENT_ARCH=$(uname -m)
|
||||||
# to check if qemu-docker run
|
if [ "$CURRENT_ARCH" = "arm64" ]; then
|
||||||
if [ "$SPC_USE_ARCH" = "" ]; then
|
CURRENT_ARCH=aarch64
|
||||||
SPC_USE_ARCH=x86_64
|
|
||||||
fi
|
fi
|
||||||
|
if [ -z "$SPC_USE_ARCH" ]; then
|
||||||
|
SPC_USE_ARCH=$CURRENT_ARCH
|
||||||
|
fi
|
||||||
|
# parse SPC_USE_ARCH
|
||||||
case $SPC_USE_ARCH in
|
case $SPC_USE_ARCH in
|
||||||
x86_64)
|
x86_64|amd64)
|
||||||
ALPINE_FROM=alpine:edge
|
SPC_USE_ARCH=x86_64
|
||||||
|
if [ "$CURRENT_ARCH" != "x86_64" ]; then
|
||||||
|
PLATFORM_ARG="--platform linux/amd64"
|
||||||
|
ALPINE_FROM=multiarch/alpine:x86_64-edge
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
aarch64)
|
aarch64|arm64)
|
||||||
ALPINE_FROM=multiarch/alpine:aarch64-edge
|
SPC_USE_ARCH=aarch64
|
||||||
# shellcheck disable=SC2039
|
if [ "$CURRENT_ARCH" != "aarch64" ]; then
|
||||||
echo -e "\e[033m* Using different arch needs to setup qemu-static for docker !\e[0m"
|
PLATFORM_ARG="--platform linux/arm64"
|
||||||
$DOCKER_EXECUTABLE run --rm --privileged multiarch/qemu-user-static:register --reset > /dev/null
|
ALPINE_FROM=multiarch/alpine:aarch64-edge
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "Current arch is not supported to run in docker: $SPC_USE_ARCH"
|
echo "Current arch is not supported to run in docker: $SPC_USE_ARCH"
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
# if ALPINE_FROM is not set, use alpine:3.21
|
||||||
|
if [ -z "$ALPINE_FROM" ]; then
|
||||||
|
ALPINE_FROM=alpine:3.21
|
||||||
|
fi
|
||||||
|
if [ "$SPC_USE_ARCH" != "$CURRENT_ARCH" ]; then
|
||||||
|
echo "* Using different arch needs to setup qemu-static for docker !"
|
||||||
|
ALPINE_FROM=multiarch/alpine:$SPC_USE_ARCH-edge
|
||||||
|
if [ "$(uname -s)" = "Linux" ]; then
|
||||||
|
$DOCKER_EXECUTABLE run --rm --privileged multiarch/qemu-user-static:register --reset > /dev/null
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
ALPINE_FROM=alpine:3.21
|
||||||
|
fi
|
||||||
|
|
||||||
if [ "$SPC_USE_MIRROR" = "yes" ]; then
|
if [ "$SPC_USE_MIRROR" = "yes" ]; then
|
||||||
SPC_USE_MIRROR="RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories"
|
SPC_USE_MIRROR="RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories"
|
||||||
@@ -50,9 +74,9 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Detect docker env is setup
|
# Detect docker env is setup
|
||||||
if ! $DOCKER_EXECUTABLE images | grep -q cwcc-spc-$SPC_USE_ARCH; then
|
if ! $DOCKER_EXECUTABLE images | grep -q cwcc-spc-$SPC_USE_ARCH-$SPC_DOCKER_VERSION; then
|
||||||
echo "Docker container does not exist. Building docker image ..."
|
echo "Docker container does not exist. Building docker image ..."
|
||||||
$DOCKER_EXECUTABLE build -t cwcc-spc-$SPC_USE_ARCH -f- . <<EOF
|
$DOCKER_EXECUTABLE build $PLATFORM_ARG -t cwcc-spc-$SPC_USE_ARCH-$SPC_DOCKER_VERSION -f- . <<EOF
|
||||||
FROM $ALPINE_FROM
|
FROM $ALPINE_FROM
|
||||||
$SPC_USE_MIRROR
|
$SPC_USE_MIRROR
|
||||||
RUN apk update; \
|
RUN apk update; \
|
||||||
@@ -79,26 +103,25 @@ RUN apk update; \
|
|||||||
linux-headers \
|
linux-headers \
|
||||||
m4 \
|
m4 \
|
||||||
make \
|
make \
|
||||||
php82 \
|
|
||||||
php82-common \
|
|
||||||
php82-pcntl \
|
|
||||||
php82-phar \
|
|
||||||
php82-posix \
|
|
||||||
php82-sodium \
|
|
||||||
php82-tokenizer \
|
|
||||||
php82-dom \
|
|
||||||
php82-xml \
|
|
||||||
php82-xmlwriter \
|
|
||||||
composer \
|
|
||||||
pkgconfig \
|
pkgconfig \
|
||||||
|
re2c \
|
||||||
wget \
|
wget \
|
||||||
xz
|
xz \
|
||||||
|
gettext-dev \
|
||||||
|
binutils-gold \
|
||||||
|
patchelf
|
||||||
|
|
||||||
|
RUN curl -#fSL https://dl.static-php.dev/static-php-cli/bulk/php-8.4.4-cli-linux-\$(uname -m).tar.gz | tar -xz -C /usr/local/bin && \
|
||||||
|
chmod +x /usr/local/bin/php
|
||||||
|
|
||||||
|
RUN curl -#fSL https://getcomposer.org/download/latest-stable/composer.phar -o /usr/local/bin/composer && \
|
||||||
|
chmod +x /usr/local/bin/composer
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
ADD ./src /app/src
|
ADD ./src /app/src
|
||||||
COPY ./composer.* /app/
|
COPY ./composer.* /app/
|
||||||
ADD ./bin /app/bin
|
ADD ./bin /app/bin
|
||||||
RUN composer install --no-dev --classmap-authoritative
|
RUN composer install --no-dev
|
||||||
EOF
|
EOF
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -119,9 +142,37 @@ MOUNT_LIST="$MOUNT_LIST -v ""$(pwd)""/source:/app/source"
|
|||||||
MOUNT_LIST="$MOUNT_LIST -v ""$(pwd)""/dist:/app/dist"
|
MOUNT_LIST="$MOUNT_LIST -v ""$(pwd)""/dist:/app/dist"
|
||||||
MOUNT_LIST="$MOUNT_LIST -v ""$(pwd)""/downloads:/app/downloads"
|
MOUNT_LIST="$MOUNT_LIST -v ""$(pwd)""/downloads:/app/downloads"
|
||||||
MOUNT_LIST="$MOUNT_LIST -v ""$(pwd)""/pkgroot:/app/pkgroot"
|
MOUNT_LIST="$MOUNT_LIST -v ""$(pwd)""/pkgroot:/app/pkgroot"
|
||||||
|
if [ -f "$(pwd)/craft.yml" ]; then
|
||||||
|
MOUNT_LIST="$MOUNT_LIST -v ""$(pwd)""/craft.yml:/app/craft.yml"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Environment variable passthrough
|
||||||
|
ENV_LIST=""
|
||||||
|
ENV_LIST="$ENV_LIST -e SPC_FIX_DEPLOY_ROOT="$(pwd)""
|
||||||
|
if [ ! -z "$GITHUB_TOKEN" ]; then
|
||||||
|
ENV_LIST="$ENV_LIST -e GITHUB_TOKEN=$GITHUB_TOKEN"
|
||||||
|
fi
|
||||||
|
|
||||||
# Run docker
|
# Run docker
|
||||||
# shellcheck disable=SC2068
|
# shellcheck disable=SC2068
|
||||||
# shellcheck disable=SC2086
|
# shellcheck disable=SC2086
|
||||||
# shellcheck disable=SC2090
|
# shellcheck disable=SC2090
|
||||||
$DOCKER_EXECUTABLE run --rm $INTERACT -e SPC_FIX_DEPLOY_ROOT="$(pwd)" $MOUNT_LIST cwcc-spc-$SPC_USE_ARCH bin/spc $@
|
if [ "$SPC_DOCKER_DEBUG" = "yes" ]; then
|
||||||
|
echo "* Debug mode enabled, run docker in interactive mode."
|
||||||
|
echo "* You can use 'exit' to exit the docker container."
|
||||||
|
echo "* You can use 'bin/spc' like normal builds."
|
||||||
|
echo "*"
|
||||||
|
echo "* Mounted directories:"
|
||||||
|
echo "* ./config: $(pwd)/config"
|
||||||
|
echo "* ./src: $(pwd)/src"
|
||||||
|
echo "* ./buildroot: $(pwd)/buildroot"
|
||||||
|
echo "* ./source: $(pwd)/source"
|
||||||
|
echo "* ./dist: $(pwd)/dist"
|
||||||
|
echo "* ./downloads: $(pwd)/downloads"
|
||||||
|
echo "* ./pkgroot: $(pwd)/pkgroot"
|
||||||
|
echo "*"
|
||||||
|
set -ex
|
||||||
|
$DOCKER_EXECUTABLE run $PLATFORM_ARG --rm $INTERACT $ENV_LIST $MOUNT_LIST cwcc-spc-$SPC_USE_ARCH-$SPC_DOCKER_VERSION /bin/bash
|
||||||
|
else
|
||||||
|
$DOCKER_EXECUTABLE run $PLATFORM_ARG --rm $INTERACT $ENV_LIST $MOUNT_LIST cwcc-spc-$SPC_USE_ARCH-$SPC_DOCKER_VERSION bin/spc $@
|
||||||
|
fi
|
||||||
|
|||||||
193
bin/spc-gnu-docker
Executable file
193
bin/spc-gnu-docker
Executable file
@@ -0,0 +1,193 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# This file is using docker to run commands
|
||||||
|
SPC_DOCKER_VERSION=v5
|
||||||
|
|
||||||
|
# Detect docker can run
|
||||||
|
if ! which docker >/dev/null; then
|
||||||
|
echo "Docker is not installed, please install docker first !"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
DOCKER_EXECUTABLE="docker"
|
||||||
|
# shellcheck disable=SC2046
|
||||||
|
if [ $(id -u) -ne 0 ]; then
|
||||||
|
if ! docker info > /dev/null 2>&1; then
|
||||||
|
if [ "$SPC_USE_SUDO" != "yes" ] && [ "$SPC_DOCKER_DEBUG" != "yes" ]; then
|
||||||
|
echo "Docker command requires sudo"
|
||||||
|
# shellcheck disable=SC2039
|
||||||
|
echo -n 'To use sudo to run docker, run "export SPC_USE_SUDO=yes" and run command again'
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
DOCKER_EXECUTABLE="sudo docker"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Convert uname to gnu arch
|
||||||
|
CURRENT_ARCH=$(uname -m)
|
||||||
|
if [ "$CURRENT_ARCH" = "arm64" ]; then
|
||||||
|
CURRENT_ARCH=aarch64
|
||||||
|
fi
|
||||||
|
if [ -z "$SPC_USE_ARCH" ]; then
|
||||||
|
SPC_USE_ARCH=$CURRENT_ARCH
|
||||||
|
fi
|
||||||
|
# parse SPC_USE_ARCH
|
||||||
|
case $SPC_USE_ARCH in
|
||||||
|
x86_64|amd64)
|
||||||
|
SPC_USE_ARCH=x86_64
|
||||||
|
SPC_USE_ARCH_DOCKER=amd64
|
||||||
|
if [ "$CURRENT_ARCH" != "x86_64" ]; then
|
||||||
|
PLATFORM_ARG="--platform linux/amd64"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
aarch64|arm64)
|
||||||
|
SPC_USE_ARCH=aarch64
|
||||||
|
SPC_USE_ARCH_DOCKER=arm64
|
||||||
|
if [ "$CURRENT_ARCH" != "aarch64" ]; then
|
||||||
|
PLATFORM_ARG="--platform linux/arm64"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Current arch is not supported to run in docker: $SPC_USE_ARCH"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
# detect if we need to use qemu-static
|
||||||
|
if [ "$SPC_USE_ARCH" != "$CURRENT_ARCH" ]; then
|
||||||
|
if [ "$(uname -s)" = "Linux" ]; then
|
||||||
|
echo "* Using different arch needs to setup qemu-static for docker !"
|
||||||
|
$DOCKER_EXECUTABLE run --rm --privileged multiarch/qemu-user-static --reset -p yes > /dev/null
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Detect docker env is setup
|
||||||
|
if ! $DOCKER_EXECUTABLE images | grep -q cwcc-spc-gnu-$SPC_USE_ARCH-$SPC_DOCKER_VERSION; then
|
||||||
|
echo "Docker container does not exist. Building docker image ..."
|
||||||
|
$DOCKER_EXECUTABLE buildx build $PLATFORM_ARG -t cwcc-spc-gnu-$SPC_USE_ARCH-$SPC_DOCKER_VERSION -f- . <<EOF
|
||||||
|
FROM centos:7
|
||||||
|
RUN sed -i 's/mirror.centos.org/vault.centos.org/g' /etc/yum.repos.d/*.repo && \
|
||||||
|
sed -i 's/^#.*baseurl=http/baseurl=http/g' /etc/yum.repos.d/*.repo && \
|
||||||
|
sed -i 's/^mirrorlist=http/#mirrorlist=http/g' /etc/yum.repos.d/*.repo
|
||||||
|
RUN yum clean all && \
|
||||||
|
yum makecache && \
|
||||||
|
yum update -y && \
|
||||||
|
localedef -c -i en_US -f UTF-8 en_US.UTF-8
|
||||||
|
|
||||||
|
RUN yum install -y centos-release-scl
|
||||||
|
|
||||||
|
RUN if [ "$SPC_USE_ARCH" = "aarch64" ]; then \
|
||||||
|
sed -i 's|mirror.centos.org/centos|vault.centos.org/altarch|g' /etc/yum.repos.d/CentOS-SCLo-scl-rh.repo ; \
|
||||||
|
sed -i 's|mirror.centos.org/centos|vault.centos.org/altarch|g' /etc/yum.repos.d/CentOS-SCLo-scl.repo ; \
|
||||||
|
else \
|
||||||
|
sed -i 's/mirror.centos.org/vault.centos.org/g' /etc/yum.repos.d/*.repo ; \
|
||||||
|
fi
|
||||||
|
RUN sed -i 's/^#.*baseurl=http/baseurl=http/g' /etc/yum.repos.d/*.repo && \
|
||||||
|
sed -i 's/^mirrorlist=http/#mirrorlist=http/g' /etc/yum.repos.d/*.repo && \
|
||||||
|
sed -i 's|http://|https://|g' /etc/yum.repos.d/*.repo
|
||||||
|
|
||||||
|
RUN yum update -y && \
|
||||||
|
yum install -y devtoolset-10-gcc-* devtoolset-10-libatomic-devel
|
||||||
|
RUN echo "source scl_source enable devtoolset-10" >> /etc/bashrc
|
||||||
|
RUN source /etc/bashrc
|
||||||
|
RUN yum install -y which
|
||||||
|
|
||||||
|
RUN curl -fsSL -o patchelf.tgz https://github.com/NixOS/patchelf/releases/download/0.18.0/patchelf-0.18.0-$SPC_USE_ARCH.tar.gz && \
|
||||||
|
mkdir -p /patchelf && \
|
||||||
|
tar -xzf patchelf.tgz -C /patchelf --strip-components=1 && \
|
||||||
|
cp /patchelf/bin/patchelf /usr/bin/
|
||||||
|
|
||||||
|
RUN curl -o cmake.tgz -#fSL https://github.com/Kitware/CMake/releases/download/v3.31.4/cmake-3.31.4-linux-$SPC_USE_ARCH.tar.gz && \
|
||||||
|
mkdir /cmake && \
|
||||||
|
tar -xzf cmake.tgz -C /cmake --strip-components 1
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
COPY ./composer.* /app/
|
||||||
|
ADD ./bin/setup-runtime /app/bin/setup-runtime
|
||||||
|
ADD ./bin/spc /app/bin/spc
|
||||||
|
RUN /app/bin/setup-runtime
|
||||||
|
ADD ./src /app/src
|
||||||
|
RUN /app/bin/php /app/bin/composer install --no-dev
|
||||||
|
ENV SPC_LIBC=glibc
|
||||||
|
ENV PATH="/app/bin:/cmake/bin:/opt/rh/devtoolset-10/root/usr/bin:\$PATH"
|
||||||
|
|
||||||
|
ADD ./config /app/config
|
||||||
|
RUN CC=gcc bin/spc doctor --auto-fix --debug
|
||||||
|
RUN if [ -f /app/buildroot/bin/re2c ]; then \
|
||||||
|
cp /app/buildroot/bin/re2c /usr/local/bin/re2c ;\
|
||||||
|
fi
|
||||||
|
|
||||||
|
RUN curl -o make.tgz -fsSL https://ftp.gnu.org/gnu/make/make-4.4.tar.gz && \
|
||||||
|
tar -zxvf make.tgz && \
|
||||||
|
cd make-4.4 && \
|
||||||
|
./configure && \
|
||||||
|
make && \
|
||||||
|
make install && \
|
||||||
|
ln -sf /usr/local/bin/make /usr/bin/make
|
||||||
|
|
||||||
|
RUN curl -o automake.tgz -fsSL https://ftp.gnu.org/gnu/automake/automake-1.17.tar.xz && \
|
||||||
|
tar -xvf automake.tgz && \
|
||||||
|
cd automake-1.17 && \
|
||||||
|
./configure && \
|
||||||
|
make && \
|
||||||
|
make install && \
|
||||||
|
ln -sf /usr/local/bin/automake /usr/bin/automake
|
||||||
|
EOF
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check if in ci (local terminal can execute with -it)
|
||||||
|
if [ -t 0 ]; then
|
||||||
|
INTERACT=-it
|
||||||
|
else
|
||||||
|
INTERACT=''
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Mounting volumes
|
||||||
|
MOUNT_LIST=""
|
||||||
|
# shellcheck disable=SC2089
|
||||||
|
MOUNT_LIST="$MOUNT_LIST -v ""$(pwd)""/config:/app/config"
|
||||||
|
MOUNT_LIST="$MOUNT_LIST -v ""$(pwd)""/src:/app/src"
|
||||||
|
MOUNT_LIST="$MOUNT_LIST -v ""$(pwd)""/buildroot:/app/buildroot"
|
||||||
|
MOUNT_LIST="$MOUNT_LIST -v ""$(pwd)""/source:/app/source"
|
||||||
|
MOUNT_LIST="$MOUNT_LIST -v ""$(pwd)""/dist:/app/dist"
|
||||||
|
MOUNT_LIST="$MOUNT_LIST -v ""$(pwd)""/downloads:/app/downloads"
|
||||||
|
MOUNT_LIST="$MOUNT_LIST -v ""$(pwd)""/pkgroot:/app/pkgroot"
|
||||||
|
if [ -f "$(pwd)/craft.yml" ]; then
|
||||||
|
MOUNT_LIST="$MOUNT_LIST -v ""$(pwd)""/craft.yml:/app/craft.yml"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Apply env in temp env file
|
||||||
|
echo 'SPC_DEFAULT_C_FLAGS=-fPIC' > /tmp/spc-gnu-docker.env
|
||||||
|
echo 'SPC_LIBC=glibc' >> /tmp/spc-gnu-docker.env
|
||||||
|
|
||||||
|
# Environment variable passthrough
|
||||||
|
ENV_LIST=""
|
||||||
|
ENV_LIST="$ENV_LIST -e SPC_FIX_DEPLOY_ROOT="$(pwd)""
|
||||||
|
if [ ! -z "$GITHUB_TOKEN" ]; then
|
||||||
|
ENV_LIST="$ENV_LIST -e GITHUB_TOKEN=$GITHUB_TOKEN"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Run docker
|
||||||
|
# shellcheck disable=SC2068
|
||||||
|
# shellcheck disable=SC2086
|
||||||
|
# shellcheck disable=SC2090
|
||||||
|
|
||||||
|
if [ "$SPC_DOCKER_DEBUG" = "yes" ]; then
|
||||||
|
echo "* Debug mode enabled, run docker in interactive mode."
|
||||||
|
echo "* You can use 'exit' to exit the docker container."
|
||||||
|
echo "* You can use 'bin/spc' like normal builds."
|
||||||
|
echo "*"
|
||||||
|
echo "* Mounted directories:"
|
||||||
|
echo "* ./config: $(pwd)/config"
|
||||||
|
echo "* ./src: $(pwd)/src"
|
||||||
|
echo "* ./buildroot: $(pwd)/buildroot"
|
||||||
|
echo "* ./source: $(pwd)/source"
|
||||||
|
echo "* ./dist: $(pwd)/dist"
|
||||||
|
echo "* ./downloads: $(pwd)/downloads"
|
||||||
|
echo "* ./pkgroot: $(pwd)/pkgroot"
|
||||||
|
echo "*"
|
||||||
|
set -ex
|
||||||
|
$DOCKER_EXECUTABLE run $PLATFORM_ARG --privileged --rm -it $INTERACT $ENV_LIST --env-file /tmp/spc-gnu-docker.env $MOUNT_LIST cwcc-spc-gnu-$SPC_USE_ARCH-$SPC_DOCKER_VERSION /bin/bash
|
||||||
|
else
|
||||||
|
$DOCKER_EXECUTABLE run $PLATFORM_ARG --rm $INTERACT $ENV_LIST --env-file /tmp/spc-gnu-docker.env $MOUNT_LIST cwcc-spc-gnu-$SPC_USE_ARCH-$SPC_DOCKER_VERSION bin/spc $@
|
||||||
|
fi
|
||||||
@@ -9,19 +9,20 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">= 8.1",
|
"php": ">= 8.3",
|
||||||
"ext-mbstring": "*",
|
"ext-mbstring": "*",
|
||||||
"ext-zlib": "*",
|
"ext-zlib": "*",
|
||||||
"laravel/prompts": "^0.1.12",
|
"laravel/prompts": "^0.1.12",
|
||||||
"symfony/console": "^5.4 || ^6 || ^7",
|
"symfony/console": "^5.4 || ^6 || ^7",
|
||||||
|
"symfony/process": "^7.2",
|
||||||
|
"symfony/yaml": "^7.2",
|
||||||
"zhamao/logger": "^1.0"
|
"zhamao/logger": "^1.0"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"captainhook/captainhook-phar": "^5.23",
|
"captainhook/captainhook-phar": "^5.23",
|
||||||
"captainhook/hook-installer": "^1.0",
|
"captainhook/hook-installer": "^1.0",
|
||||||
"friendsofphp/php-cs-fixer": "^3.25",
|
"friendsofphp/php-cs-fixer": "^3.60",
|
||||||
"humbug/box": "^4.5.0 || ^4.6.0",
|
"humbug/box": "^4.5.0 || ^4.6.0",
|
||||||
"nunomaduro/collision": "^7.8",
|
|
||||||
"phpstan/phpstan": "^1.10",
|
"phpstan/phpstan": "^1.10",
|
||||||
"phpunit/phpunit": "^10.3 || ^9.5"
|
"phpunit/phpunit": "^10.3 || ^9.5"
|
||||||
},
|
},
|
||||||
|
|||||||
3136
composer.lock
generated
3136
composer.lock
generated
File diff suppressed because it is too large
Load Diff
111
config/env.ini
111
config/env.ini
@@ -7,8 +7,12 @@
|
|||||||
;
|
;
|
||||||
; We need to use some pre-defined internal env vars, like `BUILD_ROOT_PATH`, `DOWNLOAD_PATH`, etc.
|
; We need to use some pre-defined internal env vars, like `BUILD_ROOT_PATH`, `DOWNLOAD_PATH`, etc.
|
||||||
; Please note that these vars cannot be defined in this file, they are only be defined before static-php-cli running.
|
; Please note that these vars cannot be defined in this file, they are only be defined before static-php-cli running.
|
||||||
; Here's a list of these pre-defined internal env vars, these vars are only be defined in the static-php-cli build process if not set in the shell environment:
|
|
||||||
;
|
;
|
||||||
|
; Here's a list of env vars, these value cannot be changed anywhere:
|
||||||
|
;
|
||||||
|
; SPC_VERSION: the version of static-php-cli.
|
||||||
|
; WORKING_DIR: the working directory of the build process. (default: `$(pwd)`)
|
||||||
|
; ROOT_DIR: the root directory of static-php-cli. (default: `/path/to/static-php-cli`, when running in phar or micro mode: `phar://path/to/spc.phar`)
|
||||||
; BUILD_ROOT_PATH: the root path of the build process. (default: `$(pwd)/buildroot`)
|
; BUILD_ROOT_PATH: the root path of the build process. (default: `$(pwd)/buildroot`)
|
||||||
; BUILD_INCLUDE_PATH: the path of the include files. (default: `$BUILD_ROOT_PATH/include`)
|
; BUILD_INCLUDE_PATH: the path of the include files. (default: `$BUILD_ROOT_PATH/include`)
|
||||||
; BUILD_LIB_PATH: the path of the lib files. (default: `$BUILD_ROOT_PATH/lib`)
|
; BUILD_LIB_PATH: the path of the lib files. (default: `$BUILD_ROOT_PATH/lib`)
|
||||||
@@ -17,26 +21,19 @@
|
|||||||
; SOURCE_PATH: the path of the source files. (default: `$(pwd)/source`)
|
; SOURCE_PATH: the path of the source files. (default: `$(pwd)/source`)
|
||||||
; DOWNLOAD_PATH: the path of the download files. (default: `$(pwd)/downloads`)
|
; DOWNLOAD_PATH: the path of the download files. (default: `$(pwd)/downloads`)
|
||||||
; CPU_COUNT: the count of the CPU cores. (default: `$(nproc)`)
|
; CPU_COUNT: the count of the CPU cores. (default: `$(nproc)`)
|
||||||
|
; SPC_ARCH: the arch of the current system, for some libraries needed `--host=XXX` args. (default: `$(uname -m)`, e.g. `x86_64`, `aarch64`, `arm64`)
|
||||||
; GNU_ARCH: the GNU arch of the current system. (default: `$(uname -m)`, e.g. `x86_64`, `aarch64`)
|
; GNU_ARCH: the GNU arch of the current system. (default: `$(uname -m)`, e.g. `x86_64`, `aarch64`)
|
||||||
; MAC_ARCH: the MAC arch of the current system. (default: `$(uname -m)`, e.g. `x86_64`, `arm64`)
|
; MAC_ARCH: the MAC arch of the current system. (default: `$(uname -m)`, e.g. `x86_64`, `arm64`)
|
||||||
;
|
;
|
||||||
; Here's a list of env vars, these value cannot be changed anywhere:
|
; * These vars are only be defined in Unix (macOS, Linux, FreeBSD)Builder and cannot be changed anywhere:
|
||||||
;
|
|
||||||
; WORKING_DIR: the working directory of the build process. (default: `$(pwd)`)
|
|
||||||
; ROOT_DIR: the root directory of static-php-cli. (default: `/path/to/static-php-cli`, when running in phar or micro mode: `phar://path/to/spc.phar`)
|
|
||||||
;
|
|
||||||
; * These vars are only be defined in Unix (macOS, Linux, FreeBSD)Builder *
|
|
||||||
; PATH: static-php-cli will add `$BUILD_BIN_PATH` to PATH.
|
; PATH: static-php-cli will add `$BUILD_BIN_PATH` to PATH.
|
||||||
; PKG_CONFIG: static-php-cli will set `$BUILD_BIN_PATH/pkg-config` to PKG_CONFIG.
|
; PKG_CONFIG: static-php-cli will set `$BUILD_BIN_PATH/pkg-config` to PKG_CONFIG.
|
||||||
; PKG_CONFIG_PATH: static-php-cli will set `$BUILD_LIB_PATH/pkgconfig` to PKG_CONFIG_PATH.
|
; PKG_CONFIG_PATH: static-php-cli will set `$BUILD_LIB_PATH/pkgconfig` to PKG_CONFIG_PATH.
|
||||||
; SPC_PHP_DEFAULT_OPTIMIZE_CFLAGS: the default optimization CFLAGS for compiling php. (if --no-strip option is set: `-g -O0`, else: `-g -Os`)
|
|
||||||
;
|
;
|
||||||
; * These vars are only be defined in LinuxBuilder *
|
; * These vars are only be defined in LinuxBuilder and cannot be changed anywhere:
|
||||||
; SPC_LINUX_DEFAULT_CC: the default compiler for linux. (For alpine linux: `gcc`, default: `$GNU_ARCH-linux-musl-gcc`)
|
; SPC_LINUX_DEFAULT_CC: the default compiler for linux. (For alpine linux: `gcc`, default: `$GNU_ARCH-linux-musl-gcc`)
|
||||||
; SPC_LINUX_DEFAULT_CXX: the default c++ compiler for linux. (For alpine linux: `g++`, default: `$GNU_ARCH-linux-musl-g++`)
|
; SPC_LINUX_DEFAULT_CXX: the default c++ compiler for linux. (For alpine linux: `g++`, default: `$GNU_ARCH-linux-musl-g++`)
|
||||||
; SPC_LINUX_DEFAULT_AR: the default archiver for linux. (For alpine linux: `ar`, default: `$GNU_ARCH-linux-musl-ar`)
|
; SPC_LINUX_DEFAULT_AR: the default archiver for linux. (For alpine linux: `ar`, default: `$GNU_ARCH-linux-musl-ar`)
|
||||||
; SPC_PHP_DEFAULT_LD_LIBRARY_PATH_CMD: the default LD_LIBRARY_PATH for php. (linux: `LD_LIBRARY_PATH=/usr/local/musl/$GNU_ARCH-linux-musl/lib`, default: empty)
|
|
||||||
|
|
||||||
|
|
||||||
[global]
|
[global]
|
||||||
; Build concurrency for make -jN, default is CPU_COUNT, this value are used in every libs.
|
; Build concurrency for make -jN, default is CPU_COUNT, this value are used in every libs.
|
||||||
@@ -45,8 +42,23 @@ SPC_CONCURRENCY=${CPU_COUNT}
|
|||||||
SPC_SKIP_PHP_VERSION_CHECK="no"
|
SPC_SKIP_PHP_VERSION_CHECK="no"
|
||||||
; Ignore some check item for bin/spc doctor command, comma separated (e.g. SPC_SKIP_DOCTOR_CHECK_ITEMS="if homebrew has installed")
|
; Ignore some check item for bin/spc doctor command, comma separated (e.g. SPC_SKIP_DOCTOR_CHECK_ITEMS="if homebrew has installed")
|
||||||
SPC_SKIP_DOCTOR_CHECK_ITEMS=""
|
SPC_SKIP_DOCTOR_CHECK_ITEMS=""
|
||||||
|
; extra modules that xcaddy will include in the FrankenPHP build
|
||||||
|
SPC_CMD_VAR_FRANKENPHP_XCADDY_MODULES="--with github.com/dunglas/frankenphp/caddy --with github.com/dunglas/mercure/caddy --with github.com/dunglas/vulcain/caddy --with github.com/dunglas/caddy-cbrotli"
|
||||||
|
; The display message for php version output (PHP >= 8.4 available)
|
||||||
|
PHP_BUILD_PROVIDER="static-php-cli ${SPC_VERSION}"
|
||||||
|
|
||||||
|
; EXTENSION_DIR where the built php will look for extension when a .ini instructs to load them
|
||||||
|
; only useful for builds targeting not pure-static linking
|
||||||
|
; default paths
|
||||||
|
; Ubuntu/Debian: /usr/lib/php/{PHP_VERSION}/
|
||||||
|
; RHEL: /usr/lib64/php/modules
|
||||||
|
; Alpine: /usr/lib/php{PHP_VERSION}/modules
|
||||||
|
; where {PHP_VERSION} is 84 for php 8.4
|
||||||
|
; EXTENSION_DIR=
|
||||||
|
|
||||||
[windows]
|
[windows]
|
||||||
|
; build target: win7-static
|
||||||
|
SPC_TARGET=native-windows
|
||||||
; php-sdk-binary-tools path
|
; php-sdk-binary-tools path
|
||||||
PHP_SDK_PATH="${WORKING_DIR}\php-sdk-binary-tools"
|
PHP_SDK_PATH="${WORKING_DIR}\php-sdk-binary-tools"
|
||||||
; upx executable path
|
; upx executable path
|
||||||
@@ -55,58 +67,69 @@ UPX_EXEC="${PKG_ROOT_PATH}\bin\upx.exe"
|
|||||||
SPC_MICRO_PATCHES=static_extensions_win32,cli_checks,disable_huge_page,vcruntime140,win32,zend_stream,cli_static
|
SPC_MICRO_PATCHES=static_extensions_win32,cli_checks,disable_huge_page,vcruntime140,win32,zend_stream,cli_static
|
||||||
|
|
||||||
[linux]
|
[linux]
|
||||||
; include PATH for musl libc.
|
; Linux can use different build toolchains.
|
||||||
SPC_NO_MUSL_PATH=no
|
; - musl (default, when SPC_LIBC=musl): used for general linux distros, can build `musl` (statically linked) only.
|
||||||
|
; - zig (will become default): usable on all Linux distros, can build `-musl`, `arch-linux-musl -dynamic` and `arch-linux-gnu` targets. Can specify version such as `x86_64-linux-gnu.2.17`.
|
||||||
|
; - musl-native: used for alpine linux, can build `musl` and `musl -dynamic` target.
|
||||||
|
; - gnu-native: used for general linux distros, can build gnu target for the installed glibc version only.
|
||||||
|
|
||||||
|
; LEGACY option to specify the target
|
||||||
|
SPC_LIBC=musl
|
||||||
|
|
||||||
|
; Recommended: specify your target here. Zig toolchain will be used.
|
||||||
|
; examples:
|
||||||
|
; `native-native-gnu` - links against glibc, current OS version
|
||||||
|
; `native-native-gnu.2.17` - links against glibc, version 2.17
|
||||||
|
; `native-native` - links against system libc dynamically
|
||||||
|
; `native-native-musl` - links against musl libc statically
|
||||||
|
; `native-native-musl -dynamic` - links against musl libc dynamically
|
||||||
|
; SPC_TARGET=
|
||||||
|
|
||||||
; compiler environments
|
; compiler environments
|
||||||
CC=${SPC_LINUX_DEFAULT_CC}
|
CC=${SPC_LINUX_DEFAULT_CC}
|
||||||
CXX=${SPC_LINUX_DEFAULT_CXX}
|
CXX=${SPC_LINUX_DEFAULT_CXX}
|
||||||
AR=${SPC_LINUX_DEFAULT_AR}
|
AR=${SPC_LINUX_DEFAULT_AR}
|
||||||
LD=ld.gold
|
LD=${SPC_LINUX_DEFAULT_LD}
|
||||||
; default compiler flags, used in CMake toolchain file, openssl and pkg-config build
|
; default compiler flags, used in CMake toolchain file, openssl and pkg-config build
|
||||||
SPC_DEFAULT_C_FLAGS=
|
SPC_DEFAULT_C_FLAGS="-fPIC -Os"
|
||||||
SPC_DEFAULT_CXX_FLAGS=
|
SPC_DEFAULT_CXX_FLAGS="-fPIC -Os"
|
||||||
; extra libs for building php executable, used in `make` command for building php (this value may changed by extension build process, space separated)
|
SPC_DEFAULT_LD_FLAGS=""
|
||||||
SPC_EXTRA_LIBS=
|
|
||||||
; upx executable path
|
; upx executable path
|
||||||
UPX_EXEC=${PKG_ROOT_PATH}/bin/upx
|
UPX_EXEC=${PKG_ROOT_PATH}/bin/upx
|
||||||
; phpmicro patches, for more info, see: https://github.com/easysoft/phpmicro/tree/master/patches
|
; phpmicro patches, for more info, see: https://github.com/easysoft/phpmicro/tree/master/patches
|
||||||
SPC_MICRO_PATCHES=static_extensions_win32,cli_checks,disable_huge_page,vcruntime140,win32,zend_stream
|
SPC_MICRO_PATCHES=cli_checks,disable_huge_page
|
||||||
|
|
||||||
; *** default build command for building php ***
|
; *** default build command for building php ***
|
||||||
; buildconf command
|
; buildconf command
|
||||||
SPC_CMD_PREFIX_PHP_BUILDCONF="./buildconf --force"
|
SPC_CMD_PREFIX_PHP_BUILDCONF="./buildconf --force"
|
||||||
; configure command
|
; configure command
|
||||||
SPC_CMD_PREFIX_PHP_CONFIGURE="${SPC_PHP_DEFAULT_LD_LIBRARY_PATH_CMD} ./configure --prefix= --with-valgrind=no --enable-shared=no --enable-static=yes --disable-all --disable-cgi --disable-phpdbg"
|
SPC_CMD_PREFIX_PHP_CONFIGURE="./configure --prefix= --with-valgrind=no --disable-shared --enable-static --disable-all --disable-cgi --disable-phpdbg --with-pic"
|
||||||
; make command
|
; make command
|
||||||
SPC_CMD_PREFIX_PHP_MAKE="make -j${CPU_COUNT}"
|
SPC_CMD_PREFIX_PHP_MAKE="make -j${SPC_CONCURRENCY}"
|
||||||
|
|
||||||
; *** default build vars for building php ***
|
; *** default build vars for building php ***
|
||||||
|
; embed type for php, static (libphp.a) or shared (libphp.so)
|
||||||
|
SPC_CMD_VAR_PHP_EMBED_TYPE="static"
|
||||||
; CFLAGS for configuring php
|
; CFLAGS for configuring php
|
||||||
SPC_CMD_VAR_PHP_CONFIGURE_CFLAGS="${SPC_DEFAULT_C_FLAGS}"
|
SPC_CMD_VAR_PHP_CONFIGURE_CFLAGS="${SPC_DEFAULT_C_FLAGS} -fPIE"
|
||||||
; CPPFLAGS for configuring php
|
|
||||||
SPC_CMD_VAR_PHP_CONFIGURE_CPPFLAGS="-I${BUILD_INCLUDE_PATH}"
|
|
||||||
; LDFLAGS for configuring php
|
|
||||||
SPC_CMD_VAR_PHP_CONFIGURE_LDFLAGS="-L${BUILD_LIB_PATH}"
|
|
||||||
; LIBS for configuring php
|
|
||||||
SPC_CMD_VAR_PHP_CONFIGURE_LIBS="-ldl -lpthread -lm"
|
|
||||||
; EXTRA_CFLAGS for `make` php
|
; EXTRA_CFLAGS for `make` php
|
||||||
SPC_CMD_VAR_PHP_MAKE_EXTRA_CFLAGS="${SPC_PHP_DEFAULT_OPTIMIZE_CFLAGS} -fno-ident -fPIE"
|
SPC_CMD_VAR_PHP_MAKE_EXTRA_CFLAGS="-g -fstack-protector-strong -fno-ident -fPIE ${SPC_DEFAULT_C_FLAGS}"
|
||||||
; EXTRA_LIBS for `make` php
|
; EXTRA_LDFLAGS for `make` php, can use -release to set a soname for libphp.so
|
||||||
SPC_CMD_VAR_PHP_MAKE_EXTRA_LIBS=""
|
SPC_CMD_VAR_PHP_MAKE_EXTRA_LDFLAGS=""
|
||||||
; EXTRA_LDFLAGS_PROGRAM for `make` php
|
|
||||||
SPC_CMD_VAR_PHP_MAKE_EXTRA_LDFLAGS_PROGRAM="-all-static -Wl,-O1 -pie"
|
|
||||||
|
|
||||||
[macos]
|
[macos]
|
||||||
|
; build target: macho or macho (possibly we could support macho-universal in the future)
|
||||||
|
; Currently we do not support universal and cross-compilation for macOS.
|
||||||
|
SPC_TARGET=native-macos
|
||||||
; compiler environments
|
; compiler environments
|
||||||
CC=clang
|
CC=clang
|
||||||
CXX=clang++
|
CXX=clang++
|
||||||
; default compiler flags, used in CMake toolchain file, openssl and pkg-config build
|
; default compiler flags, used in CMake toolchain file, openssl and pkg-config build
|
||||||
SPC_DEFAULT_C_FLAGS="--target=${MAC_ARCH}-apple-darwin"
|
SPC_DEFAULT_C_FLAGS="--target=${MAC_ARCH}-apple-darwin -Os"
|
||||||
SPC_DEFAULT_CXX_FLAGS="--target=${MAC_ARCH}-apple-darwin"
|
SPC_DEFAULT_CXX_FLAGS="--target=${MAC_ARCH}-apple-darwin -Os"
|
||||||
; extra libs for building php executable, used in `make` command for building php (this value may changed by extension build process, space separated)
|
SPC_DEFAULT_LD_FLAGS=""
|
||||||
SPC_EXTRA_LIBS=
|
|
||||||
; phpmicro patches, for more info, see: https://github.com/easysoft/phpmicro/tree/master/patches
|
; phpmicro patches, for more info, see: https://github.com/easysoft/phpmicro/tree/master/patches
|
||||||
SPC_MICRO_PATCHES=static_extensions_win32,cli_checks,disable_huge_page,vcruntime140,win32,zend_stream,macos_iconv
|
SPC_MICRO_PATCHES=cli_checks,macos_iconv
|
||||||
|
|
||||||
; *** default build command for building php ***
|
; *** default build command for building php ***
|
||||||
; buildconf command
|
; buildconf command
|
||||||
@@ -114,19 +137,15 @@ SPC_CMD_PREFIX_PHP_BUILDCONF="./buildconf --force"
|
|||||||
; configure command
|
; configure command
|
||||||
SPC_CMD_PREFIX_PHP_CONFIGURE="./configure --prefix= --with-valgrind=no --enable-shared=no --enable-static=yes --disable-all --disable-cgi --disable-phpdbg"
|
SPC_CMD_PREFIX_PHP_CONFIGURE="./configure --prefix= --with-valgrind=no --enable-shared=no --enable-static=yes --disable-all --disable-cgi --disable-phpdbg"
|
||||||
; make command
|
; make command
|
||||||
SPC_CMD_PREFIX_PHP_MAKE="make -j${CPU_COUNT}"
|
SPC_CMD_PREFIX_PHP_MAKE="make -j${SPC_CONCURRENCY}"
|
||||||
|
|
||||||
; *** default build vars for building php ***
|
; *** default build vars for building php ***
|
||||||
|
; embed type for php, static (libphp.a) or shared (libphp.dylib)
|
||||||
|
SPC_CMD_VAR_PHP_EMBED_TYPE="static"
|
||||||
; CFLAGS for configuring php
|
; CFLAGS for configuring php
|
||||||
SPC_CMD_VAR_PHP_CONFIGURE_CFLAGS="${SPC_DEFAULT_C_FLAGS} -Werror=unknown-warning-option"
|
SPC_CMD_VAR_PHP_CONFIGURE_CFLAGS="${SPC_DEFAULT_C_FLAGS} -Werror=unknown-warning-option"
|
||||||
; CPPFLAGS for configuring php
|
|
||||||
SPC_CMD_VAR_PHP_CONFIGURE_CPPFLAGS="-I${BUILD_INCLUDE_PATH}"
|
|
||||||
; LDFLAGS for configuring php
|
|
||||||
SPC_CMD_VAR_PHP_CONFIGURE_LDFLAGS="-L${BUILD_LIB_PATH}"
|
|
||||||
; EXTRA_CFLAGS for `make` php
|
; EXTRA_CFLAGS for `make` php
|
||||||
SPC_CMD_VAR_PHP_MAKE_EXTRA_CFLAGS="${SPC_PHP_DEFAULT_OPTIMIZE_CFLAGS}"
|
SPC_CMD_VAR_PHP_MAKE_EXTRA_CFLAGS="-g -fstack-protector-strong -fpic -fpie ${SPC_DEFAULT_C_FLAGS}"
|
||||||
; EXTRA_LIBS for `make` php
|
|
||||||
SPC_CMD_VAR_PHP_MAKE_EXTRA_LIBS="-lresolv"
|
|
||||||
|
|
||||||
[freebsd]
|
[freebsd]
|
||||||
; compiler environments
|
; compiler environments
|
||||||
|
|||||||
206
config/ext.json
206
config/ext.json
@@ -24,9 +24,17 @@
|
|||||||
"bcmath": {
|
"bcmath": {
|
||||||
"type": "builtin"
|
"type": "builtin"
|
||||||
},
|
},
|
||||||
|
"brotli": {
|
||||||
|
"type": "external",
|
||||||
|
"source": "ext-brotli",
|
||||||
|
"arg-type": "enable",
|
||||||
|
"lib-depends": [
|
||||||
|
"brotli"
|
||||||
|
]
|
||||||
|
},
|
||||||
"bz2": {
|
"bz2": {
|
||||||
"type": "builtin",
|
"type": "builtin",
|
||||||
"arg-type-unix": "with-prefix",
|
"arg-type-unix": "with-path",
|
||||||
"arg-type-windows": "with",
|
"arg-type-windows": "with",
|
||||||
"lib-depends": [
|
"lib-depends": [
|
||||||
"bzip2"
|
"bzip2"
|
||||||
@@ -92,6 +100,14 @@
|
|||||||
},
|
},
|
||||||
"type": "wip"
|
"type": "wip"
|
||||||
},
|
},
|
||||||
|
"ev": {
|
||||||
|
"type": "external",
|
||||||
|
"source": "ev",
|
||||||
|
"arg-type-windows": "with",
|
||||||
|
"ext-depends": [
|
||||||
|
"sockets"
|
||||||
|
]
|
||||||
|
},
|
||||||
"event": {
|
"event": {
|
||||||
"support": {
|
"support": {
|
||||||
"Windows": "wip",
|
"Windows": "wip",
|
||||||
@@ -116,7 +132,7 @@
|
|||||||
},
|
},
|
||||||
"ffi": {
|
"ffi": {
|
||||||
"support": {
|
"support": {
|
||||||
"Linux": "no",
|
"Linux": "partial",
|
||||||
"BSD": "wip"
|
"BSD": "wip"
|
||||||
},
|
},
|
||||||
"notes": true,
|
"notes": true,
|
||||||
@@ -169,7 +185,7 @@
|
|||||||
"BSD": "wip"
|
"BSD": "wip"
|
||||||
},
|
},
|
||||||
"type": "builtin",
|
"type": "builtin",
|
||||||
"arg-type": "with-prefix",
|
"arg-type": "with-path",
|
||||||
"lib-depends": [
|
"lib-depends": [
|
||||||
"gettext"
|
"gettext"
|
||||||
]
|
]
|
||||||
@@ -195,7 +211,7 @@
|
|||||||
"BSD": "wip"
|
"BSD": "wip"
|
||||||
},
|
},
|
||||||
"type": "builtin",
|
"type": "builtin",
|
||||||
"arg-type": "with-prefix",
|
"arg-type": "with-path",
|
||||||
"lib-depends": [
|
"lib-depends": [
|
||||||
"gmp"
|
"gmp"
|
||||||
]
|
]
|
||||||
@@ -217,7 +233,7 @@
|
|||||||
},
|
},
|
||||||
"type": "external",
|
"type": "external",
|
||||||
"source": "grpc",
|
"source": "grpc",
|
||||||
"arg-type-unix": "custom",
|
"arg-type-unix": "enable-path",
|
||||||
"cpp-extension": true,
|
"cpp-extension": true,
|
||||||
"lib-depends": [
|
"lib-depends": [
|
||||||
"grpc"
|
"grpc"
|
||||||
@@ -228,7 +244,7 @@
|
|||||||
"BSD": "wip"
|
"BSD": "wip"
|
||||||
},
|
},
|
||||||
"type": "builtin",
|
"type": "builtin",
|
||||||
"arg-type": "with-prefix",
|
"arg-type": "with-path",
|
||||||
"arg-type-windows": "with",
|
"arg-type-windows": "with",
|
||||||
"lib-depends-unix": [
|
"lib-depends-unix": [
|
||||||
"libiconv"
|
"libiconv"
|
||||||
@@ -253,6 +269,7 @@
|
|||||||
"Windows": "wip",
|
"Windows": "wip",
|
||||||
"BSD": "wip"
|
"BSD": "wip"
|
||||||
},
|
},
|
||||||
|
"notes": true,
|
||||||
"type": "external",
|
"type": "external",
|
||||||
"source": "ext-imagick",
|
"source": "ext-imagick",
|
||||||
"arg-type": "custom",
|
"arg-type": "custom",
|
||||||
@@ -287,12 +304,14 @@
|
|||||||
},
|
},
|
||||||
"intl": {
|
"intl": {
|
||||||
"support": {
|
"support": {
|
||||||
"Windows": "no",
|
|
||||||
"BSD": "wip"
|
"BSD": "wip"
|
||||||
},
|
},
|
||||||
"type": "builtin",
|
"type": "builtin",
|
||||||
"lib-depends": [
|
"lib-depends-unix": [
|
||||||
"icu"
|
"icu"
|
||||||
|
],
|
||||||
|
"lib-depends-windows": [
|
||||||
|
"icu-static-win"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"ldap": {
|
"ldap": {
|
||||||
@@ -301,7 +320,7 @@
|
|||||||
"BSD": "wip"
|
"BSD": "wip"
|
||||||
},
|
},
|
||||||
"type": "builtin",
|
"type": "builtin",
|
||||||
"arg-type": "with-prefix",
|
"arg-type": "with-path",
|
||||||
"lib-depends": [
|
"lib-depends": [
|
||||||
"ldap"
|
"ldap"
|
||||||
],
|
],
|
||||||
@@ -321,11 +340,29 @@
|
|||||||
"arg-type": "none",
|
"arg-type": "none",
|
||||||
"ext-depends": [
|
"ext-depends": [
|
||||||
"xml"
|
"xml"
|
||||||
|
],
|
||||||
|
"target": [
|
||||||
|
"static"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"lz4": {
|
||||||
|
"support": {
|
||||||
|
"Windows": "wip",
|
||||||
|
"BSD": "wip"
|
||||||
|
},
|
||||||
|
"type": "external",
|
||||||
|
"source": "ext-lz4",
|
||||||
|
"arg-type": "custom",
|
||||||
|
"lib-depends": [
|
||||||
|
"liblz4"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"mbregex": {
|
"mbregex": {
|
||||||
"type": "builtin",
|
"type": "builtin",
|
||||||
"arg-type": "custom",
|
"arg-type": "custom",
|
||||||
|
"target": [
|
||||||
|
"static"
|
||||||
|
],
|
||||||
"ext-depends": [
|
"ext-depends": [
|
||||||
"mbstring"
|
"mbstring"
|
||||||
],
|
],
|
||||||
@@ -355,18 +392,16 @@
|
|||||||
"type": "external",
|
"type": "external",
|
||||||
"source": "ext-memcache",
|
"source": "ext-memcache",
|
||||||
"arg-type": "custom",
|
"arg-type": "custom",
|
||||||
"lib-depends": [
|
|
||||||
"zlib"
|
|
||||||
],
|
|
||||||
"ext-depends": [
|
"ext-depends": [
|
||||||
|
"zlib",
|
||||||
"session"
|
"session"
|
||||||
]
|
],
|
||||||
|
"build-with-php": true
|
||||||
},
|
},
|
||||||
"memcached": {
|
"memcached": {
|
||||||
"support": {
|
"support": {
|
||||||
"Windows": "wip",
|
"Windows": "wip",
|
||||||
"BSD": "wip",
|
"BSD": "wip"
|
||||||
"Linux": "no"
|
|
||||||
},
|
},
|
||||||
"type": "external",
|
"type": "external",
|
||||||
"source": "memcached",
|
"source": "memcached",
|
||||||
@@ -375,6 +410,10 @@
|
|||||||
"lib-depends": [
|
"lib-depends": [
|
||||||
"libmemcached"
|
"libmemcached"
|
||||||
],
|
],
|
||||||
|
"lib-depends-unix": [
|
||||||
|
"libmemcached",
|
||||||
|
"fastlz"
|
||||||
|
],
|
||||||
"ext-depends": [
|
"ext-depends": [
|
||||||
"session",
|
"session",
|
||||||
"zlib"
|
"zlib"
|
||||||
@@ -393,6 +432,10 @@
|
|||||||
"openssl",
|
"openssl",
|
||||||
"zstd",
|
"zstd",
|
||||||
"zlib"
|
"zlib"
|
||||||
|
],
|
||||||
|
"frameworks": [
|
||||||
|
"CoreFoundation",
|
||||||
|
"Security"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"msgpack": {
|
"msgpack": {
|
||||||
@@ -402,7 +445,10 @@
|
|||||||
"type": "external",
|
"type": "external",
|
||||||
"source": "msgpack",
|
"source": "msgpack",
|
||||||
"arg-type-unix": "with",
|
"arg-type-unix": "with",
|
||||||
"arg-type-win": "enable"
|
"arg-type-win": "enable",
|
||||||
|
"ext-depends": [
|
||||||
|
"session"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"mysqli": {
|
"mysqli": {
|
||||||
"type": "builtin",
|
"type": "builtin",
|
||||||
@@ -428,15 +474,29 @@
|
|||||||
},
|
},
|
||||||
"notes": true
|
"notes": true
|
||||||
},
|
},
|
||||||
|
"odbc": {
|
||||||
|
"support": {
|
||||||
|
"BSD": "wip",
|
||||||
|
"Windows": "wip"
|
||||||
|
},
|
||||||
|
"type": "builtin",
|
||||||
|
"arg-type-unix": "custom",
|
||||||
|
"lib-depends-unix": [
|
||||||
|
"unixodbc"
|
||||||
|
]
|
||||||
|
},
|
||||||
"opcache": {
|
"opcache": {
|
||||||
"type": "builtin",
|
"type": "builtin",
|
||||||
"arg-type-unix": "custom"
|
"arg-type-unix": "custom",
|
||||||
|
"arg-type-windows": "enable",
|
||||||
|
"zend-extension": true
|
||||||
},
|
},
|
||||||
"openssl": {
|
"openssl": {
|
||||||
"notes": true,
|
"notes": true,
|
||||||
"type": "builtin",
|
"type": "builtin",
|
||||||
"arg-type": "custom",
|
"arg-type": "custom",
|
||||||
"arg-type-windows": "with",
|
"arg-type-windows": "with",
|
||||||
|
"build-with-php": true,
|
||||||
"lib-depends": [
|
"lib-depends": [
|
||||||
"openssl",
|
"openssl",
|
||||||
"zlib"
|
"zlib"
|
||||||
@@ -471,9 +531,10 @@
|
|||||||
},
|
},
|
||||||
"notes": true,
|
"notes": true,
|
||||||
"type": "builtin",
|
"type": "builtin",
|
||||||
"arg-type": "with-prefix",
|
"arg-type": "custom",
|
||||||
"lib-depends": [
|
"lib-depends": [
|
||||||
"libargon2"
|
"libargon2",
|
||||||
|
"openssl"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"pcntl": {
|
"pcntl": {
|
||||||
@@ -494,19 +555,36 @@
|
|||||||
"mysqlnd"
|
"mysqlnd"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"pdo_pgsql": {
|
"pdo_odbc": {
|
||||||
"support": {
|
"support": {
|
||||||
"Windows": "wip",
|
|
||||||
"BSD": "wip"
|
"BSD": "wip"
|
||||||
},
|
},
|
||||||
"type": "builtin",
|
"type": "builtin",
|
||||||
"arg-type": "with-prefix",
|
"arg-type": "custom",
|
||||||
|
"lib-depends-unix": [
|
||||||
|
"unixodbc"
|
||||||
|
],
|
||||||
|
"ext-depends": [
|
||||||
|
"pdo",
|
||||||
|
"odbc"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"pdo_pgsql": {
|
||||||
|
"support": {
|
||||||
|
"BSD": "wip"
|
||||||
|
},
|
||||||
|
"type": "builtin",
|
||||||
|
"arg-type": "with-path",
|
||||||
|
"arg-type-windows": "custom",
|
||||||
"ext-depends": [
|
"ext-depends": [
|
||||||
"pdo",
|
"pdo",
|
||||||
"pgsql"
|
"pgsql"
|
||||||
],
|
],
|
||||||
"lib-depends": [
|
"lib-depends-unix": [
|
||||||
"postgresql"
|
"postgresql"
|
||||||
|
],
|
||||||
|
"lib-depends-windows": [
|
||||||
|
"postgresql-win"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"pdo_sqlite": {
|
"pdo_sqlite": {
|
||||||
@@ -537,14 +615,16 @@
|
|||||||
},
|
},
|
||||||
"pgsql": {
|
"pgsql": {
|
||||||
"support": {
|
"support": {
|
||||||
"Windows": "wip",
|
|
||||||
"BSD": "wip"
|
"BSD": "wip"
|
||||||
},
|
},
|
||||||
"notes": true,
|
"notes": true,
|
||||||
"type": "builtin",
|
"type": "builtin",
|
||||||
"arg-type": "custom",
|
"arg-type": "custom",
|
||||||
"lib-depends": [
|
"lib-depends-unix": [
|
||||||
"postgresql"
|
"postgresql"
|
||||||
|
],
|
||||||
|
"lib-depends-windows": [
|
||||||
|
"postgresql-win"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"phar": {
|
"phar": {
|
||||||
@@ -597,9 +677,12 @@
|
|||||||
"BSD": "wip"
|
"BSD": "wip"
|
||||||
},
|
},
|
||||||
"type": "builtin",
|
"type": "builtin",
|
||||||
"arg-type": "with-prefix",
|
"arg-type": "with-path",
|
||||||
"lib-depends": [
|
"lib-depends": [
|
||||||
"readline"
|
"readline"
|
||||||
|
],
|
||||||
|
"target": [
|
||||||
|
"static"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"redis": {
|
"redis": {
|
||||||
@@ -619,10 +702,12 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"session": {
|
"session": {
|
||||||
"type": "builtin"
|
"type": "builtin",
|
||||||
|
"build-with-php": true
|
||||||
},
|
},
|
||||||
"shmop": {
|
"shmop": {
|
||||||
"type": "builtin"
|
"type": "builtin",
|
||||||
|
"build-with-php": true
|
||||||
},
|
},
|
||||||
"simdjson": {
|
"simdjson": {
|
||||||
"type": "external",
|
"type": "external",
|
||||||
@@ -640,7 +725,8 @@
|
|||||||
],
|
],
|
||||||
"ext-depends-windows": [
|
"ext-depends-windows": [
|
||||||
"xml"
|
"xml"
|
||||||
]
|
],
|
||||||
|
"build-with-php": true
|
||||||
},
|
},
|
||||||
"snappy": {
|
"snappy": {
|
||||||
"support": {
|
"support": {
|
||||||
@@ -676,7 +762,6 @@
|
|||||||
},
|
},
|
||||||
"sodium": {
|
"sodium": {
|
||||||
"support": {
|
"support": {
|
||||||
"Windows": "wip",
|
|
||||||
"BSD": "wip"
|
"BSD": "wip"
|
||||||
},
|
},
|
||||||
"type": "builtin",
|
"type": "builtin",
|
||||||
@@ -703,7 +788,7 @@
|
|||||||
"BSD": "wip"
|
"BSD": "wip"
|
||||||
},
|
},
|
||||||
"type": "builtin",
|
"type": "builtin",
|
||||||
"arg-type": "with-prefix",
|
"arg-type": "with-path",
|
||||||
"arg-type-windows": "with",
|
"arg-type-windows": "with",
|
||||||
"lib-depends": [
|
"lib-depends": [
|
||||||
"sqlite"
|
"sqlite"
|
||||||
@@ -729,12 +814,12 @@
|
|||||||
},
|
},
|
||||||
"type": "external",
|
"type": "external",
|
||||||
"source": "ext-ssh2",
|
"source": "ext-ssh2",
|
||||||
"arg-type": "with-prefix",
|
"arg-type": "with-path",
|
||||||
"arg-type-windows": "with",
|
"arg-type-windows": "with",
|
||||||
"lib-depends": [
|
"lib-depends": [
|
||||||
"libssh2"
|
"libssh2"
|
||||||
],
|
],
|
||||||
"ext-depends-windows": [
|
"ext-depends": [
|
||||||
"openssl",
|
"openssl",
|
||||||
"zlib"
|
"zlib"
|
||||||
]
|
]
|
||||||
@@ -855,13 +940,14 @@
|
|||||||
"BSD": "wip"
|
"BSD": "wip"
|
||||||
},
|
},
|
||||||
"type": "builtin",
|
"type": "builtin",
|
||||||
"arg-type": "with-prefix",
|
"arg-type": "with-path",
|
||||||
"lib-depends": [
|
"lib-depends": [
|
||||||
"tidy"
|
"tidy"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"tokenizer": {
|
"tokenizer": {
|
||||||
"type": "builtin"
|
"type": "builtin",
|
||||||
|
"build-with-php": true
|
||||||
},
|
},
|
||||||
"uuid": {
|
"uuid": {
|
||||||
"support": {
|
"support": {
|
||||||
@@ -870,7 +956,7 @@
|
|||||||
},
|
},
|
||||||
"type": "external",
|
"type": "external",
|
||||||
"source": "ext-uuid",
|
"source": "ext-uuid",
|
||||||
"arg-type": "with-prefix",
|
"arg-type": "with-path",
|
||||||
"lib-depends": [
|
"lib-depends": [
|
||||||
"libuuid"
|
"libuuid"
|
||||||
]
|
]
|
||||||
@@ -882,7 +968,7 @@
|
|||||||
},
|
},
|
||||||
"type": "external",
|
"type": "external",
|
||||||
"source": "ext-uv",
|
"source": "ext-uv",
|
||||||
"arg-type": "with-prefix",
|
"arg-type": "with-path",
|
||||||
"lib-depends": [
|
"lib-depends": [
|
||||||
"libuv"
|
"libuv"
|
||||||
],
|
],
|
||||||
@@ -891,14 +977,19 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"xdebug": {
|
"xdebug": {
|
||||||
"type": "builtin",
|
"type": "external",
|
||||||
|
"source": "xdebug",
|
||||||
|
"target": [
|
||||||
|
"shared"
|
||||||
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"Windows": "wip",
|
"Windows": "wip",
|
||||||
"BSD": "no",
|
"BSD": "no",
|
||||||
"Darwin": "no",
|
"Darwin": "partial",
|
||||||
"Linux": "no"
|
"Linux": "partial"
|
||||||
},
|
},
|
||||||
"notes": true
|
"notes": true,
|
||||||
|
"zend-extension": true
|
||||||
},
|
},
|
||||||
"xhprof": {
|
"xhprof": {
|
||||||
"support": {
|
"support": {
|
||||||
@@ -910,11 +1001,11 @@
|
|||||||
"source": "xhprof",
|
"source": "xhprof",
|
||||||
"ext-depends": [
|
"ext-depends": [
|
||||||
"ctype"
|
"ctype"
|
||||||
]
|
],
|
||||||
|
"build-with-php": true
|
||||||
},
|
},
|
||||||
"xlswriter": {
|
"xlswriter": {
|
||||||
"support": {
|
"support": {
|
||||||
"Windows": "wip",
|
|
||||||
"BSD": "wip"
|
"BSD": "wip"
|
||||||
},
|
},
|
||||||
"type": "external",
|
"type": "external",
|
||||||
@@ -941,7 +1032,8 @@
|
|||||||
],
|
],
|
||||||
"ext-depends-windows": [
|
"ext-depends-windows": [
|
||||||
"iconv"
|
"iconv"
|
||||||
]
|
],
|
||||||
|
"build-with-php": true
|
||||||
},
|
},
|
||||||
"xmlreader": {
|
"xmlreader": {
|
||||||
"support": {
|
"support": {
|
||||||
@@ -955,7 +1047,8 @@
|
|||||||
"ext-depends-windows": [
|
"ext-depends-windows": [
|
||||||
"xml",
|
"xml",
|
||||||
"dom"
|
"dom"
|
||||||
]
|
],
|
||||||
|
"build-with-php": true
|
||||||
},
|
},
|
||||||
"xmlwriter": {
|
"xmlwriter": {
|
||||||
"support": {
|
"support": {
|
||||||
@@ -968,7 +1061,8 @@
|
|||||||
],
|
],
|
||||||
"ext-depends-windows": [
|
"ext-depends-windows": [
|
||||||
"xml"
|
"xml"
|
||||||
]
|
],
|
||||||
|
"build-with-php": true
|
||||||
},
|
},
|
||||||
"xsl": {
|
"xsl": {
|
||||||
"support": {
|
"support": {
|
||||||
@@ -976,7 +1070,7 @@
|
|||||||
"BSD": "wip"
|
"BSD": "wip"
|
||||||
},
|
},
|
||||||
"type": "builtin",
|
"type": "builtin",
|
||||||
"arg-type": "with-prefix",
|
"arg-type": "with-path",
|
||||||
"lib-depends": [
|
"lib-depends": [
|
||||||
"libxslt"
|
"libxslt"
|
||||||
],
|
],
|
||||||
@@ -985,6 +1079,14 @@
|
|||||||
"dom"
|
"dom"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"xz": {
|
||||||
|
"type": "external",
|
||||||
|
"source": "ext-xz",
|
||||||
|
"arg-type": "with",
|
||||||
|
"lib-depends": [
|
||||||
|
"xz"
|
||||||
|
]
|
||||||
|
},
|
||||||
"yac": {
|
"yac": {
|
||||||
"support": {
|
"support": {
|
||||||
"BSD": "wip"
|
"BSD": "wip"
|
||||||
@@ -992,6 +1094,9 @@
|
|||||||
"type": "external",
|
"type": "external",
|
||||||
"source": "yac",
|
"source": "yac",
|
||||||
"arg-type-unix": "custom",
|
"arg-type-unix": "custom",
|
||||||
|
"lib-depends-unix": [
|
||||||
|
"fastlz"
|
||||||
|
],
|
||||||
"ext-depends-unix": [
|
"ext-depends-unix": [
|
||||||
"igbinary"
|
"igbinary"
|
||||||
]
|
]
|
||||||
@@ -1002,7 +1107,7 @@
|
|||||||
},
|
},
|
||||||
"type": "external",
|
"type": "external",
|
||||||
"source": "yaml",
|
"source": "yaml",
|
||||||
"arg-type-unix": "with-prefix",
|
"arg-type-unix": "with-path",
|
||||||
"arg-type-windows": "with",
|
"arg-type-windows": "with",
|
||||||
"lib-depends": [
|
"lib-depends": [
|
||||||
"libyaml"
|
"libyaml"
|
||||||
@@ -1013,7 +1118,7 @@
|
|||||||
"BSD": "wip"
|
"BSD": "wip"
|
||||||
},
|
},
|
||||||
"type": "builtin",
|
"type": "builtin",
|
||||||
"arg-type": "with-prefix",
|
"arg-type": "with-path",
|
||||||
"arg-type-windows": "enable",
|
"arg-type-windows": "enable",
|
||||||
"lib-depends-unix": [
|
"lib-depends-unix": [
|
||||||
"libzip"
|
"libzip"
|
||||||
@@ -1035,6 +1140,9 @@
|
|||||||
"arg-type-windows": "enable",
|
"arg-type-windows": "enable",
|
||||||
"lib-depends": [
|
"lib-depends": [
|
||||||
"zlib"
|
"zlib"
|
||||||
|
],
|
||||||
|
"target": [
|
||||||
|
"static"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"zstd": {
|
"zstd": {
|
||||||
|
|||||||
263
config/lib.json
263
config/lib.json
@@ -1,10 +1,44 @@
|
|||||||
{
|
{
|
||||||
|
"lib-base": {
|
||||||
|
"type": "root",
|
||||||
|
"lib-depends-unix": [
|
||||||
|
"pkg-config"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"php": {
|
||||||
|
"type": "root",
|
||||||
|
"source": "php-src",
|
||||||
|
"lib-depends": [
|
||||||
|
"lib-base",
|
||||||
|
"micro"
|
||||||
|
],
|
||||||
|
"lib-suggests-linux": [
|
||||||
|
"libacl"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"micro": {
|
||||||
|
"type": "target",
|
||||||
|
"source": "micro"
|
||||||
|
},
|
||||||
|
"pkg-config": {
|
||||||
|
"type": "package",
|
||||||
|
"source": "pkg-config",
|
||||||
|
"bin-unix": [
|
||||||
|
"pkg-config"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"attr": {
|
||||||
|
"source": "attr",
|
||||||
|
"static-libs-unix": [
|
||||||
|
"libattr.a"
|
||||||
|
]
|
||||||
|
},
|
||||||
"brotli": {
|
"brotli": {
|
||||||
"source": "brotli",
|
"source": "brotli",
|
||||||
"static-libs-unix": [
|
"pkg-configs": [
|
||||||
"libbrotlidec.a",
|
"libbrotlicommon",
|
||||||
"libbrotlienc.a",
|
"libbrotlidec",
|
||||||
"libbrotlicommon.a"
|
"libbrotlienc"
|
||||||
],
|
],
|
||||||
"static-libs-windows": [
|
"static-libs-windows": [
|
||||||
"brotlicommon.lib",
|
"brotlicommon.lib",
|
||||||
@@ -34,7 +68,7 @@
|
|||||||
"libcurl.a"
|
"libcurl.a"
|
||||||
],
|
],
|
||||||
"static-libs-windows": [
|
"static-libs-windows": [
|
||||||
"libcurl.lib"
|
"libcurl_a.lib"
|
||||||
],
|
],
|
||||||
"headers": [
|
"headers": [
|
||||||
"curl"
|
"curl"
|
||||||
@@ -44,7 +78,6 @@
|
|||||||
"zlib"
|
"zlib"
|
||||||
],
|
],
|
||||||
"lib-depends-windows": [
|
"lib-depends-windows": [
|
||||||
"openssl",
|
|
||||||
"zlib",
|
"zlib",
|
||||||
"libssh2",
|
"libssh2",
|
||||||
"nghttp2"
|
"nghttp2"
|
||||||
@@ -53,8 +86,11 @@
|
|||||||
"libssh2",
|
"libssh2",
|
||||||
"brotli",
|
"brotli",
|
||||||
"nghttp2",
|
"nghttp2",
|
||||||
|
"nghttp3",
|
||||||
|
"ngtcp2",
|
||||||
"zstd",
|
"zstd",
|
||||||
"libcares"
|
"libcares",
|
||||||
|
"ldap"
|
||||||
],
|
],
|
||||||
"lib-suggests-windows": [
|
"lib-suggests-windows": [
|
||||||
"brotli",
|
"brotli",
|
||||||
@@ -66,6 +102,15 @@
|
|||||||
"SystemConfiguration"
|
"SystemConfiguration"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"fastlz": {
|
||||||
|
"source": "fastlz",
|
||||||
|
"static-libs-unix": [
|
||||||
|
"libfastlz.a"
|
||||||
|
],
|
||||||
|
"headers": [
|
||||||
|
"fastlz/fastlz.h"
|
||||||
|
]
|
||||||
|
},
|
||||||
"freetype": {
|
"freetype": {
|
||||||
"source": "freetype",
|
"source": "freetype",
|
||||||
"static-libs-unix": [
|
"static-libs-unix": [
|
||||||
@@ -141,14 +186,15 @@
|
|||||||
},
|
},
|
||||||
"grpc": {
|
"grpc": {
|
||||||
"source": "grpc",
|
"source": "grpc",
|
||||||
"static-libs-unix": [
|
"pkg-configs": [
|
||||||
"libgrpc.a",
|
"grpc"
|
||||||
"libcares.a"
|
|
||||||
],
|
],
|
||||||
"lib-depends": [
|
"lib-depends": [
|
||||||
"zlib",
|
"zlib",
|
||||||
"openssl"
|
"openssl",
|
||||||
|
"libcares"
|
||||||
],
|
],
|
||||||
|
"provide-pre-built": true,
|
||||||
"frameworks": [
|
"frameworks": [
|
||||||
"CoreFoundation"
|
"CoreFoundation"
|
||||||
]
|
]
|
||||||
@@ -156,33 +202,45 @@
|
|||||||
"icu": {
|
"icu": {
|
||||||
"source": "icu",
|
"source": "icu",
|
||||||
"cpp-library": true,
|
"cpp-library": true,
|
||||||
"static-libs-unix": [
|
"pkg-configs": [
|
||||||
"libicui18n.a",
|
"icu-uc",
|
||||||
"libicuio.a",
|
"icu-i18n",
|
||||||
"libicuuc.a",
|
"icu-io"
|
||||||
"libicudata.a"
|
]
|
||||||
|
},
|
||||||
|
"icu-static-win": {
|
||||||
|
"source": "icu-static-win",
|
||||||
|
"static-libs-windows": [
|
||||||
|
"icudt.lib",
|
||||||
|
"icuin.lib",
|
||||||
|
"icuio.lib",
|
||||||
|
"icuuc.lib"
|
||||||
|
],
|
||||||
|
"headers-windows": [
|
||||||
|
"unicode"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"imagemagick": {
|
"imagemagick": {
|
||||||
"source": "imagemagick",
|
"source": "imagemagick",
|
||||||
"static-libs-unix": [
|
"pkg-configs": [
|
||||||
"libMagick++-7.Q16HDRI.a",
|
"Magick++-7.Q16HDRI",
|
||||||
"libMagickWand-7.Q16HDRI.a",
|
"MagickCore-7.Q16HDRI",
|
||||||
"libMagickCore-7.Q16HDRI.a"
|
"MagickWand-7.Q16HDRI"
|
||||||
],
|
],
|
||||||
"lib-depends": [
|
"lib-depends": [
|
||||||
"zlib",
|
"zlib",
|
||||||
"libpng",
|
|
||||||
"libjpeg",
|
"libjpeg",
|
||||||
|
"libjxl",
|
||||||
|
"libpng",
|
||||||
"libwebp",
|
"libwebp",
|
||||||
"freetype",
|
"freetype",
|
||||||
"libtiff",
|
"libtiff",
|
||||||
"libheif"
|
"libheif",
|
||||||
|
"bzip2"
|
||||||
],
|
],
|
||||||
"lib-suggests": [
|
"lib-suggests": [
|
||||||
"zstd",
|
"zstd",
|
||||||
"xz",
|
"xz",
|
||||||
"bzip2",
|
|
||||||
"libzip",
|
"libzip",
|
||||||
"libxml2"
|
"libxml2"
|
||||||
]
|
]
|
||||||
@@ -196,11 +254,23 @@
|
|||||||
"openssl"
|
"openssl"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"jbig": {
|
||||||
|
"source": "jbig",
|
||||||
|
"static-libs-unix": [
|
||||||
|
"libjbig.a",
|
||||||
|
"libjbig85.a"
|
||||||
|
],
|
||||||
|
"headers": [
|
||||||
|
"jbig.h",
|
||||||
|
"jbig85.h",
|
||||||
|
"jbig_ar.h"
|
||||||
|
]
|
||||||
|
},
|
||||||
"ldap": {
|
"ldap": {
|
||||||
"source": "ldap",
|
"source": "ldap",
|
||||||
"static-libs-unix": [
|
"pkg-configs": [
|
||||||
"liblber.a",
|
"ldap",
|
||||||
"libldap.a"
|
"lber"
|
||||||
],
|
],
|
||||||
"lib-depends": [
|
"lib-depends": [
|
||||||
"openssl",
|
"openssl",
|
||||||
@@ -209,6 +279,22 @@
|
|||||||
"libsodium"
|
"libsodium"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"lerc": {
|
||||||
|
"source": "lerc",
|
||||||
|
"static-libs-unix": [
|
||||||
|
"libLerc.a"
|
||||||
|
],
|
||||||
|
"cpp-library": true
|
||||||
|
},
|
||||||
|
"libacl": {
|
||||||
|
"source": "libacl",
|
||||||
|
"static-libs-unix": [
|
||||||
|
"libacl.a"
|
||||||
|
],
|
||||||
|
"lib-depends": [
|
||||||
|
"attr"
|
||||||
|
]
|
||||||
|
},
|
||||||
"libaom": {
|
"libaom": {
|
||||||
"source": "libaom",
|
"source": "libaom",
|
||||||
"static-libs-unix": [
|
"static-libs-unix": [
|
||||||
@@ -239,8 +325,7 @@
|
|||||||
"headers-unix": [
|
"headers-unix": [
|
||||||
"ares.h",
|
"ares.h",
|
||||||
"ares_dns.h",
|
"ares_dns.h",
|
||||||
"ares_nameser.h",
|
"ares_nameser.h"
|
||||||
"ares_rules.h"
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"libde265": {
|
"libde265": {
|
||||||
@@ -336,6 +421,21 @@
|
|||||||
"zlib"
|
"zlib"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"libjxl": {
|
||||||
|
"source": "libjxl",
|
||||||
|
"pkg-configs": [
|
||||||
|
"libjxl",
|
||||||
|
"libjxl_cms",
|
||||||
|
"libjxl_threads",
|
||||||
|
"libhwy"
|
||||||
|
],
|
||||||
|
"lib-depends": [
|
||||||
|
"brotli",
|
||||||
|
"libjpeg",
|
||||||
|
"libpng",
|
||||||
|
"libwebp"
|
||||||
|
]
|
||||||
|
},
|
||||||
"liblz4": {
|
"liblz4": {
|
||||||
"source": "liblz4",
|
"source": "liblz4",
|
||||||
"static-libs-unix": [
|
"static-libs-unix": [
|
||||||
@@ -346,7 +446,9 @@
|
|||||||
"source": "libmemcached",
|
"source": "libmemcached",
|
||||||
"static-libs-unix": [
|
"static-libs-unix": [
|
||||||
"libmemcached.a",
|
"libmemcached.a",
|
||||||
"libmemcachedutil.a"
|
"libmemcachedprotocol.a",
|
||||||
|
"libmemcachedutil.a",
|
||||||
|
"libhashkit.a"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"libpng": {
|
"libpng": {
|
||||||
@@ -399,6 +501,9 @@
|
|||||||
"source": "libsodium",
|
"source": "libsodium",
|
||||||
"static-libs-unix": [
|
"static-libs-unix": [
|
||||||
"libsodium.a"
|
"libsodium.a"
|
||||||
|
],
|
||||||
|
"static-libs-windows": [
|
||||||
|
"libsodium.lib"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"libssh2": {
|
"libssh2": {
|
||||||
@@ -416,9 +521,6 @@
|
|||||||
],
|
],
|
||||||
"lib-depends": [
|
"lib-depends": [
|
||||||
"openssl"
|
"openssl"
|
||||||
],
|
|
||||||
"lib-suggests": [
|
|
||||||
"zlib"
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"libtiff": {
|
"libtiff": {
|
||||||
@@ -429,6 +531,13 @@
|
|||||||
"lib-depends": [
|
"lib-depends": [
|
||||||
"zlib",
|
"zlib",
|
||||||
"libjpeg"
|
"libjpeg"
|
||||||
|
],
|
||||||
|
"lib-suggests-unix": [
|
||||||
|
"lerc",
|
||||||
|
"libwebp",
|
||||||
|
"jbig",
|
||||||
|
"xz",
|
||||||
|
"zstd"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"libuuid": {
|
"libuuid": {
|
||||||
@@ -448,12 +557,12 @@
|
|||||||
},
|
},
|
||||||
"libwebp": {
|
"libwebp": {
|
||||||
"source": "libwebp",
|
"source": "libwebp",
|
||||||
"static-libs-unix": [
|
"pkg-configs": [
|
||||||
"libwebp.a",
|
"libwebp",
|
||||||
"libwebpdecoder.a",
|
"libwebpdecoder",
|
||||||
"libwebpdemux.a",
|
"libwebpdemux",
|
||||||
"libwebpmux.a",
|
"libwebpmux",
|
||||||
"libsharpyuv.a"
|
"libsharpyuv"
|
||||||
],
|
],
|
||||||
"static-libs-windows": [
|
"static-libs-windows": [
|
||||||
"libwebp.lib",
|
"libwebp.lib",
|
||||||
@@ -543,6 +652,12 @@
|
|||||||
"openssl"
|
"openssl"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"mimalloc": {
|
||||||
|
"source": "mimalloc",
|
||||||
|
"static-libs-unix": [
|
||||||
|
"libmimalloc.a"
|
||||||
|
]
|
||||||
|
},
|
||||||
"ncurses": {
|
"ncurses": {
|
||||||
"source": "ncurses",
|
"source": "ncurses",
|
||||||
"static-libs-unix": [
|
"static-libs-unix": [
|
||||||
@@ -565,7 +680,45 @@
|
|||||||
"openssl"
|
"openssl"
|
||||||
],
|
],
|
||||||
"lib-suggests": [
|
"lib-suggests": [
|
||||||
"libxml2"
|
"libxml2",
|
||||||
|
"nghttp3",
|
||||||
|
"ngtcp2"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nghttp3": {
|
||||||
|
"source": "nghttp3",
|
||||||
|
"static-libs-unix": [
|
||||||
|
"libnghttp3.a"
|
||||||
|
],
|
||||||
|
"static-libs-windows": [
|
||||||
|
"nghttp3.lib"
|
||||||
|
],
|
||||||
|
"headers": [
|
||||||
|
"nghttp3"
|
||||||
|
],
|
||||||
|
"lib-depends": [
|
||||||
|
"openssl"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"ngtcp2": {
|
||||||
|
"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"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"onig": {
|
"onig": {
|
||||||
@@ -599,15 +752,10 @@
|
|||||||
"zlib"
|
"zlib"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"pkg-config": {
|
|
||||||
"source": "pkg-config"
|
|
||||||
},
|
|
||||||
"postgresql": {
|
"postgresql": {
|
||||||
"source": "postgresql",
|
"source": "postgresql",
|
||||||
"static-libs-unix": [
|
"pkg-configs": [
|
||||||
"libpq.a",
|
"libpq"
|
||||||
"libpgport.a",
|
|
||||||
"libpgcommon.a"
|
|
||||||
],
|
],
|
||||||
"lib-depends": [
|
"lib-depends": [
|
||||||
"libiconv",
|
"libiconv",
|
||||||
@@ -623,6 +771,14 @@
|
|||||||
"zstd"
|
"zstd"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"postgresql-win": {
|
||||||
|
"source": "postgresql-win",
|
||||||
|
"static-libs": [
|
||||||
|
"libpq.lib",
|
||||||
|
"libpgport.lib",
|
||||||
|
"libpgcommon.lib"
|
||||||
|
]
|
||||||
|
},
|
||||||
"pthreads4w": {
|
"pthreads4w": {
|
||||||
"source": "pthreads4w",
|
"source": "pthreads4w",
|
||||||
"static-libs-windows": [
|
"static-libs-windows": [
|
||||||
@@ -641,6 +797,12 @@
|
|||||||
"depot.h"
|
"depot.h"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"re2c": {
|
||||||
|
"source": "re2c",
|
||||||
|
"bin-unix": [
|
||||||
|
"re2c"
|
||||||
|
]
|
||||||
|
},
|
||||||
"readline": {
|
"readline": {
|
||||||
"source": "readline",
|
"source": "readline",
|
||||||
"static-libs-unix": [
|
"static-libs-unix": [
|
||||||
@@ -695,6 +857,15 @@
|
|||||||
"libiconv"
|
"libiconv"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"watcher": {
|
||||||
|
"source": "watcher",
|
||||||
|
"static-libs-unix": [
|
||||||
|
"libwatcher-c.a"
|
||||||
|
],
|
||||||
|
"headers": [
|
||||||
|
"wtr/watcher-c.h"
|
||||||
|
]
|
||||||
|
},
|
||||||
"xz": {
|
"xz": {
|
||||||
"source": "xz",
|
"source": "xz",
|
||||||
"static-libs-unix": [
|
"static-libs-unix": [
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
},
|
},
|
||||||
"nasm-x86_64-win": {
|
"nasm-x86_64-win": {
|
||||||
"type": "url",
|
"type": "url",
|
||||||
"url": "https://www.nasm.us/pub/nasm/releasebuilds/2.16.01/win64/nasm-2.16.01-win64.zip",
|
"url": "https://dl.static-php.dev/static-php-cli/deps/nasm/nasm-2.16.01-win64.zip",
|
||||||
"extract-files": {
|
"extract-files": {
|
||||||
"nasm-2.16.01/nasm.exe": "{php_sdk_path}/bin/nasm.exe",
|
"nasm-2.16.01/nasm.exe": "{php_sdk_path}/bin/nasm.exe",
|
||||||
"nasm-2.16.01/ndisasm.exe": "{php_sdk_path}/bin/ndisasm.exe"
|
"nasm-2.16.01/ndisasm.exe": "{php_sdk_path}/bin/ndisasm.exe"
|
||||||
@@ -42,5 +42,32 @@
|
|||||||
"extract-files": {
|
"extract-files": {
|
||||||
"upx-*-win64/upx.exe": "{pkg_root_path}/bin/upx.exe"
|
"upx-*-win64/upx.exe": "{pkg_root_path}/bin/upx.exe"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"go-xcaddy-x86_64-linux": {
|
||||||
|
"type": "custom"
|
||||||
|
},
|
||||||
|
"go-xcaddy-aarch64-linux": {
|
||||||
|
"type": "custom"
|
||||||
|
},
|
||||||
|
"go-xcaddy-x86_64-macos": {
|
||||||
|
"type": "custom"
|
||||||
|
},
|
||||||
|
"go-xcaddy-aarch64-macos": {
|
||||||
|
"type": "custom"
|
||||||
|
},
|
||||||
|
"zig-x86_64-linux": {
|
||||||
|
"type": "custom"
|
||||||
|
},
|
||||||
|
"zig-aarch64-linux": {
|
||||||
|
"type": "custom"
|
||||||
|
},
|
||||||
|
"zig-x86_64-macos": {
|
||||||
|
"type": "custom"
|
||||||
|
},
|
||||||
|
"zig-aarch64-macos": {
|
||||||
|
"type": "custom"
|
||||||
|
},
|
||||||
|
"zig-x86_64-win": {
|
||||||
|
"type": "custom"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"repo": "static-php/static-php-cli-hosted",
|
"repo": "static-php/static-php-cli-hosted",
|
||||||
"prefer-stable": true,
|
"prefer-stable": true,
|
||||||
"match-pattern": "{name}-{arch}-{os}.txz",
|
"match-pattern-linux": "{name}-{arch}-{os}-{libc}-{libcver}.txz",
|
||||||
"suffix": "txz"
|
"match-pattern-macos": "{name}-{arch}-{os}.txz",
|
||||||
}
|
"match-pattern-windows": "{name}-{arch}-{os}.tgz"
|
||||||
|
}
|
||||||
|
|||||||
@@ -4,7 +4,8 @@
|
|||||||
"license": {
|
"license": {
|
||||||
"type": "file",
|
"type": "file",
|
||||||
"path": "LICENSE"
|
"path": "LICENSE"
|
||||||
}
|
},
|
||||||
|
"alt": false
|
||||||
},
|
},
|
||||||
"amqp": {
|
"amqp": {
|
||||||
"type": "url",
|
"type": "url",
|
||||||
@@ -36,9 +37,23 @@
|
|||||||
"path": "LICENSE"
|
"path": "LICENSE"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"attr": {
|
||||||
|
"alt": {
|
||||||
|
"type": "url",
|
||||||
|
"url": "https://mirror.souseiseki.middlendian.com/nongnu/attr/attr-2.5.2.tar.gz"
|
||||||
|
},
|
||||||
|
"type": "url",
|
||||||
|
"url": "https://download.savannah.nongnu.org/releases/attr/attr-2.5.2.tar.gz",
|
||||||
|
"provide-pre-built": true,
|
||||||
|
"license": {
|
||||||
|
"type": "file",
|
||||||
|
"path": "doc/COPYING"
|
||||||
|
}
|
||||||
|
},
|
||||||
"brotli": {
|
"brotli": {
|
||||||
"type": "ghtar",
|
"type": "ghtagtar",
|
||||||
"repo": "google/brotli",
|
"repo": "google/brotli",
|
||||||
|
"match": "v1\\.\\d.*",
|
||||||
"provide-pre-built": true,
|
"provide-pre-built": true,
|
||||||
"license": {
|
"license": {
|
||||||
"type": "file",
|
"type": "file",
|
||||||
@@ -79,6 +94,26 @@
|
|||||||
"path": "LICENSE"
|
"path": "LICENSE"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"ev": {
|
||||||
|
"type": "url",
|
||||||
|
"url": "https://pecl.php.net/get/ev",
|
||||||
|
"path": "php-src/ext/ev",
|
||||||
|
"filename": "ev.tgz",
|
||||||
|
"license": {
|
||||||
|
"type": "file",
|
||||||
|
"path": "LICENSE"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"ext-brotli": {
|
||||||
|
"type": "git",
|
||||||
|
"path": "php-src/ext/brotli",
|
||||||
|
"rev": "master",
|
||||||
|
"url": "https://github.com/kjdev/php-ext-brotli",
|
||||||
|
"license": {
|
||||||
|
"type": "file",
|
||||||
|
"path": "LICENSE"
|
||||||
|
}
|
||||||
|
},
|
||||||
"ext-ds": {
|
"ext-ds": {
|
||||||
"type": "url",
|
"type": "url",
|
||||||
"url": "https://pecl.php.net/get/ds",
|
"url": "https://pecl.php.net/get/ds",
|
||||||
@@ -138,6 +173,17 @@
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"ext-lz4": {
|
||||||
|
"type": "ghtagtar",
|
||||||
|
"repo": "kjdev/php-ext-lz4",
|
||||||
|
"path": "php-src/ext/lz4",
|
||||||
|
"license": {
|
||||||
|
"type": "file",
|
||||||
|
"path": [
|
||||||
|
"LICENSE"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
"ext-memcache": {
|
"ext-memcache": {
|
||||||
"type": "url",
|
"type": "url",
|
||||||
"url": "https://pecl.php.net/get/memcache",
|
"url": "https://pecl.php.net/get/memcache",
|
||||||
@@ -207,6 +253,16 @@
|
|||||||
"path": "LICENSE"
|
"path": "LICENSE"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"ext-xz": {
|
||||||
|
"type": "git",
|
||||||
|
"path": "php-src/ext/xz",
|
||||||
|
"rev": "main",
|
||||||
|
"url": "https://github.com/codemasher/php-ext-xz",
|
||||||
|
"license": {
|
||||||
|
"type": "file",
|
||||||
|
"path": "LICENSE"
|
||||||
|
}
|
||||||
|
},
|
||||||
"ext-zstd": {
|
"ext-zstd": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"path": "php-src/ext/zstd",
|
"path": "php-src/ext/zstd",
|
||||||
@@ -217,6 +273,15 @@
|
|||||||
"path": "LICENSE"
|
"path": "LICENSE"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"fastlz": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/ariya/FastLZ.git",
|
||||||
|
"rev": "master",
|
||||||
|
"license": {
|
||||||
|
"type": "file",
|
||||||
|
"path": "LICENSE.MIT"
|
||||||
|
}
|
||||||
|
},
|
||||||
"freetype": {
|
"freetype": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"rev": "VER-2-13-2",
|
"rev": "VER-2-13-2",
|
||||||
@@ -251,6 +316,7 @@
|
|||||||
"gmssl": {
|
"gmssl": {
|
||||||
"type": "ghtar",
|
"type": "ghtar",
|
||||||
"repo": "guanzhi/GmSSL",
|
"repo": "guanzhi/GmSSL",
|
||||||
|
"provide-pre-built": true,
|
||||||
"license": {
|
"license": {
|
||||||
"type": "file",
|
"type": "file",
|
||||||
"path": "LICENSE"
|
"path": "LICENSE"
|
||||||
@@ -277,6 +343,14 @@
|
|||||||
"path": "LICENSE"
|
"path": "LICENSE"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"icu-static-win": {
|
||||||
|
"type": "url",
|
||||||
|
"url": "https://dl.static-php.dev/static-php-cli/deps/icu-static-windows-x64/icu-static-windows-x64.zip",
|
||||||
|
"license": {
|
||||||
|
"type": "text",
|
||||||
|
"text": "none"
|
||||||
|
}
|
||||||
|
},
|
||||||
"igbinary": {
|
"igbinary": {
|
||||||
"type": "url",
|
"type": "url",
|
||||||
"url": "https://pecl.php.net/get/igbinary",
|
"url": "https://pecl.php.net/get/igbinary",
|
||||||
@@ -314,6 +388,19 @@
|
|||||||
"path": "LICENSE"
|
"path": "LICENSE"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"jbig": {
|
||||||
|
"type": "url",
|
||||||
|
"url": "https://dl.static-php.dev/static-php-cli/deps/jbig/jbigkit-2.1.tar.gz",
|
||||||
|
"provide-pre-built": true,
|
||||||
|
"alt": {
|
||||||
|
"type": "url",
|
||||||
|
"url": "https://www.cl.cam.ac.uk/~mgk25/jbigkit/download/jbigkit-2.1.tar.gz"
|
||||||
|
},
|
||||||
|
"license": {
|
||||||
|
"type": "file",
|
||||||
|
"path": "COPYING"
|
||||||
|
}
|
||||||
|
},
|
||||||
"ldap": {
|
"ldap": {
|
||||||
"type": "filelist",
|
"type": "filelist",
|
||||||
"url": "https://www.openldap.org/software/download/OpenLDAP/openldap-release/",
|
"url": "https://www.openldap.org/software/download/OpenLDAP/openldap-release/",
|
||||||
@@ -323,6 +410,29 @@
|
|||||||
"path": "LICENSE"
|
"path": "LICENSE"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"lerc": {
|
||||||
|
"type": "ghtar",
|
||||||
|
"repo": "Esri/lerc",
|
||||||
|
"prefer-stable": true,
|
||||||
|
"provide-pre-built": true,
|
||||||
|
"license": {
|
||||||
|
"type": "file",
|
||||||
|
"path": "LICENSE"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"libacl": {
|
||||||
|
"alt": {
|
||||||
|
"type": "url",
|
||||||
|
"url": "https://mirror.souseiseki.middlendian.com/nongnu/acl/acl-2.3.2.tar.gz"
|
||||||
|
},
|
||||||
|
"type": "url",
|
||||||
|
"url": "https://download.savannah.nongnu.org/releases/acl/acl-2.3.2.tar.gz",
|
||||||
|
"provide-pre-built": true,
|
||||||
|
"license": {
|
||||||
|
"type": "file",
|
||||||
|
"path": "doc/COPYING"
|
||||||
|
}
|
||||||
|
},
|
||||||
"libaom": {
|
"libaom": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"rev": "main",
|
"rev": "main",
|
||||||
@@ -447,6 +557,21 @@
|
|||||||
"path": "LICENSE.md"
|
"path": "LICENSE.md"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"libjxl": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/libjxl/libjxl",
|
||||||
|
"rev": "main",
|
||||||
|
"submodules": [
|
||||||
|
"third_party/highway",
|
||||||
|
"third_party/libjpeg-turbo",
|
||||||
|
"third_party/sjpeg",
|
||||||
|
"third_party/skcms"
|
||||||
|
],
|
||||||
|
"license": {
|
||||||
|
"type": "file",
|
||||||
|
"path": "LICENSE"
|
||||||
|
}
|
||||||
|
},
|
||||||
"liblz4": {
|
"liblz4": {
|
||||||
"type": "ghrel",
|
"type": "ghrel",
|
||||||
"repo": "lz4/lz4",
|
"repo": "lz4/lz4",
|
||||||
@@ -459,12 +584,12 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"libmemcached": {
|
"libmemcached": {
|
||||||
"type": "git",
|
"type": "ghtagtar",
|
||||||
"url": "https://github.com/static-php/libmemcached-macos.git",
|
"repo": "awesomized/libmemcached",
|
||||||
"rev": "master",
|
"match": "1.\\d.\\d",
|
||||||
"license": {
|
"license": {
|
||||||
"type": "file",
|
"type": "file",
|
||||||
"path": "COPYING"
|
"path": "LICENSE"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"libpng": {
|
"libpng": {
|
||||||
@@ -510,6 +635,7 @@
|
|||||||
"repo": "libssh2/libssh2",
|
"repo": "libssh2/libssh2",
|
||||||
"match": "libssh2.+\\.tar\\.gz",
|
"match": "libssh2.+\\.tar\\.gz",
|
||||||
"prefer-stable": true,
|
"prefer-stable": true,
|
||||||
|
"provide-pre-built": true,
|
||||||
"license": {
|
"license": {
|
||||||
"type": "file",
|
"type": "file",
|
||||||
"path": "COPYING"
|
"path": "COPYING"
|
||||||
@@ -519,7 +645,6 @@
|
|||||||
"type": "filelist",
|
"type": "filelist",
|
||||||
"url": "https://download.osgeo.org/libtiff/",
|
"url": "https://download.osgeo.org/libtiff/",
|
||||||
"regex": "/href=\"(?<file>tiff-(?<version>[^\"]+)\\.tar\\.xz)\"/",
|
"regex": "/href=\"(?<file>tiff-(?<version>[^\"]+)\\.tar\\.xz)\"/",
|
||||||
"provide-pre-built": true,
|
|
||||||
"license": {
|
"license": {
|
||||||
"type": "file",
|
"type": "file",
|
||||||
"path": "LICENSE.md"
|
"path": "LICENSE.md"
|
||||||
@@ -571,7 +696,7 @@
|
|||||||
"regex": "/href=\"(?<file>libxslt-(?<version>[^\"]+)\\.tar\\.xz)\"/",
|
"regex": "/href=\"(?<file>libxslt-(?<version>[^\"]+)\\.tar\\.xz)\"/",
|
||||||
"license": {
|
"license": {
|
||||||
"type": "file",
|
"type": "file",
|
||||||
"path": "COPYING"
|
"path": "Copyright"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"libyaml": {
|
"libyaml": {
|
||||||
@@ -608,13 +733,23 @@
|
|||||||
"micro": {
|
"micro": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"path": "php-src/sapi/micro",
|
"path": "php-src/sapi/micro",
|
||||||
"rev": "84beta",
|
"rev": "php-85-win",
|
||||||
"url": "https://github.com/static-php/phpmicro",
|
"url": "https://github.com/static-php/phpmicro",
|
||||||
"license": {
|
"license": {
|
||||||
"type": "file",
|
"type": "file",
|
||||||
"path": "LICENSE"
|
"path": "LICENSE"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"mimalloc": {
|
||||||
|
"type": "ghtagtar",
|
||||||
|
"repo": "microsoft/mimalloc",
|
||||||
|
"match": "v2\\.\\d\\.[^3].*",
|
||||||
|
"provide-pre-built": false,
|
||||||
|
"license": {
|
||||||
|
"type": "file",
|
||||||
|
"path": "LICENSE"
|
||||||
|
}
|
||||||
|
},
|
||||||
"mongodb": {
|
"mongodb": {
|
||||||
"type": "ghrel",
|
"type": "ghrel",
|
||||||
"repo": "mongodb/mongo-php-driver",
|
"repo": "mongodb/mongo-php-driver",
|
||||||
@@ -656,6 +791,26 @@
|
|||||||
"path": "COPYING"
|
"path": "COPYING"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"nghttp3": {
|
||||||
|
"type": "ghrel",
|
||||||
|
"repo": "ngtcp2/nghttp3",
|
||||||
|
"match": "nghttp3.+\\.tar\\.xz",
|
||||||
|
"prefer-stable": true,
|
||||||
|
"license": {
|
||||||
|
"type": "file",
|
||||||
|
"path": "COPYING"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"ngtcp2": {
|
||||||
|
"type": "ghrel",
|
||||||
|
"repo": "ngtcp2/ngtcp2",
|
||||||
|
"match": "ngtcp2.+\\.tar\\.xz",
|
||||||
|
"prefer-stable": true,
|
||||||
|
"license": {
|
||||||
|
"type": "file",
|
||||||
|
"path": "COPYING"
|
||||||
|
}
|
||||||
|
},
|
||||||
"onig": {
|
"onig": {
|
||||||
"type": "ghrel",
|
"type": "ghrel",
|
||||||
"repo": "kkos/oniguruma",
|
"repo": "kkos/oniguruma",
|
||||||
@@ -723,13 +878,22 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"postgresql": {
|
"postgresql": {
|
||||||
"type": "url",
|
"type": "ghtagtar",
|
||||||
"url": "https://ftp.postgresql.org/pub/source/v16.2/postgresql-16.2.tar.bz2",
|
"repo": "postgres/postgres",
|
||||||
|
"match": "REL_16_\\d+",
|
||||||
"license": {
|
"license": {
|
||||||
"type": "file",
|
"type": "file",
|
||||||
"path": "COPYRIGHT"
|
"path": "COPYRIGHT"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"postgresql-win": {
|
||||||
|
"type": "url",
|
||||||
|
"url": "https://get.enterprisedb.com/postgresql/postgresql-16.8-1-windows-x64-binaries.zip",
|
||||||
|
"license": {
|
||||||
|
"type": "text",
|
||||||
|
"text": "PostgreSQL Database Management System\n(also known as Postgres, formerly as Postgres95)\n\nPortions Copyright (c) 1996-2025, The PostgreSQL Global Development Group\n\nPortions Copyright (c) 1994, The Regents of the University of California\n\nPermission to use, copy, modify, and distribute this software and its\ndocumentation for any purpose, without fee, and without a written\nagreement is hereby granted, provided that the above copyright notice\nand this paragraph and the following two paragraphs appear in all\ncopies.\n\nIN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY\nFOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES,\nINCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS\nDOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF\nTHE POSSIBILITY OF SUCH DAMAGE.\n\nTHE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,\nINCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS\nON AN \"AS IS\" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS\nTO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS."
|
||||||
|
}
|
||||||
|
},
|
||||||
"protobuf": {
|
"protobuf": {
|
||||||
"type": "url",
|
"type": "url",
|
||||||
"url": "https://pecl.php.net/get/protobuf",
|
"url": "https://pecl.php.net/get/protobuf",
|
||||||
@@ -768,6 +932,20 @@
|
|||||||
"path": "LICENSE"
|
"path": "LICENSE"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"re2c": {
|
||||||
|
"type": "ghrel",
|
||||||
|
"repo": "skvadrik/re2c",
|
||||||
|
"match": "re2c.+\\.tar\\.xz",
|
||||||
|
"prefer-stable": true,
|
||||||
|
"alt": {
|
||||||
|
"type": "url",
|
||||||
|
"url": "https://dl.static-php.dev/static-php-cli/deps/re2c/re2c-4.3.tar.xz"
|
||||||
|
},
|
||||||
|
"license": {
|
||||||
|
"type": "file",
|
||||||
|
"path": "LICENSE"
|
||||||
|
}
|
||||||
|
},
|
||||||
"readline": {
|
"readline": {
|
||||||
"type": "filelist",
|
"type": "filelist",
|
||||||
"url": "https://ftp.gnu.org/pub/gnu/readline/",
|
"url": "https://ftp.gnu.org/pub/gnu/readline/",
|
||||||
@@ -832,34 +1010,29 @@
|
|||||||
},
|
},
|
||||||
"swoole": {
|
"swoole": {
|
||||||
"path": "php-src/ext/swoole",
|
"path": "php-src/ext/swoole",
|
||||||
"type": "git",
|
"type": "ghtar",
|
||||||
"rev": "master",
|
"repo": "swoole/swoole-src",
|
||||||
"url": "https://github.com/swoole/swoole-src.git",
|
"match": "v6\\.+",
|
||||||
|
"prefer-stable": true,
|
||||||
"license": {
|
"license": {
|
||||||
"type": "file",
|
"type": "file",
|
||||||
"path": "LICENSE"
|
"path": "LICENSE"
|
||||||
},
|
|
||||||
"alt": {
|
|
||||||
"type": "ghtar",
|
|
||||||
"repo": "swoole/swoole-src",
|
|
||||||
"prefer-stable": true
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"swow": {
|
"swow": {
|
||||||
"type": "git",
|
|
||||||
"path": "php-src/ext/swow-src",
|
"path": "php-src/ext/swow-src",
|
||||||
"rev": "ci",
|
"type": "ghtar",
|
||||||
"url": "https://github.com/swow/swow",
|
"repo": "swow/swow",
|
||||||
"patch": "patchSwow",
|
"prefer-stable": true,
|
||||||
"license": {
|
"license": {
|
||||||
"type": "file",
|
"type": "file",
|
||||||
"path": "LICENSE"
|
"path": "LICENSE"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"tidy": {
|
"tidy": {
|
||||||
"type": "url",
|
"type": "ghtar",
|
||||||
"url": "https://github.com/htacg/tidy-html5/archive/refs/tags/5.8.0.tar.gz",
|
"repo": "htacg/tidy-html5",
|
||||||
"filename": "tidy-html5.tgz",
|
"prefer-stable": true,
|
||||||
"license": {
|
"license": {
|
||||||
"type": "file",
|
"type": "file",
|
||||||
"path": "README/LICENSE.md"
|
"path": "README/LICENSE.md"
|
||||||
@@ -874,6 +1047,24 @@
|
|||||||
"path": "COPYING"
|
"path": "COPYING"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"watcher": {
|
||||||
|
"type": "ghtar",
|
||||||
|
"repo": "e-dant/watcher",
|
||||||
|
"prefer-stable": true,
|
||||||
|
"license": {
|
||||||
|
"type": "file",
|
||||||
|
"path": "license"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"xdebug": {
|
||||||
|
"type": "url",
|
||||||
|
"url": "https://pecl.php.net/get/xdebug",
|
||||||
|
"filename": "xdebug.tgz",
|
||||||
|
"license": {
|
||||||
|
"type": "file",
|
||||||
|
"path": "LICENSE"
|
||||||
|
}
|
||||||
|
},
|
||||||
"xhprof": {
|
"xhprof": {
|
||||||
"type": "url",
|
"type": "url",
|
||||||
"url": "https://pecl.php.net/get/xhprof",
|
"url": "https://pecl.php.net/get/xhprof",
|
||||||
|
|||||||
@@ -30,6 +30,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="my-btn" v-if="selectedSystem !== 'windows'" @click="selectCommon">{{ I18N[lang].selectCommon }}</div>
|
<div class="my-btn" v-if="selectedSystem !== 'windows'" @click="selectCommon">{{ I18N[lang].selectCommon }}</div>
|
||||||
|
<div class="my-btn" v-if="selectedSystem !== 'windows'" @click="selectAll">{{ I18N[lang].selectAll }}</div>
|
||||||
<div class="my-btn" @click="checkedExts = []">{{ I18N[lang].selectNone }}</div>
|
<div class="my-btn" @click="checkedExts = []">{{ I18N[lang].selectNone }}</div>
|
||||||
|
|
||||||
<details class="details custom-block" open>
|
<details class="details custom-block" open>
|
||||||
@@ -44,6 +45,7 @@
|
|||||||
<div class="tip custom-block">
|
<div class="tip custom-block">
|
||||||
<p class="custom-block-title">TIP</p>
|
<p class="custom-block-title">TIP</p>
|
||||||
<p>{{ I18N[lang].depTips }}</p>
|
<p>{{ I18N[lang].depTips }}</p>
|
||||||
|
<p>{{ I18N[lang].depTips2 }}</p>
|
||||||
</div>
|
</div>
|
||||||
<h2>{{ I18N[lang].buildTarget }}</h2>
|
<h2>{{ I18N[lang].buildTarget }}</h2>
|
||||||
<div class="box">
|
<div class="box">
|
||||||
@@ -175,6 +177,12 @@
|
|||||||
{{ buildCommandString }}
|
{{ buildCommandString }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="command-container">
|
||||||
|
<b>craft.yml</b>
|
||||||
|
<div id="craft-cmd" class="command-preview pre">
|
||||||
|
{{ craftCommandString }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -230,6 +238,7 @@ const availablePhpVersions = [
|
|||||||
'8.2',
|
'8.2',
|
||||||
'8.3',
|
'8.3',
|
||||||
'8.4',
|
'8.4',
|
||||||
|
'8.5',
|
||||||
];
|
];
|
||||||
|
|
||||||
const I18N = {
|
const I18N = {
|
||||||
@@ -246,6 +255,7 @@ const I18N = {
|
|||||||
no: '否',
|
no: '否',
|
||||||
resultShow: '结果展示',
|
resultShow: '结果展示',
|
||||||
selectCommon: '选择常用扩展',
|
selectCommon: '选择常用扩展',
|
||||||
|
selectAll: '选择全部',
|
||||||
selectNone: '全部取消选择',
|
selectNone: '全部取消选择',
|
||||||
useZTS: '是否编译线程安全版',
|
useZTS: '是否编译线程安全版',
|
||||||
hardcodedINI: '硬编码 INI 选项',
|
hardcodedINI: '硬编码 INI 选项',
|
||||||
@@ -261,6 +271,7 @@ const I18N = {
|
|||||||
selectedSystem: '选择操作系统',
|
selectedSystem: '选择操作系统',
|
||||||
buildLibs: '要构建的库',
|
buildLibs: '要构建的库',
|
||||||
depTips: '选择扩展后,不可选中的项目为必需的依赖,编译的依赖库列表中可选的为现有扩展和依赖库的可选依赖。选择可选依赖后,将生成 --with-libs 参数。',
|
depTips: '选择扩展后,不可选中的项目为必需的依赖,编译的依赖库列表中可选的为现有扩展和依赖库的可选依赖。选择可选依赖后,将生成 --with-libs 参数。',
|
||||||
|
depTips2: '无法同时构建所有扩展,因为有些扩展之间相互冲突。请根据需要选择扩展。',
|
||||||
microUnavailable: 'micro 不支持 PHP 7.4 及更早版本!',
|
microUnavailable: 'micro 不支持 PHP 7.4 及更早版本!',
|
||||||
windowsSAPIUnavailable: 'Windows 目前不支持 fpm、embed 构建!',
|
windowsSAPIUnavailable: 'Windows 目前不支持 fpm、embed 构建!',
|
||||||
useUPX: '是否开启 UPX 压缩(减小二进制体积)',
|
useUPX: '是否开启 UPX 压缩(减小二进制体积)',
|
||||||
@@ -280,6 +291,7 @@ const I18N = {
|
|||||||
no: 'No',
|
no: 'No',
|
||||||
resultShow: 'Result',
|
resultShow: 'Result',
|
||||||
selectCommon: 'Select common extensions',
|
selectCommon: 'Select common extensions',
|
||||||
|
selectAll: 'Select all',
|
||||||
selectNone: 'Unselect all',
|
selectNone: 'Unselect all',
|
||||||
useZTS: 'Enable ZTS',
|
useZTS: 'Enable ZTS',
|
||||||
hardcodedINI: 'Hardcoded INI options',
|
hardcodedINI: 'Hardcoded INI options',
|
||||||
@@ -295,6 +307,7 @@ const I18N = {
|
|||||||
selectedSystem: 'Select Build OS',
|
selectedSystem: 'Select Build OS',
|
||||||
buildLibs: 'Select Dependencies',
|
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.',
|
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!',
|
microUnavailable: 'Micro does not support PHP 7.4 and earlier versions!',
|
||||||
windowsSAPIUnavailable: 'Windows does not support fpm and embed build!',
|
windowsSAPIUnavailable: 'Windows does not support fpm and embed build!',
|
||||||
useUPX: 'Enable UPX compression (reduce binary size)',
|
useUPX: 'Enable UPX compression (reduce binary size)',
|
||||||
@@ -331,6 +344,10 @@ const selectCommon = () => {
|
|||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const selectAll = () => {
|
||||||
|
checkedExts.value = extFilter.value;
|
||||||
|
};
|
||||||
|
|
||||||
const extList = computed(() => {
|
const extList = computed(() => {
|
||||||
return checkedExts.value.join(',');
|
return checkedExts.value.join(',');
|
||||||
});
|
});
|
||||||
@@ -358,7 +375,7 @@ const checkedTargets = ref(['cli']);
|
|||||||
const selectedEnv = ref('spc');
|
const selectedEnv = ref('spc');
|
||||||
|
|
||||||
// chosen php version
|
// chosen php version
|
||||||
const selectedPhpVersion = ref('8.2');
|
const selectedPhpVersion = ref('8.4');
|
||||||
|
|
||||||
// chosen debug
|
// chosen debug
|
||||||
const debug = ref(0);
|
const debug = ref(0);
|
||||||
@@ -499,6 +516,38 @@ const buildCommandString = computed(() => {
|
|||||||
return `${spcCommand.value} build ${buildCommand.value} "${extList.value}"${additionalLibs.value}${debug.value ? ' --debug' : ''}${zts.value ? ' --enable-zts' : ''}${enableUPX.value ? ' --with-upx-pack' : ''}${displayINI.value}`;
|
return `${spcCommand.value} build ${buildCommand.value} "${extList.value}"${additionalLibs.value}${debug.value ? ' --debug' : ''}${zts.value ? ' --enable-zts' : ''}${enableUPX.value ? ' --with-upx-pack' : ''}${displayINI.value}`;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const craftCommandString = computed(() => {
|
||||||
|
let str = `php-version: ${selectedPhpVersion.value}\n`;
|
||||||
|
str += `extensions: "${extList.value}"\n`;
|
||||||
|
if (checkedTargets.value.join(',') === 'all') {
|
||||||
|
str += 'sapi: ' + ['cli', 'fpm', 'micro', 'embed'].join(',') + '\n';
|
||||||
|
} else {
|
||||||
|
str += `sapi: ${checkedTargets.value.join(',')}\n`;
|
||||||
|
}
|
||||||
|
if (additionalLibs.value) {
|
||||||
|
str += `libs: ${additionalLibs.value.replace('--with-libs="', '').replace('"', '').trim()}\n`;
|
||||||
|
}
|
||||||
|
if (debug.value) {
|
||||||
|
str += 'debug: true\n';
|
||||||
|
}
|
||||||
|
str += '{{position_hold}}';
|
||||||
|
if (enableUPX.value) {
|
||||||
|
str += ' with-upx-pack: true\n';
|
||||||
|
}
|
||||||
|
if (zts.value) {
|
||||||
|
str += ' enable-zts: true\n';
|
||||||
|
}
|
||||||
|
if (preBuilt.value) {
|
||||||
|
str += ' prefer-pre-built: true\n';
|
||||||
|
}
|
||||||
|
if (!str.endsWith('{{position_hold}}')) {
|
||||||
|
str = str.replace('{{position_hold}}', 'build-options:\n');
|
||||||
|
} else {
|
||||||
|
str = str.replace('{{position_hold}}', '');
|
||||||
|
}
|
||||||
|
return str;
|
||||||
|
});
|
||||||
|
|
||||||
const calculateExtLibDepends = (input) => {
|
const calculateExtLibDepends = (input) => {
|
||||||
const result = new Set();
|
const result = new Set();
|
||||||
|
|
||||||
@@ -617,6 +666,12 @@ h2 {
|
|||||||
overflow-wrap: break-word;
|
overflow-wrap: break-word;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.pre {
|
||||||
|
white-space: pre-wrap;
|
||||||
|
word-break: break-word;
|
||||||
|
overflow-wrap: break-word;
|
||||||
|
}
|
||||||
|
|
||||||
.option-line {
|
.option-line {
|
||||||
padding: 4px 8px;
|
padding: 4px 8px;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,6 +47,10 @@ export default {
|
|||||||
nav: [],
|
nav: [],
|
||||||
socialLinks: [
|
socialLinks: [
|
||||||
{icon: 'github', link: 'https://github.com/crazywhalecc/static-php-cli'}
|
{icon: 'github', link: 'https://github.com/crazywhalecc/static-php-cli'}
|
||||||
]
|
],
|
||||||
|
footer: {
|
||||||
|
message: 'Released under the MIT License.',
|
||||||
|
copyright: 'Copyright © 2023-present crazywhalecc'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,54 +1,57 @@
|
|||||||
export default {
|
export default {
|
||||||
'/en/guide/': [
|
'/en/guide/': [
|
||||||
{
|
{
|
||||||
text: 'Guide',
|
text: 'Basic Build Guides',
|
||||||
items: [
|
items: [
|
||||||
{text: 'Guide', link: '/en/guide/'},
|
{text: 'Guide', link: '/en/guide/'},
|
||||||
{text: 'Actions Build', link: '/en/guide/action-build'},
|
{text: 'Build (Local)', link: '/en/guide/manual-build'},
|
||||||
{text: 'Manual Build', link: '/en/guide/manual-build'},
|
{text: 'Build (CI)', link: '/en/guide/action-build'},
|
||||||
{text: 'Extension List', link: '/en/guide/extensions'},
|
{text: 'Supported Extensions', link: '/en/guide/extensions'},
|
||||||
{text: 'Extension Notes', link: '/en/guide/extension-notes'},
|
{text: 'Extension Notes', link: '/en/guide/extension-notes'},
|
||||||
{text: 'Command Generator', link: '/en/guide/cli-generator'},
|
{text: 'Build Command Generator', link: '/en/guide/cli-generator'},
|
||||||
{text: 'Environment Variables', link: '/en/guide/env-vars', collapsed: true,},
|
{text: 'Environment Variables', link: '/en/guide/env-vars', collapsed: true,},
|
||||||
{text: 'Dependency Table', link: '/en/guide/deps-map'},
|
{text: 'Dependency Table', link: '/en/guide/deps-map'},
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
items: [
|
text: 'Extended Build Guides',
|
||||||
{text: 'Troubleshooting', link: '/en/guide/troubleshooting'},
|
items: [
|
||||||
{text: 'Build on Windows', link: '/en/guide/build-on-windows'},
|
{text: 'Troubleshooting', link: '/en/guide/troubleshooting'},
|
||||||
],
|
{text: 'Build on Windows', link: '/en/guide/build-on-windows'},
|
||||||
}
|
{text: 'Build with GNU libc', link: '/en/guide/build-with-glibc'},
|
||||||
],
|
],
|
||||||
'/en/develop/': [
|
}
|
||||||
{
|
],
|
||||||
text: 'Development',
|
'/en/develop/': [
|
||||||
items: [
|
{
|
||||||
{text: 'Get Started', link: '/en/develop/'},
|
text: 'Development',
|
||||||
{text: 'Project Structure', link: '/en/develop/structure'},
|
items: [
|
||||||
{text: 'PHP Source Modification', link: '/en/develop/php-src-changes'},
|
{text: 'Get Started', link: '/en/develop/'},
|
||||||
],
|
{text: 'Project Structure', link: '/en/develop/structure'},
|
||||||
},
|
{text: 'PHP Source Modification', link: '/en/develop/php-src-changes'},
|
||||||
{
|
],
|
||||||
text: 'Module',
|
},
|
||||||
items: [
|
{
|
||||||
{text: 'Doctor ', link: '/en/develop/doctor-module'},
|
text: 'Module',
|
||||||
{text: 'Source', link: '/en/develop/source-module'},
|
items: [
|
||||||
]
|
{text: 'Doctor ', link: '/en/develop/doctor-module'},
|
||||||
},
|
{text: 'Source', link: '/en/develop/source-module'},
|
||||||
{
|
]
|
||||||
text: 'Extra',
|
},
|
||||||
items: [
|
{
|
||||||
{text: 'Compilation Tools', link: '/en/develop/system-build-tools'},
|
text: 'Extra',
|
||||||
]
|
items: [
|
||||||
}
|
{text: 'Compilation Tools', link: '/en/develop/system-build-tools'},
|
||||||
],
|
{text: 'craft.yml Configuration', link: '/zh/develop/craft-yml'},
|
||||||
'/en/contributing/': [
|
]
|
||||||
{
|
}
|
||||||
text: 'Contributing',
|
],
|
||||||
items: [
|
'/en/contributing/': [
|
||||||
{text: 'Contributing', link: '/en/contributing/'},
|
{
|
||||||
],
|
text: 'Contributing',
|
||||||
}
|
items: [
|
||||||
],
|
{text: 'Contributing', link: '/en/contributing/'},
|
||||||
|
],
|
||||||
|
}
|
||||||
|
],
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,54 +1,57 @@
|
|||||||
export default {
|
export default {
|
||||||
'/zh/guide/': [
|
'/zh/guide/': [
|
||||||
{
|
{
|
||||||
text: '构建指南',
|
text: '构建指南',
|
||||||
items: [
|
items: [
|
||||||
{text: '指南', link: '/zh/guide/'},
|
{text: '指南', link: '/zh/guide/'},
|
||||||
{text: 'Actions 构建', link: '/zh/guide/action-build'},
|
{text: '本地构建', link: '/zh/guide/manual-build'},
|
||||||
{text: '本地构建', link: '/zh/guide/manual-build'},
|
{text: 'Actions 构建', link: '/zh/guide/action-build'},
|
||||||
{text: '扩展列表', link: '/zh/guide/extensions'},
|
{text: '扩展列表', link: '/zh/guide/extensions'},
|
||||||
{text: '扩展注意事项', link: '/zh/guide/extension-notes'},
|
{text: '扩展注意事项', link: '/zh/guide/extension-notes'},
|
||||||
{text: '编译命令生成器', link: '/zh/guide/cli-generator'},
|
{text: '编译命令生成器', link: '/zh/guide/cli-generator'},
|
||||||
{text: '环境变量列表', link: '/zh/guide/env-vars'},
|
{text: '环境变量列表', link: '/zh/guide/env-vars'},
|
||||||
{text: '依赖关系图表', link: '/zh/guide/deps-map'},
|
{text: '依赖关系图表', link: '/zh/guide/deps-map'},
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
items: [
|
text: '扩展构建指南',
|
||||||
{text: '故障排除', link: '/zh/guide/troubleshooting'},
|
items: [
|
||||||
{text: '在 Windows 上构建', link: '/zh/guide/build-on-windows'},
|
{text: '故障排除', link: '/zh/guide/troubleshooting'},
|
||||||
],
|
{text: '在 Windows 上构建', link: '/zh/guide/build-on-windows'},
|
||||||
}
|
{text: '构建 GNU libc 兼容的二进制', link: '/zh/guide/build-with-glibc'},
|
||||||
],
|
],
|
||||||
'/zh/develop/': [
|
}
|
||||||
{
|
],
|
||||||
text: '开发指南',
|
'/zh/develop/': [
|
||||||
items: [
|
{
|
||||||
{ text: '开发简介', link: '/zh/develop/' },
|
text: '开发指南',
|
||||||
{ text: '项目结构简介', link: '/zh/develop/structure' },
|
items: [
|
||||||
{text: '对 PHP 源码的修改', link: '/zh/develop/php-src-changes'},
|
{text: '开发简介', link: '/zh/develop/'},
|
||||||
],
|
{text: '项目结构简介', link: '/zh/develop/structure'},
|
||||||
},
|
{text: '对 PHP 源码的修改', link: '/zh/develop/php-src-changes'},
|
||||||
{
|
],
|
||||||
text: '模块',
|
},
|
||||||
items: [
|
{
|
||||||
{ text: 'Doctor 环境检查工具', link: '/zh/develop/doctor-module' },
|
text: '模块',
|
||||||
{ text: '资源模块', link: '/zh/develop/source-module' },
|
items: [
|
||||||
]
|
{text: 'Doctor 环境检查工具', link: '/zh/develop/doctor-module'},
|
||||||
},
|
{text: '资源模块', link: '/zh/develop/source-module'},
|
||||||
{
|
]
|
||||||
text: '其他',
|
},
|
||||||
items: [
|
{
|
||||||
{text: '系统编译工具', link: '/zh/develop/system-build-tools'},
|
text: '其他',
|
||||||
]
|
items: [
|
||||||
}
|
{text: '系统编译工具', link: '/zh/develop/system-build-tools'},
|
||||||
],
|
{text: 'craft.yml 配置详解', link: '/zh/develop/craft-yml'},
|
||||||
'/zh/contributing/': [
|
]
|
||||||
{
|
}
|
||||||
text: '贡献指南',
|
],
|
||||||
items: [
|
'/zh/contributing/': [
|
||||||
{text: '贡献指南', link: '/zh/contributing/'},
|
{
|
||||||
],
|
text: '贡献指南',
|
||||||
}
|
items: [
|
||||||
],
|
{text: '贡献指南', link: '/zh/contributing/'},
|
||||||
|
],
|
||||||
|
}
|
||||||
|
],
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
import DefaultTheme from 'vitepress/theme'
|
import DefaultTheme from 'vitepress/theme'
|
||||||
import {inBrowser, useData} from "vitepress";
|
import {inBrowser, useData} from "vitepress";
|
||||||
import {watchEffect} from "vue";
|
import {watchEffect} from "vue";
|
||||||
|
import './style.css';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
...DefaultTheme,
|
...DefaultTheme,
|
||||||
@@ -13,4 +14,4 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
6
docs/.vitepress/theme/style.css
Normal file
6
docs/.vitepress/theme/style.css
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
/** override default styles */
|
||||||
|
.vp-sponsor-grid-image {
|
||||||
|
max-height:36px !important;
|
||||||
|
max-width: 1000px !important;
|
||||||
|
}
|
||||||
|
|
||||||
70
docs/deps-craft-yml.md
Normal file
70
docs/deps-craft-yml.md
Normal file
@@ -0,0 +1,70 @@
|
|||||||
|
```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
|
||||||
|
# Extra libraries to build (list or comma-separated are both accepted)
|
||||||
|
libs: [ ]
|
||||||
|
# [REQUIRED] Build SAPIs (list or comma-separated are both accepted)
|
||||||
|
sapi: cli,micro,fpm
|
||||||
|
# Show full console output (default: false)
|
||||||
|
debug: false
|
||||||
|
# Build options (same as `build` command options, all options are optional)
|
||||||
|
build-options:
|
||||||
|
# Before build, remove all old build files and sources (default: false)
|
||||||
|
with-clean: false
|
||||||
|
# Build with all suggested libraries (default: false)
|
||||||
|
with-suggested-libs: false
|
||||||
|
# Build with all suggested extensions (default: false)
|
||||||
|
with-suggested-exts: false
|
||||||
|
# Build extra shared extensions (list or comma-separated are both accepted)
|
||||||
|
build-shared: [ ]
|
||||||
|
# Build without stripping the binary (default: false)
|
||||||
|
no-strip: false
|
||||||
|
# Disable Opcache JIT (default: false)
|
||||||
|
disable-opcache-jit: false
|
||||||
|
# PHP configuration options (same as --with-config-file-path)
|
||||||
|
with-config-file-path: ""
|
||||||
|
# PHP configuration options (same as --with-config-file-scan-dir)
|
||||||
|
with-config-file-scan-dir: ""
|
||||||
|
# Hardcoded INI options for cli and micro SAPI (e.g. "memory_limit=4G", list accepted)
|
||||||
|
with-hardcoded-ini: [ ]
|
||||||
|
# Pretend micro SAPI as cli SAPI to avoid some frameworks to limit the usage of micro SAPI
|
||||||
|
with-micro-fake-cli: false
|
||||||
|
# Additional patch point injection files (e.g. "path/to/patch.php", list accepted)
|
||||||
|
with-added-patch: [ ]
|
||||||
|
# Ignore micro extension tests (if you are using micro SAPI, default: false)
|
||||||
|
without-micro-ext-test: false
|
||||||
|
# UPX pack the binary (default: false)
|
||||||
|
with-upx-pack: false
|
||||||
|
# Set the micro.exe program icon (only for Windows, default: "")
|
||||||
|
with-micro-logo: ""
|
||||||
|
# Set micro SAPI as win32 mode, without this, micro SAPI will be compiled as a console application (only for Windows, default: false)
|
||||||
|
enable-micro-win32: false
|
||||||
|
|
||||||
|
# Build options for shared extensions (list or comma-separated are both accepted)
|
||||||
|
shared-extensions: [ ]
|
||||||
|
|
||||||
|
# Download options
|
||||||
|
download-options:
|
||||||
|
# Use custom url for specified sources, format: "{source-name}:{url}" (e.g. "php-src:https://example.com/php-8.4.0.tar.gz")
|
||||||
|
custom-url: [ ]
|
||||||
|
# Use custom git repo for specified sources, format: "{source-name}:{branch}:{url}" (e.g. "php-src:master:https://github.com/php/php-src.git")
|
||||||
|
custom-git: [ ]
|
||||||
|
# Retries count for downloading sources (default: 5)
|
||||||
|
retry: 5
|
||||||
|
# Use pre-built libraries if available (default: false)
|
||||||
|
prefer-pre-built: true
|
||||||
|
# Do not download from alternative sources (default: false)
|
||||||
|
no-alt: false
|
||||||
|
|
||||||
|
craft-options:
|
||||||
|
doctor: true
|
||||||
|
download: true
|
||||||
|
build: true
|
||||||
|
|
||||||
|
# Extra environment variables
|
||||||
|
extra-env:
|
||||||
|
# e.g. Use github token to avoid rate limit
|
||||||
|
GITHUB_TOKEN: your-github-token
|
||||||
|
```
|
||||||
7
docs/en/develop/craft-yml.md
Normal file
7
docs/en/develop/craft-yml.md
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
---
|
||||||
|
aside: false
|
||||||
|
---
|
||||||
|
|
||||||
|
# craft.yml Configuration
|
||||||
|
|
||||||
|
<!--@include: ../../deps-craft-yml.md-->
|
||||||
@@ -16,33 +16,40 @@ The directory can be changed using the manual build option `--with-config-file-s
|
|||||||
|
|
||||||
## Can statically-compiled PHP install extensions?
|
## Can statically-compiled PHP install extensions?
|
||||||
|
|
||||||
Because the principle of installing extensions in PHP under the traditional architecture is to install new extensions using `.so` type dynamic link libraries,
|
Because the principle of installing PHP extensions under the normal mode is to use `.so` type dynamic link library to install new extensions,
|
||||||
and statically linked PHP compiled using this project cannot **directly** install new extensions using dynamic link libraries.
|
and we use the static link PHP compiled by this project. However, static linking has different definitions in different operating systems.
|
||||||
|
|
||||||
For the macOS platform, almost all binary files under macOS cannot be linked purely statically,
|
First of all, for Linux systems, statically linked binaries will not link the system's dynamic link library.
|
||||||
and almost all binary files will link macOS system libraries: `/usr/lib/libresolv.9.dylib` and `/usr/lib/libSystem.B.dylib`.
|
Purely statically linked binaries (`build with -all-static`) cannot load dynamic libraries, so new extensions cannot be added.
|
||||||
So under macOS system, statically compiled php binary files can be used under certain compilation conditions,
|
At the same time, in pure static mode, you cannot use extensions such as `ffi` to load external `.so` modules.
|
||||||
and dynamic link extensions can be used at the same time:
|
|
||||||
|
|
||||||
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`.
|
You can use the command `ldd buildroot/bin/php` to check whether the binary you built under Linux is purely statically linked.
|
||||||
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.
|
If you [build GNU libc based PHP](../guide/build-with-glibc), you can use the `ffi` extension to load external `.so` modules and load `.so` extensions with the same ABI.
|
||||||
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"`.
|
|
||||||
|
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
|
```bash
|
||||||
# build statically linked php-cli but not stripped
|
bin/spc-gnu-docker download --for-extensions=ffi,xml --with-php=8.4
|
||||||
bin/spc build ffi --build-cli --no-strip
|
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 the Linux platform, the current compilation result is a purely statically linked binary file,
|
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`.
|
||||||
and new extensions cannot be installed using a dynamic link library.
|
So on macOS, you can **directly** use SPC to build statically compiled PHP binaries with dynamically linked extensions:
|
||||||
|
|
||||||
|
1. Build shared extension `xxx.so` using: `--build-shared=XXX` option. e.g. `bin/spc build bcmath,zlib --build-shared=xdebug --build-cli`
|
||||||
|
2. You will get `buildroot/modules/xdebug.so` and `buildroot/bin/php`.
|
||||||
|
3. The `xdebug.so` file could be used for php that version and thread-safe are the same.
|
||||||
|
|
||||||
## Can it support Oracle database extension?
|
## Can it support Oracle database extension?
|
||||||
|
|
||||||
Some extensions that rely on closed source libraries, such as `oci8`, `sourceguardian`, etc.,
|
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`).
|
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 from source, so this project may never support them.
|
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 according to the above questions.
|
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,
|
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](https://github.com/crazywhalecc/static-php-cli/discussions/58). Welcome to leave a message.
|
see the discussion on [standalone-php-cli](https://github.com/crazywhalecc/static-php-cli/discussions/58). Welcome to leave a message.
|
||||||
@@ -75,6 +82,8 @@ such as Swoole Compiler, Source Guardian, etc.
|
|||||||
|
|
||||||
## Unable to use ssl
|
## 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.
|
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`.
|
This error is caused by statically compiled PHP without specifying `openssl.cafile` via `php.ini`.
|
||||||
|
|
||||||
|
|||||||
64
docs/en/guide/build-with-glibc.md
Normal file
64
docs/en/guide/build-with-glibc.md
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
# 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](https://github.com/php/php-src/issues/13648).
|
||||||
|
|
||||||
|
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](./manual-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.
|
||||||
|
|
||||||
|
Please keep in mind that we only support glibc build with `bin/spc-gnu-docker`. Compilation on RHEL 9 & 10 has been tested and is stable, but if you run into issues, we may choose not to fix them.
|
||||||
@@ -39,6 +39,21 @@ Or, if you need to modify an environment variable for a long time, you can modif
|
|||||||
|
|
||||||
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.
|
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)
|
## 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.
|
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.
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ which will be listed one by one here.
|
|||||||
|
|
||||||
## curl
|
## 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.
|
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](../faq/#unable-to-use-ssl).
|
For details on the solution, see [FAQ - Unable to use ssl](../faq/#unable-to-use-ssl).
|
||||||
|
|
||||||
@@ -46,13 +48,17 @@ This extension contains an implementation of the coroutine environment for `pdo_
|
|||||||
|
|
||||||
## swow
|
## swow
|
||||||
|
|
||||||
1. Only PHP 8.0 ~ 8.4 is supported.
|
1. Only PHP 8.0+ is supported.
|
||||||
|
|
||||||
|
## imagick
|
||||||
|
|
||||||
|
1. OpenMP support is disabled, this is recommended by the maintainers and also the case system packages.
|
||||||
|
|
||||||
## imap
|
## imap
|
||||||
|
|
||||||
1. Kerberos is not supported
|
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.
|
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](https://github.com/Webklex/php-imap)
|
3. The extension was dropped from php 8.4, we recommend you look for an alternative implementation, such as [Webklex/php-imap](https://github.com/Webklex/php-imap)
|
||||||
|
|
||||||
## gd
|
## gd
|
||||||
|
|
||||||
@@ -76,11 +82,9 @@ and this extension cannot be compiled into php by static linking, so it cannot b
|
|||||||
|
|
||||||
## xdebug
|
## xdebug
|
||||||
|
|
||||||
1. Xdebug is a Zend extension. The functions of Xdebug depend on PHP's Zend engine and underlying code.
|
1. Xdebug is only buildable as a shared extension. On Linux, you'll need to use a SPC_TARGET like `native-native -dynamic` or `native-native-gnu`.
|
||||||
If you want to statically compile it into PHP, you may need a huge amount of patch code, which is not feasible.
|
2. When using Linux/glibc or macOS, you can compile Xdebug as a shared extension using --build-shared="xdebug".
|
||||||
2. The macOS platform can compile an xdebug extension under PHP compiled on the same platform,
|
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`.
|
||||||
extract the `xdebug.so` file, and then use the `--no-strip` parameter in static-php-cli to retain the debug symbol table and add the `ffi` extension.
|
|
||||||
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
|
## xml
|
||||||
|
|
||||||
@@ -118,13 +122,13 @@ For details on the solution, see [FAQ - Unable to use ssl](../faq/#unable-to-use
|
|||||||
|
|
||||||
## password-argon2
|
## password-argon2
|
||||||
|
|
||||||
1. password-argon2 is not a standard extension, it is an additional algorithm for the `password_hash` function.
|
1. password-argon2 is not a standard extension. The algorithm `PASSWORD_ARGON2ID` for the `password_hash` function needs libsodium or libargon2 to work.
|
||||||
2. On Linux systems, `password-argon2` dependency `libargon2` conflicts with the `libsodium` library.
|
2. using password-argon2 enables multithread support for this.
|
||||||
|
|
||||||
## ffi
|
## ffi
|
||||||
|
|
||||||
1. Linux not supported yet: Due to limitations of the Linux system, although the ffi extension can be compiled successfully, it cannot be used to load other `so` extensions.
|
1. Due to the limitation of musl libc's static linkage, you cannot use ffi because dynamic libraries cannot be loaded.
|
||||||
The prerequisite for Linux to support loading `so` extensions is dynamic compilation, but dynamic compilation conflicts with the purpose of this project.
|
If you need to use the ffi extension, see [Compile PHP with GNU libc](./build-with-glibc).
|
||||||
2. macOS supports the ffi extension, but errors will occur when some kernels do not contain debugging symbols.
|
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.
|
3. Windows x64 supports the ffi extension.
|
||||||
|
|
||||||
@@ -147,5 +151,10 @@ Parallel is only supported on PHP 8.0 ZTS and above.
|
|||||||
|
|
||||||
## spx
|
## spx
|
||||||
|
|
||||||
1. The [SPX extension](https://github.com/NoiseByNorthwest/php-spx) only supports NTS mode.
|
1. SPX does not support Windows, and the official repository does not support static compilation. static-php-cli uses a [modified version](https://github.com/static-php/php-spx).
|
||||||
2. SPX does not support Windows, and the official repository does not support static compilation. static-php-cli uses a [modified version](https://github.com/static-php/php-spx).
|
|
||||||
|
## 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.
|
||||||
|
|||||||
@@ -5,14 +5,10 @@ currently supporting Linux and macOS systems.
|
|||||||
|
|
||||||
In the guide section, you will learn how to use static php cli to build standalone PHP programs.
|
In the guide section, you will learn how to use static php cli to build standalone PHP programs.
|
||||||
|
|
||||||
- [GitHub Action Build](./action-build)
|
- [Build (local)](./manual-build)
|
||||||
- [Manual Build](./manual-build)
|
- [Build (GitHub Actions)](./action-build)
|
||||||
- [Supported Extensions](./extensions)
|
- [Supported Extensions](./extensions)
|
||||||
|
|
||||||
::: tip
|
|
||||||
If you are a native English speaker, some corrections to the documentation are welcome.
|
|
||||||
:::
|
|
||||||
|
|
||||||
## Compilation Environment
|
## Compilation Environment
|
||||||
|
|
||||||
The following is the architecture support situation, where :gear: represents support for GitHub Action build,
|
The following is the architecture support situation, where :gear: represents support for GitHub Action build,
|
||||||
@@ -36,7 +32,7 @@ Windows currently only supports the x86_64 architecture, and does not support 32
|
|||||||
|
|
||||||
## Supported PHP Version
|
## Supported PHP Version
|
||||||
|
|
||||||
Currently, static php cli supports PHP versions 8.1 to 8.4, and theoretically supports PHP 8.0 and earlier versions.
|
Currently, static php cli supports PHP versions 8.1 to 8.5, and theoretically supports PHP 8.0 and earlier versions.
|
||||||
Simply select the earlier version when downloading.
|
Simply select the earlier version when downloading.
|
||||||
However, due to some extensions and special components that have stopped supporting earlier versions of PHP,
|
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.
|
static-php-cli will not explicitly support earlier versions.
|
||||||
|
|||||||
@@ -1,3 +1,7 @@
|
|||||||
|
---
|
||||||
|
outline: 'deep'
|
||||||
|
---
|
||||||
|
|
||||||
# Build (Linux, macOS, FreeBSD)
|
# Build (Linux, macOS, FreeBSD)
|
||||||
|
|
||||||
This section covers the build process for Linux, macOS, and FreeBSD. If you want to build on Windows,
|
This section covers the build process for Linux, macOS, and FreeBSD. If you want to build on Windows,
|
||||||
@@ -57,56 +61,6 @@ cd static-php-cli
|
|||||||
composer update
|
composer update
|
||||||
```
|
```
|
||||||
|
|
||||||
### 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
|
|
||||||
|
|
||||||
# [Debian], you need to make sure your php version >= 8.1 and composer >= 2.0
|
|
||||||
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.
|
|
||||||
:::
|
|
||||||
|
|
||||||
### 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 Precompiled Static PHP Binaries
|
### Use Precompiled Static PHP Binaries
|
||||||
|
|
||||||
If you don't want to use Docker and install PHP in the system,
|
If you don't want to use Docker and install PHP in the system,
|
||||||
@@ -133,13 +87,104 @@ This script will download two files in total: `bin/php` and `bin/composer`. Afte
|
|||||||
it is equivalent to installing PHP in the system, you can directly Use commands such as `composer`, `php -v`, or directly use `bin/spc`.
|
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`.
|
2. Direct call, such as executing static-php-cli command: `bin/php bin/spc --help`, executing Composer: `bin/php bin/composer update`.
|
||||||
|
|
||||||
## Command - download
|
### 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
|
||||||
|
|
||||||
|
# [Debian], you need to make sure your php version >= 8.1 and composer >= 2.0
|
||||||
|
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.
|
||||||
|
:::
|
||||||
|
|
||||||
|
## Build with craft (recommended)
|
||||||
|
|
||||||
|
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](./cli-generator) or written manually.
|
||||||
|
|
||||||
|
For manual writing, please refer to the comments in [craft.yml configuration](../develop/craft-yml.md) 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](./manual-build#command-micro-combine).
|
||||||
|
- embed: See [Using embed](./manual-build#embed-usage).
|
||||||
|
- frankenphp: The build result is `buildroot/bin/frankenphp`.
|
||||||
|
|
||||||
|
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,
|
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.
|
including php-src and the source code of various dependent libraries.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Download all dependencies
|
# Download all dependencies, defaults to php 8.4
|
||||||
bin/spc download --all
|
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
|
# Download all dependent packages, and specify the main version of PHP to download, optional: 8.1, 8.2, 8.3, 8.4
|
||||||
@@ -197,8 +242,8 @@ Also, it is available when downloading with the `--for-extensions` option.
|
|||||||
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Specifying to download a beta version of PHP8.3
|
# Specifying to download a alpha version of PHP 8.5
|
||||||
bin/spc download --all -U "php-src:https://downloads.php.net/~eric/php-8.3.0beta1.tar.gz"
|
bin/spc download --all -U "php-src:https://downloads.php.net/~edorian/php-8.5.0alpha2.tar.xz"
|
||||||
|
|
||||||
# Specifying to download an older version of the curl library
|
# 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"
|
bin/spc download --all -U "curl:https://curl.se/download/curl-7.88.1.tar.gz"
|
||||||
@@ -217,7 +262,7 @@ bin/spc download --for-extensions=redis -G "php-src:master:https://github.com/ph
|
|||||||
bin/spc download --for-extensions=swoole -G "swoole:master:https://github.com/swoole/swoole-src.git"
|
bin/spc download --for-extensions=swoole -G "swoole:master:https://github.com/swoole/swoole-src.git"
|
||||||
```
|
```
|
||||||
|
|
||||||
## Command - doctor
|
### Command - doctor
|
||||||
|
|
||||||
If you can run `bin/spc` normally but cannot compile static PHP or dependent libraries normally,
|
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.
|
you can run `bin/spc doctor` first to check whether the system itself lacks dependencies.
|
||||||
@@ -230,13 +275,13 @@ bin/spc doctor
|
|||||||
bin/spc doctor --auto-fix
|
bin/spc doctor --auto-fix
|
||||||
```
|
```
|
||||||
|
|
||||||
## Command - build
|
### Command - build
|
||||||
|
|
||||||
Use the build command to start building the static php binary.
|
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.
|
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.
|
It is recommended to use `doctor` to check the environment.
|
||||||
|
|
||||||
### Basic build
|
#### Basic build
|
||||||
|
|
||||||
You need to go to [Extension List](./extensions) or [Command Generator](./cli-generator) to select the extension you want to add,
|
You need to go to [Extension List](./extensions) or [Command Generator](./cli-generator) to select the extension you want to add,
|
||||||
and then use the command `bin/spc build` to compile.
|
and then use the command `bin/spc build` to compile.
|
||||||
@@ -246,6 +291,7 @@ You need to specify a compilation target, choose from the following parameters:
|
|||||||
- `--build-fpm`: Build a fpm sapi (php-fpm, used in conjunction with other traditional fpm architecture software such as nginx)
|
- `--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-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-embed`: Build an embed sapi (used to embed into other C language programs)
|
||||||
|
- `--build-frankenphp`: Build a [FrankenPHP](https://github.com/php/frankenphp) executable
|
||||||
- `--build-all`: build all above sapi
|
- `--build-all`: build all above sapi
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
@@ -283,16 +329,7 @@ bin/spc build bcmath,curl,openssl,ftp,posix,pcntl --build-cli
|
|||||||
```
|
```
|
||||||
:::
|
:::
|
||||||
|
|
||||||
### Debug
|
#### Build Options
|
||||||
|
|
||||||
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
|
|
||||||
```
|
|
||||||
|
|
||||||
### Build Options
|
|
||||||
|
|
||||||
During the compilation process, in some special cases,
|
During the compilation process, in some special cases,
|
||||||
the compiler and the content of the compilation directory need to be intervened.
|
the compiler and the content of the compilation directory need to be intervened.
|
||||||
@@ -302,7 +339,7 @@ You can try to use the following commands:
|
|||||||
- `--cxx=XXX`: Specifies the execution command of the C++ language compiler (Linux defaults to `g++`, macOS defaults to `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
|
- `--with-clean`: clean up old make files before compiling PHP
|
||||||
- `--enable-zts`: Make compiled PHP thread-safe version (default is NTS version)
|
- `--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)
|
- `--no-strip`: Do not run `strip` after compiling the PHP library to trim the binary file to reduce its size
|
||||||
- `--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-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](../faq/index.html#what-is-the-path-of-php-ini) for default paths)
|
- `--with-config-file-path=XXX`: Set the path in which to look for `php.ini` (Check [here](../faq/index.html#what-is-the-path-of-php-ini) for default paths)
|
||||||
- `--with-config-file-scan-dir=XXX`: Set the directory to scan for `.ini` files after reading `php.ini` (Check [here](../faq/index.html#what-is-the-path-of-php-ini) for default paths)
|
- `--with-config-file-scan-dir=XXX`: Set the directory to scan for `.ini` files after reading `php.ini` (Check [here](../faq/index.html#what-is-the-path-of-php-ini) for default paths)
|
||||||
@@ -314,6 +351,7 @@ You can try to use the following commands:
|
|||||||
- `--with-suggested-exts`: Add `ext-suggests` as dependencies when compiling
|
- `--with-suggested-exts`: Add `ext-suggests` as dependencies when compiling
|
||||||
- `--with-suggested-libs`: Add `lib-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-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:
|
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:
|
||||||
|
|
||||||
@@ -321,6 +359,15 @@ For hardcoding INI options, it works for cli, micro, embed sapi. Here is a simpl
|
|||||||
bin/spc build bcmath,pcntl,posix --build-all -I "memory_limit=4G" -I "disable_functions=system"
|
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
|
## 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.
|
Use the `micro:combine` command to build the compiled `micro.sfx` and your code (`.php` or `.phar` file) into an executable binary.
|
||||||
@@ -397,6 +444,31 @@ manually unpack and copy the package to a specified location, and we can use com
|
|||||||
bin/spc extract php-src,libxml2
|
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
|
||||||
|
bin/spc dump-extensions /path-to/tour/project/ --no-dev
|
||||||
|
|
||||||
|
# Output in the extension list format acceptable to the spc command (comma separated)
|
||||||
|
bin/spc dump-extensions /path-to/tour/project/ --format=text
|
||||||
|
|
||||||
|
# Output as a JSON list
|
||||||
|
bin/spc dump-extensions /path-to/tour/project/ --format=json
|
||||||
|
|
||||||
|
# When the project does not have any extensions, output the specified extension combination instead of returning failure
|
||||||
|
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
|
## Dev Command - dev
|
||||||
|
|
||||||
Debug commands refer to a collection of commands that can assist in outputting some information
|
Debug commands refer to a collection of commands that can assist in outputting some information
|
||||||
@@ -439,6 +511,8 @@ When `bin/spc doctor` automatically repairs the Windows environment, tools such
|
|||||||
Here is an example of installing the tool:
|
Here is an example of installing the tool:
|
||||||
|
|
||||||
- Download and install UPX (Linux and Windows only): `bin/spc install-pkg upx`
|
- Download and install UPX (Linux and Windows only): `bin/spc install-pkg upx`
|
||||||
|
- Download and install nasm (Windows only): `bin/spc install-pkg nasm`
|
||||||
|
- Download and install go-xcaddy: `bin/spc install-pkg go-xcaddy`
|
||||||
|
|
||||||
## Command - del-download
|
## Command - del-download
|
||||||
|
|
||||||
|
|||||||
@@ -38,3 +38,5 @@ and then determine the command that reported the error.
|
|||||||
The error terminal output is very important for fixing compilation errors.
|
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),
|
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.
|
and include the `spc` command and parameters used.
|
||||||
|
|
||||||
|
If you are rebuilding, please refer to the [Local Build - Multiple Builds](./manual-build#multiple-builds) section.
|
||||||
|
|||||||
@@ -21,3 +21,16 @@ features:
|
|||||||
- title: Dependency Management
|
- title: Dependency Management
|
||||||
details: static-php-cli comes with dependency management and supports installation of different types of PHP extensions.
|
details: static-php-cli comes with dependency management and supports installation of different types of PHP extensions.
|
||||||
---
|
---
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import {VPSponsors} from "vitepress/theme";
|
||||||
|
const sponsors = [
|
||||||
|
{ name: 'Beyond Code', img: '/images/beyondcode-seeklogo.png', url: 'https://beyondco.de/' },
|
||||||
|
{ name: 'NativePHP', img: '/images/nativephp-logo.svg', url: 'https://nativephp.com/' },
|
||||||
|
];
|
||||||
|
</script>
|
||||||
|
|
||||||
|
## Special Sponsors
|
||||||
|
|
||||||
|
<VPSponsors :data="sponsors"/>
|
||||||
|
|
||||||
|
|||||||
BIN
docs/public/images/beyondcode-seeklogo.png
Normal file
BIN
docs/public/images/beyondcode-seeklogo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 29 KiB |
6
docs/public/images/nativephp-logo.svg
Normal file
6
docs/public/images/nativephp-logo.svg
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 764 100">
|
||||||
|
<path fill="#505b93" d="M29.5,98.4H0V1.2h29.5V98.4z"/>
|
||||||
|
<path fill="#00aaa6" d="M96.7,98.4H67.2V1.2h29.5V98.4z"/>
|
||||||
|
<path fill="#272d48" d="M96.7,98.4H29.5V1.2L96.7,98.4z"/>
|
||||||
|
<path fill="#272d48" d="M102.6,54.5c0-6.2,1.3-11.8,4.1-16.7c2.7-5,6.7-8.8,11.9-11.6c5.2-2.8,11.4-4.2,18.6-4.2c1.1,0,2.8,0.1,5.2,0.3 c4.9,0.4,9.1,1.3,12.5,2.8c3.4,1.5,6.4,3.4,9.1,5.9v-7.2h25.8v74.7h-25.8v-7.2c-2.5,2.6-5.6,4.6-9.4,6.1c-3.8,1.5-7.9,2.4-12.1,2.6 c-0.9,0.1-2.3,0.1-4.1,0.1c-7.2,0-13.4-1.4-18.8-4.1c-5.4-2.7-9.5-6.6-12.4-11.5c-2.9-4.9-4.3-10.5-4.3-16.6V54.5z M128.4,63.9 c0,9.2,5.9,13.8,17.7,13.8c11.8,0,17.7-4.6,17.7-13.8v-5.6c0-9.3-5.9-14-17.7-14c-11.8,0-17.7,4.7-17.7,14V63.9z M208.3,98.4V47h-12.8V23.7l12.8-0.2V1.2h25.9l0.1,22.4h18.3V47h-18.4v51.4 M287.3,98.4h-25.9V23.6h25.9V98.4z M351,98.4H325l-31-74.8H320L338,68l18-44.5h25.9L351,98.4z M454.9,87.6c-4.1,4.2-8.8,7.3-14.1,9.3c-5.3,2-11.8,2.9-19.5,2.9c-8,0-15.1-1.4-21.3-4.2 c-6.2-2.8-11.1-6.7-14.7-11.6c-3.5-5-5.3-10.6-5.3-17V54.6c0-6.5,1.7-12.2,5.2-17.1c3.4-4.9,8.2-8.7,14.2-11.3c6-2.7,12.7-4,20-4 c8,0,15,1.5,21.2,4.3c6.1,2.9,10.9,7,14.4,12.4c3.4,5.4,5.2,11.6,5.2,18.7c0,1.7-0.2,4.2-0.7,7.7l-54.2,0.1v2.1 c0,4.1,1.5,7.3,4.4,9.4c2.9,2.2,6.9,3.2,11.8,3.2c4.6,0,8.5-0.6,11.8-1.8c3.2-1.2,6.4-3.5,9.4-6.8L454.9,87.6z M434.4,51.4 c0-3.1-1.4-5.5-4.2-7.1c-2.8-1.6-6.4-2.4-10.8-2.4s-7.9,0.8-10.5,2.4c-2.6,1.6-3.8,4-3.8,7.1H434.4z M466,98.4V1.2h56c9.9,0,17.8,1.9,23.7,5.6c5.9,3.7,10,8.2,12.2,13.3c2.3,5.1,3.4,10.1,3.4,15 c0,4.8-1.2,9.7-3.5,14.7c-2.3,5-6.4,9.2-12.2,12.8c-5.8,3.6-13.7,5.4-23.7,5.4h-30.2v30.5H466z M522,44.6c9,0,13.6-3.3,13.6-9.9 c0-6.9-4.6-10.3-13.7-10.3h-30.1v20.2H522z M593,98.4h-25.8V1.2H593v38h43.9v-38h25.8v97.2h-25.8V59.9H593V98.4z M668.6,98.4V1.2h56c9.9,0,17.8,1.9,23.7,5.6c5.9,3.7,10,8.2,12.2,13.3c2.3,5.1,3.4,10.1,3.4,15 c0,4.8-1.2,9.7-3.5,14.7c-2.3,5-6.4,9.2-12.2,12.8c-5.8,3.6-13.7,5.4-23.7,5.4h-30.2v30.5H668.6z M724.6,44.6c9,0,13.6-3.3,13.6-9.9 c0-6.9-4.6-10.3-13.7-10.3h-30.1v20.2H724.6z M291.1,20.2h-33.5V0h33.5V20.2z"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 2.0 KiB |
@@ -4,45 +4,48 @@
|
|||||||
|
|
||||||
## 贡献方法
|
## 贡献方法
|
||||||
|
|
||||||
如果你有代码或文档想要贡献,需要先了解以下内容。
|
如果你有代码或文档要贡献,以下是你需要首先了解的内容。
|
||||||
|
|
||||||
1. 你要贡献什么类型的代码?(新扩展、修复 Bug、安全问题、项目框架优化、文档)
|
1. 你要贡献什么类型的代码?(新扩展、修复 Bug、安全问题、项目框架优化、文档)
|
||||||
2. 如果你贡献了新文件或新片段,你的代码是否经过 `php-cs-fixer` 和 `phpstan` 的检查?
|
2. 如果你贡献了新文件或新片段,你的代码是否经过 `php-cs-fixer` 和 `phpstan` 的检查?
|
||||||
3. 在贡献代码前是否充分阅读了 [开发指南](../develop/)?
|
3. 在贡献代码前是否充分阅读了 [开发指南](../develop/)?
|
||||||
|
|
||||||
如果你可以回答以上问题,并已经对代码做出了修改,可以及时在项目 GitHub 仓库发起 Pull Request。待代码审查完毕后,可根据建议修改代码,或直接合并到主分支。
|
如果你能回答上述问题并对代码进行了修改,可以及时在项目 GitHub 仓库发起 Pull Request。
|
||||||
|
代码审查完成后,可以根据建议修改代码,或直接合并到主分支。
|
||||||
|
|
||||||
## 贡献类型
|
## 贡献类型
|
||||||
|
|
||||||
本项目主要用途是编译静态链接的 PHP 二进制,基于 `symfony/console` 编写了命令行处理功能。在开发之前,如果你对它不够熟悉,
|
本项目的主要目的是编译静态链接的 PHP 二进制文件,命令行处理功能基于 `symfony/console` 编写。
|
||||||
可以先查看 [symfony/console 文档](https://symfony.com/doc/current/components/console.html)。
|
在开发之前,如果你对它不够熟悉,请先查看 [symfony/console 文档](https://symfony.com/doc/current/components/console.html)。
|
||||||
|
|
||||||
### 安全问题
|
### 安全更新
|
||||||
|
|
||||||
因为本项目基本上是属于本地运行的 PHP 项目,一般来说不会存在远程攻击行为。但如果你发现了此类问题,请**不要**在 GitHub 仓库提交 PR 或 Issue,
|
因为本项目基本上是一个本地运行的 PHP 项目,一般来说不会有远程攻击。
|
||||||
你需要通过 [邮件](mailto:admin@zhamao.me) 的方式联系项目维护者(crazywhalecc)。
|
但如果你发现此类问题,请**不要**在 GitHub 仓库提交 PR 或 Issue,
|
||||||
|
你需要通过 [邮件](mailto:admin@zhamao.me) 联系项目维护者(crazywhalecc)。
|
||||||
|
|
||||||
### 修复 Bug
|
### 修复 Bug
|
||||||
|
|
||||||
修复 Bug 一般不涉及项目结构和框架的修改,所以如果你可以定位到错误代码并直接修复它,请直接提交 PR。
|
修复 Bug 一般不涉及项目结构和框架的修改,所以如果你能定位到错误代码并直接修复它,请直接提交 PR。
|
||||||
|
|
||||||
### 新扩展
|
### 新扩展
|
||||||
|
|
||||||
对于添加一个新扩展来说,你需要先了解一些本项目的基本结构,以及如何根据现有的逻辑添加新扩展。在本页的下一章节将会详细介绍。
|
对于添加新扩展,你需要了解项目的一些基本结构以及如何根据现有逻辑添加新扩展。
|
||||||
|
这将在本页的下一节中详细介绍。
|
||||||
总的来说,你需要:
|
总的来说,你需要:
|
||||||
|
|
||||||
1. 评估扩展是否可以内联编译到 PHP 中。
|
1. 评估扩展是否可以内联编译到 PHP 中。
|
||||||
2. 评估扩展的依赖库(如果有)是否可以静态编译。
|
2. 评估扩展的依赖库(如果有)是否可以静态编译。
|
||||||
3. 写出扩展的依赖库在不同平台编译命令。
|
3. 编写不同平台的库编译命令。
|
||||||
4. 验证扩展及其依赖库能否与现有扩展和依赖库兼容。
|
4. 验证扩展及其依赖项与现有扩展和依赖项兼容。
|
||||||
5. 验证扩展在 `cli`、`micro`、`fpm`、`embed` 几种 SAPI 中均正常工作。
|
5. 验证扩展在 `cli`、`micro`、`fpm`、`embed` SAPIs 中正常工作。
|
||||||
6. 编写文档,加入你的扩展。
|
6. 编写文档并添加你的扩展。
|
||||||
|
|
||||||
### 项目框架优化
|
### 项目框架优化
|
||||||
|
|
||||||
如果你已经熟悉 `symfony/console` 的工作原理,并同时要对项目的框架进行一些修改或优化,请先了解以下事情:
|
如果你已经熟悉 `symfony/console` 的工作原理,并同时要对项目的框架进行一些修改或优化,请先了解以下事情:
|
||||||
|
|
||||||
1. 加入扩展不属于项目框架优化,但如果你在加入新的扩展时发现不得不优化框架,则需先对框架本身进行修改,然后再加入扩展。
|
1. 添加扩展不属于项目框架优化,但如果你在添加新扩展时发现必须优化框架,则需要先修改框架本身,然后再添加扩展。
|
||||||
2. 对于一些大规模逻辑修改(例如涉及 LibraryBase、Extension 对象等的修改)时,建议先提交 Issue 或 Draft PR 进行讨论方案。
|
2. 对于一些大规模逻辑修改(例如涉及 LibraryBase、Extension 对象等的修改),建议先提交 Issue 或 Draft PR 进行讨论。
|
||||||
3. 项目早期为纯中文开发项目,代码中存在一部分中文的注释。国际化项目后你可以提交 PR 将这些注释翻译为英语。
|
3. 在项目早期,它是一个纯私有开发项目,代码中有一些中文注释。项目国际化后,你可以提交 PR 将这些注释翻译为英语。
|
||||||
4. 请不要在代码中提交包含较多无用的代码片段,例如大量未被使用的变量、方法、类、重复写了很多次的代码。
|
4. 请不要在代码中提交更多无用的代码片段,例如大量未使用的变量、方法、类以及多次重写的代码。
|
||||||
|
|||||||
7
docs/zh/develop/craft-yml.md
Normal file
7
docs/zh/develop/craft-yml.md
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
---
|
||||||
|
aside: false
|
||||||
|
---
|
||||||
|
|
||||||
|
# craft.yml 配置
|
||||||
|
|
||||||
|
<!--@include: ../../deps-craft-yml.md-->
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
开发本项目需要安装部署 PHP 环境,以及一些 PHP 项目常用的扩展和 Composer。
|
开发本项目需要安装部署 PHP 环境,以及一些 PHP 项目常用的扩展和 Composer。
|
||||||
|
|
||||||
项目的开发环境和运行环境几乎完全一致,你可以参照 **指南-本地构建** 部分安装系统 PHP 或使用本项目预构建的静态 PHP 作为环境,这里不再赘述。
|
项目的开发环境和运行环境几乎完全一致。你可以参照 **手动构建** 部分安装系统 PHP 或使用本项目预构建的静态 PHP 作为环境。这里不再赘述。
|
||||||
|
|
||||||
抛开用途,本项目本身其实就是一个 `php-cli` 程序,你可以将它当作一个正常的 PHP 项目进行编辑和开发,同时你需要了解不同系统的 Shell 命令行。
|
抛开用途,本项目本身其实就是一个 `php-cli` 程序,你可以将它当作一个正常的 PHP 项目进行编辑和开发,同时你需要了解不同系统的 Shell 命令行。
|
||||||
|
|
||||||
@@ -18,10 +18,10 @@
|
|||||||
curl,dom,filter,mbstring,openssl,pcntl,phar,posix,sodium,tokenizer,xml,xmlwriter
|
curl,dom,filter,mbstring,openssl,pcntl,phar,posix,sodium,tokenizer,xml,xmlwriter
|
||||||
```
|
```
|
||||||
|
|
||||||
static-php-cli 项目本身不需要这么多扩展,但在开发过程中,你会用到 Composer、PHPUnit 等工具,它们需要这些扩展。
|
static-php-cli 项目本身不需要这么多扩展,但在开发过程中,你会用到 Composer 和 PHPUnit 等工具,它们需要这些扩展。
|
||||||
|
|
||||||
> 对于 static-php-cli 自身构建的 micro 自执行二进制,仅需要 `pcntl,posix,mbstring,tokenizer,phar`。
|
> 对于 static-php-cli 自身构建的 micro 自执行二进制,仅需要 `pcntl,posix,mbstring,tokenizer,phar`。
|
||||||
|
|
||||||
## 开始开发
|
## 开始开发
|
||||||
|
|
||||||
继续向下查看项目结构的文档,你可以从中了解 `static-php-cli` 是如何运作的。
|
继续向下查看项目结构文档,你可以学习 `static-php-cli` 是如何工作的。
|
||||||
|
|||||||
@@ -4,76 +4,88 @@
|
|||||||
|
|
||||||
## php.ini 的路径是什么?
|
## php.ini 的路径是什么?
|
||||||
|
|
||||||
在 Linux、macOS 和 FreeBSD 上,`php.ini` 的默认路径是 `/usr/local/etc/php/php.ini`。
|
在 Linux、macOS 和 FreeBSD 上,`php.ini` 的路径是 `/usr/local/etc/php/php.ini`。
|
||||||
在 Windows 中,路径是 `C:\windows\php.ini` 或 `php.exe` 所在的当前目录。
|
在 Windows 中,路径是 `C:\windows\php.ini` 或 `php.exe` 所在的当前目录。
|
||||||
可以在 *nix 系统中使用手动构建选项 `--with-config-file-path` 来更改查找 `php.ini` 的目录。
|
可以在 *nix 系统中使用手动构建选项 `--with-config-file-path` 来更改查找 `php.ini` 的目录。
|
||||||
|
|
||||||
此外,在 Linux、macOS 和 FreeBSD 上,`/usr/local/etc/php/conf.d` 目录中的 `*.ini` 文件也会被加载。
|
此外,在 Linux、macOS 和 FreeBSD 上,`/usr/local/etc/php/conf.d` 目录中的 `.ini` 文件也会被加载。
|
||||||
在 Windows 中,该路径默认为空。
|
在 Windows 中,该路径默认为空。
|
||||||
可以使用手动构建选项 `--with-config-file-scan-dir` 更改该目录。
|
可以使用手动构建选项 `--with-config-file-scan-dir` 更改该目录。
|
||||||
|
|
||||||
PHP 默认也会从 [其他标准位置](https://www.php.net/manual/zh/configuration.file.php) 中搜索 `php.ini`。
|
PHP 默认也会从 [其他标准位置](https://www.php.net/manual/zh/configuration.file.php) 中搜索 `php.ini`。
|
||||||
|
|
||||||
## 静态编译的 PHP 可以安装扩展吗
|
## 静态编译的 PHP 可以安装扩展吗?
|
||||||
|
|
||||||
因为传统架构下的 PHP 安装扩展的原理是使用 `.so` 类型的动态链接的库方式安装新扩展,而使用本项目编译的静态链接的 PHP 无法**直接**使用动态链接库安装新扩展。
|
因为传统架构下的 PHP 安装扩展的原理是使用 `.so` 类型的动态链接的库方式安装新扩展,而使用本项目编译的静态链接的 PHP。但是静态链接在不同操作系统有不同的定义。
|
||||||
|
|
||||||
对于 macOS 平台来说,macOS 下的几乎所有二进制文件都无法真正纯静态链接,几乎所有二进制文件都会链接 macOS 的系统库:`/usr/lib/libresolv.9.dylib` 和 `/usr/lib/libSystem.B.dylib`。
|
首先,对于 Linux 系统,静态链接的二进制文件不会链接系统的动态链接库。纯静态链接的二进制文件(`-all-static`)无法加载动态库,因此无法添加新扩展。
|
||||||
所以在 macOS 系统下,在特定的编译条件下可以使用静态编译的 php 二进制文件,同时使用动态链接的扩展:
|
同时,在纯静态模式下,你也不能使用 `ffi` 等扩展来加载外部 `.so` 模块。
|
||||||
|
|
||||||
1. 使用 `--no-strip` 参数,将不会对二进制文件去除调试符号等信息,以供使用 `Xdebug` 等外部 Zend 扩展。
|
你可以使用命令 `ldd buildroot/bin/php` 来检查你在 Linux 下构建的二进制文件是否为纯静态链接。
|
||||||
2. 如果要编译某些 Zend 扩展,使用 Homebrew、MacPorts、源码编译的形式,在所在的操作系统安装一个普通版本的 PHP。
|
|
||||||
3. 使用 `phpize && ./configure && make` 命令编译想要使用的扩展。
|
如果你 [构建基于 GNU libc 的 PHP](../guide/build-with-glibc),你可以使用 `ffi` 扩展来加载外部 `.so` 模块,并加载具有相同 ABI 的 `.so` 扩展。
|
||||||
4. 将扩展文件 `xxxx.so` 拷贝到外部,使用静态编译的 PHP 二进制,例如使用 Xdebug 扩展:`cd buildroot/bin/ && ./php -d "zend_extension=/path/to/xdebug.so"`。
|
|
||||||
|
例如,你可以使用以下命令构建一个与 glibc 动态链接的静态 PHP 二进制文件,支持 FFI 扩展并加载相同 PHP 版本和相同 TS 类型的 `xdebug.so` 扩展:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# 构建静态 php-cli
|
bin/spc-gnu-docker download --for-extensions=ffi,xml --with-php=8.4
|
||||||
bin/spc build ffi --build-cli --no-strip
|
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
|
||||||
```
|
```
|
||||||
|
|
||||||
对于 Linux 平台来说,目前的编译结果为纯静态链接的二进制文件,无法使用动态链接库安装新扩展。
|
对于 macOS 平台,macOS 下的几乎所有二进制文件都无法真正纯静态链接,几乎所有二进制文件都会链接 macOS 系统库:`/usr/lib/libresolv.9.dylib` 和 `/usr/lib/libSystem.B.dylib`。
|
||||||
|
因此,在 macOS 上,你可以**直接**使用 SPC 构建具有动态链接扩展的静态编译 PHP 二进制文件:
|
||||||
|
|
||||||
## 可以支持 Oracle 数据库扩展吗
|
1. 使用 `--build-shared=XXX` 选项构建共享扩展 `xxx.so`。例如:`bin/spc build bcmath,zlib --build-shared=xdebug --build-cli`
|
||||||
|
2. 你将获得 `buildroot/modules/xdebug.so` 和 `buildroot/bin/php`。
|
||||||
|
3. `xdebug.so` 文件可用于版本和线程安全相同的 php。
|
||||||
|
|
||||||
|
## 可以支持 Oracle 数据库扩展吗?
|
||||||
|
|
||||||
部分依赖库闭源的扩展,如 `oci8`、`sourceguardian` 等,它们没有提供纯静态编译的依赖库文件(`.a`),仅提供了动态依赖库文件(`.so`),
|
部分依赖库闭源的扩展,如 `oci8`、`sourceguardian` 等,它们没有提供纯静态编译的依赖库文件(`.a`),仅提供了动态依赖库文件(`.so`),
|
||||||
这些扩展无法使用源码的形式编译到 static-php-cli 中,所以本项目可能永远也不会支持这些扩展。不过,理论上你可以根据上面的问题在 macOS 下接入和使用这类扩展。
|
这些扩展无法使用源码的形式编译到 static-php-cli 中,所以本项目可能永远也不会支持这些扩展。不过,理论上你可以根据上面的问题在 macOS 和 Linux 下接入和使用这类扩展。
|
||||||
|
|
||||||
如果你对此类扩展有需求,或者大部分人都对这些闭源扩展使用有需求,
|
如果你对此类扩展有需求,或者大部分人都对这些闭源扩展使用有需求,
|
||||||
可以看看有关 [standalone-php-cli](https://github.com/crazywhalecc/static-php-cli/discussions/58) 的讨论。欢迎留言。
|
可以看看有关 [standalone-php-cli](https://github.com/crazywhalecc/static-php-cli/discussions/58) 的讨论。欢迎留言。
|
||||||
|
|
||||||
## 支持 Windows 吗
|
## 支持 Windows 吗?
|
||||||
|
|
||||||
该项目目前已支持 Windows,但支持的扩展数量较少,Windows 的支持并不完美,主要有以下几个问题:
|
该项目目前支持 Windows,但支持的扩展数量较少。Windows 支持并不完美。主要有以下问题:
|
||||||
|
|
||||||
1. Windows 的编译流程与 *nix 不同,使用的工具链也不同,编译各个扩展的依赖库使用的编译工具也几乎完全不同。
|
1. Windows 的编译过程与 *nix 不同,使用的工具链也不同。用于编译每个扩展依赖库的编译工具也几乎完全不同。
|
||||||
2. Windows 版本的需求也会根据所有使用本项目的人的需求推进,如果有很多人需要,我会尽快支持相关扩展。
|
2. Windows 版本的需求也会根据所有使用本项目的人的需求推进。如果很多人需要,我会尽快支持相关扩展。
|
||||||
|
|
||||||
## 使用 micro 可以保护我的源码吗
|
## 我可以使用 micro 保护我的源代码吗?
|
||||||
|
|
||||||
不可以。micro.sfx 本质上是将 php 和 php 代码结合为一个文件,没有 PHP 代码编译或加密的过程。
|
不可以。micro.sfx 本质上是将 php 和 php 代码合并为一个文件,没有编译或加密 PHP 代码的过程。
|
||||||
首先 php-src 是 PHP 代码的官方解释器,而且现在市面上还没有一个能兼容主流分支的 PHP 编译器。
|
|
||||||
之前我在网上看到有一个项目是 BPC(Binary PHP Compiler?)可以把 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 等。
|
因此,本项目(static-php-cli)和相关项目(lwmbs、swoole-cli)都提供了 php-src 源代码的便捷编译工具。
|
||||||
|
本项目和相关项目引用的 phpmicro 只是 PHP 的 sapi 接口封装,而不是 PHP 代码的编译工具。
|
||||||
|
PHP 代码的编译器是一个完全不同的项目,因此不考虑额外的情况。
|
||||||
|
如果你对加密感兴趣,可以考虑使用现有的加密技术,如 Swoole Compiler、Source Guardian 等。
|
||||||
|
|
||||||
## 无法使用 ssl
|
## 无法使用 ssl
|
||||||
|
|
||||||
使用 curl、pgsql 等 请求 HTTPS 网站或建立 SSL 连接时,可能存在 `error:80000002:system library::No such file or directory` 错误,
|
**更新:该问题已在最新版本的 static-php-cli 中修复,现在默认读取系统的证书文件。如果你仍然遇到问题,请尝试下面的解决方案。**
|
||||||
这个错误是由于静态编译的 PHP 未通过 `php.ini` 指定 `openssl.cafile` 导致的。
|
|
||||||
|
|
||||||
你可以在使用 PHP 前指定 `php.ini`,并在 INI 内添加 `openssl.cafile=/path/to/your-cert.pem` 来解决这个问题。
|
使用 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](https://curl.se/docs/caextract.html) 文件,也可以使用系统自带的证书文件。
|
对于 Linux 系统,你可以从 curl 官方网站下载 [cacert.pem](https://curl.se/docs/caextract.html) 文件,也可以使用系统自带的证书文件。
|
||||||
有关不同发行版的证书位置,可参考 [Go 标准库](https://go.dev/src/crypto/x509/root_linux.go)。
|
有关不同发行版的证书位置,请参考 [Golang 文档](https://go.dev/src/crypto/x509/root_linux.go)。
|
||||||
|
|
||||||
> INI 配置 `openssl.cafile` 不可以使用 `ini_set()` 函数动态设置,因为 `openssl.cafile` 是一个 `PHP_INI_SYSTEM` 类型的配置,只能在 `php.ini` 文件中设置。
|
> INI 配置 `openssl.cafile` 不能使用 `ini_set()` 函数动态设置,因为 `openssl.cafile` 是 `PHP_INI_SYSTEM` 类型的配置,只能在 `php.ini` 文件中设置。
|
||||||
|
|
||||||
## 为什么不支持旧版本 PHP ?
|
## 为什么不支持旧版本的 PHP?
|
||||||
|
|
||||||
因为旧版本的 PHP 有很多问题,比如安全问题、性能问题、功能问题等。此外,旧版本的 PHP 很多都无法与最新的依赖库兼容,这也是不支持旧版本 PHP 的原因之一。
|
因为旧版本的 PHP 有很多问题,如安全问题、性能问题和功能问题。此外,许多旧版本的 PHP 与最新的依赖库不兼容,这也是不支持旧版本 PHP 的原因之一。
|
||||||
|
|
||||||
你可以使用 static-php-cli 早期编译好的旧版本,如 PHP 8.0,但是不会明确支持早期版本。
|
你可以使用 static-php-cli 早期编译的旧版本,如 PHP 8.0,但不会明确支持早期版本。
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ Action 构建指的是直接使用 GitHub Action 进行编译。
|
|||||||
如果你不想自行编译,可以从本项目现有的 Action 下载 Artifact,也可以从自托管的服务器下载:[进入](https://dl.static-php.dev/static-php-cli/common/)
|
如果你不想自行编译,可以从本项目现有的 Action 下载 Artifact,也可以从自托管的服务器下载:[进入](https://dl.static-php.dev/static-php-cli/common/)
|
||||||
|
|
||||||
> 自托管的二进制也是由 Action 构建而来,[项目仓库地址](https://github.com/static-php/static-php-cli-hosted)。
|
> 自托管的二进制也是由 Action 构建而来,[项目仓库地址](https://github.com/static-php/static-php-cli-hosted)。
|
||||||
|
> 包含的扩展有: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
|
||||||
|
|
||||||
## 构建方法
|
## 构建方法
|
||||||
|
|
||||||
|
|||||||
54
docs/zh/guide/build-with-glibc.md
Normal file
54
docs/zh/guide/build-with-glibc.md
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
# 构建 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 的性能问题](https://github.com/php/php-src/issues/13648)。
|
||||||
|
|
||||||
|
对于不同的 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` 一样的命令帮助菜单,这时说明容器已经准备好了。
|
||||||
|
|
||||||
|
在容器准备好后,你可以参考 [本地构建](./manual-build) 章节的内容,构建你的 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` 脚本,手动构建一个类似的环境。
|
||||||
|
|
||||||
|
请注意,我们仅支持使用 bin/spc-gnu-docker 构建的 glibc 版本。已在 RHEL 9 和 10 上进行了编译测试并验证其稳定性,但如果您遇到问题,我们可能不会进行修复。
|
||||||
@@ -36,6 +36,19 @@ SPC_CONCURRENCY=4 bin/spc build mbstring,pcntl --build-cli
|
|||||||
|
|
||||||
例如,你需要修改编译 PHP 的 `./configure` 命令,你可以在 `config/env.ini` 文件中找到 `SPC_CMD_PREFIX_PHP_CONFIGURE` 环境变量,然后修改其值即可。
|
例如,你需要修改编译 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 系统)
|
## 编译依赖库的环境变量(仅限 Unix 系统)
|
||||||
|
|
||||||
从 2.2.0 开始,static-php-cli 对所有 macOS、Linux、FreeBSD 等 Unix 系统的编译依赖库的命令均支持自定义环境变量。
|
从 2.2.0 开始,static-php-cli 对所有 macOS、Linux、FreeBSD 等 Unix 系统的编译依赖库的命令均支持自定义环境变量。
|
||||||
|
|||||||
@@ -4,6 +4,8 @@
|
|||||||
|
|
||||||
## curl
|
## curl
|
||||||
|
|
||||||
|
HTTP3 支持默认未启用,需在编译时添加 `--with-libs="nghttp2,nghttp3,ngtcp2"` 以启用 PHP 8.4 及以上版本的 HTTP3 支持。
|
||||||
|
|
||||||
使用 curl 请求 HTTPS 时,可能存在 `error:80000002:system library::No such file or directory` 错误,
|
使用 curl 请求 HTTPS 时,可能存在 `error:80000002:system library::No such file or directory` 错误,
|
||||||
解决办法详见 [FAQ - 无法使用 ssl](../faq/#无法使用-ssl)。
|
解决办法详见 [FAQ - 无法使用 ssl](../faq/#无法使用-ssl)。
|
||||||
|
|
||||||
@@ -43,13 +45,17 @@ swoole-hook-sqlite 与 `pdo_sqlite` 扩展冲突。如需使用 Swoole 和 `pdo_
|
|||||||
|
|
||||||
## swow
|
## swow
|
||||||
|
|
||||||
1. swow 仅支持 PHP 8.0 ~ 8.4 版本。
|
1. swow 仅支持 PHP 8.0+ 版本。
|
||||||
|
|
||||||
|
## imagick
|
||||||
|
|
||||||
|
1. OpenMP 支持已被禁用,这是维护者推荐的做法,系统软件包也是如此配置。
|
||||||
|
|
||||||
## imap
|
## imap
|
||||||
|
|
||||||
1. 该扩展目前不支持 Kerberos。
|
1. 该扩展目前不支持 Kerberos。
|
||||||
2. 由于底层的 c-client、ext-imap 不是线程安全的。 无法在 `--enable-zts` 构建中使用它。
|
2. 由于底层的 c-client、ext-imap 不是线程安全的。 无法在 `--enable-zts` 构建中使用它。
|
||||||
3. 由于该扩展可能会从未来的 PHP 中删除,因此我们建议您寻找替代实现,例如 [Webklex/php-imap](https://github.com/Webklex/php-imap)。
|
3. 该扩展已在 PHP 8.4 中被移除,因此我们建议您寻找替代实现,例如 [Webklex/php-imap](https://github.com/Webklex/php-imap)。
|
||||||
|
|
||||||
## gd
|
## gd
|
||||||
|
|
||||||
@@ -70,9 +76,9 @@ bin/spc build gd --with-libs=freetype,libjpeg,libavif,libwebp --build-cli
|
|||||||
|
|
||||||
## xdebug
|
## xdebug
|
||||||
|
|
||||||
1. Xdebug 是一个 Zend 扩展,Xdebug 的功能依赖于 PHP 的 Zend 引擎和底层代码,如果要将其静态编译到 PHP 中,可能需要巨量的 patch 代码,这是不可行的。
|
1. Xdebug 只能作为共享扩展进行构建。您需要使用除了 `musl-static` 外的其他 `SPC_TARGET` 构建目标。
|
||||||
2. macOS 平台可以通过在相同平台编译的 PHP 下编译一个 xdebug 扩展,并提取其中的 `xdebug.so` 文件,再在 static-php-cli 中使用 `--no-strip` 参数保留调试符号表,同时加入 `ffi` 扩展。
|
2. 使用 Linux/glibc 或 macOS 时,您可以使用 `--build-shared=xdebug` 将 Xdebug 编译为共享扩展。
|
||||||
编译的 `./php` 二进制可以通过指定 INI 配置并运行,例如`./php -d 'zend_extension=xdebug.so' your-code.php`。
|
编译后的 `./php` 二进制文件可以通过指定 INI 文件进行配置和运行,例如 `./php -d 'zend_extension=/path/to/xdebug.so' your-code.php`。
|
||||||
|
|
||||||
## xml
|
## xml
|
||||||
|
|
||||||
@@ -108,14 +114,15 @@ pgsql 16.2 修复了这个 Bug,现在正常工作了。
|
|||||||
|
|
||||||
## password-argon2
|
## password-argon2
|
||||||
|
|
||||||
1. password-argon2不是一个标准的扩展,它是 `password_hash` 函数的额外算法。
|
1. password-argon2不是一个标准的扩展。`password_hash` 函数的 `PASSWORD_ARGON2ID` 算法需要 libsodium 或 libargon2 才能工作。
|
||||||
2. 在Linux系统,password-argon2 的依赖库 `libargon2` 与 `libsodium` 库冲突。
|
2. 使用 password-argon2 可以为此启用多线程支持。
|
||||||
|
|
||||||
## ffi
|
## ffi
|
||||||
|
|
||||||
1. 因为 Linux 系统的限制,虽然可以成功编译 ffi 扩展,但无法使用它加载其他 `so` 扩展。Linux 支持加载 so 扩展的前提是非静态编译,但动态编译和本项目的目的冲突。
|
1. 由于 musl libc 静态链接的限制,无法加载动态库,因此无法使用 ffi。
|
||||||
2. macOS 支持 ffi 扩展,但是部分内核下不包含调试符号时会出现错误。
|
如果您需要使用 ffi 扩展,请参阅 [使用 GNU libc 编译 PHP](./build-with-glibc)。
|
||||||
3. Windows 支持 ffi 扩展。
|
2. macOS 支持 ffi 扩展,但某些内核不包含调试符号时会出现错误。
|
||||||
|
3. Windows x64 支持 ffi 扩展。
|
||||||
|
|
||||||
## xhprof
|
## xhprof
|
||||||
|
|
||||||
@@ -134,5 +141,10 @@ parallel 扩展只支持 PHP 8.0 及以上版本,并只支持 ZTS 构建(`--
|
|||||||
|
|
||||||
## spx
|
## spx
|
||||||
|
|
||||||
1. [SPX 扩展](https://github.com/NoiseByNorthwest/php-spx) 只支持非线程模式。
|
1. SPX 目前不支持 Windows,且官方仓库也不支持静态编译,static-php-cli 使用了 [修改版本](https://github.com/static-php/php-spx)。
|
||||||
2. SPX 目前不支持 Windows,且官方仓库也不支持静态编译,static-php-cli 使用了 [修改版本](https://github.com/static-php/php-spx)。
|
|
||||||
|
## mimalloc
|
||||||
|
|
||||||
|
1. 从技术上讲,这不是扩展,而是一个库。
|
||||||
|
2. 在 Linux 或 macOS 上使用 `--with-libs="mimalloc"` 进行构建将覆盖默认分配器。
|
||||||
|
3. 目前,这还处于实验阶段,但建议在线程环境中使用。
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ static-php-cli 是一个用于构建静态编译的 PHP 二进制的工具,目
|
|||||||
|
|
||||||
在指南章节中,你将了解到如何使用 static-php-cli 构建独立的 php 程序。
|
在指南章节中,你将了解到如何使用 static-php-cli 构建独立的 php 程序。
|
||||||
|
|
||||||
- [Action 构建](./action-build)
|
|
||||||
- [本地构建](./manual-build)
|
- [本地构建](./manual-build)
|
||||||
|
- [Action 构建](./action-build)
|
||||||
- [扩展列表](./extensions)
|
- [扩展列表](./extensions)
|
||||||
|
|
||||||
## 编译环境
|
## 编译环境
|
||||||
@@ -29,6 +29,6 @@ Windows 目前只支持 x86_64 架构,不支持 32 位 x86、不支持 arm64
|
|||||||
|
|
||||||
## PHP 支持版本
|
## PHP 支持版本
|
||||||
|
|
||||||
目前,static-php-cli 对 PHP 8.1 ~ 8.4 版本是支持的,对于 PHP 8.0 及更早版本理论上支持,只需下载时选择早期版本即可。
|
目前,static-php-cli 对 PHP 8.1 ~ 8.5 版本是支持的,对于 PHP 8.0 及更早版本理论上支持,只需下载时选择早期版本即可。
|
||||||
但由于部分扩展和特殊组件已对早期版本的 PHP 停止了支持,所以 static-php-cli 不会明确支持早期版本。
|
但由于部分扩展和特殊组件已对早期版本的 PHP 停止了支持,所以 static-php-cli 不会明确支持早期版本。
|
||||||
我们推荐你编译尽可能新的 PHP 版本,以获得更好的体验。
|
我们推荐你编译尽可能新的 PHP 版本,以获得更好的体验。
|
||||||
|
|||||||
@@ -1,3 +1,7 @@
|
|||||||
|
---
|
||||||
|
outline: 'deep'
|
||||||
|
---
|
||||||
|
|
||||||
# 本地构建(Linux、macOS、FreeBSD)
|
# 本地构建(Linux、macOS、FreeBSD)
|
||||||
|
|
||||||
本章节为 Linux、macOS、FreeBSD 的构建过程,如果你要在 Windows 上构建,请到 [在 Windows 上构建](./build-on-windows)。
|
本章节为 Linux、macOS、FreeBSD 的构建过程,如果你要在 Windows 上构建,请到 [在 Windows 上构建](./build-on-windows)。
|
||||||
@@ -50,29 +54,29 @@ cd static-php-cli
|
|||||||
composer update
|
composer update
|
||||||
```
|
```
|
||||||
|
|
||||||
### 使用系统 PHP 环境
|
### 使用预编译静态 PHP 二进制运行 static-php-cli
|
||||||
|
|
||||||
下面是系统安装 PHP、Composer 的一些示例命令。具体安装方式建议自行搜索或询问 AI 搜索引擎获取答案,这里不多赘述。
|
如果你不想使用 Docker、在系统内安装 PHP,可以直接下载本项目自身编译好的 php 二进制 cli 程序。使用流程如下:
|
||||||
|
|
||||||
```bash
|
使用命令部署环境,此脚本会从 [自托管的服务器](https://dl.static-php.dev/static-php-cli/) 下载一个当前操作系统的 php-cli 包,
|
||||||
# [macOS], 需要先安装 Homebrew. See https://brew.sh/
|
并从 [getcomposer](https://getcomposer.org/download/latest-stable/composer.phar) 或 [Aliyun(镜像)](https://mirrors.aliyun.com/composer/composer.phar) 下载 Composer。
|
||||||
# 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.1 and composer >= 2.0
|
|
||||||
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
|
::: tip
|
||||||
目前 Ubuntu 部分版本的 apt 安装的 php 版本较旧,故不提供安装命令。如有需要,建议先添加 ppa 等软件源后,安装最新版的 PHP 以及 tokenizer、xml、phar 扩展。
|
使用预编译静态 PHP 二进制目前仅支持 Linux 和 macOS。FreeBSD 环境因为缺少自动化构建环境,所以暂不支持。
|
||||||
|
|
||||||
较老版本的 Debian 默认安装的可能为旧版本(<= 7.4)版本的 PHP,建议先升级 Debian。
|
|
||||||
:::
|
:::
|
||||||
|
|
||||||
|
```bash
|
||||||
|
bin/setup-runtime
|
||||||
|
|
||||||
|
# 对于中国大陆地区等网络环境特殊的用户,可使用镜像站加快下载速度
|
||||||
|
bin/setup-runtime --mirror china
|
||||||
|
```
|
||||||
|
|
||||||
|
此脚本总共会下载两个文件:`bin/php` 和 `bin/composer`,下载完成后,有两种使用方式:
|
||||||
|
|
||||||
|
1. 将 `bin/` 目录添加到 PATH 路径中:`export PATH="/path/to/your/static-php-cli/bin:$PATH"`,添加路径后,相当于系统安装了 PHP,可直接使用 `composer`、`php -v` 等命令,也可以直接使用 `bin/spc`。
|
||||||
|
2. 直接调用,比如执行 static-php-cli 命令:`bin/php bin/spc --help`,执行 Composer:`bin/php bin/composer update`。
|
||||||
|
|
||||||
### 使用 Docker 环境
|
### 使用 Docker 环境
|
||||||
|
|
||||||
如果你不愿意在系统安装 PHP 和 Composer 运行环境,可以使用内置的 Docker 环境构建脚本。
|
如果你不愿意在系统安装 PHP 和 Composer 运行环境,可以使用内置的 Docker 环境构建脚本。
|
||||||
@@ -92,30 +96,66 @@ bin/spc-alpine-docker
|
|||||||
export SPC_USE_SUDO=yes
|
export SPC_USE_SUDO=yes
|
||||||
```
|
```
|
||||||
|
|
||||||
### 使用预编译静态 PHP 二进制
|
### 使用系统 PHP 环境
|
||||||
|
|
||||||
如果你不想使用 Docker、在系统内安装 PHP,可以直接下载本项目自身编译好的 php 二进制 cli 程序。使用流程如下:
|
下面是系统安装 PHP、Composer 的一些示例命令。具体安装方式建议自行搜索或询问 AI 搜索引擎获取答案,这里不多赘述。
|
||||||
|
|
||||||
使用命令部署环境,此脚本会从 [自托管的服务器](https://dl.static-php.dev/static-php-cli/) 下载一个当前操作系统的 php-cli 包,
|
|
||||||
并从 [getcomposer](https://getcomposer.org/download/latest-stable/composer.phar) 或 [Aliyun(镜像)](https://mirrors.aliyun.com/composer/composer.phar) 下载 Composer。
|
|
||||||
|
|
||||||
::: tip
|
|
||||||
使用预编译静态 PHP 二进制目前仅支持 Linux 和 macOS。FreeBSD 环境因为缺少自动化构建环境,所以暂不支持。
|
|
||||||
:::
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
bin/setup-runtime
|
# [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
|
||||||
bin/setup-runtime --mirror china
|
sudo apt install php-cli composer php-tokenizer
|
||||||
```
|
```
|
||||||
|
|
||||||
此脚本总共会下载两个文件:`bin/php` 和 `bin/composer`,下载完成后,有两种使用方式:
|
::: tip
|
||||||
|
目前 Ubuntu 部分版本的 apt 安装的 php 版本较旧,故不提供安装命令。如有需要,建议先添加 ppa 等软件源后,安装最新版的 PHP 以及 tokenizer、xml、phar 扩展。
|
||||||
|
|
||||||
1. 将 `bin/` 目录添加到 PATH 路径中:`export PATH="/path/to/your/static-php-cli/bin:$PATH"`,添加路径后,相当于系统安装了 PHP,可直接使用 `composer`、`php -v` 等命令,也可以直接使用 `bin/spc`。
|
较老版本的 Debian 默认安装的可能为旧版本(<= 8.3)版本的 PHP,建议先升级 Debian 或使用 Docker 或自带的静态二进制环境。
|
||||||
2. 直接调用,比如执行 static-php-cli 命令:`bin/php bin/spc --help`,执行 Composer:`bin/php bin/composer update`。
|
:::
|
||||||
|
|
||||||
## 命令 download - 下载依赖包
|
## 使用 craft 构建(推荐)
|
||||||
|
|
||||||
|
使用 `bin/spc craft` 可以使用一个配置文件,一个命令实现自动检查环境、下载源代码、构建依赖库、构建 PHP 及扩展等。
|
||||||
|
|
||||||
|
你需要编写一个 `craft.yml` 文件,存放在当前工作目录下。`craft.yml` 可以由 [命令生成器](./cli-generator) 生成,或者手动编写。
|
||||||
|
|
||||||
|
手动编写可参考 [craft.yml 配置](../develop/craft-yml.md) 中的注释来编写。我们下面假设你编译一个扩展组合,并选用 PHP 8.4,输出 `cli` 和 `fpm`:
|
||||||
|
|
||||||
|
```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 二进制](./manual-build#命令-micro-combine-打包-micro-二进制)。
|
||||||
|
- embed: 参见 [embed 使用](./manual-build#embed-使用)。
|
||||||
|
- frankenphp: 构建结果为 `buildroot/bin/frankenphp`。
|
||||||
|
|
||||||
|
如果中途构建出错,你可以使用 `--debug` 参数查看详细的错误信息,或者使用 `--with-clean` 参数清除旧的编译结果,重新编译。
|
||||||
|
|
||||||
|
如使用以上方式仍构建失败,请提交一个 issue,附上你的 `craft.yml`、`craft.log`。
|
||||||
|
|
||||||
|
## 分步构建命令
|
||||||
|
|
||||||
|
如果你有定制化需求,或分开下载、编译 PHP 和依赖库的需求,可以使用 `bin/spc` 命令分步执行。
|
||||||
|
|
||||||
|
### 命令 download - 下载依赖包
|
||||||
|
|
||||||
使用命令 `bin/spc download` 可以下载编译需要的源代码,包括 php-src 以及依赖的各种库的源码。
|
使用命令 `bin/spc download` 可以下载编译需要的源代码,包括 php-src 以及依赖的各种库的源码。
|
||||||
|
|
||||||
@@ -169,8 +209,8 @@ bin/spc download --from-zip=/path/to/your/download.zip
|
|||||||
让下载器强制使用你指定的链接下载此 source 的包。使用方法为 `{source-name}:{url}` 即可,可同时重写多个库的下载地址。在使用 `--for-extensions` 选项下载时同样可用。
|
让下载器强制使用你指定的链接下载此 source 的包。使用方法为 `{source-name}:{url}` 即可,可同时重写多个库的下载地址。在使用 `--for-extensions` 选项下载时同样可用。
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# 例如:指定下载测试版的 PHP8.3
|
# 例如:指定下载 Alpha 版的 PHP8.5
|
||||||
bin/spc download --all -U "php-src:https://downloads.php.net/~eric/php-8.3.0beta1.tar.gz"
|
bin/spc download --all -U "php-src:https://downloads.php.net/~edorian/php-8.5.0alpha2.tar.xz"
|
||||||
|
|
||||||
# 指定下载旧版本的 curl 库
|
# 指定下载旧版本的 curl 库
|
||||||
bin/spc download --all -U "curl:https://curl.se/download/curl-7.88.1.tar.gz"
|
bin/spc download --all -U "curl:https://curl.se/download/curl-7.88.1.tar.gz"
|
||||||
@@ -187,7 +227,7 @@ bin/spc download --for-extensions=redis,phar -G "php-src:master:https://github.c
|
|||||||
bin/spc download --for-extensions=swoole -G "swoole:master:https://github.com/swoole/swoole-src.git"
|
bin/spc download --for-extensions=swoole -G "swoole:master:https://github.com/swoole/swoole-src.git"
|
||||||
```
|
```
|
||||||
|
|
||||||
## 命令 doctor - 环境检查
|
### 命令 doctor - 环境检查
|
||||||
|
|
||||||
如果你可以正常运行 `bin/spc` 但无法正常编译静态的 PHP 或依赖库,可以先运行 `bin/spc doctor` 检查系统自身是否缺少依赖。
|
如果你可以正常运行 `bin/spc` 但无法正常编译静态的 PHP 或依赖库,可以先运行 `bin/spc doctor` 检查系统自身是否缺少依赖。
|
||||||
|
|
||||||
@@ -199,11 +239,11 @@ bin/spc doctor
|
|||||||
bin/spc doctor --auto-fix
|
bin/spc doctor --auto-fix
|
||||||
```
|
```
|
||||||
|
|
||||||
## 命令 build - 编译 PHP
|
### 命令 build - 编译 PHP
|
||||||
|
|
||||||
使用 build 命令可以开始构建静态 php 二进制,在执行 `bin/spc build` 命令前,务必先使用 `download` 命令下载资源,建议使用 `doctor` 检查环境。
|
使用 build 命令可以开始构建静态 php 二进制,在执行 `bin/spc build` 命令前,务必先使用 `download` 命令下载资源,建议使用 `doctor` 检查环境。
|
||||||
|
|
||||||
### 基本用法
|
#### 基本用法
|
||||||
|
|
||||||
你需要先到 [扩展列表](./extensions) 或 [命令生成器](./cli-generator) 选择你要加入的扩展,然后使用命令 `bin/spc build` 进行编译。你需要指定一个编译目标,从如下参数中选择:
|
你需要先到 [扩展列表](./extensions) 或 [命令生成器](./cli-generator) 选择你要加入的扩展,然后使用命令 `bin/spc build` 进行编译。你需要指定一个编译目标,从如下参数中选择:
|
||||||
|
|
||||||
@@ -211,6 +251,7 @@ bin/spc doctor --auto-fix
|
|||||||
- `--build-fpm`: 构建一个 fpm sapi(php-fpm,用于和其他传统的 fpm 架构的软件如 nginx 配合使用)
|
- `--build-fpm`: 构建一个 fpm sapi(php-fpm,用于和其他传统的 fpm 架构的软件如 nginx 配合使用)
|
||||||
- `--build-micro`: 构建一个 micro sapi(用于构建一个包含 PHP 代码的独立可执行二进制)
|
- `--build-micro`: 构建一个 micro sapi(用于构建一个包含 PHP 代码的独立可执行二进制)
|
||||||
- `--build-embed`: 构建一个 embed sapi(用于嵌入到其他 C 语言程序中)
|
- `--build-embed`: 构建一个 embed sapi(用于嵌入到其他 C 语言程序中)
|
||||||
|
- `--build-frankenphp`: 构建一个 [frankenphp](https://github.com/php/frankenphp) 二进制
|
||||||
- `--build-all`: 构建以上所有 sapi
|
- `--build-all`: 构建以上所有 sapi
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
@@ -247,15 +288,7 @@ bin/spc build bcmath,curl,openssl,ftp,posix,pcntl --build-cli
|
|||||||
```
|
```
|
||||||
:::
|
:::
|
||||||
|
|
||||||
### 调试
|
#### 编译运行选项
|
||||||
|
|
||||||
如果你在编译过程中遇到了问题,或者想查看每个执行的 shell 命令,可以使用 `--debug` 开启 debug 模式,查看所有终端日志:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
bin/spc build mysqlnd,pdo_mysql --build-all --debug
|
|
||||||
```
|
|
||||||
|
|
||||||
### 编译运行选项
|
|
||||||
|
|
||||||
在编译过程中,有些特殊情况需要对编译器、编译目录的内容进行干预,可以尝试使用以下命令:
|
在编译过程中,有些特殊情况需要对编译器、编译目录的内容进行干预,可以尝试使用以下命令:
|
||||||
|
|
||||||
@@ -263,7 +296,7 @@ bin/spc build mysqlnd,pdo_mysql --build-all --debug
|
|||||||
- `--cxx=XXX`: 指定 C++ 语言编译器的执行命令(Linux 默认 `g++`,macOS 默认 `clang++`)
|
- `--cxx=XXX`: 指定 C++ 语言编译器的执行命令(Linux 默认 `g++`,macOS 默认 `clang++`)
|
||||||
- `--with-clean`: 编译 PHP 前先清理旧的 make 产生的文件
|
- `--with-clean`: 编译 PHP 前先清理旧的 make 产生的文件
|
||||||
- `--enable-zts`: 让编译的 PHP 为线程安全版本(默认为 NTS 版本)
|
- `--enable-zts`: 让编译的 PHP 为线程安全版本(默认为 NTS 版本)
|
||||||
- `--no-strip`: 编译 PHP 库后不运行 `strip` 裁剪二进制文件缩小体积(不裁剪的 macOS 二进制文件可使用动态链接的第三方扩展)
|
- `--no-strip`: 编译 PHP 库后不运行 `strip` 裁剪二进制文件缩小体积
|
||||||
- `--with-libs=XXX,YYY`: 编译 PHP 前先编译指定的依赖库,激活部分扩展的可选功能(例如 gd 库的 libavif 等)
|
- `--with-libs=XXX,YYY`: 编译 PHP 前先编译指定的依赖库,激活部分扩展的可选功能(例如 gd 库的 libavif 等)
|
||||||
- `--with-config-file-path=XXX`: 查找 `php.ini` 的路径(在 [这里](../faq/index.html#php-ini-的路径是什么) 查看默认路径)
|
- `--with-config-file-path=XXX`: 查找 `php.ini` 的路径(在 [这里](../faq/index.html#php-ini-的路径是什么) 查看默认路径)
|
||||||
- `--with-config-file-scan-dir=XXX`: 读取 `php.ini` 后扫描 `.ini` 文件的目录(在 [这里](../faq/index.html#php-ini-的路径是什么) 查看默认路径)
|
- `--with-config-file-scan-dir=XXX`: 读取 `php.ini` 后扫描 `.ini` 文件的目录(在 [这里](../faq/index.html#php-ini-的路径是什么) 查看默认路径)
|
||||||
@@ -275,6 +308,7 @@ bin/spc build mysqlnd,pdo_mysql --build-all --debug
|
|||||||
- `--with-suggested-exts`: 编译时将 `ext-suggests` 也作为编译依赖加入
|
- `--with-suggested-exts`: 编译时将 `ext-suggests` 也作为编译依赖加入
|
||||||
- `--with-suggested-libs`: 编译时将 `lib-suggests` 也作为编译依赖加入
|
- `--with-suggested-libs`: 编译时将 `lib-suggests` 也作为编译依赖加入
|
||||||
- `--with-upx-pack`: 编译后使用 UPX 减小二进制文件体积(需先使用 `bin/spc install-pkg upx` 安装 upx)
|
- `--with-upx-pack`: 编译后使用 UPX 减小二进制文件体积(需先使用 `bin/spc install-pkg upx` 安装 upx)
|
||||||
|
- `--build-shared=XXX,YYY`: 编译时将指定的扩展编译为共享库(默认编译为静态库)
|
||||||
|
|
||||||
硬编码 INI 选项适用于 cli、micro、embed。有关硬编码 INI 选项,下面是一个简单的例子,我们预设一个更大的 `memory_limit`,并且禁用 `system` 函数:
|
硬编码 INI 选项适用于 cli、micro、embed。有关硬编码 INI 选项,下面是一个简单的例子,我们预设一个更大的 `memory_limit`,并且禁用 `system` 函数:
|
||||||
|
|
||||||
@@ -342,6 +376,14 @@ memory_limit=1G
|
|||||||
|
|
||||||
如果要打包 phar,只需要将 `a.php` 替换为打包好的 phar 文件即可。但要注意,phar 下的 micro.sfx 需要额外注意路径问题,见 [Developing - Phar 路径问题](../develop/structure#phar-应用目录问题)
|
如果要打包 phar,只需要将 `a.php` 替换为打包好的 phar 文件即可。但要注意,phar 下的 micro.sfx 需要额外注意路径问题,见 [Developing - Phar 路径问题](../develop/structure#phar-应用目录问题)
|
||||||
|
|
||||||
|
## 调试
|
||||||
|
|
||||||
|
如果你在编译过程中遇到了问题,或者想查看每个执行的 shell 命令,可以使用 `--debug` 开启 debug 模式,查看所有终端日志:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
bin/spc build mysqlnd,pdo_mysql --build-all --debug
|
||||||
|
```
|
||||||
|
|
||||||
## 命令 extract - 手动解压某个库
|
## 命令 extract - 手动解压某个库
|
||||||
|
|
||||||
使用命令 `bin/spc extract` 可以解包和拷贝编译需要的源代码,包括 php-src 以及依赖的各种库的源码(需要自己指定要解包的库名)。
|
使用命令 `bin/spc extract` 可以解包和拷贝编译需要的源代码,包括 php-src 以及依赖的各种库的源码(需要自己指定要解包的库名)。
|
||||||
@@ -353,6 +395,32 @@ memory_limit=1G
|
|||||||
bin/spc extract php-src,libxml2
|
bin/spc extract php-src,libxml2
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## 命令 dump-extensions - 导出项目扩展依赖
|
||||||
|
|
||||||
|
使用命令 `bin/spc dump-extensions` 可以导出当前项目的扩展依赖。
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# 打印项目的扩展列表,传入项目包含composer.json的根目录
|
||||||
|
bin/spc dump-extensions /path/to/your/project/
|
||||||
|
|
||||||
|
# 打印项目的扩展列表,不包含开发依赖
|
||||||
|
bin/spc dump-extensions /path-to/tour/project/ --no-dev
|
||||||
|
|
||||||
|
# 输出为 spc 命令可接受的扩展列表格式(逗号分割)
|
||||||
|
bin/spc dump-extensions /path-to/tour/project/ --format=text
|
||||||
|
|
||||||
|
# 输出为 JSON 列表
|
||||||
|
bin/spc dump-extensions /path-to/tour/project/ --format=json
|
||||||
|
|
||||||
|
# 当项目没有任何扩展时,输出指定扩展组合,而不是返回失败
|
||||||
|
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.json` 和 `composer.lock` 文件,否则无法正常获取。
|
||||||
|
|
||||||
## 调试命令 dev - 调试命令集合
|
## 调试命令 dev - 调试命令集合
|
||||||
|
|
||||||
调试命令指的是你在使用 static-php-cli 构建 PHP 或改造、增强 static-php-cli 项目本身的时候,可以辅助输出一些信息的命令集合。
|
调试命令指的是你在使用 static-php-cli 构建 PHP 或改造、增强 static-php-cli 项目本身的时候,可以辅助输出一些信息的命令集合。
|
||||||
@@ -391,6 +459,8 @@ bin/spc dev:sort-config ext
|
|||||||
下面是安装工具的示例:
|
下面是安装工具的示例:
|
||||||
|
|
||||||
- 下载安装 UPX(仅限 Linux 和 Windows): `bin/spc install-pkg upx`
|
- 下载安装 UPX(仅限 Linux 和 Windows): `bin/spc install-pkg upx`
|
||||||
|
- 下载安装 nasm(仅限 Windows): `bin/spc install-pkg nasm`
|
||||||
|
- 下载安装 go-xcaddy: `bin/spc install-pkg go-xcaddy`
|
||||||
|
|
||||||
## 命令 del-download - 删除已下载的资源
|
## 命令 del-download - 删除已下载的资源
|
||||||
|
|
||||||
|
|||||||
@@ -10,18 +10,22 @@
|
|||||||
当下载资源时,你可能最终会看到类似 `curl: (56) The requested URL returned error: 403` 的错误,这通常是由于 GitHub 限制导致的。
|
当下载资源时,你可能最终会看到类似 `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"` 的输出。
|
你可以通过在命令中添加 `--debug` 来验证,会看到类似 `[DEBU] Running command (no output) : curl -sfSL "https://api.github.com/repos/openssl/openssl/releases"` 的输出。
|
||||||
|
|
||||||
要解决这个问题,可以在 GitHub 上 [创建](https://github.com/settings/token) 一个个人访问令牌,并将其设置为环境变量 `GITHUB_TOKEN=<XXX>`。
|
要解决这个问题,可以在 GitHub 上 [创建](https://github.com/settings/tokens) 一个个人访问令牌,并将其设置为环境变量 `GITHUB_TOKEN=<XXX>`。
|
||||||
|
|
||||||
如果确认地址确实无法正常访问,可以提交 Issue 或 PR 更新地址。
|
如果确认地址确实无法正常访问,可以提交 Issue 或 PR 更新地址或下载类型。
|
||||||
|
|
||||||
## doctor 无法修复
|
## Doctor 无法修复某些问题
|
||||||
|
|
||||||
在绝大部分情况下,doctor 模块都可以对缺失的系统环境进行自动修复和安装,但也存在特殊的环境无法正常使用自动修复功能。
|
在绝大部分情况下,doctor 模块都可以对缺失的系统环境进行自动修复和安装,但也存在特殊的环境无法正常使用自动修复功能。
|
||||||
|
|
||||||
部分项目由于系统局限(如 Windows 下无法自动安装 Visual Studio 等软件),无法使用自动修复功能。
|
由于系统限制(例如,Windows 下无法自动安装 Visual Studio 等软件),自动修复功能无法用于某些项目。
|
||||||
在遇到无法自动修复功能时,如果遇到 `Some check items can not be fixed` 字样,则表明无法自动修复,请根据终端显示的方法提交 Issue 或自行修复环境。
|
在遇到无法自动修复功能时,如果遇到 `Some check items can not be fixed` 字样,则表明无法自动修复。
|
||||||
|
请根据终端显示的方法提交 Issue 或自行修复环境。
|
||||||
|
|
||||||
## 编译错误
|
## 编译错误
|
||||||
|
|
||||||
遇到编译错误时,如果没有开启 `--debug` 日志,请先开启调试日志,然后确定报错的命令。
|
遇到编译错误时,如果没有开启 `--debug` 日志,请先开启调试日志,然后确定报错的命令。
|
||||||
报错的终端输出对于修复编译错误非常重要,请在提交 Issue 时一并将终端日志的最后报错片段(或整个终端日志输出)上传,并且包含使用的 `spc` 命令和参数。
|
报错的终端输出对于修复编译错误非常重要。
|
||||||
|
在提交 Issue 时,请上传终端日志的最后报错片段(或整个终端日志输出),并且包含使用的 `spc` 命令和参数。
|
||||||
|
|
||||||
|
如果你是重复构建,请参考 [本地构建 - 多次构建](./manual-build#多次构建) 章节。
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
"docs:preview": "vitepress preview docs"
|
"docs:preview": "vitepress preview docs"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"vitepress": "^1.0.0-rc.35",
|
"vitepress": "^2.0.0-alpha.5",
|
||||||
"vue": "^3.2.47"
|
"vue": "^3.2.47"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,4 +2,8 @@
|
|||||||
<phpunit
|
<phpunit
|
||||||
bootstrap="tests/bootstrap.php"
|
bootstrap="tests/bootstrap.php"
|
||||||
>
|
>
|
||||||
</phpunit>
|
<php>
|
||||||
|
<env name="SPC_IGNORE_BAD_HASH" value="yes" force="true" />
|
||||||
|
<env name="SPC_SKIP_TOOLCHAIN_CHECK" value="yes" force="true" />
|
||||||
|
</php>
|
||||||
|
</phpunit>
|
||||||
|
|||||||
@@ -4,10 +4,12 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace SPC;
|
namespace SPC;
|
||||||
|
|
||||||
use SPC\command\BuildCliCommand;
|
|
||||||
use SPC\command\BuildLibsCommand;
|
use SPC\command\BuildLibsCommand;
|
||||||
|
use SPC\command\BuildPHPCommand;
|
||||||
|
use SPC\command\CraftCommand;
|
||||||
use SPC\command\DeleteDownloadCommand;
|
use SPC\command\DeleteDownloadCommand;
|
||||||
use SPC\command\dev\AllExtCommand;
|
use SPC\command\dev\AllExtCommand;
|
||||||
|
use SPC\command\dev\EnvCommand;
|
||||||
use SPC\command\dev\ExtVerCommand;
|
use SPC\command\dev\ExtVerCommand;
|
||||||
use SPC\command\dev\GenerateExtDepDocsCommand;
|
use SPC\command\dev\GenerateExtDepDocsCommand;
|
||||||
use SPC\command\dev\GenerateExtDocCommand;
|
use SPC\command\dev\GenerateExtDocCommand;
|
||||||
@@ -18,6 +20,7 @@ use SPC\command\dev\PhpVerCommand;
|
|||||||
use SPC\command\dev\SortConfigCommand;
|
use SPC\command\dev\SortConfigCommand;
|
||||||
use SPC\command\DoctorCommand;
|
use SPC\command\DoctorCommand;
|
||||||
use SPC\command\DownloadCommand;
|
use SPC\command\DownloadCommand;
|
||||||
|
use SPC\command\DumpExtensionsCommand;
|
||||||
use SPC\command\DumpLicenseCommand;
|
use SPC\command\DumpLicenseCommand;
|
||||||
use SPC\command\ExtractCommand;
|
use SPC\command\ExtractCommand;
|
||||||
use SPC\command\InstallPkgCommand;
|
use SPC\command\InstallPkgCommand;
|
||||||
@@ -31,7 +34,7 @@ use Symfony\Component\Console\Application;
|
|||||||
*/
|
*/
|
||||||
final class ConsoleApplication extends Application
|
final class ConsoleApplication extends Application
|
||||||
{
|
{
|
||||||
public const VERSION = '2.4.5';
|
public const VERSION = '2.7.0';
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
@@ -42,8 +45,10 @@ final class ConsoleApplication extends Application
|
|||||||
|
|
||||||
$this->addCommands(
|
$this->addCommands(
|
||||||
[
|
[
|
||||||
|
// Craft command
|
||||||
|
new CraftCommand(),
|
||||||
// Common commands
|
// Common commands
|
||||||
new BuildCliCommand(),
|
new BuildPHPCommand(),
|
||||||
new BuildLibsCommand(),
|
new BuildLibsCommand(),
|
||||||
new DoctorCommand(),
|
new DoctorCommand(),
|
||||||
new DownloadCommand(),
|
new DownloadCommand(),
|
||||||
@@ -54,6 +59,7 @@ final class ConsoleApplication extends Application
|
|||||||
new MicroCombineCommand(),
|
new MicroCombineCommand(),
|
||||||
new SwitchPhpVersionCommand(),
|
new SwitchPhpVersionCommand(),
|
||||||
new SPCConfigCommand(),
|
new SPCConfigCommand(),
|
||||||
|
new DumpExtensionsCommand(),
|
||||||
|
|
||||||
// Dev commands
|
// Dev commands
|
||||||
new AllExtCommand(),
|
new AllExtCommand(),
|
||||||
@@ -65,6 +71,7 @@ final class ConsoleApplication extends Application
|
|||||||
new GenerateExtDepDocsCommand(),
|
new GenerateExtDepDocsCommand(),
|
||||||
new GenerateLibDepDocsCommand(),
|
new GenerateLibDepDocsCommand(),
|
||||||
new PackLibCommand(),
|
new PackLibCommand(),
|
||||||
|
new EnvCommand(),
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace SPC\builder;
|
namespace SPC\builder;
|
||||||
|
|
||||||
|
use PharIo\FileSystem\File;
|
||||||
use SPC\exception\ExceptionHandler;
|
use SPC\exception\ExceptionHandler;
|
||||||
use SPC\exception\FileSystemException;
|
use SPC\exception\FileSystemException;
|
||||||
use SPC\exception\InterruptException;
|
use SPC\exception\InterruptException;
|
||||||
@@ -11,7 +12,9 @@ use SPC\exception\RuntimeException;
|
|||||||
use SPC\exception\WrongUsageException;
|
use SPC\exception\WrongUsageException;
|
||||||
use SPC\store\Config;
|
use SPC\store\Config;
|
||||||
use SPC\store\FileSystem;
|
use SPC\store\FileSystem;
|
||||||
|
use SPC\store\LockFile;
|
||||||
use SPC\store\SourceManager;
|
use SPC\store\SourceManager;
|
||||||
|
use SPC\store\SourcePatcher;
|
||||||
use SPC\util\CustomExt;
|
use SPC\util\CustomExt;
|
||||||
|
|
||||||
abstract class BuilderBase
|
abstract class BuilderBase
|
||||||
@@ -63,13 +66,17 @@ abstract class BuilderBase
|
|||||||
// build all libs
|
// build all libs
|
||||||
foreach ($this->libs as $lib) {
|
foreach ($this->libs as $lib) {
|
||||||
$starttime = microtime(true);
|
$starttime = microtime(true);
|
||||||
match ($lib->setup($this->getOption('rebuild', false))) {
|
$status = $lib->setup($this->getOption('rebuild', false));
|
||||||
|
match ($status) {
|
||||||
LIB_STATUS_OK => logger()->info('lib [' . $lib::NAME . '] setup success, took ' . round(microtime(true) - $starttime, 2) . ' s'),
|
LIB_STATUS_OK => logger()->info('lib [' . $lib::NAME . '] setup success, took ' . round(microtime(true) - $starttime, 2) . ' s'),
|
||||||
LIB_STATUS_ALREADY => logger()->notice('lib [' . $lib::NAME . '] already built'),
|
LIB_STATUS_ALREADY => logger()->notice('lib [' . $lib::NAME . '] already built'),
|
||||||
LIB_STATUS_BUILD_FAILED => logger()->error('lib [' . $lib::NAME . '] build failed'),
|
LIB_STATUS_BUILD_FAILED => logger()->error('lib [' . $lib::NAME . '] build failed'),
|
||||||
LIB_STATUS_INSTALL_FAILED => logger()->error('lib [' . $lib::NAME . '] install failed'),
|
LIB_STATUS_INSTALL_FAILED => logger()->error('lib [' . $lib::NAME . '] install failed'),
|
||||||
default => logger()->warning('lib [' . $lib::NAME . '] build status unknown'),
|
default => logger()->warning('lib [' . $lib::NAME . '] build status unknown'),
|
||||||
};
|
};
|
||||||
|
if (in_array($status, [LIB_STATUS_BUILD_FAILED, LIB_STATUS_INSTALL_FAILED])) {
|
||||||
|
throw new RuntimeException('Library [' . $lib::NAME . '] setup failed.');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -122,9 +129,12 @@ abstract class BuilderBase
|
|||||||
*
|
*
|
||||||
* @return Extension[]
|
* @return Extension[]
|
||||||
*/
|
*/
|
||||||
public function getExts(): array
|
public function getExts(bool $including_shared = true): array
|
||||||
{
|
{
|
||||||
return $this->exts;
|
if ($including_shared) {
|
||||||
|
return $this->exts;
|
||||||
|
}
|
||||||
|
return array_filter($this->exts, fn ($ext) => $ext->isBuildStatic());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -136,7 +146,7 @@ abstract class BuilderBase
|
|||||||
public function hasCpp(): bool
|
public function hasCpp(): bool
|
||||||
{
|
{
|
||||||
// judge cpp-extension
|
// judge cpp-extension
|
||||||
$exts = array_keys($this->getExts());
|
$exts = array_keys($this->getExts(false));
|
||||||
foreach ($exts as $ext) {
|
foreach ($exts as $ext) {
|
||||||
if (Config::getExt($ext, 'cpp-extension', false) === true) {
|
if (Config::getExt($ext, 'cpp-extension', false) === true) {
|
||||||
return true;
|
return true;
|
||||||
@@ -170,23 +180,48 @@ abstract class BuilderBase
|
|||||||
* @throws \Throwable|WrongUsageException
|
* @throws \Throwable|WrongUsageException
|
||||||
* @internal
|
* @internal
|
||||||
*/
|
*/
|
||||||
public function proveExts(array $extensions, bool $skip_check_deps = false): void
|
public function proveExts(array $static_extensions, array $shared_extensions = [], bool $skip_check_deps = false, bool $skip_extract = false): void
|
||||||
{
|
{
|
||||||
CustomExt::loadCustomExt();
|
CustomExt::loadCustomExt();
|
||||||
$this->emitPatchPoint('before-php-extract');
|
// judge ext
|
||||||
SourceManager::initSource(sources: ['php-src']);
|
foreach ($static_extensions as $ext) {
|
||||||
$this->emitPatchPoint('after-php-extract');
|
// if extension does not support static build, throw exception
|
||||||
if ($this->getPHPVersionID() >= 80000) {
|
if (!in_array('static', Config::getExtTarget($ext))) {
|
||||||
$this->emitPatchPoint('before-micro-extract');
|
throw new WrongUsageException('Extension [' . $ext . '] does not support static build!');
|
||||||
SourceManager::initSource(sources: ['micro']);
|
}
|
||||||
$this->emitPatchPoint('after-micro-extract');
|
|
||||||
}
|
}
|
||||||
$this->emitPatchPoint('before-exts-extract');
|
foreach ($shared_extensions as $ext) {
|
||||||
SourceManager::initSource(exts: $extensions);
|
// if extension does not support shared build, throw exception
|
||||||
$this->emitPatchPoint('after-exts-extract');
|
if (!in_array('shared', Config::getExtTarget($ext)) && !in_array($ext, $shared_extensions)) {
|
||||||
foreach ($extensions as $extension) {
|
throw new WrongUsageException('Extension [' . $ext . '] does not support shared build!');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!$skip_extract) {
|
||||||
|
$this->emitPatchPoint('before-php-extract');
|
||||||
|
SourceManager::initSource(sources: ['php-src'], source_only: true);
|
||||||
|
$this->emitPatchPoint('after-php-extract');
|
||||||
|
if ($this->getPHPVersionID() >= 80000) {
|
||||||
|
$this->emitPatchPoint('before-micro-extract');
|
||||||
|
SourceManager::initSource(sources: ['micro'], source_only: true);
|
||||||
|
$this->emitPatchPoint('after-micro-extract');
|
||||||
|
}
|
||||||
|
$this->emitPatchPoint('before-exts-extract');
|
||||||
|
SourceManager::initSource(exts: [...$static_extensions, ...$shared_extensions]);
|
||||||
|
$this->emitPatchPoint('after-exts-extract');
|
||||||
|
// patch micro
|
||||||
|
SourcePatcher::patchMicro();
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ([...$static_extensions, ...$shared_extensions] as $extension) {
|
||||||
$class = CustomExt::getExtClass($extension);
|
$class = CustomExt::getExtClass($extension);
|
||||||
|
/** @var Extension $ext */
|
||||||
$ext = new $class($extension, $this);
|
$ext = new $class($extension, $this);
|
||||||
|
if (in_array($extension, $static_extensions)) {
|
||||||
|
$ext->setBuildStatic();
|
||||||
|
}
|
||||||
|
if (in_array($extension, $shared_extensions)) {
|
||||||
|
$ext->setBuildShared();
|
||||||
|
}
|
||||||
$this->addExt($ext);
|
$this->addExt($ext);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -194,10 +229,10 @@ abstract class BuilderBase
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($this->exts as $ext) {
|
foreach ($this->getExts() as $ext) {
|
||||||
$ext->checkDependency();
|
$ext->checkDependency();
|
||||||
}
|
}
|
||||||
$this->ext_list = $extensions;
|
$this->ext_list = [...$static_extensions, ...$shared_extensions];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -207,6 +242,45 @@ abstract class BuilderBase
|
|||||||
*/
|
*/
|
||||||
abstract public function buildPHP(int $build_target = BUILD_TARGET_NONE);
|
abstract public function buildPHP(int $build_target = BUILD_TARGET_NONE);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test PHP
|
||||||
|
*/
|
||||||
|
abstract public function testPHP(int $build_target = BUILD_TARGET_NONE);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @throws WrongUsageException
|
||||||
|
* @throws RuntimeException
|
||||||
|
* @throws FileSystemException
|
||||||
|
*/
|
||||||
|
public function buildSharedExts(): void
|
||||||
|
{
|
||||||
|
$lines = file(BUILD_BIN_PATH . '/php-config');
|
||||||
|
$extension_dir_line = null;
|
||||||
|
foreach ($lines as $key => $value) {
|
||||||
|
if (str_starts_with($value, 'extension_dir=')) {
|
||||||
|
$lines[$key] = 'extension_dir="' . BUILD_MODULES_PATH . '"' . PHP_EOL;
|
||||||
|
$extension_dir_line = $value;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
file_put_contents(BUILD_BIN_PATH . '/php-config', implode('', $lines));
|
||||||
|
FileSystem::replaceFileStr(BUILD_LIB_PATH . '/php/build/phpize.m4', 'test "[$]$1" = "no" && $1=yes', '# test "[$]$1" = "no" && $1=yes');
|
||||||
|
FileSystem::createDir(BUILD_MODULES_PATH);
|
||||||
|
try {
|
||||||
|
foreach ($this->getExts() as $ext) {
|
||||||
|
if (!$ext->isBuildShared()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
$ext->buildShared();
|
||||||
|
}
|
||||||
|
} catch (RuntimeException $e) {
|
||||||
|
FileSystem::replaceFileLineContainsString(BUILD_BIN_PATH . '/php-config', 'extension_dir=', $extension_dir_line);
|
||||||
|
throw $e;
|
||||||
|
}
|
||||||
|
FileSystem::replaceFileLineContainsString(BUILD_BIN_PATH . '/php-config', 'extension_dir=', $extension_dir_line);
|
||||||
|
FileSystem::replaceFileStr(BUILD_LIB_PATH . '/php/build/phpize.m4', '# test "[$]$1" = "no" && $1=yes', 'test "[$]$1" = "no" && $1=yes');
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generate extension enable arguments for configure.
|
* Generate extension enable arguments for configure.
|
||||||
* e.g. --enable-mbstring
|
* e.g. --enable-mbstring
|
||||||
@@ -214,12 +288,24 @@ abstract class BuilderBase
|
|||||||
* @throws FileSystemException
|
* @throws FileSystemException
|
||||||
* @throws WrongUsageException
|
* @throws WrongUsageException
|
||||||
*/
|
*/
|
||||||
public function makeExtensionArgs(): string
|
public function makeStaticExtensionArgs(): string
|
||||||
{
|
{
|
||||||
$ret = [];
|
$ret = [];
|
||||||
foreach ($this->exts as $ext) {
|
foreach ($this->getExts() as $ext) {
|
||||||
logger()->info($ext->getName() . ' is using ' . $ext->getConfigureArg());
|
$arg = $ext->getConfigureArg();
|
||||||
$ret[] = trim($ext->getConfigureArg());
|
if ($ext->isBuildShared() && !$ext->isBuildStatic()) {
|
||||||
|
if (
|
||||||
|
(Config::getExt($ext->getName(), 'type') === 'builtin' &&
|
||||||
|
!file_exists(SOURCE_PATH . '/php-src/ext/' . $ext->getName() . '/config.m4')) ||
|
||||||
|
Config::getExt($ext->getName(), 'build-with-php') === true
|
||||||
|
) {
|
||||||
|
$arg = $ext->getConfigureArg(true);
|
||||||
|
} else {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
logger()->info($ext->getName() . ' is using ' . $arg);
|
||||||
|
$ret[] = trim($arg);
|
||||||
}
|
}
|
||||||
logger()->debug('Using configure: ' . implode(' ', $ret));
|
logger()->debug('Using configure: ' . implode(' ', $ret));
|
||||||
return implode(' ', $ret);
|
return implode(' ', $ret);
|
||||||
@@ -253,16 +339,21 @@ abstract class BuilderBase
|
|||||||
throw new RuntimeException('PHP version file format is malformed, please remove it and download again');
|
throw new RuntimeException('PHP version file format is malformed, please remove it and download again');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getPHPVersion(): string
|
public function getPHPVersion(bool $exception_on_failure = true): string
|
||||||
{
|
{
|
||||||
if (!file_exists(SOURCE_PATH . '/php-src/main/php_version.h')) {
|
if (!file_exists(SOURCE_PATH . '/php-src/main/php_version.h')) {
|
||||||
|
if (!$exception_on_failure) {
|
||||||
|
return 'unknown';
|
||||||
|
}
|
||||||
throw new WrongUsageException('PHP source files are not available, you need to download them first');
|
throw new WrongUsageException('PHP source files are not available, you need to download them first');
|
||||||
}
|
}
|
||||||
$file = file_get_contents(SOURCE_PATH . '/php-src/main/php_version.h');
|
$file = file_get_contents(SOURCE_PATH . '/php-src/main/php_version.h');
|
||||||
if (preg_match('/PHP_VERSION "(.*)"/', $file, $match) !== 0) {
|
if (preg_match('/PHP_VERSION "(.*)"/', $file, $match) !== 0) {
|
||||||
return $match[1];
|
return $match[1];
|
||||||
}
|
}
|
||||||
|
if (!$exception_on_failure) {
|
||||||
|
return 'unknown';
|
||||||
|
}
|
||||||
throw new RuntimeException('PHP version file format is malformed, please remove it and download again');
|
throw new RuntimeException('PHP version file format is malformed, please remove it and download again');
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -274,17 +365,13 @@ abstract class BuilderBase
|
|||||||
public function getPHPVersionFromArchive(?string $file = null): false|string
|
public function getPHPVersionFromArchive(?string $file = null): false|string
|
||||||
{
|
{
|
||||||
if ($file === null) {
|
if ($file === null) {
|
||||||
$lock = file_exists(DOWNLOAD_PATH . '/.lock.json') ? file_get_contents(DOWNLOAD_PATH . '/.lock.json') : false;
|
$lock = LockFile::get('php-src');
|
||||||
if ($lock === false) {
|
if ($lock === null) {
|
||||||
return false;
|
|
||||||
}
|
|
||||||
$lock = json_decode($lock, true);
|
|
||||||
$file = $lock['php-src']['filename'] ?? null;
|
|
||||||
if ($file === null) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
$file = LockFile::getLockFullPath($lock);
|
||||||
}
|
}
|
||||||
if (preg_match('/php-(\d+\.\d+\.\d+(?:RC\d+)?)\.tar\.(?:gz|bz2|xz)/', $file, $match)) {
|
if (preg_match('/php-(\d+\.\d+\.\d+(?:RC\d+|alpha\d+|beta\d+)?)\.tar\.(?:gz|bz2|xz)/', $file, $match)) {
|
||||||
return $match[1];
|
return $match[1];
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@@ -328,6 +415,9 @@ abstract class BuilderBase
|
|||||||
if (($type & BUILD_TARGET_EMBED) === BUILD_TARGET_EMBED) {
|
if (($type & BUILD_TARGET_EMBED) === BUILD_TARGET_EMBED) {
|
||||||
$ls[] = 'embed';
|
$ls[] = 'embed';
|
||||||
}
|
}
|
||||||
|
if (($type & BUILD_TARGET_FRANKENPHP) === BUILD_TARGET_FRANKENPHP) {
|
||||||
|
$ls[] = 'frankenphp';
|
||||||
|
}
|
||||||
return implode(', ', $ls);
|
return implode(', ', $ls);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -396,7 +486,7 @@ abstract class BuilderBase
|
|||||||
foreach ($this->libs as $lib) {
|
foreach ($this->libs as $lib) {
|
||||||
$lib->validate();
|
$lib->validate();
|
||||||
}
|
}
|
||||||
foreach ($this->exts as $ext) {
|
foreach ($this->getExts() as $ext) {
|
||||||
$ext->validate();
|
$ext->validate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -434,6 +524,29 @@ abstract class BuilderBase
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function checkBeforeBuildPHP(int $rule): void
|
||||||
|
{
|
||||||
|
if (($rule & BUILD_TARGET_FRANKENPHP) === BUILD_TARGET_FRANKENPHP) {
|
||||||
|
if (!$this->getOption('enable-zts')) {
|
||||||
|
throw new WrongUsageException('FrankenPHP SAPI requires ZTS enabled PHP, build with `--enable-zts`!');
|
||||||
|
}
|
||||||
|
// frankenphp doesn't support windows, BSD is currently not supported by static-php-cli
|
||||||
|
if (!in_array(PHP_OS_FAMILY, ['Linux', 'Darwin'])) {
|
||||||
|
throw new WrongUsageException('FrankenPHP SAPI is only available on Linux and macOS!');
|
||||||
|
}
|
||||||
|
// frankenphp needs package go-xcaddy installed
|
||||||
|
$pkg_dir = PKG_ROOT_PATH . '/go-xcaddy-' . arch2gnu(php_uname('m')) . '-' . osfamily2shortname();
|
||||||
|
if (!file_exists("{$pkg_dir}/bin/go") || !file_exists("{$pkg_dir}/bin/xcaddy")) {
|
||||||
|
global $argv;
|
||||||
|
throw new WrongUsageException("FrankenPHP SAPI requires the go-xcaddy package, please install it first: {$argv[0]} install-pkg go-xcaddy");
|
||||||
|
}
|
||||||
|
// frankenphp needs libxml2 lib on macos, see: https://github.com/php/frankenphp/blob/main/frankenphp.go#L17
|
||||||
|
if (PHP_OS_FAMILY === 'Darwin' && !$this->getLib('libxml2')) {
|
||||||
|
throw new WrongUsageException('FrankenPHP SAPI for macOS requires libxml2 library, please include the `xml` extension in your build.');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generate micro extension test php code.
|
* Generate micro extension test php code.
|
||||||
*/
|
*/
|
||||||
@@ -441,7 +554,7 @@ abstract class BuilderBase
|
|||||||
{
|
{
|
||||||
$php = "<?php\n\necho '[micro-test-start]' . PHP_EOL;\n";
|
$php = "<?php\n\necho '[micro-test-start]' . PHP_EOL;\n";
|
||||||
|
|
||||||
foreach ($this->getExts() as $ext) {
|
foreach ($this->getExts(false) as $ext) {
|
||||||
$ext_name = $ext->getDistName();
|
$ext_name = $ext->getDistName();
|
||||||
if (!empty($ext_name)) {
|
if (!empty($ext_name)) {
|
||||||
$php .= "echo 'Running micro with {$ext_name} test' . PHP_EOL;\n";
|
$php .= "echo 'Running micro with {$ext_name} test' . PHP_EOL;\n";
|
||||||
|
|||||||
@@ -9,11 +9,21 @@ use SPC\exception\RuntimeException;
|
|||||||
use SPC\exception\WrongUsageException;
|
use SPC\exception\WrongUsageException;
|
||||||
use SPC\store\Config;
|
use SPC\store\Config;
|
||||||
use SPC\store\FileSystem;
|
use SPC\store\FileSystem;
|
||||||
|
use SPC\toolchain\ToolchainManager;
|
||||||
|
use SPC\toolchain\ZigToolchain;
|
||||||
|
use SPC\util\SPCConfigUtil;
|
||||||
|
use SPC\util\SPCTarget;
|
||||||
|
|
||||||
class Extension
|
class Extension
|
||||||
{
|
{
|
||||||
protected array $dependencies = [];
|
protected array $dependencies = [];
|
||||||
|
|
||||||
|
protected bool $build_shared = false;
|
||||||
|
|
||||||
|
protected bool $build_static = false;
|
||||||
|
|
||||||
|
protected string $source_dir;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @throws FileSystemException
|
* @throws FileSystemException
|
||||||
* @throws RuntimeException
|
* @throws RuntimeException
|
||||||
@@ -30,6 +40,25 @@ class Extension
|
|||||||
if (PHP_OS_FAMILY === 'Windows' && $unix_only) {
|
if (PHP_OS_FAMILY === 'Windows' && $unix_only) {
|
||||||
throw new RuntimeException("{$ext_type} extension {$name} is not supported on Windows platform");
|
throw new RuntimeException("{$ext_type} extension {$name} is not supported on Windows platform");
|
||||||
}
|
}
|
||||||
|
// set source_dir for builtin
|
||||||
|
if ($ext_type === 'builtin') {
|
||||||
|
$this->source_dir = SOURCE_PATH . '/php-src/ext/' . $this->name;
|
||||||
|
} elseif ($ext_type === 'external') {
|
||||||
|
$source = Config::getExt($this->name, 'source');
|
||||||
|
if ($source === null) {
|
||||||
|
throw new RuntimeException("{$ext_type} extension {$name} source not found");
|
||||||
|
}
|
||||||
|
$source_path = Config::getSource($source)['path'] ?? null;
|
||||||
|
$source_path = $source_path === null ? SOURCE_PATH . '/' . $source : SOURCE_PATH . '/' . $source_path;
|
||||||
|
$this->source_dir = $source_path;
|
||||||
|
} else {
|
||||||
|
$this->source_dir = SOURCE_PATH . '/php-src';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getFrameworks(): array
|
||||||
|
{
|
||||||
|
return Config::getExt($this->getName(), 'frameworks', []);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -38,20 +67,15 @@ class Extension
|
|||||||
* @throws FileSystemException
|
* @throws FileSystemException
|
||||||
* @throws WrongUsageException
|
* @throws WrongUsageException
|
||||||
*/
|
*/
|
||||||
public function getConfigureArg(): string
|
public function getConfigureArg(bool $shared = false): string
|
||||||
{
|
{
|
||||||
$arg = $this->getEnableArg();
|
return match (PHP_OS_FAMILY) {
|
||||||
switch (PHP_OS_FAMILY) {
|
'Windows' => $this->getWindowsConfigureArg($shared),
|
||||||
case 'Windows':
|
'Darwin',
|
||||||
$arg .= $this->getWindowsConfigureArg();
|
'Linux',
|
||||||
break;
|
'BSD' => $this->getUnixConfigureArg($shared),
|
||||||
case 'Darwin':
|
default => throw new WrongUsageException(PHP_OS_FAMILY . ' build is not supported yet'),
|
||||||
case 'Linux':
|
};
|
||||||
case 'BSD':
|
|
||||||
$arg .= $this->getUnixConfigureArg();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return $arg;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -60,15 +84,17 @@ class Extension
|
|||||||
* @throws FileSystemException
|
* @throws FileSystemException
|
||||||
* @throws WrongUsageException
|
* @throws WrongUsageException
|
||||||
*/
|
*/
|
||||||
public function getEnableArg(): string
|
public function getEnableArg(bool $shared = false): string
|
||||||
{
|
{
|
||||||
|
$escapedPath = str_replace("'", '', escapeshellarg(BUILD_ROOT_PATH)) !== BUILD_ROOT_PATH || str_contains(BUILD_ROOT_PATH, ' ') ? escapeshellarg(BUILD_ROOT_PATH) : BUILD_ROOT_PATH;
|
||||||
$_name = str_replace('_', '-', $this->name);
|
$_name = str_replace('_', '-', $this->name);
|
||||||
return match ($arg_type = Config::getExt($this->name, 'arg-type', 'enable')) {
|
return match ($arg_type = Config::getExt($this->name, 'arg-type', 'enable')) {
|
||||||
'enable' => '--enable-' . $_name . ' ',
|
'enable' => '--enable-' . $_name . ($shared ? '=shared' : '') . ' ',
|
||||||
'with' => '--with-' . $_name . ' ',
|
'enable-path' => '--enable-' . $_name . '=' . ($shared ? 'shared,' : '') . $escapedPath . ' ',
|
||||||
'with-prefix' => '--with-' . $_name . '="' . BUILD_ROOT_PATH . '" ',
|
'with' => '--with-' . $_name . ($shared ? '=shared' : '') . ' ',
|
||||||
|
'with-path' => '--with-' . $_name . '=' . ($shared ? 'shared,' : '') . $escapedPath . ' ',
|
||||||
'none', 'custom' => '',
|
'none', 'custom' => '',
|
||||||
default => throw new WrongUsageException("argType does not accept {$arg_type}, use [enable/with/with-prefix] ."),
|
default => throw new WrongUsageException("argType does not accept {$arg_type}, use [enable/with/with-path] ."),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -126,20 +152,21 @@ class Extension
|
|||||||
return $this->name;
|
return $this->name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getWindowsConfigureArg(): string
|
public function getWindowsConfigureArg(bool $shared = false): string
|
||||||
{
|
{
|
||||||
return '';
|
return $this->getEnableArg();
|
||||||
// Windows is not supported yet
|
// Windows is not supported yet
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getUnixConfigureArg(): string
|
public function getUnixConfigureArg(bool $shared = false): string
|
||||||
{
|
{
|
||||||
return '';
|
return $this->getEnableArg($shared);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Patch code before ./buildconf
|
* Patch code before ./buildconf
|
||||||
* If you need to patch some code, overwrite this and return true
|
* If you need to patch some code, overwrite this
|
||||||
|
* return true if you patched something, false if not
|
||||||
*/
|
*/
|
||||||
public function patchBeforeBuildconf(): bool
|
public function patchBeforeBuildconf(): bool
|
||||||
{
|
{
|
||||||
@@ -148,22 +175,131 @@ class Extension
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Patch code before ./configure
|
* Patch code before ./configure
|
||||||
* If you need to patch some code, overwrite this and return true
|
* If you need to patch some code, overwrite this
|
||||||
|
* return true if you patched something, false if not
|
||||||
*/
|
*/
|
||||||
public function patchBeforeConfigure(): bool
|
public function patchBeforeConfigure(): bool
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Patch code before ./configure.bat for Windows
|
||||||
|
*/
|
||||||
|
public function patchBeforeWindowsConfigure(): bool
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Patch code before make
|
* Patch code before make
|
||||||
* If you need to patch some code, overwrite this and return true
|
* If you need to patch some code, overwrite this
|
||||||
|
* return true if you patched something, false if not
|
||||||
*/
|
*/
|
||||||
public function patchBeforeMake(): bool
|
public function patchBeforeMake(): bool
|
||||||
{
|
{
|
||||||
|
if (SPCTarget::getTargetOS() === 'Linux' && $this->isBuildShared() && ($objs = getenv('SPC_EXTRA_RUNTIME_OBJECTS'))) {
|
||||||
|
FileSystem::replaceFileRegex(
|
||||||
|
SOURCE_PATH . '/php-src/Makefile',
|
||||||
|
"/^(shared_objects_{$this->getName()}\\s*=.*)$/m",
|
||||||
|
"$1 {$objs}",
|
||||||
|
);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Patch code before shared extension phpize
|
||||||
|
* If you need to patch some code, overwrite this
|
||||||
|
* return true if you patched something, false if not
|
||||||
|
*/
|
||||||
|
public function patchBeforeSharedPhpize(): bool
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Patch code before shared extension ./configure
|
||||||
|
* If you need to patch some code, overwrite this
|
||||||
|
* return true if you patched something, false if not
|
||||||
|
*/
|
||||||
|
public function patchBeforeSharedConfigure(): bool
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Patch code before shared extension make
|
||||||
|
* If you need to patch some code, overwrite this
|
||||||
|
* return true if you patched something, false if not
|
||||||
|
*/
|
||||||
|
public function patchBeforeSharedMake(): bool
|
||||||
|
{
|
||||||
|
$config = (new SPCConfigUtil($this->builder))->config([$this->getName()], array_map(fn ($l) => $l->getName(), $this->builder->getLibs()));
|
||||||
|
[$staticLibs] = $this->splitLibsIntoStaticAndShared($config['libs']);
|
||||||
|
FileSystem::replaceFileRegex(
|
||||||
|
$this->source_dir . '/Makefile',
|
||||||
|
'/^(.*_SHARED_LIBADD\s*=.*)$/m',
|
||||||
|
'$1 ' . trim($staticLibs)
|
||||||
|
);
|
||||||
|
if ($objs = getenv('SPC_EXTRA_RUNTIME_OBJECTS')) {
|
||||||
|
FileSystem::replaceFileRegex(
|
||||||
|
$this->source_dir . '/Makefile',
|
||||||
|
"/^(shared_objects_{$this->getName()}\\s*=.*)$/m",
|
||||||
|
"$1 {$objs}",
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return string
|
||||||
|
* returns a command line string with all required shared extensions to load
|
||||||
|
* i.e.; pdo_pgsql would return:
|
||||||
|
*
|
||||||
|
* `-d "extension=pgsql" -d "extension=pdo_pgsql"`
|
||||||
|
* @throws FileSystemException
|
||||||
|
* @throws WrongUsageException
|
||||||
|
*/
|
||||||
|
public function getSharedExtensionLoadString(): string
|
||||||
|
{
|
||||||
|
$loaded = [];
|
||||||
|
$order = [];
|
||||||
|
|
||||||
|
$resolve = function ($extension) use (&$resolve, &$loaded, &$order) {
|
||||||
|
if (isset($loaded[$extension->getName()])) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
$loaded[$extension->getName()] = true;
|
||||||
|
|
||||||
|
foreach ($this->dependencies as $dependency) {
|
||||||
|
$resolve($dependency);
|
||||||
|
}
|
||||||
|
|
||||||
|
$order[] = $extension;
|
||||||
|
};
|
||||||
|
|
||||||
|
$resolve($this);
|
||||||
|
|
||||||
|
$ret = '';
|
||||||
|
foreach ($order as $ext) {
|
||||||
|
if ($ext instanceof self && $ext->isBuildShared()) {
|
||||||
|
if (Config::getExt($ext->getName(), 'zend-extension', false) === true) {
|
||||||
|
$ret .= " -d \"zend_extension={$ext->getName()}\"";
|
||||||
|
} else {
|
||||||
|
$ret .= " -d \"extension={$ext->getName()}\"";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($ret !== '') {
|
||||||
|
$ret = ' -d "extension_dir=' . BUILD_MODULES_PATH . '"' . $ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $ret;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @throws RuntimeException
|
* @throws RuntimeException
|
||||||
*/
|
*/
|
||||||
@@ -172,9 +308,13 @@ class Extension
|
|||||||
// Run compile check if build target is cli
|
// Run compile check if build target is cli
|
||||||
// If you need to run some check, overwrite this or add your assert in src/globals/ext-tests/{extension_name}.php
|
// If you need to run some check, overwrite this or add your assert in src/globals/ext-tests/{extension_name}.php
|
||||||
// If check failed, throw RuntimeException
|
// If check failed, throw RuntimeException
|
||||||
[$ret] = shell()->execWithResult(BUILD_ROOT_PATH . '/bin/php --ri "' . $this->getDistName() . '"', false);
|
$sharedExtensions = $this->getSharedExtensionLoadString();
|
||||||
|
[$ret, $out] = shell()->execWithResult(BUILD_BIN_PATH . '/php -n' . $sharedExtensions . ' --ri "' . $this->getDistName() . '"');
|
||||||
if ($ret !== 0) {
|
if ($ret !== 0) {
|
||||||
throw new RuntimeException('extension ' . $this->getName() . ' failed compile check: php-cli returned ' . $ret);
|
throw new RuntimeException(
|
||||||
|
'extension ' . $this->getName() . ' failed runtime check: php-cli returned ' . $ret . "\n" .
|
||||||
|
join("\n", $out)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (file_exists(ROOT_DIR . '/src/globals/ext-tests/' . $this->getName() . '.php')) {
|
if (file_exists(ROOT_DIR . '/src/globals/ext-tests/' . $this->getName() . '.php')) {
|
||||||
@@ -185,11 +325,9 @@ class Extension
|
|||||||
file_get_contents(ROOT_DIR . '/src/globals/ext-tests/' . $this->getName() . '.php')
|
file_get_contents(ROOT_DIR . '/src/globals/ext-tests/' . $this->getName() . '.php')
|
||||||
);
|
);
|
||||||
|
|
||||||
[$ret, $out] = shell()->execWithResult(BUILD_ROOT_PATH . '/bin/php -r "' . trim($test) . '"');
|
[$ret, $out] = shell()->execWithResult(BUILD_BIN_PATH . '/php -n' . $sharedExtensions . ' -r "' . trim($test) . '"');
|
||||||
if ($ret !== 0) {
|
if ($ret !== 0) {
|
||||||
if ($this->builder->getOption('debug')) {
|
var_dump($out);
|
||||||
var_dump($out);
|
|
||||||
}
|
|
||||||
throw new RuntimeException('extension ' . $this->getName() . ' failed sanity check');
|
throw new RuntimeException('extension ' . $this->getName() . ' failed sanity check');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -228,6 +366,110 @@ class Extension
|
|||||||
// do nothing, just throw wrong usage exception if not valid
|
// do nothing, just throw wrong usage exception if not valid
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Build shared extension
|
||||||
|
*
|
||||||
|
* @throws WrongUsageException
|
||||||
|
* @throws RuntimeException
|
||||||
|
*/
|
||||||
|
public function buildShared(): void
|
||||||
|
{
|
||||||
|
if (Config::getExt($this->getName(), 'type') === 'builtin' || Config::getExt($this->getName(), 'build-with-php') === true) {
|
||||||
|
if (file_exists(BUILD_MODULES_PATH . '/' . $this->getName() . '.so')) {
|
||||||
|
logger()->info('Shared extension [' . $this->getName() . '] was already built by php-src/configure (' . $this->getName() . '.so)');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (Config::getExt($this->getName(), 'build-with-php') === true) {
|
||||||
|
logger()->warning('Shared extension [' . $this->getName() . '] did not build with php-src/configure (' . $this->getName() . '.so)');
|
||||||
|
logger()->warning('Try deleting your build and source folders and running `spc build`` again.');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (file_exists(BUILD_MODULES_PATH . '/' . $this->getName() . '.so')) {
|
||||||
|
logger()->info('Shared extension [' . $this->getName() . '] was already built, skipping (' . $this->getName() . '.so)');
|
||||||
|
}
|
||||||
|
logger()->info('Building extension [' . $this->getName() . '] as shared extension (' . $this->getName() . '.so)');
|
||||||
|
foreach ($this->dependencies as $dependency) {
|
||||||
|
if (!$dependency instanceof Extension) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (!$dependency->isBuildStatic()) {
|
||||||
|
logger()->info('extension ' . $this->getName() . ' requires extension ' . $dependency->getName());
|
||||||
|
$dependency->buildShared();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
match (PHP_OS_FAMILY) {
|
||||||
|
'Darwin', 'Linux' => $this->buildUnixShared(),
|
||||||
|
default => throw new WrongUsageException(PHP_OS_FAMILY . ' build shared extensions is not supported yet'),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Build shared extension for Unix
|
||||||
|
*
|
||||||
|
* @throws FileSystemException
|
||||||
|
* @throws RuntimeException
|
||||||
|
* @throws WrongUsageException
|
||||||
|
* @throws \ReflectionException
|
||||||
|
* @throws \Throwable
|
||||||
|
*/
|
||||||
|
public function buildUnixShared(): void
|
||||||
|
{
|
||||||
|
$config = (new SPCConfigUtil($this->builder))->config(
|
||||||
|
[$this->getName()],
|
||||||
|
array_map(fn ($l) => $l->getName(), $this->getLibraryDependencies(recursive: true)),
|
||||||
|
$this->builder->getOption('with-suggested-exts'),
|
||||||
|
$this->builder->getOption('with-suggested-libs'),
|
||||||
|
);
|
||||||
|
[$staticLibs, $sharedLibs] = $this->splitLibsIntoStaticAndShared($config['libs']);
|
||||||
|
$preStatic = PHP_OS_FAMILY === 'Darwin' ? '' : '-Wl,--start-group ';
|
||||||
|
$postStatic = PHP_OS_FAMILY === 'Darwin' ? '' : ' -Wl,--end-group ';
|
||||||
|
$env = [
|
||||||
|
'CFLAGS' => $config['cflags'],
|
||||||
|
'CXXFLAGS' => $config['cflags'],
|
||||||
|
'LDFLAGS' => $config['ldflags'],
|
||||||
|
'LIBS' => clean_spaces("{$preStatic} {$staticLibs} {$postStatic} {$sharedLibs}"),
|
||||||
|
'LD_LIBRARY_PATH' => BUILD_LIB_PATH,
|
||||||
|
];
|
||||||
|
if (ToolchainManager::getToolchainClass() === ZigToolchain::class && SPCTarget::getTargetOS() === 'Linux') {
|
||||||
|
$env['SPC_COMPILER_EXTRA'] = '-lstdc++';
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($this->patchBeforeSharedPhpize()) {
|
||||||
|
logger()->info("Extension [{$this->getName()}] patched before shared phpize");
|
||||||
|
}
|
||||||
|
|
||||||
|
// prepare configure args
|
||||||
|
shell()->cd($this->source_dir)
|
||||||
|
->setEnv($env)
|
||||||
|
->appendEnv($this->getExtraEnv())
|
||||||
|
->exec(BUILD_BIN_PATH . '/phpize');
|
||||||
|
|
||||||
|
if ($this->patchBeforeSharedConfigure()) {
|
||||||
|
logger()->info("Extension [{$this->getName()}] patched before shared configure");
|
||||||
|
}
|
||||||
|
|
||||||
|
shell()->cd($this->source_dir)
|
||||||
|
->setEnv($env)
|
||||||
|
->appendEnv($this->getExtraEnv())
|
||||||
|
->exec(
|
||||||
|
'./configure ' . $this->getUnixConfigureArg(true) .
|
||||||
|
' --with-php-config=' . BUILD_BIN_PATH . '/php-config ' .
|
||||||
|
'--enable-shared --disable-static'
|
||||||
|
);
|
||||||
|
|
||||||
|
if ($this->patchBeforeSharedMake()) {
|
||||||
|
logger()->info("Extension [{$this->getName()}] patched before shared make");
|
||||||
|
}
|
||||||
|
|
||||||
|
shell()->cd($this->source_dir)
|
||||||
|
->setEnv($env)
|
||||||
|
->appendEnv($this->getExtraEnv())
|
||||||
|
->exec('make clean')
|
||||||
|
->exec('make -j' . $this->builder->concurrency)
|
||||||
|
->exec('make install');
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get current extension version
|
* Get current extension version
|
||||||
*
|
*
|
||||||
@@ -238,6 +480,32 @@ class Extension
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function setBuildStatic(): void
|
||||||
|
{
|
||||||
|
if (!in_array('static', Config::getExtTarget($this->name))) {
|
||||||
|
throw new WrongUsageException("Extension [{$this->name}] does not support static build!");
|
||||||
|
}
|
||||||
|
$this->build_static = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setBuildShared(): void
|
||||||
|
{
|
||||||
|
if (!in_array('shared', Config::getExtTarget($this->name))) {
|
||||||
|
throw new WrongUsageException("Extension [{$this->name}] does not support shared build!");
|
||||||
|
}
|
||||||
|
$this->build_shared = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function isBuildShared(): bool
|
||||||
|
{
|
||||||
|
return $this->build_shared;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function isBuildStatic(): bool
|
||||||
|
{
|
||||||
|
return $this->build_static;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @throws RuntimeException
|
* @throws RuntimeException
|
||||||
*/
|
*/
|
||||||
@@ -270,6 +538,38 @@ class Extension
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function getExtraEnv(): array
|
||||||
|
{
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Splits a given string of library flags into static and shared libraries.
|
||||||
|
*
|
||||||
|
* @param string $allLibs A space-separated string of library flags (e.g., -lxyz).
|
||||||
|
* @return array an array containing two elements: the first is a space-separated string
|
||||||
|
* of static library flags, and the second is a space-separated string
|
||||||
|
* of shared library flags
|
||||||
|
*/
|
||||||
|
protected function splitLibsIntoStaticAndShared(string $allLibs): array
|
||||||
|
{
|
||||||
|
$staticLibString = '';
|
||||||
|
$sharedLibString = '';
|
||||||
|
$libs = explode(' ', $allLibs);
|
||||||
|
foreach ($libs as $lib) {
|
||||||
|
$staticLib = BUILD_LIB_PATH . '/lib' . str_replace('-l', '', $lib) . '.a';
|
||||||
|
if (str_starts_with($lib, BUILD_LIB_PATH . '/lib') && str_ends_with($lib, '.a')) {
|
||||||
|
$staticLib = $lib;
|
||||||
|
}
|
||||||
|
if ($lib === '-lphp' || !file_exists($staticLib)) {
|
||||||
|
$sharedLibString .= " {$lib}";
|
||||||
|
} else {
|
||||||
|
$staticLibString .= " {$lib}";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return [trim($staticLibString), trim($sharedLibString)];
|
||||||
|
}
|
||||||
|
|
||||||
private function getLibraryDependencies(bool $recursive = false): array
|
private function getLibraryDependencies(bool $recursive = false): array
|
||||||
{
|
{
|
||||||
$ret = array_filter($this->dependencies, fn ($x) => $x instanceof LibraryBase);
|
$ret = array_filter($this->dependencies, fn ($x) => $x instanceof LibraryBase);
|
||||||
@@ -295,6 +595,11 @@ class Extension
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (array_key_exists(0, $deps)) {
|
||||||
|
$zero = [0 => $deps[0]];
|
||||||
|
unset($deps[0]);
|
||||||
|
return $zero + $deps;
|
||||||
|
}
|
||||||
return $deps;
|
return $deps;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,11 +8,16 @@ use SPC\exception\FileSystemException;
|
|||||||
use SPC\exception\RuntimeException;
|
use SPC\exception\RuntimeException;
|
||||||
use SPC\exception\WrongUsageException;
|
use SPC\exception\WrongUsageException;
|
||||||
use SPC\store\Config;
|
use SPC\store\Config;
|
||||||
|
use SPC\store\Downloader;
|
||||||
use SPC\store\FileSystem;
|
use SPC\store\FileSystem;
|
||||||
|
use SPC\store\LockFile;
|
||||||
use SPC\store\SourceManager;
|
use SPC\store\SourceManager;
|
||||||
|
use SPC\util\GlobalValueTrait;
|
||||||
|
|
||||||
abstract class LibraryBase
|
abstract class LibraryBase
|
||||||
{
|
{
|
||||||
|
use GlobalValueTrait;
|
||||||
|
|
||||||
/** @var string */
|
/** @var string */
|
||||||
public const NAME = 'unknown';
|
public const NAME = 'unknown';
|
||||||
|
|
||||||
@@ -30,7 +35,7 @@ abstract class LibraryBase
|
|||||||
if (static::NAME === 'unknown') {
|
if (static::NAME === 'unknown') {
|
||||||
throw new RuntimeException('no unknown!!!!!');
|
throw new RuntimeException('no unknown!!!!!');
|
||||||
}
|
}
|
||||||
$this->source_dir = $source_dir ?? (SOURCE_PATH . '/' . static::NAME);
|
$this->source_dir = $source_dir ?? (SOURCE_PATH . '/' . Config::getLib(static::NAME, 'source'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -42,11 +47,11 @@ abstract class LibraryBase
|
|||||||
*/
|
*/
|
||||||
public function setup(bool $force = false): int
|
public function setup(bool $force = false): int
|
||||||
{
|
{
|
||||||
$lock = json_decode(FileSystem::readFile(DOWNLOAD_PATH . '/.lock.json'), true) ?? [];
|
|
||||||
$source = Config::getLib(static::NAME, 'source');
|
$source = Config::getLib(static::NAME, 'source');
|
||||||
// if source is locked as pre-built, we just tryInstall it
|
// if source is locked as pre-built, we just tryInstall it
|
||||||
if (isset($lock[$source]) && ($lock[$source]['lock_as'] ?? SPC_LOCK_SOURCE) === SPC_LOCK_PRE_BUILT) {
|
$pre_built_name = Downloader::getPreBuiltLockName($source);
|
||||||
return $this->tryInstall($lock[$source]['filename'], $force);
|
if (($lock = LockFile::get($pre_built_name)) && $lock['lock_as'] === SPC_DOWNLOAD_PRE_BUILT) {
|
||||||
|
return $this->tryInstall($lock, $force);
|
||||||
}
|
}
|
||||||
return $this->tryBuild($force);
|
return $this->tryBuild($force);
|
||||||
}
|
}
|
||||||
@@ -113,7 +118,7 @@ abstract class LibraryBase
|
|||||||
/*
|
/*
|
||||||
Rules:
|
Rules:
|
||||||
If it is a Windows system, try the following dependencies in order: lib-depends-windows, lib-depends-win, lib-depends.
|
If it is a Windows system, try the following dependencies in order: lib-depends-windows, lib-depends-win, lib-depends.
|
||||||
If it is a macOS system, try the following dependencies in order: lib-depends-darwin, lib-depends-unix, lib-depends.
|
If it is a macOS system, try the following dependencies in order: lib-depends-macos, lib-depends-unix, lib-depends.
|
||||||
If it is a Linux system, try the following dependencies in order: lib-depends-linux, lib-depends-unix, lib-depends.
|
If it is a Linux system, try the following dependencies in order: lib-depends-linux, lib-depends-unix, lib-depends.
|
||||||
*/
|
*/
|
||||||
foreach (Config::getLib(static::NAME, 'lib-depends', []) as $dep_name) {
|
foreach (Config::getLib(static::NAME, 'lib-depends', []) as $dep_name) {
|
||||||
@@ -146,18 +151,30 @@ abstract class LibraryBase
|
|||||||
return Config::getLib(static::NAME, 'headers', []);
|
return Config::getLib(static::NAME, 'headers', []);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get binary files.
|
||||||
|
*
|
||||||
|
* @throws FileSystemException
|
||||||
|
* @throws WrongUsageException
|
||||||
|
*/
|
||||||
|
public function getBinaryFiles(): array
|
||||||
|
{
|
||||||
|
return Config::getLib(static::NAME, 'bin', []);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @throws WrongUsageException
|
* @throws WrongUsageException
|
||||||
* @throws FileSystemException
|
* @throws FileSystemException
|
||||||
*/
|
*/
|
||||||
public function tryInstall(string $install_file, bool $force_install = false): int
|
public function tryInstall(array $lock, bool $force_install = false): int
|
||||||
{
|
{
|
||||||
|
$install_file = $lock['filename'];
|
||||||
if ($force_install) {
|
if ($force_install) {
|
||||||
logger()->info('Installing required library [' . static::NAME . '] from pre-built binaries');
|
logger()->info('Installing required library [' . static::NAME . '] from pre-built binaries');
|
||||||
|
|
||||||
// Extract files
|
// Extract files
|
||||||
try {
|
try {
|
||||||
FileSystem::extractPackage($install_file, DOWNLOAD_PATH . '/' . $install_file, BUILD_ROOT_PATH);
|
FileSystem::extractPackage($install_file, $lock['source_type'], DOWNLOAD_PATH . '/' . $install_file, BUILD_ROOT_PATH);
|
||||||
$this->install();
|
$this->install();
|
||||||
return LIB_STATUS_OK;
|
return LIB_STATUS_OK;
|
||||||
} catch (FileSystemException|RuntimeException $e) {
|
} catch (FileSystemException|RuntimeException $e) {
|
||||||
@@ -165,22 +182,8 @@ abstract class LibraryBase
|
|||||||
return LIB_STATUS_INSTALL_FAILED;
|
return LIB_STATUS_INSTALL_FAILED;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
foreach ($this->getStaticLibs() as $name) {
|
if (!$this->isLibraryInstalled()) {
|
||||||
if (!file_exists(BUILD_LIB_PATH . "/{$name}")) {
|
return $this->tryInstall($lock, true);
|
||||||
$this->tryInstall($install_file, true);
|
|
||||||
return LIB_STATUS_OK;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
foreach ($this->getHeaders() as $name) {
|
|
||||||
if (!file_exists(BUILD_INCLUDE_PATH . "/{$name}")) {
|
|
||||||
$this->tryInstall($install_file, true);
|
|
||||||
return LIB_STATUS_OK;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// pkg-config is treated specially. If it is pkg-config, check if the pkg-config binary exists
|
|
||||||
if (static::NAME === 'pkg-config' && !file_exists(BUILD_ROOT_PATH . '/bin/pkg-config')) {
|
|
||||||
$this->tryInstall($install_file, true);
|
|
||||||
return LIB_STATUS_OK;
|
|
||||||
}
|
}
|
||||||
return LIB_STATUS_ALREADY;
|
return LIB_STATUS_ALREADY;
|
||||||
}
|
}
|
||||||
@@ -203,12 +206,13 @@ abstract class LibraryBase
|
|||||||
}
|
}
|
||||||
// force means just build
|
// force means just build
|
||||||
if ($force_build) {
|
if ($force_build) {
|
||||||
logger()->info('Building required library [' . static::NAME . ']');
|
$type = Config::getLib(static::NAME, 'type', 'lib');
|
||||||
|
logger()->info('Building required ' . $type . ' [' . static::NAME . ']');
|
||||||
|
|
||||||
// extract first if not exists
|
// extract first if not exists
|
||||||
if (!is_dir($this->source_dir)) {
|
if (!is_dir($this->source_dir)) {
|
||||||
$this->getBuilder()->emitPatchPoint('before-library[ ' . static::NAME . ']-extract');
|
$this->getBuilder()->emitPatchPoint('before-library[ ' . static::NAME . ']-extract');
|
||||||
SourceManager::initSource(libs: [static::NAME]);
|
SourceManager::initSource(libs: [static::NAME], source_only: true);
|
||||||
$this->getBuilder()->emitPatchPoint('after-library[ ' . static::NAME . ']-extract');
|
$this->getBuilder()->emitPatchPoint('after-library[ ' . static::NAME . ']-extract');
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -222,37 +226,13 @@ abstract class LibraryBase
|
|||||||
return LIB_STATUS_OK;
|
return LIB_STATUS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
// check if these libraries exist, if not, invoke compilation and return the result status
|
if (!$this->isLibraryInstalled()) {
|
||||||
foreach ($this->getStaticLibs() as $name) {
|
return $this->tryBuild(true);
|
||||||
if (!file_exists(BUILD_LIB_PATH . "/{$name}")) {
|
|
||||||
$this->tryBuild(true);
|
|
||||||
return LIB_STATUS_OK;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// header files the same
|
|
||||||
foreach ($this->getHeaders() as $name) {
|
|
||||||
if (!file_exists(BUILD_INCLUDE_PATH . "/{$name}")) {
|
|
||||||
$this->tryBuild(true);
|
|
||||||
return LIB_STATUS_OK;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// pkg-config is treated specially. If it is pkg-config, check if the pkg-config binary exists
|
|
||||||
if (static::NAME === 'pkg-config' && !file_exists(BUILD_ROOT_PATH . '/bin/pkg-config')) {
|
|
||||||
$this->tryBuild(true);
|
|
||||||
return LIB_STATUS_OK;
|
|
||||||
}
|
}
|
||||||
// if all the files exist at this point, skip the compilation process
|
// if all the files exist at this point, skip the compilation process
|
||||||
return LIB_STATUS_ALREADY;
|
return LIB_STATUS_ALREADY;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Patch before build, overwrite this and return true to patch libs.
|
|
||||||
*/
|
|
||||||
public function patchBeforeBuild(): bool
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function validate(): void
|
public function validate(): void
|
||||||
{
|
{
|
||||||
// do nothing, just throw wrong usage exception if not valid
|
// do nothing, just throw wrong usage exception if not valid
|
||||||
@@ -278,6 +258,65 @@ abstract class LibraryBase
|
|||||||
// do something before pack, default do nothing. overwrite this method to do something (e.g. modify pkg-config file)
|
// do something before pack, default do nothing. overwrite this method to do something (e.g. modify pkg-config file)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Patch code before build
|
||||||
|
* If you need to patch some code, overwrite this
|
||||||
|
* return true if you patched something, false if not
|
||||||
|
*/
|
||||||
|
public function patchBeforeBuild(): bool
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Patch code before ./buildconf
|
||||||
|
* If you need to patch some code, overwrite this
|
||||||
|
* return true if you patched something, false if not
|
||||||
|
*/
|
||||||
|
public function patchBeforeBuildconf(): bool
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Patch code before ./configure
|
||||||
|
* If you need to patch some code, overwrite this
|
||||||
|
* return true if you patched something, false if not
|
||||||
|
*/
|
||||||
|
public function patchBeforeConfigure(): bool
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Patch code before windows configure.bat
|
||||||
|
* If you need to patch some code, overwrite this
|
||||||
|
* return true if you patched something, false if not
|
||||||
|
*/
|
||||||
|
public function patchBeforeWindowsConfigure(): bool
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Patch code before make
|
||||||
|
* If you need to patch some code, overwrite this
|
||||||
|
* return true if you patched something, false if not
|
||||||
|
*/
|
||||||
|
public function patchBeforeMake(): bool
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Patch php-config after embed was built
|
||||||
|
* Example: imap requires -lcrypt
|
||||||
|
*/
|
||||||
|
public function patchPhpConfig(): bool
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Build this library.
|
* Build this library.
|
||||||
*
|
*
|
||||||
@@ -287,7 +326,27 @@ abstract class LibraryBase
|
|||||||
|
|
||||||
protected function install(): void
|
protected function install(): void
|
||||||
{
|
{
|
||||||
// do something after extracting pre-built files, default do nothing. overwrite this method to do something
|
// replace placeholders if BUILD_ROOT_PATH/.spc-extract-placeholder.json exists
|
||||||
|
$replace_item_file = BUILD_ROOT_PATH . '/.spc-extract-placeholder.json';
|
||||||
|
if (!file_exists($replace_item_file)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
$replace_items = json_decode(file_get_contents($replace_item_file), true);
|
||||||
|
if (!is_array($replace_items)) {
|
||||||
|
throw new RuntimeException('Invalid placeholder file: ' . $replace_item_file);
|
||||||
|
}
|
||||||
|
$placeholders = get_pack_replace();
|
||||||
|
// replace placeholders in BUILD_ROOT_PATH
|
||||||
|
foreach ($replace_items as $item) {
|
||||||
|
$filepath = BUILD_ROOT_PATH . "/{$item}";
|
||||||
|
FileSystem::replaceFileStr(
|
||||||
|
$filepath,
|
||||||
|
array_values($placeholders),
|
||||||
|
array_keys($placeholders),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
// remove placeholder file
|
||||||
|
unlink($replace_item_file);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -334,4 +393,29 @@ abstract class LibraryBase
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function isLibraryInstalled(): bool
|
||||||
|
{
|
||||||
|
foreach (Config::getLib(static::NAME, 'static-libs', []) as $name) {
|
||||||
|
if (!file_exists(BUILD_LIB_PATH . "/{$name}")) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
foreach (Config::getLib(static::NAME, 'headers', []) as $name) {
|
||||||
|
if (!file_exists(BUILD_INCLUDE_PATH . "/{$name}")) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
foreach (Config::getLib(static::NAME, 'pkg-configs', []) as $name) {
|
||||||
|
if (!file_exists(BUILD_LIB_PATH . "/pkgconfig/{$name}.pc")) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
foreach (Config::getLib(static::NAME, 'bin', []) as $name) {
|
||||||
|
if (!file_exists(BUILD_BIN_PATH . "/{$name}")) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,18 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace SPC\builder;
|
namespace SPC\builder;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Interface for library implementations
|
||||||
|
*
|
||||||
|
* This interface defines the basic contract that all library classes must implement.
|
||||||
|
* It provides a common way to identify and work with different library types.
|
||||||
|
*/
|
||||||
interface LibraryInterface
|
interface LibraryInterface
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* Get the name of the library
|
||||||
|
*
|
||||||
|
* @return string The library name
|
||||||
|
*/
|
||||||
public function getName(): string;
|
public function getName(): string;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ class amqp extends Extension
|
|||||||
{
|
{
|
||||||
public function patchBeforeMake(): bool
|
public function patchBeforeMake(): bool
|
||||||
{
|
{
|
||||||
|
$patched = parent::patchBeforeMake();
|
||||||
if (PHP_OS_FAMILY === 'Windows') {
|
if (PHP_OS_FAMILY === 'Windows') {
|
||||||
FileSystem::replaceFileRegex(BUILD_INCLUDE_PATH . '\amqp.h', '/^#warning.*/m', '');
|
FileSystem::replaceFileRegex(BUILD_INCLUDE_PATH . '\amqp.h', '/^#warning.*/m', '');
|
||||||
FileSystem::replaceFileRegex(BUILD_INCLUDE_PATH . '\amqp_framing.h', '/^#warning.*/m', '');
|
FileSystem::replaceFileRegex(BUILD_INCLUDE_PATH . '\amqp_framing.h', '/^#warning.*/m', '');
|
||||||
@@ -20,15 +21,15 @@ class amqp extends Extension
|
|||||||
FileSystem::replaceFileRegex(BUILD_INCLUDE_PATH . '\amqp_tcp_socket.h', '/^#warning.*/m', '');
|
FileSystem::replaceFileRegex(BUILD_INCLUDE_PATH . '\amqp_tcp_socket.h', '/^#warning.*/m', '');
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return $patched;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getUnixConfigureArg(): string
|
public function getUnixConfigureArg(bool $shared = false): string
|
||||||
{
|
{
|
||||||
return '--with-amqp --with-librabbitmq-dir=' . BUILD_ROOT_PATH;
|
return '--with-amqp' . ($shared ? '=shared' : '') . ' --with-librabbitmq-dir=' . BUILD_ROOT_PATH;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getWindowsConfigureArg(): string
|
public function getWindowsConfigureArg($shared = false): string
|
||||||
{
|
{
|
||||||
return '--with-amqp';
|
return '--with-amqp';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,9 @@ declare(strict_types=1);
|
|||||||
namespace SPC\builder\extension;
|
namespace SPC\builder\extension;
|
||||||
|
|
||||||
use SPC\builder\Extension;
|
use SPC\builder\Extension;
|
||||||
|
use SPC\builder\linux\LinuxBuilder;
|
||||||
use SPC\builder\macos\MacOSBuilder;
|
use SPC\builder\macos\MacOSBuilder;
|
||||||
|
use SPC\builder\windows\WindowsBuilder;
|
||||||
use SPC\exception\FileSystemException;
|
use SPC\exception\FileSystemException;
|
||||||
use SPC\exception\WrongUsageException;
|
use SPC\exception\WrongUsageException;
|
||||||
use SPC\store\FileSystem;
|
use SPC\store\FileSystem;
|
||||||
@@ -21,7 +23,7 @@ class curl extends Extension
|
|||||||
{
|
{
|
||||||
logger()->info('patching before-configure for curl checks');
|
logger()->info('patching before-configure for curl checks');
|
||||||
$file1 = "AC_DEFUN([PHP_CHECK_LIBRARY], [\n $3\n])";
|
$file1 = "AC_DEFUN([PHP_CHECK_LIBRARY], [\n $3\n])";
|
||||||
$files = FileSystem::readFile(SOURCE_PATH . '/php-src/ext/curl/config.m4');
|
$files = FileSystem::readFile($this->source_dir . '/config.m4');
|
||||||
$file2 = 'AC_DEFUN([PHP_CHECK_LIBRARY], [
|
$file2 = 'AC_DEFUN([PHP_CHECK_LIBRARY], [
|
||||||
save_old_LDFLAGS=$LDFLAGS
|
save_old_LDFLAGS=$LDFLAGS
|
||||||
ac_stuff="$5"
|
ac_stuff="$5"
|
||||||
@@ -40,7 +42,7 @@ class curl extends Extension
|
|||||||
$4
|
$4
|
||||||
])dnl
|
])dnl
|
||||||
])';
|
])';
|
||||||
file_put_contents(SOURCE_PATH . '/php-src/ext/curl/config.m4', $file1 . "\n" . $files . "\n" . $file2);
|
file_put_contents($this->source_dir . '/config.m4', $file1 . "\n" . $files . "\n" . $file2);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -52,6 +54,84 @@ class curl extends Extension
|
|||||||
{
|
{
|
||||||
$frameworks = $this->builder instanceof MacOSBuilder ? ' ' . $this->builder->getFrameworks(true) . ' ' : '';
|
$frameworks = $this->builder instanceof MacOSBuilder ? ' ' . $this->builder->getFrameworks(true) . ' ' : '';
|
||||||
FileSystem::replaceFileRegex(SOURCE_PATH . '/php-src/configure', '/-lcurl/', $this->getLibFilesString() . $frameworks);
|
FileSystem::replaceFileRegex(SOURCE_PATH . '/php-src/configure', '/-lcurl/', $this->getLibFilesString() . $frameworks);
|
||||||
|
$this->patchBeforeSharedConfigure();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function patchBeforeMake(): bool
|
||||||
|
{
|
||||||
|
$patched = parent::patchBeforeMake();
|
||||||
|
$extra_libs = getenv('SPC_EXTRA_LIBS') ?: '';
|
||||||
|
if ($this->builder instanceof WindowsBuilder && !str_contains($extra_libs, 'secur32.lib')) {
|
||||||
|
$extra_libs .= ' secur32.lib';
|
||||||
|
putenv('SPC_EXTRA_LIBS=' . trim($extra_libs));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return $patched;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function patchBeforeSharedConfigure(): bool
|
||||||
|
{
|
||||||
|
$file = $this->source_dir . '/config.m4';
|
||||||
|
$content = FileSystem::readFile($file);
|
||||||
|
|
||||||
|
// Inject patch before it
|
||||||
|
$patch = ' save_LIBS="$LIBS"
|
||||||
|
LIBS="$LIBS $CURL_LIBS"
|
||||||
|
';
|
||||||
|
// Check if already patched
|
||||||
|
if (str_contains($content, $patch)) {
|
||||||
|
return false; // Already patched
|
||||||
|
}
|
||||||
|
|
||||||
|
// Match the line containing PHP_CHECK_LIBRARY for curl
|
||||||
|
$pattern = '/(PHP_CHECK_LIBRARY\(\[curl],\s*\[curl_easy_perform],)/';
|
||||||
|
|
||||||
|
// Restore LIBS after the check — append this just after the macro block
|
||||||
|
$restore = '
|
||||||
|
LIBS="$save_LIBS"';
|
||||||
|
|
||||||
|
// Apply patch
|
||||||
|
$patched = preg_replace_callback($pattern, function ($matches) use ($patch) {
|
||||||
|
return $patch . $matches[1];
|
||||||
|
}, $content, 1);
|
||||||
|
|
||||||
|
// Inject restore after the matching PHP_CHECK_LIBRARY block
|
||||||
|
$patched = preg_replace(
|
||||||
|
'/(PHP_CHECK_LIBRARY\(\[curl],\s*\[curl_easy_perform],.*?\)\n)/s',
|
||||||
|
"$1{$restore}\n",
|
||||||
|
$patched,
|
||||||
|
1
|
||||||
|
);
|
||||||
|
|
||||||
|
if ($patched === null) {
|
||||||
|
throw new \RuntimeException('Failed to patch config.m4 due to a regex error');
|
||||||
|
}
|
||||||
|
|
||||||
|
FileSystem::writeFile($file, $patched);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function buildUnixShared(): void
|
||||||
|
{
|
||||||
|
if (!$this->builder instanceof LinuxBuilder) {
|
||||||
|
parent::buildUnixShared();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
FileSystem::replaceFileStr(
|
||||||
|
$this->source_dir . '/config.m4',
|
||||||
|
['$ext_dir/phar.1', '$ext_dir/phar.phar.1'],
|
||||||
|
['${ext_dir}phar.1', '${ext_dir}phar.phar.1']
|
||||||
|
);
|
||||||
|
try {
|
||||||
|
parent::buildUnixShared();
|
||||||
|
} finally {
|
||||||
|
FileSystem::replaceFileStr(
|
||||||
|
$this->source_dir . '/config.m4',
|
||||||
|
['${ext_dir}phar.1', '${ext_dir}phar.phar.1'],
|
||||||
|
['$ext_dir/phar.1', '$ext_dir/phar.phar.1']
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,13 +10,13 @@ use SPC\util\CustomExt;
|
|||||||
#[CustomExt('dba')]
|
#[CustomExt('dba')]
|
||||||
class dba extends Extension
|
class dba extends Extension
|
||||||
{
|
{
|
||||||
public function getUnixConfigureArg(): string
|
public function getUnixConfigureArg(bool $shared = false): string
|
||||||
{
|
{
|
||||||
$qdbm = $this->builder->getLib('qdbm') ? (' --with-qdbm=' . BUILD_ROOT_PATH) : '';
|
$qdbm = $this->builder->getLib('qdbm') ? (' --with-qdbm=' . ($shared ? 'shared,' : '') . BUILD_ROOT_PATH) : '';
|
||||||
return '--enable-dba' . $qdbm;
|
return '--enable-dba' . ($shared ? '=shared' : '') . $qdbm;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getWindowsConfigureArg(): string
|
public function getWindowsConfigureArg(bool $shared = false): string
|
||||||
{
|
{
|
||||||
$qdbm = $this->builder->getLib('qdbm') ? ' --with-qdbm' : '';
|
$qdbm = $this->builder->getLib('qdbm') ? ' --with-qdbm' : '';
|
||||||
return '--with-dba' . $qdbm;
|
return '--with-dba' . $qdbm;
|
||||||
|
|||||||
35
src/SPC/builder/extension/dom.php
Normal file
35
src/SPC/builder/extension/dom.php
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace SPC\builder\extension;
|
||||||
|
|
||||||
|
use SPC\builder\Extension;
|
||||||
|
use SPC\exception\RuntimeException;
|
||||||
|
use SPC\store\FileSystem;
|
||||||
|
use SPC\util\CustomExt;
|
||||||
|
|
||||||
|
#[CustomExt('dom')]
|
||||||
|
class dom extends Extension
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @throws RuntimeException
|
||||||
|
*/
|
||||||
|
public function getUnixConfigureArg(bool $shared = false): string
|
||||||
|
{
|
||||||
|
$arg = '--enable-dom' . ($shared ? '=shared' : '');
|
||||||
|
$arg .= ' --with-libxml="' . BUILD_ROOT_PATH . '"';
|
||||||
|
return $arg;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function patchBeforeBuildconf(): bool
|
||||||
|
{
|
||||||
|
FileSystem::replaceFileStr(SOURCE_PATH . '/php-src/win32/build/config.w32', 'dllmain.c ', '');
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getWindowsConfigureArg($shared = false): string
|
||||||
|
{
|
||||||
|
return '--with-dom';
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -10,7 +10,7 @@ use SPC\util\CustomExt;
|
|||||||
#[CustomExt('enchant')]
|
#[CustomExt('enchant')]
|
||||||
class enchant extends Extension
|
class enchant extends Extension
|
||||||
{
|
{
|
||||||
public function getUnixConfigureArg(): string
|
public function getUnixConfigureArg(bool $shared = false): string
|
||||||
{
|
{
|
||||||
$glibs = [
|
$glibs = [
|
||||||
'/Users/jerry/project/git-project/static-php-cli/buildroot/lib/libgio-2.0.a',
|
'/Users/jerry/project/git-project/static-php-cli/buildroot/lib/libgio-2.0.a',
|
||||||
|
|||||||
31
src/SPC/builder/extension/ev.php
Normal file
31
src/SPC/builder/extension/ev.php
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace SPC\builder\extension;
|
||||||
|
|
||||||
|
use SPC\builder\Extension;
|
||||||
|
use SPC\exception\FileSystemException;
|
||||||
|
use SPC\store\FileSystem;
|
||||||
|
use SPC\util\CustomExt;
|
||||||
|
|
||||||
|
#[CustomExt('ev')]
|
||||||
|
class ev extends Extension
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @throws FileSystemException
|
||||||
|
*/
|
||||||
|
public function patchBeforeBuildconf(): bool
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* replace EXTENSION('ev', php_ev_sources, true, ' /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1');
|
||||||
|
* to EXTENSION('ev', php_ev_sources, PHP_EV_SHARED, ' /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1');
|
||||||
|
*/
|
||||||
|
FileSystem::replaceFileLineContainsString(
|
||||||
|
$this->source_dir . '/config.w32',
|
||||||
|
'EXTENSION(\'ev\'',
|
||||||
|
" EXTENSION('ev', php_ev_sources, PHP_EV_SHARED, ' /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1');"
|
||||||
|
);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -13,7 +13,7 @@ use SPC\util\CustomExt;
|
|||||||
#[CustomExt('event')]
|
#[CustomExt('event')]
|
||||||
class event extends Extension
|
class event extends Extension
|
||||||
{
|
{
|
||||||
public function getUnixConfigureArg(): string
|
public function getUnixConfigureArg(bool $shared = false): string
|
||||||
{
|
{
|
||||||
$arg = '--with-event-core --with-event-extra --with-event-libevent-dir=' . BUILD_ROOT_PATH;
|
$arg = '--with-event-core --with-event-extra --with-event-libevent-dir=' . BUILD_ROOT_PATH;
|
||||||
if ($this->builder->getLib('openssl')) {
|
if ($this->builder->getLib('openssl')) {
|
||||||
@@ -41,10 +41,12 @@ class event extends Extension
|
|||||||
*/
|
*/
|
||||||
public function patchBeforeMake(): bool
|
public function patchBeforeMake(): bool
|
||||||
{
|
{
|
||||||
|
$patched = parent::patchBeforeMake();
|
||||||
// Prevent event extension compile error on macOS
|
// Prevent event extension compile error on macOS
|
||||||
if ($this->builder instanceof MacOSBuilder) {
|
if ($this->builder instanceof MacOSBuilder) {
|
||||||
FileSystem::replaceFileRegex(SOURCE_PATH . '/php-src/main/php_config.h', '/^#define HAVE_OPENPTY 1$/m', '');
|
FileSystem::replaceFileRegex(SOURCE_PATH . '/php-src/main/php_config.h', '/^#define HAVE_OPENPTY 1$/m', '');
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
return true;
|
return $patched;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,12 +10,12 @@ use SPC\util\CustomExt;
|
|||||||
#[CustomExt('ffi')]
|
#[CustomExt('ffi')]
|
||||||
class ffi extends Extension
|
class ffi extends Extension
|
||||||
{
|
{
|
||||||
public function getUnixConfigureArg(): string
|
public function getUnixConfigureArg(bool $shared = false): string
|
||||||
{
|
{
|
||||||
return '--with-ffi --enable-zend-signals';
|
return '--with-ffi' . ($shared ? '=shared' : '') . ' --enable-zend-signals';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getWindowsConfigureArg(): string
|
public function getWindowsConfigureArg(bool $shared = false): string
|
||||||
{
|
{
|
||||||
return '--with-ffi';
|
return '--with-ffi';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,9 +10,9 @@ use SPC\util\CustomExt;
|
|||||||
#[CustomExt('gd')]
|
#[CustomExt('gd')]
|
||||||
class gd extends Extension
|
class gd extends Extension
|
||||||
{
|
{
|
||||||
public function getUnixConfigureArg(): string
|
public function getUnixConfigureArg(bool $shared = false): string
|
||||||
{
|
{
|
||||||
$arg = '--enable-gd';
|
$arg = '--enable-gd' . ($shared ? '=shared' : '');
|
||||||
$arg .= $this->builder->getLib('freetype') ? ' --with-freetype' : '';
|
$arg .= $this->builder->getLib('freetype') ? ' --with-freetype' : '';
|
||||||
$arg .= $this->builder->getLib('libjpeg') ? ' --with-jpeg' : '';
|
$arg .= $this->builder->getLib('libjpeg') ? ' --with-jpeg' : '';
|
||||||
$arg .= $this->builder->getLib('libwebp') ? ' --with-webp' : '';
|
$arg .= $this->builder->getLib('libwebp') ? ' --with-webp' : '';
|
||||||
|
|||||||
@@ -30,12 +30,12 @@ class glfw extends Extension
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getUnixConfigureArg(): string
|
public function getUnixConfigureArg(bool $shared = false): string
|
||||||
{
|
{
|
||||||
return '--enable-glfw --with-glfw-dir=' . BUILD_ROOT_PATH;
|
return '--enable-glfw --with-glfw-dir=' . BUILD_ROOT_PATH;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getWindowsConfigureArg(): string
|
public function getWindowsConfigureArg(bool $shared = false): string
|
||||||
{
|
{
|
||||||
return '--enable-glfw=static';
|
return '--enable-glfw=static';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,41 +5,54 @@ declare(strict_types=1);
|
|||||||
namespace SPC\builder\extension;
|
namespace SPC\builder\extension;
|
||||||
|
|
||||||
use SPC\builder\Extension;
|
use SPC\builder\Extension;
|
||||||
use SPC\builder\macos\MacOSBuilder;
|
|
||||||
use SPC\builder\windows\WindowsBuilder;
|
use SPC\builder\windows\WindowsBuilder;
|
||||||
use SPC\store\FileSystem;
|
use SPC\store\FileSystem;
|
||||||
use SPC\util\CustomExt;
|
use SPC\util\CustomExt;
|
||||||
use SPC\util\GlobalEnvManager;
|
use SPC\util\GlobalEnvManager;
|
||||||
|
use SPC\util\SPCConfigUtil;
|
||||||
|
use SPC\util\SPCTarget;
|
||||||
|
|
||||||
#[CustomExt('grpc')]
|
#[CustomExt('grpc')]
|
||||||
class grpc extends Extension
|
class grpc extends Extension
|
||||||
{
|
{
|
||||||
public function patchBeforeBuildconf(): bool
|
public function patchBeforeBuildconf(): bool
|
||||||
{
|
{
|
||||||
// soft link to the grpc source code
|
|
||||||
if ($this->builder instanceof WindowsBuilder) {
|
if ($this->builder instanceof WindowsBuilder) {
|
||||||
// not support windows yet
|
|
||||||
throw new \RuntimeException('grpc extension does not support windows yet');
|
throw new \RuntimeException('grpc extension does not support windows yet');
|
||||||
}
|
}
|
||||||
if (!is_link(SOURCE_PATH . '/php-src/ext/grpc')) {
|
if (file_exists(SOURCE_PATH . '/php-src/ext/grpc')) {
|
||||||
shell()->exec('ln -s ' . $this->builder->getLib('grpc')->getSourceDir() . '/src/php/ext/grpc ' . SOURCE_PATH . '/php-src/ext/grpc');
|
return false;
|
||||||
$macos = $this->builder instanceof MacOSBuilder ? "\n" . ' LDFLAGS="$LDFLAGS -framework CoreFoundation"' : '';
|
|
||||||
FileSystem::replaceFileRegex(SOURCE_PATH . '/php-src/ext/grpc/config.m4', '/GRPC_LIBDIR=.*$/m', 'GRPC_LIBDIR=' . BUILD_LIB_PATH . $macos);
|
|
||||||
FileSystem::replaceFileRegex(SOURCE_PATH . '/php-src/ext/grpc/config.m4', '/SEARCH_PATH=.*$/m', 'SEARCH_PATH="' . BUILD_ROOT_PATH . '"');
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
return false;
|
// soft link to the grpc source code
|
||||||
|
if (is_dir($this->source_dir . '/src/php/ext/grpc')) {
|
||||||
|
shell()->exec('ln -s ' . $this->source_dir . '/src/php/ext/grpc ' . SOURCE_PATH . '/php-src/ext/grpc');
|
||||||
|
} else {
|
||||||
|
throw new \RuntimeException('Cannot find grpc source code');
|
||||||
|
}
|
||||||
|
if (SPCTarget::getTargetOS() === 'Darwin') {
|
||||||
|
FileSystem::replaceFileRegex(
|
||||||
|
SOURCE_PATH . '/php-src/ext/grpc/config.m4',
|
||||||
|
'/GRPC_LIBDIR=.*$/m',
|
||||||
|
'GRPC_LIBDIR=' . BUILD_LIB_PATH . "\n" . 'LDFLAGS="$LDFLAGS -framework CoreFoundation"'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function patchBeforeConfigure(): bool
|
||||||
|
{
|
||||||
|
$util = new SPCConfigUtil($this->builder, ['libs_only_deps' => true]);
|
||||||
|
$config = $util->config(['grpc']);
|
||||||
|
$libs = $config['libs'];
|
||||||
|
FileSystem::replaceFileStr(SOURCE_PATH . '/php-src/configure', '-lgrpc', $libs);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function patchBeforeMake(): bool
|
public function patchBeforeMake(): bool
|
||||||
{
|
{
|
||||||
|
parent::patchBeforeMake();
|
||||||
// add -Wno-strict-prototypes
|
// add -Wno-strict-prototypes
|
||||||
GlobalEnvManager::putenv('SPC_CMD_VAR_PHP_MAKE_EXTRA_CFLAGS=' . getenv('SPC_CMD_VAR_PHP_MAKE_EXTRA_CFLAGS') . ' -Wno-strict-prototypes');
|
GlobalEnvManager::putenv('SPC_CMD_VAR_PHP_MAKE_EXTRA_CFLAGS=' . getenv('SPC_CMD_VAR_PHP_MAKE_EXTRA_CFLAGS') . ' -Wno-strict-prototypes');
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getUnixConfigureArg(): string
|
|
||||||
{
|
|
||||||
return '--enable-grpc=' . BUILD_ROOT_PATH . '/grpc GRPC_LIB_SUBDIR=' . BUILD_LIB_PATH;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,25 +5,24 @@ declare(strict_types=1);
|
|||||||
namespace SPC\builder\extension;
|
namespace SPC\builder\extension;
|
||||||
|
|
||||||
use SPC\builder\Extension;
|
use SPC\builder\Extension;
|
||||||
use SPC\builder\linux\LinuxBuilder;
|
|
||||||
use SPC\util\CustomExt;
|
use SPC\util\CustomExt;
|
||||||
|
|
||||||
#[CustomExt('imagick')]
|
#[CustomExt('imagick')]
|
||||||
class imagick extends Extension
|
class imagick extends Extension
|
||||||
{
|
{
|
||||||
public function patchBeforeMake(): bool
|
public function getUnixConfigureArg(bool $shared = false): string
|
||||||
{
|
{
|
||||||
// imagick may call omp_pause_all which requires -lgomp
|
$disable_omp = ' ac_cv_func_omp_pause_resource_all=no';
|
||||||
$extra_libs = getenv('SPC_EXTRA_LIBS') ?: '';
|
return '--with-imagick=' . ($shared ? 'shared,' : '') . BUILD_ROOT_PATH . $disable_omp;
|
||||||
if ($this->builder instanceof LinuxBuilder) {
|
|
||||||
$extra_libs .= (empty($extra_libs) ? '' : ' ') . '-lgomp ';
|
|
||||||
}
|
|
||||||
f_putenv('SPC_EXTRA_LIBS=' . $extra_libs);
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getUnixConfigureArg(): string
|
protected function splitLibsIntoStaticAndShared(string $allLibs): array
|
||||||
{
|
{
|
||||||
return '--with-imagick=' . BUILD_ROOT_PATH;
|
[$static, $shared] = parent::splitLibsIntoStaticAndShared($allLibs);
|
||||||
|
if (str_contains(getenv('PATH'), 'rh/devtoolset-10')) {
|
||||||
|
$static .= ' -l:libstdc++.a';
|
||||||
|
$shared = str_replace('-lstdc++', '', $shared);
|
||||||
|
}
|
||||||
|
return [clean_spaces($static), clean_spaces($shared)];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ declare(strict_types=1);
|
|||||||
namespace SPC\builder\extension;
|
namespace SPC\builder\extension;
|
||||||
|
|
||||||
use SPC\builder\Extension;
|
use SPC\builder\Extension;
|
||||||
|
use SPC\builder\linux\SystemUtil;
|
||||||
use SPC\exception\WrongUsageException;
|
use SPC\exception\WrongUsageException;
|
||||||
use SPC\store\FileSystem;
|
use SPC\store\FileSystem;
|
||||||
use SPC\util\CustomExt;
|
use SPC\util\CustomExt;
|
||||||
@@ -33,7 +34,7 @@ class imap extends Extension
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getUnixConfigureArg(): string
|
public function getUnixConfigureArg(bool $shared = false): string
|
||||||
{
|
{
|
||||||
$arg = '--with-imap=' . BUILD_ROOT_PATH;
|
$arg = '--with-imap=' . BUILD_ROOT_PATH;
|
||||||
if ($this->builder->getLib('openssl') !== null) {
|
if ($this->builder->getLib('openssl') !== null) {
|
||||||
@@ -41,4 +42,15 @@ class imap extends Extension
|
|||||||
}
|
}
|
||||||
return $arg;
|
return $arg;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function patchBeforeMake(): bool
|
||||||
|
{
|
||||||
|
$patched = parent::patchBeforeMake();
|
||||||
|
if (PHP_OS_FAMILY !== 'Linux' || SystemUtil::isMuslDist()) {
|
||||||
|
return $patched;
|
||||||
|
}
|
||||||
|
$extra_libs = trim((getenv('SPC_EXTRA_LIBS') ?: '') . ' -lcrypt');
|
||||||
|
f_putenv('SPC_EXTRA_LIBS=' . $extra_libs);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ declare(strict_types=1);
|
|||||||
namespace SPC\builder\extension;
|
namespace SPC\builder\extension;
|
||||||
|
|
||||||
use SPC\builder\Extension;
|
use SPC\builder\Extension;
|
||||||
|
use SPC\builder\windows\WindowsBuilder;
|
||||||
use SPC\store\FileSystem;
|
use SPC\store\FileSystem;
|
||||||
use SPC\util\CustomExt;
|
use SPC\util\CustomExt;
|
||||||
|
|
||||||
@@ -13,14 +14,19 @@ class intl extends Extension
|
|||||||
{
|
{
|
||||||
public function patchBeforeBuildconf(): bool
|
public function patchBeforeBuildconf(): bool
|
||||||
{
|
{
|
||||||
// TODO: remove the following line when https://github.com/php/php-src/pull/14002 will be released
|
if ($this->builder instanceof WindowsBuilder) {
|
||||||
FileSystem::replaceFileStr(SOURCE_PATH . '/php-src/ext/intl/config.m4', 'PHP_CXX_COMPILE_STDCXX(11', 'PHP_CXX_COMPILE_STDCXX(17');
|
FileSystem::replaceFileStr(
|
||||||
// Also need to use clang++ -std=c++17 to force override the default C++ standard
|
SOURCE_PATH . '/php-src/ext/intl/config.w32',
|
||||||
if (is_string($env = getenv('CXX')) && !str_contains($env, 'std=c++17')) {
|
'EXTENSION("intl", "php_intl.c intl_convert.c intl_convertcpp.cpp intl_error.c ", true,',
|
||||||
f_putenv('CXX=' . $env . ' -std=c++17');
|
'EXTENSION("intl", "php_intl.c intl_convert.c intl_convertcpp.cpp intl_error.c ", PHP_INTL_SHARED,'
|
||||||
} else {
|
);
|
||||||
f_putenv('CXX=clang++ -std=c++17');
|
return true;
|
||||||
}
|
}
|
||||||
return true;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function patchBeforeSharedPhpize(): bool
|
||||||
|
{
|
||||||
|
return $this->patchBeforeBuildconf();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
22
src/SPC/builder/extension/lz4.php
Normal file
22
src/SPC/builder/extension/lz4.php
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace SPC\builder\extension;
|
||||||
|
|
||||||
|
use SPC\builder\Extension;
|
||||||
|
use SPC\util\CustomExt;
|
||||||
|
|
||||||
|
#[CustomExt('lz4')]
|
||||||
|
class lz4 extends Extension
|
||||||
|
{
|
||||||
|
public function getUnixConfigureArg(bool $shared = false): string
|
||||||
|
{
|
||||||
|
return '--enable-lz4' . ($shared ? '=shared' : '') . ' --with-lz4-includedir=' . BUILD_ROOT_PATH;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getWindowsConfigureArg(bool $shared = false): string
|
||||||
|
{
|
||||||
|
return '--enable-lz4';
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -16,7 +16,7 @@ class mbregex extends Extension
|
|||||||
return 'mbstring';
|
return 'mbstring';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getConfigureArg(): string
|
public function getConfigureArg(bool $shared = false): string
|
||||||
{
|
{
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
@@ -26,7 +26,8 @@ class mbregex extends Extension
|
|||||||
*/
|
*/
|
||||||
public function runCliCheckUnix(): void
|
public function runCliCheckUnix(): void
|
||||||
{
|
{
|
||||||
[$ret] = shell()->execWithResult(BUILD_ROOT_PATH . '/bin/php --ri "mbstring" | grep regex', false);
|
$sharedext = $this->builder->getExt('mbstring')->isBuildShared() ? '-d "extension_dir=' . BUILD_MODULES_PATH . '" -d "extension=mbstring"' : '';
|
||||||
|
[$ret] = shell()->execWithResult(BUILD_ROOT_PATH . '/bin/php -n' . $sharedext . ' --ri "mbstring" | grep regex', false);
|
||||||
if ($ret !== 0) {
|
if ($ret !== 0) {
|
||||||
throw new RuntimeException('extension ' . $this->getName() . ' failed compile check: compiled php-cli mbstring extension does not contain regex !');
|
throw new RuntimeException('extension ' . $this->getName() . ' failed compile check: compiled php-cli mbstring extension does not contain regex !');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,9 +10,20 @@ use SPC\util\CustomExt;
|
|||||||
#[CustomExt('mbstring')]
|
#[CustomExt('mbstring')]
|
||||||
class mbstring extends Extension
|
class mbstring extends Extension
|
||||||
{
|
{
|
||||||
public function getConfigureArg(): string
|
public function getConfigureArg(bool $shared = false): string
|
||||||
{
|
{
|
||||||
$arg = '--enable-mbstring';
|
$arg = '--enable-mbstring' . ($shared ? '=shared' : '');
|
||||||
|
if ($this->builder->getExt('mbregex') === null) {
|
||||||
|
$arg .= ' --disable-mbregex';
|
||||||
|
} else {
|
||||||
|
$arg .= ' --enable-mbregex';
|
||||||
|
}
|
||||||
|
return $arg;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getUnixConfigureArg(bool $shared = false): string
|
||||||
|
{
|
||||||
|
$arg = '--enable-mbstring' . ($shared ? '=shared' : '');
|
||||||
if ($this->builder->getExt('mbregex') === null) {
|
if ($this->builder->getExt('mbregex') === null) {
|
||||||
$arg .= ' --disable-mbregex';
|
$arg .= ' --disable-mbregex';
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -12,9 +12,9 @@ use SPC\util\CustomExt;
|
|||||||
#[CustomExt('memcache')]
|
#[CustomExt('memcache')]
|
||||||
class memcache extends Extension
|
class memcache extends Extension
|
||||||
{
|
{
|
||||||
public function getUnixConfigureArg(): string
|
public function getUnixConfigureArg(bool $shared = false): string
|
||||||
{
|
{
|
||||||
return '--enable-memcache --with-zlib-dir=' . BUILD_ROOT_PATH;
|
return '--enable-memcache' . ($shared ? '=shared' : '') . ' --with-zlib-dir=' . BUILD_ROOT_PATH;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -10,9 +10,13 @@ use SPC\util\CustomExt;
|
|||||||
#[CustomExt('memcached')]
|
#[CustomExt('memcached')]
|
||||||
class memcached extends Extension
|
class memcached extends Extension
|
||||||
{
|
{
|
||||||
public function getUnixConfigureArg(): string
|
public function getUnixConfigureArg(bool $shared = false): string
|
||||||
{
|
{
|
||||||
$rootdir = BUILD_ROOT_PATH;
|
return '--enable-memcached' . ($shared ? '=shared' : '') . ' ' .
|
||||||
return "--enable-memcached --with-zlib-dir={$rootdir} --with-libmemcached-dir={$rootdir} --disable-memcached-sasl --enable-memcached-json";
|
'--with-zlib-dir=' . BUILD_ROOT_PATH . ' ' .
|
||||||
|
'--with-libmemcached-dir=' . BUILD_ROOT_PATH . ' ' .
|
||||||
|
'--disable-memcached-sasl ' .
|
||||||
|
'--enable-memcached-json ' .
|
||||||
|
'--with-system-fastlz';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ use SPC\util\CustomExt;
|
|||||||
#[CustomExt('mongodb')]
|
#[CustomExt('mongodb')]
|
||||||
class mongodb extends Extension
|
class mongodb extends Extension
|
||||||
{
|
{
|
||||||
public function getUnixConfigureArg(): string
|
public function getUnixConfigureArg(bool $shared = false): string
|
||||||
{
|
{
|
||||||
$arg = ' --enable-mongodb ';
|
$arg = ' --enable-mongodb ';
|
||||||
$arg .= ' --with-mongodb-system-libs=no --with-mongodb-client-side-encryption=no ';
|
$arg .= ' --with-mongodb-system-libs=no --with-mongodb-client-side-encryption=no ';
|
||||||
|
|||||||
17
src/SPC/builder/extension/odbc.php
Normal file
17
src/SPC/builder/extension/odbc.php
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace SPC\builder\extension;
|
||||||
|
|
||||||
|
use SPC\builder\Extension;
|
||||||
|
use SPC\util\CustomExt;
|
||||||
|
|
||||||
|
#[CustomExt('odbc')]
|
||||||
|
class odbc extends Extension
|
||||||
|
{
|
||||||
|
public function getUnixConfigureArg(bool $shared = false): string
|
||||||
|
{
|
||||||
|
return '--with-unixODBC=' . ($shared ? 'shared,' : '') . BUILD_ROOT_PATH;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -26,23 +26,30 @@ class opcache extends Extension
|
|||||||
|
|
||||||
public function patchBeforeBuildconf(): bool
|
public function patchBeforeBuildconf(): bool
|
||||||
{
|
{
|
||||||
|
$version = $this->builder->getPHPVersion();
|
||||||
if (file_exists(SOURCE_PATH . '/php-src/.opcache_patched')) {
|
if (file_exists(SOURCE_PATH . '/php-src/.opcache_patched')) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// if 8.2.0 <= PHP_VERSION < 8.2.23, we need to patch from legacy patch file
|
// if 8.2.0 <= PHP_VERSION < 8.2.23, we need to patch from legacy patch file
|
||||||
if (version_compare($this->builder->getPHPVersion(), '8.2.0', '>=') && version_compare($this->builder->getPHPVersion(), '8.2.23', '<')) {
|
if (version_compare($version, '8.2.0', '>=') && version_compare($version, '8.2.23', '<')) {
|
||||||
SourcePatcher::patchFile('spc_fix_static_opcache_before_80222.patch', SOURCE_PATH . '/php-src');
|
SourcePatcher::patchFile('spc_fix_static_opcache_before_80222.patch', SOURCE_PATH . '/php-src');
|
||||||
}
|
}
|
||||||
// if 8.3.0 <= PHP_VERSION < 8.3.11, we need to patch from legacy patch file
|
// if 8.3.0 <= PHP_VERSION < 8.3.11, we need to patch from legacy patch file
|
||||||
elseif (version_compare($this->builder->getPHPVersion(), '8.3.0', '>=') && version_compare($this->builder->getPHPVersion(), '8.3.11', '<')) {
|
elseif (version_compare($version, '8.3.0', '>=') && version_compare($version, '8.3.11', '<')) {
|
||||||
SourcePatcher::patchFile('spc_fix_static_opcache_before_80310.patch', SOURCE_PATH . '/php-src');
|
SourcePatcher::patchFile('spc_fix_static_opcache_before_80310.patch', SOURCE_PATH . '/php-src');
|
||||||
} else {
|
}
|
||||||
|
// if 8.3.12 <= PHP_VERSION < 8.5.0-dev, we need to patch from legacy patch file
|
||||||
|
elseif (version_compare($version, '8.5.0-dev', '<')) {
|
||||||
SourcePatcher::patchMicro(items: ['static_opcache']);
|
SourcePatcher::patchMicro(items: ['static_opcache']);
|
||||||
}
|
}
|
||||||
|
// PHP 8.5.0-dev and later supports static opcache without patching
|
||||||
|
else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
return file_put_contents(SOURCE_PATH . '/php-src/.opcache_patched', '1') !== false;
|
return file_put_contents(SOURCE_PATH . '/php-src/.opcache_patched', '1') !== false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getUnixConfigureArg(): string
|
public function getUnixConfigureArg(bool $shared = false): string
|
||||||
{
|
{
|
||||||
return '--enable-opcache';
|
return '--enable-opcache';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ class openssl extends Extension
|
|||||||
{
|
{
|
||||||
public function patchBeforeMake(): bool
|
public function patchBeforeMake(): bool
|
||||||
{
|
{
|
||||||
|
$patched = parent::patchBeforeMake();
|
||||||
// patch openssl3 with php8.0 bug
|
// patch openssl3 with php8.0 bug
|
||||||
if ($this->builder->getPHPVersionID() < 80100) {
|
if ($this->builder->getPHPVersionID() < 80100) {
|
||||||
$openssl_c = file_get_contents(SOURCE_PATH . '/php-src/ext/openssl/openssl.c');
|
$openssl_c = file_get_contents(SOURCE_PATH . '/php-src/ext/openssl/openssl.c');
|
||||||
@@ -20,11 +21,25 @@ class openssl extends Extension
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return $patched;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getUnixConfigureArg(): string
|
public function getUnixConfigureArg(bool $shared = false): string
|
||||||
{
|
{
|
||||||
return '--with-openssl=' . BUILD_ROOT_PATH . ' --with-openssl-dir=' . BUILD_ROOT_PATH;
|
$openssl_dir = $this->builder->getPHPVersionID() >= 80400 ? '' : ' --with-openssl-dir=' . BUILD_ROOT_PATH;
|
||||||
|
$args = '--with-openssl=' . ($shared ? 'shared,' : '') . BUILD_ROOT_PATH . $openssl_dir;
|
||||||
|
if ($this->builder->getPHPVersionID() >= 80500 || ($this->builder->getPHPVersionID() >= 80400 && !$this->builder->getOption('enable-zts'))) {
|
||||||
|
$args .= ' --with-openssl-argon2 OPENSSL_LIBS="-lz"';
|
||||||
|
}
|
||||||
|
return $args;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getWindowsConfigureArg(bool $shared = false): string
|
||||||
|
{
|
||||||
|
$args = '--with-openssl';
|
||||||
|
if ($this->builder->getPHPVersionID() >= 80500 || ($this->builder->getPHPVersionID() >= 80400 && !$this->builder->getOption('enable-zts'))) {
|
||||||
|
$args .= ' --with-openssl-argon2';
|
||||||
|
}
|
||||||
|
return $args;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ class opentelemetry extends Extension
|
|||||||
|
|
||||||
public function patchBeforeMake(): bool
|
public function patchBeforeMake(): bool
|
||||||
{
|
{
|
||||||
|
parent::patchBeforeMake();
|
||||||
// add -Wno-strict-prototypes
|
// add -Wno-strict-prototypes
|
||||||
GlobalEnvManager::putenv('SPC_CMD_VAR_PHP_MAKE_EXTRA_CFLAGS=' . getenv('SPC_CMD_VAR_PHP_MAKE_EXTRA_CFLAGS') . ' -Wno-strict-prototypes');
|
GlobalEnvManager::putenv('SPC_CMD_VAR_PHP_MAKE_EXTRA_CFLAGS=' . getenv('SPC_CMD_VAR_PHP_MAKE_EXTRA_CFLAGS') . ' -Wno-strict-prototypes');
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -18,9 +18,38 @@ class password_argon2 extends Extension
|
|||||||
|
|
||||||
public function runCliCheckUnix(): void
|
public function runCliCheckUnix(): void
|
||||||
{
|
{
|
||||||
[$ret] = shell()->execWithResult(BUILD_ROOT_PATH . '/bin/php -r "assert(defined(\'PASSWORD_ARGON2I\'));"');
|
[$ret] = shell()->execWithResult(BUILD_ROOT_PATH . '/bin/php -n -r "assert(defined(\'PASSWORD_ARGON2I\'));"');
|
||||||
if ($ret !== 0) {
|
if ($ret !== 0) {
|
||||||
throw new RuntimeException('extension ' . $this->getName() . ' failed sanity check');
|
throw new RuntimeException('extension ' . $this->getName() . ' failed sanity check');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function patchBeforeMake(): bool
|
||||||
|
{
|
||||||
|
$patched = parent::patchBeforeMake();
|
||||||
|
if ($this->builder->getLib('libsodium') !== null) {
|
||||||
|
$extraLibs = getenv('SPC_EXTRA_LIBS');
|
||||||
|
if ($extraLibs !== false) {
|
||||||
|
$extraLibs = str_replace(
|
||||||
|
[BUILD_LIB_PATH . '/libargon2.a', BUILD_LIB_PATH . '/libsodium.a'],
|
||||||
|
['', BUILD_LIB_PATH . '/libargon2.a ' . BUILD_LIB_PATH . '/libsodium.a'],
|
||||||
|
$extraLibs,
|
||||||
|
);
|
||||||
|
$extraLibs = trim(preg_replace('/\s+/', ' ', $extraLibs)); // normalize spacing
|
||||||
|
f_putenv('SPC_EXTRA_LIBS=' . $extraLibs);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $patched;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getConfigureArg(bool $shared = false): string
|
||||||
|
{
|
||||||
|
if ($this->builder->getLib('openssl') !== null) {
|
||||||
|
if ($this->builder->getPHPVersionID() >= 80500 || ($this->builder->getPHPVersionID() >= 80400 && !$this->builder->getOption('enable-zts'))) {
|
||||||
|
return '--without-password-argon2'; // use --with-openssl-argon2 in openssl extension instead
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return '--with-password-argon2';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
29
src/SPC/builder/extension/pdo_odbc.php
Normal file
29
src/SPC/builder/extension/pdo_odbc.php
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace SPC\builder\extension;
|
||||||
|
|
||||||
|
use SPC\builder\Extension;
|
||||||
|
use SPC\store\FileSystem;
|
||||||
|
use SPC\util\CustomExt;
|
||||||
|
|
||||||
|
#[CustomExt('pdo_odbc')]
|
||||||
|
class pdo_odbc extends Extension
|
||||||
|
{
|
||||||
|
public function patchBeforeBuildconf(): bool
|
||||||
|
{
|
||||||
|
FileSystem::replaceFileStr(SOURCE_PATH . '/php-src/ext/pdo_odbc/config.m4', 'PDO_ODBC_LDFLAGS="$pdo_odbc_def_ldflags', 'PDO_ODBC_LDFLAGS="-liconv $pdo_odbc_def_ldflags');
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getUnixConfigureArg(bool $shared = false): string
|
||||||
|
{
|
||||||
|
return '--with-pdo-odbc=' . ($shared ? 'shared,' : '') . 'unixODBC,' . BUILD_ROOT_PATH;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getWindowsConfigureArg(bool $shared = false): string
|
||||||
|
{
|
||||||
|
return '--with-pdo-odbc';
|
||||||
|
}
|
||||||
|
}
|
||||||
17
src/SPC/builder/extension/pdo_pgsql.php
Normal file
17
src/SPC/builder/extension/pdo_pgsql.php
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace SPC\builder\extension;
|
||||||
|
|
||||||
|
use SPC\builder\Extension;
|
||||||
|
use SPC\util\CustomExt;
|
||||||
|
|
||||||
|
#[CustomExt('pdo_pgsql')]
|
||||||
|
class pdo_pgsql extends Extension
|
||||||
|
{
|
||||||
|
public function getWindowsConfigureArg(bool $shared = false): string
|
||||||
|
{
|
||||||
|
return '--with-pdo-pgsql=yes';
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -33,11 +33,35 @@ class pgsql extends Extension
|
|||||||
* @throws WrongUsageException
|
* @throws WrongUsageException
|
||||||
* @throws RuntimeException
|
* @throws RuntimeException
|
||||||
*/
|
*/
|
||||||
public function getUnixConfigureArg(): string
|
public function getUnixConfigureArg(bool $shared = false): string
|
||||||
{
|
{
|
||||||
if ($this->builder->getPHPVersionID() >= 80400) {
|
if ($this->builder->getPHPVersionID() >= 80400) {
|
||||||
return '--with-pgsql PGSQL_CFLAGS=-I' . BUILD_INCLUDE_PATH . ' PGSQL_LIBS="-L' . BUILD_LIB_PATH . ' -lpq -lpgport -lpgcommon"';
|
$libfiles = $this->getLibFilesString();
|
||||||
|
$libfiles = str_replace(BUILD_LIB_PATH . '/lib', '-l', $libfiles);
|
||||||
|
$libfiles = str_replace('.a', '', $libfiles);
|
||||||
|
return '--with-pgsql' . ($shared ? '=shared' : '') .
|
||||||
|
' PGSQL_CFLAGS=-I' . BUILD_INCLUDE_PATH .
|
||||||
|
' PGSQL_LIBS="-L' . BUILD_LIB_PATH . ' ' . $libfiles . '"';
|
||||||
|
}
|
||||||
|
return '--with-pgsql=' . ($shared ? 'shared,' : '') . BUILD_ROOT_PATH;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @throws WrongUsageException
|
||||||
|
* @throws RuntimeException
|
||||||
|
*/
|
||||||
|
public function getWindowsConfigureArg(bool $shared = false): string
|
||||||
|
{
|
||||||
|
if ($this->builder->getPHPVersionID() >= 80400) {
|
||||||
|
return '--with-pgsql';
|
||||||
}
|
}
|
||||||
return '--with-pgsql=' . BUILD_ROOT_PATH;
|
return '--with-pgsql=' . BUILD_ROOT_PATH;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function getExtraEnv(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'CFLAGS' => '-Wno-int-conversion',
|
||||||
|
];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
37
src/SPC/builder/extension/phar.php
Normal file
37
src/SPC/builder/extension/phar.php
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace SPC\builder\extension;
|
||||||
|
|
||||||
|
use SPC\builder\Extension;
|
||||||
|
use SPC\builder\linux\LinuxBuilder;
|
||||||
|
use SPC\store\FileSystem;
|
||||||
|
use SPC\util\CustomExt;
|
||||||
|
|
||||||
|
#[CustomExt('phar')]
|
||||||
|
class phar extends Extension
|
||||||
|
{
|
||||||
|
public function buildUnixShared(): void
|
||||||
|
{
|
||||||
|
if (!$this->builder instanceof LinuxBuilder) {
|
||||||
|
parent::buildUnixShared();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
FileSystem::replaceFileStr(
|
||||||
|
$this->source_dir . '/config.m4',
|
||||||
|
['$ext_dir/phar.1', '$ext_dir/phar.phar.1'],
|
||||||
|
['${ext_dir}phar.1', '${ext_dir}phar.phar.1']
|
||||||
|
);
|
||||||
|
try {
|
||||||
|
parent::buildUnixShared();
|
||||||
|
} finally {
|
||||||
|
FileSystem::replaceFileStr(
|
||||||
|
$this->source_dir . '/config.m4',
|
||||||
|
['${ext_dir}phar.1', '${ext_dir}phar.phar.1'],
|
||||||
|
['$ext_dir/phar.1', '$ext_dir/phar.phar.1']
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -15,5 +15,10 @@ class protobuf extends Extension
|
|||||||
if ($this->builder->getPHPVersionID() < 80000 && getenv('SPC_SKIP_PHP_VERSION_CHECK') !== 'yes') {
|
if ($this->builder->getPHPVersionID() < 80000 && getenv('SPC_SKIP_PHP_VERSION_CHECK') !== 'yes') {
|
||||||
throw new \RuntimeException('The latest protobuf extension requires PHP 8.0 or later');
|
throw new \RuntimeException('The latest protobuf extension requires PHP 8.0 or later');
|
||||||
}
|
}
|
||||||
|
$grpc = $this->builder->getExt('grpc');
|
||||||
|
// protobuf conflicts with grpc
|
||||||
|
if ($grpc?->isBuildStatic()) {
|
||||||
|
throw new \RuntimeException('protobuf conflicts with grpc, please remove grpc or protobuf extension');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,8 +11,16 @@ use SPC\util\CustomExt;
|
|||||||
#[CustomExt('rdkafka')]
|
#[CustomExt('rdkafka')]
|
||||||
class rdkafka extends Extension
|
class rdkafka extends Extension
|
||||||
{
|
{
|
||||||
|
public function patchBeforeBuildconf(): bool
|
||||||
|
{
|
||||||
|
FileSystem::replaceFileStr("{$this->source_dir}/config.m4", "-L\$RDKAFKA_DIR/\$PHP_LIBDIR -lm\n", "-L\$RDKAFKA_DIR/\$PHP_LIBDIR -lm \$RDKAFKA_LIBS\n");
|
||||||
|
FileSystem::replaceFileStr("{$this->source_dir}/config.m4", "-L\$RDKAFKA_DIR/\$PHP_LIBDIR -lm\"\n", '-L$RDKAFKA_DIR/$PHP_LIBDIR -lm $RDKAFKA_LIBS"');
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public function patchBeforeMake(): bool
|
public function patchBeforeMake(): bool
|
||||||
{
|
{
|
||||||
|
parent::patchBeforeMake();
|
||||||
// when compiling rdkafka with inline builds, it shows some errors, I don't know why.
|
// when compiling rdkafka with inline builds, it shows some errors, I don't know why.
|
||||||
FileSystem::replaceFileStr(
|
FileSystem::replaceFileStr(
|
||||||
SOURCE_PATH . '/php-src/ext/rdkafka/rdkafka.c',
|
SOURCE_PATH . '/php-src/ext/rdkafka/rdkafka.c',
|
||||||
@@ -27,10 +35,10 @@ class rdkafka extends Extension
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getConfigureArg(): string
|
public function getUnixConfigureArg(bool $shared = false): string
|
||||||
{
|
{
|
||||||
$pkgconf_libs = shell()->execWithResult('pkg-config --libs --static rdkafka')[1];
|
$pkgconf_libs = shell()->execWithResult('pkg-config --libs --static rdkafka')[1];
|
||||||
$pkgconf_libs = trim(implode('', $pkgconf_libs));
|
$pkgconf_libs = trim(implode('', $pkgconf_libs));
|
||||||
return '--with-rdkafka=' . BUILD_ROOT_PATH . ' LIBS="' . $pkgconf_libs . '"';
|
return '--with-rdkafka=' . ($shared ? 'shared,' : '') . BUILD_ROOT_PATH . ' RDKAFKA_LIBS="' . $pkgconf_libs . '"';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,4 +24,23 @@ class readline extends Extension
|
|||||||
);
|
);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getUnixConfigureArg(bool $shared = false): string
|
||||||
|
{
|
||||||
|
$enable = '--without-libedit --with-readline=' . BUILD_ROOT_PATH;
|
||||||
|
if ($this->builder->getPHPVersionID() < 84000) {
|
||||||
|
// the check uses `char rl_pending_input()` instead of `extern int rl_pending_input`, which makes LTO fail
|
||||||
|
$enable .= ' ac_cv_lib_readline_rl_pending_input=yes';
|
||||||
|
}
|
||||||
|
return $enable;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function buildUnixShared(): void
|
||||||
|
{
|
||||||
|
if (!file_exists(BUILD_BIN_PATH . '/php') || !file_exists(BUILD_INCLUDE_PATH . '/php/sapi/cli/cli.h')) {
|
||||||
|
logger()->warning('CLI mode is not enabled, skipping readline build');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
parent::buildUnixShared();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,11 +10,16 @@ use SPC\util\CustomExt;
|
|||||||
#[CustomExt('redis')]
|
#[CustomExt('redis')]
|
||||||
class redis extends Extension
|
class redis extends Extension
|
||||||
{
|
{
|
||||||
public function getUnixConfigureArg(): string
|
public function getUnixConfigureArg(bool $shared = false): string
|
||||||
{
|
{
|
||||||
$arg = '--enable-redis';
|
$arg = '--enable-redis';
|
||||||
$arg .= $this->builder->getExt('session') ? ' --enable-redis-session' : ' --disable-redis-session';
|
if ($this->isBuildStatic()) {
|
||||||
$arg .= $this->builder->getExt('igbinary') ? ' --enable-redis-igbinary' : ' --disable-redis-igbinary';
|
$arg .= $this->builder->getExt('session')?->isBuildStatic() ? ' --enable-redis-session' : ' --disable-redis-session';
|
||||||
|
$arg .= $this->builder->getExt('igbinary')?->isBuildStatic() ? ' --enable-redis-igbinary' : ' --disable-redis-igbinary';
|
||||||
|
} else {
|
||||||
|
$arg .= $this->builder->getExt('session') ? ' --enable-redis-session' : ' --disable-redis-session';
|
||||||
|
$arg .= $this->builder->getExt('igbinary') ? ' --enable-redis-igbinary' : ' --disable-redis-igbinary';
|
||||||
|
}
|
||||||
if ($this->builder->getLib('zstd')) {
|
if ($this->builder->getLib('zstd')) {
|
||||||
$arg .= ' --enable-redis-zstd --with-libzstd="' . BUILD_ROOT_PATH . '"';
|
$arg .= ' --enable-redis-zstd --with-libzstd="' . BUILD_ROOT_PATH . '"';
|
||||||
}
|
}
|
||||||
@@ -24,7 +29,7 @@ class redis extends Extension
|
|||||||
return $arg;
|
return $arg;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getWindowsConfigureArg(): string
|
public function getWindowsConfigureArg(bool $shared = false): string
|
||||||
{
|
{
|
||||||
$arg = '--enable-redis';
|
$arg = '--enable-redis';
|
||||||
$arg .= $this->builder->getExt('session') ? ' --enable-redis-session' : ' --disable-redis-session';
|
$arg .= $this->builder->getExt('session') ? ' --enable-redis-session' : ' --disable-redis-session';
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ class snappy extends Extension
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getUnixConfigureArg(): string
|
public function getUnixConfigureArg(bool $shared = false): string
|
||||||
{
|
{
|
||||||
return '--enable-snappy --with-snappy-includedir="' . BUILD_ROOT_PATH . '"';
|
return '--enable-snappy --with-snappy-includedir="' . BUILD_ROOT_PATH . '"';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,28 +5,28 @@ declare(strict_types=1);
|
|||||||
namespace SPC\builder\extension;
|
namespace SPC\builder\extension;
|
||||||
|
|
||||||
use SPC\builder\Extension;
|
use SPC\builder\Extension;
|
||||||
use SPC\exception\WrongUsageException;
|
use SPC\store\FileSystem;
|
||||||
use SPC\util\CustomExt;
|
use SPC\util\CustomExt;
|
||||||
|
|
||||||
#[CustomExt('spx')]
|
#[CustomExt('spx')]
|
||||||
class spx extends Extension
|
class spx extends Extension
|
||||||
{
|
{
|
||||||
/**
|
public function getUnixConfigureArg(bool $shared = false): string
|
||||||
* @throws WrongUsageException
|
|
||||||
*/
|
|
||||||
public function validate(): void
|
|
||||||
{
|
{
|
||||||
if ($this->builder->getOption('enable-zts')) {
|
$arg = '--enable-spx' . ($shared ? '=shared' : '');
|
||||||
throw new WrongUsageException('ext-spx is not thread safe, do not build it with ZTS builds');
|
if ($this->builder->getLib('zlib') !== null) {
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getUnixConfigureArg(): string
|
|
||||||
{
|
|
||||||
$arg = '--enable-spx';
|
|
||||||
if ($this->builder->getExt('zlib') === null) {
|
|
||||||
$arg .= ' --with-zlib-dir=' . BUILD_ROOT_PATH;
|
$arg .= ' --with-zlib-dir=' . BUILD_ROOT_PATH;
|
||||||
}
|
}
|
||||||
return $arg;
|
return $arg;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function patchBeforeConfigure(): bool
|
||||||
|
{
|
||||||
|
FileSystem::replaceFileStr(
|
||||||
|
$this->source_dir . '/Makefile.frag',
|
||||||
|
'@cp -r assets/web-ui/*',
|
||||||
|
'@cp -r ' . $this->source_dir . '/assets/web-ui/*',
|
||||||
|
);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ class sqlsrv extends Extension
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function patchBeforeConfigure(): bool
|
public function patchBeforeWindowsConfigure(): bool
|
||||||
{
|
{
|
||||||
if ($this->pdo_sqlsrv_patched) {
|
if ($this->pdo_sqlsrv_patched) {
|
||||||
// revert pdo_sqlsrv patch
|
// revert pdo_sqlsrv patch
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user