1 | <?php |
||
11 | class FileHandler extends Service implements HandlerInterface |
||
12 | { |
||
13 | /** @var SnapshotConfig */ |
||
14 | private $config; |
||
15 | |||
16 | /** @var FileManager */ |
||
17 | private $files; |
||
18 | |||
19 | /** |
||
20 | * FileHandler constructor. |
||
21 | * |
||
22 | * @param SnapshotConfig $config |
||
23 | * @param FileManager $files |
||
24 | */ |
||
25 | public function __construct(SnapshotConfig $config, FileManager $files) |
||
30 | |||
31 | /** |
||
32 | * Create snapshot aggregation and aggregated snapshot and tie them together. |
||
33 | * |
||
34 | * @param SnapshotInterface $snapshot |
||
35 | */ |
||
36 | public function registerSnapshot(SnapshotInterface $snapshot) |
||
42 | |||
43 | /** |
||
44 | * Save snapshot information on hard-drive. |
||
45 | * |
||
46 | * @param SnapshotInterface $snapshot |
||
47 | */ |
||
48 | protected function saveSnapshot(SnapshotInterface $snapshot) |
||
65 | |||
66 | /** |
||
67 | * Clean old snapshots. |
||
68 | * |
||
69 | * @param array $snapshots |
||
70 | */ |
||
71 | protected function performRotation(array $snapshots) |
||
86 | } |