RoutePluginManager should be retrieved from a ServiceLocator #3516

Closed
Ocramius opened this Issue Jan 22, 2013 · 6 comments

Projects

None yet

3 participants

@Ocramius
Member

The current implementation of the Zend\Mvc\Router\SimpleRouteStack instantiates the Zend\Mvc\Router\RoutePluginManager directly.

An impressive degree of flexibility can be obtained by having this plugin manager come from a service locator.

This would automatically unlock cool things like:

return array(
    'router' => array(
        'routes' => array( /* yadda */ ),
        'invokables' => array( /* yadda */ ),
        'initializers' => array( /* yadda */ ),
        'factories' => array( /* yadda */ ),
        'abstract_factories' => array( /* yadda */ ),
    ),
);

All this can be achieved without BC breaks by:

  • implementing Zend\Mvc\Service\RoutePluginManagerFactory (maybe extending Zend\Mvc\Service\AbstractPluginManagerFactory
  • modifying Zend\Mvc\Service\RouterFactory so that the plugin manager is passed to the newly instantiated route stack

Ping @DASPRiD @bakura10

@weierophinney
Member

@ocramius Any chance you can get a PR in in the next day or two?
On Jan 22, 2013 8:14 AM, "Marco Pivetta" notifications@github.com wrote:

The current implementation of the Zend\Mvc\Router\SimpleRouteStackinstantiates the
Zend\Mvc\Router\RoutePluginManager directly.

An impressive degree of flexibility can be obtained by having this plugin
manager come from a service locator.

This would automatically unlock cool things like:

return array(
'router' => array(
'routes' => array( /* yadda / ),
),
'invokables' => array( /
yadda / ),
'initializers' => array( /
yadda / ),
'factories' => array( /
yadda / ),
'abstract_factories' => array( /
yadda */ ),);

All this can be achieved without BC breaks by:

  • implementing Zend\Mvc\Service\RoutePluginManagerFactory (maybe
    extending Zend\Mvc\Service\AbstractPluginManagerFactory
  • modifying Zend\Mvc\Service\RouterFactory so that the plugin manager
    is passed to the newly instantiated route stack

Ping @DASPRiD https://github.com/DASPRiD @bakura10https://github.com/bakura10


Reply to this email directly or view it on GitHubhttps://github.com/zendframework/zf2/issues/3516.

@Ocramius
Member

@weierophinney yes, ask @bakura10. He will most probably handle it today.

@bakura10
Contributor

I'm doing this for today.

@weierophinney
Member

Awesome, thank you @bakura10 ! Ping one of my team or the CR team to review
when it's ready (I'm travelling to PHP Benelux).

On Tue, Jan 22, 2013 at 10:53 AM, Michaël Gallego
notifications@github.comwrote:

I'm doing this for today.


Reply to this email directly or view it on GitHubhttps://github.com/zendframework/zf2/issues/3516#issuecomment-12553761.

Matthew Weier O'Phinney
matthew@weierophinney.net
http://mwop.net/

@bakura10
Contributor

@Maks3w @ralphschindler could you review it thx ? :)

@Ocramius
Member

I think this one can be closed.

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