Skip to content

Commit ae9c06c

Browse files
vudaltsovnicolas-grekas
authored andcommitted
[DI] Use GlobResource for non-tracked directories
1 parent 65e0c7e commit ae9c06c

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

ContainerBuilder.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -407,9 +407,13 @@ public function fileExists($path, $trackContents = true)
407407
return $exists;
408408
}
409409

410-
if ($trackContents && is_dir($path)) {
411-
$this->addResource(new DirectoryResource($path, is_string($trackContents) ? $trackContents : null));
412-
} elseif ($trackContents || is_dir($path)) {
410+
if (is_dir($path)) {
411+
if ($trackContents) {
412+
$this->addResource(new DirectoryResource($path, is_string($trackContents) ? $trackContents : null));
413+
} else {
414+
$this->addResource(new GlobResource($path, '/*', false));
415+
}
416+
} elseif ($trackContents) {
413417
$this->addResource(new FileResource($path));
414418
}
415419

0 commit comments

Comments
 (0)