Details
-
Bug
-
Resolution: Unresolved
-
Medium
-
None
-
None
-
None
Description
The code in method EzSystems\EzPlatformEncoreBundle\DependencyInjection\EzSystemsEzPlatformEncoreExtension\dumpConfigurationPathsToFile() will throw an exception if any folder or file in a bundle is not readable by the current user, even though it is only looking for config files which match a specific directory pattern.
Although this is not necessarily a recommended configuration, it is not too uncommon to temporarily create a file or subfolder in a bundle which is not readable by the process executing the php application, be it apache or php-fpm. In fact, it might even be a good idea, for security reasons.
Which leads me to say that the code in eZPlatformEncoreBundle which tries to find existing configuration for webpack encore should be improved. It should
- only scan folders called `$bundle/Resources/encore`
- throw if any folders with such name exist and are not readable
- not throw if any other existing files / folders are not readable
This can be done f.e. by replacing the usage of the Symfony Finder component with a simple foreach+file_exists loop (or waiting for Symfony to fix https://github.com/symfony/symfony/issues/40401 )