CacheDecorator
in package
implements
ReaderInterface
This class decorates a configuration file reader with caching support.
Tags
Interfaces, Classes, Traits and Enums
- ReaderInterface
Table of Contents
- $reader : ReaderInterface
- The decorated reader.
- $storage : StorageInterface
- Cache storage.
- __construct() : void
- Constructor.
- fromFile() : array<string|int, mixed>
- Read from a file and create an array
- fromString() : array<string|int, mixed>|bool
- Read from a string and create an array
- generateKey() : string
- Return a cache key.
Properties
$reader
The decorated reader.
protected
ReaderInterface
$reader
$storage
Cache storage.
protected
StorageInterface
$storage
Methods
__construct()
Constructor.
public
__construct(ReaderInterface $reader, StorageInterface $storage) : void
Parameters
- $reader : ReaderInterface
-
Config reader
- $storage : StorageInterface
-
Cache storage
Return values
void —fromFile()
Read from a file and create an array
public
fromFile(string $filename) : array<string|int, mixed>
Parameters
- $filename : string
-
Filename
Return values
array<string|int, mixed> —fromString()
Read from a string and create an array
public
fromString(string $string) : array<string|int, mixed>|bool
Parameters
- $string : string
-
String
Return values
array<string|int, mixed>|bool —generateKey()
Return a cache key.
protected
generateKey(string $string) : string
Parameters
- $string : string
-
String