Skip to content

Commit

Permalink
Add installation instructions for pecl-extensions
Browse files Browse the repository at this point in the history
Otherwise those extensions would not be installed correctly on PHP8.3

Signed-off-by: Andreas Heigl <[email protected]>
  • Loading branch information
heiglandreas committed Nov 22, 2023
1 parent c79c218 commit 069d9a6
Show file tree
Hide file tree
Showing 5 changed files with 82 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .laminas-ci/install-apcu-extension-via-pecl.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

PHP_VERSION="$1"

if ! [[ "${PHP_VERSION}" =~ 8\.3 ]]; then
echo "mongodb is only installed from pecl for PHP 8.3, ${PHP_VERSION} detected."
exit 0;
fi

set +e
apt install make

pecl install mongodb
echo "extension=mongodb.so" > /etc/php/${PHP_VERSION}/mods-available/mongodb.ini
phpenmod -v ${PHP} -s cli mongodb
15 changes: 15 additions & 0 deletions .laminas-ci/install-memcached-extension-via-pecl.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

PHP_VERSION="$1"

if ! [[ "${PHP_VERSION}" =~ 8\.3 ]]; then
echo "memcached is only installed from pecl for PHP 8.3, ${PHP_VERSION} detected."
exit 0;
fi

set +e
apt install make

pecl install memcached
echo "extension=memcached.so" > /etc/php/${PHP_VERSION}/mods-available/memcached.ini
phpenmod -v ${PHP} -s cli memcached
15 changes: 15 additions & 0 deletions .laminas-ci/install-mongodb-extension-via-pecl.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

PHP_VERSION="$1"

if ! [[ "${PHP_VERSION}" =~ 8\.3 ]]; then
echo "mongodb is only installed from pecl for PHP 8.3, ${PHP_VERSION} detected."
exit 0;
fi

set +e
apt install make

pecl install mongodb
echo "extension=mongodb.so" > /etc/php/${PHP_VERSION}/mods-available/mongodb.ini
phpenmod -v ${PHP} -s cli mongodb
15 changes: 15 additions & 0 deletions .laminas-ci/install-redis-extension-via-pecl.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

PHP_VERSION="$1"

if ! [[ "${PHP_VERSION}" =~ 8\.3 ]]; then
echo "redis is only installed from pecl for PHP 8.3, ${PHP_VERSION} detected."
exit 0;
fi

set +e
apt install make

pecl install redis
echo "extension=redis.so" > /etc/php/${PHP_VERSION}/mods-available/redis.ini
phpenmod -v ${PHP} -s cli redis
22 changes: 22 additions & 0 deletions .laminas-ci/pre-install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash

WORKING_DIRECTORY=$2
JOB=$3
PHP_VERSION=$(echo "${JOB}" | jq -r '.php')


if [ ! -z "$GITHUB_BASE_REF" ] && [[ "$GITHUB_BASE_REF" =~ ^[0-9]+\.[0-9] ]]; then
readarray -td. TARGET_BRANCH_VERSION_PARTS <<<"${GITHUB_BASE_REF}.";
unset 'TARGET_BRANCH_VERSION_PARTS[-1]';
declare -a TARGET_BRANCH_VERSION_PARTS
MAJOR_OF_TARGET_BRANCH=${TARGET_BRANCH_VERSION_PARTS[0]}
MINOR_OF_TARGET_BRANCH=${TARGET_BRANCH_VERSION_PARTS[1]}

export COMPOSER_ROOT_VERISON="${MAJOR_OF_TARGET_BRANCH}.${MINOR_OF_TARGET_BRANCH}.99"
echo "Exported COMPOSER_ROOT_VERISON as ${COMPOSER_ROOT_VERISON}"
fi

${WORKING_DIRECTORY}/.laminas-ci/install-mongodb-extension-via-pecl.sh "${PHP_VERSION}" || exit 1
${WORKING_DIRECTORY}/.laminas-ci/install-apcu-extension-via-pecl.sh "${PHP_VERSION}" || exit 1
${WORKING_DIRECTORY}/.laminas-ci/install-memcached-extension-via-pecl.sh "${PHP_VERSION}" || exit 1
${WORKING_DIRECTORY}/.laminas-ci/install-redis-extension-via-pecl.sh "${PHP_VERSION}" || exit 1

0 comments on commit 069d9a6

Please sign in to comment.