mirror of
https://github.com/DirectoryLister/DirectoryLister.git
synced 2025-09-02 02:12:37 +02:00
Moved finder depth filter to DirectoryController
This commit is contained in:
@@ -50,7 +50,7 @@ class FinderComposer
|
||||
*/
|
||||
public function __invoke(): void
|
||||
{
|
||||
$finder = Finder::create()->depth(0)->followLinks();
|
||||
$finder = Finder::create()->followLinks();
|
||||
$finder->ignoreVCS($this->config->get('app.hide_vcs_files', false));
|
||||
$finder->filter(function (SplFileInfo $file) {
|
||||
return ! $this->hiddenFiles()->contains($file->getRealPath());
|
||||
|
@@ -47,7 +47,7 @@ class DirectoryController
|
||||
public function __invoke(Finder $files, Response $response, string $path = '.')
|
||||
{
|
||||
try {
|
||||
$files = $files->in($path);
|
||||
$files = $files->in($path)->depth(0);
|
||||
} catch (DirectoryNotFoundException $exception) {
|
||||
return $this->view->render($response->withStatus(404), '404.twig');
|
||||
}
|
||||
|
Reference in New Issue
Block a user