Restrict scanning for composer.json in themes to certain directory depth (optional)#9013
Conversation
| @@ -1,3 +1,7 @@ | |||
| # UPGRADE FROM 1.0.5 to 1.0.6 | |||
|
|
|||
| * Scanning for `composer.json` file inside themes used to be recursive. This is now limited to the root of each theme. This has always been the intended location for this file. | |||
There was a problem hiding this comment.
This is now limited to the root of each theme. This has always been the intended location for this file.
That's true. What has not been said is that themes root have to be not more than one level below app/themes. Some people might have set up themes like app/themes/vendor/package-name/composer.json and some like app/themes/FooBarTheme/composer.json so for the first ones it would result in a BC break.
We might add an option to FilesystemConfigurationSourceFactory named depth, which defaults to null (being the current behaviour with no limit) and then setting it to 1 would restrict the depth in the recursive file locator.
There was a problem hiding this comment.
Just only one allow app/themes/vendor/package-name/composer.json.
f0c817d to
4211b7e
Compare
|
@pamil Can you have a check again? I've restricted the configuration now to a single integer (optional, default = null). The depth method call inside the recursive file locator can also be called multiple times, allowing users to define e.g. >1 & < 4, but I'm not sure we need something like that. In that rare case user can maybe create their own solution. I think with this change we cover the biggest performance issue (e.g. scanning a node_modules folder). |
|
P.S. Do you also want more tests (functional / phpunit) etc? ThemeBundle has quite some I see. |
|
@stefandoorn but we need to make current configuration tests green again |
|
Hm damn I thought they would pass yesterday. Will look again into it then. |
|
@stefandoorn looks all right! Some functional tests would be great (and an another one for configuration actually). For example, you might add Btw. can you rebase it to 1.1? It feels more like a new feature (restricting scanning depth) and the release is less than a month away anyway :) |
f4a3466 to
daada35
Compare
daada35 to
56b001c
Compare
|
@pamil @lchrusciel Ready to be checked again. Rebased against 1.1 and added functional test / configuration checks. |
|
Thanks Stefan, themes will be lightning fast right now 🥇 |
Uh oh!
There was an error while loading. Please reload this page.