1 | <?php |
||
10 | class Manager implements ManagerInterface |
||
11 | { |
||
12 | |||
13 | protected $config = []; |
||
14 | |||
15 | protected $cache; |
||
16 | protected $localCache; |
||
17 | protected $builder; |
||
18 | protected $configurationLocation; |
||
19 | 12 | protected $hashAlgo; |
|
20 | |||
21 | public function __construct( |
||
22 | StorageInterface $cache = null, |
||
23 | BuilderInterface $builder = null, |
||
24 | StorageInterface $localCache = null, |
||
25 | 12 | $hashAlgo = 'sha1' |
|
26 | 12 | ) |
|
27 | 12 | { |
|
28 | 12 | $this->cache = $cache; |
|
29 | $this->builder = $builder; |
||
30 | $this->localCache = $localCache; |
||
31 | $this->hashAlgo = $hashAlgo; |
||
32 | } |
||
33 | |||
34 | public function getBuilder() |
||
35 | { |
||
36 | return $this->builder; |
||
37 | } |
||
38 | |||
39 | public function setLocalCache(StorageInterface $storage) |
||
40 | { |
||
41 | 9 | $this->localCache = $storage; |
|
42 | } |
||
43 | 9 | ||
44 | 9 | public function setRemoteCache(StorageInterface $storage) |
|
45 | 1 | { |
|
46 | $this->cache = $storage; |
||
47 | } |
||
48 | |||
49 | 9 | public function setBuilder(BuilderInterface $builder) |
|
50 | { |
||
51 | 2 | $this->builder = $builder; |
|
52 | } |
||
53 | 2 | ||
54 | 1 | ||
55 | public function getContextCacheKey($context = Config::CONTEXT_DEFAULT) |
||
59 | |||
60 | /** |
||
61 | * @param string $context The (configurable) context for the needed configuration object |
||
62 | 7 | * @return Config |
|
63 | * @throws NoConfigurationException |
||
64 | */ |
||
65 | 9 | ||
66 | 9 | public function getConfiguration($context = Config::CONTEXT_DEFAULT, $storeScopeLocally = false) |
|
116 | |||
117 | public function storeConfigurationObject(Config $config, $context = Config::CONTEXT_DEFAULT) |
||
130 | |||
131 | } |
||
132 |