‪TYPO3CMS  10.4
FluidTemplateCache.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of the TYPO3 CMS project.
5  *
6  * It is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU General Public License, either version 2
8  * of the License, or any later version.
9  *
10  * For the full copyright and license information, please read the
11  * LICENSE.txt file that was distributed with this source code.
12  *
13  * The TYPO3 project - inspiring people to share!
14  */
15 
17 
20 use TYPO3Fluid\Fluid\Core\Cache\FluidCacheInterface;
21 use TYPO3Fluid\Fluid\Core\Cache\FluidCacheWarmerInterface;
22 use TYPO3Fluid\Fluid\Core\Cache\StandardCacheWarmer;
23 
32 class FluidTemplateCache extends ‪PhpFrontend implements FluidCacheInterface
33 {
37  public function flush($name = null)
38  {
39  parent::flush();
40  }
41 
46  public function get($entryIdentifier)
47  {
48  return $this->requireOnce($entryIdentifier);
49  }
50 
58  public function set($entryIdentifier, $sourceCode, array $tags = [], $lifetime = null)
59  {
60  if (strpos($sourceCode, '<?php') === 0) {
61  // Remove opening PHP tag; it is added by the cache backend to which
62  // we delegate and would be duplicated if not removed.
63  $sourceCode = substr($sourceCode, 6);
64  }
65  parent::set($entryIdentifier, $sourceCode, $tags, time() + 86400);
66  }
67 
71  public function getCacheWarmer()
72  {
73  return new StandardCacheWarmer();
74  }
75 }
‪TYPO3\CMS\Core\Cache\Frontend\PhpFrontend
Definition: PhpFrontend.php:25
‪TYPO3\CMS\Fluid\Core\Cache
Definition: FluidTemplateCache.php:16
‪TYPO3\CMS\Core\Cache\Exception\InvalidDataException
Definition: InvalidDataException.php:24