2017 © Pedro Peláez
 

library doctrine-adapter-bundle

A bundle that registers Doctrine cache implementations as Symfony services supporting PSR-6 and tagging

image

cache/doctrine-adapter-bundle

A bundle that registers Doctrine cache implementations as Symfony services supporting PSR-6 and tagging

  • Saturday, January 23, 2016
  • by aequasi
  • Repository
  • 2 Watchers
  • 0 Stars
  • 3,173 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 5 Versions
  • 1 % Grown

The README.md

This bundle is deprecated in favor for AdapterBundle.

Doctrine Adapter Bundle

Build Status SensioLabsInsight, (*1)

This bundle helps you configurate and register PSR-6 cache services. The bundle uses Doctrine as cache implementation with help from DoctrineAdapter to make it PSR-6 complient., (*2)

To Install

Run the following in your project root, assuming you have composer set up for your project, (*3)

composer require cache/doctrine-adapter-bundle

Add the bundle to app/AppKernel.php, (*4)

$bundles(
    // ...
    new Cache\Adapter\DoctrineAdapterBundle\DoctrineAdapterBundle(),
    // ...
);

Configuration

cache_adapter_doctrine:
  providers:
    acme_memcached:
      type: memcached
      persistent: true # Boolean or persistent_id
      namespace: mc
      hosts:
        - { host: localhost, port: 11211 }
    acme_redis:
      type: redis
      hosts:
        main:
          host: 127.0.0.1
          port: 6379
    acme_file_system_cache:
      type: file_system
      extension: '.fsc'
      directory: '%kernel.root_dir%/var/storage/fs_cache/'
    acme_php_file_cache:
      type: php_file
      extension: '.cache'
      directory: '%kernel.root_dir%/var/storage/'
    acme_array_cache:
      type: array
    acme_apc_cache:
      type: apc
      namespace: my_ns

Usage

When using a configuration like below, you will get a service with the id cache.provider.acme_apc_cache., (*5)

cache_adapter_doctrine:
  providers:
    acme_apc_cache:
      type: apc
      namespace: my_ns

Use the new service as any PSR-6 cache., (*6)

``` php /** @var CacheItemPoolInterface $cache */ $cache = $this->container->get('cache.provider.acme_apc_cache'); // Or $cache = $this->container->get('cache'); // This is either the default provider, or the first provider in the config, (*7)

/** @var CacheItemInterface $item */ $item = $cache->getItem('cache-key'); $item->set('foobar'); $item->expiresAfter(3600); $cache->save($item); ```, (*8)

The Versions

23/01 2016

dev-master

9999999-dev https://github.com/php-cache/doctrine-cache-bundle

A bundle that registers Doctrine cache implementations as Symfony services supporting PSR-6 and tagging

  Sources   Download

MIT

The Requires

 

The Development Requires

02/01 2016

0.2.0

0.2.0.0 https://github.com/php-cache/doctrine-cache-bundle

A bundle that registers Doctrine cache implementations as Symfony services supporting PSR-6 and tagging

  Sources   Download

MIT

The Requires

 

The Development Requires

23/12 2015

0.1.2

0.1.2.0 https://github.com/php-cache/doctrine-cache-bundle

A bundle that registers Doctrine cache implementations as Symfony services supporting PSR-6 and tagging

  Sources   Download

MIT

The Requires

 

The Development Requires

15/12 2015

0.1.1

0.1.1.0 https://github.com/php-cache/doctrine-cache-bundle

A bundle that registers Doctrine cache implementations as Symfony services supporting PSR-6 and tagging

  Sources   Download

MIT

The Requires

 

The Development Requires