Skip to content

Commit 3269ba7

Browse files
committed
[compile_php_exts.sh] Add ability to lock compiled commit
Signed-off-by: Jack Cherng <[email protected]>
1 parent 21721ee commit 3269ba7

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

general/web_server/compile_php_exts.sh

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,13 @@ declare -A PHP_EXTS_CMD=(
3737
["ssh2"]="git clone https://github.com/php/pecl-networking-ssh2.git ssh2"
3838
["swoole"]="git clone https://github.com/swoole/swoole-src.git swoole"
3939
["swoole-async-ext"]="git clone https://github.com/swoole/async-ext.git swoole-async-ext"
40-
["xxhash"]="git clone https://github.com/Megasaxon/php-xxhash.git --single-branch --branch develop xxhash"
40+
["xxhash"]="git clone https://github.com/Megasaxon/php-xxhash.git xxhash"
41+
)
42+
43+
# checkout repo to a specific commit before compilation
44+
declare -A PHP_EXTS_CHECKOUT=(
45+
["swoole"]="v4.3.1"
46+
["xxhash"]="origin/develop"
4147
)
4248

4349
declare -A PHP_EXTS_CONFIG=(
@@ -129,6 +135,12 @@ for PHP_EXT_NAME in "${!PHP_EXTS_CMD[@]}"; do
129135
git submodule update --init
130136
git submodule foreach --recursive git pull
131137

138+
# checkout a specific commit
139+
commit=${PHP_EXTS_CHECKOUT[${PHP_EXT_NAME}]}
140+
if [ "${commit}" != "" ]; then
141+
git checkout -f "${commit}"
142+
fi
143+
132144
for PHP_BASE_DIR in "${PHP_BASE_DIRS[@]}"; do
133145
# paths
134146
phpize="${PHP_BASE_DIR}/bin/phpize"

0 commit comments

Comments
 (0)