}
/**
- * Read the description of the ref entry file
+ * Read the first line of the description of the ref entry file
* @return string
*/
public function getDescription() {
return $this;
}
+ /**
+ * Read the full description of the ref entry file
+ * @return string
+ */
+ public function getFullDescription() {
+ if ($this->isFile()) {
+ return trim($this->getFile()->readFullDescription());
+ }
+ if ($this->isRoot()) {
+ return trim($this->repo->getRootEntry()->getFullDescription());
+ }
+ return $this;
+ }
+
/**
* Read the intriductory section of the refentry file
* @return string
return ctype_upper($base{0});
}
+ public function getEntryName() {
+ return end($this->list);
+ }
+
+ public function getNsName() {
+ if ($this->isRoot()) {
+ return $this->getName();
+ } elseif ($this->isFunction()) {
+ $parts = explode("/", trim($this->getName(), "/"));
+ $self = array_pop($parts);
+ return implode("\\", $parts) . "::" . $self;
+ } else {
+ return strtr($this->getName(), "/", "\\");
+ }
+ }
+
/**
* Display name
* @return string
($loose && glob($this->getBasename() . "/*/$glob"));
} elseif ($this->isRoot()) {
return true;
- } else {
+ } elseif ($this->getBasename() !== "/") {
return is_dir($this->getBasename());
+ } else {
+ return false;
}
}
function getIterator() {
return new Tree($this->getBasename(), $this->repo);
}
+
+ function getStructure() {
+ return new Structure($this);
+ }
}