trt/doctrine-encrypted-cache-bundle 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

trt/doctrine-encrypted-cache-bundle

最新稳定版本:v0.2

Composer 安装命令:

composer require trt/doctrine-encrypted-cache-bundle

包简介

Doctrine Encrypted Cache Bundle

README 文档

README

This bundle integrates a Symfony2 application with the trt/doctrine-encoded-cache library.

##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.

How?

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

Installation

run php composer.phar require trt/doctrine-encrypted-cache-bundle:~0.1

Create your KeyProvider

Put the following lines with Symfony Kernel

    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.

Create your own service implementing the KeyProvider interface.

Example:

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

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

Register the service:

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

Full Configuration

According to the DoctrineCacheBundle documentation, configure the cache service

## 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

统计信息

  • 总下载量: 1.59k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-12-22

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固