Skip to content

Commit c6c159f

Browse files
committed
Merge branch 'master' of https://github.com/PHP-DI/ZF2-Bridge
# Conflicts: # config/module.config.php # src/DI/ZendFramework2/Service/CacheFactory.php
2 parents b0c41d1 + 505890e commit c6c159f

File tree

4 files changed

+28
-3
lines changed

4 files changed

+28
-3
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ php:
44
- 5.5
55
- 5.6
66
- 7.0
7+
- 7.1
78
- hhvm
89

910
before_script:

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,22 @@ return [
134134
];
135135
```
136136

137+
### Enable Memcached cache
138+
139+
If you're using Memcached, you should have only one project per memcached instance.
140+
141+
```php
142+
return [
143+
'phpdi-zf2' => [
144+
'cache' => [
145+
'adapter' => 'memcached',
146+
'host' => 'localhost', // default is localhost
147+
'port' => 11211, // default is 11211
148+
],
149+
]
150+
];
151+
```
152+
137153
## Console commands
138154

139155
### Clear definition cache

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@
1313
},
1414

1515
"require-dev": {
16-
"zendframework/zendframework": "~2.5",
1716
"squizlabs/php_codesniffer": "~2.0",
1817
"phpmd/phpmd" : "~2.0",
19-
"phpunit/phpunit": "~4.8"
18+
"phpunit/phpunit": "~4.8",
19+
"zendframework/zendframework": "^2.5"
2020
},
2121

2222
"autoload": {

config/module.config.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@
88
*/
99
namespace DI\ZendFramework2;
1010

11+
// compatibility with zend > 2.5
12+
$controllerType = 'ControllerLoader';
13+
if (class_exists('\Zend\Version\Version')) {
14+
if (\Zend\Version\Version::compareVersion('2.5.3') <= 0) {
15+
$controllerType = 'ControllerManager';
16+
}
17+
}
18+
1119
return [
1220
'controllers' => [
1321
'invokables' => [
@@ -21,7 +29,7 @@
2129
),
2230

2331
'factories' => [
24-
'ControllerLoader' => __NAMESPACE__ . '\\Service\\ControllerLoaderFactory',
32+
$controllerType => __NAMESPACE__ . '\\Service\\ControllerLoaderFactory',
2533
'DiCache' => __NAMESPACE__ . '\\Service\\CacheFactory\CacheFactory',
2634
],
2735
],

0 commit comments

Comments
 (0)