Level up index.php

This is the preparation for having the Icinga library in PHP's include path.
This commit is contained in:
Eric Lippmann 2014-11-11 15:22:21 +01:00
parent 877e9101f3
commit 32d483f69f
1 changed files with 9 additions and 1 deletions

View File

@ -2,4 +2,12 @@
// {{{ICINGA_LICENSE_HEADER}}}
// {{{ICINGA_LICENSE_HEADER}}}
require_once dirname(__DIR__). '/library/Icinga/Application/webrouter.php';
define('ICINGAWEB_BASEDIR', dirname(__DIR__));
// ICINGAWEB_BASEDIR is the parent folder for at least application, bin, modules and public
if (! @include_once ICINGAWEB_BASEDIR . '/library/Icinga/Application/webrouter.php') {
// If the Icinga library wasn't found under ICINGAWEB_BASEDIR, require that the Icinga library is found in PHP's
// include path which is the case if Icinga Web 2 is installed via packages
require_once 'Icinga/Application/webrouter.php';
}