Skip to content

Instantly share code, notes, and snippets.

Created September 23, 2011 23:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/1238680 to your computer and use it in GitHub Desktop.
Save anonymous/1238680 to your computer and use it in GitHub Desktop.
// check if tag already exists
$tag = 'a tag to contain a list of cacheIds';
$cacheId = 'some key to cache';
if ( ! $keys = $this->_cache->load( $tag ) ) {
$keys = array( $cacheId );
$this->_cache->save( $keys, $tag );
}
else if ( ! in_array( $cacheId, $keys ) ) {
$keys[] = $cacheId;
$this->_cache->save( $keys, $tag );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment