function ThemeRegistry::set

Overrides DrupalCacheArray::set

1 call to ThemeRegistry::set()
ThemeRegistry::__construct in includes/theme.inc
Constructs a DrupalCacheArray object.

File

includes/theme.inc, line 447

Class

ThemeRegistry
Builds the run-time theme registry.

Code

public function set($data, $lock = TRUE) {
    $lock_name = $this->cid . ':' . $this->bin;
    if (!$lock || lock_acquire($lock_name)) {
        if ($cached = cache_get($this->cid, $this->bin)) {
            // Use array merge instead of union so that filled in values in $data
            // overwrite empty values in the current cache.
            $data = array_merge($cached->data, $data);
        }
        else {
            $registry = $this->initializeRegistry();
            $data = array_merge($registry, $data);
        }
        cache_set($this->cid, $data, $this->bin);
        if ($lock) {
            lock_release($lock_name);
        }
    }
}

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