Skip to content

Commit

Permalink
Loop up the tree for root.
Browse files Browse the repository at this point in the history
  • Loading branch information
g105b authored Jan 13, 2017
1 parent f46b252 commit d0ababb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Core/Path.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ public static function get($name) {
else {
$p = dirname($_SERVER["DOCUMENT_ROOT"]);
}
$p = realpath($p);
while(!in_array("src", scandir($p))
&& $p !== "/") {
$p = realpath("$p/..");
}
break;

case self::SCRIPT:
Expand Down Expand Up @@ -210,4 +215,4 @@ public static function getNamespace($path) {
return false;
}

}#
}#

0 comments on commit d0ababb

Please sign in to comment.