-
My team has just updated a large, ~10 years old application to Symfony 6.4, and we're now also trying to get rid of the deprecated SensioFrameworkExtraBundle. One of the bundle's features we're using extensively is ParamConverters, so we've rewritten those as CustomValueResolvers. To make use of them, we had to tag our controllers with The application uses an ORM (Propel) which generates base model classes from its schema definitions, and subclasses for us to insert custom code. The base classes are not checked into the source code repository, to make sure they're generated freshly for each build and can't accidentally diverge from the schema. Now here's the problem: The Worst of all, this means that, if the generated classes don't exist yet, we can't generate them as the generation is done by a Symfony command, which needs to compile the service container before running, which needs to autowire the controller arguments, which fails if the generated classes don't exist yet. The only way out of this dilemma appears to be to check the base classes into Git so they'll always exist. But ideally we would like to avoid that, for the reason mentioned above and also to avoid potential scenarios where the dependency of the code generation command on the previous existence of the generated code might still cause trouble. If anyone knows a way to accomplish this, we'd appreciate a hint. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
{{title}}
{{editor}}'s edit
{{editor}}'s edit
-
This is a deal breaker if you don’t want to version the generated classes, but I’m pretty sure it could be done in a compiler pass. Set it a priority higher than |
Beta Was this translation helpful? Give feedback.
This is a deal breaker if you don’t want to version the generated classes, but I’m pretty sure it could be done in a compiler pass. Set it a priority higher than
0
to run before theRegisterControllerArgumentLocatorsPass
and the classes would be generated at build time.