[PATCH 2/4] Add Constant for Hools classnma because program using this lib can have already Hooks classname
David Durieux
d.durieux at siprossii.com
Fri Aug 20 20:35:40 UTC 2010
---
Classes/Action/InventoryAction.class.php | 3 ++-
.../Inventory/DirectoryStorageInventory.class.php | 7 ++++---
user/main.php | 2 +-
3 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/Classes/Action/InventoryAction.class.php b/Classes/Action/InventoryAction.class.php
index 5bf5f04..a2c88b0 100644
--- a/Classes/Action/InventoryAction.class.php
+++ b/Classes/Action/InventoryAction.class.php
@@ -115,7 +115,8 @@ class InventoryAction extends Action
$internalId = uniqid();
try {
- $externalId = Hooks::createMachine();
+ $classhook = LIBSERVERFUSIONINVENTORY_HOOKS_CLASSNAME;
+ $externalId = $classhook::createMachine();
$libData->addLibMachine($internalId, $externalId);
$libData->addLibCriteriasMachine($internalId);
diff --git a/Classes/Storage/Inventory/DirectoryStorageInventory.class.php b/Classes/Storage/Inventory/DirectoryStorageInventory.class.php
index 8905cff..cb7b908 100644
--- a/Classes/Storage/Inventory/DirectoryStorageInventory.class.php
+++ b/Classes/Storage/Inventory/DirectoryStorageInventory.class.php
@@ -320,7 +320,7 @@ INFOCONTENT;
//Retrieve changes, sections to Add and sections to Remove
$sectionsToAdd = array_diff($xmlHashSections, $iniSections["sections"]);
$sectionsToRemove = array_diff($iniSections["sections"], $xmlHashSections);
-
+ $classhook = LIBSERVERFUSIONINVENTORY_HOOKS_CLASSNAME;
if ($sectionsToRemove)
{
$sectionsId = array();
@@ -330,7 +330,8 @@ INFOCONTENT;
unset($iniSections["sections"][$sectionId]);
array_push($sectionsId, $sectionId);
}
- Hooks::removeSections($sectionsId, $iniSections["externalId"][0]);
+
+ $classhook::removeSections($sectionsId, $iniSections["externalId"][0]);
$log->notifyDebugMessage(count($sectionsToRemove)." section(s) removed");
}
@@ -348,7 +349,7 @@ INFOCONTENT;
}
- $sectionsId = Hooks::addSections($data, $iniSections["externalId"][0]);
+ $sectionsId = $classhook::addSections($data, $iniSections["externalId"][0]);
$log->notifyDebugMessage(count($sectionsToAdd)." section(s) added");
diff --git a/user/main.php b/user/main.php
index 2e202de..f77fcdf 100644
--- a/user/main.php
+++ b/user/main.php
@@ -7,7 +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_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=0003-Add-STORAGELOCATION-in-coplete-path-in-a-constant.patch
More information about the Fusioninventory-devel
mailing list