Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prepare icingacli for having the Icinga library in PHP's include path
- Loading branch information
Showing
2 changed files
with
15 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters