Skip to content

Commit 7413b1f

Browse files
authored
Add a way to skip checking if extensions work (#915)
1 parent fabb509 commit 7413b1f

File tree

2 files changed

+19
-8
lines changed

2 files changed

+19
-8
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,7 @@ Here's the list of all the supported environment variables:
410410
| | `IPE_DEBUG=1` | By setting this environment variable, the script will print all the commands it executes (it will be very verbose, useful only for debug purposes) |
411411
| | `IPE_PROCESSOR_COUNT` | By default all available processors. Set this environment variable to override the number of processors detected by the script (used for parallel compilation) |
412412
| | `IPE_DONT_ENABLE=1` | By default the script will install and enable the extensions.<br />If you want to only install them (without enabling them) you can set this environment variable.<br />To enable the extensions at a later time you can execute the command `docker-php-ext-enable-<extension>` (for example: `docker-php-ext-enable-xdebug`).<br />**Beware**: installing some PHP extensions requires that other PHP extensions are already enabled, so use this feature wisely. |
413+
| | `IPE_SKIP_CHECK=1` | By default the script will check if the extensions can be enabled: if you want to skip this check, you can use this flag.<br />**Beware**: extensions may be enabled even if they break PHP: use this function wisely. |
413414
| | `IPE_KEEP_SYSPKG_CACHE=1` | By default the script will clear the apt/apk/pear cache in order to save disk space. You can disable it by setting this environment variable |
414415
| lzf | `IPE_LZF_BETTERCOMPRESSION=1` | By default `install-php-extensions` compiles the `lzf` extension to prefer speed over size; you can use this environment variable to compile it preferring size over speed |
415416
| event | `IPE_EVENT_NAMESPACE=`... | By default, the `event` classes are defined in the root namespace. You can use this environment variable to specify a custom namespace |

install-php-extensions

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2640,13 +2640,18 @@ EOF
26402640
esac
26412641
;;
26422642
esac
2643-
php -r 'return;' >/dev/null 2>/dev/null || true
2644-
installBundledModule_errAfter="$(php -r 'return;' 2>&1 || true)"
2645-
if test "$installBundledModule_errAfter" != "$installBundledModule_errBefore"; then
2646-
printf 'PHP has problems after installing the "%s" extension:\n%s\n' "$1" "$installBundledModule_errAfter" >&2
2647-
rm "$PHP_INI_DIR/conf.d/docker-php-ext-$1.ini" || true
2648-
return 1
2649-
fi
2643+
case "${IPE_SKIP_CHECK:-}" in
2644+
1 | y* | Y*) ;;
2645+
*)
2646+
php -r 'return;' >/dev/null 2>/dev/null || true
2647+
installBundledModule_errAfter="$(php -r 'return;' 2>&1 || true)"
2648+
if test "$installBundledModule_errAfter" != "$installBundledModule_errBefore"; then
2649+
printf 'PHP has problems after installing the "%s" extension:\n%s\n' "$1" "$installBundledModule_errAfter" >&2
2650+
rm "$PHP_INI_DIR/conf.d/docker-php-ext-$1.ini" || true
2651+
return 1
2652+
fi
2653+
;;
2654+
esac
26502655
}
26512656

26522657
# Fetch a tar.gz file, extract it and returns the path of the extracted folder.
@@ -4229,7 +4234,12 @@ installRemoteModule() {
42294234
fi
42304235
postProcessModule "$installRemoteModule_module"
42314236
if test $installRemoteModule_manuallyInstalled -lt 2; then
4232-
checkModuleWorking "$installRemoteModule_module" "$installRemoteModule_ini_basename" "$installRemoteModule_ini_extra"
4237+
case "${IPE_SKIP_CHECK:-}" in
4238+
1 | y* | Y*) ;;
4239+
*)
4240+
checkModuleWorking "$installRemoteModule_module" "$installRemoteModule_ini_basename" "$installRemoteModule_ini_extra"
4241+
;;
4242+
esac
42334243
enablePhpExtension "$installRemoteModule_module" "$installRemoteModule_ini_basename" "$installRemoteModule_ini_extra"
42344244
fi
42354245
}

0 commit comments

Comments
 (0)