Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support writing proxy classes to files #49

Closed
karsten-sbs opened this issue Dec 14, 2021 · 5 comments
Closed

Support writing proxy classes to files #49

karsten-sbs opened this issue Dec 14, 2021 · 5 comments
Assignees
Labels
easy-pick enhancement New feature or request
Milestone

Comments

@karsten-sbs
Copy link

In my project I need to use a lazy injection. I defined it as

'dependencies' => [
        'services' => [
            Foo::class => DI\create(Foo::class)->constructor(DI\get(Bar::class))->lazy(),
        ],
        ...

and it's working fine. However, in production mode I'd like to have the generated proxy class written to a file as described in https://php-di.org/doc/lazy-injection.html#optimizing-performances Could you please add support for that?

@elie29
Copy link
Owner

elie29 commented Dec 15, 2021

Hey @karsten-sbs, I will check this and add enable proxy, thx for your feedback

@karsten-sbs
Copy link
Author

Thanks, would be really nice.

@elie29
Copy link
Owner

elie29 commented Dec 15, 2021

@karsten-sbs I made the modification on enable-proxy branch, could you test it?

@elie29 elie29 self-assigned this Dec 15, 2021
@elie29 elie29 added easy-pick enhancement New feature or request labels Dec 15, 2021
@elie29 elie29 added this to the 8.x milestone Dec 15, 2021
@karsten-sbs
Copy link
Author

Thank you! Yes, it works nicely.

@elie29 elie29 reopened this Dec 15, 2021
@elie29
Copy link
Owner

elie29 commented Dec 15, 2021

Great, I will add some tests and release a new version

elie29 pushed a commit that referenced this issue Dec 16, 2021
@elie29 elie29 closed this as completed Dec 16, 2021
elie29 added a commit that referenced this issue Dec 16, 2021
* ✨ Support writing proxy classes to files #49

* ✔️ Test added #49

Co-authored-by: Elie NEHME <elie.nehme@soprasterianext.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
easy-pick enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants