1 | <?php |
||
20 | class InstallerState |
||
21 | { |
||
22 | /** |
||
23 | * Checks the installer state |
||
24 | * |
||
25 | * @param string $state state to check agains |
||
26 | * @return bool true if installer is in state $state |
||
27 | */ |
||
28 | public static function check(string $state): bool |
||
37 | |||
38 | /** |
||
39 | * Resets the installer state |
||
40 | * |
||
41 | * @return void |
||
42 | */ |
||
43 | public static function reset(): void |
||
47 | |||
48 | /** |
||
49 | * Sets the installer state |
||
50 | * |
||
51 | * @param string $state the state |
||
52 | * @return void |
||
53 | */ |
||
54 | public static function set(string $state): void |
||
58 | |||
59 | /** |
||
60 | * Gets handle to state storage file |
||
61 | * |
||
62 | * The file is stored as file in writable directory. Cache isn't available |
||
63 | * during the installation. |
||
64 | * |
||
65 | * @return File file handle |
||
66 | * @throws \RuntimeException |
||
67 | */ |
||
68 | private static function getFile(): File |
||
76 | } |
||
77 |