\PluginFusioninventoryFormatconvert

Used to convert inventory from agent to inventory ready to inject in GLPI.

Summary

Methods
Properties
Constants
XMLtoArray()
JSONtoArray()
cleanArray()
computerInventoryTransformation()
computerSoftwareTransformation()
extraCollectInfo()
addValues()
replaceids()
networkequipmentInventoryTransformation()
printerInventoryTransformation()
getTypeDrive()
$foreignkey_itemtype
$manufacturer_cache
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Properties

$foreignkey_itemtype

$foreignkey_itemtype : array

Initialize the foreignkey itemtypes

Type

array

$manufacturer_cache

$manufacturer_cache : array

Initialize the manufacturer cache

Type

array

Methods

XMLtoArray()

XMLtoArray(string  $xml) : array

Convert XML into php array

Parameters

string $xml

Returns

array

JSONtoArray()

JSONtoArray(string  $json) : array

Convert json into php array

Parameters

string $json

Returns

array

cleanArray()

cleanArray(array  $data) : array

Clean the php array(remove unwanted characters, potential attack code.

..)

Parameters

array $data

Returns

array —

cleaned php array

computerInventoryTransformation()

computerInventoryTransformation(array  $array) : array

Convert Fusioninventory Computer inventory to pre-prepared GLPI inventory

Parameters

array $array

Returns

array

computerSoftwareTransformation()

computerSoftwareTransformation(array  $a_inventory, integer  $entities_id) : array

Convert SOFTWARE part of computer inventory because need a special transformation

Parameters

array $a_inventory

computer inventory converted

integer $entities_id

entity id

Returns

array

extraCollectInfo()

extraCollectInfo(array  $a_inventory, integer  $computers_id) : array

Prepare collect info (file, wmi and registry) to be glpi ready :D

Parameters

array $a_inventory

computer array prepared

integer $computers_id

computer ID

Returns

array

addValues()

addValues(array  $array, array  $a_key) : string|array

Convert data in right format (string, integer) when have empty or not exist in inventory

Parameters

array $array

inventory data

array $a_key

the key to check

Returns

string|array

replaceids()

replaceids(array  $array, string  $itemtype, integer  $items_id, integer  $level) : array

Replace string in prepared data into GLPI ID (create items if required)

Parameters

array $array

data prepared

string $itemtype

it's itemtype of item

integer $items_id

id of the item

integer $level

Returns

array

networkequipmentInventoryTransformation()

networkequipmentInventoryTransformation(array  $array) : array

Convert network equipment in GLPI prepared data

Parameters

array $array

Returns

array

printerInventoryTransformation()

printerInventoryTransformation(array  $array) : array

Convert printer in GLPI prepared data

Parameters

array $array

Returns

array

getTypeDrive()

getTypeDrive(array  $data) : string

Get type of the drive

Parameters

array $data

information of the storage

Returns

string —

"Drive" or "HardDrive"