Skip to content

Instantly share code, notes, and snippets.

@bdalziel
Forked from anonymous/gist:1238680
Created September 25, 2011 07:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bdalziel/1240329 to your computer and use it in GitHub Desktop.
Save bdalziel/1240329 to your computer and use it in GitHub Desktop.
$tag = "a tag to contain a list of cacheId";
$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