Skip to content
This repository was archived by the owner on Jan 29, 2020. It is now read-only.

ControllerLoaderFactory fix + deprecated (v2) #152

Merged
merged 2 commits into from
Jun 11, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions src/Service/ControllerLoaderFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
use Zend\ServiceManager\FactoryInterface;
use Zend\ServiceManager\ServiceLocatorInterface;

/**
* @deprecated please use the {@see \Zend\Mvc\Service\ControllerManagerFactory} factory instead:
* this class will be removed in release 3.0
*/
class ControllerLoaderFactory implements FactoryInterface
{
/**
Expand All @@ -33,8 +37,13 @@ class ControllerLoaderFactory implements FactoryInterface
*/
public function createService(ServiceLocatorInterface $serviceLocator)
{
$controllerLoader = new ControllerManager();
$controllerLoader->setServiceLocator($serviceLocator);
trigger_error(sprintf(
'%s is deprecated; please use %s instead',
__CLASS__,
ControllerManagerFactory::class
), E_USER_DEPRECATED);

$controllerLoader = new ControllerManager($serviceLocator);
$controllerLoader->addPeeringServiceManager($serviceLocator);

$config = $serviceLocator->get('Config');
Expand Down