Closed tristanlins closed 8 years ago
Which logic? All?
Only allow simple assignments?
How to determine if it is a config.php
in contao context?
Only allow simple assignments?
Yes
How to determine if it is a config.php in contao context?
Thats a good question and where is the config.php
located? ...
I have sometimes a condition between frontend and backbend in the config.php. for example for adding stylesheets for the back end.
Don't see why this would be a bad coding style.
Don't see why this would be a bad coding style.
Per definition a configuration must be static, otherwise it is not cacheable. Logic in the internal cache sometimes break your extension. There may be decisions that are "not critical" like the FE/BE decision, but at all I don't want to whitelist something.
Also in the config.php
you are still in the bootstrapping process which should not contain such logic.
A better way is to use the initializeSystem
hook for logic.
But in the past - before we had the initializeSystem
hook - writing such hacks into the config.php
was a working solution.
This is merely now invalid as phpcq is not ccabs anymore and therefore does not handle config.php files.
We should add a rule that check for logic in the
config.php
.