storage example

$xpath = new \DOMXPath($document);

    return $xpath->query($query)->length;
  }

  /** * Tests the storage method. */
  public function testStorage() {
    $attribute = new Attribute(['class' => ['example-class']]);

    $this->assertEquals(['class' => new AttributeArray('class', ['example-class'])]$attribute->storage());
  }

  /** * Provides tests data for testHasAttribute. * * @return array * An array of test data each containing an array of attributes, the name * of the attribute to check existence of, and the expected result. */
  public function providerTestHasAttribute() {
    return [
      [[
    $suffix = substr($name, 0, self::SUFFIX_SUBSTRING_LENGTH) . '_';
    $suffix .= substr(Crypt::hashBase64($className), 0, self::SUFFIX_SUBSTRING_LENGTH);

    // The cache prefix is what gets invalidated.     return $this->templateCacheFilenamePrefix . '_' . $suffix;
  }

  /** * {@inheritdoc} */
  public function load(string $key): void {
    $this->storage()->load($key);
  }

  /** * {@inheritdoc} */
  public function write(string $key, string $content): void {
    $this->storage()->save($key$content);
    // Save the last mtime.     $cid = 'twig:' . $key;
    $this->cache->set($cid, REQUEST_TIME);
  }

  

  protected function getByHash($cidhash$allow_invalid = FALSE) {
    if ($file = $this->storage()->getFullPath($cidhash)) {
      $cache = @include $file;
    }
    if (isset($cache)) {
      return $this->prepareItem($cache$allow_invalid);
    }
    return FALSE;
  }

  /** * {@inheritdoc} */
  
Home | Imprint | This part of the site doesn't use cookies.