protected function getFile(WebRequest $request)
    {
        $path = realpath($this->dirRoot . DIRECTORY_SEPARATOR . $request->getPath());
        if (false === $path) {
            throw new Exceptions\HttpStatusError(
                "File not found.",
                404
            );
        }
        if (is_dir($path)) {
            $path .= DIRECTORY_SEPARATOR . $this->index;
        }
        
        $contents = null;
        $info     = pathinfo($path);
        if ($info["extension"] == "php") {
            ob_start();
            /** @noinspection PhpIncludeInspection */
            include($path);
            $contents = ob_get_contents();
            ob_end_clean();
        } else {
            $contents = file_get_contents($path);
        }
        
        return $contents;
    }