1 | <?php |
||
25 | class CacheService implements SingletonInterface |
||
26 | { |
||
27 | use ExtendedSelfInstantiateTrait; |
||
28 | |||
29 | const CACHE_IDENTIFIER = 'cache_formz'; |
||
30 | const CONFIGURATION_OBJECT_CACHE_IDENTIFIER = 'cache_formz_configuration_object'; |
||
31 | const GENERATED_FILES_PATH = 'typo3temp/FormZ/'; |
||
32 | |||
33 | /** |
||
34 | * @var TypoScriptService |
||
35 | */ |
||
36 | protected $typoScriptService; |
||
37 | |||
38 | /** |
||
39 | * @var FrontendInterface |
||
40 | */ |
||
41 | protected $cacheInstance; |
||
42 | |||
43 | /** |
||
44 | * @var CacheManager |
||
45 | */ |
||
46 | protected $cacheManager; |
||
47 | |||
48 | /** |
||
49 | * Returns the type of backend cache defined in TypoScript at the path: |
||
50 | * `settings.defaultBackendCache`. |
||
51 | * |
||
52 | * @return string |
||
53 | * @throws ClassNotFoundException |
||
54 | * @throws InvalidOptionValueException |
||
55 | */ |
||
56 | public function getBackendCache() |
||
70 | |||
71 | /** |
||
72 | * Returns the cache instance used by this extension. |
||
73 | * |
||
74 | * @return FrontendInterface |
||
75 | */ |
||
76 | public function getCacheInstance() |
||
84 | |||
85 | /** |
||
86 | * Generic cache identifier creation for usages in the extension. |
||
87 | * |
||
88 | * @param string $formClassName |
||
89 | * @param string $formName |
||
90 | * @return string |
||
91 | */ |
||
92 | public function getFormCacheIdentifier($formClassName, $formName) |
||
98 | |||
99 | /** |
||
100 | * Function called when clearing TYPO3 caches. It will remove the temporary |
||
101 | * asset files created by FormZ. |
||
102 | * |
||
103 | * @param array $parameters |
||
104 | */ |
||
105 | public function clearCacheCommand($parameters) |
||
115 | |||
116 | /** |
||
117 | * @param string $path |
||
118 | * @return array |
||
119 | */ |
||
120 | protected function getFilesInPath($path) |
||
128 | |||
129 | /** |
||
130 | * @param string $file |
||
131 | */ |
||
132 | protected function clearFile($file) |
||
136 | |||
137 | /** |
||
138 | * @param CacheManager $cacheManager |
||
139 | */ |
||
140 | public function injectCacheManager(CacheManager $cacheManager) |
||
144 | |||
145 | /** |
||
146 | * @param TypoScriptService $typoScriptService |
||
147 | */ |
||
148 | public function injectTypoScriptService(TypoScriptService $typoScriptService) |
||
152 | } |
||
153 |