-
Notifications
You must be signed in to change notification settings - Fork 2.5k
make 'listeners' key can be configured outside application.config.php #5612
make 'listeners' key can be configured outside application.config.php #5612
Conversation
can you give more insight on what you are doing here? |
@Ocramius for example : I make module and has custom 'listeners' config on my module for specific purpose, and the 'listeners' key will not be called on |
@samsonasik Hmmm to avoid BC maybe we can have a merge with listeners from app config and listeners from modules config ? |
@blanchonvincent done ;). please let me know if I missed something ;) |
$serviceManager = new ServiceManager(new Service\ServiceManagerConfig($smConfig)); | ||
$serviceManager->setService('ApplicationConfig', $configuration); | ||
$serviceManager->get('ModuleManager')->loadModules(); | ||
|
||
$config = array_unique(array_merge($configuration, $serviceManager->get('Config'))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@samsonasik maybe can we merge only $configuration['listeners']
and $serviceManager->get('Config')['listeners']
it will be faster ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@blanchonvincent done, now only merge with key 'listeners'
👍 |
|
||
$configurationListeners = isset($configuration['listeners']) ? $configuration['listeners'] : array(); | ||
$config = $serviceManager->get('Config'); | ||
$configListeners = isset($config['listeners']) ? $config['listeners'] : array(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These variable names are very confusing. May I suggest $listenersFromAppConfig
and $listenersFromConfigService
instead?
@weierophinney done. fixed. please let me know if I missed something ;) |
because in ZF2 Skeleton App use : Zend\Mvc\Application::init(require 'config/application.config.php')
….config make 'listeners' key can be configured outside application.config.php
Merged to develop for release with 2.3.0. |
because in ZF2 Skeleton App use : Zend\Mvc\Application::init(require 'config/application.config.php')