MINOR Fixed path concat issues

This commit is contained in:
Ingo Schommer 2010-08-01 07:03:50 +00:00
parent a013923106
commit f623dcc887
2 changed files with 8 additions and 4 deletions

View File

@ -221,6 +221,10 @@ class DocumentationEntity extends ViewableData {
$path = $this->versions[$versions[0]]; $path = $this->versions[$versions[0]];
} }
return $path . '/' . $lang .'/'; return rtrim($path, '/') . '/' . rtrim($lang, '/') .'/';
}
function __toString() {
return sprintf('DocumentationEntity: %s)', $this->getPath());
} }
} }

View File

@ -30,8 +30,7 @@ class DocumentationPage extends ViewableData {
if(!file_exists($this->getPath())) { if(!file_exists($this->getPath())) {
throw new InvalidArgumentException(sprintf( throw new InvalidArgumentException(sprintf(
'Path could not be found: "%s" (module path: %s, file path: %s)', 'Path could not be found. Module path: %s, file path: %s',
$this->getPath(),
$this->entity->getPath(), $this->entity->getPath(),
$this->relativePath $this->relativePath
)); ));
@ -61,7 +60,8 @@ class DocumentationPage extends ViewableData {
* @return String * @return String
*/ */
function getPath() { 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() { function getLang() {