Skip to content

Commit d0ababb

Browse files
author
Greg Bowler
authored
Loop up the tree for root.
1 parent f46b252 commit d0ababb

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/Core/Path.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,11 @@ public static function get($name) {
6666
else {
6767
$p = dirname($_SERVER["DOCUMENT_ROOT"]);
6868
}
69+
$p = realpath($p);
70+
while(!in_array("src", scandir($p))
71+
&& $p !== "/") {
72+
$p = realpath("$p/..");
73+
}
6974
break;
7075

7176
case self::SCRIPT:
@@ -210,4 +215,4 @@ public static function getNamespace($path) {
210215
return false;
211216
}
212217

213-
}#
218+
}#

0 commit comments

Comments
 (0)