public function AliasWhitelist::get

public AliasWhitelist::get($offset)

Gets value from the cache.

Parameters

string $key: Key that identifies the data.

Return value

mixed The corresponding cache data.

Overrides CacheCollector::get

File

core/lib/Drupal/Core/Path/AliasWhitelist.php, line 83

Class

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

Namespace

Drupal\Core\Path

Code

public function get($offset) {
  $this->lazyLoadCache();
  // this may be called with paths that are not represented by menu router
  // items such as paths that will be rewritten by hook_url_outbound_alter().
  // Therefore internally TRUE is used to indicate whitelisted paths. FALSE is
  // used to indicate paths that have already been checked but are not
  // whitelisted, and NULL indicates paths that have not been checked yet.
  if (isset($this->storage[$offset])) {
    if ($this->storage[$offset]) {
      return TRUE;
    }
  }
  elseif (array_key_exists($offset, $this->storage)) {
    return $this->resolveCacheMiss($offset);
  }
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Path!AliasWhitelist.php/function/AliasWhitelist::get/8.1.x