public function AliasWhitelist::set

Overrides \Drupal\Core\Utility\CacheArray::set().

Overrides CacheArray::set

File

drupal/core/lib/Drupal/Core/Path/AliasWhitelist.php, line 116
Contains \Drupal\Core\Path\AliasWhitelist.

Class

AliasWhitelist
Extends CacheArray to build the path alias whitelist over time.

Namespace

Drupal\Core\Path

Code

public function set($data, $lock = TRUE) {
  $lock_name = $this->cid . ':' . $this->bin;
  if (!$lock || lock()
    ->acquire($lock_name)) {
    if ($cached = cache($this->bin)
      ->get($this->cid)) {

      // 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);
    }
    cache($this->bin)
      ->set($this->cid, $data);
    if ($lock) {
      lock()
        ->release($lock_name);
    }
  }
}