ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
Assetic\Cache Namespace Reference

Data Structures

class  ApcCache
 Uses APC to cache files. More...
 
class  ArrayCache
 A simple array cache. More...
 
interface  CacheInterface
 Interface for a cache backend. More...
 
class  ConfigCache
 A config cache stores values using var_export() and include. More...
 
class  ExpiringCache
 Adds expiration to a cache backend. More...
 
class  FilesystemCache
 A simple filesystem cache. More...
 

Functions

 get ($resource)
 Loads and returns the value for the supplied cache key. More...
 
 getTimestamp ($resource)
 Returns a timestamp for when the cache was created. More...
 
 getSourcePath ($resource)
 Returns the path where the file corresponding to the supplied cache key can be included from. More...
 

Function Documentation

◆ get()

Assetic\Cache\get (   $resource)

Loads and returns the value for the supplied cache key.

Parameters
string$resourceA cache key
Returns
mixed The cached value

Definition at line 75 of file ConfigCache.php.

76 {
77 $path = $this->getSourcePath($resource);
78
79 if (!file_exists($path)) {
80 throw new \RuntimeException('There is no cached value for '.$resource);
81 }
82
83 return include $path;
84 }
$path
Definition: aliased.php:25
getSourcePath($resource)
Returns the path where the file corresponding to the supplied cache key can be included from.

References $path, and Assetic\Cache\getSourcePath().

Referenced by Parser\fetchScaryTemplateMaybeFromCache(), ilDate\get(), HTMLPurifier_DefinitionCache_Decorator_Cleanup\get(), HTMLPurifier_DefinitionCache_Decorator_Memory\get(), Assetic\Factory\LazyAssetManager\get(), ilTemplate\get(), Title\moveToNewTitle(), Title\newFromRedirect(), ActiveRecord\preloadObjects(), and ilTemplate\show().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSourcePath()

Assetic\Cache\getSourcePath (   $resource)
private

Returns the path where the file corresponding to the supplied cache key can be included from.

Parameters
string$resourceA cache key
Returns
string A file path

Definition at line 117 of file ConfigCache.php.

118 {
119 $key = md5($resource);
120
121 return $this->dir.'/'.$key[0].'/'.$key.'.php';
122 }

Referenced by Assetic\Cache\get(), Assetic\Cache\getTimestamp(), Assetic\Cache\ConfigCache\has(), and Assetic\Cache\ConfigCache\set().

+ Here is the caller graph for this function:

◆ getTimestamp()

Assetic\Cache\getTimestamp (   $resource)

Returns a timestamp for when the cache was created.

Parameters
string$resourceA cache key
Returns
integer A UNIX timestamp

Definition at line 93 of file ConfigCache.php.

94 {
95 $path = $this->getSourcePath($resource);
96
97 if (!file_exists($path)) {
98 throw new \RuntimeException('There is no cached value for '.$resource);
99 }
100
101 if (false === $mtime = @filemtime($path)) {
102 // @codeCoverageIgnoreStart
103 throw new \RuntimeException('Unable to determine file mtime for '.$path);
104 // @codeCoverageIgnoreEnd
105 }
106
107 return $mtime;
108 }

References $path, and Assetic\Cache\getSourcePath().

Referenced by Monolog\Handler\DeduplicationHandler\appendRecord(), Monolog\Formatter\FluentdFormatter\format(), ilWACSignedPath\isSignedPathValid(), and Monolog\Handler\DeduplicationHandlerTest\testGcOldLogs().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: