Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for APCu Cache driver #77

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
composer.lock
vendor
.idea
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,8 @@ Configuration
`Doctrine\ORM\Mapping\EntityListenerResolver`.
* **orm.default_cache**:
String or array describing default cache implementation.
* Available cache implementations, one of `array`, `filesystem`, `apc`, `apcu`, `memcache`, `memcached`, `redis`,
`xcache` or `couchbase`. Some implementations may require more configuration than others.
* **orm.add_mapping_driver**:
Function providing the ability to add a mapping driver to an Entity Manager.

Expand Down
3 changes: 3 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
"pimple/pimple": ">=2.1,<4",
"doctrine/orm": "~2.3"
},
"require-dev": {
"phpunit/phpunit" : "~4.0"
},
"autoload": {
"psr-4": {
"Dflydev\\Provider\\DoctrineOrm\\": "src/Dflydev/Provider/DoctrineOrm"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
namespace Dflydev\Provider\DoctrineOrm;

use Doctrine\Common\Cache\ApcCache;
use Doctrine\Common\Cache\ApcuCache;
use Doctrine\Common\Cache\ArrayCache;
use Doctrine\Common\Cache\CacheProvider;
use Doctrine\Common\Cache\FilesystemCache;
Expand Down Expand Up @@ -321,6 +322,10 @@ public function register(Container $container)
return new ApcCache;
});

$container['orm.cache.factory.apcu'] = $container->protect(function () {
return new ApcuCache;
});

$container['orm.cache.factory.xcache'] = $container->protect(function () {
return new XcacheCache;
});
Expand Down