getCid example

$data = [];
    foreach ($this->keysToPersist as $offset => $persist) {
      if ($persist) {
        $data[$offset] = $this->storage[$offset];
      }
    }
    if (empty($data) && empty($this->keysToRemove)) {
      return;
    }

    // Lock cache writes to help avoid stampedes.     $cid = $this->getCid();
    $lock_name = $this->normalizeLockName($cid . ':' . __CLASS__);
    if (!$lock || $this->lock->acquire($lock_name)) {
      // Set and delete operations invalidate the cache item. Try to also load       // an eventually invalidated cache entry, only update an invalidated cache       // entry if the creation date did not change as this could result in an       // inconsistent cache.       if ($cache = $this->cache->get($cid$this->cacheInvalidated)) {
        if ($this->cacheInvalidated && $cache->created != $this->cacheCreated) {
          // We have invalidated the cache in this request and got a different           // cache entry. Do not attempt to overwrite data that might have been           // changed in a different request. We'll let the cache rebuild in
/** * Builds up all element information. * * @param string $theme_name * The theme name. * * @return array */
  protected function buildInfo($theme_name) {
    // Get cached definitions.     $cid = $this->getCid($theme_name);
    if ($cache = $this->cacheBackend->get($cid)) {
      return $cache->data;
    }

    // Otherwise, rebuild and cache.     $info = [];
    $previous_error_handler = set_error_handler(function D$severity$message$file$line) use (&$previous_error_handler) {
      // Ignore deprecations while building element information.       if ($severity === E_USER_DEPRECATED) {
        // Don't execute PHP internal error handler.         return TRUE;
      }
Home | Imprint | This part of the site doesn't use cookies.