Skip to content

Commit

Permalink
Remove basePath, because it is of no specific use
Browse files Browse the repository at this point in the history
  • Loading branch information
gisostallenberg committed Mar 3, 2016
1 parent 314bed0 commit effa9b3
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions src/FileServer.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,6 @@ class FileServer
*/
private $request;

/**
* The base path to find files.
*
* @var string
*/
private $basePath;

/**
* Constructor.
*
Expand All @@ -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');
}

/**
Expand All @@ -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);
Expand Down

0 comments on commit effa9b3

Please sign in to comment.