[icinga-checkins] icinga.org: icingaweb2/master: Use realpath in ApplicationBootstrap:: getBootstrapDirecory()

git at icinga.org git at icinga.org
Wed Nov 12 17:12:00 CET 2014


Module: icingaweb2
Branch: master
Commit: c394cd0bffcef10f2a29041a53a202d1bce1c453
URL:    https://git.icinga.org/?p=icingaweb2.git;a=commit;h=c394cd0bffcef10f2a29041a53a202d1bce1c453

Author: Eric Lippmann <eric.lippmann at netways.de>
Date:   Wed Nov 12 17:10:05 2014 +0100

Use realpath in ApplicationBootstrap::getBootstrapDirecory()

If the CLI is called from source, the base directory is now set to the correct path.
Packagers will have to provide the path to the base directory though.

---

 library/Icinga/Application/ApplicationBootstrap.php |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/library/Icinga/Application/ApplicationBootstrap.php b/library/Icinga/Application/ApplicationBootstrap.php
index a74a7f8..92fe9b6 100644
--- a/library/Icinga/Application/ApplicationBootstrap.php
+++ b/library/Icinga/Application/ApplicationBootstrap.php
@@ -259,15 +259,15 @@ abstract class ApplicationBootstrap
     }
 
     /**
-     * Get the path to the bootstrapping directory.
+     * Get the path to the bootstrapping directory
      *
-     * This is usually /public for Web and EmbeddedWeb
+     * This is usually /public for Web and EmbeddedWeb and /bin for the CLI
      *
      * @return string
      */
     public function getBootstrapDirecory()
     {
-        return dirname($_SERVER['SCRIPT_FILENAME']);
+        return dirname(realpath($_SERVER['SCRIPT_FILENAME']));
     }
 
     /**



More information about the icinga-checkins mailing list