Skip to content

Commit

Permalink
Prepare icingacli for having the Icinga library in PHP's include path
Browse files Browse the repository at this point in the history
  • Loading branch information
lippserd committed Nov 12, 2014
1 parent 8c9465f commit 921f324
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
17 changes: 14 additions & 3 deletions bin/icingacli
@@ -1,6 +1,17 @@
#!/usr/bin/php

<?php
// {{{ICINGA_LICENSE_HEADER}}}
// {{{ICINGA_LICENSE_HEADER}}}

define('ICINGAWEB_BASEDIR', dirname(__DIR__));
// ICINGAWEB_BASEDIR is the parent folder for at least application, bin, modules, library/vendor and public


if (! @include_once ICINGAWEB_BASEDIR . 'Icinga/Application/Cli.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/Cli.php';
}

use Icinga\Application\Cli;
require_once dirname(__DIR__) . '/library/Icinga/Application/Cli.php';
Cli::start()->dispatch();
Icinga\Application\Cli::start()->dispatch();
2 changes: 1 addition & 1 deletion public/index.php
Expand Up @@ -3,7 +3,7 @@
// {{{ICINGA_LICENSE_HEADER}}}

define('ICINGAWEB_BASEDIR', dirname(__DIR__));
// ICINGAWEB_BASEDIR is the parent folder for at least application, bin, modules and public
// ICINGAWEB_BASEDIR is the parent folder for at least application, bin, modules, library/vendor and public


if (! @include_once ICINGAWEB_BASEDIR . '/library/Icinga/Application/webrouter.php') {
Expand Down

0 comments on commit 921f324

Please sign in to comment.