Merge pull request #102 from mlocati/php5.5

Start adding support for PHP 5.5
pull/103/head
Michele Locati 2020-01-31 16:29:31 +01:00 committed by GitHub
commit 5c1a92ca95
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 32 additions and 14 deletions

View File

@ -6,7 +6,7 @@ This repository contains a script that can be used to easily install a PHP exten
The script will install all the required APT/APK packages; at the end of the script execution, the no-more needed packages will be removed so that the image will be much smaller.
The script works both for Alpine and Debian Linux.
Supported docker images are all the Alpine/Debian versions, except for PHP 5.5 where we only support Debian 8 (jessie) (that is, `php:5.5`, `php:5.5-apache`, `php:5.5-cli`, `php:5.5-fpm`, `php:5.5-zts`)
## Usage

View File

@ -1,14 +1,14 @@
amqp 5.6 7.0 7.1 7.2 7.3 7.4
apcu 5.6 7.0 7.1 7.2 7.3 7.4
bcmath 5.6 7.0 7.1 7.2 7.3 7.4
bz2 5.6 7.0 7.1 7.2 7.3 7.4
calendar 5.6 7.0 7.1 7.2 7.3 7.4
amqp 5.5 5.6 7.0 7.1 7.2 7.3 7.4
apcu 5.5 5.6 7.0 7.1 7.2 7.3 7.4
bcmath 5.5 5.6 7.0 7.1 7.2 7.3 7.4
bz2 5.5 5.6 7.0 7.1 7.2 7.3 7.4
calendar 5.5 5.6 7.0 7.1 7.2 7.3 7.4
cmark 7.0 7.1 7.2 7.3 7.4
dba 5.6 7.0 7.1 7.2 7.3 7.4
enchant 5.6 7.0 7.1 7.2 7.3 7.4
exif 5.6 7.0 7.1 7.2 7.3 7.4
gd 5.6 7.0 7.1 7.2 7.3 7.4
gettext 5.6 7.0 7.1 7.2 7.3 7.4
dba 5.5 5.6 7.0 7.1 7.2 7.3 7.4
enchant 5.5 5.6 7.0 7.1 7.2 7.3 7.4
exif 5.5 5.6 7.0 7.1 7.2 7.3 7.4
gd 5.5 5.6 7.0 7.1 7.2 7.3 7.4
gettext 5.5 5.6 7.0 7.1 7.2 7.3 7.4
gmagick 5.6 7.0 7.1 7.2 7.3 7.4
gmp 5.6 7.0 7.1 7.2 7.3 7.4
grpc 5.6 7.0 7.1 7.2 7.3 7.4

View File

@ -645,6 +645,7 @@ buildRequiredPackageLists() {
;;
debian)
DEBIAN_FRONTEND=noninteractive apt-get update -q
DEBIAN_FRONTEND=noninteractive apt-get upgrade -qqy
;;
esac
if test -n "$buildRequiredPackageLists_persistent"; then
@ -1324,7 +1325,7 @@ mkdir -p /tmp/src
IPE_ERRFLAG_FILE="$(mktemp -p /tmp/src)"
PHP_MAJMIN_VERSION=$(getPHPMajorMinor)
case "$PHP_MAJMIN_VERSION" in
506 | 700 | 701 | 702 | 703 | 704) ;;
505 | 506 | 700 | 701 | 702 | 703 | 704) ;;
*)
printf "### ERROR: Unsupported PHP version: %s.%s ###\n" $((PHP_MAJMIN_VERSION / 100)) $((PHP_MAJMIN_VERSION % 100))
;;

View File

@ -37,11 +37,20 @@ try {
throw new Exception("{$saveFuntion}() function is missing");
}
$tempFile = tempnam(sys_get_temp_dir(), 'dpei');
ob_start();
if ($saveFuntion($image, $tempFile) === false) {
throw new Exception("{$saveFuntion}() failed");
}
if (!is_file($tempFile) || filesize($tempFile) < 1) {
throw new Exception("{$saveFuntion}() created an empty file");
$contents = ob_get_contents();
ob_end_clean();
if (!is_file($tempFile)) {
throw new Exception("{$saveFuntion}() didn't create a file");
}
if (filesize($tempFile) < 1) {
if ($format !== 'xbm' || PHP_VERSION_ID >= 50600 || $contents === '') {
throw new Exception("{$saveFuntion}() created an empty file");
}
file_put_contents($tempFile, $contents);
}
$image2 = $loadFuntion($tempFile);
unlink($tempFile);

View File

@ -39,6 +39,14 @@ getDockerImageName() {
done
fi
getDockerImageName_imageName="$(printf 'php:%s-%s-%s' "$getDockerImageName_version" "$getDockerImageName_suffix" "$DOCKER_DISTRO")"
case "$getDockerImageName_imageName" in
php:5.5-cli-jessie)
getDockerImageName_imageName='php:5.5-cli'
;;
php:5.5-zts-jessie)
getDockerImageName_imageName='php:5.5-zts'
;;
esac
if test -z "$(docker images -q "$getDockerImageName_imageName" 2>/dev/null)"; then
getDockerImageName_log="$(docker pull "$getDockerImageName_imageName" 2>&1 || true)"
if test -z "$(docker images -q "$getDockerImageName_imageName" 2>/dev/null)"; then