Search code examples
phpdrupal-7

How to get all the cids and cache bin's in drupal 7


I have some troubles in my drupal system lately.
So I want to investigate drupal basic features about cache system.
But I can't find how can I get all the cache bin's.

I'd like to know this bin's because I want to use cache_get_multiple function. https://api.drupal.org/api/drupal/includes%21cache.inc/function/cache_get_multiple/7.x


Solution

  • There are Parameters which you can use according to your needs.

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

    $bin: 'cache_block', 'cache_bootstrap', 'cache_field', 'cache_filter', 'cache_form', 'cache_menu', 'cache_page', 'cache_path', 'cache_update' or 'cache'. and for the default cache use 'cache'.

    Return value The cache or FALSE on failure.

    Parameters can set in below function accordingly.

    function cache_get_multiple(array &$cids, $bin = 'cache') {
      return _cache_get_object($bin)->getMultiple($cids);
    }