Skip to content

Instantly share code, notes, and snippets.

@MacDada
Created November 12, 2012 18:01
Show Gist options
  • Save MacDada/4060861 to your computer and use it in GitHub Desktop.
Save MacDada/4060861 to your computer and use it in GitHub Desktop.
<?php
$cacheId = 'xyz';
$cacheDriver = new \Doctrine\Common\Cache\ApcCache();
if ($cacheDriver->contains($cacheId)) {
return $cacheDriver->fetch($cacheId);
}
$result = /* do your query */
$cacheDriver->save($cacheId, $result);
return $result;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment