Browse files

$basePath funguje i když je Document root přímo na rootu disku (např …

…E:/)
  • Loading branch information...
1 parent 7d30a8f commit 8b527e6944a7377449597dc5cf7b2b779159cf86 @ViliamKopecky ViliamKopecky committed Feb 2, 2012
Showing with 1 addition and 0 deletions.
  1. +1 −0 HttpPHPUnit/Main/TemplateFactory.php
View
1 HttpPHPUnit/Main/TemplateFactory.php
@@ -25,6 +25,7 @@ public static function getBasePath()
$dir = realpath(__DIR__ . '/..');
$documentRoot = realpath($_SERVER['DOCUMENT_ROOT']);
if (!$documentRoot) throw new Exception;
+ $documentRoot = rtrim($documentRoot, DIRECTORY_SEPARATOR);
$tmp = $documentRoot . DIRECTORY_SEPARATOR;
if ($documentRoot != $dir AND strncmp($dir, $tmp, strlen($tmp)) !== 0) throw new Exception;
return str_replace('\\', '/', substr($dir, strlen($documentRoot)));

0 comments on commit 8b527e6

Please sign in to comment.