|Generation of Proxies and Hydrators||weaverryan||1/19/11 3:32 PM|
Requiring the proxies and hydrators to be generated really kicked my arse last night... and I'm *kinda* smart. I don't think requiring this of all users is realistic, and I think it'll cause a lot of heartache either during development (when they finally switch into the prod environment) or after they deploy. I realize you can change this setting, but user's will only discover this AFTER they've deployed to prod or hit their head against their desk for hours :)
I realize the problem with generating on every request in production, but isn't there a middleground? What about the following (by default):
* always generate these classes in dev
* generate conditionally using a file_exists() in prod
* Keep the option to never generate proxies or hydrators for advanced users (but it has to be explicitly enabled).
Requiring these classes to be generated effectively means that you need to have an automated deployment. That's best practice but just not a reality. Bulat proposed that there could be a check.php or CLI task that checks your app for "production" settings and warns you when things are non-ideal. Perhaps that could be rolled into whatever deployment tools we eventually craft and perfect.
|Re: Generation of Proxies and Hydrators||Henrik Bjørnskov||1/20/11 2:18 AM|
|Re: [symfony-devs] Re: Generation of Proxies and Hydrators||weaverryan||1/20/11 4:01 AM|
I'm aware of those options - please read the rest of my post that proposes that the defaults for these options makes the learning curve too great.
On Jan 20, 2011 4:18 AM, "Henrik Bjornskov" <y...@iamhenrik.se> wrote:
> If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com
> You received this message because you are subscribed to the Google
> Groups "symfony developers" group.
> To post to this group, send email to symfon...@googlegroups.com
> To unsubscribe from this group, send email to
> For more options, visit this group at
|Re: [symfony-devs] Re: Generation of Proxies and Hydrators||Lukas Kahwe Smith||1/20/11 4:04 AM|
> I'm aware of those options - please read the rest of my post that proposes that the defaults for these options makes the learning curve too great.
I think a check production config command would be a better approach than setting these to on by default.
|Re: [symfony-devs] Re: Generation of Proxies and Hydrators||weaverryan||1/20/11 4:10 AM|
I think that still requires too much from a beginner, but if I'm wrong, then the generation of these classes should be documented to be just as central as the build commands in doctrine1 (change your schema, then always rebuild) and it should be off everywhere.
But still, what about the middleground proposal?
|Re: [symfony-devs] Generation of Proxies and Hydrators||Lukas Kahwe Smith||1/20/11 4:13 AM|
> I realize the problem with generating on every request in production, but isn't there a middleground? What about the following (by default):
that file_exists() is pretty expensive to force upon everyone and adding an if to decide when to do the file_exists() is just ugly imho.
|Re: [symfony-devs] Generation of Proxies and Hydrators||Benjamin Eberlei||1/20/11 4:18 AM|
@ryan: This is a Doctrine feature to change, so Symfony couldn't even wrap
around it at the moment. We are changing this slightly for 2.1 to allow 2
additional proxy generation methods:
Your suggested file_exists() method is dangerous in case of cache slams
On Thu, 20 Jan 2011 13:13:11 +0100, Lukas Kahwe Smith <m...@pooteeweet.org>
|Re: [symfony-devs] Generation of Proxies and Hydrators||weaverryan||1/20/11 5:12 AM|
Thanks for the good explanation guys. Two things then:
- perhaps we should turn auto-generation off in all environments to be consistent?
- it should be well-documented that the generation tasks be run after every model change so that proxies/hydrators aren't an afterthought
What do you guys think? If you don't generate hydrators, for example, the error is simply a failed require call on a non-existent file in the cache dir. It's not obvious what went wrong or how to fix it. That's really where my concern lies.
|Re: [symfony-devs] Generation of Proxies and Hydrators||Lukas Kahwe Smith||1/20/11 5:22 AM|
> Thanks for the good explanation guys. Two things then:
well its set explicitly to the debug setting. so the setting is there right there for everyone to see in config.yml
> - it should be well-documented that the generation tasks be run after every model change so that proxies/hydrators aren't an afterthought
sure documentation is good, check command is better
|Re: [symfony-devs] Generation of Proxies and Hydrators||weaverryan||1/20/11 7:11 AM|
I'm just thinking that consistency between the environments is important and, unlike Twig templates, it doesn't seem like hydrators/proxies are generated from code that will be changed very often (you occasionally modify an entity, then rebuilt hydrators/proxies).
On the check command, how could that help unless the check command is able to tell you that your proxies/hydrators are out-of-date and still need to be generated before pushing to production?
Thanks for everyone's feedback.