/** * Constructor. * * @param Horde_Pear_Package_Xml $xml The package.xml handler * to operate on. * @param DOMNode $contents The root node for the * "contents" listing. * @param DOMNode $filelist The root node for the * "filelist" listing. */ public function __construct(Horde_Pear_Package_Xml $xml, DOMNode $contents, DOMNode $filelist) { $this->_xml = $xml; $this->_filelist = $filelist; $element = $this->_xml->createElementDirectory('/'); $element->setDocument($this->_xml); $element->setDirectoryNode($contents); $this->_dir_list = $this->_xml->createDirectory($element, $this->_xml); $this->_populateFileList(); }
/** * Insert a new directory entry into the XML at the given point with the * specified name * * @param string $name The name. * @param DOMNode $point Insertion point. * * @return Horde_Pear_Package_Xml_Element_Directory The inserted element. */ public function insertSubDirectory($name, DOMNode $point = null) { $element = $this->_xml->createElementDirectory($name, $this); $element->_insert($this, $point); return $element; }