diff --git a/src/FileServer.php b/src/FileServer.php index 5d04360..7757c9c 100644 --- a/src/FileServer.php +++ b/src/FileServer.php @@ -30,13 +30,6 @@ class FileServer */ private $request; - /** - * The base path to find files. - * - * @var string - */ - private $basePath; - /** * Constructor. * @@ -53,8 +46,6 @@ public function __construct($from, $to, Request $request = null) $request = Request::createFromGlobals(); } $this->request = $request; - - $this->basePath = $this->request->server->get('DOCUMENT_ROOT'); } /** @@ -80,7 +71,7 @@ public function getResponse() { $requestPath = parse_url($this->request->server->get('REQUEST_URI'), PHP_URL_PATH); - $filePath = $this->basePath.$this->from.substr($requestPath, strlen($this->to)); + $filePath = $this->from.substr($requestPath, strlen($this->to)); if (is_file($filePath)) { $file = new File($filePath);