diff --git a/code/DocumentationEntity.php b/code/DocumentationEntity.php index 970b6aa..8ffccd5 100644 --- a/code/DocumentationEntity.php +++ b/code/DocumentationEntity.php @@ -221,6 +221,10 @@ class DocumentationEntity extends ViewableData { $path = $this->versions[$versions[0]]; } - return $path . '/' . $lang .'/'; + return rtrim($path, '/') . '/' . rtrim($lang, '/') .'/'; + } + + function __toString() { + return sprintf('DocumentationEntity: %s)', $this->getPath()); } } \ No newline at end of file diff --git a/code/DocumentationPage.php b/code/DocumentationPage.php index 99cb538..53d8d61 100644 --- a/code/DocumentationPage.php +++ b/code/DocumentationPage.php @@ -30,8 +30,7 @@ class DocumentationPage extends ViewableData { if(!file_exists($this->getPath())) { throw new InvalidArgumentException(sprintf( - 'Path could not be found: "%s" (module path: %s, file path: %s)', - $this->getPath(), + 'Path could not be found. Module path: %s, file path: %s', $this->entity->getPath(), $this->relativePath )); @@ -61,7 +60,8 @@ class DocumentationPage extends ViewableData { * @return String */ function getPath() { - return realpath($this->entity->getPath($this->version, $this->lang) . '/' . $this->getRelativePath()); + $path = rtrim($this->entity->getPath($this->version, $this->lang), '/') . '/' . $this->getRelativePath(); + return realpath($path); } function getLang() {