1 | <?php |
||
9 | final class SubKey |
||
10 | { |
||
11 | private function __construct() |
||
14 | |||
15 | /** |
||
16 | * Gets the subkey for the pattern cache file, generated from the given string |
||
17 | * |
||
18 | * @param string $string |
||
19 | * @return string |
||
20 | */ |
||
21 | 2 | public static function getPatternCacheSubkey(string $string) : string |
|
22 | { |
||
23 | 2 | return $string[0] . $string[1]; |
|
24 | } |
||
25 | |||
26 | /** |
||
27 | * Gets all subkeys for the pattern cache files |
||
28 | * |
||
29 | * @return array |
||
30 | */ |
||
31 | 1 | public static function getAllPatternCacheSubkeys() : array |
|
32 | { |
||
33 | 1 | $subkeys = []; |
|
34 | 1 | $chars = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f']; |
|
35 | |||
36 | 1 | foreach ($chars as $charOne) { |
|
37 | 1 | foreach ($chars as $charTwo) { |
|
38 | 1 | $subkeys[$charOne . $charTwo] = ''; |
|
39 | } |
||
40 | } |
||
41 | |||
42 | 1 | return $subkeys; |
|
43 | } |
||
44 | |||
45 | /** |
||
46 | * Gets the sub key for the ini parts cache file, generated from the given string |
||
47 | * |
||
48 | * @param string $string |
||
49 | * @return string |
||
50 | */ |
||
51 | public static function getIniPartCacheSubKey(string $string) : string |
||
55 | |||
56 | /** |
||
57 | * Gets all sub keys for the inipart cache files |
||
58 | * |
||
59 | * @return array |
||
60 | */ |
||
61 | public static function getAllIniPartCacheSubKeys() : array |
||
76 | } |
||
77 |