Skip to content

Commit 6f12272

Browse files
authored
Merge pull request #1021 from infosiftr/ini-name
Add `ini-name` to ext-install to pass along to ext-enable
2 parents a3cf31c + a041c42 commit 6f12272

File tree

78 files changed

+546
-156
lines changed

Some content is hidden

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

78 files changed

+546
-156
lines changed

7.2/alpine3.10/cli/docker-php-ext-enable

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,15 @@ for module in $modules; do
103103
continue
104104
fi
105105

106-
ini="$PHP_INI_DIR/conf.d/${iniName:-"docker-php-ext-$ext.ini"}"
106+
case "$iniName" in
107+
/*)
108+
# allow an absolute path
109+
ini="$iniName"
110+
;;
111+
*)
112+
ini="$PHP_INI_DIR/conf.d/${iniName:-"docker-php-ext-$ext.ini"}"
113+
;;
114+
esac
107115
if ! grep -q "$line" "$ini" 2>/dev/null; then
108116
echo "$line" >> "$ini"
109117
fi

7.2/alpine3.10/cli/docker-php-ext-install

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ fi
1919
cd /usr/src/php/ext
2020

2121
usage() {
22-
echo "usage: $0 [-jN] ext-name [ext-name ...]"
22+
echo "usage: $0 [-jN] [--ini-name file.ini] ext-name [ext-name ...]"
2323
echo " ie: $0 gd mysqli"
2424
echo " $0 pdo pdo_mysql"
2525
echo " $0 -j5 gd mbstring mysqli pdo pdo_mysql shmop"
@@ -41,15 +41,17 @@ usage() {
4141
echo 'the output of "php -i" to see which modules are already loaded.'
4242
}
4343

44-
opts="$(getopt -o 'h?j:' --long 'help,jobs:' -- "$@" || { usage >&2 && false; })"
44+
opts="$(getopt -o 'h?j:' --long 'help,ini-name:,jobs:' -- "$@" || { usage >&2 && false; })"
4545
eval set -- "$opts"
4646

4747
j=1
48+
iniName=
4849
while true; do
4950
flag="$1"
5051
shift
5152
case "$flag" in
5253
--help|-h|'-?') usage && exit 0 ;;
54+
--ini-name) iniName="$1" && shift ;;
5355
--jobs|-j) j="$1" && shift ;;
5456
--) break ;;
5557
*)
@@ -108,7 +110,7 @@ for ext in $exts; do
108110
-maxdepth 1 \
109111
-name '*.so' \
110112
-exec basename '{}' ';' \
111-
| xargs -r docker-php-ext-enable
113+
| xargs -r docker-php-ext-enable ${iniName:+--ini-name "$iniName"}
112114
make -j"$j" clean
113115
cd "$popDir"
114116
done

7.2/alpine3.10/fpm/docker-php-ext-enable

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,15 @@ for module in $modules; do
103103
continue
104104
fi
105105

106-
ini="$PHP_INI_DIR/conf.d/${iniName:-"docker-php-ext-$ext.ini"}"
106+
case "$iniName" in
107+
/*)
108+
# allow an absolute path
109+
ini="$iniName"
110+
;;
111+
*)
112+
ini="$PHP_INI_DIR/conf.d/${iniName:-"docker-php-ext-$ext.ini"}"
113+
;;
114+
esac
107115
if ! grep -q "$line" "$ini" 2>/dev/null; then
108116
echo "$line" >> "$ini"
109117
fi

7.2/alpine3.10/fpm/docker-php-ext-install

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ fi
1919
cd /usr/src/php/ext
2020

2121
usage() {
22-
echo "usage: $0 [-jN] ext-name [ext-name ...]"
22+
echo "usage: $0 [-jN] [--ini-name file.ini] ext-name [ext-name ...]"
2323
echo " ie: $0 gd mysqli"
2424
echo " $0 pdo pdo_mysql"
2525
echo " $0 -j5 gd mbstring mysqli pdo pdo_mysql shmop"
@@ -41,15 +41,17 @@ usage() {
4141
echo 'the output of "php -i" to see which modules are already loaded.'
4242
}
4343

44-
opts="$(getopt -o 'h?j:' --long 'help,jobs:' -- "$@" || { usage >&2 && false; })"
44+
opts="$(getopt -o 'h?j:' --long 'help,ini-name:,jobs:' -- "$@" || { usage >&2 && false; })"
4545
eval set -- "$opts"
4646

4747
j=1
48+
iniName=
4849
while true; do
4950
flag="$1"
5051
shift
5152
case "$flag" in
5253
--help|-h|'-?') usage && exit 0 ;;
54+
--ini-name) iniName="$1" && shift ;;
5355
--jobs|-j) j="$1" && shift ;;
5456
--) break ;;
5557
*)
@@ -108,7 +110,7 @@ for ext in $exts; do
108110
-maxdepth 1 \
109111
-name '*.so' \
110112
-exec basename '{}' ';' \
111-
| xargs -r docker-php-ext-enable
113+
| xargs -r docker-php-ext-enable ${iniName:+--ini-name "$iniName"}
112114
make -j"$j" clean
113115
cd "$popDir"
114116
done

7.2/alpine3.10/zts/docker-php-ext-enable

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,15 @@ for module in $modules; do
103103
continue
104104
fi
105105

106-
ini="$PHP_INI_DIR/conf.d/${iniName:-"docker-php-ext-$ext.ini"}"
106+
case "$iniName" in
107+
/*)
108+
# allow an absolute path
109+
ini="$iniName"
110+
;;
111+
*)
112+
ini="$PHP_INI_DIR/conf.d/${iniName:-"docker-php-ext-$ext.ini"}"
113+
;;
114+
esac
107115
if ! grep -q "$line" "$ini" 2>/dev/null; then
108116
echo "$line" >> "$ini"
109117
fi

7.2/alpine3.10/zts/docker-php-ext-install

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ fi
1919
cd /usr/src/php/ext
2020

2121
usage() {
22-
echo "usage: $0 [-jN] ext-name [ext-name ...]"
22+
echo "usage: $0 [-jN] [--ini-name file.ini] ext-name [ext-name ...]"
2323
echo " ie: $0 gd mysqli"
2424
echo " $0 pdo pdo_mysql"
2525
echo " $0 -j5 gd mbstring mysqli pdo pdo_mysql shmop"
@@ -41,15 +41,17 @@ usage() {
4141
echo 'the output of "php -i" to see which modules are already loaded.'
4242
}
4343

44-
opts="$(getopt -o 'h?j:' --long 'help,jobs:' -- "$@" || { usage >&2 && false; })"
44+
opts="$(getopt -o 'h?j:' --long 'help,ini-name:,jobs:' -- "$@" || { usage >&2 && false; })"
4545
eval set -- "$opts"
4646

4747
j=1
48+
iniName=
4849
while true; do
4950
flag="$1"
5051
shift
5152
case "$flag" in
5253
--help|-h|'-?') usage && exit 0 ;;
54+
--ini-name) iniName="$1" && shift ;;
5355
--jobs|-j) j="$1" && shift ;;
5456
--) break ;;
5557
*)
@@ -108,7 +110,7 @@ for ext in $exts; do
108110
-maxdepth 1 \
109111
-name '*.so' \
110112
-exec basename '{}' ';' \
111-
| xargs -r docker-php-ext-enable
113+
| xargs -r docker-php-ext-enable ${iniName:+--ini-name "$iniName"}
112114
make -j"$j" clean
113115
cd "$popDir"
114116
done

7.2/alpine3.11/cli/docker-php-ext-enable

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,15 @@ for module in $modules; do
103103
continue
104104
fi
105105

106-
ini="$PHP_INI_DIR/conf.d/${iniName:-"docker-php-ext-$ext.ini"}"
106+
case "$iniName" in
107+
/*)
108+
# allow an absolute path
109+
ini="$iniName"
110+
;;
111+
*)
112+
ini="$PHP_INI_DIR/conf.d/${iniName:-"docker-php-ext-$ext.ini"}"
113+
;;
114+
esac
107115
if ! grep -q "$line" "$ini" 2>/dev/null; then
108116
echo "$line" >> "$ini"
109117
fi

7.2/alpine3.11/cli/docker-php-ext-install

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ fi
1919
cd /usr/src/php/ext
2020

2121
usage() {
22-
echo "usage: $0 [-jN] ext-name [ext-name ...]"
22+
echo "usage: $0 [-jN] [--ini-name file.ini] ext-name [ext-name ...]"
2323
echo " ie: $0 gd mysqli"
2424
echo " $0 pdo pdo_mysql"
2525
echo " $0 -j5 gd mbstring mysqli pdo pdo_mysql shmop"
@@ -41,15 +41,17 @@ usage() {
4141
echo 'the output of "php -i" to see which modules are already loaded.'
4242
}
4343

44-
opts="$(getopt -o 'h?j:' --long 'help,jobs:' -- "$@" || { usage >&2 && false; })"
44+
opts="$(getopt -o 'h?j:' --long 'help,ini-name:,jobs:' -- "$@" || { usage >&2 && false; })"
4545
eval set -- "$opts"
4646

4747
j=1
48+
iniName=
4849
while true; do
4950
flag="$1"
5051
shift
5152
case "$flag" in
5253
--help|-h|'-?') usage && exit 0 ;;
54+
--ini-name) iniName="$1" && shift ;;
5355
--jobs|-j) j="$1" && shift ;;
5456
--) break ;;
5557
*)
@@ -108,7 +110,7 @@ for ext in $exts; do
108110
-maxdepth 1 \
109111
-name '*.so' \
110112
-exec basename '{}' ';' \
111-
| xargs -r docker-php-ext-enable
113+
| xargs -r docker-php-ext-enable ${iniName:+--ini-name "$iniName"}
112114
make -j"$j" clean
113115
cd "$popDir"
114116
done

7.2/alpine3.11/fpm/docker-php-ext-enable

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,15 @@ for module in $modules; do
103103
continue
104104
fi
105105

106-
ini="$PHP_INI_DIR/conf.d/${iniName:-"docker-php-ext-$ext.ini"}"
106+
case "$iniName" in
107+
/*)
108+
# allow an absolute path
109+
ini="$iniName"
110+
;;
111+
*)
112+
ini="$PHP_INI_DIR/conf.d/${iniName:-"docker-php-ext-$ext.ini"}"
113+
;;
114+
esac
107115
if ! grep -q "$line" "$ini" 2>/dev/null; then
108116
echo "$line" >> "$ini"
109117
fi

7.2/alpine3.11/fpm/docker-php-ext-install

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ fi
1919
cd /usr/src/php/ext
2020

2121
usage() {
22-
echo "usage: $0 [-jN] ext-name [ext-name ...]"
22+
echo "usage: $0 [-jN] [--ini-name file.ini] ext-name [ext-name ...]"
2323
echo " ie: $0 gd mysqli"
2424
echo " $0 pdo pdo_mysql"
2525
echo " $0 -j5 gd mbstring mysqli pdo pdo_mysql shmop"
@@ -41,15 +41,17 @@ usage() {
4141
echo 'the output of "php -i" to see which modules are already loaded.'
4242
}
4343

44-
opts="$(getopt -o 'h?j:' --long 'help,jobs:' -- "$@" || { usage >&2 && false; })"
44+
opts="$(getopt -o 'h?j:' --long 'help,ini-name:,jobs:' -- "$@" || { usage >&2 && false; })"
4545
eval set -- "$opts"
4646

4747
j=1
48+
iniName=
4849
while true; do
4950
flag="$1"
5051
shift
5152
case "$flag" in
5253
--help|-h|'-?') usage && exit 0 ;;
54+
--ini-name) iniName="$1" && shift ;;
5355
--jobs|-j) j="$1" && shift ;;
5456
--) break ;;
5557
*)
@@ -108,7 +110,7 @@ for ext in $exts; do
108110
-maxdepth 1 \
109111
-name '*.so' \
110112
-exec basename '{}' ';' \
111-
| xargs -r docker-php-ext-enable
113+
| xargs -r docker-php-ext-enable ${iniName:+--ini-name "$iniName"}
112114
make -j"$j" clean
113115
cd "$popDir"
114116
done

0 commit comments

Comments
 (0)