-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
php templating engine service is inaccessible (set to private) #7254
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
Comments
Why would you need to access this service ? You can use the |
because addGlobals (and many other methods) aren't available on the delegating engine nor can i grab the php engine directly because getEngine is protected. |
If you want to add some globals, you should use a compiler pass to add a method call on the service definition instead of getting the service somewhere during the boot process or the kernel events. This way, this keeps the service lazy-loaded and ensures that your global is always set when using the service. |
i saw that the twig engine was available as a public service, so i suggested the same for the php engine. is there a reason for that? |
perhaps the real problem is that the constructor of the PHPEngine should be more flexible and not just force a single global. I wonder if there are any other folks who are interested in the phpengine who have any ideas on that? It seems to be somewhat illmaintained comparatively. |
oh BTW.. i cannot simply set globals at compile time, some of them are based on the request. So a compiler pass will not solve (all) my problems. |
Moving |
This PR was merged into the master branch. Discussion ---------- [Templating|FrameworkBundle] Made DelegatingEngine::getEngine() public | Q | A | ------------- | --- | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #7254 | License | MIT | Doc PR | - As a bonus I've covered both classes with tests. Commits ------- a54cbff [FrameworkBundle] Made DelegatingEngine::getEngine() public. 3f84cd3 [Templating] Made DelegatingEngine::getEngine() public. 0a72a99 [FrameworkBundle] Added tests for the DelegatingEngine. 6c31ab2 [Templating] Added tests for the DelegatingEngine.
Can we change the service to public? If so, would that be considered a bug
fix or a new feature?
The text was updated successfully, but these errors were encountered: