packaging/config: allow to override APPDIR

It is now possible to either define ICINGAWEB_APPDIR in an Environment
variable or to define it as a PHP constant before bootstrapping.

fixes #6400
This commit is contained in:
Thomas Gelf 2014-06-04 21:22:29 +00:00
parent 55880cb5a3
commit bdc3423d4e
1 changed files with 7 additions and 2 deletions

View File

@ -133,8 +133,13 @@ abstract class ApplicationBootstrap
define('ICINGA_LIBDIR', $this->libDir);
}
// TODO: Make appdir configurable for packagers
$this->appDir = realpath($this->libDir. '/../application');
if (defined('ICINGAWEB_APPDIR')) {
$this->appDir = ICINGAWEB_APPDIR;
} elseif (array_key_exists('ICINGAWEB_APPDIR', $_SERVER)) {
$this->appDir = $_SERVER['ICINGAWEB_APPDIR'];
} else {
$this->appDir = realpath($this->libDir. '/../application');
}
if (!defined('ICINGAWEB_APPDIR')) {
define('ICINGAWEB_APPDIR', $this->appDir);