#!/usr/bin/php
createInstance($amo_id, $req_par, $id);
if($ret == GenericAdmin::EC_OK)
print "Instance of class $amo_id with id $id created.\n";
elseif ($ret == GenericAdmin::EC_DUPL_INST)
print "Instance of class $amo_id with id $id already existing.\n";
else
throw new Exception("Instance creation result: $ret");
return $id;
}
// main
try {
// check SysAl-Path
//$path = preg_replace("/.Test.*php/", "", __FILE__);
if(file_exists("link_to_sysal/AlarmManagement/AlarmManagement.php"))
// test environment
set_include_path("link_to_sysal" . PATH_SEPARATOR . get_include_path());
elseif (file_exists("/usr/share/php/SysAl/AlarmManagement/AlarmManagement.php"))
// production environment
set_include_path("/usr/share/php/SysAl" . PATH_SEPARATOR . get_include_path());
else
throw new Exception("Cannot find SystemAlarming environent");
// create Interface
require_once 'AlarmManagement/AlarmManagement.php';
$if = new AlarmManagement();
// create AEDs
$req_par = 'Downtimefree_form/Downtime';
$aed_dt = createInstance($if, 2, $req_par);
// create TASAR
$req_par = "Downtime$aed_dt20507075100";
$tasar_id = createInstance($if, 7, $req_par);
}
catch (Exception $e) {
echo ($e);
throw $e;
}