setup-php 2.31.1 → 2.33.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 (46) hide show
  1. package/README.md +105 -100
  2. package/lib/config.js +17 -7
  3. package/lib/config.js.map +1 -1
  4. package/lib/coverage.js +17 -7
  5. package/lib/coverage.js.map +1 -1
  6. package/lib/extensions.js +31 -21
  7. package/lib/extensions.js.map +1 -1
  8. package/lib/fetch.js +17 -7
  9. package/lib/fetch.js.map +1 -1
  10. package/lib/install.js +17 -7
  11. package/lib/install.js.map +1 -1
  12. package/lib/packagist.js +17 -7
  13. package/lib/packagist.js.map +1 -1
  14. package/lib/tools.js +20 -7
  15. package/lib/tools.js.map +1 -1
  16. package/lib/utils.js +23 -10
  17. package/lib/utils.js.map +1 -1
  18. package/package.json +21 -18
  19. package/src/configs/mod_priority +1 -1
  20. package/src/configs/php-versions.json +4 -4
  21. package/src/configs/tools.json +7 -2
  22. package/src/extensions.ts +31 -31
  23. package/src/scripts/darwin.sh +10 -8
  24. package/src/scripts/extensions/add_extensions.ps1 +4 -0
  25. package/src/scripts/extensions/couchbase.sh +1 -1
  26. package/src/scripts/extensions/firebird.sh +1 -0
  27. package/src/scripts/extensions/intl.sh +6 -3
  28. package/src/scripts/extensions/oci.ps1 +10 -14
  29. package/src/scripts/extensions/oci.sh +14 -6
  30. package/src/scripts/extensions/patches/common.sh +2 -2
  31. package/src/scripts/extensions/phalcon.ps1 +2 -2
  32. package/src/scripts/extensions/phalcon.sh +1 -1
  33. package/src/scripts/extensions/relay.sh +9 -0
  34. package/src/scripts/extensions/source.sh +1 -1
  35. package/src/scripts/extensions/zephir_parser.ps1 +9 -2
  36. package/src/scripts/extensions/zephir_parser.sh +7 -3
  37. package/src/scripts/linux.sh +6 -5
  38. package/src/scripts/tools/add_tools.sh +0 -1
  39. package/src/scripts/tools/brew.sh +0 -1
  40. package/src/scripts/tools/grpc_php_plugin.ps1 +7 -1
  41. package/src/scripts/tools/ppa.sh +14 -11
  42. package/src/scripts/tools/protoc.sh +3 -1
  43. package/src/scripts/unix.sh +58 -1
  44. package/src/scripts/win32.ps1 +11 -2
  45. package/src/tools.ts +3 -0
  46. package/src/utils.ts +8 -3
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "lowest": "8.1",
3
- "highest": "8.3",
4
- "latest": "8.3",
5
- "nightly": "8.4",
3
+ "highest": "8.4",
4
+ "latest": "8.4",
5
+ "nightly": "8.5",
6
6
  "5.x": "5.6",
7
7
  "7.x": "7.4",
8
- "8.x": "8.3"
8
+ "8.x": "8.4"
9
9
  }
@@ -16,6 +16,11 @@
16
16
  "version_prefix": "",
17
17
  "version_parameter": "-V"
18
18
  },
19
+ "composer-dependency-analyser": {
20
+ "type": "composer",
21
+ "repository": "shipmonk/composer-dependency-analyser",
22
+ "scope": "scoped"
23
+ },
19
24
  "composer-unused": {
20
25
  "type": "phar",
21
26
  "repository": "composer-unused/composer-unused",
@@ -30,7 +35,7 @@
30
35
  "extension": ".phar",
31
36
  "domain": "https://github.com",
32
37
  "version_prefix": "",
33
- "version_parameter": "-V"
38
+ "version_parameter": "diagnose"
34
39
  },
35
40
  "cs2pr": {
36
41
  "type": "phar",
@@ -66,7 +71,7 @@
66
71
  },
67
72
  "php-cs-fixer": {
68
73
  "type": "phar",
69
- "repository": "FriendsOfPHP/PHP-CS-Fixer",
74
+ "repository": "PHP-CS-Fixer/PHP-CS-Fixer",
70
75
  "extension": ".phar",
71
76
  "domain": "https://github.com",
72
77
  "fetch_latest": "true",
package/src/extensions.ts CHANGED
@@ -31,26 +31,26 @@ export async function addExtensionDarwin(
31
31
  case /.+-.+\/.+@.+/.test(extension):
32
32
  add_script += await utils.parseExtensionSource(extension, ext_prefix);
33
33
  return;
34
- // match 7.4relay...8.3relay
35
- // match 5.3blackfire...8.3blackfire
36
- // match 5.3blackfire-(semver)...8.3blackfire-(semver)
34
+ // match 7.4relay...8.5relay
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
41
- case /^(7\.4|8\.[0-3])relay(-v?\d+\.\d+\.\d+)?$/.test(version_extension):
42
- case /^(5\.[3-6]|7\.[0-4]|8\.[0-3])blackfire(-\d+\.\d+\.\d+)?$/.test(
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
+ case /^(7\.4|8\.[0-5])relay(-v?\d+\.\d+\.\d+)?$/.test(version_extension):
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(
@@ -263,16 +263,16 @@ export async function addExtensionLinux(
263
263
  case /.+-.+\/.+@.+/.test(extension):
264
264
  add_script += await utils.parseExtensionSource(extension, ext_prefix);
265
265
  return;
266
- // match 7.4relay...8.3relay
267
- // match 5.3blackfire...8.3blackfire
268
- // match 5.3blackfire-(semver)...8.3blackfire-(semver)
266
+ // match 7.4relay...8.5relay
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
274
- case /^(7\.4|8\.[0-3])relay(-v?\d+\.\d+\.\d+)?$/.test(version_extension):
275
- case /^(5\.[3-6]|7\.[0-4]|8\.[0-3])blackfire(-\d+\.\d+\.\d+)?$/.test(
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
+ case /^(7\.4|8\.[0-5])relay(-v?\d+\.\d+\.\d+)?$/.test(version_extension):
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(
@@ -213,6 +213,8 @@ get_scan_dir() {
213
213
  setup_php() {
214
214
  step_log "Setup PHP"
215
215
  php_config="$(command -v php-config 2>/dev/null)"
216
+ update=true
217
+ check_pre_installed
216
218
  existing_version=$(get_brewed_php)
217
219
  if [[ "$version" =~ ${old_versions:?} ]]; then
218
220
  run_script "php5-darwin" "${version/./}" >/dev/null 2>&1
@@ -220,12 +222,13 @@ setup_php() {
220
222
  elif [ "$existing_version" != "$version" ]; then
221
223
  add_php "install" "$existing_version" >/dev/null 2>&1
222
224
  status="Installed"
223
- elif [ "$existing_version" = "$version" ] && [ "${update:?}" = "true" ]; then
224
- add_php "upgrade" "$existing_version" >/dev/null 2>&1
225
- status="Updated to"
226
- else
227
- add_php "upgrade" "$existing_version" >/dev/null 2>&1
228
- status="Updated to"
225
+ elif [ "$existing_version" = "$version" ]; then
226
+ if [ "${update:?}" = "true" ]; then
227
+ add_php "upgrade" "$existing_version" >/dev/null 2>&1
228
+ status="Updated to"
229
+ else
230
+ status="Found"
231
+ fi
229
232
  fi
230
233
  php_config="$(command -v php-config)"
231
234
  ext_dir="$(sed -n "s/.*extension_dir=['\"]\(.*\)['\"].*/\1/p" "$php_config")"
@@ -249,7 +252,7 @@ setup_php() {
249
252
  }
250
253
 
251
254
  # Variables
252
- version=${1:-'8.3'}
255
+ version=${1:-'8.4'}
253
256
  ini=${2:-'production'}
254
257
  src=${0%/*}/..
255
258
  php_formula=shivammathur/php/php@"$version"
@@ -257,7 +260,6 @@ scripts="$src"/scripts
257
260
  ext_tap=shivammathur/homebrew-extensions
258
261
  php_tap=shivammathur/homebrew-php
259
262
  export HOMEBREW_CHANGE_ARCH_TO_ARM=1
260
- export HOMEBREW_DEVELOPER=1
261
263
  export HOMEBREW_NO_AUTO_UPDATE=1
262
264
  export HOMEBREW_NO_ENV_HINTS=1
263
265
  export HOMEBREW_NO_INSTALL_CLEANUP=1
@@ -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,14 @@ change_library_paths() {
48
48
  fi
49
49
  }
50
50
 
51
+ # Link hiredis library
52
+ link_hiredis() {
53
+ lib_dir="${brew_prefix:?}"/opt/hiredis/lib
54
+ if [ -e "$lib_dir"/libhiredis_ssl.1.1.0.dylib ]; then
55
+ sudo ln -sf "$lib_dir"/libhiredis_ssl.1.1.0.dylib "$lib_dir"/libhiredis_ssl.dylib.1.1.0
56
+ fi
57
+ }
58
+
51
59
  # Add relay dependencies
52
60
  add_relay_dependencies() {
53
61
  add_extension json
@@ -57,6 +65,7 @@ add_relay_dependencies() {
57
65
  . "${0%/*}"/tools/brew.sh
58
66
  configure_brew
59
67
  brew install hiredis lz4 zstd concurrencykit
68
+ link_hiredis
60
69
  fi
61
70
  }
62
71
 
@@ -152,7 +152,7 @@ add_extension_from_source() {
152
152
  patch_extension "$extension" >/dev/null 2>&1
153
153
  run_group "phpize" "phpize"
154
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"
155
+ run_group "sudo $prefix_opts make -j$(nproc 2>/dev/null || sysctl -n hw.ncpu)" "make"
156
156
  run_group "sudo make install" "make install"
157
157
  enable_extension "$extension" "$prefix"
158
158
  fi
@@ -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
@@ -111,8 +111,8 @@ add_devtools() {
111
111
  add_log "${tick:?}" "$tool" "Added $tool $semver"
112
112
  }
113
113
 
114
- # Function to setup the nightly build from shivammathur/php-builder
115
- setup_nightly() {
114
+ # Function to setup PHP from the shivammathur/php-builder builds.
115
+ setup_php_builder() {
116
116
  run_script "php-builder" "${runner:?}" "$version" "${debug:?}" "${ts:?}"
117
117
  }
118
118
 
@@ -186,8 +186,8 @@ update_php() {
186
186
  # Function to install PHP.
187
187
  add_php() {
188
188
  if [ "${runner:?}" = "self-hosted" ] || [ "${use_package_cache:-true}" = "false" ]; then
189
- if [[ "$version" =~ ${nightly_versions:?} ]]; then
190
- setup_nightly
189
+ if [[ "$version" =~ ${nightly_versions:?} || "$ts" = "zts" ]]; then
190
+ setup_php_builder
191
191
  else
192
192
  add_packaged_php
193
193
  switch_version >/dev/null 2>&1
@@ -246,6 +246,7 @@ setup_php() {
246
246
  step_log "Setup PHP"
247
247
  sudo mkdir -m 777 -p /var/run /run/php
248
248
  php_config="$(command -v php-config)"
249
+ check_pre_installed
249
250
  if [[ -z "$php_config" ]] || [ "$(php_semver | cut -c 1-3)" != "$version" ]; then
250
251
  if [ ! -e "/usr/bin/php$version" ] || [ ! -e "/usr/bin/php-config$version" ]; then
251
252
  add_php >/dev/null 2>&1
@@ -289,7 +290,7 @@ setup_php() {
289
290
  }
290
291
 
291
292
  # Variables
292
- version=${1:-'8.3'}
293
+ version=${1:-'8.4'}
293
294
  ini=${2:-'production'}
294
295
  src=${0%/*}/..
295
296
  debconf_fix="DEBIAN_FRONTEND=noninteractive"
@@ -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"
@@ -70,7 +70,6 @@ configure_brew() {
70
70
  core_repo="$tap_dir"/homebrew/homebrew-core
71
71
 
72
72
  export HOMEBREW_CHANGE_ARCH_TO_ARM=1
73
- export HOMEBREW_DEVELOPER=1
74
73
  export HOMEBREW_NO_AUTO_UPDATE=1
75
74
  export HOMEBREW_NO_ENV_HINTS=1
76
75
  export HOMEBREW_NO_INSTALL_CLEANUP=1
@@ -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"
@@ -54,7 +54,7 @@ update_lists() {
54
54
  status_file=/tmp/os_lists
55
55
  if [[ -n "$ppa" && -n "$ppa_search" ]]; then
56
56
  list="$list_dir"/"$(basename "$(grep -lr "$ppa_search" "$list_dir")")"
57
- status_file=/tmp/"${ppa/\//_}"
57
+ status_file=/tmp/"$(echo -n "$ppa_search" | shasum -a 256 | cut -d ' ' -f 1)"
58
58
  elif [ -e "$list_file" ] && grep -Eq '^deb |^Types deb' "$list_file"; then
59
59
  list="$list_file"
60
60
  fi
@@ -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,11 +117,11 @@ 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}
124
- ppa_search="deb .*$ppa_url $package_dist .*$branches"
124
+ ppa_search="deb .*$ppa_url $package_dist .*$branches$"
125
125
  if check_lists "$ppa" "$ppa_search"; then
126
126
  echo "Repository $ppa already exists";
127
127
  return 1;
@@ -139,10 +139,10 @@ add_list() {
139
139
  # Function to check if a PPA exists
140
140
  check_ppa() {
141
141
  ppa=$1
142
- ppa_url=${2:-"$lp_ppa/$ppa/ubuntu"}
142
+ ppa_url=${2:-"$lpc_ppa/$ppa/ubuntu"}
143
143
  package_dist=${3:-"$VERSION_CODENAME"}
144
144
  branches=${4:-main}
145
- ppa_search="deb .*$ppa_url $package_dist .*$branches"
145
+ ppa_search="deb .*$ppa_url $package_dist .*$branches$"
146
146
  if check_lists "$ppa" "$ppa_search"; then
147
147
  return 0;
148
148
  else
@@ -163,7 +163,7 @@ remove_list() {
163
163
  # Function to check if ubuntu ppa is up
164
164
  is_ubuntu_ppa_up() {
165
165
  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
166
+ curl -s --connect-timeout 5 --max-time 5 --head --fail "$lpc_ppa/$ppa/ubuntu/dists/$VERSION_CODENAME/Release" > /dev/null
167
167
  }
168
168
 
169
169
  # Function to add the PPA mirror.
@@ -181,7 +181,7 @@ add_ppa() {
181
181
  ppa=${1:-ondrej/php}
182
182
  if [[ "$ID" = "ubuntu" || "$ID_LIKE" =~ ubuntu ]] && [[ "$ppa" =~ "ondrej/" ]]; then
183
183
  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"
184
+ [ "${debug:?}" = "debug" ] && add_list "$ppa" "$lpc_ppa/$ppa/ubuntu" "$lpc_ppa/$ppa/ubuntu" "$VERSION_CODENAME" "main/debug"
185
185
  add_list "$ppa"
186
186
  else
187
187
  add_ppa_sp_mirror "$ppa"
@@ -201,7 +201,7 @@ add_ppa() {
201
201
  update_ppa() {
202
202
  set_base_version
203
203
  ppa=${1:-ondrej/php}
204
- ppa_url=${2:-"$lp_ppa/$ppa/ubuntu"}
204
+ ppa_url=${2:-"$lpc_ppa/$ppa/ubuntu"}
205
205
  package_dist=${4:-"$VERSION_CODENAME"}
206
206
  branches=${5:-main}
207
207
  ppa_search="deb .*$ppa_url $package_dist .*$branches"
@@ -214,7 +214,10 @@ list_dir='/etc/apt/sources.list.d'
214
214
  list_file="/etc/apt/sources.list.d/$ID.sources"
215
215
  [ -e "$list_file" ] || list_file='/etc/apt/sources.list'
216
216
  upstream_lsb='/etc/upstream-release/lsb-release'
217
- lp_api='https://api.launchpad.net/1.0'
217
+ lp_api=(
218
+ 'https://api.launchpad.net/1.0'
219
+ 'https://api.launchpad.net/devel'
220
+ )
218
221
  lp_ppa='http://ppa.launchpad.net'
219
222
  lpc_ppa='https://ppa.launchpadcontent.net'
220
223
  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