setup-php 2.35.5 → 2.36.0

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.
Files changed (37) hide show
  1. package/README.md +101 -88
  2. package/lib/extensions.js +8 -8
  3. package/lib/extensions.js.map +1 -1
  4. package/lib/tools.js +6 -5
  5. package/lib/tools.js.map +1 -1
  6. package/lib/utils.js +1 -1
  7. package/lib/utils.js.map +1 -1
  8. package/package.json +17 -16
  9. package/src/configs/brew_extensions +1 -0
  10. package/src/configs/darwin_libs +22 -0
  11. package/src/configs/linux_libs +22 -0
  12. package/src/configs/php-versions.json +5 -4
  13. package/src/configs/tools.json +2 -1
  14. package/src/extensions.ts +23 -17
  15. package/src/scripts/darwin.sh +37 -17
  16. package/src/scripts/extensions/add_extensions.sh +5 -3
  17. package/src/scripts/extensions/gearman.sh +3 -1
  18. package/src/scripts/extensions/ibm.ps1 +56 -0
  19. package/src/scripts/extensions/ibm.sh +106 -0
  20. package/src/scripts/extensions/oci.sh +2 -1
  21. package/src/scripts/extensions/patches/amqp.sh +5 -0
  22. package/src/scripts/extensions/patches/common.sh +31 -8
  23. package/src/scripts/extensions/patches/geos.sh +1 -5
  24. package/src/scripts/extensions/patches/pdo_oci.sh +3 -0
  25. package/src/scripts/extensions/patches/pdo_sqlsrv.sh +5 -0
  26. package/src/scripts/extensions/patches/phpize.sh +2 -1
  27. package/src/scripts/extensions/relay.sh +21 -34
  28. package/src/scripts/extensions/source.sh +23 -5
  29. package/src/scripts/linux.sh +1 -1
  30. package/src/scripts/tools/ppa.sh +197 -28
  31. package/src/scripts/tools/symfony.ps1 +28 -14
  32. package/src/scripts/tools/symfony.sh +34 -31
  33. package/src/scripts/unix.sh +1 -1
  34. package/src/scripts/win32.ps1 +5 -2
  35. package/src/tools.ts +6 -5
  36. package/src/utils.ts +1 -1
  37. package/src/scripts/extensions/patches/gearman.sh +0 -5
@@ -50,12 +50,23 @@ update_lists_helper() {
50
50
  update_lists() {
51
51
  local ppa=${1:-}
52
52
  local ppa_search=${2:-}
53
+ local status_token=${3:-$ppa_search}
53
54
  local list=
54
- status_file=/tmp/os_lists
55
+ local status_file=/tmp/os_lists
56
+ local hash_cmd
55
57
  if [[ -n "$ppa" && -n "$ppa_search" ]]; then
56
- list="$list_dir"/"$(basename "$(grep -lr "$ppa_search" "$list_dir")")"
57
- status_file=/tmp/"$(echo -n "$ppa_search" | shasum -a 256 | cut -d ' ' -f 1)"
58
- elif [ -e "$list_file" ] && grep -Eq '^deb |^Types deb' "$list_file"; then
58
+ if [ -f "$ppa_search" ]; then
59
+ list="$ppa_search"
60
+ else
61
+ list="$(grep -Elr "$ppa_search" "$list_dir" 2>/dev/null | head -n 1)"
62
+ fi
63
+ hash_cmd="$(command -v sha256sum || command -v shasum)"
64
+ if [ -n "$status_token" ] && [ -n "$hash_cmd" ]; then
65
+ status_file=/tmp/os_lists_"$(echo -n "$status_token" | $hash_cmd | awk '{print $1}')"
66
+ elif [ -n "$status_token" ]; then
67
+ status_file=/tmp/os_lists_$(date +%s)
68
+ fi
69
+ elif [ -e "$list_file" ] && grep -Eq '^deb |^Types: *deb' "$list_file"; then
59
70
  list="$list_file"
60
71
  fi
61
72
  if [ ! -e "$status_file" ]; then
@@ -64,6 +75,81 @@ update_lists() {
64
75
  fi
65
76
  }
66
77
 
78
+ # Determine whether deb822 sources are the default on this system.
79
+ get_sources_format() {
80
+ if [ -n "$sources_format" ]; then
81
+ echo "$sources_format"
82
+ return
83
+ fi
84
+ sources_format=deb
85
+ if [ -e "$list_dir"/ubuntu.sources ] || [ -e "$list_dir"/debian.sources ]; then
86
+ sources_format="deb822"
87
+ elif ! [[ "$ID" =~ ubuntu|debian ]]; then
88
+ find "$list_dir" -type f -name '*.sources' | grep -q . && sources_format="deb822"
89
+ fi
90
+ echo "$sources_format"
91
+ }
92
+
93
+ # Function to get sources file extension.
94
+ get_sources_extension() {
95
+ [ "$1" = "deb822" ] && echo "sources" || echo "list"
96
+ }
97
+
98
+ # Function to escape regex special characters.
99
+ escape_regex() {
100
+ printf '%s' "$1" | sed -e 's/[][\.^$*+?{}()|\/]/\\&/g'
101
+ }
102
+
103
+ # Function to merge two components strings.
104
+ merge_components() {
105
+ local out=() t
106
+ for t in $1 $2; do [[ $t && " ${out[*]} " != *" $t "* ]] && out+=("$t"); done
107
+ printf '%s\n' "${out[*]}"
108
+ }
109
+
110
+ # Function to merge components from a file.
111
+ merge_components_from_file() {
112
+ local path=$1
113
+ local incoming=$2
114
+ local current=
115
+ if [ -n "$path" ] && [ -e "$path" ]; then
116
+ if grep -Eq '^Components:' "$path"; then
117
+ current="$(grep -E '^Components:' "$path" | head -n 1 | cut -d ':' -f 2 | xargs)"
118
+ else
119
+ current="$(sed -E -n 's/^deb[[:space:]]+(\[[^]]*\][[:space:]]+)?[^[:space:]]+[[:space:]]+[^[:space:]]+[[:space:]]+//p' "$path" | head -n 1 | xargs)"
120
+ fi
121
+ fi
122
+ local merged
123
+ merged="$(merge_components "$current" "$incoming")"
124
+ if [ -z "$merged" ] || [ "$merged" = "$current" ]; then
125
+ return 1
126
+ fi
127
+ printf '%s\n' "$merged"
128
+ }
129
+
130
+ # Function to get repo patterns based on format.
131
+ get_repo_patterns() {
132
+ local list_format=$1
133
+ local ppa_url=$2
134
+ local package_dist=$3
135
+ local branches=$4
136
+ local escaped_url
137
+ local escaped_dist
138
+ local escaped_branches
139
+ escaped_url="$(escape_regex "$ppa_url")"
140
+ escaped_dist="$(escape_regex "$package_dist")"
141
+ escaped_branches="$(escape_regex "$branches")"
142
+ local deb_primary="^deb[[:space:]]+(\\[[^]]*\\][[:space:]]+)?${escaped_url}[[:space:]]+${escaped_dist}[[:space:]]"
143
+ local deb_secondary="^deb[[:space:]]+(\\[[^]]*\\][[:space:]]+)?${escaped_url}[[:space:]]+${escaped_dist}[[:space:]]+.*${escaped_branches}([[:space:]]|$)"
144
+ local deb822_primary="^URIs: ${escaped_url}$"
145
+ local deb822_secondary="^Suites: ${escaped_dist}$"
146
+ if [ "$list_format" = "deb822" ]; then
147
+ printf '%s|%s\n' "$deb822_primary" "$deb822_secondary"
148
+ else
149
+ printf '%s|%s\n' "$deb_primary" "$deb_secondary"
150
+ fi
151
+ }
152
+
67
153
  # Function to get fingerprint from an Ubuntu PPA.
68
154
  ubuntu_fingerprint() {
69
155
  ppa="$1"
@@ -104,19 +190,74 @@ add_key() {
104
190
  fi
105
191
  }
106
192
 
193
+ # Function to handle existing list files.
194
+ handle_existing_list() {
195
+ local ppa=$1
196
+ local list_format=$2
197
+ local branches=$3
198
+ local merged_components
199
+ if [ -z "$check_lists_file" ]; then
200
+ echo "Repository $ppa ($branches) already exists" && return 1
201
+ fi
202
+ if merged_components="$(merge_components_from_file "$check_lists_file" "$branches")"; then
203
+ sudo rm -f "$check_lists_file" && printf '%s\n' "$merged_components" && return 0
204
+ fi
205
+ if [[ "$list_format" = "deb822" && "$check_lists_file" = *.list ]]; then
206
+ sudo rm -f "$check_lists_file" && printf '%s\n' "$branches" && return 0
207
+ fi
208
+ echo "Repository $ppa ($branches) already exists" && return 1
209
+ }
210
+
211
+ # Function to write a list file.
212
+ write_list() {
213
+ local type=$1
214
+ local ppa=$2
215
+ local url=$3
216
+ local suite=$4
217
+ local components=$5
218
+ local key_file=$6
219
+ local list_basename="${ppa%%/*}"-"$ID"-"${ppa#*/}"-"$suite"
220
+ local arch
221
+ arch="$(dpkg --print-architecture)"
222
+ sudo rm -f "$list_dir"/"${ppa/\//-}".list "$list_dir"/"${ppa/\//-}".sources "$list_dir"/"$list_basename".list "$list_dir"/"$list_basename".sources || true
223
+ if [ "$type" = "deb822" ]; then
224
+ cat <<EOF | sudo tee "$list_dir"/"$list_basename".sources >/dev/null
225
+ Types: deb
226
+ URIs: $url
227
+ Suites: $suite
228
+ Components: $components
229
+ Architectures: $arch
230
+ Signed-By: $key_file
231
+ EOF
232
+ else
233
+ echo "deb [arch=$arch signed-by=$key_file] $url $suite $components" | sudo tee "$list_dir"/"$list_basename".list >/dev/null 2>&1
234
+ fi
235
+ }
236
+
107
237
  # Function to check if a PPA and its lists exist
108
238
  check_lists() {
109
- ppa=$1
110
- ppa_search=$2
111
- if grep -Eqr "$ppa_search" "$list_dir"; then
239
+ local ppa=$1
240
+ local primary=${2:-}
241
+ local secondary=${3:-}
242
+ local status_token=${4:-$primary}
243
+ local match_file=
244
+ check_lists_file=
245
+ if [ -n "$primary" ]; then
246
+ match_file=$(grep -Elr "$primary" "$list_dir" 2>/dev/null | head -n 1)
247
+ fi
248
+ if [ -z "$match_file" ] && [ -n "$secondary" ]; then
249
+ match_file=$(grep -Elr "$secondary" "$list_dir" 2>/dev/null | head -n 1)
250
+ fi
251
+ if [ -n "$match_file" ]; then
252
+ local list_count
112
253
  list_count="$(sudo find /var/lib/apt/lists -type f -name "*${ppa/\//_}*" | wc -l)"
113
254
  if [ "$list_count" = "0" ]; then
114
- update_lists "$ppa" "$ppa_search"
255
+ update_lists "$ppa" "$match_file" "$status_token"
115
256
  fi
116
- return 0;
117
- else
118
- return 1;
257
+ check_lists_file="$match_file"
258
+ return 0
119
259
  fi
260
+ return 1
120
261
  }
121
262
 
122
263
  # Function to add a sources list.
@@ -126,19 +267,32 @@ add_list() {
126
267
  key_source=${3:-"$ppa_url"}
127
268
  package_dist=${4:-"$VERSION_CODENAME"}
128
269
  branches=${5:-main}
129
- ppa_search="deb .*$ppa_url $package_dist .*$branches$"
130
- if check_lists "$ppa" "$ppa_search"; then
131
- echo "Repository $ppa already exists";
132
- return 1;
133
- else
134
- arch=$(dpkg --print-architecture)
135
- [ -e "$key_source" ] && key_file=$key_source || key_file="$key_dir"/"${ppa/\//-}"-keyring.gpg
136
- add_key "$ppa" "$ppa_url" "$package_dist" "$key_source" "$key_file"
137
- sudo rm -rf "$list_dir"/"${ppa/\//-}".list || true
138
- echo "deb [arch=$arch signed-by=$key_file] $ppa_url $package_dist $branches" | sudo tee -a "$list_dir"/"${ppa%%/*}"-"$ID"-"${ppa#*/}"-"$package_dist".list >/dev/null 2>&1
139
- update_lists "$ppa" "$ppa_search"
140
- . /etc/os-release
270
+ local list_format
271
+ local list_extension
272
+ local status_token
273
+ local resolved_branches
274
+ local list_path=
275
+ list_format="$(get_sources_format)"
276
+ list_extension="$(get_sources_extension "$list_format")"
277
+ status_token="${ppa_url}|${package_dist}|${branches}"
278
+ IFS='|' read -r primary_pattern secondary_pattern <<< "$(get_repo_patterns "$list_format" "$ppa_url" "$package_dist" "$branches")"
279
+ if check_lists "$ppa" "$primary_pattern" "$secondary_pattern" "$status_token"; then
280
+ list_path="$check_lists_file"
281
+ if resolved_branches="$(handle_existing_list "$ppa" "$list_format" "$branches")"; then
282
+ branches="$resolved_branches"
283
+ else
284
+ [ -n "$resolved_branches" ] && echo "$resolved_branches" && return 1
285
+ fi
286
+ check_lists_file=
287
+ IFS='|' read -r primary_pattern secondary_pattern <<< "$(get_repo_patterns "$list_format" "$ppa_url" "$package_dist" "$branches")"
288
+ status_token="${ppa_url}|${package_dist}|${branches}"
141
289
  fi
290
+ [ -e "$key_source" ] && key_file=$key_source || key_file="$key_dir"/"${ppa/\//-}"-keyring.gpg
291
+ add_key "$ppa" "$ppa_url" "$package_dist" "$key_source" "$key_file"
292
+ write_list "$list_format" "$ppa" "$ppa_url" "$package_dist" "$branches" "$key_file"
293
+ list_path="$list_dir"/"${ppa%%/*}"-"$ID"-"${ppa#*/}"-"$package_dist"."$list_extension"
294
+ update_lists "$ppa" "$list_path" "$status_token"
295
+ . /etc/os-release
142
296
  return 0;
143
297
  }
144
298
 
@@ -148,8 +302,12 @@ check_ppa() {
148
302
  ppa_url=${2:-"$lpc_ppa/$ppa/ubuntu"}
149
303
  package_dist=${3:-"$VERSION_CODENAME"}
150
304
  branches=${4:-main}
151
- ppa_search="deb .*$ppa_url $package_dist .*$branches$"
152
- if check_lists "$ppa" "$ppa_search"; then
305
+ local list_format
306
+ list_format="$(get_sources_format)"
307
+ IFS='|' read -r primary_pattern secondary_pattern <<< "$(get_repo_patterns "$list_format" "$ppa_url" "$package_dist" "$branches")"
308
+ local status_token
309
+ status_token="${ppa_url}|${package_dist}|${branches}"
310
+ if check_lists "$ppa" "$primary_pattern" "$secondary_pattern" "$status_token"; then
153
311
  return 0;
154
312
  else
155
313
  return 1;
@@ -163,7 +321,7 @@ remove_list() {
163
321
  for ppa_url in "${ppa_urls[@]}"; do
164
322
  grep -lr "$ppa_url" "$list_dir" | xargs -n1 sudo rm -f
165
323
  done
166
- sudo rm -f "$key_dir"/"${ppa/\//-}"-keyring || true
324
+ sudo rm -f "$key_dir"/"${ppa/\//-}"-keyring /tmp/os_lists* || true
167
325
  }
168
326
 
169
327
  # Function to check if ubuntu ppa is up
@@ -213,12 +371,23 @@ update_ppa() {
213
371
  ppa_url=${2:-"$lpc_ppa/$ppa/ubuntu"}
214
372
  package_dist=${4:-"$VERSION_CODENAME"}
215
373
  branches=${5:-main}
216
- ppa_search="deb .*$ppa_url $package_dist .*$branches"
217
- update_lists "$ppa" "$ppa_search"
374
+ local list_format
375
+ list_format="$(get_sources_format)"
376
+ IFS='|' read -r primary_pattern secondary_pattern <<< "$(get_repo_patterns "$list_format" "$ppa_url" "$package_dist" "$branches")"
377
+ local list_path
378
+ list_path="$(grep -Elr "$primary_pattern" "$list_dir" 2>/dev/null | head -n 1)"
379
+ if [ -z "$list_path" ] && [ -n "$secondary_pattern" ]; then
380
+ list_path="$(grep -Elr "$secondary_pattern" "$list_dir" 2>/dev/null | head -n 1)"
381
+ fi
382
+ local status_token
383
+ status_token="${ppa_url}|${package_dist}|${branches}"
384
+ update_lists "$ppa" "${list_path:-$primary_pattern}" "$status_token"
218
385
  . /etc/os-release
219
386
  }
220
387
 
221
388
  # Variables
389
+ sources_format=
390
+ check_lists_file=
222
391
  list_dir='/etc/apt/sources.list.d'
223
392
  list_file="/etc/apt/sources.list.d/$ID.sources"
224
393
  [ -e "$list_file" ] || list_file='/etc/apt/sources.list'
@@ -1,18 +1,32 @@
1
1
  Function Add-Symfony() {
2
- $arch_name ='amd64'
3
- if(-not([Environment]::Is64BitOperatingSystem) -or $version -lt '7.0') {
4
- $arch_name = '386'
5
- }
6
- $url = "https://github.com/symfony-cli/symfony-cli/releases/latest/download/symfony-cli_windows_${arch_name}.zip"
7
- Get-File -Url $url -OutFile $bin_dir\symfony.zip >$null 2>&1
8
- Expand-Archive -Path $bin_dir\symfony.zip -DestinationPath $bin_dir -Force >$null 2>&1
9
- if(Test-Path $bin_dir\symfony.exe) {
10
- Copy-Item -Path $bin_dir\symfony.exe -Destination $bin_dir\symfony-cli.exe > $null 2>&1
11
- Add-ToProfile $current_profile 'symfony' "New-Alias symfony $bin_dir\symfony.exe"
12
- Add-ToProfile $current_profile 'symfony_cli' "New-Alias symfony-cli $bin_dir\symfony-cli.exe"
13
- $tool_version = Get-ToolVersion symfony "-V"
14
- Add-Log $tick "symfony-cli" "Added symfony-cli $tool_version"
2
+ param(
3
+ [Parameter(Mandatory = $true, Position = 0, HelpMessage = 'Symfony version to be installed')]
4
+ [string] $protobuf_tag
5
+ )
6
+ $protobuf_tag = $protobuf_tag.replace('v', '')
7
+ if($protobuf_tag -ne 'latest' -and $protobuf_tag -notmatch '^\d+(\.\d+)*$') {
8
+ Add-Log $cross "symfony-cli" "Invalid symfony version: $protobuf_tag"
15
9
  } else {
16
- Add-Log $cross "symfony-cli" "Could not setup symfony-cli"
10
+ $arch_name = 'amd64'
11
+ if (-not ([Environment]::Is64BitOperatingSystem) -or $version -lt '7.0') {
12
+ $arch_name = '386'
13
+ }
14
+ $symfony_releases = "https://github.com/symfony-cli/symfony-cli/releases"
15
+ if ($protobuf_tag -eq 'latest') {
16
+ $url = "$symfony_releases/latest/download/symfony-cli_windows_${arch_name}.zip"
17
+ } else {
18
+ $url = "$symfony_releases/download/v$protobuf_tag/symfony-cli_windows_${arch_name}.zip"
19
+ }
20
+ Get-File -Url $url -OutFile $bin_dir\symfony.zip > $null 2>&1
21
+ Expand-Archive -Path $bin_dir\symfony.zip -DestinationPath $bin_dir -Force > $null 2>&1
22
+ if (Test-Path $bin_dir\symfony.exe) {
23
+ Copy-Item -Path $bin_dir\symfony.exe -Destination $bin_dir\symfony-cli.exe > $null 2>&1
24
+ Add-ToProfile $current_profile 'symfony' "New-Alias symfony $bin_dir\symfony.exe"
25
+ Add-ToProfile $current_profile 'symfony_cli' "New-Alias symfony-cli $bin_dir\symfony-cli.exe"
26
+ $tool_version = Get-ToolVersion symfony "-V"
27
+ Add-Log $tick "symfony-cli" "Added symfony-cli $tool_version"
28
+ } else {
29
+ Add-Log $cross "symfony-cli" "Could not setup symfony-cli"
30
+ }
17
31
  }
18
32
  }
@@ -1,41 +1,44 @@
1
- add_symfony_with_brew() {
2
- add_brew_tap symfony-cli/homebrew-tap
3
- brew install symfony-cli/tap/symfony-cli
4
- }
5
-
6
1
  get_symfony_artifact_url() {
7
- arch=$(dpkg --print-architecture)
8
- url=$(get -s -n "" https://raw.githubusercontent.com/symfony-cli/homebrew-tap/main/Formula/symfony-cli.rb 2<&1 | grep -m 1 "url.*linux.*${arch}" | cut -d\" -f 2)
9
- if [ -z "$url" ]; then
10
- url=$(get -s -n "" https://api.github.com/repos/symfony-cli/symfony-cli/releases 2<&1 | grep -m 1 "url.*linux.*${arch}.*gz\"" | cut -d\" -f 4)
11
- fi
12
- echo "$url"
2
+ local symfony_tag=$1
3
+ local os
4
+ local arch
5
+ os="$(uname -s | tr '[:upper:]' '[:lower:]')"
6
+ arch="$(uname -m)"
7
+ case "$arch" in
8
+ arm|armv6*|armv7*) arch="armv6" ;;
9
+ aarch64*|armv8*|arm64) arch="arm64" ;;
10
+ i[36]86) arch="386" ;;
11
+ x86_64|amd64) arch="amd64" ;;
12
+ esac
13
+ [ "$os" = "darwin" ] && arch="all"
14
+ symfony_releases="https://github.com/symfony-cli/symfony-cli/releases"
15
+ if [ "$symfony_tag" = "latest" ]; then
16
+ echo "$symfony_releases/latest/download/symfony-cli_${os}_${arch}.tar.gz"
17
+ else
18
+ echo "$symfony_releases/download/v$symfony_tag/symfony-cli_${os}_${arch}.tar.gz"
19
+ fi
13
20
  }
14
21
 
15
22
  add_symfony_helper() {
16
- if [ "$(uname -s)" = "Linux" ]; then
17
- url="$(get_symfony_artifact_url)"
18
- if [ -z "$url" ]; then
19
- . "${0%/*}"/tools/brew.sh
20
- configure_brew
21
- add_symfony_with_brew
22
- else
23
- get -s -n "" "$url" | sudo tar -xz -C "${tool_path_dir:?}" 2>/dev/null
24
- sudo chmod a+x /usr/local/bin/symfony
25
- fi
26
- elif [ "$(uname -s)" = "Darwin" ]; then
27
- add_symfony_with_brew
28
- fi
23
+ local install_dir=/usr/local/bin
24
+ [ "$(uname -s)" = "Darwin" ] && install_dir=${brew_prefix:?}/bin
25
+ get -s -n "" "$(get_symfony_artifact_url "$symfony_tag")" | sudo tar -xz -C "$install_dir" 2>/dev/null
26
+ sudo chmod a+x "$install_dir"/symfony
29
27
  }
30
28
 
31
29
  add_symfony() {
32
- add_symfony_helper >/dev/null 2>&1
33
- symfony_path="$(command -v symfony)"
34
- if [[ -n "$symfony_path" ]]; then
35
- sudo ln -s "$symfony_path" "${tool_path_dir:?}"/symfony-cli
36
- tool_version=$(get_tool_version "symfony" "-V")
37
- add_log "${tick:?}" "symfony-cli" "Added symfony-cli $tool_version"
30
+ local symfony_tag="${1/v/}"
31
+ if ! [[ "$symfony_tag" =~ ^[0-9]+(\.[0-9]+)*$ || "$symfony_tag" == 'latest' ]]; then
32
+ add_log "${cross:?}" "symfony-cli" "Version '$symfony_tag' is not valid for symfony-cli"
38
33
  else
39
- add_log "${cross:?}" "symfony-cli" "Could not setup symfony-cli"
34
+ add_symfony_helper "$symfony_tag" >/dev/null 2>&1
35
+ symfony_path="$(command -v symfony)"
36
+ if [[ -n "$symfony_path" ]]; then
37
+ sudo ln -s "$symfony_path" "${tool_path_dir:?}"/symfony-cli
38
+ tool_version=$(get_tool_version "symfony" "-V")
39
+ add_log "${tick:?}" "symfony-cli" "Added symfony-cli $tool_version"
40
+ else
41
+ add_log "${cross:?}" "symfony-cli" "Could not setup symfony-cli"
42
+ fi
40
43
  fi
41
44
  }
@@ -4,7 +4,7 @@ export cross="✗"
4
4
  export curl_opts=(-sL)
5
5
  export old_versions="5.[3-5]"
6
6
  export jit_versions="8.[0-9]"
7
- export nightly_versions="8.[3-9]"
7
+ export nightly_versions="8.[6-9]"
8
8
  export xdebug3_versions="7.[2-4]|8.[0-9]"
9
9
  export latest="releases/latest/download"
10
10
  export github="https://github.com/shivammathur"
@@ -323,7 +323,7 @@ $php_builder = "$github/shivammathur/php-builder-windows"
323
323
  $current_profile = "$env:TEMP\setup-php.ps1"
324
324
  $ProgressPreference = 'SilentlyContinue'
325
325
  $jit_versions = '8.[0-9]'
326
- $nightly_versions = '8.[2-9]'
326
+ $nightly_versions = '8.[6-9]'
327
327
  $xdebug3_versions = "7.[2-4]|8.[0-9]"
328
328
  $enable_extensions = ('openssl', 'curl', 'mbstring')
329
329
 
@@ -444,9 +444,12 @@ if($installed.MajorMinorVersion -ne $version) {
444
444
  }
445
445
  if($version -lt "5.5") {
446
446
  ('libeay32.dll', 'ssleay32.dll') | ForEach-Object -Parallel { Invoke-WebRequest -Uri "$using:php_builder/releases/download/openssl-1.0.2u/$_" -OutFile $using:php_dir\$_ >$null 2>&1 }
447
- } else {
447
+ } elseif($version -lt "8.5") {
448
448
  $enable_extensions += ('opcache')
449
449
  }
450
+ if($version -ge "8.5" -and (Test-Path $ext_dir\php_opcache.dll)) {
451
+ Remove-Item $ext_dir\php_opcache.dll -Force
452
+ }
450
453
  Enable-PhpExtension -Extension ($enable_extensions | Where-Object { Test-Path $ext_dir\php_$_.dll }) -Path $php_dir
451
454
  Add-PhpCAInfo
452
455
  Add-OpenSSLConf
package/src/tools.ts CHANGED
@@ -156,7 +156,7 @@ export async function filterList(tools_list: string[]): Promise<string[]> {
156
156
  * @param data
157
157
  */
158
158
  export async function getUrl(data: RS): Promise<string> {
159
- if (data['version'] === 'latest') {
159
+ if ((data['version'] ?? 'latest') === 'latest') {
160
160
  return [
161
161
  data['domain'],
162
162
  data['repository'],
@@ -290,7 +290,8 @@ export async function addComposer(data: RS): Promise<string> {
290
290
  const spc_url = `${spc}/composer/${filename}`;
291
291
  const lts_url = `${getcomposer}/download/latest-2.2.x/composer.phar`;
292
292
  const is_lts = /^5\.[3-6]$|^7\.[0-1]$/.test(data['php_version']);
293
- const version_source_url = `${getcomposer}/composer-${channel}.phar`;
293
+ const channel_source_url = `${getcomposer}/composer-${channel}.phar`;
294
+ const version_source_url = `${getcomposer}/download/${channel}/composer.phar`;
294
295
  let cache_url = `${releases_url},${spc_url},${cds_url}`;
295
296
  let source_url = `${getcomposer}/composer.phar`;
296
297
  switch (true) {
@@ -298,17 +299,17 @@ export async function addComposer(data: RS): Promise<string> {
298
299
  source_url = is_lts ? lts_url : source_url;
299
300
  break;
300
301
  case /^preview$|^2$/.test(channel):
301
- source_url = is_lts ? lts_url : version_source_url;
302
+ source_url = is_lts ? lts_url : channel_source_url;
302
303
  break;
303
304
  case /^1$/.test(channel):
304
- source_url = version_source_url;
305
+ source_url = channel_source_url;
305
306
  break;
306
307
  case /^\d+\.\d+\.\d+[\w-]*$/.test(data['version']):
307
308
  cache_url = `${github}/${data['repository']}/releases/download/${data['version']}/composer.phar`;
308
309
  source_url = version_source_url;
309
310
  break;
310
311
  default:
311
- source_url = is_lts ? lts_url : version_source_url;
312
+ source_url = is_lts ? lts_url : channel_source_url;
312
313
  }
313
314
  const use_cache: boolean = (await utils.readEnv('NO_TOOLS_CACHE')) !== 'true';
314
315
  data['url'] = use_cache ? `${cache_url},${source_url}` : source_url;
package/src/utils.ts CHANGED
@@ -400,7 +400,7 @@ export async function customPackage(
400
400
  version: string,
401
401
  os: string
402
402
  ): Promise<string> {
403
- const pkg_name: string = pkg.replace(/\d+|(pdo|pecl)[_-]/, '');
403
+ const pkg_name: string = pkg.replace(/\d+|(pdo|pecl)[_-]|[_-]db2/, '');
404
404
  const script_extension: string = await scriptExtension(os);
405
405
  const script: string = path.join(
406
406
  __dirname,
@@ -1,5 +0,0 @@
1
- patch_gearman() {
2
- if [[ "${version:?}" =~ ${nightly_versions:?} ]]; then
3
- sed -i~ -e "s/zend_exception_get_default()/zend_ce_exception/" php_gearman.c
4
- fi
5
- }