Created
October 16, 2013 12:09
-
-
Save tvlooy/7006707 to your computer and use it in GitHub Desktop.
User cache Symfony2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In config.yml: | |
services: | |
cache: | |
class: Doctrine\Common\Cache\ApcCache | |
In code: | |
if ($this->get('cache')->contains('menu')) { | |
$menu = unserialize($this->get('cache')->fetch('menu')); | |
} else { | |
$menu = /* IMPLEMENTATION_NEEDED */ | |
$this->get('cache')->save('menu', serialize($menu)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment