From 33a8947c76d74a738522dbb54ae562b6f44d5f97 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Mon, 24 Jun 2024 09:32:58 +0200 Subject: [PATCH] Ensure DOKU_INC is always right using an auto_prepend_file This is basically the same fix as bitnami/containers#12535 Plugins or template may have their own entry points. Eg. the sprintdoc template's svg.php Those entrypoints usually start with something like: ``` if(!defined('DOKU_INC')) define('DOKU_INC', __DIR__ . '/../../../'); require_once(DOKU_INC . 'inc/init.php'); ``` Since plugins are installed in the volume, __DIR__ will point to the wrong location. By predefining DOKU_INC before any other code runs, this can be avoided. --- root/usr/local/etc/php/conf.d/dokuwiki.ini | 1 + root/var/www/html/.autoprepend.php | 7 +++++++ root/var/www/html/health.php | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 root/var/www/html/.autoprepend.php diff --git a/root/usr/local/etc/php/conf.d/dokuwiki.ini b/root/usr/local/etc/php/conf.d/dokuwiki.ini index c0a87bf..919c98a 100644 --- a/root/usr/local/etc/php/conf.d/dokuwiki.ini +++ b/root/usr/local/etc/php/conf.d/dokuwiki.ini @@ -3,3 +3,4 @@ post_max_size = ${PHP_UPLOADLIMIT} upload_max_filesize = ${PHP_UPLOADLIMIT} memory_limit = ${PHP_MEMORYLIMIT} date.timezone = ${PHP_TIMEZONE} +auto_prepend_file = /var/www/html/.autoprepend.php diff --git a/root/var/www/html/.autoprepend.php b/root/var/www/html/.autoprepend.php new file mode 100644 index 0000000..516a90e --- /dev/null +++ b/root/var/www/html/.autoprepend.php @@ -0,0 +1,7 @@ +