setup-php 2.12.0 → 2.16.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 (113) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +977 -936
  3. package/package.json +66 -56
  4. package/src/config.ts +82 -82
  5. package/src/configs/brew_extensions +30 -0
  6. package/src/configs/os_releases.csv +17 -0
  7. package/src/configs/php-versions.json +6 -5
  8. package/src/configs/{php.json → pm/php.json} +29 -29
  9. package/src/configs/{phpunit.json → pm/phpunit.json} +24 -24
  10. package/src/configs/tools.json +256 -234
  11. package/src/configs/tools_schema.json +114 -103
  12. package/src/coverage.ts +169 -142
  13. package/src/extensions.ts +363 -349
  14. package/src/install.ts +79 -82
  15. package/src/scripts/common.sh +366 -314
  16. package/src/scripts/darwin.sh +257 -248
  17. package/src/scripts/ext/blackfire.ps1 +32 -32
  18. package/src/scripts/ext/blackfire.sh +22 -21
  19. package/src/scripts/ext/couchbase.sh +43 -43
  20. package/src/scripts/ext/cubrid.sh +60 -60
  21. package/src/scripts/ext/extension_map.php +109 -0
  22. package/src/scripts/ext/firebird.ps1 +19 -19
  23. package/src/scripts/ext/firebird.sh +39 -35
  24. package/src/scripts/ext/gearman.sh +22 -22
  25. package/src/scripts/ext/geos.sh +17 -17
  26. package/src/scripts/ext/http.ps1 +54 -54
  27. package/src/scripts/ext/http.sh +120 -120
  28. package/src/scripts/ext/intl.sh +23 -23
  29. package/src/scripts/ext/ioncube.ps1 +33 -32
  30. package/src/scripts/ext/ioncube.sh +21 -19
  31. package/src/scripts/ext/oci.ps1 +60 -60
  32. package/src/scripts/ext/oci.sh +65 -63
  33. package/src/scripts/ext/patches/firebird.sh +11 -11
  34. package/src/scripts/ext/patches/geos.sh +7 -7
  35. package/src/scripts/ext/patches/http.sh +11 -11
  36. package/src/scripts/ext/patches/pdo_oci.sh +6 -6
  37. package/src/scripts/ext/patches/phpize.sh +26 -26
  38. package/src/scripts/ext/patches/protobuf.sh +4 -4
  39. package/src/scripts/ext/phalcon.ps1 +54 -55
  40. package/src/scripts/ext/phalcon.sh +59 -59
  41. package/src/scripts/ext/source.sh +144 -144
  42. package/src/scripts/linux.sh +239 -280
  43. package/src/scripts/tools/add_tools.ps1 +28 -25
  44. package/src/scripts/tools/add_tools.sh +27 -19
  45. package/src/scripts/tools/blackfire.ps1 +19 -21
  46. package/src/scripts/tools/blackfire.sh +40 -35
  47. package/src/scripts/tools/grpc_php_plugin.ps1 +21 -21
  48. package/src/scripts/tools/grpc_php_plugin.sh +58 -61
  49. package/src/scripts/tools/ppa.sh +189 -0
  50. package/src/scripts/tools/protoc.ps1 +38 -38
  51. package/src/scripts/tools/protoc.sh +28 -28
  52. package/src/scripts/win32.ps1 +566 -471
  53. package/src/tools.ts +538 -509
  54. package/src/utils.ts +503 -497
  55. package/.eslintrc.json +0 -16
  56. package/.github/CODE_OF_CONDUCT.md +0 -76
  57. package/.github/CONTRIBUTING.md +0 -70
  58. package/.github/FUNDING.yml +0 -7
  59. package/.github/ISSUE_TEMPLATE/bug_report.md +0 -42
  60. package/.github/ISSUE_TEMPLATE/feature_request.md +0 -26
  61. package/.github/PULL_REQUEST_TEMPLATE.md +0 -37
  62. package/.github/SECURITY.md +0 -29
  63. package/.github/workflows/docs.yml +0 -77
  64. package/.github/workflows/node-workflow.yml +0 -51
  65. package/.github/workflows/workflow.yml +0 -78
  66. package/.idea/workspace.xml +0 -113
  67. package/.prettierrc.json +0 -12
  68. package/__tests__/config.test.ts +0 -52
  69. package/__tests__/coverage.test.ts +0 -110
  70. package/__tests__/extensions.test.ts +0 -261
  71. package/__tests__/install.test.ts +0 -175
  72. package/__tests__/tools.test.ts +0 -490
  73. package/__tests__/utils.test.ts +0 -303
  74. package/action.yml +0 -29
  75. package/dist/index.js +0 -3001
  76. package/examples/bedrock.yml +0 -32
  77. package/examples/blackfire-player.yml +0 -31
  78. package/examples/blackfire.yml +0 -31
  79. package/examples/cakephp-mysql.yml +0 -114
  80. package/examples/cakephp-postgres.yml +0 -112
  81. package/examples/cakephp.yml +0 -92
  82. package/examples/codeigniter.yml +0 -34
  83. package/examples/laravel-mysql.yml +0 -74
  84. package/examples/laravel-postgres.yml +0 -74
  85. package/examples/laravel.yml +0 -42
  86. package/examples/lumen-mysql.yml +0 -74
  87. package/examples/lumen-postgres.yml +0 -74
  88. package/examples/lumen.yml +0 -38
  89. package/examples/phalcon-mysql.yml +0 -74
  90. package/examples/phalcon-postgres.yml +0 -73
  91. package/examples/sage.yml +0 -57
  92. package/examples/slim-framework.yml +0 -34
  93. package/examples/symfony-mysql.yml +0 -57
  94. package/examples/symfony-postgres.yml +0 -55
  95. package/examples/symfony.yml +0 -39
  96. package/examples/yii2-mysql.yml +0 -73
  97. package/examples/yii2-postgres.yml +0 -71
  98. package/examples/zend-framework.yml +0 -36
  99. package/jest.config.js +0 -12
  100. package/lib/config.js +0 -72
  101. package/lib/config.js.map +0 -1
  102. package/lib/coverage.js +0 -88
  103. package/lib/coverage.js.map +0 -1
  104. package/lib/extensions.js +0 -201
  105. package/lib/extensions.js.map +0 -1
  106. package/lib/install.js +0 -82
  107. package/lib/install.js.map +0 -1
  108. package/lib/sapi.js +0 -64
  109. package/lib/tools.js +0 -387
  110. package/lib/tools.js.map +0 -1
  111. package/lib/utils.js +0 -292
  112. package/lib/utils.js.map +0 -1
  113. package/tsconfig.json +0 -18
@@ -1,120 +1,120 @@
1
- # Function to get http version for a PHP version.
2
- get_http_version() {
3
- if [[ ${version:?} =~ 5.[3-6] ]]; then
4
- echo "pecl_http-2.6.0"
5
- elif [[ ${version:?} =~ 7.[0-4] ]]; then
6
- echo "pecl_http-3.2.4"
7
- else
8
- echo "pecl_http-$(get_pecl_version "pecl_http" "stable")"
9
- fi
10
- }
11
-
12
- # Function to enable http extension.
13
- enable_http() {
14
- enable_extension propro extension
15
- enable_extension raphf extension
16
- if (! [[ ${version:?} =~ ${jit_versions:?} ]] && check_extension propro && check_extension raphf) ||
17
- ( [[ ${version:?} =~ ${jit_versions:?} ]] && check_extension raphf); then
18
- enable_extension http extension
19
- fi
20
- }
21
-
22
- # Function to install extensions.
23
- add_extension_helper() {
24
- if [ "$os" = "Linux" ]; then
25
- add_extension "$1" extension
26
- else
27
- add_brew_extension "$1" extension
28
- fi
29
- }
30
-
31
- # Function to install http dependencies.
32
- add_http_dependencies() {
33
- if [[ ${version:?} =~ ${old_versions:?} ]]; then
34
- add_pecl_extension raphf 1.1.2 extension
35
- add_pecl_extension propro 1.0.2 extension
36
- elif [[ ${version:?} =~ 5.6|7.[0-4] ]]; then
37
- add_extension_helper propro
38
- add_extension_helper raphf
39
- else
40
- add_extension_helper raphf
41
- fi
42
- }
43
-
44
- # Function to get configure options for http.
45
- get_http_configure_opts() {
46
- if [ "$os" = 'Linux' ]; then
47
- for lib in zlib libbrotli libcurl libevent libicu libidn2 libidn libidnkit2 libidnkit; do
48
- http_opts+=( "--with-http-$lib-dir=/usr" )
49
- done
50
- else
51
- http_opts+=( "--with-http-zlib-dir=$(xcrun --show-sdk-path)/usr" )
52
- http_opts+=( "--with-http-libbrotli-dir=$(brew --prefix brotli)" )
53
- http_opts+=( "--with-http-libcurl-dir=$(brew --prefix curl)" )
54
- http_opts+=( "--with-http-libicu-dir=$(brew --prefix icu4c)" )
55
- http_opts+=( "--with-http-libevent-dir=$(brew --prefix libevent)" )
56
- http_opts+=( "--with-http-libidn2-dir=$(brew --prefix libidn2)" )
57
- fi
58
- }
59
-
60
- # Compile and install http explicitly.
61
- # This is done as pecl compiles raphf and propro as well.
62
- add_http_helper() {
63
- ext=$1
64
- http_opts=() && get_http_configure_opts
65
- export HTTP_PREFIX_CONFIGURE_OPTS="CFLAGS=-Wno-implicit-function-declaration"
66
- http_configure_opts="--with-http --with-php-config=$(command -v php-config) ${http_opts[*]}"
67
- export HTTP_CONFIGURE_OPTS="$http_configure_opts"
68
- export HTTP_LINUX_LIBS="zlib1g libbrotli-dev libcurl4-openssl-dev libevent-dev libicu-dev libidn2-dev"
69
- export HTTP_DARWIN_LIBS="brotli curl icu4c libevent libidn2"
70
- if [[ "${version:?}" =~ ${nightly_versions:?} ]]; then
71
- add_extension_from_source http https://github.com m6w6 ext-http master extension
72
- else
73
- add_extension_from_source pecl_http https://pecl.php.net http http "${ext##*-}" extension pecl
74
- fi
75
- }
76
-
77
- # Function to setup latest http extension.
78
- add_http_latest() {
79
- enable_http
80
- if ! check_extension http; then
81
- add_http_dependencies
82
- if [ "$os" = "Linux" ]; then
83
- if ! [[ "${version:?}" =~ ${old_versions:?}|${nightly_versions:?} ]]; then
84
- install_packages "php$version-http"
85
- else
86
- add_http_helper "$(get_http_version)" "$os"
87
- fi
88
- else
89
- if ! [[ "${version:?}" =~ ${old_versions:?} ]]; then
90
- add_brew_extension pecl_http extension
91
- fi
92
- fi
93
- status="Installed and enabled"
94
- fi
95
- }
96
-
97
- # Function to setup http extension given a version.
98
- add_http_version() {
99
- ext=$1
100
- enable_http
101
- if [ "x$(php -r "echo phpversion('http');")" != "x${ext##*-}" ]; then
102
- remove_extension http >/dev/null
103
- add_http_helper pecl_http-"${ext##*-}" "$os"
104
- status="Installed and enabled"
105
- fi
106
- }
107
-
108
- # Function to setup http extension
109
- add_http() {
110
- ext=$1
111
- status="Enabled"
112
- if [[ "$ext" =~ ^(pecl_http|http)$ ]]; then
113
- add_http_latest >/dev/null 2>&1
114
- else
115
- add_http_version "$ext" >/dev/null 2>&1
116
- fi
117
- add_extension_log "http" "$status"
118
- }
119
-
120
- os="$(uname -s)"
1
+ # Function to get http version for a PHP version.
2
+ get_http_version() {
3
+ if [[ ${version:?} =~ 5.[3-6] ]]; then
4
+ echo "pecl_http-2.6.0"
5
+ elif [[ ${version:?} =~ 7.[0-4] ]]; then
6
+ echo "pecl_http-3.2.4"
7
+ else
8
+ echo "pecl_http-$(get_pecl_version "pecl_http" "stable")"
9
+ fi
10
+ }
11
+
12
+ # Function to enable http extension.
13
+ enable_http() {
14
+ enable_extension propro extension
15
+ enable_extension raphf extension
16
+ if (! [[ ${version:?} =~ ${jit_versions:?} ]] && check_extension propro && check_extension raphf) ||
17
+ ( [[ ${version:?} =~ ${jit_versions:?} ]] && check_extension raphf); then
18
+ enable_extension http extension
19
+ fi
20
+ }
21
+
22
+ # Function to install extensions.
23
+ add_extension_helper() {
24
+ if [ "$os" = "Linux" ]; then
25
+ add_extension "$1" extension
26
+ else
27
+ add_brew_extension "$1" extension
28
+ fi
29
+ }
30
+
31
+ # Function to install http dependencies.
32
+ add_http_dependencies() {
33
+ if [[ ${version:?} =~ ${old_versions:?} ]]; then
34
+ add_pecl_extension raphf 1.1.2 extension
35
+ add_pecl_extension propro 1.0.2 extension
36
+ elif [[ ${version:?} =~ 5.6|7.[0-4] ]]; then
37
+ add_extension_helper propro
38
+ add_extension_helper raphf
39
+ else
40
+ add_extension_helper raphf
41
+ fi
42
+ }
43
+
44
+ # Function to get configure options for http.
45
+ get_http_configure_opts() {
46
+ if [ "$os" = 'Linux' ]; then
47
+ for lib in zlib libbrotli libcurl libevent libicu libidn2 libidn libidnkit2 libidnkit; do
48
+ http_opts+=( "--with-http-$lib-dir=/usr" )
49
+ done
50
+ else
51
+ http_opts+=( "--with-http-zlib-dir=$(xcrun --show-sdk-path)/usr" )
52
+ http_opts+=( "--with-http-libbrotli-dir=$(brew --prefix brotli)" )
53
+ http_opts+=( "--with-http-libcurl-dir=$(brew --prefix curl)" )
54
+ http_opts+=( "--with-http-libicu-dir=$(brew --prefix icu4c)" )
55
+ http_opts+=( "--with-http-libevent-dir=$(brew --prefix libevent)" )
56
+ http_opts+=( "--with-http-libidn2-dir=$(brew --prefix libidn2)" )
57
+ fi
58
+ }
59
+
60
+ # Compile and install http explicitly.
61
+ # This is done as pecl compiles raphf and propro as well.
62
+ add_http_helper() {
63
+ ext=$1
64
+ http_opts=() && get_http_configure_opts
65
+ export HTTP_PREFIX_CONFIGURE_OPTS="CFLAGS=-Wno-implicit-function-declaration"
66
+ http_configure_opts="--with-http --with-php-config=$(command -v php-config) ${http_opts[*]}"
67
+ export HTTP_CONFIGURE_OPTS="$http_configure_opts"
68
+ export HTTP_LINUX_LIBS="zlib1g libbrotli-dev libcurl4-openssl-dev libevent-dev libicu-dev libidn2-dev"
69
+ export HTTP_DARWIN_LIBS="brotli curl icu4c libevent libidn2"
70
+ if [[ "${version:?}" =~ ${nightly_versions:?} ]]; then
71
+ add_extension_from_source http https://github.com m6w6 ext-http master extension
72
+ else
73
+ add_extension_from_source pecl_http https://pecl.php.net http http "${ext##*-}" extension pecl
74
+ fi
75
+ }
76
+
77
+ # Function to setup latest http extension.
78
+ add_http_latest() {
79
+ enable_http
80
+ if ! check_extension http; then
81
+ add_http_dependencies
82
+ if [ "$os" = "Linux" ]; then
83
+ if ! [[ "${version:?}" =~ ${old_versions:?}|${nightly_versions:?} ]]; then
84
+ install_packages "php$version-http"
85
+ else
86
+ add_http_helper "$(get_http_version)" "$os"
87
+ fi
88
+ else
89
+ if ! [[ "${version:?}" =~ ${old_versions:?} ]]; then
90
+ add_brew_extension pecl_http extension
91
+ fi
92
+ fi
93
+ status="Installed and enabled"
94
+ fi
95
+ }
96
+
97
+ # Function to setup http extension given a version.
98
+ add_http_version() {
99
+ ext=$1
100
+ enable_http
101
+ if [ "x$(php -r "echo phpversion('http');")" != "x${ext##*-}" ]; then
102
+ disable_extension_helper http >/dev/null
103
+ add_http_helper pecl_http-"${ext##*-}" "$os"
104
+ status="Installed and enabled"
105
+ fi
106
+ }
107
+
108
+ # Function to setup http extension
109
+ add_http() {
110
+ ext=$1
111
+ status="Enabled"
112
+ if [[ "$ext" =~ ^(pecl_http|http)$ ]]; then
113
+ add_http_latest >/dev/null 2>&1
114
+ else
115
+ add_http_version "$ext" >/dev/null 2>&1
116
+ fi
117
+ add_extension_log "http" "$status"
118
+ }
119
+
120
+ os="$(uname -s)"
@@ -1,23 +1,23 @@
1
- # Function to install ICU
2
- install_icu() {
3
- icu=$1
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"
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/
8
- fi
9
- }
10
-
11
- # Function to add ext-intl with the given version of ICU
12
- add_intl() {
13
- icu=$(echo "$1" | cut -d'-' -f 2)
14
- supported_version=$(get -s -n "" https://api.github.com/repos/shivammathur/icu-intl/releases | grep -Po "${icu//./\\.}" | head -n 1)
15
- if [ "$icu" != "$supported_version" ]; then
16
- add_log "${cross:?}" "intl" "ICU $icu is not supported"
17
- else
18
- install_icu "$icu" >/dev/null 2>&1
19
- get -q -n "${ext_dir:?}/intl.so" "https://github.com/shivammathur/icu-intl/releases/download/intl/php${version:?}-intl-$icu.so"
20
- enable_extension intl extension
21
- add_extension_log intl "Installed and enabled with ICU $icu"
22
- fi
23
- }
1
+ # Function to install ICU
2
+ install_icu() {
3
+ icu=$1
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"
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/
8
+ fi
9
+ }
10
+
11
+ # Function to add ext-intl with the given version of ICU
12
+ add_intl() {
13
+ icu=$(echo "$1" | cut -d'-' -f 2)
14
+ supported_version=$(get -s -n "" https://api.github.com/repos/shivammathur/icu-intl/releases | grep -Po "${icu//./\\.}" | head -n 1)
15
+ if [ "$icu" != "$supported_version" ]; then
16
+ add_log "${cross:?}" "intl" "ICU $icu is not supported"
17
+ else
18
+ install_icu "$icu" >/dev/null 2>&1
19
+ get -q -n "${ext_dir:?}/intl.so" "https://github.com/shivammathur/icu-intl/releases/download/intl/php${version:?}-intl-$icu.so"
20
+ enable_extension intl extension
21
+ add_extension_log intl "Installed and enabled with ICU $icu"
22
+ fi
23
+ }
@@ -1,32 +1,33 @@
1
- # Function to log result of a operation.
2
- Function Add-LicenseLog() {
3
- printf "::group::\033[34;1m%s \033[0m\033[90;1m%s \033[0m\n" "ioncube" "Click to read the ioncube loader license information"
4
- Get-Content $ext_dir\ioncube\LICENSE.txt
5
- Write-Output "::endgroup::"
6
- }
7
-
8
- # Function to add ioncube extension.
9
- Function Add-Ioncube() {
10
- try {
11
- if (-not(Test-Path $ext_dir\php_ioncube.dll)) {
12
- $status = 'Installed and enabled'
13
- $arch_part = $arch
14
- if ($arch -eq 'x64') {
15
- $arch_part = 'x86-64'
16
- }
17
- $vc = $installed.VCVersion
18
- $ts_part = ""
19
- if (-not($installed.ThreadSafe)) {
20
- $ts_part = "_nonts"
21
- }
22
- Invoke-WebRequest -Uri "https://downloads.ioncube.com/loader_downloads/ioncube_loaders_win$ts_part`_vc$vc`_$arch_part.zip" -OutFile $ext_dir\ioncube.zip
23
- Expand-Archive -Path $ext_dir\ioncube.zip -DestinationPath $ext_dir -Force
24
- Copy-Item $ext_dir\ioncube\ioncube_loader_win_$version.dll $ext_dir\php_ioncube.dll
25
- }
26
- "zend_extension=$ext_dir\php_ioncube.dll`r`n" + (Get-Content $php_dir\php.ini -Raw) | Set-Content $php_dir\php.ini
27
- Add-Log $tick "ioncube" $status
28
- Add-LicenseLog
29
- } catch {
30
- Add-Log $cross "ioncube" "Could not install ioncube on PHP $($installed.FullVersion)"
31
- }
32
- }
1
+ # Function to log result of a operation.
2
+ Function Add-LicenseLog() {
3
+ printf "::group::\033[34;1m%s \033[0m\033[90;1m%s \033[0m\n" "ioncube" "Click to read the ioncube loader license information"
4
+ Get-Content $ext_dir\ioncube\LICENSE.txt
5
+ Write-Output "::endgroup::"
6
+ }
7
+
8
+ # Function to add ioncube extension.
9
+ Function Add-Ioncube() {
10
+ try {
11
+ $status = 'Enabled'
12
+ if (-not(Test-Path $ext_dir\php_ioncube.dll)) {
13
+ $status = 'Installed and enabled'
14
+ $arch_part = $arch
15
+ if ($arch -eq 'x64') {
16
+ $arch_part = 'x86-64'
17
+ }
18
+ $vc = $installed.VCVersion
19
+ $ts_part = ""
20
+ if (-not($installed.ThreadSafe)) {
21
+ $ts_part = "_nonts"
22
+ }
23
+ Invoke-WebRequest -Uri "https://downloads.ioncube.com/loader_downloads/ioncube_loaders_win$ts_part`_vc$vc`_$arch_part.zip" -OutFile $ext_dir\ioncube.zip
24
+ Expand-Archive -Path $ext_dir\ioncube.zip -DestinationPath $ext_dir -Force
25
+ Copy-Item $ext_dir\ioncube\ioncube_loader_win_$version.dll $ext_dir\php_ioncube.dll
26
+ }
27
+ "zend_extension=$ext_dir\php_ioncube.dll`r`n" + (Get-Content $php_dir\php.ini -Raw) | Set-Content $php_dir\php.ini
28
+ Add-Log $tick "ioncube" $status
29
+ Add-LicenseLog
30
+ } catch {
31
+ Add-Log $cross "ioncube" "Could not install ioncube on PHP $($installed.FullVersion)"
32
+ }
33
+ }
@@ -1,19 +1,21 @@
1
- # Function to log result of a operation.
2
- add_license_log() {
3
- printf "::group::\033[34;1m%s \033[0m\033[90;1m%s \033[0m\n" "ioncube" "Click to read the ioncube loader license information"
4
- cat /tmp/ioncube/LICENSE.txt
5
- echo "::endgroup::"
6
- }
7
-
8
- # Function to install ioncube.
9
- add_ioncube() {
10
- if [ ! -e "${ext_dir:?}/ioncube.so" ]; then
11
- status='Installed and enabled'
12
- os_name='lin' && [ "$(uname -s)" = "Darwin" ] && os_name='mac'
13
- get -s -n "" https://downloads.ioncube.com/loader_downloads/ioncube_loaders_"$os_name"_x86-64.tar.gz | tar -xzf - -C /tmp
14
- sudo mv /tmp/ioncube/ioncube_loader_"$os_name"_"${version:?}".so "$ext_dir/ioncube.so"
15
- fi
16
- echo "zend_extension=$ext_dir/ioncube.so" | sudo tee "${scan_dir:?}/00-ioncube.ini" >/dev/null 2>&1
17
- add_extension_log "ioncube" "$status"
18
- check_extension "ioncube" && add_license_log
19
- }
1
+ # Function to log result of a operation.
2
+ add_license_log() {
3
+ printf "::group::\033[34;1m%s \033[0m\033[90;1m%s \033[0m\n" "ioncube" "Click to read the ioncube loader license information"
4
+ cat "${ext_dir:?}"/IONCUBE_LICENSE.txt
5
+ echo "::endgroup::"
6
+ }
7
+
8
+ # Function to install ioncube.
9
+ add_ioncube() {
10
+ status='Enabled'
11
+ if ! shared_extension ioncube; then
12
+ status='Installed and enabled'
13
+ os_name='lin' && [ "$(uname -s)" = "Darwin" ] && os_name='mac'
14
+ get -s -n "" https://downloads.ioncube.com/loader_downloads/ioncube_loaders_"$os_name"_x86-64.tar.gz | tar -xzf - -C /tmp
15
+ sudo mv /tmp/ioncube/ioncube_loader_"$os_name"_"${version:?}".so "${ext_dir:?}/ioncube.so"
16
+ sudo cp /tmp/ioncube/LICENSE.txt "$ext_dir"/IONCUBE_LICENSE.txt
17
+ fi
18
+ echo "zend_extension=$ext_dir/ioncube.so" | sudo tee "${scan_dir:?}/00-ioncube.ini" >/dev/null 2>&1
19
+ add_extension_log "ioncube" "$status"
20
+ check_extension "ioncube" && add_license_log
21
+ }
@@ -1,60 +1,60 @@
1
- # Function to log license information.
2
- Function Add-LicenseLog() {
3
- printf "::group::\033[34;1m%s \033[0m\033[90;1m%s \033[0m\n" $extension "Click to read the $extension related license information"
4
- printf "Oracle Instant Client package is required for %s extension.\n" $extension
5
- printf "It is provided under the Oracle Technology Network Development and Distribution License.\n"
6
- printf "Refer to: \033[35;1m%s \033[0m\n" "https://www.oracle.com/downloads/licenses/instant-client-lic.html"
7
- Write-Output "::endgroup::"
8
- }
9
-
10
- # Function to get instantclinet.
11
- Function Add-InstantClient() {
12
- if (-not(Test-Path $php_dir\oci.dll)) {
13
- $suffix = 'windows'
14
- if ($arch -eq 'x86') {
15
- $suffix = 'nt'
16
- }
17
- Invoke-WebRequest -Uri https://download.oracle.com/otn_software/nt/instantclient/instantclient-basiclite-$suffix.zip -OutFile $php_dir\instantclient.zip
18
- Expand-Archive -Path $php_dir\instantclient.zip -DestinationPath $php_dir -Force
19
- Copy-Item $php_dir\instantclient*\* $php_dir
20
- }
21
- }
22
-
23
- # Function to install oci8 and pdo_oci.
24
- Function Add-Oci() {
25
- Param (
26
- [Parameter(Position = 0, Mandatory = $true)]
27
- [ValidateNotNull()]
28
- [ValidateSet('oci8', 'pdo_oci')]
29
- [string]
30
- $extension
31
- )
32
- try {
33
- $status = 'Enabled'
34
- Add-InstantClient
35
- if ($extension -eq "pdo_oci") {
36
- Enable-PhpExtension pdo_oci -Path $php_dir
37
- } else {
38
- if(-not(Test-Path $ext_dir\php_oci8.dll)) {
39
- $status = 'Installed and enabled'
40
- $ociVersion = Get-PeclPackageVersion oci8 -MinimumStability stable -MaximumStability stable | Select-Object -First 1
41
- if ($version -eq '7.0') {
42
- $ociVersion = '2.1.8'
43
- } elseif ($version -lt '7.0') {
44
- $ociVersion = '2.0.12'
45
- } elseif ($version -lt '8.0') {
46
- $ociVersion = '2.2.0'
47
- }
48
- $ociUrl = Get-PeclArchiveUrl oci8 $ociVersion $installed
49
- Invoke-WebRequest -Uri $ociUrl -OutFile $php_dir\oci8.zip
50
- Expand-Archive -Path $php_dir\oci8.zip -DestinationPath $ext_dir -Force
51
-
52
- }
53
- Add-Content -Value "`r`nextension=php_oci8.dll" -Path $php_dir\php.ini
54
- }
55
- Add-Log $tick $extension $status
56
- Add-LicenseLog
57
- } catch {
58
- Add-Log $cross $extension "Could not install $extension on PHP $( $installed.FullVersion )"
59
- }
60
- }
1
+ # Function to log license information.
2
+ Function Add-LicenseLog() {
3
+ printf "::group::\033[34;1m%s \033[0m\033[90;1m%s \033[0m\n" $extension "Click to read the $extension related license information"
4
+ printf "Oracle Instant Client package is required for %s extension.\n" $extension
5
+ printf "It is provided under the Oracle Technology Network Development and Distribution License.\n"
6
+ printf "Refer to: \033[35;1m%s \033[0m\n" "https://www.oracle.com/downloads/licenses/instant-client-lic.html"
7
+ Write-Output "::endgroup::"
8
+ }
9
+
10
+ # Function to get instantclinet.
11
+ Function Add-InstantClient() {
12
+ if (-not(Test-Path $php_dir\oci.dll)) {
13
+ $suffix = 'windows'
14
+ if ($arch -eq 'x86') {
15
+ $suffix = 'nt'
16
+ }
17
+ Invoke-WebRequest -Uri https://download.oracle.com/otn_software/nt/instantclient/instantclient-basiclite-$suffix.zip -OutFile $php_dir\instantclient.zip
18
+ Expand-Archive -Path $php_dir\instantclient.zip -DestinationPath $php_dir -Force
19
+ Copy-Item $php_dir\instantclient*\* $php_dir
20
+ }
21
+ }
22
+
23
+ # Function to install oci8 and pdo_oci.
24
+ Function Add-Oci() {
25
+ Param (
26
+ [Parameter(Position = 0, Mandatory = $true)]
27
+ [ValidateNotNull()]
28
+ [ValidateSet('oci8', 'pdo_oci')]
29
+ [string]
30
+ $extension
31
+ )
32
+ try {
33
+ $status = 'Enabled'
34
+ Add-InstantClient
35
+ if ($extension -eq "pdo_oci") {
36
+ Enable-PhpExtension pdo_oci -Path $php_dir
37
+ } else {
38
+ if(-not(Test-Path $ext_dir\php_oci8.dll)) {
39
+ $status = 'Installed and enabled'
40
+ $ociVersion = Get-PeclPackageVersion oci8 -MinimumStability stable -MaximumStability stable | Select-Object -First 1
41
+ if ($version -eq '7.0') {
42
+ $ociVersion = '2.1.8'
43
+ } elseif ($version -lt '7.0') {
44
+ $ociVersion = '2.0.12'
45
+ } elseif ($version -lt '8.0') {
46
+ $ociVersion = '2.2.0'
47
+ }
48
+ $ociUrl = Get-PeclArchiveUrl oci8 $ociVersion $installed
49
+ Invoke-WebRequest -Uri $ociUrl -OutFile $php_dir\oci8.zip
50
+ Expand-Archive -Path $php_dir\oci8.zip -DestinationPath $ext_dir -Force
51
+
52
+ }
53
+ Add-Content -Value "`r`nextension=php_oci8.dll" -Path $php_dir\php.ini
54
+ }
55
+ Add-Log $tick $extension $status
56
+ Add-LicenseLog
57
+ } catch {
58
+ Add-Log $cross $extension "Could not install $extension on PHP $( $installed.FullVersion )"
59
+ }
60
+ }
@@ -1,63 +1,65 @@
1
- # Function to log result of a operation.
2
- add_license_log() {
3
- printf "::group::\033[34;1m%s \033[0m\033[90;1m%s \033[0m\n" "$ext" "Click to read the $ext related license information"
4
- printf "Oracle Instant Client package is required for %s extension.\n" "$ext"
5
- printf "It is provided under the Oracle Technology Network Development and Distribution License.\n"
6
- printf "Refer to: \033[35;1m%s \033[0m\n" "https://www.oracle.com/downloads/licenses/instant-client-lic.html"
7
- echo "::endgroup::"
8
- }
9
-
10
- # Function to install instantclient and SDK.
11
- add_client() {
12
- if [ ! -e "$oracle_client" ]; then
13
- sudo mkdir -p -m 777 "$oracle_home" "$oracle_client"
14
- for package in basiclite sdk; do
15
- if [ "$os" = 'Linux' ]; then
16
- libs='/usr/lib/'
17
- os_name='linux'
18
- arch='linuxx64'
19
- lib_ext='so'
20
- elif [ "$os" = 'Darwin' ]; then
21
- libs='/usr/local/lib/'
22
- os_name='mac'
23
- arch='macos'
24
- lib_ext='dylib'
25
- 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"
28
- done
29
- for icdir in /opt/oracle/instantclient_*; do
30
- sudo mv "$icdir"/* "$oracle_client"/
31
- done
32
- sudo ln -sf /opt/oracle/instantclient/*.$lib_ext* $libs
33
- fi
34
- }
35
-
36
- # Function to install oci8 and pdo_oci.
37
- add_oci_helper() {
38
- if ! [ -e "${ext_dir:?}/$ext.so" ]; then
39
- status='Installed and enabled'
40
- read -r "${ext}_LINUX_LIBS" <<< "libaio-dev"
41
- read -r "${ext}_CONFIGURE_OPTS" <<< "--with-php-config=$(command -v php-config) --with-${ext/_/-}=instantclient,$oracle_client"
42
- read -r "${ext}_PATH" <<< "ext/$ext"
43
- patch_phpize
44
- add_extension_from_source "$ext" https://github.com php php-src "$(php_src_tag)" extension get
45
- restore_phpize
46
- fi
47
- }
48
-
49
- # Function to add oci extension oci8 and pdo_oci.
50
- add_oci() {
51
- ext=$1
52
- status='Enabled'
53
- oracle_home='/opt/oracle'
54
- oracle_client=$oracle_home/instantclient
55
- os=$(uname -s)
56
- add_client >/dev/null 2>&1
57
- add_oci_helper >/dev/null 2>&1
58
- add_extension_log "$ext" "$status"
59
- check_extension "$ext" && add_license_log
60
- }
61
-
62
- # shellcheck source=.
63
- . "${scripts:?}"/ext/patches/phpize.sh
1
+ # Function to log result of a operation.
2
+ add_license_log() {
3
+ printf "::group::\033[34;1m%s \033[0m\033[90;1m%s \033[0m\n" "$ext" "Click to read the $ext related license information"
4
+ printf "Oracle Instant Client package is required for %s extension.\n" "$ext"
5
+ printf "It is provided under the Oracle Technology Network Development and Distribution License.\n"
6
+ printf "Refer to: \033[35;1m%s \033[0m\n" "https://www.oracle.com/downloads/licenses/instant-client-lic.html"
7
+ echo "::endgroup::"
8
+ }
9
+
10
+ # Function to install instantclient and SDK.
11
+ add_client() {
12
+ if [ ! -e "$oracle_client" ]; then
13
+ sudo mkdir -p -m 777 "$oracle_home" "$oracle_client"
14
+ for package in basiclite sdk; do
15
+ if [ "$os" = 'Linux' ]; then
16
+ libs='/usr/lib/'
17
+ os_name='linux'
18
+ arch='linuxx64'
19
+ lib_ext='so'
20
+ elif [ "$os" = 'Darwin' ]; then
21
+ libs='/usr/local/lib/'
22
+ os_name='mac'
23
+ arch='macos'
24
+ lib_ext='dylib'
25
+ 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"
28
+ done
29
+ for icdir in /opt/oracle/instantclient_*; do
30
+ sudo mv "$icdir"/* "$oracle_client"/
31
+ done
32
+ sudo ln -sf /opt/oracle/instantclient/*.$lib_ext* $libs
33
+ fi
34
+ }
35
+
36
+ # Function to install oci8 and pdo_oci.
37
+ add_oci_helper() {
38
+ if ! shared_extension "$ext"; then
39
+ status='Installed and enabled'
40
+ read -r "${ext}_LINUX_LIBS" <<< "libaio-dev"
41
+ read -r "${ext}_CONFIGURE_OPTS" <<< "--with-php-config=$(command -v php-config) --with-${ext/_/-}=instantclient,$oracle_client"
42
+ read -r "${ext}_PATH" <<< "ext/$ext"
43
+ patch_phpize
44
+ add_extension_from_source "$ext" https://github.com php php-src "$(php_src_tag)" extension get
45
+ restore_phpize
46
+ else
47
+ enable_extension "$ext" extension
48
+ fi
49
+ }
50
+
51
+ # Function to add oci extension oci8 and pdo_oci.
52
+ add_oci() {
53
+ ext=$1
54
+ status='Enabled'
55
+ oracle_home='/opt/oracle'
56
+ oracle_client=$oracle_home/instantclient
57
+ os=$(uname -s)
58
+ add_client >/dev/null 2>&1
59
+ add_oci_helper >/dev/null 2>&1
60
+ add_extension_log "$ext" "$status"
61
+ check_extension "$ext" && add_license_log
62
+ }
63
+
64
+ # shellcheck source=.
65
+ . "${scripts:?}"/ext/patches/phpize.sh