-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #37 from svycka/improvement/servicemanager-v3-and-…
…eventmanager-v3-support Added ServiceManager v3 and EventManager v3 support
- Loading branch information
Showing
12 changed files
with
45 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,8 +18,7 @@ | |
|
||
namespace ZfrCors\Factory; | ||
|
||
use Zend\ServiceManager\FactoryInterface; | ||
use Zend\ServiceManager\ServiceLocatorInterface; | ||
use Interop\Container\ContainerInterface; | ||
use ZfrCors\Options\CorsOptions; | ||
|
||
/** | ||
|
@@ -28,15 +27,17 @@ | |
* @license MIT | ||
* @author Florent Blaison <[email protected]> | ||
*/ | ||
class CorsOptionsFactory implements FactoryInterface | ||
class CorsOptionsFactory | ||
{ | ||
/** | ||
* {@inheritDoc} | ||
* | ||
* @return CorsOptions | ||
*/ | ||
public function createService(ServiceLocatorInterface $serviceLocator) | ||
public function __invoke(ContainerInterface $container, $requestedName, $options = null) | ||
{ | ||
/* @var $config array */ | ||
$config = $serviceLocator->get('Config'); | ||
$config = $container->get('Config'); | ||
|
||
return new CorsOptions($config['zfr_cors']); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,8 +18,7 @@ | |
|
||
namespace ZfrCors\Factory; | ||
|
||
use Zend\ServiceManager\FactoryInterface; | ||
use Zend\ServiceManager\ServiceLocatorInterface; | ||
use Interop\Container\ContainerInterface; | ||
use ZfrCors\Mvc\CorsRequestListener; | ||
use ZfrCors\Service\CorsService; | ||
|
||
|
@@ -29,16 +28,17 @@ | |
* @license MIT | ||
* @author Florent Blaison <[email protected]> | ||
*/ | ||
class CorsRequestListenerFactory implements FactoryInterface | ||
class CorsRequestListenerFactory | ||
{ | ||
/** | ||
* {@inheritDoc} | ||
* | ||
* @return CorsRequestListener | ||
*/ | ||
public function createService(ServiceLocatorInterface $serviceLocator) | ||
public function __invoke(ContainerInterface $container, $requestedName, $options = null) | ||
{ | ||
/* @var $corsService CorsService */ | ||
$corsService = $serviceLocator->get('ZfrCors\Service\CorsService'); | ||
$corsService = $container->get('ZfrCors\Service\CorsService'); | ||
|
||
return new CorsRequestListener($corsService); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,8 +18,7 @@ | |
|
||
namespace ZfrCors\Factory; | ||
|
||
use Zend\ServiceManager\FactoryInterface; | ||
use Zend\ServiceManager\ServiceLocatorInterface; | ||
use Interop\Container\ContainerInterface; | ||
use ZfrCors\Options\CorsOptions; | ||
use ZfrCors\Service\CorsService; | ||
|
||
|
@@ -29,16 +28,17 @@ | |
* @license MIT | ||
* @author Florent Blaison <[email protected]> | ||
*/ | ||
class CorsServiceFactory implements FactoryInterface | ||
class CorsServiceFactory | ||
{ | ||
/** | ||
* {@inheritDoc} | ||
* | ||
* @return CorsService | ||
*/ | ||
public function createService(ServiceLocatorInterface $serviceLocator) | ||
public function __invoke(ContainerInterface $container, $requestedName, $options = null) | ||
{ | ||
/* @var $corsOptions CorsOptions */ | ||
$corsOptions = $serviceLocator->get('ZfrCors\Options\CorsOptions'); | ||
$corsOptions = $container->get('ZfrCors\Options\CorsOptions'); | ||
|
||
return new CorsService($corsOptions); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters