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.
- package/LICENSE +21 -21
- package/README.md +977 -936
- package/package.json +66 -56
- package/src/config.ts +82 -82
- package/src/configs/brew_extensions +30 -0
- package/src/configs/os_releases.csv +17 -0
- package/src/configs/php-versions.json +6 -5
- package/src/configs/{php.json → pm/php.json} +29 -29
- package/src/configs/{phpunit.json → pm/phpunit.json} +24 -24
- package/src/configs/tools.json +256 -234
- package/src/configs/tools_schema.json +114 -103
- package/src/coverage.ts +169 -142
- package/src/extensions.ts +363 -349
- package/src/install.ts +79 -82
- package/src/scripts/common.sh +366 -314
- package/src/scripts/darwin.sh +257 -248
- package/src/scripts/ext/blackfire.ps1 +32 -32
- package/src/scripts/ext/blackfire.sh +22 -21
- package/src/scripts/ext/couchbase.sh +43 -43
- package/src/scripts/ext/cubrid.sh +60 -60
- package/src/scripts/ext/extension_map.php +109 -0
- package/src/scripts/ext/firebird.ps1 +19 -19
- package/src/scripts/ext/firebird.sh +39 -35
- package/src/scripts/ext/gearman.sh +22 -22
- package/src/scripts/ext/geos.sh +17 -17
- package/src/scripts/ext/http.ps1 +54 -54
- package/src/scripts/ext/http.sh +120 -120
- package/src/scripts/ext/intl.sh +23 -23
- package/src/scripts/ext/ioncube.ps1 +33 -32
- package/src/scripts/ext/ioncube.sh +21 -19
- package/src/scripts/ext/oci.ps1 +60 -60
- package/src/scripts/ext/oci.sh +65 -63
- package/src/scripts/ext/patches/firebird.sh +11 -11
- package/src/scripts/ext/patches/geos.sh +7 -7
- package/src/scripts/ext/patches/http.sh +11 -11
- package/src/scripts/ext/patches/pdo_oci.sh +6 -6
- package/src/scripts/ext/patches/phpize.sh +26 -26
- package/src/scripts/ext/patches/protobuf.sh +4 -4
- package/src/scripts/ext/phalcon.ps1 +54 -55
- package/src/scripts/ext/phalcon.sh +59 -59
- package/src/scripts/ext/source.sh +144 -144
- package/src/scripts/linux.sh +239 -280
- package/src/scripts/tools/add_tools.ps1 +28 -25
- package/src/scripts/tools/add_tools.sh +27 -19
- package/src/scripts/tools/blackfire.ps1 +19 -21
- package/src/scripts/tools/blackfire.sh +40 -35
- package/src/scripts/tools/grpc_php_plugin.ps1 +21 -21
- package/src/scripts/tools/grpc_php_plugin.sh +58 -61
- package/src/scripts/tools/ppa.sh +189 -0
- package/src/scripts/tools/protoc.ps1 +38 -38
- package/src/scripts/tools/protoc.sh +28 -28
- package/src/scripts/win32.ps1 +566 -471
- package/src/tools.ts +538 -509
- package/src/utils.ts +503 -497
- package/.eslintrc.json +0 -16
- package/.github/CODE_OF_CONDUCT.md +0 -76
- package/.github/CONTRIBUTING.md +0 -70
- package/.github/FUNDING.yml +0 -7
- package/.github/ISSUE_TEMPLATE/bug_report.md +0 -42
- package/.github/ISSUE_TEMPLATE/feature_request.md +0 -26
- package/.github/PULL_REQUEST_TEMPLATE.md +0 -37
- package/.github/SECURITY.md +0 -29
- package/.github/workflows/docs.yml +0 -77
- package/.github/workflows/node-workflow.yml +0 -51
- package/.github/workflows/workflow.yml +0 -78
- package/.idea/workspace.xml +0 -113
- package/.prettierrc.json +0 -12
- package/__tests__/config.test.ts +0 -52
- package/__tests__/coverage.test.ts +0 -110
- package/__tests__/extensions.test.ts +0 -261
- package/__tests__/install.test.ts +0 -175
- package/__tests__/tools.test.ts +0 -490
- package/__tests__/utils.test.ts +0 -303
- package/action.yml +0 -29
- package/dist/index.js +0 -3001
- package/examples/bedrock.yml +0 -32
- package/examples/blackfire-player.yml +0 -31
- package/examples/blackfire.yml +0 -31
- package/examples/cakephp-mysql.yml +0 -114
- package/examples/cakephp-postgres.yml +0 -112
- package/examples/cakephp.yml +0 -92
- package/examples/codeigniter.yml +0 -34
- package/examples/laravel-mysql.yml +0 -74
- package/examples/laravel-postgres.yml +0 -74
- package/examples/laravel.yml +0 -42
- package/examples/lumen-mysql.yml +0 -74
- package/examples/lumen-postgres.yml +0 -74
- package/examples/lumen.yml +0 -38
- package/examples/phalcon-mysql.yml +0 -74
- package/examples/phalcon-postgres.yml +0 -73
- package/examples/sage.yml +0 -57
- package/examples/slim-framework.yml +0 -34
- package/examples/symfony-mysql.yml +0 -57
- package/examples/symfony-postgres.yml +0 -55
- package/examples/symfony.yml +0 -39
- package/examples/yii2-mysql.yml +0 -73
- package/examples/yii2-postgres.yml +0 -71
- package/examples/zend-framework.yml +0 -36
- package/jest.config.js +0 -12
- package/lib/config.js +0 -72
- package/lib/config.js.map +0 -1
- package/lib/coverage.js +0 -88
- package/lib/coverage.js.map +0 -1
- package/lib/extensions.js +0 -201
- package/lib/extensions.js.map +0 -1
- package/lib/install.js +0 -82
- package/lib/install.js.map +0 -1
- package/lib/sapi.js +0 -64
- package/lib/tools.js +0 -387
- package/lib/tools.js.map +0 -1
- package/lib/utils.js +0 -292
- package/lib/utils.js.map +0 -1
- package/tsconfig.json +0 -18
|
@@ -1,144 +1,144 @@
|
|
|
1
|
-
# Function to parse extension environment variables
|
|
2
|
-
parse_args() {
|
|
3
|
-
extension=$1
|
|
4
|
-
suffix=$(echo "$2" | tr '[:lower:]' '[:upper:]')
|
|
5
|
-
up_ext_name=$(echo "$extension" | tr '[:lower:]' '[:upper:]')
|
|
6
|
-
var="${extension}_${suffix}"
|
|
7
|
-
up_var="${up_ext_name}_${suffix}"
|
|
8
|
-
! [[ "$suffix" =~ .*PREFIX|LIBS|PATH.* ]] && hyp='-'
|
|
9
|
-
output=$(echo "${!var} ${!up_var}" | sed "s/, *$hyp/ $hyp/g" | sed -E "s/^,|,$//g")
|
|
10
|
-
echo "$output" | xargs -n 1 | sort | uniq | xargs
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
# Function to log if a library is installed
|
|
14
|
-
add_lib_log() {
|
|
15
|
-
lib=$1
|
|
16
|
-
if check_lib "$lib"; then
|
|
17
|
-
add_log "${tick:?}" "$lib" "Installed"
|
|
18
|
-
else
|
|
19
|
-
add_log "${cross:?}" "$lib" "Could not install $lib"
|
|
20
|
-
fi
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
# Function to check if a library is installed
|
|
24
|
-
check_lib() {
|
|
25
|
-
lib=$1
|
|
26
|
-
if [ "$(uname -s)" = "Linux" ]; then
|
|
27
|
-
[ "x$(dpkg -s "$lib" 2>/dev/null | grep Status)" != "x" ]
|
|
28
|
-
else
|
|
29
|
-
[ "x$(find "${brew_prefix:?}"/Cellar -maxdepth 1 -name "$lib")" != "x" ]
|
|
30
|
-
fi
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
# Function to add a library on linux
|
|
34
|
-
add_linux_libs() {
|
|
35
|
-
lib=$1
|
|
36
|
-
if ! check_lib "$lib"; then
|
|
37
|
-
install_packages "$lib" >/dev/null 2>&1 || true
|
|
38
|
-
fi
|
|
39
|
-
add_lib_log "$lib"
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
# Function to add a library on macOS
|
|
43
|
-
add_darwin_libs() {
|
|
44
|
-
lib=$1
|
|
45
|
-
if ! check_lib "$lib"; then
|
|
46
|
-
brew install "$lib" >/dev/null 2>&1 || true
|
|
47
|
-
if [[ "$lib" = *@* ]]; then
|
|
48
|
-
brew link --overwrite --force "$lib" >/dev/null 2>&1 || true
|
|
49
|
-
fi
|
|
50
|
-
fi
|
|
51
|
-
add_lib_log "$lib"
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
# Function to add required libraries
|
|
55
|
-
add_libs() {
|
|
56
|
-
all_libs=("$@")
|
|
57
|
-
for lib in "${all_libs[@]}"; do
|
|
58
|
-
if [ "$(uname -s)" = "Linux" ]; then
|
|
59
|
-
add_linux_libs "$lib"
|
|
60
|
-
else
|
|
61
|
-
add_darwin_libs "$lib"
|
|
62
|
-
fi
|
|
63
|
-
done
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
# Function to run command in a group
|
|
67
|
-
run_group() {
|
|
68
|
-
command=$1
|
|
69
|
-
log=$2
|
|
70
|
-
echo "$command" | sudo tee ./run_group.sh >/dev/null 2>&1
|
|
71
|
-
echo "::group::$log"
|
|
72
|
-
. ./run_group.sh
|
|
73
|
-
rm ./run_group.sh
|
|
74
|
-
echo "::endgroup::"
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
patch_extension() {
|
|
78
|
-
extension=$1
|
|
79
|
-
if [ -e "${scripts:?}"/ext/patches/"$extension".sh ]; then
|
|
80
|
-
# shellcheck source=.
|
|
81
|
-
. "${scripts:?}"/ext/patches/"$extension".sh
|
|
82
|
-
patch_"${extension}"
|
|
83
|
-
fi
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
fetch_extension() {
|
|
87
|
-
fetch=$1
|
|
88
|
-
if [ "$fetch" = "clone" ]; then
|
|
89
|
-
run_group "git clone -nv $url/$org/$repo /tmp/$repo-$release" "git clone"
|
|
90
|
-
cd /tmp/"$repo-$release" || exit 1
|
|
91
|
-
git checkout -q "$release"
|
|
92
|
-
cd "$sub_dir" || exit 1
|
|
93
|
-
if [ -e .gitmodules ]; then
|
|
94
|
-
jobs="$(grep -c "\[submodule" .gitmodules)"
|
|
95
|
-
run_group "git submodule update --jobs $jobs --init --recursive" "git submodule"
|
|
96
|
-
fi
|
|
97
|
-
elif [ "$fetch" = "get" ]; then
|
|
98
|
-
get -q -n /tmp/"$extension".tar.gz "$url/$org/$repo/archive/$release.tar.gz"
|
|
99
|
-
tar -xzf /tmp/"$extension".tar.gz -C /tmp
|
|
100
|
-
cd /tmp/"$repo"-"$release"/"$sub_dir" || exit
|
|
101
|
-
elif [ "$fetch" = "pecl" ]; then
|
|
102
|
-
source="pecl"
|
|
103
|
-
pecl_name=${extension/http/pecl_http}
|
|
104
|
-
get -q -n /tmp/"$pecl_name".tgz https://pecl.php.net/get/"$pecl_name"-"$release".tgz
|
|
105
|
-
tar -xzf /tmp/"$pecl_name".tgz -C /tmp
|
|
106
|
-
cd /tmp/"$pecl_name"-"$release" || exit
|
|
107
|
-
fi
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
# Function to install extension from a git repository
|
|
111
|
-
add_extension_from_source() {
|
|
112
|
-
extension="${1/pecl_/}"
|
|
113
|
-
url=$2
|
|
114
|
-
org=$3
|
|
115
|
-
repo=$4
|
|
116
|
-
release=$5
|
|
117
|
-
prefix=$6
|
|
118
|
-
fetch=${7:-clone}
|
|
119
|
-
slug="$extension-$release"
|
|
120
|
-
source="$url/$org/$repo"
|
|
121
|
-
libraries="$(parse_args "$extension" LIBS) $(parse_args "$extension" "$(uname -s)"_LIBS)"
|
|
122
|
-
opts="$(parse_args "$extension" CONFIGURE_OPTS)"
|
|
123
|
-
prefix_opts="$(parse_args "$extension" CONFIGURE_PREFIX_OPTS)"
|
|
124
|
-
suffix_opts="$(parse_args "$extension" CONFIGURE_SUFFIX_OPTS)"
|
|
125
|
-
sub_dir="$(parse_args "$extension" PATH)"
|
|
126
|
-
step_log "Setup $slug"
|
|
127
|
-
(
|
|
128
|
-
add_devtools phpize >/dev/null 2>&1
|
|
129
|
-
|
|
130
|
-
fetch_extension "$fetch"
|
|
131
|
-
if ! [ "$(find . -maxdepth 1 -name '*.m4' -exec grep -H 'PHP_NEW_EXTENSION' {} \; | wc -l)" != "0" ]; then
|
|
132
|
-
add_log "${cross:?}" "$source" "$source does not have a PHP extension"
|
|
133
|
-
else
|
|
134
|
-
[[ -n "${libraries// }" ]] && run_group "add_libs $libraries" "add libraries"
|
|
135
|
-
patch_extension "$extension" >/dev/null 2>&1
|
|
136
|
-
run_group "phpize" "phpize"
|
|
137
|
-
run_group "sudo $prefix_opts ./configure $suffix_opts $opts" "configure"
|
|
138
|
-
run_group "sudo make -j$(nproc 2>/dev/null || sysctl -n hw.ncpu)" "make"
|
|
139
|
-
run_group "sudo make install" "make install"
|
|
140
|
-
enable_extension "$extension" "$prefix"
|
|
141
|
-
fi
|
|
142
|
-
)
|
|
143
|
-
add_extension_log "$slug" "Installed from $source and enabled"
|
|
144
|
-
}
|
|
1
|
+
# Function to parse extension environment variables
|
|
2
|
+
parse_args() {
|
|
3
|
+
extension=$1
|
|
4
|
+
suffix=$(echo "$2" | tr '[:lower:]' '[:upper:]')
|
|
5
|
+
up_ext_name=$(echo "$extension" | tr '[:lower:]' '[:upper:]')
|
|
6
|
+
var="${extension}_${suffix}"
|
|
7
|
+
up_var="${up_ext_name}_${suffix}"
|
|
8
|
+
! [[ "$suffix" =~ .*PREFIX|LIBS|PATH.* ]] && hyp='-'
|
|
9
|
+
output=$(echo "${!var} ${!up_var}" | sed "s/, *$hyp/ $hyp/g" | sed -E "s/^,|,$//g")
|
|
10
|
+
echo "$output" | xargs -n 1 | sort | uniq | xargs
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
# Function to log if a library is installed
|
|
14
|
+
add_lib_log() {
|
|
15
|
+
lib=$1
|
|
16
|
+
if check_lib "$lib"; then
|
|
17
|
+
add_log "${tick:?}" "$lib" "Installed"
|
|
18
|
+
else
|
|
19
|
+
add_log "${cross:?}" "$lib" "Could not install $lib"
|
|
20
|
+
fi
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
# Function to check if a library is installed
|
|
24
|
+
check_lib() {
|
|
25
|
+
lib=$1
|
|
26
|
+
if [ "$(uname -s)" = "Linux" ]; then
|
|
27
|
+
[ "x$(dpkg -s "$lib" 2>/dev/null | grep Status)" != "x" ]
|
|
28
|
+
else
|
|
29
|
+
[ "x$(find "${brew_prefix:?}"/Cellar -maxdepth 1 -name "$lib")" != "x" ]
|
|
30
|
+
fi
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
# Function to add a library on linux
|
|
34
|
+
add_linux_libs() {
|
|
35
|
+
lib=$1
|
|
36
|
+
if ! check_lib "$lib"; then
|
|
37
|
+
install_packages "$lib" >/dev/null 2>&1 || true
|
|
38
|
+
fi
|
|
39
|
+
add_lib_log "$lib"
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
# Function to add a library on macOS
|
|
43
|
+
add_darwin_libs() {
|
|
44
|
+
lib=$1
|
|
45
|
+
if ! check_lib "$lib"; then
|
|
46
|
+
brew install "$lib" >/dev/null 2>&1 || true
|
|
47
|
+
if [[ "$lib" = *@* ]]; then
|
|
48
|
+
brew link --overwrite --force "$lib" >/dev/null 2>&1 || true
|
|
49
|
+
fi
|
|
50
|
+
fi
|
|
51
|
+
add_lib_log "$lib"
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
# Function to add required libraries
|
|
55
|
+
add_libs() {
|
|
56
|
+
all_libs=("$@")
|
|
57
|
+
for lib in "${all_libs[@]}"; do
|
|
58
|
+
if [ "$(uname -s)" = "Linux" ]; then
|
|
59
|
+
add_linux_libs "$lib"
|
|
60
|
+
else
|
|
61
|
+
add_darwin_libs "$lib"
|
|
62
|
+
fi
|
|
63
|
+
done
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
# Function to run command in a group
|
|
67
|
+
run_group() {
|
|
68
|
+
command=$1
|
|
69
|
+
log=$2
|
|
70
|
+
echo "$command" | sudo tee ./run_group.sh >/dev/null 2>&1
|
|
71
|
+
echo "::group::$log"
|
|
72
|
+
. ./run_group.sh
|
|
73
|
+
rm ./run_group.sh
|
|
74
|
+
echo "::endgroup::"
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
patch_extension() {
|
|
78
|
+
extension=$1
|
|
79
|
+
if [ -e "${scripts:?}"/ext/patches/"$extension".sh ]; then
|
|
80
|
+
# shellcheck source=.
|
|
81
|
+
. "${scripts:?}"/ext/patches/"$extension".sh
|
|
82
|
+
patch_"${extension}"
|
|
83
|
+
fi
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
fetch_extension() {
|
|
87
|
+
fetch=$1
|
|
88
|
+
if [ "$fetch" = "clone" ]; then
|
|
89
|
+
run_group "git clone -nv $url/$org/$repo /tmp/$repo-$release" "git clone"
|
|
90
|
+
cd /tmp/"$repo-$release" || exit 1
|
|
91
|
+
git checkout -q "$release"
|
|
92
|
+
cd "$sub_dir" || exit 1
|
|
93
|
+
if [ -e .gitmodules ]; then
|
|
94
|
+
jobs="$(grep -c "\[submodule" .gitmodules)"
|
|
95
|
+
run_group "git submodule update --jobs $jobs --init --recursive" "git submodule"
|
|
96
|
+
fi
|
|
97
|
+
elif [ "$fetch" = "get" ]; then
|
|
98
|
+
get -q -n /tmp/"$extension".tar.gz "$url/$org/$repo/archive/$release.tar.gz"
|
|
99
|
+
tar -xzf /tmp/"$extension".tar.gz -C /tmp
|
|
100
|
+
cd /tmp/"$repo"-"$release"/"$sub_dir" || exit
|
|
101
|
+
elif [ "$fetch" = "pecl" ]; then
|
|
102
|
+
source="pecl"
|
|
103
|
+
pecl_name=${extension/http/pecl_http}
|
|
104
|
+
get -q -n /tmp/"$pecl_name".tgz https://pecl.php.net/get/"$pecl_name"-"$release".tgz
|
|
105
|
+
tar -xzf /tmp/"$pecl_name".tgz -C /tmp
|
|
106
|
+
cd /tmp/"$pecl_name"-"$release" || exit
|
|
107
|
+
fi
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
# Function to install extension from a git repository
|
|
111
|
+
add_extension_from_source() {
|
|
112
|
+
extension="${1/pecl_/}"
|
|
113
|
+
url=$2
|
|
114
|
+
org=$3
|
|
115
|
+
repo=$4
|
|
116
|
+
release=$5
|
|
117
|
+
prefix=$6
|
|
118
|
+
fetch=${7:-clone}
|
|
119
|
+
slug="$extension-$release"
|
|
120
|
+
source="$url/$org/$repo"
|
|
121
|
+
libraries="$(parse_args "$extension" LIBS) $(parse_args "$extension" "$(uname -s)"_LIBS)"
|
|
122
|
+
opts="$(parse_args "$extension" CONFIGURE_OPTS)"
|
|
123
|
+
prefix_opts="$(parse_args "$extension" CONFIGURE_PREFIX_OPTS)"
|
|
124
|
+
suffix_opts="$(parse_args "$extension" CONFIGURE_SUFFIX_OPTS)"
|
|
125
|
+
sub_dir="$(parse_args "$extension" PATH)"
|
|
126
|
+
step_log "Setup $slug"
|
|
127
|
+
(
|
|
128
|
+
add_devtools phpize >/dev/null 2>&1
|
|
129
|
+
disable_extension_helper "$extension"
|
|
130
|
+
fetch_extension "$fetch"
|
|
131
|
+
if ! [ "$(find . -maxdepth 1 -name '*.m4' -exec grep -H 'PHP_NEW_EXTENSION' {} \; | wc -l)" != "0" ]; then
|
|
132
|
+
add_log "${cross:?}" "$source" "$source does not have a PHP extension"
|
|
133
|
+
else
|
|
134
|
+
[[ -n "${libraries// }" ]] && run_group "add_libs $libraries" "add libraries"
|
|
135
|
+
patch_extension "$extension" >/dev/null 2>&1
|
|
136
|
+
run_group "phpize" "phpize"
|
|
137
|
+
run_group "sudo $prefix_opts ./configure $suffix_opts $opts" "configure"
|
|
138
|
+
run_group "sudo make -j$(nproc 2>/dev/null || sysctl -n hw.ncpu)" "make"
|
|
139
|
+
run_group "sudo make install" "make install"
|
|
140
|
+
enable_extension "$extension" "$prefix"
|
|
141
|
+
fi
|
|
142
|
+
)
|
|
143
|
+
add_extension_log "$slug" "Installed from $source and enabled"
|
|
144
|
+
}
|