Example #1
0
 public static function getInstance($name = '', $right = array())
 {
     $right = self::right(array_merge($right, self::right($name)));
     if (@$right[0] === '') {
         $right = array();
     }
     $short = self::short($right);
     if (empty(self::$childs[$short])) {
         $that = new self($right);
         $that->path = $right;
         $that->name = @$right[sizeof($right) - 1];
         $that->value = $that->query = $that->is = $that->counter = null;
         self::$childs[$short] = $that;
         if ($that->name) {
             $that->parent = $that->getInst('//');
         }
     }
     return self::$childs[$short];
 }