71 public function request($cmd, $throw = TRUE)
73 return $this->
getParent()->request($cmd, $throw);
83 public function prepare($cmd, array $params = array())
85 return $this->
getParent()->prepare($cmd, $params);
95 public function execute($cmd, array $params = array())
129 return ($this[$key] > 0 && $this[$key] < 1000) ? TRUE : FALSE;
140 $iconid = ($this[$key] < 0) ? (pow(2, 32))-($this[$key]*-1) : $this[$key];
155 return $prefix .
"spacer";
159 return $prefix .
"query";
177 abstract public function getIcon();
196 $iterator =
new RecursiveIteratorIterator($this, RecursiveIteratorIterator::SELF_FIRST);
198 foreach($iterator as $node)
202 for($level = 0; $level < $iterator->getDepth(); $level++)
204 $siblings[] = ($iterator->getSubIterator($level)->hasNext()) ? 1 : 0;
207 $siblings[] = (!$iterator->getSubIterator($level)->hasNext()) ? 1 : 0;
222 protected function filterList(array $nodes = array(), array $rules = array())
226 foreach($nodes as $node)
230 $props = $node->getInfo(FALSE);
231 $props = array_intersect_key($props, $rules);
234 foreach($props as $key => $val)
238 $match = $val->contains($rules[$key], TRUE);
242 $match = $val == $rules[$key];
247 unset($nodes[$node->getId()]);
264 public function getInfo($extend = TRUE, $convert = FALSE)
275 foreach($info as $key => $val)
279 if($key->contains(
"_bytes_"))
283 elseif($key->contains(
"_bandwidth_"))
287 elseif($key->contains(
"_packets_"))
289 $info[$key->toString()] = number_format($val, null, null,
".");
291 elseif($key->contains(
"_packetloss_"))
293 $info[$key->toString()] = sprintf(
"%01.2f", floatval($val->toString())*100) .
"%";
295 elseif($key->endsWith(
"_uptime"))
299 elseif($key->endsWith(
"_version"))
303 elseif($key->endsWith(
"_icon_id"))
305 $info[$key->toString()] = $this->
iconGetName($key)->filterDigits();
334 return $this->nodeInfo[(string) $property];
344 return get_class($this);
375 public function __call($name, array $args)
379 return call_user_func_array(array($this->
getParent(), $name), $args);
394 $this->storage[$key] = $val;
406 return (array_key_exists($key, $this->storage) && !empty($this->storage[$key])) ? $this->storage[$key] : $default;
417 unset($this->storage[$key]);
427 return array(
"parent",
"storage",
"nodeId");
435 $this->nodeList = array();
451 $this->nodeInfo = array();
459 if($this->nodeList === null)
470 $this->nodeList = null;
480 return count($this->nodeList);
490 return current($this->nodeList);
510 return $this->
current()->count() > 0;
520 return $this->
key()+1 < $this->
count();
530 return key($this->nodeList);
540 return $this->
key() !== null;
550 return next($this->nodeList);
560 return reset($this->nodeList);
568 return array_key_exists((
string) $offset, $this->nodeInfo) ? TRUE : FALSE;
586 return $this->nodeInfo[(string) $offset];
594 if(method_exists($this,
"modify"))
596 return $this->modify(array((
string) $offset => $value));
607 unset($this->nodeInfo[(
string) $offset]);
621 public function __set($offset, $value)