/** * Constructor. * * @param string $name The name of * the directory. * @param Horde_Pear_Package_Xml_Element_Directory $parent The parent * directory. * @param string $role The file role. */ public function __construct($name, $parent, $role = null) { $this->_name = $name; $this->_role = $role; $this->_parent = $parent; $this->_xml = $parent->getDocument(); $this->_level = $parent->getLevel() + 1; }
/** * 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; } }