private function traversalDir(RecursiveArrayIterator $iterator)
    {
        $key = '';
        while ($iterator->valid()) {
            if ($iterator->hasChildren()) {
                $this->traversalDir($iterator->getChildren());
            } else {
                if ($iterator->key() == 'key' && ($iterator->current() != '/')) {
                    $this->dirs[] = $key = $iterator->current();
                }

                if ($iterator->key() == 'value') {
                    $this->values[$key] = $iterator->current();
                }
            }
            $iterator->next();
        }
        return $this->dirs;
    }
private function traversalDir(RecursiveArrayIterator $iterator)
    {
        $key = '';
        while ($iterator->valid()) {
            if ($iterator->hasChildren()) {
                $this->traversalDir($iterator->getChildren());
            } else {
                if ($iterator->key() == 'key' && ($iterator->current() != '/')) {
                    $this->dirs[] = $key = $iterator->current();
                }

                if ($iterator->key() == 'value') {
                    $this->values[$key] = $iterator->current();
                }
            }
            $iterator->next();
        }
        return $this->dirs;
    }
private function traversalDir ( RecursiveArrayIterator $ iterator ) { $ key = '' ; while ( $ iterator -> valid ( ) ) { if ( $ iterator -> hasChildren ( ) ) { $ this -> traversalDir ( $ iterator -> getChildren ( ) ) ; } else { if ( $ iterator -> key ( ) == 'key' && ( $ iterator -> current ( ) != '/' ) ) { $ this -> dirs [ ] = $ key = $ iterator -> current ( ) ; } if ( $ iterator -> key ( ) == 'value' ) { $ this -> values [ $ key ] = $ iterator -> current ( ) ; } } $ iterator -> next ( ) ; } return $ this -> dirs ; }
Traversal the directory to get the keys.
@param RecursiveArrayIterator $iterator
@return array
Traversal the directory to get the keys .