Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/PHP-DI/ZF2-Bridge
Browse files Browse the repository at this point in the history
# Conflicts:
#	config/module.config.php
#	src/DI/ZendFramework2/Service/CacheFactory.php
  • Loading branch information
Rastusik committed Aug 16, 2017
2 parents b0c41d1 + 505890e commit c6c159f
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 3 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ php:
- 5.5
- 5.6
- 7.0
- 7.1
- hhvm

before_script:
Expand Down
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,22 @@ return [
];
```

### Enable Memcached cache

If you're using Memcached, you should have only one project per memcached instance.

```php
return [
'phpdi-zf2' => [
'cache' => [
'adapter' => 'memcached',
'host' => 'localhost', // default is localhost
'port' => 11211, // default is 11211
],
]
];
```

## Console commands

### Clear definition cache
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
},

"require-dev": {
"zendframework/zendframework": "~2.5",
"squizlabs/php_codesniffer": "~2.0",
"phpmd/phpmd" : "~2.0",
"phpunit/phpunit": "~4.8"
"phpunit/phpunit": "~4.8",
"zendframework/zendframework": "^2.5"
},

"autoload": {
Expand Down
10 changes: 9 additions & 1 deletion config/module.config.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@
*/
namespace DI\ZendFramework2;

// compatibility with zend > 2.5
$controllerType = 'ControllerLoader';
if (class_exists('\Zend\Version\Version')) {
if (\Zend\Version\Version::compareVersion('2.5.3') <= 0) {
$controllerType = 'ControllerManager';
}
}

return [
'controllers' => [
'invokables' => [
Expand All @@ -21,7 +29,7 @@
),

'factories' => [
'ControllerLoader' => __NAMESPACE__ . '\\Service\\ControllerLoaderFactory',
$controllerType => __NAMESPACE__ . '\\Service\\ControllerLoaderFactory',
'DiCache' => __NAMESPACE__ . '\\Service\\CacheFactory\CacheFactory',
],
],
Expand Down

0 comments on commit c6c159f

Please sign in to comment.