Skip to content

Commit

Permalink
zendframework#6266 - Moved the alias for the ServiceManager to its …
Browse files Browse the repository at this point in the history
…own factory (allows for overrides)
  • Loading branch information
Ocramius committed May 20, 2014
1 parent 843ad2a commit 8652a92
Showing 1 changed file with 4 additions and 18 deletions.
22 changes: 4 additions & 18 deletions library/Zend/Mvc/Service/ServiceManagerConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ public function __construct(array $configuration = array())
},
);

$this->factories['ServiceManager'] = function (ServiceLocatorInterface $serviceLocator) {
return $serviceLocator;
};

$configuration = array_replace_recursive(array(
'invokables' => $this->invokables,
'factories' => $this->factories,
Expand All @@ -127,22 +131,4 @@ public function __construct(array $configuration = array())

parent::__construct($configuration);
}

/**
* Configure the provided service manager instance with the configuration
* in this class.
*
* In addition to using each of the internal properties to configure the
* service manager, also adds an initializer to inject ServiceManagerAware
* and ServiceLocatorAware classes with the service manager.
*
* @param ServiceManager $serviceManager
* @return void
*/
public function configureServiceManager(ServiceManager $serviceManager)
{
parent::configureServiceManager($serviceManager);

$serviceManager->setService('ServiceManager', $serviceManager);
}
}

0 comments on commit 8652a92

Please sign in to comment.