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

Commit 9ab3288

Browse files
committed
Merge branch 'feature/35' into develop
Close #35
2 parents 5ae42fc + d9ca597 commit 9ab3288

16 files changed

+459
-223
lines changed

.travis.yml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,28 @@ matrix:
1717
- php: 5.5
1818
env:
1919
- EXECUTE_CS_CHECK=true
20+
- php: 5.5
21+
env:
22+
- ZEND_EVENTMANAGER_VERSION="^2.6.2"
23+
- ZEND_SERVICEMANAGER_VERSION="^2.7.5"
2024
- php: 5.6
2125
env:
2226
- EXECUTE_TEST_COVERALLS=true
27+
- php: 5.6
28+
env:
29+
- ZEND_EVENTMANAGER_VERSION="^2.6.2"
30+
- ZEND_SERVICEMANAGER_VERSION="^2.7.5"
31+
- php: 7
2332
- php: 7
33+
env:
34+
- ZEND_EVENTMANAGER_VERSION="^2.6.2"
35+
- ZEND_SERVICEMANAGER_VERSION="^2.7.5"
36+
- php: hhvm
2437
- php: hhvm
38+
env:
39+
- ZEND_EVENTMANAGER_VERSION="^2.6.2"
40+
- ZEND_SERVICEMANAGER_VERSION="^2.7.5"
2541
allow_failures:
26-
- php: 7
2742
- php: hhvm
2843

2944
notifications:
@@ -34,6 +49,11 @@ before_install:
3449
- if [[ $EXECUTE_TEST_COVERALLS != 'true' ]]; then phpenv config-rm xdebug.ini || return 0 ; fi
3550
- composer self-update
3651
- if [[ $EXECUTE_TEST_COVERALLS == 'true' ]]; then composer require --dev --no-update satooshi/php-coveralls ; fi
52+
- if [[ $ZEND_EVENTMANAGER_VERSION != '' ]]; then composer require --no-update "zendframework/zend-eventmanager:$ZEND_EVENTMANAGER_VERSION" ; fi
53+
- if [[ $ZEND_EVENTMANAGER_VERSION == '' ]]; then composer require --no-update "zendframework/zend-eventmanager:^3.0" ; fi
54+
- if [[ $ZEND_SERVICEMANAGER_VERSION != '' ]]; then composer require --dev --no-update "zendframework/zend-servicemanager:$ZEND_SERVICEMANAGER_VERSION" ; fi
55+
- if [[ $ZEND_SERVICEMANAGER_VERSION == '' ]]; then composer require --dev --no-update "zendframework/zend-servicemanager:^3.0.3" ; fi
56+
- if [[ $ZEND_SERVICEMANAGER_VERSION == '' ]]; then composer remove --dev --no-update zendframework/zend-mvc zendframework/zend-session ; fi
3757

3858
install:
3959
- travis_retry composer install --no-interaction --ignore-platform-reqs

CHANGELOG.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
All notable changes to this project will be documented in this file, in reverse chronological order by release.
44

5-
## 3.0.0 - TBD
5+
## 2.6.0 - TBD
66

77
### Added
88

@@ -22,14 +22,15 @@ All notable changes to this project will be documented in this file, in reverse
2222

2323
### Fixed
2424

25-
- [#15](https://github.com/zendframework/zend-view/pull/15) updates the codebase
26-
to work with the upcoming zend-eventmanager v3 release. Primarily, these are
27-
changes to how events are triggered to ensure they continue working correctly.
28-
- [#17](https://github.com/zendframework/zend-view/pull/17) updates the codebase
29-
to work with the upcoming zend-servicemanager v3 release. This change is
30-
transparent to the end user, as it mostly affects only how the plugin managers
31-
and various helper factories are implemented, while leaving the functionality
32-
the same.
25+
- [#15](https://github.com/zendframework/zend-view/pull/15),
26+
[#17](https://github.com/zendframework/zend-view/pull/17),
27+
[#35](https://github.com/zendframework/zend-view/pull/35), and
28+
[#42](https://github.com/zendframework/zend-view/pull/42) update the component
29+
to be forwards-compatible with the v3 releases of zend-eventmanager,
30+
zend-servicemanager, and zend-stdlib. The changes include:
31+
- changes to how events are triggered to ensure they continue working correctly.
32+
- updates to the plugin manager to be forwards-compatible.
33+
- updates to helper factories to be forwards-compatible.
3334

3435
## 2.5.4 - TBD
3536

composer.json

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -14,31 +14,30 @@
1414
},
1515
"require": {
1616
"php": "^5.5 || ^7.0",
17-
"zendframework/zend-eventmanager": "dev-develop as 2.7.0",
18-
"zendframework/zend-loader": "~2.5",
19-
"zendframework/zend-stdlib": "~2.5"
17+
"zendframework/zend-eventmanager": "^2.6.2 || ^3.0",
18+
"zendframework/zend-loader": "^2.5",
19+
"zendframework/zend-stdlib": "^2.7 || ^3.0"
2020
},
2121
"require-dev": {
22-
"zendframework/zend-authentication": "~2.5",
23-
"zendframework/zend-cache": "~2.5",
24-
"zendframework/zend-config": "~2.5",
25-
"zendframework/zend-console": "~2.5",
26-
"zendframework/zend-escaper": "~2.5",
27-
"zendframework/zend-feed": "~2.5",
28-
"zendframework/zend-filter": "~2.5",
29-
"zendframework/zend-http": "~2.5",
30-
"zendframework/zend-i18n": "~2.5",
31-
"zendframework/zend-json": "~2.5",
32-
"zendframework/zend-log": "~2.5",
33-
"zendframework/zend-modulemanager": "dev-develop as 2.7.0",
34-
"zendframework/zend-mvc": "~2.5",
35-
"zendframework/zend-navigation": "~2.5",
36-
"zendframework/zend-paginator": "~2.5",
37-
"zendframework/zend-permissions-acl": "~2.5",
38-
"zendframework/zend-serializer": "~2.5",
39-
"zendframework/zend-servicemanager": "dev-develop as 2.7.0",
40-
"zendframework/zend-session": "dev-master",
41-
"zendframework/zend-uri": "~2.5",
22+
"zendframework/zend-authentication": "^2.5",
23+
"zendframework/zend-cache": "^2.6.1",
24+
"zendframework/zend-config": "^2.6",
25+
"zendframework/zend-console": "^2.6",
26+
"zendframework/zend-escaper": "^2.5",
27+
"zendframework/zend-feed": "^2.7",
28+
"zendframework/zend-filter": "^2.6.1",
29+
"zendframework/zend-http": "^2.5.4",
30+
"zendframework/zend-i18n": "^2.6",
31+
"zendframework/zend-json": "^2.6.1",
32+
"zendframework/zend-log": "^2.7",
33+
"zendframework/zend-mvc": "^2.6.1",
34+
"zendframework/zend-navigation": "^2.5",
35+
"zendframework/zend-paginator": "^2.5",
36+
"zendframework/zend-permissions-acl": "^2.6",
37+
"zendframework/zend-serializer": "^2.6.1",
38+
"zendframework/zend-session": "^2.5",
39+
"zendframework/zend-servicemanager": "^2.7.5 || ^3.0.3",
40+
"zendframework/zend-uri": "^2.5",
4241
"fabpot/php-cs-fixer": "1.7.*",
4342
"phpunit/PHPUnit": "~4.0"
4443
},

src/Helper/Service/FlashMessengerFactory.php

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
namespace Zend\View\Helper\Service;
1111

1212
use Interop\Container\ContainerInterface;
13-
use Zend\ServiceManager\Factory\FactoryInterface;
13+
use Zend\ServiceManager\FactoryInterface;
14+
use Zend\ServiceManager\ServiceLocatorInterface;
1415
use Zend\View\Helper\FlashMessenger;
1516

1617
class FlashMessengerFactory implements FactoryInterface
@@ -25,6 +26,10 @@ class FlashMessengerFactory implements FactoryInterface
2526
*/
2627
public function __invoke(ContainerInterface $container, $name, array $options = null)
2728
{
29+
// test if we are using Zend\ServiceManager v2 or v3
30+
if (! method_exists($container, 'configure')) {
31+
$container = $container->getServiceLocator();
32+
}
2833
$helper = new FlashMessenger();
2934
$controllerPluginManager = $container->get('ControllerPluginManager');
3035
$flashMessenger = $controllerPluginManager->get('flashmessenger');
@@ -47,4 +52,15 @@ public function __invoke(ContainerInterface $container, $name, array $options =
4752

4853
return $helper;
4954
}
55+
56+
/**
57+
* Create service
58+
*
59+
* @param ServiceLocatorInterface $serviceLocator
60+
* @return mixed
61+
*/
62+
public function createService(ServiceLocatorInterface $serviceLocator, $rName = null, $cName = null)
63+
{
64+
return $this($serviceLocator, $cName);
65+
}
5066
}

src/Helper/Service/IdentityFactory.php

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
namespace Zend\View\Helper\Service;
1111

1212
use Interop\Container\ContainerInterface;
13-
use Zend\ServiceManager\Factory\FactoryInterface;
13+
use Zend\ServiceManager\FactoryInterface;
14+
use Zend\ServiceManager\ServiceLocatorInterface;
1415
use Zend\View\Helper\Identity;
1516

1617
class IdentityFactory implements FactoryInterface
@@ -25,10 +26,25 @@ class IdentityFactory implements FactoryInterface
2526
*/
2627
public function __invoke(ContainerInterface $container, $name, array $options = null)
2728
{
29+
// test if we are using Zend\ServiceManager v2 or v3
30+
if (! method_exists($container, 'configure')) {
31+
$container = $container->getServiceLocator();
32+
}
2833
$helper = new Identity();
2934
if ($container->has('Zend\Authentication\AuthenticationService')) {
3035
$helper->setAuthenticationService($container->get('Zend\Authentication\AuthenticationService'));
3136
}
3237
return $helper;
3338
}
39+
40+
/**
41+
* Create service
42+
*
43+
* @param ServiceLocatorInterface $serviceLocator
44+
* @return mixed
45+
*/
46+
public function createService(ServiceLocatorInterface $serviceLocator, $rName = null, $cName = null)
47+
{
48+
return $this($serviceLocator, $cName);
49+
}
3450
}

0 commit comments

Comments
 (0)