setup-php 2.36.0 → 2.37.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -12
- package/lib/config.js +5 -2
- package/lib/config.js.map +1 -1
- package/lib/core.d.ts +8 -0
- package/lib/core.js +55 -0
- package/lib/core.js.map +1 -0
- package/lib/extensions.js +9 -8
- package/lib/extensions.js.map +1 -1
- package/lib/fetch.js +25 -70
- package/lib/fetch.js.map +1 -1
- package/lib/install.js +3 -3
- package/lib/install.js.map +1 -1
- package/lib/tools.d.ts +50 -21
- package/lib/tools.js +211 -150
- package/lib/tools.js.map +1 -1
- package/lib/utils.d.ts +3 -0
- package/lib/utils.js +62 -26
- package/lib/utils.js.map +1 -1
- package/package.json +20 -20
- package/src/config.ts +5 -2
- package/src/configs/brew_extensions +19 -0
- package/src/configs/composer-gh-auth-no-op +3 -0
- package/src/configs/composer-gh-auth-warn +1 -0
- package/src/configs/os_releases.csv +4 -1
- package/src/core.ts +112 -0
- package/src/extensions.ts +16 -15
- package/src/fetch.ts +28 -42
- package/src/install.ts +6 -3
- package/src/scripts/darwin.sh +12 -6
- package/src/scripts/extensions/couchbase.sh +13 -2
- package/src/scripts/extensions/firebird.sh +6 -23
- package/src/scripts/extensions/gearman.sh +1 -1
- package/src/scripts/extensions/http.ps1 +7 -5
- package/src/scripts/extensions/phalcon.ps1 +3 -21
- package/src/scripts/extensions/phalcon.sh +2 -0
- package/src/scripts/extensions/relay.sh +5 -2
- package/src/scripts/extensions/source.sh +3 -1
- package/src/scripts/extensions/sqlsrv.ps1 +2 -0
- package/src/scripts/extensions/sqlsrv.sh +2 -0
- package/src/scripts/linux.sh +49 -9
- package/src/scripts/tools/add_tools.ps1 +75 -27
- package/src/scripts/tools/add_tools.sh +67 -23
- package/src/scripts/tools/blackfire.sh +1 -1
- package/src/scripts/tools/brew.sh +130 -0
- package/src/scripts/tools/grpc_php_plugin.sh +2 -2
- package/src/scripts/tools/ppa.sh +5 -1
- package/src/scripts/unix.sh +7 -3
- package/src/scripts/win32.ps1 +17 -11
- package/src/tools.ts +349 -203
- package/src/utils.ts +81 -34
package/src/extensions.ts
CHANGED
|
@@ -35,9 +35,9 @@ export async function addExtensionDarwin(
|
|
|
35
35
|
// match 5.3blackfire...8.5blackfire
|
|
36
36
|
// match 5.3blackfire-(semver)...8.5blackfire-(semver)
|
|
37
37
|
// match couchbase, event, geos, ibm_db2, pdo_ibm, pdo_oci, oci8, http, pecl_http
|
|
38
|
-
// match 5.3ioncube...8.
|
|
38
|
+
// match 5.3ioncube...8.5ioncube
|
|
39
39
|
// match 7.0phalcon3...7.3phalcon3, 7.2phalcon4...7.4phalcon4, and 7.4phalcon5...8.4phalcon5
|
|
40
|
-
// match 7.0zephir_parser...8.
|
|
40
|
+
// match 7.0zephir_parser...8.5zephir_parser
|
|
41
41
|
case /^(7\.4|8\.[0-5])relay(-v?\d+\.\d+\.\d+|-nightly)?$/.test(
|
|
42
42
|
version_extension
|
|
43
43
|
):
|
|
@@ -47,12 +47,12 @@ export async function addExtensionDarwin(
|
|
|
47
47
|
case /^couchbase|^event|^gearman$|^geos$|^ibm_db2$|^pdo_ibm$|^pdo_oci$|^oci8$|^(pecl_)?http|^pdo_firebird$/.test(
|
|
48
48
|
extension
|
|
49
49
|
):
|
|
50
|
-
case /^(5\.[3-6]|7\.[0-4]|8\.[0-
|
|
50
|
+
case /^(5\.[3-6]|7\.[0-4]|8\.[0-5])ioncube$/.test(version_extension):
|
|
51
51
|
case /(5\.6|7\.[0-3])phalcon3|7\.[2-4]phalcon4|(7\.4|8\.[0-4])phalcon5?/.test(
|
|
52
52
|
version_extension
|
|
53
53
|
):
|
|
54
54
|
case /(?<!5\.[3-6])(pdo_)?sqlsrv$/.test(version_extension):
|
|
55
|
-
case /^(7\.[0-4]|8\.[0-
|
|
55
|
+
case /^(7\.[0-4]|8\.[0-5])zephir_parser(-v?\d+\.\d+\.\d+)?$/.test(
|
|
56
56
|
version_extension
|
|
57
57
|
):
|
|
58
58
|
add_script += await utils.customPackage(
|
|
@@ -85,13 +85,14 @@ export async function addExtensionDarwin(
|
|
|
85
85
|
add_script += await utils.getUnsupportedLog('pcov', version, 'darwin');
|
|
86
86
|
return;
|
|
87
87
|
// match brew extensions
|
|
88
|
-
case /(?<!5\.[3-5])(amqp|apcu|expect|gnupg|grpc|igbinary|imagick|imap|mailparse|mcrypt|memcache|memcached|mongodb|msgpack|protobuf|psr|raphf|rdkafka|redis|snmp|ssh2|swoole|uuid|vld|xdebug|xdebug2|yaml|zmq)/.test(
|
|
88
|
+
case /(?<!5\.[3-5])(amqp|apcu|brotli|excimer|expect|gmagick|gnupg|grpc|igbinary|imagick|imap|interbase|mailparse|maxminddb|mcrypt|memcache|memcached|mongodb|mongodb1|msgpack|newrelic|oauth|opentelemetry|pdo_firebird|pinba|protobuf|psr|raphf|rdkafka|redis|scalar_objects|seaslog|snmp|spx|ssh2|swoole|uopz|uploadprogress|uuid|vld|xdebug|xdebug2|xhprof|yaml|zmq|zstd)/.test(
|
|
89
89
|
version_extension
|
|
90
90
|
):
|
|
91
91
|
case /(?<!5\.[3-6])(ds|v8js)/.test(version_extension):
|
|
92
92
|
case /(5\.6|7\.[0-4])(propro|lua)/.test(version_extension):
|
|
93
93
|
case /(?<!5\.[3-6]|7\.0)pcov/.test(version_extension):
|
|
94
94
|
case /(?<!5\.[3-6])(ast|vips|xlswriter)/.test(version_extension):
|
|
95
|
+
case /^(8\.[0-5])swow$/.test(version_extension):
|
|
95
96
|
add_script += await utils.joins(
|
|
96
97
|
'\nadd_brew_extension',
|
|
97
98
|
ext_name,
|
|
@@ -139,23 +140,23 @@ export async function addExtensionWindows(
|
|
|
139
140
|
// match 5.3blackfire...8.5blackfire
|
|
140
141
|
// match 5.3blackfire-(semver)...8.5blackfire-(semver)
|
|
141
142
|
// match ibm_db2, pdo_ibm, pdo_oci and oci8
|
|
142
|
-
// match 5.3ioncube...8.
|
|
143
|
+
// match 5.3ioncube...8.5ioncube
|
|
143
144
|
// match 7.0phalcon3...7.3phalcon3, 7.2phalcon4...7.4phalcon4, and 7.4phalcon5...8.4phalcon5
|
|
144
|
-
// match 7.1pecl_http...8.
|
|
145
|
-
// match 7.0zephir_parser...8.
|
|
145
|
+
// match 7.1pecl_http...8.5pecl_http and 7.1http...8.5http
|
|
146
|
+
// match 7.0zephir_parser...8.5zephir_parser
|
|
146
147
|
case /^(5\.[3-6]|7\.[0-4]|8\.[0-5])blackfire(-\d+\.\d+\.\d+)?$/.test(
|
|
147
148
|
version_extension
|
|
148
149
|
):
|
|
149
150
|
case /^ibm_db2$|^pdo_ibm$|^pdo_oci$|^oci8$|^pdo_firebird$/.test(
|
|
150
151
|
extension
|
|
151
152
|
):
|
|
152
|
-
case /^(5\.[3-6]|7\.[0-4]|8\.[0-
|
|
153
|
+
case /^(5\.[3-6]|7\.[0-4]|8\.[0-5])ioncube$/.test(version_extension):
|
|
153
154
|
case /^7\.[0-3]phalcon3$|^7\.[2-4]phalcon4$|^(7\.4|8\.[0-4])phalcon5?$/.test(
|
|
154
155
|
version_extension
|
|
155
156
|
):
|
|
156
|
-
case /^(7\.[1-4]|8\.
|
|
157
|
+
case /^(7\.[1-4]|8\.[0-5])(pecl_)?http/.test(version_extension):
|
|
157
158
|
case /(?<!5\.[3-6])(pdo_)?sqlsrv$/.test(version_extension):
|
|
158
|
-
case /^(7\.[0-4]|8\.[0-
|
|
159
|
+
case /^(7\.[0-4]|8\.[0-5])zephir_parser(-v?\d+\.\d+\.\d+)?$/.test(
|
|
159
160
|
version_extension
|
|
160
161
|
):
|
|
161
162
|
add_script += await utils.customPackage(
|
|
@@ -272,9 +273,9 @@ export async function addExtensionLinux(
|
|
|
272
273
|
// match 5.3blackfire-(semver)...8.5blackfire-(semver)
|
|
273
274
|
// match 5.3pdo_cubrid...7.2php_cubrid, 5.3cubrid...7.4cubrid
|
|
274
275
|
// match couchbase, geos, ibm_db2, pdo_ibm, pdo_oci, oci8, http, pecl_http
|
|
275
|
-
// match 5.3ioncube...8.
|
|
276
|
+
// match 5.3ioncube...8.5ioncube
|
|
276
277
|
// match 7.0phalcon3...7.3phalcon3, 7.2phalcon4...7.4phalcon4, 7.4phalcon5...8.4phalcon5
|
|
277
|
-
// match 7.0zephir_parser...8.
|
|
278
|
+
// match 7.0zephir_parser...8.5zephir_parser
|
|
278
279
|
case /^(7\.4|8\.[0-5])relay(-v?\d+\.\d+\.\d+|-nightly)?$/.test(
|
|
279
280
|
version_extension
|
|
280
281
|
):
|
|
@@ -288,12 +289,12 @@ export async function addExtensionLinux(
|
|
|
288
289
|
extension
|
|
289
290
|
):
|
|
290
291
|
case /(?<!5\.[3-5])intl-\d+\.\d+$/.test(version_extension):
|
|
291
|
-
case /^(5\.[3-6]|7\.[0-4]|8\.[0-
|
|
292
|
+
case /^(5\.[3-6]|7\.[0-4]|8\.[0-5])ioncube$/.test(version_extension):
|
|
292
293
|
case /^7\.[0-3]phalcon3$|^7\.[2-4]phalcon4$|^(7\.4|8\.[0-4])phalcon5?$/.test(
|
|
293
294
|
version_extension
|
|
294
295
|
):
|
|
295
296
|
case /(?<!5\.[3-6])(pdo_)?sqlsrv$/.test(version_extension):
|
|
296
|
-
case /^(7\.[0-4]|8\.[0-
|
|
297
|
+
case /^(7\.[0-4]|8\.[0-5])zephir_parser(-v?\d+\.\d+\.\d+)?$/.test(
|
|
297
298
|
version_extension
|
|
298
299
|
):
|
|
299
300
|
add_script += await utils.customPackage(
|
package/src/fetch.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Redirect status codes set for O(1) lookup
|
|
3
|
+
*/
|
|
4
|
+
const REDIRECT_CODES = new Set([301, 302, 303, 307, 308]);
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
|
-
* Function to fetch a URL
|
|
7
|
+
* Function to fetch a URL using native fetch API (Node 24+)
|
|
7
8
|
*
|
|
8
9
|
* @param input_url
|
|
9
10
|
* @param auth_token
|
|
@@ -14,43 +15,28 @@ export async function fetch(
|
|
|
14
15
|
auth_token?: string,
|
|
15
16
|
redirect_count = 5
|
|
16
17
|
): Promise<Record<string, string>> {
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
res.on('end', () => resolve({data: `${body}`}));
|
|
38
|
-
} else if (
|
|
39
|
-
[301, 302, 303, 307, 308].includes(res.statusCode as number)
|
|
40
|
-
) {
|
|
41
|
-
if (redirect_count > 0 && res.headers.location) {
|
|
42
|
-
fetch(res.headers.location, auth_token, redirect_count--).then(
|
|
43
|
-
resolve
|
|
44
|
-
);
|
|
45
|
-
} else {
|
|
46
|
-
resolve({error: `${res.statusCode}: Redirect error`});
|
|
47
|
-
}
|
|
48
|
-
} else {
|
|
49
|
-
resolve({error: `${res.statusCode}: ${res.statusMessage}`});
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
req.end();
|
|
18
|
+
const headers: Record<string, string> = {
|
|
19
|
+
'User-Agent': `Mozilla/5.0 (${process.platform} ${process.arch}) setup-php`
|
|
20
|
+
};
|
|
21
|
+
if (auth_token) {
|
|
22
|
+
headers['Authorization'] = 'Bearer ' + auth_token;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
try {
|
|
26
|
+
const response = await globalThis.fetch(input_url, {
|
|
27
|
+
headers,
|
|
28
|
+
redirect: redirect_count > 0 ? 'follow' : 'manual'
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
if (response.ok) {
|
|
32
|
+
const data = await response.text();
|
|
33
|
+
return {data};
|
|
34
|
+
} else if (REDIRECT_CODES.has(response.status) && redirect_count <= 0) {
|
|
35
|
+
return {error: `${response.status}: Redirect error`};
|
|
36
|
+
} else {
|
|
37
|
+
return {error: `${response.status}: ${response.statusText}`};
|
|
53
38
|
}
|
|
54
|
-
)
|
|
55
|
-
|
|
39
|
+
} catch (error) {
|
|
40
|
+
return {error: `Fetch error: ${(error as Error).message}`};
|
|
41
|
+
}
|
|
56
42
|
}
|
package/src/install.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import path from 'path';
|
|
2
2
|
import fs from 'fs';
|
|
3
3
|
import {exec} from '@actions/exec';
|
|
4
|
-
import * as core from '@actions/core';
|
|
5
4
|
import * as config from './config';
|
|
5
|
+
import * as core from './core';
|
|
6
6
|
import * as coverage from './coverage';
|
|
7
7
|
import * as extensions from './extensions';
|
|
8
8
|
import * as tools from './tools';
|
|
@@ -18,7 +18,10 @@ export async function getScript(os: string): Promise<string> {
|
|
|
18
18
|
const filename = os + (await utils.scriptExtension(os));
|
|
19
19
|
const script_path = path.join(__dirname, '../src/scripts', filename);
|
|
20
20
|
const run_path = script_path.replace(os, 'run');
|
|
21
|
-
const extension_csv: string =
|
|
21
|
+
const extension_csv: string = utils.sanitizeShellInput(
|
|
22
|
+
await utils.getInput('extensions', false),
|
|
23
|
+
true
|
|
24
|
+
);
|
|
22
25
|
const ini_values_csv: string = await utils.getInput('ini-values', false);
|
|
23
26
|
const coverage_driver: string = await utils.getInput('coverage', false);
|
|
24
27
|
const tools_csv: string = await utils.getInput('tools', false);
|
|
@@ -28,7 +31,7 @@ export async function getScript(os: string): Promise<string> {
|
|
|
28
31
|
const ini_file: string = await utils.parseIniFile(
|
|
29
32
|
await utils.getInput('ini-file', false)
|
|
30
33
|
);
|
|
31
|
-
let script = await utils.joins('.', script_path, version
|
|
34
|
+
let script = await utils.joins('.', script_path, `'${version}'`, ini_file);
|
|
32
35
|
if (extension_csv) {
|
|
33
36
|
script += await extensions.addExtension(extension_csv, version, os);
|
|
34
37
|
}
|
package/src/scripts/darwin.sh
CHANGED
|
@@ -15,7 +15,9 @@ handle_dependency_extensions() {
|
|
|
15
15
|
brew_opts=(-sf)
|
|
16
16
|
patch_abstract_file >/dev/null 2>&1
|
|
17
17
|
for dependency_extension in "${dependency_extensions[@]}"; do
|
|
18
|
-
|
|
18
|
+
safe_brew install --skip-link "${brew_opts[@]}" "$ext_tap/$dependency_extension@$version" >/dev/null 2>&1 &&
|
|
19
|
+
brew link --overwrite --force "$dependency_extension@$version" >/dev/null 2>&1 &&
|
|
20
|
+
copy_brew_extensions "$dependency_extension"
|
|
19
21
|
done
|
|
20
22
|
fi
|
|
21
23
|
}
|
|
@@ -83,7 +85,11 @@ add_brew_extension() {
|
|
|
83
85
|
formula="$(get_renamed_formula "$formula")"
|
|
84
86
|
update_dependencies >/dev/null 2>&1
|
|
85
87
|
handle_dependency_extensions "$formula" "$extension" >/dev/null 2>&1
|
|
86
|
-
(
|
|
88
|
+
(
|
|
89
|
+
safe_brew install --skip-link "${brew_opts[@]}" "$ext_tap/$formula@$version" >/dev/null 2>&1 &&
|
|
90
|
+
brew link --overwrite --force "$formula@$version" >/dev/null 2>&1 &&
|
|
91
|
+
copy_brew_extensions "$formula"
|
|
92
|
+
) || pecl_install "$extension" >/dev/null 2>&1
|
|
87
93
|
add_extension_log "$extension" "Installed and enabled"
|
|
88
94
|
fi
|
|
89
95
|
}
|
|
@@ -181,14 +187,14 @@ add_php() {
|
|
|
181
187
|
fi
|
|
182
188
|
if [[ "$existing_version" != "false" && -z "$suffix" ]]; then
|
|
183
189
|
if [ "$action" = "upgrade" ]; then
|
|
184
|
-
|
|
185
|
-
|
|
190
|
+
safe_brew install --only-dependencies "$php_formula"
|
|
191
|
+
safe_brew upgrade -f --overwrite "$php_formula"
|
|
186
192
|
else
|
|
187
193
|
brew unlink "$php_keg"
|
|
188
194
|
fi
|
|
189
195
|
else
|
|
190
|
-
|
|
191
|
-
|
|
196
|
+
safe_brew install --only-dependencies "$php_formula"
|
|
197
|
+
safe_brew install --skip-link -f --overwrite "$php_formula" 2>/dev/null || safe_brew upgrade -f --overwrite "$php_formula"
|
|
192
198
|
fi
|
|
193
199
|
brew link --force --overwrite "$php_keg" || (sudo chown -R "$(id -un)":"$(id -gn)" "$brew_prefix" && brew link --force --overwrite "$php_keg")
|
|
194
200
|
}
|
|
@@ -79,9 +79,20 @@ add_couchbase() {
|
|
|
79
79
|
add_extension_log "couchbase" "Installed and enabled"
|
|
80
80
|
fi
|
|
81
81
|
else
|
|
82
|
-
if [ -e "${ext_dir:?}
|
|
83
|
-
|
|
82
|
+
if [ -e "${ext_dir:?}/couchbase.so" ]; then
|
|
83
|
+
couchbase_rpath="$(otool -l "${ext_dir:?}/couchbase.so" 2>/dev/null | awk '$1 == "path" && $2 ~ /\/couchbase@'"${version:?}"'\// {print $2; exit}')"
|
|
84
|
+
couchbase_rpath="${couchbase_rpath/@loader_path/${ext_dir:?}}"
|
|
85
|
+
otool -L "${ext_dir:?}/couchbase.so" 2>/dev/null |
|
|
86
|
+
awk -v rpath="$couchbase_rpath" '/libcouchbase_php.*\.dylib/ {if ($1 ~ /^@rpath\// && rpath != "") {sub(/^@rpath/, rpath, $1)}; print $1}' |
|
|
87
|
+
while read -r dylib; do
|
|
88
|
+
dylib="${dylib/@loader_path/${ext_dir:?}}"
|
|
89
|
+
[ -e "${ext_dir:?}/$(basename "$dylib")" ] || continue
|
|
90
|
+
sudo mkdir -p "$(dirname "$dylib")"
|
|
91
|
+
sudo cp "${ext_dir:?}/$(basename "$dylib")" "$dylib"
|
|
92
|
+
done
|
|
84
93
|
fi
|
|
85
94
|
add_brew_extension couchbase extension
|
|
95
|
+
find "${brew_prefix:?}/lib" "${brew_prefix:?}/opt/couchbase@${version:?}" "${brew_prefix:?}/Cellar/couchbase@${version:?}" \
|
|
96
|
+
-name 'libcouchbase_php*.dylib' -exec sudo cp {} "${ext_dir:?}" \; >/dev/null 2>&1
|
|
86
97
|
fi
|
|
87
98
|
}
|
|
@@ -1,17 +1,3 @@
|
|
|
1
|
-
add_firebird_client_darwin() {
|
|
2
|
-
firebird_tag='v5.0.0'
|
|
3
|
-
arch_name='x64'
|
|
4
|
-
arch="$(uname -m)"
|
|
5
|
-
[[ "$arch" = "arm64" || "$arch" = "aarch64" ]] && arch_name='arm64'
|
|
6
|
-
pkg_name=$(get -s -n "" https://api.github.com/repos/FirebirdSQL/firebird/releases/tags/"$firebird_tag" | grep -Eo "Firebird-.*.-$arch_name.pkg" | head -n 1)
|
|
7
|
-
[ -z "$pkg_name" ] && pkg_name=$(get -s -n "" https://github.com/FirebirdSQL/firebird/releases/expanded_assets/"$firebird_tag" | grep -Eo "Firebird-.*.-$arch_name.pkg" | head -n 1)
|
|
8
|
-
get -q -e "/tmp/firebird.pkg" https://github.com/FirebirdSQL/firebird/releases/download/"$firebird_tag"/"$pkg_name"
|
|
9
|
-
sudo installer -pkg /tmp/firebird.pkg -target /
|
|
10
|
-
sudo mkdir -p /opt/firebird/include /opt/firebird/lib
|
|
11
|
-
sudo cp -a /Library/Frameworks/Firebird.framework/Headers/* /opt/firebird/include/
|
|
12
|
-
sudo find /Library/Frameworks/Firebird.framework -name '*.dylib' -exec cp "{}" /opt/firebird/lib \;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
1
|
add_firebird_helper() {
|
|
16
2
|
firebird_dir=$1
|
|
17
3
|
tag="$(php_src_tag)"
|
|
@@ -23,22 +9,19 @@ add_firebird_helper() {
|
|
|
23
9
|
}
|
|
24
10
|
|
|
25
11
|
add_firebird() {
|
|
26
|
-
if [ "$(uname -s )" = "Darwin" ]; then
|
|
27
|
-
add_firebird_client_darwin >/dev/null 2>&1
|
|
28
|
-
fi
|
|
29
12
|
enable_extension pdo_firebird extension
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
13
|
+
if check_extension pdo_firebird; then
|
|
14
|
+
add_log "${tick:?}" pdo_firebird Enabled
|
|
15
|
+
else
|
|
33
16
|
if [ "$(uname -s)" = "Linux" ]; then
|
|
34
|
-
if [[ "${version:?}" =~ 5.3|${
|
|
17
|
+
if [[ "${version:?}" =~ 5.3|${php_builder_versions:?} ]]; then
|
|
35
18
|
add_firebird_helper /usr >/dev/null 2>&1
|
|
36
19
|
else
|
|
37
20
|
add_pdo_extension firebird >/dev/null 2>&1
|
|
38
21
|
fi
|
|
39
22
|
else
|
|
40
|
-
|
|
23
|
+
add_brew_extension pdo_firebird extension >/dev/null 2>&1
|
|
41
24
|
fi
|
|
25
|
+
add_extension_log pdo_firebird "Installed and enabled"
|
|
42
26
|
fi
|
|
43
|
-
add_extension_log pdo_firebird "$status"
|
|
44
27
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# Helper function to add gearman extension.
|
|
2
2
|
add_gearman_helper() {
|
|
3
|
-
install_packages libgearman-dev
|
|
4
3
|
enable_extension gearman extension
|
|
5
4
|
if ! check_extension gearman; then
|
|
6
5
|
status="Installed and enabled"
|
|
6
|
+
install_packages libgearman-dev
|
|
7
7
|
if [[ "${version:?}" =~ 5.[3-6] ]]; then
|
|
8
8
|
pecl_install gearman-1.1.2
|
|
9
9
|
elif [[ "${version:?}" =~ 7.0 ]]; then
|
|
@@ -10,13 +10,15 @@ Function Get-ICUUrl() {
|
|
|
10
10
|
[ValidateNotNull()]
|
|
11
11
|
$vs_version
|
|
12
12
|
)
|
|
13
|
-
$trunk = "https://
|
|
14
|
-
$urls=@("${trunk}/
|
|
13
|
+
$trunk = "https://downloads.php.net"
|
|
14
|
+
$urls=@("${trunk}/~windows/php-sdk/deps/${vs_version}/${arch}/", "${trunk}/~windows/php-sdk/deps/archives/${vs_version}/${arch}/")
|
|
15
15
|
foreach ($url in $urls) {
|
|
16
|
-
|
|
16
|
+
try {
|
|
17
|
+
$web_content = Get-File -Url $url 2>$null
|
|
18
|
+
} catch { continue }
|
|
17
19
|
foreach ($link in $web_content.Links) {
|
|
18
|
-
if ($link -match "
|
|
19
|
-
return $
|
|
20
|
+
if ($link.href -match ".*ICU-${icu_version}.*") {
|
|
21
|
+
return $url + $link.HREF
|
|
20
22
|
}
|
|
21
23
|
}
|
|
22
24
|
}
|
|
@@ -19,26 +19,6 @@ Function Get-PhalconReleaseAssetUrl() {
|
|
|
19
19
|
$match = (Get-File -Url "$github/$releases/expanded_assets/v$Semver").Links.href | Select-String -Pattern "(phalcon_${arch}_.*_php${version}_${extension_version}.*[0-9]${nts}.zip)"
|
|
20
20
|
} catch { }
|
|
21
21
|
}
|
|
22
|
-
} else {
|
|
23
|
-
$nts = if (!$installed.ThreadSafe) { "-nts" } else { "-ts" }
|
|
24
|
-
try {
|
|
25
|
-
$match = (Invoke-RestMethod -Uri "$domain/$releases/tags/v$Semver").assets | Select-String -Pattern "browser_download_url=.*(php_phalcon-php${version}${nts}-windows.*-x64.zip)"
|
|
26
|
-
} catch { }
|
|
27
|
-
if($null -eq $match) {
|
|
28
|
-
try {
|
|
29
|
-
$match = (Get-File -Url "$github/$releases/expanded_assets/v$Semver").Links.href | Select-String -Pattern "(php_phalcon-php${version}${nts}-windows.*-x64.zip)"
|
|
30
|
-
} catch { }
|
|
31
|
-
}
|
|
32
|
-
if($null -eq $match) {
|
|
33
|
-
try {
|
|
34
|
-
$match = (Invoke-RestMethod -Uri "$domain/$releases/tags/v$Semver").assets | Select-String -Pattern "browser_download_url=.*(phalcon-php${version}${nts}-windows.*-x64.zip)"
|
|
35
|
-
} catch { }
|
|
36
|
-
}
|
|
37
|
-
if($null -eq $match) {
|
|
38
|
-
try {
|
|
39
|
-
$match = (Get-File -Url "$github/$releases/expanded_assets/v$Semver").Links.href | Select-String -Pattern "(phalcon-php${version}${nts}-windows.*-x64.zip)"
|
|
40
|
-
} catch { }
|
|
41
|
-
}
|
|
42
22
|
}
|
|
43
23
|
if($NULL -ne $match) {
|
|
44
24
|
return "$github/$releases/download/v$Semver/$($match.Matches[0].Groups[1].Value)"
|
|
@@ -73,6 +53,8 @@ Function Get-PhalconSemver() {
|
|
|
73
53
|
return '4.1.0'
|
|
74
54
|
} elseif (($extension_version -eq '5') -and ($version -eq '7.4')) {
|
|
75
55
|
return '5.4.0'
|
|
56
|
+
} elseif (($extension_version -eq '5') -and ($version -eq '8.0')) {
|
|
57
|
+
return '5.10.0'
|
|
76
58
|
}
|
|
77
59
|
return Get-PeclPackageVersion phalcon $extension_version stable stable | Select-Object -First 1
|
|
78
60
|
}
|
|
@@ -80,7 +62,7 @@ Function Get-PhalconSemver() {
|
|
|
80
62
|
# Function to install phalcon
|
|
81
63
|
Function Add-PhalconHelper() {
|
|
82
64
|
$semver = Get-PhalconSemver
|
|
83
|
-
if ($extension_version -
|
|
65
|
+
if ($extension_version -match '[3-4]') {
|
|
84
66
|
Add-PhalconFromGitHub $semver
|
|
85
67
|
} else {
|
|
86
68
|
Add-Extension -Extension phalcon -Stability stable -Extension_version $semver
|
|
@@ -36,7 +36,10 @@ get_openssl_suffix() {
|
|
|
36
36
|
change_library_paths() {
|
|
37
37
|
if [ "$os" = "Darwin" ]; then
|
|
38
38
|
otool -L "${ext_dir:?}"/relay.so | grep -q 'ssl.1' && openssl_version='1.1' || openssl_version='3'
|
|
39
|
-
[ -e "${brew_prefix:?}"/opt/openssl@"$openssl_version" ] ||
|
|
39
|
+
[ -e "${brew_prefix:?}"/opt/openssl@"$openssl_version" ] || {
|
|
40
|
+
safe_brew install --skip-link openssl@"$openssl_version" &&
|
|
41
|
+
brew link --overwrite --force openssl@"$openssl_version"
|
|
42
|
+
}
|
|
40
43
|
dylibs="$(otool -L "${ext_dir:?}"/relay.so | grep -Eo '.*\.dylib' | cut -f1 -d ' ')"
|
|
41
44
|
install_name_tool -change "$(echo "${dylibs}" | grep -E "libzstd.*dylib" | xargs)" "$brew_prefix"/opt/zstd/lib/libzstd.dylib "$ext_dir"/relay.so
|
|
42
45
|
install_name_tool -change "$(echo "${dylibs}" | grep -E "liblz4.*dylib" | xargs)" "$brew_prefix"/opt/lz4/lib/liblz4.dylib "$ext_dir"/relay.so
|
|
@@ -54,7 +57,7 @@ add_relay_dependencies() {
|
|
|
54
57
|
if [ "$os" = "Darwin" ]; then
|
|
55
58
|
. "${0%/*}"/tools/brew.sh
|
|
56
59
|
configure_brew
|
|
57
|
-
|
|
60
|
+
safe_brew install lz4 hiredis zstd concurrencykit
|
|
58
61
|
fi
|
|
59
62
|
}
|
|
60
63
|
|
|
@@ -60,9 +60,11 @@ add_linux_libs() {
|
|
|
60
60
|
add_darwin_libs() {
|
|
61
61
|
local lib=$1
|
|
62
62
|
if ! check_lib "$lib"; then
|
|
63
|
-
brew install "$lib" >/dev/null 2>&1 || true
|
|
64
63
|
if [[ "$lib" = *@* ]]; then
|
|
64
|
+
safe_brew install --skip-link "$lib" >/dev/null 2>&1 || true
|
|
65
65
|
brew link --overwrite --force "$lib" >/dev/null 2>&1 || true
|
|
66
|
+
else
|
|
67
|
+
safe_brew install "$lib" >/dev/null 2>&1 || true
|
|
66
68
|
fi
|
|
67
69
|
fi
|
|
68
70
|
add_lib_log "$lib"
|
package/src/scripts/linux.sh
CHANGED
|
@@ -127,6 +127,51 @@ setup_cached_versions() {
|
|
|
127
127
|
run_script "php-ubuntu" "$version" "${debug:?}" "${ts:?}"
|
|
128
128
|
}
|
|
129
129
|
|
|
130
|
+
# Function to get the link path for an alternative.
|
|
131
|
+
alternative_link() {
|
|
132
|
+
case "$1" in
|
|
133
|
+
php-cgi-bin) echo "/usr/lib/cgi-bin/php" ;;
|
|
134
|
+
php-fpm) echo "/usr/sbin/php-fpm" ;;
|
|
135
|
+
php-fpm.sock) echo "/run/php/php-fpm.sock" ;;
|
|
136
|
+
*) echo "/usr/bin/$1" ;;
|
|
137
|
+
esac
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
# Function to get the target path for an alternative.
|
|
141
|
+
alternative_target() {
|
|
142
|
+
case "$1" in
|
|
143
|
+
php-cgi-bin) echo "/usr/lib/cgi-bin/php$version" ;;
|
|
144
|
+
php-fpm) echo "/usr/sbin/php-fpm$version" ;;
|
|
145
|
+
php-fpm.sock) echo "/run/php/php$version-fpm.sock" ;;
|
|
146
|
+
*) echo "/usr/bin/$1$version" ;;
|
|
147
|
+
esac
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
# Function to register an alternative if the versioned binary exists but is missing.
|
|
151
|
+
register_alternative() {
|
|
152
|
+
local tool=$1
|
|
153
|
+
local link target priority state_file
|
|
154
|
+
target="$(alternative_target "$tool")"
|
|
155
|
+
[ -e "$target" ] || return 0
|
|
156
|
+
state_file="/var/lib/dpkg/alternatives/$tool"
|
|
157
|
+
if sudo test -r "$state_file" && sudo grep -Fxq "$target" "$state_file"; then
|
|
158
|
+
return 0
|
|
159
|
+
fi
|
|
160
|
+
link="$(alternative_link "$tool")"
|
|
161
|
+
priority="${version//./}"
|
|
162
|
+
sudo update-alternatives --install "$link" "$tool" "$target" "$priority" >/dev/null 2>&1
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
# Function to register and switch an alternative.
|
|
166
|
+
set_alternative() {
|
|
167
|
+
local tool=$1
|
|
168
|
+
local target
|
|
169
|
+
target="$(alternative_target "$tool")"
|
|
170
|
+
[ -e "$target" ] || return 0
|
|
171
|
+
register_alternative "$tool" || return 1
|
|
172
|
+
sudo update-alternatives --set "$tool" "$target" >/dev/null 2>&1
|
|
173
|
+
}
|
|
174
|
+
|
|
130
175
|
# Function to add PECL.
|
|
131
176
|
add_pecl() {
|
|
132
177
|
add_devtools phpize >/dev/null 2>&1
|
|
@@ -143,16 +188,11 @@ switch_version() {
|
|
|
143
188
|
tools=("$@")
|
|
144
189
|
to_wait=()
|
|
145
190
|
if ! (( ${#tools[@]} )); then
|
|
146
|
-
tools+=(pear pecl php phar phar.phar php-cgi php-config phpize phpdbg)
|
|
147
|
-
[ -e /usr/lib/cgi-bin/php"$version" ] && sudo update-alternatives --set php-cgi-bin /usr/lib/cgi-bin/php"$version" & to_wait+=($!)
|
|
148
|
-
[ -e /usr/sbin/php-fpm"$version" ] && sudo update-alternatives --set php-fpm /usr/sbin/php-fpm"$version" & to_wait+=($!)
|
|
149
|
-
[ -e /run/php/php"$version"-fpm.sock ] && sudo update-alternatives --set php-fpm.sock /run/php/php"$version"-fpm.sock & to_wait+=($!)
|
|
191
|
+
tools+=(php-cgi-bin php-fpm php-fpm.sock pear pecl php phar phar.phar php-cgi php-config phpize phpdbg)
|
|
150
192
|
fi
|
|
151
193
|
for tool in "${tools[@]}"; do
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
to_wait+=($!)
|
|
155
|
-
fi
|
|
194
|
+
set_alternative "$tool" &
|
|
195
|
+
to_wait+=($!)
|
|
156
196
|
done
|
|
157
197
|
wait "${to_wait[@]}"
|
|
158
198
|
}
|
|
@@ -187,7 +227,7 @@ update_php() {
|
|
|
187
227
|
# Function to install PHP.
|
|
188
228
|
add_php() {
|
|
189
229
|
if [ "${runner:?}" = "self-hosted" ] || [ "${use_package_cache:-true}" = "false" ]; then
|
|
190
|
-
if [[ "$version" =~ ${
|
|
230
|
+
if [[ "$version" =~ ${php_builder_versions:?} || "$ts" = "zts" ]]; then
|
|
191
231
|
setup_php_builder
|
|
192
232
|
else
|
|
193
233
|
add_packaged_php
|