82 public function prepare($cmd, array $params = array())
84 return $this->
getParent()->prepare($cmd, $params);
94 public function execute($cmd, array $params = array())
128 return ($this[$key] > 0 && $this[$key] < 1000) ? TRUE : FALSE;
139 $iconid = ($this[$key] < 0) ? (pow(2, 32))-($this[$key]*-1) : $this[$key];
154 return $prefix .
"spacer";
158 return $prefix .
"query";
176 abstract public function getIcon();
195 $iterator =
new RecursiveIteratorIterator($this, RecursiveIteratorIterator::SELF_FIRST);
197 foreach($iterator as $node)
201 for($level = 0; $level < $iterator->getDepth(); $level++)
203 $siblings[] = ($iterator->getSubIterator($level)->hasNext()) ? 1 : 0;
206 $siblings[] = (!$iterator->getSubIterator($level)->hasNext()) ? 1 : 0;
221 protected function filterList(array $nodes = array(), array $rules = array())
225 foreach($nodes as $node)
229 $props = $node->getInfo(FALSE);
230 $props = array_intersect_key($props, $rules);
233 foreach($props as $key => $val)
237 $match = $val->contains($rules[$key], TRUE);
241 $match = $val == $rules[$key];
246 unset($nodes[$node->getId()]);
263 public function getInfo($extend = TRUE, $convert = FALSE)
274 foreach($info as $key => $val)
278 if($key->contains(
"_bytes_"))
282 elseif($key->contains(
"_bandwidth_"))
286 elseif($key->contains(
"_packets_"))
288 $info[$key->toString()] = number_format($val, null, null,
".");
290 elseif($key->contains(
"_packetloss_"))
292 $info[$key->toString()] = sprintf(
"%01.2f", floatval($val->toString())*100) .
"%";
294 elseif($key->endsWith(
"_uptime"))
298 elseif($key->endsWith(
"_version"))
302 elseif($key->endsWith(
"_icon_id"))
304 $info[$key->toString()] = $this->
iconGetName($key)->filterDigits();
333 return $this->nodeInfo[(string) $property];
343 return get_class($this);
374 public function __call($name, array $args)
378 return call_user_func_array(array($this->
getParent(), $name), $args);
393 $this->storage[$key] = $val;
405 return (array_key_exists($key, $this->storage) && !empty($this->storage[$key])) ? $this->storage[$key] : $default;
416 unset($this->storage[$key]);
426 return array(
"parent",
"storage",
"nodeId");
434 $this->nodeList = array();
450 $this->nodeInfo = array();
458 if($this->nodeList === null)
469 $this->nodeList = null;
479 return count($this->nodeList);
489 return current($this->nodeList);
509 return $this->
current()->count() > 0;
519 return $this->
key()+1 < $this->
count();
529 return key($this->nodeList);
539 return $this->
key() !== null;
549 return next($this->nodeList);
559 return reset($this->nodeList);
567 return array_key_exists((
string) $offset, $this->nodeInfo) ? TRUE : FALSE;
587 return $this->nodeInfo[(string) $offset];
595 if(method_exists($this,
"modify"))
597 return $this->modify(array((
string) $offset => $value));
608 unset($this->nodeInfo[(
string) $offset]);
622 public function __set($offset, $value)