Skip to content

Commit 8b987aa

Browse files
committed
Copy 8.1 extensions to 8.2
1 parent 2001e4b commit 8b987aa

File tree

45 files changed

+473
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+473
-0
lines changed

extensions/8.2/amqp/install.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
export EXTENSION=amqp
5+
6+
../docker-install.sh

extensions/8.2/apcu/install.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
export EXTENSION=apcu
5+
6+
../docker-install.sh

extensions/8.2/ast/install.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
export EXTENSION=ast
5+
6+
../docker-install.sh

extensions/8.2/bcmath/install.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
EXTENSION=bcmath ../docker-install.sh

extensions/8.2/blackfire/install.sh

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
5+
# Install Blackfire
6+
if [[ "${BLACKFIRE_VERSION}" == "" ]]; then
7+
echo "Blackfire version is not set in the environment variables. Exiting!"
8+
exit 1
9+
fi
10+
11+
# Let's make it flexible: for those who want to be safe, the image will be built with v1
12+
# Now if you build the image yourself, you can build it with v2, this way everyone gets happy :)
13+
14+
version=$(php -r "echo PHP_MAJOR_VERSION.PHP_MINOR_VERSION;")
15+
# Probe is the same for v1 and v2
16+
curl -A "Docker" -o /tmp/blackfire-probe.tar.gz -D - -L -s https://blackfire.io/api/v1/releases/probe/php/${TARGETOS}/${TARGETARCH}/$version
17+
mkdir -p /tmp/blackfire
18+
tar zxpf /tmp/blackfire-probe.tar.gz -C /tmp/blackfire
19+
mv /tmp/blackfire/blackfire-*.so $(php -r "echo ini_get ('extension_dir');")/blackfire.so
20+
printf "extension=blackfire.so" > "/etc/php/${PHP_VERSION}/mods-available/blackfire.ini"
21+
rm -rf /tmp/blackfire /tmp/blackfire-probe.tar.gz
22+
23+
if [[ "${BLACKFIRE_VERSION}" == "1" ]]; then
24+
# Cli for v1 require specific version
25+
curl -A "Docker" "https://packages.blackfire.io/binaries/blackfire-agent/1.50.0/blackfire-cli-${TARGETOS}"_"${TARGETARCH}" -o /tmp/blackfire
26+
chmod +x /tmp/blackfire
27+
mv /tmp/blackfire /usr/bin/blackfire
28+
rm -Rf /tmp/blackfire
29+
elif [[ "${BLACKFIRE_VERSION}" == "2" ]]; then
30+
# Cli for v2 is latest version
31+
echo "Installing Blackfire version 2..."
32+
mkdir -p /tmp/blackfire
33+
curl -A "Docker" -L https://blackfire.io/api/v1/releases/cli/linux/${TARGETARCH} | tar zxp -C /tmp/blackfire
34+
if ! /tmp/blackfire/blackfire self:version --no-ansi | grep -qE "version 2\.[0-9]+\.[0-9]+"; then
35+
echo "Blackfire installed is not version 2 : $(/tmp/blackfire/blackfire self:version --no-ansi)"
36+
exit 1
37+
fi
38+
mv /tmp/blackfire/blackfire /usr/bin/blackfire
39+
rm -Rf /tmp/blackfire
40+
else
41+
echo "Blackfire version in environment variable is invalid"
42+
echo "Value: '${BLACKFIRE_VERSION}'"
43+
exit 1
44+
fi
45+
46+
# Let's perform a test
47+
phpenmod -v $PHP_VERSION blackfire
48+
/usr/bin/real_php -m | grep "blackfire"
49+
# Check that there is no output on STDERR when starting php:
50+
OUTPUT=`/usr/bin/real_php -r "echo '';" 2>&1`
51+
[[ "$OUTPUT" == "" ]]
52+
# And now, let's disable it!
53+
phpdismod -v $PHP_VERSION blackfire

extensions/8.2/bz2/install.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
EXTENSION=bz2 ../docker-install.sh

extensions/8.2/dba/install.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
EXTENSION=dba ../docker-install.sh

extensions/8.2/disable_all.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
set -ex
5+
6+
for ext in */; do \
7+
ext_no_slash=${ext%/}
8+
if compgen -G "/etc/php/${PHP_VERSION}/cli/conf.d/*-$ext_no_slash.ini" > /dev/null; then
9+
echo "***************** Disabling $ext_no_slash ******************"
10+
#rm -f /etc/php/${PHP_VERSION}/cli/conf.d/*-$ext_no_slash.ini
11+
phpdismod -v $PHP_VERSION $ext_no_slash
12+
fi
13+
done

extensions/8.2/docker-install.sh

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
#!/usr/bin/env bash
2+
3+
set -ex
4+
5+
if [ -n "$DEV_DEPENDENCIES" ] || [ -n "$DEPENDENCIES" ]; then
6+
apt-get install -y --no-install-recommends $DEV_DEPENDENCIES $DEPENDENCIES
7+
fi
8+
9+
if [ -n "$CONFIGURE_OPTIONS" ]; then
10+
docker-php-ext-configure $EXTENSION $CONFIGURE_OPTIONS
11+
fi
12+
13+
if [ -n "$EXTENSION" ]; then
14+
set +e
15+
PACKAGE_NAME=${PACKAGE_NAME:-$EXTENSION}
16+
if apt-cache search --names-only "php${PHP_VERSION}-$PACKAGE_NAME" | grep "php${PHP_VERSION}-$PACKAGE_NAME"; then
17+
set -e
18+
apt-get install -y --no-install-recommends php${PHP_VERSION}-$PACKAGE_NAME
19+
else
20+
set -e
21+
apt-get install -y --no-install-recommends php-$PACKAGE_NAME
22+
fi
23+
24+
fi
25+
26+
if [ -n "$PECL_EXTENSION" ]; then
27+
# if env ready?
28+
29+
# is phpize installed?
30+
if which pickle && which phpize; then
31+
echo "pickle found"
32+
which pickle
33+
else
34+
apt-get install -y --no-install-recommends build-essential php-pear php${PHP_VERSION}-dev pkg-config
35+
curl https://github.com/FriendsOfPHP/pickle/releases/latest/download/pickle.phar -L -o /usr/local/bin/pickle
36+
chmod +x /usr/local/bin/pickle
37+
fi
38+
39+
if [ -n "$USE_PECL" ]; then
40+
pecl channel-update pecl.php.net && pecl channel-update pear.php.net
41+
pecl install $PECL_EXTENSION
42+
else
43+
pickle install $PECL_EXTENSION
44+
fi
45+
echo "extension=${PHP_EXT_NAME:-${PECL_EXTENSION}}.so" > /etc/php/${PHP_VERSION}/mods-available/${PHP_EXT_NAME:-${PECL_EXTENSION}}.ini
46+
# Adding this in the list of Ubuntu extensions because we use that list as a base for the modules list.
47+
# TODO: question: cannot we use /etc/php/mods-available instead???
48+
touch /var/lib/php/modules/${PHP_VERSION}/registry/${PHP_EXT_NAME:-${PECL_EXTENSION}}
49+
fi
50+
51+
if [ -n "$DEV_DEPENDENCIES" ]; then
52+
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false -o APT::AutoRemove::SuggestsImportant=false $DEV_DEPENDENCIES
53+
fi
54+
55+
if [ -n "$EXTENSION" ]; then
56+
# Let's perform a test
57+
phpenmod -v $PHP_VERSION $EXTENSION
58+
/usr/bin/real_php -m | grep "${PHP_EXT_PHP_NAME:-${PHP_EXT_NAME:-$EXTENSION}}"
59+
# Check that there is no output on STDERR when starting php:
60+
OUTPUT=`/usr/bin/real_php -r "echo '';" 2>&1`
61+
[[ "$OUTPUT" == "" ]]
62+
# And now, let's disable it!
63+
phpdismod -v $PHP_VERSION $EXTENSION
64+
fi
65+
66+
if [ -n "$PECL_EXTENSION" ]; then
67+
# Let's perform a test
68+
PHP_EXTENSIONS="${PHP_EXT_NAME:-$PECL_EXTENSION}" PHP_VERSION="${PHP_VERSION}" /usr/bin/real_php /usr/local/bin/setup_extensions.php | bash
69+
PHP_EXTENSIONS="${PHP_EXT_NAME:-$PECL_EXTENSION}" /usr/bin/real_php /usr/local/bin/generate_conf.php > /etc/php/${PHP_VERSION}/cli/conf.d/testextension.ini
70+
71+
/usr/bin/real_php -m | grep "${PHP_EXT_PHP_NAME:-${PHP_EXT_NAME:-$PECL_EXTENSION}}"
72+
# Check that there is no output on STDERR when starting php:
73+
OUTPUT=`/usr/bin/real_php -r "echo '';" 2>&1`
74+
[[ "$OUTPUT" == "" ]]
75+
PHP_EXTENSIONS="" PHP_VERSION="${PHP_VERSION}" /usr/bin/real_php /usr/local/bin/setup_extensions.php | bash
76+
rm /etc/php/${PHP_VERSION}/cli/conf.d/testextension.ini
77+
fi

extensions/8.2/ds/install.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
EXTENSION=ds ../docker-install.sh

0 commit comments

Comments
 (0)