You are here

function _spaces_registry in Spaces 7

Same name and namespace in other branches
  1. 6.3 spaces.module \_spaces_registry()
  2. 7.3 spaces.module \_spaces_registry()

Registry retrieval and caching.

2 calls to _spaces_registry()
spaces_controllers in ./spaces.module
Get the registry of spaces controllers.
spaces_types in ./spaces.module
Get the registry of spaces types.

File

./spaces.module, line 197

Code

function _spaces_registry($key = NULL, $reset = FALSE) {
  static $registry;
  if (!isset($registry) || $reset) {
    if (!$reset && ($cache = cache_get('spaces_registry', 'cache'))) {
      $registry = $cache->data;
    }
    else {
      $registry = module_invoke_all('spaces_registry');
      drupal_alter('spaces_registry', $registry);
      cache_set('spaces_registry', $registry);
    }
  }
  if (isset($key)) {
    return isset($registry[$key]) ? $registry[$key] : array();
  }
  return $registry;
}