Skip to content

Commit ff79610

Browse files
authored
Merge pull request #235 from moufmouf/pcovphp8
Enabling pcov again in PHP 8
2 parents fe94fc8 + f3647b8 commit ff79610

File tree

8 files changed

+27
-9
lines changed

8 files changed

+27
-9
lines changed

extensions/8.0/pcov

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../core/pcov

extensions/core/docker-install.sh

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,13 @@ fi
1313

1414
if [ -n "$EXTENSION" ]; then
1515
set +e
16-
if apt-cache search --names-only "php${PHP_VERSION}-$EXTENSION" | grep "php${PHP_VERSION}-$EXTENSION"; then
16+
PACKAGE_NAME=${PACKAGE_NAME:-$EXTENSION}
17+
if apt-cache search --names-only "php${PHP_VERSION}-$PACKAGE_NAME" | grep "php${PHP_VERSION}-$PACKAGE_NAME"; then
1718
set -e
18-
apt-get install -y --no-install-recommends php${PHP_VERSION}-$EXTENSION
19+
apt-get install -y --no-install-recommends php${PHP_VERSION}-$PACKAGE_NAME
1920
else
2021
set -e
21-
apt-get install -y --no-install-recommends php-$EXTENSION
22+
apt-get install -y --no-install-recommends php-$PACKAGE_NAME
2223
fi
2324

2425
fi
@@ -27,14 +28,20 @@ if [ -n "$PECL_EXTENSION" ]; then
2728
# if env ready?
2829

2930
# is phpize installed?
30-
if which pecl && which phpize; then
31-
echo "pecl found"
32-
which pecl
31+
if which pickle && which phpize; then
32+
echo "pickle found"
33+
which pickle
3334
else
3435
apt-get install -y --no-install-recommends build-essential php-pear php${PHP_VERSION}-dev pkg-config
36+
curl https://github.com/FriendsOfPHP/pickle/releases/latest/download/pickle.phar -L -o /usr/local/bin/pickle
37+
chmod +x /usr/local/bin/pickle
3538
fi
3639

37-
pecl install $PECL_EXTENSION
40+
if [ -n "$USE_PECL" ]; then
41+
pecl install $PECL_EXTENSION
42+
else
43+
pickle install $PECL_EXTENSION
44+
fi
3845
echo "extension=${PHP_EXT_NAME:-${PECL_EXTENSION}}.so" > /etc/php/${PHP_VERSION}/mods-available/${PHP_EXT_NAME:-${PECL_EXTENSION}}.ini
3946
# Adding this in the list of Ubuntu extensions because we use that list as a base for the modules list.
4047
# TODO: question: cannot we use /etc/php/mods-available instead???

extensions/core/install_all.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,4 @@ apt-get purge -y php-pear build-essential php${PHP_VERSION}-dev pkg-config
2323
apt-get autoremove -y
2424
apt-get clean
2525
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*
26+
rm -f /usr/local/bin/pickle

extensions/core/mcrypt/install.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
set -e
44
# Comments: MCrypt is deprecated and usage is generally discouraged. Provided here for legacy apps only.
55

6+
export USE_PECL=1
67
export PECL_EXTENSION=mcrypt-1.0.1
78
export PHP_EXT_NAME=mcrypt # name of the extension (to put in PHP_EXTENSIONS variable)
89
export DEV_DEPENDENCIES="libmcrypt-dev"

extensions/core/mysqli/install.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
#!/usr/bin/env bash
22

33
set -e
4-
export EXTENSION=mysql
4+
export EXTENSION=mysqlnd
5+
export PACKAGE_NAME=mysql
56

67
../docker-install.sh
8+
9+
# Exception for this package that enables both mysqlnd and mysqli and pdo_mysql
10+
phpdismod mysqli
11+
phpdismod pdo_mysql

extensions/core/pcov/install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bash
22

33
set -e
4-
export EXTENSION=pcov
4+
export PECL_EXTENSION=pcov
55

66
../docker-install.sh

extensions/core/swoole/install.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@
33
set -e
44
export DEV_DEPENDENCIES="zlib1g-dev"
55
export DEPENDENCIES="zlib1g"
6+
export USE_PECL=1
67
PECL_EXTENSION=swoole ../docker-install.sh

utils/php_proxy.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ sudo chown docker:docker /opt/php_env_var_cache.php
55
REGENERATE=$(/usr/bin/real_php /usr/local/bin/check_php_env_var_changes.php)
66

77
if [[ "$REGENERATE" != "0" ]] && [[ "$REGENERATE" != "1" ]]; then
8+
>&2 echo "Unexpected PHP proxy output:"
9+
>&2 echo $REGENERATE
810
exit 1
911
fi
1012

0 commit comments

Comments
 (0)