1 | <?php |
||
11 | class TempDirectory |
||
12 | { |
||
13 | /** @var string[] */ |
||
14 | private static $tempDirs = [ |
||
15 | '/dev/shm', |
||
16 | ]; |
||
17 | |||
18 | /** @var string */ |
||
19 | private static $timestamp; |
||
20 | |||
21 | /** |
||
22 | * Paraunit constructor. |
||
23 | */ |
||
24 | 72 | public function __construct() |
|
28 | |||
29 | /** |
||
30 | * @return string |
||
31 | * @throws \RuntimeException If the temp dirs cannot be created |
||
32 | */ |
||
33 | 64 | public function getTempDirForThisExecution(): string |
|
43 | |||
44 | /** |
||
45 | * @return string |
||
46 | * |
||
47 | * @throws \RuntimeException |
||
48 | */ |
||
49 | 64 | public static function getTempBaseDir(): string |
|
71 | |||
72 | /** |
||
73 | * @param string $path |
||
74 | * |
||
75 | * @throws \RuntimeException If the dir cannot be created |
||
76 | */ |
||
77 | 64 | public static function mkdirIfNotExists(string $path) |
|
87 | } |
||
88 |