insertSubDirectory() public method

Insert a new directory entry into the XML at the given point with the specified name
public insertSubDirectory ( string $name, DOMNode $point = null ) : Horde_Pear_Package_Xml_Element_Directory
$name string The name.
$point DOMNode Insertion point.
return Horde_Pear_Package_Xml_Element_Directory The inserted element.
Beispiel #1
0
 /**
  * Ensure the provided path hierarchy.
  *
  * @param array $tree The path elements that are required.
  *
  * @return DOMNode The parent directory for the file.
  */
 public function getParent($tree)
 {
     $next = array_shift($tree);
     while ($next === '') {
         $next = array_shift($tree);
     }
     if (empty($tree) && !strlen($next)) {
         return $this;
     }
     if (!isset($this->_subdirectories[$next])) {
         $this->_subdirectories[$next] = $this->_create($this->_element->insertSubDirectory($next, $this->_getDirectoryInsertionPoint($next)), $this);
     }
     return $this->_subdirectories[$next]->getParent($tree);
 }