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

How to handle configuration, not services? #6

Open
Koc opened this issue Mar 14, 2012 · 1 comment
Open

How to handle configuration, not services? #6

Koc opened this issue Mar 14, 2012 · 1 comment

Comments

@Koc
Copy link

Koc commented Mar 14, 2012

Hello!

There is part from configuration

services:
    runtime_parameters.security.firewalls.main.remember_me.domain:
        public: false
        class: stdClass
        factory_service: opensky.runtime_config
        factory_method: get
        arguments:
            - security.firewalls.main.remember_me.domain

security:
    firewalls:
        main:
            pattern: .*
            remember_me:
                # ...
                domain: @runtime_parameters.security.firewalls.main.remember_me.domain

It doesnt works as expected:

        $g = new \Symfony\Component\Security\Http\RememberMe\TokenBasedRememberMeServices(array(0 => $b), 'fe1qwd3', 'main', array('name' => 'remember_me', 'lifetime' => '8640000', 'path' => '/',

// as you see - it just use string but not calling service
'domain' => '@runtime_parameters.security.firewalls.main.remember_me.domain',

'secure' => false, 'httponly' => true, 'always_remember_me' => true, 'remember_me_parameter' => '_remember_me'), $c);

What you can advice for me?

@magnusnordlander
Copy link

There's no one-size-fits-all solution to handle this. Config processing is handled by each bundle, so each bundle will have to be considered separately.

Basically, you have two options:

  1. You can fork the bundle, and alter the configuration processing to allow services as an argument. You can then either just use your fork and/or do a PR against the bundle for everyone to be able to use your changes. There is however the risk that the bundle maintainer doesn't want this functionality, in which you'll have to maintain your own fork indefinitely.
  2. You can use a compiler pass to alter the configuration that's been created by the bundle. This may be somewhat easier to maintain (and doesn't involve loads of forks), but it can break with configuration processing updates in the bundle, so you'll need to be watchful when updating bundles...

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

No branches or pull requests

2 participants