[PATCH 3/4] Add STORAGELOCATION in coplete path in a constant

David Durieux d.durieux at siprossii.com
Fri Aug 20 20:46:15 UTC 2010


---
 .../Inventory/DirectoryStorageInventory.class.php  |   10 ++++------
 user/main.php                                      |    1 +
 2 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/Classes/Storage/Inventory/DirectoryStorageInventory.class.php b/Classes/Storage/Inventory/DirectoryStorageInventory.class.php
index cb7b908..d3263b6 100644
--- a/Classes/Storage/Inventory/DirectoryStorageInventory.class.php
+++ b/Classes/Storage/Inventory/DirectoryStorageInventory.class.php
@@ -253,9 +253,8 @@ INFOCONTENT;
     */
     private function _getCriteriaDSN($criteriaName, $criteriaValue)
     {
-        $dsn = sprintf('%s/../../../%s/%s/%s/%s/%s',
-        dirname(__FILE__),
-        $this->_configs["storageLocation"],
+        $dsn = sprintf('%s/%s/%s',
+        LIBSERVERFUSIONINVENTORY_STORAGELOCATION,
         "criterias",
         $criteriaName,
         $this->_applicationName,
@@ -270,9 +269,8 @@ INFOCONTENT;
     */
     private function _getInfoPathDSN($internalId)
     {
-        $dsn = sprintf('%s/../../../%s/%s/%s',
-        dirname(__FILE__),
-        $this->_configs["storageLocation"],
+        $dsn = sprintf('%s/%s/%s',
+        LIBSERVERFUSIONINVENTORY_STORAGELOCATION,
         "machines",
         $internalId);
         return $dsn;
diff --git a/user/main.php b/user/main.php
index f77fcdf..2bfe481 100644
--- a/user/main.php
+++ b/user/main.php
@@ -7,6 +7,7 @@ require_once dirname(__FILE__) ."/../Classes/Logger.class.php";
 $configs = parse_ini_file(dirname(__FILE__) ."/configs.ini", true);
 
 define("LIBSERVERFUSIONINVENTORY_LOG_FILE",dirname(__FILE__)."/../data/logs");
+define("LIBSERVERFUSIONINVENTORY_STORAGELOCATION",dirname(__FILE__)."/".$configs['storageLocation']);
 define("LIBSERVERFUSIONINVENTORY_HOOKS_CLASSNAME","Hooks");
 
 if (file_exists ($path=dirname(__FILE__) ."/applications/{$configs['application']['name']}/FusInvHooks.class.php"))
-- 
1.7.1


--MP_/588BW=eT46D5iQi6cnuB8Os
Content-Type: text/x-patch
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename=0004-Fix-bug-when-have-only-one-criteria.patch



More information about the Fusioninventory-devel mailing list