function cache_get

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.


$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


55 calls to cache_get()
archiver_get_info in includes/
Retrieves a list of all available archivers.
book_menu_subtree_data in modules/book/book.module
Gets the data representing a subtree of the book hierarchy.
BootstrapGetFilenameWebTestCase::testDrupalGetFilename in modules/simpletest/tests/bootstrap.test
Test that drupal_get_filename() works correctly with a full Drupal site.
CacheClearCase::testMinimumCacheLifetime in modules/simpletest/tests/cache.test
Test minimum cache lifetime.
CacheSavingCase::checkVariable in modules/simpletest/tests/cache.test
Check or a variable is stored and restored properly.

... See full list

1 string reference to 'cache_get'
_drupal_file_scan_cache in includes/
Returns the current list of cached file system scan results.


includes/, line 56


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

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.