config/application.config.php

return array(
    'service_manager' => array(
        //'use_defaults' => true,
        'factories'    => array(
            //'Application' => 'Zend\Mvc\Service\ApplicationFactory',
            'Application' => 'Application\Mvc\Service\ApplicationFactory',
        ),
    ),
);


What config options are required to specify which Mvc\ApplicationFactory to
use?

It looks like the ServiceManagerConfig::configureServiceManager method will
always end up trying to initialize the 'Application' factory config.
Whereas I think it should check to see if one has already been specified
instead of resorting to forcing the defaultServiceConfigurations?

I also could not see how to specify the allow_override flag, and wonder why
it is not part of the ServiceManagerConfig? I realize that even if I was
able to specify this value, it would not be what I want anyway. Since in
the above example, I would not want the
defaultServiceConfiguration['factories']['Application'] value to override
the existing configuration.


A while ago, I did end up going down another route, and made some progress
via the service_listener_options, however once it was set up for the
Application factory config, things went south, because the code or
configuration pertaining to 'Config' => Zend\Mvc\Service\ConfigFactory,
which may of been just because it was the next entry in the
defaultServicesConfig?

I don't have the config options for what I tried awhile back anymore, but
it was to do with:

$serviceListener->addServiceManager(
                    $newServiceManager['service_manager'],
                    $newServiceManager['config_key'],
                    $newServiceManager['interface'],
                    $newServiceManager['method']
                );


So how in the global config/application.config.php file is it possible to
override the 'Application' service?

Would it be feasible to see the global config/application.config.php file
specify all the default services that the ServiceListenerFactory setups,
and allow users to easily swap them out via the global config file, even as
example test case?


-- 
Greg

Reply via email to