Skip to content

Commit

Permalink
Level up index.php
Browse files Browse the repository at this point in the history
This is the preparation for having the Icinga library in PHP's include path.
  • Loading branch information
lippserd committed Nov 12, 2014
1 parent 877e910 commit 32d483f
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion public/index.php
Expand Up @@ -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';
}

0 comments on commit 32d483f

Please sign in to comment.