clean, clean, clean, all i have to do is clean

git-svn-id: http://www.observium.org/svn/observer/trunk@1855 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Tom Laermans
2011-03-15 15:27:14 +00:00
parent 6b0c5c183f
commit a8d60662d2
6 changed files with 151 additions and 119 deletions

View File

@@ -1,33 +1,33 @@
<?php
## Very basic parser to parse classic Observium-type schemes.
## Parser should populate $port_ifAlias array with type, descr, circuit, speed and notes
## Very basic parser to parse classic Observium-type schemes.
## Parser should populate $port_ifAlias array with type, descr, circuit, speed and notes
unset ($port_ifAlias);
unset ($port_ifAlias);
echo($this_port['ifAlias']);
echo($this_port['ifAlias']);
list($type,$descr) = preg_split("/[\:\[\]\{\}\(\)]/", $this_port['ifAlias']);
list(,$circuit) = preg_split("/[\{\}]/", $this_port['ifAlias']);
list(,$notes) = preg_split("/[\(\)]/", $this_port['ifAlias']);
list(,$speed) = preg_split("/[\[\]]/", $this_port['ifAlias']);
$descr = trim($descr);
list($type,$descr) = preg_split("/[\:\[\]\{\}\(\)]/", $this_port['ifAlias']);
list(,$circuit) = preg_split("/[\{\}]/", $this_port['ifAlias']);
list(,$notes) = preg_split("/[\(\)]/", $this_port['ifAlias']);
list(,$speed) = preg_split("/[\[\]]/", $this_port['ifAlias']);
$descr = trim($descr);
if($type && $descr) {
$type = strtolower($type);
$port_ifAlias['type'] = $type;
$port_ifAlias['descr'] = $descr;
$port_ifAlias['circuit'] = $circuit;
$port_ifAlias['speed'] = $speed;
$port_ifAlias['notes'] = $notes;
if($debug) {
print_r($port_ifAlias);
}
if ($type && $descr)
{
$type = strtolower($type);
$port_ifAlias['type'] = $type;
$port_ifAlias['descr'] = $descr;
$port_ifAlias['circuit'] = $circuit;
$port_ifAlias['speed'] = $speed;
$port_ifAlias['notes'] = $notes;
if ($debug)
{
print_r($port_ifAlias);
}
}
unset ($port_type, $port_descr, $port_circuit, $port_notes, $port_speed);
unset ($port_type, $port_descr, $port_circuit, $port_notes, $port_speed);
?>
?>