2017 © Pedro Peláez
 

library doctrine-encrypted-cache-bundle

Doctrine Encrypted Cache Bundle

image

trt/doctrine-encrypted-cache-bundle

Doctrine Encrypted Cache Bundle

  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 1 % Grown

The README.md

Doctrine Encoded Cache Bundle

This bundle integrates a Symfony2 application with the trt/doctrine-encoded-cache library., (*1)

Why cache encoding?

Because sometimes there is the need to make the cached data unreadable. Think about high confidential data.
Only database servers are authorized to store datas., (*2)

How?

Cached data will be encrypted/decripted with AES256 (php-mcrypt extension is required), (*3)

Installation

run php composer.phar require trt/doctrine-encrypted-cache-bundle:~0.1, (*4)

Create your KeyProvider

Put the following lines with Symfony Kernel, (*5)

    public function registerBundles()
    {
        $bundles = array(

            new Doctrine\Bundle\DoctrineCacheBundle\DoctrineCacheBundle(),
            new Trt\Doctrine\Cache\Bundle\DoctrineEncodedCacheBundle()
        );

    }

For security reason it's your responsability to store the encoding key in a safe place, so a key provider service is mandatory., (*6)

Create your own service implementing the KeyProvider interface., (*7)

Example:, (*8)

class CacheKeyProvider implements \Trt\Doctrine\Cache\Key\KeyProvider
{

    /**
     * Provide the encoding key string.
     *
     * @return String
     */
    public function getKey()
    {
        return $this->fetchKeyFromASafePlace();
    }
}

Register the service:, (*9)

services:
  my_bundle.cache.key_provider:
   class: My\Bundle\CacheKeyProvider

Full Configuration

According to the DoctrineCacheBundle documentation, configure the cache service, (*10)

## An Example with apc cache
doctrine_cache:
    aliases:
        cache_apc: my_apc_cache

    providers:
        my_apc_cache:
            type: apc
            namespace: my_apc_cache_ns
            aliases:
                - apc_cache

doctrine_encoded_cache:
  key_provider: my_bundle.cache.key_provider #Your key provider service
  cache: apc_cache #The doctrine cache service


# Enable the doctrine ORM cache
doctrine:
    orm:
        result_cache_driver:
            type: service
            id: doctrine_encoded_cache 
        metadata_cache_driver:
            type: service
            id: doctrine_encoded_cache
        query_cache_driver:
            type: service
            id: doctrine_encoded_cache

The Versions

22/12 2014

dev-master

9999999-dev

Doctrine Encrypted Cache Bundle

  Sources   Download

MIT

The Requires

 

The Development Requires

22/12 2014

v0.2

0.2.0.0

Doctrine Encrypted Cache Bundle

  Sources   Download

MIT

The Requires

 

The Development Requires