From 11bb8dbab03ae56cd820959918b00c4015d82388 Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Fri, 14 Nov 2014 16:02:17 +0100 Subject: [PATCH] icingacli web serve: Fix "PHP Notice: Use of undefined constant ICINGA_LIBDIR" --- application/clicommands/WebCommand.php | 2 +- library/Icinga/Application/ApplicationBootstrap.php | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/application/clicommands/WebCommand.php b/application/clicommands/WebCommand.php index 5d9b20c64..12ed9e1a4 100644 --- a/application/clicommands/WebCommand.php +++ b/application/clicommands/WebCommand.php @@ -47,7 +47,7 @@ class WebCommand extends Command readlink('/proc/self/exe'), $socket, $basedir, - ICINGA_LIBDIR . '/Icinga/Application/webrouter.php' + Icinga::app()->getLibraryDir('/Icinga/Application/webrouter.php') ); // TODO: Store webserver log, switch uid, log index.php includes, pid file diff --git a/library/Icinga/Application/ApplicationBootstrap.php b/library/Icinga/Application/ApplicationBootstrap.php index 0368c2238..1844486cb 100644 --- a/library/Icinga/Application/ApplicationBootstrap.php +++ b/library/Icinga/Application/ApplicationBootstrap.php @@ -275,6 +275,18 @@ abstract class ApplicationBootstrap return $this->getDirWithSubDir($this->configDir, $subDir); } + /** + * Get the Icinga library directory + * + * @param string $subDir Optional sub directory to get + * + * @return string + */ + public function getLibraryDir($subDir = null) + { + return $this->getDirWithSubDir($this->libDir, $subDir); + } + /** * Get the path to the bootstrapping directory *