Beispiel #1
0
 public function resolve($path)
 {
     if (is_null($this->top)) {
         return $path;
     }
     if (is_null($path)) {
         throw new Exception("path is null!");
     }
     if (PathUtil::startsWith($path, PathUtil::SEP)) {
         $path = substr($path, 1);
     }
     $r = PathUtil::rel($this->top, $path);
     if (PathUtil::startsWith($r, $this->top)) {
         return $r;
     }
     throw new Exception("Cannot access to {$path}");
 }
Beispiel #2
0
 public function startsWith($prefix)
 {
     return PathUtil::startsWith($this->name(), $prefix);
 }