/**
* Constructor.
*
* @param string $name The name of
* the directory.
* @param Horde_Pear_Package_Xml_Element_Directory $parent The parent
* directory.
*/
public function __construct($name, $parent = null)
{
$this->_name = $name;
if ($parent instanceof Horde_Pear_Package_Xml_Element_Directory) {
$this->_xml = $parent->getDocument();
$this->_path = $parent->getPath() . '/' . $name;
$this->_level = $parent->getLevel() + 1;
} else {
$this->_path = '';
$this->_level = 1;
}
}