function cache_get

7.x cache.inc cache_get($cid, $bin = 'cache')
6.x cache.inc cache_get($cid, $table = 'cache')
6.x cache-install.inc cache_get($key, $table = 'cache')

Returns data from the persistent cache.

Data may be stored as either plain text or as serialized data. cache_get will automatically return unserialized objects and arrays.

Parameters

$cid: The cache ID of the data to retrieve.

$bin: The cache bin to store the data in. Valid core values are 'cache_block', 'cache_bootstrap', 'cache_field', 'cache_filter', 'cache_form', 'cache_menu', 'cache_page', 'cache_path', 'cache_update' or 'cache' for the default cache.

Return value

The cache or FALSE on failure.

See also

cache_set()

50 calls to cache_get()
archiver_get_info in drupal-7.x/includes/common.inc
Retrieves a list of all available archivers.
book_menu_subtree_data in drupal-7.x/modules/book/book.module
Gets the data representing a subtree of the book hierarchy.
CacheClearCase::testMinimumCacheLifetime in drupal-7.x/modules/simpletest/tests/cache.test
Test minimum cache lifetime.
CacheSavingCase::checkVariable in drupal-7.x/modules/simpletest/tests/cache.test
Check or a variable is stored and restored properly.
CacheSavingCase::testNoEmptyCids in drupal-7.x/modules/simpletest/tests/cache.test
Test no empty cids are written in cache table.

... See full list

File

drupal-7.x/includes/cache.inc, line 55
Functions and interfaces for cache handling.

Code

function cache_get($cid, $bin = 'cache') {
  return _cache_get_object($bin)->get($cid);
}