We're developing php extensions for an application called "HP Server Automation", which is written in Java and Python. It have a functionaliy by which you can write web extensions to interact with it, and you can use PHP, Perl and Python. But now, we have a problem because the APP Api returns us a query in a unknown serialization format, that we can't identify it:
Code: Select all
{
model="VMWARE VIRTUAL PLATFORM"
netBIOSName=
osFlavor="Windows Server 2003, Enterprise Edition"
modifiedBy="dsx5959"
locale="3082"
state="OK"
discoveredDate="2012/03/14 13:03:23.000"
use="REPSOL.DEV"
serialNumber="VMWARE-42 1A 86 62 D8 B4 1D 13-AB 34 02 89 76 4A E8 40"
firstDetectDate=
customer="Not Assigned"
virtualizationType=1
stage="JULIAN CAMARILLO 6"
facility="SAUCDGSAJC8"
realm="SAUCDGSAJC8-agents"
description="This is the description
of this server, with some carriage
returns"
codeset="CP1252"
name="vsaujc8test02"
hostName="vsaujc8test02"
agentVersion="40.0.0.1.77"
lockInfo={
locked=false
date=
comment=
user=
}
createdDate="2012/03/14 13:03:23.000"
defaultGw="172.18.175.33"
platform="Windows Server 2003"
osSPVersion="SP1"
osVersion="Microsoft Windows Server 2003, \"Enterprise Edition\" Service Pack 1 Build 3790 (03-15-2012)"
origin="PROVISIONED"
modifiedDate="2012/03/16 08:14:32.000"
managementIP="172.18.175.50"
peerIP="172.18.175.50"
loopbackIP=
primaryIP="172.18.175.50"
lastScanDate=
createdBy="Automatic"
hypervisor=false
manufacturer="VMWARE, INC."
reporting=true
previousSWRegDate="2012/03/15 09:24:50.000"
mid="24070001"
opswLifecycle="MANAGED"
}· It can be multi-leveled, base params are enclosed with {} but you can have a param that contains {} with more params.
· Params are defined with key=value, and params are separated by a new line (carriage return)
· There are three field types: Text field, enclosed with double quotes. If the text has quotes, the api returns it escaped with \". Number field, that is not enclosed with quotes, and booleans, that are not enclosed too (true and false). It seems that date fields are threated as text fields.
We would like to de-serialize and load data in a multi-level array, but we'll need to code a processor if we can't identify the format.
Anyone knows it? Thank you.