From f4275770674f56dd42b46f921207dd93b91f0cd5 Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Thu, 13 Nov 2014 09:38:04 +0100 Subject: [PATCH] Add getVendorDir() in favor of constant ICINGAWEB_VENDORS --- .../Application/ApplicationBootstrap.php | 59 ++++++++++++------- 1 file changed, 38 insertions(+), 21 deletions(-) diff --git a/library/Icinga/Application/ApplicationBootstrap.php b/library/Icinga/Application/ApplicationBootstrap.php index 9940f1901..a259496bf 100644 --- a/library/Icinga/Application/ApplicationBootstrap.php +++ b/library/Icinga/Application/ApplicationBootstrap.php @@ -56,6 +56,27 @@ abstract class ApplicationBootstrap */ protected $appDir; + /** + * Vendor library directory + * + * @var string + */ + protected $vendorDir; + + /** + * Library directory + * + * @var string + */ + protected $libDir; + + /** + * Configuration directory + * + * @var string + */ + protected $configDir; + /** * Icinga auto loader * @@ -63,13 +84,6 @@ abstract class ApplicationBootstrap */ private $loader; - /** - * Library directory - * - * @var string - */ - private $libDir; - /** * Config object * @@ -77,13 +91,6 @@ abstract class ApplicationBootstrap */ protected $config; - /** - * Configuration directory - * - * @var string - */ - private $configDir; - /** * Module manager * @@ -118,9 +125,7 @@ abstract class ApplicationBootstrap } $this->baseDir = $baseDir; $this->appDir = $baseDir . '/application'; - - define('ICINGAWEB_VENDORS', $baseDir . '/library/vendor'); - + $this->vendorDir = $baseDir . '/library/vendor'; $this->libDir = realpath(__DIR__ . '/../..'); if ($configDir === null) { @@ -242,15 +247,27 @@ abstract class ApplicationBootstrap } /** - * Getter for config dir + * Get the vendor library directory * - * @param string $subdir + * @param string $subDir Optional sub directory to get * * @return string */ - public function getConfigDir($subdir = null) + public function getVendorDir($subDir = null) { - return $this->getDirWithSubDir($this->configDir, $subdir); + return $this->getDirWithSubDir($this->vendorDir, $subDir); + } + + /** + * Get the configuration directory + * + * @param string $subDir Optional sub directory to get + * + * @return string + */ + public function getConfigDir($subDir = null) + { + return $this->getDirWithSubDir($this->configDir, $subDir); } /**