From 3abf993607cb4f23ab8a1caee87f35586062b2be Mon Sep 17 00:00:00 2001 From: Deon George Date: Thu, 13 Feb 2025 23:44:00 +1100 Subject: [PATCH] Enable creation of prepend.php and automatically disable opcache --- docker/init-docker | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docker/init-docker b/docker/init-docker index 621bc78..97870c6 100755 --- a/docker/init-docker +++ b/docker/init-docker @@ -46,6 +46,13 @@ if [ -x /usr/bin/memcached -a "${MEMCACHED_START}" == "TRUE" ]; then /usr/bin/memcached -d -P /run/memcached/memcached.pid -u memcached fi +# If we are local, then disable the opcache +if [ "${ENV}" != "production" -a ! -e ${PHP_DIR}/pprepend.php ]; then + echo "* Automatically disabling opcache as environment is not production [${ENV}]" + echo " ${PHP_DIR}/prepend.php + sed -i -e s"#auto_prepend_file =#auto_prepend_file=${PHP_DIR}/prepend.php#" /usr/local/etc/php/php.ini +fi + # Laravel Specific if [ -r artisan -a -e ${php}/.env ]; then echo "* Laravel Setup..."