Removed DirectoryController::isRoot() method

This commit is contained in:
Chris Kankiewicz
2020-02-05 10:16:33 -07:00
parent c00b8daf5c
commit 5f86bf79b1
2 changed files with 1 additions and 14 deletions

View File

@@ -64,24 +64,11 @@ class DirectoryController
sprintf('/(?:.*)%s(?:.*)/i', preg_quote($search, '/'))
) : $files->depth(0),
'path' => $path,
'is_root' => $this->isRoot($path),
'readme' => $this->readme($path),
'search' => $search,
]);
}
/**
* Determine if a provided path is the root path.
*
* @param string $path
*
* @return bool
*/
protected function isRoot(string $path): bool
{
return realpath($path) === realpath($this->container->get('base_path'));
}
/**
* Return the README file for a given path.
*

View File

@@ -21,7 +21,7 @@
<ul id="file-list">
<li>
{% if not search and not is_root %}
{% if not search and path != '.' %}
{{ include('components/file.twig', { parentDir: true }) }}
{% endif %}
</li>