setup-php 2.32.0 → 2.34.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.
@@ -18,7 +18,7 @@
18
18
  },
19
19
  "composer-dependency-analyser": {
20
20
  "type": "composer",
21
- "repository": "shipmonk-rnd/composer-dependency-analyser",
21
+ "repository": "shipmonk/composer-dependency-analyser",
22
22
  "scope": "scoped"
23
23
  },
24
24
  "composer-unused": {
@@ -35,7 +35,7 @@
35
35
  "extension": ".phar",
36
36
  "domain": "https://github.com",
37
37
  "version_prefix": "",
38
- "version_parameter": "-V"
38
+ "version_parameter": "diagnose"
39
39
  },
40
40
  "cs2pr": {
41
41
  "type": "phar",
@@ -71,7 +71,7 @@
71
71
  },
72
72
  "php-cs-fixer": {
73
73
  "type": "phar",
74
- "repository": "FriendsOfPHP/PHP-CS-Fixer",
74
+ "repository": "PHP-CS-Fixer/PHP-CS-Fixer",
75
75
  "extension": ".phar",
76
76
  "domain": "https://github.com",
77
77
  "fetch_latest": "true",
@@ -136,6 +136,14 @@
136
136
  "version_prefix": "",
137
137
  "version_parameter": "-V"
138
138
  },
139
+ "pie": {
140
+ "type": "phar",
141
+ "repository": "php/pie",
142
+ "extension": ".phar",
143
+ "domain": "https://github.com",
144
+ "version_prefix": "",
145
+ "version_parameter": "-V"
146
+ },
139
147
  "pint": {
140
148
  "type": "phar",
141
149
  "repository": "laravel/pint",
package/src/extensions.ts CHANGED
@@ -32,25 +32,25 @@ export async function addExtensionDarwin(
32
32
  add_script += await utils.parseExtensionSource(extension, ext_prefix);
33
33
  return;
34
34
  // match 7.4relay...8.5relay
35
- // match 5.3blackfire...8.3blackfire
36
- // match 5.3blackfire-(semver)...8.3blackfire-(semver)
35
+ // match 5.3blackfire...8.4blackfire
36
+ // match 5.3blackfire-(semver)...8.4blackfire-(semver)
37
37
  // match couchbase, event, geos, pdo_oci, oci8, http, pecl_http
38
- // match 5.3ioncube...8.2ioncube
39
- // match 7.0phalcon3...7.3phalcon3, 7.2phalcon4...7.4phalcon4, and 7.4phalcon5...8.3phalcon5
40
- // match 7.0zephir_parser...8.3zephir_parser
38
+ // match 5.3ioncube...8.4ioncube
39
+ // match 7.0phalcon3...7.3phalcon3, 7.2phalcon4...7.4phalcon4, and 7.4phalcon5...8.4phalcon5
40
+ // match 7.0zephir_parser...8.4zephir_parser
41
41
  case /^(7\.4|8\.[0-5])relay(-v?\d+\.\d+\.\d+)?$/.test(version_extension):
42
- case /^(5\.[3-6]|7\.[0-4]|8\.[0-3])blackfire(-\d+\.\d+\.\d+)?$/.test(
42
+ case /^(5\.[3-6]|7\.[0-4]|8\.[0-4])blackfire(-\d+\.\d+\.\d+)?$/.test(
43
43
  version_extension
44
44
  ):
45
45
  case /^couchbase|^event|^gearman$|^geos$|^pdo_oci$|^oci8$|^(pecl_)?http|^pdo_firebird$/.test(
46
46
  extension
47
47
  ):
48
- case /^(5\.[3-6]|7\.[0-4]|8\.[0-2])ioncube$/.test(version_extension):
49
- case /(5\.6|7\.[0-3])phalcon3|7\.[2-4]phalcon4|(7\.4|8\.[0-3])phalcon5?/.test(
48
+ case /^(5\.[3-6]|7\.[0-4]|8\.[0-4])ioncube$/.test(version_extension):
49
+ case /(5\.6|7\.[0-3])phalcon3|7\.[2-4]phalcon4|(7\.4|8\.[0-4])phalcon5?/.test(
50
50
  version_extension
51
51
  ):
52
52
  case /(?<!5\.[3-6])(pdo_)?sqlsrv$/.test(version_extension):
53
- case /^(7\.[0-4]|8\.[0-3])zephir_parser(-v?\d+\.\d+\.\d+)?$/.test(
53
+ case /^(7\.[0-4]|8\.[0-4])zephir_parser(-v?\d+\.\d+\.\d+)?$/.test(
54
54
  version_extension
55
55
  ):
56
56
  add_script += await utils.customPackage(
@@ -134,24 +134,24 @@ export async function addExtensionWindows(
134
134
  case /^none$/.test(ext_name):
135
135
  add_script += '\nDisable-AllShared';
136
136
  break;
137
- // match 5.3blackfire...8.3blackfire
138
- // match 5.3blackfire-(semver)...8.3blackfire-(semver)
137
+ // match 5.3blackfire...8.4blackfire
138
+ // match 5.3blackfire-(semver)...8.4blackfire-(semver)
139
139
  // match pdo_oci and oci8
140
- // match 5.3ioncube...8.2ioncube
141
- // match 7.0phalcon3...7.3phalcon3, 7.2phalcon4...7.4phalcon4, and 7.4phalcon5...8.3phalcon5
140
+ // match 5.3ioncube...8.4ioncube
141
+ // match 7.0phalcon3...7.3phalcon3, 7.2phalcon4...7.4phalcon4, and 7.4phalcon5...8.4phalcon5
142
142
  // match 7.1pecl_http...8.1pecl_http and 7.1http...8.1http
143
- // match 7.0zephir_parser...8.3zephir_parser
144
- case /^(5\.[3-6]|7\.[0-4]|8\.[0-3])blackfire(-\d+\.\d+\.\d+)?$/.test(
143
+ // match 7.0zephir_parser...8.4zephir_parser
144
+ case /^(5\.[3-6]|7\.[0-4]|8\.[0-4])blackfire(-\d+\.\d+\.\d+)?$/.test(
145
145
  version_extension
146
146
  ):
147
147
  case /^pdo_oci$|^oci8$|^pdo_firebird$/.test(extension):
148
- case /^(5\.[3-6]|7\.[0-4]|8\.[0-2])ioncube$/.test(version_extension):
149
- case /^7\.[0-3]phalcon3$|^7\.[2-4]phalcon4$|^(7\.4|8\.[0-3])phalcon5?$/.test(
148
+ case /^(5\.[3-6]|7\.[0-4]|8\.[0-4])ioncube$/.test(version_extension):
149
+ case /^7\.[0-3]phalcon3$|^7\.[2-4]phalcon4$|^(7\.4|8\.[0-4])phalcon5?$/.test(
150
150
  version_extension
151
151
  ):
152
152
  case /^(7\.[1-4]|8\.1)(pecl_)?http/.test(version_extension):
153
153
  case /(?<!5\.[3-6])(pdo_)?sqlsrv$/.test(version_extension):
154
- case /^(7\.[0-4]|8\.[0-3])zephir_parser(-v?\d+\.\d+\.\d+)?$/.test(
154
+ case /^(7\.[0-4]|8\.[0-4])zephir_parser(-v?\d+\.\d+\.\d+)?$/.test(
155
155
  version_extension
156
156
  ):
157
157
  add_script += await utils.customPackage(
@@ -264,15 +264,15 @@ export async function addExtensionLinux(
264
264
  add_script += await utils.parseExtensionSource(extension, ext_prefix);
265
265
  return;
266
266
  // match 7.4relay...8.5relay
267
- // match 5.3blackfire...8.3blackfire
268
- // match 5.3blackfire-(semver)...8.3blackfire-(semver)
267
+ // match 5.3blackfire...8.4blackfire
268
+ // match 5.3blackfire-(semver)...8.4blackfire-(semver)
269
269
  // match 5.3pdo_cubrid...7.2php_cubrid, 5.3cubrid...7.4cubrid
270
270
  // match couchbase, geos, pdo_oci, oci8, http, pecl_http
271
- // match 5.3ioncube...8.2ioncube
272
- // match 7.0phalcon3...7.3phalcon3, 7.2phalcon4...7.4phalcon4, 7.4phalcon5...8.3phalcon5
273
- // match 7.0zephir_parser...8.3zephir_parser
271
+ // match 5.3ioncube...8.4ioncube
272
+ // match 7.0phalcon3...7.3phalcon3, 7.2phalcon4...7.4phalcon4, 7.4phalcon5...8.4phalcon5
273
+ // match 7.0zephir_parser...8.4zephir_parser
274
274
  case /^(7\.4|8\.[0-5])relay(-v?\d+\.\d+\.\d+)?$/.test(version_extension):
275
- case /^(5\.[3-6]|7\.[0-4]|8\.[0-3])blackfire(-\d+\.\d+\.\d+)?$/.test(
275
+ case /^(5\.[3-6]|7\.[0-4]|8\.[0-4])blackfire(-\d+\.\d+\.\d+)?$/.test(
276
276
  version_extension
277
277
  ):
278
278
  case /^((5\.[3-6])|(7\.[0-2]))pdo_cubrid$|^((5\.[3-6])|(7\.[0-4]))cubrid$/.test(
@@ -282,12 +282,12 @@ export async function addExtensionLinux(
282
282
  extension
283
283
  ):
284
284
  case /(?<!5\.[3-5])intl-\d+\.\d+$/.test(version_extension):
285
- case /^(5\.[3-6]|7\.[0-4]|8\.[0-2])ioncube$/.test(version_extension):
286
- case /^7\.[0-3]phalcon3$|^7\.[2-4]phalcon4$|^(7\.4|8\.[0-3])phalcon5?$/.test(
285
+ case /^(5\.[3-6]|7\.[0-4]|8\.[0-4])ioncube$/.test(version_extension):
286
+ case /^7\.[0-3]phalcon3$|^7\.[2-4]phalcon4$|^(7\.4|8\.[0-4])phalcon5?$/.test(
287
287
  version_extension
288
288
  ):
289
289
  case /(?<!5\.[3-6])(pdo_)?sqlsrv$/.test(version_extension):
290
- case /^(7\.[0-4]|8\.[0-3])zephir_parser(-v?\d+\.\d+\.\d+)?$/.test(
290
+ case /^(7\.[0-4]|8\.[0-4])zephir_parser(-v?\d+\.\d+\.\d+)?$/.test(
291
291
  version_extension
292
292
  ):
293
293
  add_script += await utils.customPackage(
@@ -69,7 +69,6 @@ add_brew_extension() {
69
69
  else
70
70
  add_brew_tap "$php_tap"
71
71
  add_brew_tap "$ext_tap"
72
- sudo mv "$tap_dir"/"$ext_tap"/.github/deps/"$formula"/* "${core_repo:?}/Formula/" 2>/dev/null || true
73
72
  update_dependencies >/dev/null 2>&1
74
73
  handle_dependency_extensions "$formula" "$extension" >/dev/null 2>&1
75
74
  (brew install "${brew_opts[@]}" "$ext_tap/$formula@$version" >/dev/null 2>&1 && copy_brew_extensions "$formula") || pecl_install "$extension" >/dev/null 2>&1
@@ -136,7 +135,9 @@ update_dependencies() {
136
135
  patch_brew
137
136
  if ! [ -e /tmp/update_dependencies ]; then
138
137
  for repo in "$brew_repo" "$core_repo"; do
139
- git_retry -C "$repo" fetch origin master && git -C "$repo" reset --hard origin/master
138
+ if [ -e "$repo" ]; then
139
+ git_retry -C "$repo" fetch origin master && git -C "$repo" reset --hard origin/master
140
+ fi
140
141
  done
141
142
  echo '' | sudo tee /tmp/update_dependencies >/dev/null 2>&1
142
143
  fi
@@ -209,6 +210,11 @@ get_scan_dir() {
209
210
  fi
210
211
  }
211
212
 
213
+ # Function to handle self-hosted runner setup.
214
+ self_hosted_helper() {
215
+ :
216
+ }
217
+
212
218
  # Function to Setup PHP.
213
219
  setup_php() {
214
220
  step_log "Setup PHP"
@@ -252,7 +258,7 @@ setup_php() {
252
258
  }
253
259
 
254
260
  # Variables
255
- version=${1:-'8.3'}
261
+ version=${1:-'8.4'}
256
262
  ini=${2:-'production'}
257
263
  src=${0%/*}/..
258
264
  php_formula=shivammathur/php/php@"$version"
@@ -136,6 +136,10 @@ Function Add-Extension {
136
136
  {
137
137
  $params["Version"] = $extension_version
138
138
  }
139
+ # If extension for a different version exists
140
+ if(Test-Path $ext_dir\php_$extension.dll) {
141
+ Move-Item $ext_dir\php_$extension.dll $ext_dir\php_$extension.bak.dll -Force
142
+ }
139
143
  Install-PhpExtension @params
140
144
  Set-ExtensionPrerequisites $extension
141
145
  }
@@ -23,7 +23,7 @@ add_couchbase_clibs() {
23
23
 
24
24
  add_old_libssl() {
25
25
  if [[ "$VERSION_ID" = "24.04" ]]; then
26
- get -q -n /tmp/libssl.deb http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2.22_amd64.deb
26
+ get -q -n /tmp/libssl.deb http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2_amd64.deb
27
27
  [ -e /tmp/libssl.deb ] && sudo dpkg -i /tmp/libssl.deb || add_extension_log "couchbase" "Could not install libssl1.1"
28
28
  fi
29
29
  }
@@ -15,6 +15,7 @@ add_firebird_client_darwin() {
15
15
  add_firebird_helper() {
16
16
  firebird_dir=$1
17
17
  tag="$(php_src_tag)"
18
+ export PDO_FIREBIRD_CONFIGURE_PREFIX_OPTS="CFLAGS=-Wno-incompatible-function-pointer-types EXTRA_CFLAGS=-Wno-int-conversion"
18
19
  export PDO_FIREBIRD_CONFIGURE_OPTS="--with-pdo-firebird=$firebird_dir"
19
20
  export PDO_FIREBIRD_LINUX_LIBS="firebird-dev"
20
21
  export PDO_FIREBIRD_PATH="ext/pdo_firebird"
@@ -2,9 +2,9 @@
2
2
  install_icu() {
3
3
  icu=$1
4
4
  if [ "$(php -i | grep "ICU version =>" | sed -e "s|.*=> s*||")" != "$icu" ]; then
5
- get -q -n /tmp/icu.tar.zst "https://github.com/shivammathur/icu-intl/releases/download/icu4c/icu4c-$icu.tar.zst"
5
+ get -q -n /tmp/icu.tar.zst "https://github.com/shivammathur/icu-intl/releases/download/icu4c/icu4c-$icu$arch_suffix.tar.zst"
6
6
  sudo tar -I zstd -xf /tmp/icu.tar.zst -C /usr/local
7
- sudo cp -r /usr/local/icu/lib/* /usr/lib/x86_64-linux-gnu/
7
+ sudo cp -r /usr/local/icu/lib/* /usr/lib/"$(uname -m)"-linux-gnu/
8
8
  fi
9
9
  }
10
10
 
@@ -17,8 +17,11 @@ add_intl() {
17
17
  else
18
18
  [ "${ts:?}" = 'zts' ] && suffix='-zts'
19
19
  install_icu "$icu" >/dev/null 2>&1
20
- get -q -n "${ext_dir:?}/intl.so" "https://github.com/shivammathur/icu-intl/releases/download/intl/php${version:?}-intl-$icu$suffix.so"
20
+ get -q -n "${ext_dir:?}/intl.so" "https://github.com/shivammathur/icu-intl/releases/download/intl/php${version:?}-intl-$icu$suffix$arch_suffix.so"
21
21
  enable_extension intl extension
22
22
  add_extension_log intl "Installed and enabled with ICU $icu"
23
23
  fi
24
24
  }
25
+
26
+ arch="$(uname -m)"
27
+ [[ "$arch" = 'arm64' || "$arch" = 'aarch64' ]] && arch_suffix='-arm64' || arch_suffix=''
@@ -48,6 +48,7 @@ Function Get-Oci8DLL() {
48
48
  return $_
49
49
  }
50
50
  }
51
+ return $null
51
52
  }
52
53
 
53
54
  # Function to install oci8 and pdo_oci.
@@ -62,22 +63,17 @@ Function Add-Oci() {
62
63
  try {
63
64
  $status = 'Enabled'
64
65
  Add-InstantClient
65
- if ($extension -eq "pdo_oci") {
66
- Enable-PhpExtension pdo_oci -Path $php_dir
67
- } else {
68
- if(-not(Test-Path $ext_dir\php_oci8.dll)) {
69
- $oci8DLL = Get-Oci8DLL
70
- if($oci8DLL) {
71
- Copy-Item -Path $oci8DLL -Destination $ext_dir\php_oci8.dll
72
- } else {
73
- $status = 'Installed and enabled'
74
- Get-File -Url (Get-Oci8Url) -OutFile $php_dir\oci8.zip
75
- Expand-Archive -Path $php_dir\oci8.zip -DestinationPath $ext_dir -Force
76
- }
66
+ if($version -lt '8.4') {
67
+ if($version -lt '5.6' -and $extension -eq 'oci8') {
68
+ Add-Content -Value "`r`nextension=php_oci8.dll" -Path $php_dir\php.ini
69
+ } else {
70
+ Enable-PhpExtension $extension -Path $php_dir
77
71
  }
78
- Add-Content -Value "`r`nextension=php_oci8.dll" -Path $php_dir\php.ini
72
+ } else {
73
+ $status = 'Installed and enabled'
74
+ Add-Extension $extension >$null 2>&1
79
75
  }
80
- Add-Log $tick $extension $status
76
+ Add-ExtensionLog $extension $status
81
77
  Add-LicenseLog
82
78
  } catch {
83
79
  Add-Log $cross $extension "Could not install $extension on PHP $( $installed.FullVersion )"
@@ -11,28 +11,36 @@ add_license_log() {
11
11
  add_client() {
12
12
  if [ ! -e "$oracle_client" ]; then
13
13
  sudo mkdir -p -m 777 "$oracle_home" "$oracle_client"
14
+ arch="$(uname -m)"
14
15
  for package in basiclite sdk; do
15
16
  if [ "$os" = 'Linux' ]; then
16
17
  libs='/usr/lib/'
17
18
  os_name='linux'
18
- arch='linuxx64'
19
+ [[ "$arch" = 'arm64' || "$arch" = 'aarch64' ]] && arch_suffix='linux-arm64' || arch_suffix='linuxx64'
19
20
  lib_ext='so'
20
21
  elif [ "$os" = 'Darwin' ]; then
21
22
  libs='/usr/local/lib/'
22
23
  os_name='mac'
23
- arch='macos'
24
+ arch_suffix='macos'
24
25
  lib_ext='dylib'
25
26
  fi
26
- get -q -n "/opt/oracle/$package.zip" "https://download.oracle.com/otn_software/$os_name/instantclient/instantclient-$package-$arch.zip"
27
- unzip -o "/opt/oracle/$package.zip" -d "$oracle_home"
27
+ if [[ "$os" = 'Darwin' && ("$arch" = 'arm64' || "$arch" = 'aarch64') ]]; then
28
+ get -q -n "/opt/oracle/$package.dmg" "https://download.oracle.com/otn_software/$os_name/instantclient/instantclient-$package-macos-arm64.dmg"
29
+ sudo hdiutil attach "/opt/oracle/$package.dmg"
30
+ (cd /Volumes/instantclient-"$package"-macos.arm64-* && bash install_ic.sh)
31
+ sudo cp -a ~/Downloads/instantclient_* /opt/oracle/
32
+ else
33
+ get -q -n "/opt/oracle/$package.zip" "https://download.oracle.com/otn_software/$os_name/instantclient/instantclient-$package-$arch_suffix.zip"
34
+ unzip -o "/opt/oracle/$package.zip" -d "$oracle_home"
35
+ fi
28
36
  done
29
37
  for icdir in /opt/oracle/instantclient_*; do
30
38
  sudo mv "$icdir"/* "$oracle_client"/
31
39
  done
40
+ sudo mkdir -p "$libs"
32
41
  sudo ln -sf /opt/oracle/instantclient/*.$lib_ext* $libs
33
42
  if [ "$os" = "Linux" ]; then
34
- arch="$(uname -m)"
35
- [ -e "$libs/$arch"-linux-gnu/libaio.so.1t64 ] && sudo ln -sf "$libs/$arch"-linux-gnu/libaio.so.1t64 "$libs/$arch"-linux-gnu/libaio.so.1
43
+ [ -e "$libs/$arch"-linux-gnu/libaio.so.1 ] || sudo ln -sf "$libs/$arch"-linux-gnu/libaio.so.1t64 "$libs/$arch"-linux-gnu/libaio.so.1
36
44
  fi
37
45
  fi
38
46
  }
@@ -1,7 +1,7 @@
1
1
  process_file() {
2
2
  local file=$1
3
- sed -i '0,/#include.*\(php_lcg.h\|php_mt_rand.h\|php_rand.h\|standard\/php_random\.h\).*/s//\#include <ext\/random\/php_random.h>/' "$file"
4
- sed -i '/#include.*\(php_lcg.h\|php_mt_rand.h\|php_rand.h\|standard\/php_random\.h\)/d' "$file"
3
+ sed -i'' -e '0,/#include.*\(php_lcg.h\|php_mt_rand.h\|php_rand.h\|standard\/php_random\.h\).*/s//\#include <ext\/random\/php_random.h>/' "$file"
4
+ sed -i'' -e '/#include.*\(php_lcg.h\|php_mt_rand.h\|php_rand.h\|standard\/php_random\.h\)/d' "$file"
5
5
  }
6
6
 
7
7
  export -f process_file
@@ -80,9 +80,9 @@ Function Get-PhalconSemver() {
80
80
  # Function to install phalcon
81
81
  Function Add-PhalconHelper() {
82
82
  $semver = Get-PhalconSemver
83
- if (($extension_version -eq '3') -or ($extension_version -eq '5')) {
83
+ if ($extension_version -eq '3') {
84
84
  Add-PhalconFromGitHub $semver
85
- } elseif ($extension_version -eq '4') {
85
+ } else {
86
86
  Add-Extension -Extension phalcon -Stability stable -Extension_version $semver
87
87
  }
88
88
  }
@@ -73,7 +73,7 @@ add_phalcon4() {
73
73
  fi
74
74
  }
75
75
 
76
- # Function to add phalcon3.
76
+ # Function to add phalcon5.
77
77
  add_phalcon5() {
78
78
  if shared_extension phalcon; then
79
79
  phalcon_version=$(php -d="extension=phalcon.so" -r "echo phpversion('phalcon');" | cut -d'.' -f 1)
@@ -48,6 +48,19 @@ change_library_paths() {
48
48
  fi
49
49
  }
50
50
 
51
+ # Add hiredis library
52
+ add_hiredis() {
53
+ hiredis_url=https://github.com/redis/hiredis/archive/v1.1.0.tar.gz
54
+ hiredis_sha=fe6d21741ec7f3fc9df409d921f47dfc73a4d8ff64f4ac6f1d95f951bf7f53d6
55
+ sed -Ei.bak -e "s#^ url.*# url \"$hiredis_url\"#" -e "s#^ sha256.*# sha256 \"$hiredis_sha\"#" ${core_repo:?}/Formula/h/hiredis.rb
56
+ brew install -s hiredis
57
+ lib_dir="${brew_prefix:?}"/opt/hiredis/lib
58
+ if [ -e "$lib_dir"/libhiredis_ssl.1.1.0.dylib ]; then
59
+ sudo ln -sf "$lib_dir"/libhiredis_ssl.1.1.0.dylib "$lib_dir"/libhiredis_ssl.dylib.1.1.0
60
+ fi
61
+ mv ${core_repo:?}/Formula/h/hiredis.rb.bak ${core_repo:?}/Formula/h/hiredis.rb
62
+ }
63
+
51
64
  # Add relay dependencies
52
65
  add_relay_dependencies() {
53
66
  add_extension json
@@ -56,7 +69,8 @@ add_relay_dependencies() {
56
69
  if [ "$os" = "Darwin" ]; then
57
70
  . "${0%/*}"/tools/brew.sh
58
71
  configure_brew
59
- brew install hiredis lz4 zstd concurrencykit
72
+ brew install lz4 zstd concurrencykit
73
+ add_hiredis
60
74
  fi
61
75
  }
62
76
 
@@ -83,8 +83,10 @@ run_group() {
83
83
  echo "$command" | sudo tee ./run_group.sh >/dev/null 2>&1
84
84
  echo "$GROUP$log"
85
85
  . ./run_group.sh
86
+ local status=$?
86
87
  rm ./run_group.sh
87
88
  echo "$END_GROUP"
89
+ return $status
88
90
  }
89
91
 
90
92
  patch_extension() {
@@ -150,10 +152,10 @@ add_extension_from_source() {
150
152
  [[ -n "${libraries// }" ]] && run_group "add_libs $libraries" "add libraries"
151
153
  [ "${debug:?}" = "debug" ] && suffix_opts="$suffix_opts --enable-debug"
152
154
  patch_extension "$extension" >/dev/null 2>&1
153
- run_group "phpize" "phpize"
154
- run_group "sudo $prefix_opts ./configure $suffix_opts $opts" "configure"
155
- run_group "sudo make -j$(nproc 2>/dev/null || sysctl -n hw.ncpu)" "make"
156
- run_group "sudo make install" "make install"
155
+ run_group "phpize" "phpize" && \
156
+ run_group "sudo $prefix_opts ./configure $suffix_opts $opts" "configure" && \
157
+ run_group "sudo $prefix_opts make -j$(nproc 2>/dev/null || sysctl -n hw.ncpu)" "make" && \
158
+ run_group "sudo make install" "make install" && \
157
159
  enable_extension "$extension" "$prefix"
158
160
  fi
159
161
  )
@@ -31,6 +31,9 @@ Function Get-ZephirParserVersion() {
31
31
  $repo = 'zephir-lang/php-zephir-parser'
32
32
  $zp_releases = "$github/$repo/releases"
33
33
  if($extension -eq 'zephir_parser') {
34
+ if($version -lt '7.2') {
35
+ return 'v1.6.1'
36
+ }
34
37
  return (Get-File -Url $zp_releases/latest).BaseResponse.RequestMessage.RequestUri.Segments[-1]
35
38
  } else {
36
39
  return 'v' + ($extension.split('-')[1] -replace 'v')
@@ -71,10 +74,14 @@ Function Add-ZephirParser() {
71
74
  Enable-PhpExtension -Extension zephir_parser -Path $php_dir
72
75
  } else {
73
76
  $status = 'Installed and enabled'
74
- Add-ZephirParserFromGitHub $extension
77
+ try {
78
+ Add-ZephirParserFromGitHub $extension
79
+ } catch {
80
+ Add-Extension $extension >$null 2>&1
81
+ }
75
82
  }
76
83
  Add-ExtensionLog zephir_parser $status
77
84
  } catch {
78
85
  Add-Log $cross $extension "Could not install $extension on PHP $($installed.FullVersion)"
79
86
  }
80
- }
87
+ }
@@ -17,9 +17,13 @@ add_zephir_parser_helper() {
17
17
  [ "$(uname -s)" = "Linux" ] && os_suffix=ubuntu || os_suffix=macos
18
18
  build_name=$(get -s -n "" https://api.github.com/repos/"$repo"/releases/tags/"$ext_version" | grep -Eo "zephir_parser-php-${version:?}-$nts-$os_suffix-.*.zip" | head -n 1)
19
19
  [ -z "$build_name" ] && build_name=$(get -s -n "" "$zp_releases"/expanded_assets/"$ext_version" | grep -Eo "zephir_parser-php-${version:?}-$nts-$os_suffix-.*.zip" | head -n 1)
20
- get -q -e "/tmp/zp.zip" "$zp_releases"/download/"$ext_version"/"$build_name"
21
- sudo unzip -o "/tmp/zp.zip" -d "${ext_dir:?}"
22
- enable_extension zephir_parser extension
20
+ if [ -n "$build_name" ]; then
21
+ get -q -e "/tmp/zp.zip" "$zp_releases"/download/"$ext_version"/"$build_name"
22
+ sudo unzip -o "/tmp/zp.zip" -d "${ext_dir:?}"
23
+ enable_extension zephir_parser extension
24
+ else
25
+ pecl_install zephir_parser
26
+ fi
23
27
  }
24
28
 
25
29
  # Add zephir_parser
@@ -290,7 +290,7 @@ setup_php() {
290
290
  }
291
291
 
292
292
  # Variables
293
- version=${1:-'8.3'}
293
+ version=${1:-'8.4'}
294
294
  ini=${2:-'production'}
295
295
  src=${0%/*}/..
296
296
  debconf_fix="DEBIAN_FRONTEND=noninteractive"
@@ -58,6 +58,11 @@ Function Set-ComposerEnv() {
58
58
  (Get-Content $src\configs\composer.env -Raw) -replace '(?m)^COMPOSER_PROCESS_TIMEOUT=.*$', "COMPOSER_PROCESS_TIMEOUT=$env:COMPOSER_PROCESS_TIMEOUT" | Set-Content $src\configs\composer.env
59
59
  }
60
60
  Add-EnvPATH $src\configs\composer.env
61
+ if($env:COMPOSER_ALLOW_PLUGINS) {
62
+ $env:COMPOSER_ALLOW_PLUGINS -split '\s*,\s*' | Where-Object { $_ } | ForEach-Object {
63
+ & composer global config --no-plugins "allow-plugins.$_" true > $null 2>&1
64
+ }
65
+ }
61
66
  }
62
67
 
63
68
  # Function to extract tool version.
@@ -1,5 +1,4 @@
1
1
  # Variables
2
- export tool_path_dir="/usr/local/bin"
3
2
  export composer_home="$HOME/.composer"
4
3
  export composer_bin="$composer_home/vendor/bin"
5
4
  export composer_json="$composer_home/composer.json"
@@ -76,6 +75,11 @@ set_composer_env() {
76
75
  sed -i "$sed_arg" "$composer_env" 2>/dev/null || sed -i '' "$sed_arg" "$composer_env"
77
76
  fi
78
77
  add_env_path "$composer_env"
78
+ if [ -n "$COMPOSER_ALLOW_PLUGINS" ]; then
79
+ echo "$COMPOSER_ALLOW_PLUGINS" | tr ',' '\n' | sed 's/^[[:space:]]*//;s/[[:space:]]*$//' | grep -v '^$' | while IFS= read -r plugin; do
80
+ composer global config --no-plugins "allow-plugins.$plugin" true >/dev/null 2>&1
81
+ done
82
+ fi
79
83
  }
80
84
 
81
85
  # Helper function to configure tools.
@@ -9,7 +9,13 @@ Function Add-Msys2() {
9
9
 
10
10
  Function Add-GrpcPhpPlugin() {
11
11
  $msys_location = Add-Msys2
12
- $logs = . $msys_location\usr\bin\bash -l -c "pacman -S --noconfirm mingw-w64-x86_64-grpc" >$null 2>&1
12
+ $arch = arch
13
+ if($arch -eq 'arm64' -or $arch -eq 'aarch64') {
14
+ $grpc_package = 'mingw-w64-clang-aarch64-grpc'
15
+ } else {
16
+ $grpc_package = 'mingw-w64-x86_64-grpc'
17
+ }
18
+ $logs = . $msys_location\usr\bin\bash -l -c "pacman -S --noconfirm $grpc_package" >$null 2>&1
13
19
  $grpc_version = Get-ToolVersion 'Write-Output' "$logs"
14
20
  Add-Path $msys_location\mingw64\bin
15
21
  Set-Output grpc_php_plugin_path "$msys_location\mingw64\bin\grpc_php_plugin.exe"
@@ -67,7 +67,7 @@ update_lists() {
67
67
  # Function to get fingerprint from an Ubuntu PPA.
68
68
  ubuntu_fingerprint() {
69
69
  ppa=$1
70
- get -s -n "" "$lp_api"/~"${ppa%/*}"/+archive/"${ppa##*/}" | jq -r '.signing_key_fingerprint'
70
+ get -s -n "" "${lp_api[@]/%//~${ppa%/*}/+archive/${ppa##*/}}" | jq -r '.signing_key_fingerprint'
71
71
  }
72
72
 
73
73
  # Function to get fingerprint from a Debian PPA.
@@ -88,7 +88,7 @@ add_key() {
88
88
  key_source=$4
89
89
  key_file=$5
90
90
  key_urls=("$key_source")
91
- if [[ "$key_source" =~ launchpad.net|debian.org ]]; then
91
+ if [[ "$key_source" =~ launchpadcontent.net|debian.org ]]; then
92
92
  fingerprint="$("${ID}"_fingerprint "$ppa" "$ppa_url" "$package_dist")"
93
93
  sks_params="op=get&options=mr&exact=on&search=0x$fingerprint"
94
94
  key_urls=("${sks[@]/%/\/pks\/lookup\?"$sks_params"}")
@@ -117,7 +117,7 @@ check_lists() {
117
117
  # Function to add a sources list.
118
118
  add_list() {
119
119
  ppa=${1-ondrej/php}
120
- ppa_url=${2:-"$lp_ppa/$ppa/ubuntu"}
120
+ ppa_url=${2:-"$lpc_ppa/$ppa/ubuntu"}
121
121
  key_source=${3:-"$ppa_url"}
122
122
  package_dist=${4:-"$VERSION_CODENAME"}
123
123
  branches=${5:-main}
@@ -129,7 +129,8 @@ add_list() {
129
129
  arch=$(dpkg --print-architecture)
130
130
  [ -e "$key_source" ] && key_file=$key_source || key_file="$key_dir"/"${ppa/\//-}"-keyring.gpg
131
131
  add_key "$ppa" "$ppa_url" "$package_dist" "$key_source" "$key_file"
132
- echo "deb [arch=$arch signed-by=$key_file] $ppa_url $package_dist $branches" | sudo tee -a "$list_dir"/"${ppa/\//-}".list >/dev/null 2>&1
132
+ sudo rm -rf "$list_dir"/"${ppa/\//-}".list || true
133
+ 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
133
134
  update_lists "$ppa" "$ppa_search"
134
135
  . /etc/os-release
135
136
  fi
@@ -139,7 +140,7 @@ add_list() {
139
140
  # Function to check if a PPA exists
140
141
  check_ppa() {
141
142
  ppa=$1
142
- ppa_url=${2:-"$lp_ppa/$ppa/ubuntu"}
143
+ ppa_url=${2:-"$lpc_ppa/$ppa/ubuntu"}
143
144
  package_dist=${3:-"$VERSION_CODENAME"}
144
145
  branches=${4:-main}
145
146
  ppa_search="deb .*$ppa_url $package_dist .*$branches$"
@@ -163,7 +164,7 @@ remove_list() {
163
164
  # Function to check if ubuntu ppa is up
164
165
  is_ubuntu_ppa_up() {
165
166
  ppa=${1:-ondrej/php}
166
- curl -s --connect-timeout 5 --max-time 5 --head --fail "$lp_ppa/$ppa/ubuntu/dists/$VERSION_CODENAME/Release" > /dev/null
167
+ curl -s --connect-timeout 5 --max-time 5 --head --fail "$lpc_ppa/$ppa/ubuntu/dists/$VERSION_CODENAME/Release" > /dev/null
167
168
  }
168
169
 
169
170
  # Function to add the PPA mirror.
@@ -181,7 +182,8 @@ add_ppa() {
181
182
  ppa=${1:-ondrej/php}
182
183
  if [[ "$ID" = "ubuntu" || "$ID_LIKE" =~ ubuntu ]] && [[ "$ppa" =~ "ondrej/" ]]; then
183
184
  if is_ubuntu_ppa_up "$ppa" ; then
184
- [ "${debug:?}" = "debug" ] && add_list "$ppa" "$lp_ppa/$ppa/ubuntu" "$lp_ppa/$ppa/ubuntu" "$VERSION_CODENAME" "main/debug"
185
+ [ "${runner:?}" = "self-hosted" ] && find "$list_dir" -type f -name 'sp*' -exec grep -qF "$sp" {} \; -delete
186
+ [ "${debug:?}" = "debug" ] && add_list "$ppa" "$lpc_ppa/$ppa/ubuntu" "$lpc_ppa/$ppa/ubuntu" "$VERSION_CODENAME" "main/debug"
185
187
  add_list "$ppa"
186
188
  else
187
189
  add_ppa_sp_mirror "$ppa"
@@ -201,7 +203,7 @@ add_ppa() {
201
203
  update_ppa() {
202
204
  set_base_version
203
205
  ppa=${1:-ondrej/php}
204
- ppa_url=${2:-"$lp_ppa/$ppa/ubuntu"}
206
+ ppa_url=${2:-"$lpc_ppa/$ppa/ubuntu"}
205
207
  package_dist=${4:-"$VERSION_CODENAME"}
206
208
  branches=${5:-main}
207
209
  ppa_search="deb .*$ppa_url $package_dist .*$branches"
@@ -214,7 +216,10 @@ list_dir='/etc/apt/sources.list.d'
214
216
  list_file="/etc/apt/sources.list.d/$ID.sources"
215
217
  [ -e "$list_file" ] || list_file='/etc/apt/sources.list'
216
218
  upstream_lsb='/etc/upstream-release/lsb-release'
217
- lp_api='https://api.launchpad.net/1.0'
219
+ lp_api=(
220
+ 'https://api.launchpad.net/1.0'
221
+ 'https://api.launchpad.net/devel'
222
+ )
218
223
  lp_ppa='http://ppa.launchpad.net'
219
224
  lpc_ppa='https://ppa.launchpadcontent.net'
220
225
  key_dir='/usr/share/keyrings'
@@ -17,7 +17,9 @@ add_protoc() {
17
17
  (
18
18
  platform='linux'
19
19
  [ "$(uname -s)" = "Darwin" ] && platform='osx'
20
- get -q -n /tmp/protobuf.zip "https://github.com/protocolbuffers/protobuf/releases/download/$protobuf_tag/protoc-${protobuf_tag:1}-$platform-x86_64.zip"
20
+ arch="$(uname -m)"
21
+ [[ "$arch" = 'arm64' || "$arch" = 'aarch64' ]] && arch='aarch_64'
22
+ get -q -n /tmp/protobuf.zip "https://github.com/protocolbuffers/protobuf/releases/download/$protobuf_tag/protoc-${protobuf_tag:1}-$platform-$arch.zip"
21
23
  sudo unzip /tmp/protobuf.zip -d /usr/local/
22
24
  sudo chmod -R 777 /usr/local/bin/protoc /usr/local/include/google
23
25
  ) >/dev/null 2>&1