Skip to content

Commit 1b72e65

Browse files
committed
Add extensions
1 parent ef3f2d3 commit 1b72e65

File tree

6 files changed

+232
-3
lines changed

6 files changed

+232
-3
lines changed

config.full.ini

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ wcli = Yes ; Windows CLI native support
8585
; apcu = Yes
8686
; ast = Yes
8787
; bitset = Yes
88+
; bsdiff = Yes
8889
; brotli = Yes
8990
; csv = Yes
9091
; dbase = Yes
@@ -95,16 +96,20 @@ wcli = Yes ; Windows CLI native support
9596
; geospatial = Yes
9697
; haru = Yes
9798
; igbinary = Yes
99+
; ip2location = Yes
100+
; ip2proxy = Yes
98101
; jsonpath = Yes
99102
; lzf = Yes
100103
; mailparse = Yes
101104
; maxminddb = Yes
102105
; msgpack = Yes
103106
; opentelemetry = Yes
104107
; parallel = Yes
108+
; pcsc = Yes
105109
; pecl_http = Yes
106110
; simdjson = Yes
107111
; ssh2 = Yes
112+
; stomp = Yes
108113
; sync = Yes
109114
; teds = Yes
110115
; timezonedb = Yes
@@ -115,6 +120,7 @@ wcli = Yes ; Windows CLI native support
115120
; xhprof = Yes
116121
; yac = Yes
117122
; yaml = Yes
123+
; zephir_parser = Yes
118124
; zstd = Yes
119125

120126

libraries/install_ip2location.php

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
<?php
2+
3+
/**
4+
* ██╗██████╗ ██████╗ ██╗ ██████╗ ██████╗ █████╗ ████████╗██╗ ██████╗ ███╗ ██╗
5+
* ██║██╔══██╗╚════██╗██║ ██╔═══██╗██╔════╝██╔══██╗╚══██╔══╝██║██╔═══██╗████╗ ██║
6+
* ██║██████╔╝ █████╔╝██║ ██║ ██║██║ ███████║ ██║ ██║██║ ██║██╔██╗ ██║
7+
* ██║██╔═══╝ ██╔═══╝ ██║ ██║ ██║██║ ██╔══██║ ██║ ██║██║ ██║██║╚██╗██║
8+
* ██║██║ ███████╗███████╗╚██████╔╝╚██████╗██║ ██║ ██║ ██║╚██████╔╝██║ ╚████║
9+
* ╚═╝╚═╝ ╚══════╝╚══════╝ ╚═════╝ ╚═════╝╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══╝
10+
*/
11+
12+
13+
$path = ARCH_PATH . $lib->name . '-' . $lib->version . '\\';
14+
$ip2log = LOG . 'ip2location.log';
15+
16+
17+
// Verify if libevent is installed
18+
if (is_dir($path) && is_file($path . 'build\lib\IP2Location.lib') && is_file(DEPS_PATH . 'lib\IP2Location.lib')) {
19+
draw_status($lib->name . '-' . $lib->version, "installed", Green);
20+
return;
21+
}
22+
23+
24+
// Download and unzip ip2location
25+
$tmpfile = TMP.pathinfo($lib->download_url, PATHINFO_BASENAME);
26+
if(!download_file($lib->download_url, $tmpfile, pathinfo($tmpfile, PATHINFO_BASENAME))) exit_error();
27+
if(!$firstdir = zip_first_dir($tmpfile)) exit_error("Invalid zip archive");
28+
if(!unzip($tmpfile, ARCH_PATH)) exit_error();
29+
if(!rename_wait(ARCH_PATH . $firstdir, $path)) exit_error("Can't rename library path");
30+
if(!$contents = curl_get_contents($lib->win_patch_url)) exit_error("Can't download patch");
31+
file_put_contents($path . 'libIP2Location\IP2Location.c', $contents);
32+
33+
34+
// Compile ip2location
35+
$label = "Compile " . $lib->name . '-' . $lib->version;
36+
draw_line($label, "running", Yellow);
37+
$bat = '@echo off'.RN;
38+
$bat .= 'cd ' . escapeshellarg($path).RN;
39+
$bat .= 'nmake Makefile.win'.RN;
40+
$batfile = TMP . 'build_ip2location.bat';
41+
file_put_contents($batfile, $bat);
42+
$ret = shell_exec_vs16($batfile);
43+
file_put_contents($ip2log, $ret);
44+
45+
46+
// Verify if the build works
47+
if(!is_file($path . 'libIP2Location\IP2Location.lib')) draw_status($label, "failed", Red, true, 'SEE: ' . $ip2log);
48+
else draw_status($label, "complete", Green);
49+
50+
51+
// Install ip2location
52+
$label = "Install " . $lib->name . '-' . $lib->version;
53+
draw_line($label, "running", Yellow);
54+
$builddir = $path . 'build\\';
55+
56+
$files[$path . 'libIP2Location\IP2Location.lib'] = 'lib\IP2Location.lib';
57+
$files[$path . 'libIP2Location\IP2Location.h'] = 'include\IP2Location.h';
58+
59+
if(!create_build($builddir, $files)) draw_status($label, "failed", Red, true);
60+
if(!install_deps($builddir)) draw_status($label, "failed", Red, true);
61+
else draw_status($label, "complete", Green);
62+
63+
delete_parent_deps($lib->name);

libraries/install_ip2proxy.php

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
<?php
2+
3+
/**
4+
* ██╗██████╗ ██████╗ ██████╗ ██████╗ ██████╗ ██╗ ██╗██╗ ██╗
5+
* ██║██╔══██╗╚════██╗██╔══██╗██╔══██╗██╔═══██╗╚██╗██╔╝╚██╗ ██╔╝
6+
* ██║██████╔╝ █████╔╝██████╔╝██████╔╝██║ ██║ ╚███╔╝ ╚████╔╝
7+
* ██║██╔═══╝ ██╔═══╝ ██╔═══╝ ██╔══██╗██║ ██║ ██╔██╗ ╚██╔╝
8+
* ██║██║ ███████╗██║ ██║ ██║╚██████╔╝██╔╝ ██╗ ██║
9+
* ╚═╝╚═╝ ╚══════╝╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝
10+
*/
11+
12+
13+
$path = ARCH_PATH . $lib->name . '-' . $lib->version . '\\';
14+
$ip2log = LOG . 'ip2proxy.log';
15+
16+
17+
// Verify if ip2proxy is installed
18+
if (is_dir($path) && is_file($path . 'build\lib\IP2Proxy.lib') && is_file(DEPS_PATH . 'lib\IP2Proxy.lib')) {
19+
draw_status($lib->name . '-' . $lib->version, "installed", Green);
20+
return;
21+
}
22+
23+
24+
// Download and unzip ip2proxy
25+
$tmpfile = TMP.pathinfo($lib->download_url, PATHINFO_BASENAME);
26+
if(!download_file($lib->download_url, $tmpfile, pathinfo($tmpfile, PATHINFO_BASENAME))) exit_error();
27+
if(!$firstdir = zip_first_dir($tmpfile)) exit_error("Invalid zip archive");
28+
if(!unzip($tmpfile, ARCH_PATH)) exit_error();
29+
if(!rename_wait(ARCH_PATH . $firstdir, $path)) exit_error("Can't rename library path");
30+
31+
32+
// Compile ip2proxy
33+
$label = "Compile " . $lib->name . '-' . $lib->version;
34+
draw_line($label, "running", Yellow);
35+
$bat = '@echo off'.RN;
36+
$bat .= 'cd ' . escapeshellarg($path).RN;
37+
$bat .= 'nmake /A /f Makefile.win'.RN;
38+
$batfile = TMP . 'build_ip2proxy.bat';
39+
file_put_contents($batfile, $bat);
40+
$ret = shell_exec_vs16($batfile);
41+
file_put_contents($ip2log, $ret);
42+
43+
44+
// Verify if the build works
45+
if(!is_file($path . 'libIP2Proxy\IP2Proxy.lib')) draw_status($label, "failed", Red, true, 'SEE: ' . $ip2log);
46+
else draw_status($label, "complete", Green);
47+
48+
49+
50+
// Install ip2proxy
51+
$label = "Install " . $lib->name . '-' . $lib->version;
52+
draw_line($label, "running", Yellow);
53+
$builddir = $path . 'build\\';
54+
55+
$files[$path . 'libIP2Proxy\IP2Proxy.lib'] = 'lib\IP2Proxy.lib';
56+
$files[$path . 'libIP2Proxy\IP2Proxy.h'] = 'include\IP2Proxy.h';
57+
58+
if(!create_build($builddir, $files)) draw_status($label, "failed", Red, true);
59+
if(!install_deps($builddir)) draw_status($label, "failed", Red, true);
60+
else draw_status($label, "complete", Green);
61+
62+
delete_parent_deps($lib->name);

libraries/install_libpng.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,7 @@
3030

3131

3232
// Find zlib
33-
foreach($MATRIX->libraries as $_lib)
34-
if($_lib->name == 'zlib')
35-
break;
33+
foreach($MATRIX->libraries as $_lib) if($_lib->name == 'zlib') break;
3634
if($_lib->name != 'zlib') exit_error("Can't find zlib");
3735
$zlib = $_lib->name . '-' . $_lib->version;
3836
if(!is_dir(ARCH_PATH . $zlib)) exit_error("Can't find zlib");

matrix.json

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -943,6 +943,73 @@
943943
"switch": "--enable-mailparse",
944944
"dependancies": ["mbstring"],
945945
"libraries": []
946+
},
947+
{
948+
"name": "bsdiff",
949+
"repo": "",
950+
"url": "https://pecl.php.net/get/bsdiff-0.1.2.tgz",
951+
"version": "0.1.2",
952+
"install_script": "ext_bsdiff.php",
953+
"builtin": false,
954+
"mandatory": false,
955+
"switch": "--enable-bsdiff",
956+
"dependancies": ["bz2"],
957+
"libraries": []
958+
},
959+
{
960+
"name": "ip2location",
961+
"repo": "",
962+
"url": "https://pecl.php.net/get/ip2location-8.2.0.tgz",
963+
"version": "8.2.0",
964+
"builtin": false,
965+
"mandatory": false,
966+
"switch": "--with-ip2location",
967+
"dependancies": [],
968+
"libraries": ["ip2location"]
969+
},
970+
{
971+
"name": "ip2proxy",
972+
"repo": "",
973+
"url": "https://pecl.php.net/get/ip2proxy-3.0.3.tgz",
974+
"version": "3.0.3",
975+
"builtin": false,
976+
"mandatory": false,
977+
"switch": "--with-ip2proxy",
978+
"dependancies": [],
979+
"libraries": ["ip2proxy"]
980+
},
981+
{
982+
"name": "pcsc",
983+
"repo": "",
984+
"url": "https://pecl.php.net/get/pcsc-0.5.1.tgz",
985+
"version": "0.5.1",
986+
"builtin": false,
987+
"mandatory": false,
988+
"switch": "--with-pcsc",
989+
"dependancies": [],
990+
"libraries": []
991+
},
992+
{
993+
"name": "stomp",
994+
"repo": "",
995+
"url": "https://pecl.php.net/get/stomp-2.0.3.tgz",
996+
"version": "2.0.3",
997+
"builtin": false,
998+
"mandatory": false,
999+
"switch": "--enable-stomp",
1000+
"dependancies": [],
1001+
"libraries": ["openssl"]
1002+
},
1003+
{
1004+
"name": "zephir_parser",
1005+
"repo": "",
1006+
"url": "https://pecl.php.net/get/zephir_parser-1.6.0.tgz",
1007+
"version": "1.6.0",
1008+
"builtin": false,
1009+
"mandatory": false,
1010+
"switch": "--enable-zephir-parser",
1011+
"dependancies": [],
1012+
"libraries": []
9461013
}
9471014
],
9481015

@@ -1365,6 +1432,23 @@
13651432
"install_script": "install_mpdecimal.php",
13661433
"mandatory": false,
13671434
"dependancies": []
1435+
},
1436+
{
1437+
"name": "ip2location",
1438+
"version": "8.6.1-1",
1439+
"download_url": "https://github.com/chrislim2888/IP2Location-C-Library/archive/refs/heads/master.zip",
1440+
"win_patch_url": "https://raw.githubusercontent.com/lexylein/IP2Location-C-Library/patch-1/libIP2Location/IP2Location.cz",
1441+
"install_script": "install_ip2location.php",
1442+
"mandatory": false,
1443+
"dependancies": []
1444+
},
1445+
{
1446+
"name": "ip2proxy",
1447+
"version": "4.1.2",
1448+
"download_url": "https://github.com/ip2location/ip2proxy-c/archive/refs/tags/4.1.2.zip",
1449+
"install_script": "install_ip2proxy.php",
1450+
"mandatory": false,
1451+
"dependancies": []
13681452
}
13691453
]
13701454
}

php/ext_bsdiff.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
/**
4+
* ██████╗ █████╗ ████████╗ ██████╗██╗ ██╗ ██████╗ ███████╗██████╗ ██╗███████╗███████╗
5+
* ██╔══██╗██╔══██╗╚══██╔══╝██╔════╝██║ ██║ ██╔══██╗██╔════╝██╔══██╗██║██╔════╝██╔════╝
6+
* ██████╔╝███████║ ██║ ██║ ███████║ ██████╔╝███████╗██║ ██║██║█████╗ █████╗
7+
* ██╔═══╝ ██╔══██║ ██║ ██║ ██╔══██║ ██╔══██╗╚════██║██║ ██║██║██╔══╝ ██╔══╝
8+
* ██║ ██║ ██║ ██║ ╚██████╗██║ ██║ ██████╔╝███████║██████╔╝██║██║ ██║
9+
* ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝ ╚═════╝ ╚══════╝╚═════╝ ╚═╝╚═╝ ╚═╝
10+
*/
11+
12+
13+
$contents = file_get_contents($path . 'config.w32');
14+
$contents = preg_replace('#ARG_WITH\("bz2.*ARG_ENABLE\(\'bsdiff#msi', "ARG_ENABLE('bsdiff", $contents);
15+
file_put_contents($path . 'config.w32', $contents);
16+

0 commit comments

Comments
 (0)