zendframework / zendframework

Official Zend Framework repository
https://framework.zend.com/
BSD 3-Clause "New" or "Revised" License
5.5k stars 2.55k forks source link

Build service names according to the configuration #3360

Closed egeloen closed 11 years ago

egeloen commented 11 years ago

Hey!

I use ZF 2.0.6 & after search I can't find a way to build service names dynamically according to the configuration.

Configuration:

return array(
    'fridge_dbal' => array(
        'default_connection' => 'main',
        'connections' => array(
            'main' => array(
                'parameters' => array( /* ... */ ),
            ),
            'blog' => array(
                'parameters' => array( /* ... */ ),
            ),
        ),
)

Builded services:

$mainConnection = $sm->get('fridge.dbal.main_connection');
$blogConnection = $sm->get('fridge.dbal.blog_connection');

// Alias for fridge.dbal.main_connection
$defaultConnection = $sm->get('fridge.dbal.default_connection');

Is there a way to archieve that?

Regards

weierophinney commented 11 years ago

This is not an issue as reported; please direct this question to the relevant mailing list (fw-general@lists.zend.com / http://framework.zend.com/archives), the zend-framework2 tag on StackOverflow, or #zftalk on Freenode IRC.