phpfluent / cachebundle
为 Symfony 2 设计的流畅缓存包。
dev-master
2013-02-24 21:00 UTC
Requires
- php: >=5.3
- phpfluent/cache: dev-master
- symfony/framework-bundle: 2.*
- symfony/symfony: 2.*
This package is auto-updated.
Last update: 2024-08-24 03:31:02 UTC
README
为 Symfony 2 设计的流畅缓存包。
安装
composer require phpfluent/cachebundle
更新 settings.yml 文件
services: cache: class: Doctrine\Common\Cache\ApcCache
注册包
<?php //%/app/AppKernel.php $bundles = array( new Symfony\Bundle\FrameworkBundle\FrameworkBundle(), new Symfony\Bundle\TwigBundle\TwigBundle(), new Symfony\Bundle\MonologBundle\MonologBundle(), new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(), /** * Your bundles */ new PHPFluent\Bundle\CacheBundle\CacheBundle(), );
在代码中调用它
$cache = $this->get('phpfluent_cache'); $cache['foo'] = 'bar'; //Caching echo $cache['foo'];//Retrieving from the cache