Skip to content

Conversation

whatyoubendoing
Copy link

  • Allows users to use the service container across other factories, for
    example in the session storage factory

@GromNaN
Copy link
Collaborator

GromNaN commented Mar 24, 2015

👍 I'll test.

@j0k3r
Copy link
Contributor

j0k3r commented May 20, 2016

@B3njamin could you rebase your branch against the master to avoid these extra commits? Thanks

@whatyoubendoing
Copy link
Author

Sure - done :)

@j0k3r
Copy link
Contributor

j0k3r commented Sep 7, 2016

@miniche could you test that?

- Allows users to use the service container across other factories, for
example in the session storage factory
Copy link
Contributor

@alquerci alquerci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The trade that we can do currently without a refactoring for factories it just to get the depending service outside of the constructor.


// available list of factories
$factories = array('view_cache_manager', 'logger', 'i18n', 'controller', 'request', 'response', 'routing', 'storage', 'user', 'view_cache', 'mailer', 'service_container');
$factories = array('service_container', 'view_cache_manager', 'logger', 'i18n', 'controller', 'request', 'response', 'routing', 'storage', 'user', 'view_cache', 'mailer');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The service container depends on user and routing (e.g; sfContext::getServiceContainer()).

For example try to get a service that depend on user inside the constructor of the response class.
You will caught that the sfContext::getInstance()->getUser() return null.


Another topic but it would be good to provide at least i18n and mailer as service.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants