mirror of
https://github.com/hoellen/dockerfiles.git
synced 2025-07-01 22:55:39 +00:00
update php to 7.1.5
This commit is contained in:
@ -1,19 +0,0 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
ext="$1"
|
||||
extDir="/usr/src/php/ext/$ext"
|
||||
if [ -z "$ext" ] || ! [ -d "$extDir" ]; then
|
||||
echo >&2 "usage: $0 ext-name [configure flags]"
|
||||
echo >&2 " ie: $0 gd --with-jpeg-dir=/usr/local/something"
|
||||
echo >&2
|
||||
echo >&2 'Possible values for ext-name:'
|
||||
echo >&2 $(find /usr/src/php/ext -mindepth 2 -maxdepth 2 -type f -name 'config.m4' | cut -d/ -f6 | sort)
|
||||
exit 1
|
||||
fi
|
||||
shift
|
||||
|
||||
set -x
|
||||
cd "$extDir"
|
||||
phpize
|
||||
./configure "$@"
|
@ -1,83 +0,0 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
cd "$(php -r 'echo ini_get("extension_dir");')"
|
||||
|
||||
usage() {
|
||||
echo "usage: $0 [options] module-name [module-name ...]"
|
||||
echo " ie: $0 gd mysqli"
|
||||
echo " $0 pdo pdo_mysql"
|
||||
echo " $0 --ini-name 0-apc.ini apcu apc"
|
||||
echo
|
||||
echo 'Possible values for module-name:'
|
||||
echo $(find -maxdepth 1 -type f -name '*.so' -exec basename '{}' ';' | sort)
|
||||
}
|
||||
|
||||
opts="$(getopt -o 'h?' --long 'help,ini-name:' -- "$@" || { usage >&2 && false; })"
|
||||
eval set -- "$opts"
|
||||
|
||||
iniName=
|
||||
while true; do
|
||||
flag="$1"
|
||||
shift
|
||||
case "$flag" in
|
||||
--help|-h|'-?') usage && exit 0 ;;
|
||||
--ini-name) iniName="$1" && shift ;;
|
||||
--) break ;;
|
||||
*)
|
||||
{
|
||||
echo "error: unknown flag: $flag"
|
||||
usage
|
||||
} >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
modules=
|
||||
for module; do
|
||||
if [ -z "$module" ]; then
|
||||
continue
|
||||
fi
|
||||
if [ -f "$module.so" ] && ! [ -f "$module" ]; then
|
||||
# allow ".so" to be optional
|
||||
module="$module.so"
|
||||
fi
|
||||
if ! [ -f "$module" ]; then
|
||||
echo >&2 "error: $(readlink -f "$module") does not exist"
|
||||
echo >&2
|
||||
usage >&2
|
||||
exit 1
|
||||
fi
|
||||
modules="$modules $module"
|
||||
done
|
||||
|
||||
if [ -z "$modules" ]; then
|
||||
usage >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
for module in $modules; do
|
||||
if nm -g "$module" | grep -q ' zend_extension_entry$'; then
|
||||
# https://wiki.php.net/internals/extensions#loading_zend_extensions
|
||||
line="zend_extension=$(readlink -f "$module")"
|
||||
else
|
||||
line="extension=$module"
|
||||
fi
|
||||
|
||||
ext="$(basename "$module")"
|
||||
ext="${ext%.*}"
|
||||
if php -r 'exit(extension_loaded("'"$ext"'") ? 0 : 1);'; then
|
||||
# this isn't perfect, but it's better than nothing
|
||||
# (for example, 'opcache.so' presents inside PHP as 'Zend OPcache', not 'opcache')
|
||||
echo >&2
|
||||
echo >&2 "warning: $ext ($module) is already loaded!"
|
||||
echo >&2
|
||||
continue
|
||||
fi
|
||||
|
||||
ini="/php/conf.d/${iniName:-"docker-php-ext-$ext.ini"}"
|
||||
if ! grep -q "$line" "$ini" 2>/dev/null; then
|
||||
echo "$line" >> "$ini"
|
||||
fi
|
||||
done
|
@ -1,71 +0,0 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
cd /usr/src/php/ext
|
||||
|
||||
usage() {
|
||||
echo "usage: $0 [-jN] ext-name [ext-name ...]"
|
||||
echo " ie: $0 gd mysqli"
|
||||
echo " $0 pdo pdo_mysql"
|
||||
echo " $0 -j5 gd mbstring mysqli pdo pdo_mysql shmop"
|
||||
echo
|
||||
echo 'if custom ./configure arguments are necessary, see docker-php-ext-configure'
|
||||
echo
|
||||
echo 'Possible values for ext-name:'
|
||||
echo $(find /usr/src/php/ext -mindepth 2 -maxdepth 2 -type f -name 'config.m4' | cut -d/ -f6 | sort)
|
||||
}
|
||||
|
||||
opts="$(getopt -o 'h?j:' --long 'help,jobs:' -- "$@" || { usage >&2 && false; })"
|
||||
eval set -- "$opts"
|
||||
|
||||
j=1
|
||||
while true; do
|
||||
flag="$1"
|
||||
shift
|
||||
case "$flag" in
|
||||
--help|-h|'-?') usage && exit 0 ;;
|
||||
--jobs|-j) j="$1" && shift ;;
|
||||
--) break ;;
|
||||
*)
|
||||
{
|
||||
echo "error: unknown flag: $flag"
|
||||
usage
|
||||
} >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
exts=
|
||||
for ext; do
|
||||
if [ -z "$ext" ]; then
|
||||
continue
|
||||
fi
|
||||
if [ ! -d "$ext" ]; then
|
||||
echo >&2 "error: $(pwd -P)/$ext does not exist"
|
||||
echo >&2
|
||||
usage >&2
|
||||
exit 1
|
||||
fi
|
||||
exts="$exts $ext"
|
||||
done
|
||||
|
||||
if [ -z "$exts" ]; then
|
||||
usage >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
for ext in $exts; do
|
||||
(
|
||||
cd "$ext"
|
||||
[ -e Makefile ] || docker-php-ext-configure "$ext"
|
||||
make -j"$j"
|
||||
make -j"$j" install
|
||||
find modules \
|
||||
-maxdepth 1 \
|
||||
-name '*.so' \
|
||||
-exec basename '{}' ';' \
|
||||
| xargs -r docker-php-ext-enable
|
||||
make -j"$j" clean
|
||||
)
|
||||
done
|
Reference in New Issue
Block a user