MCPcopy Create free account
hub / github.com/error311/FileRise / loadResumableIndex

Method loadResumableIndex

src/FileRise/Domain/UploadModel.php:307–324  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

305 }
306
307 private static function loadResumableIndex(): array
308 {
309 $path = self::resumableIndexPath();
310 if (!is_file($path)) {
311 return ['lastSweep' => 0, 'folders' => []];
312 }
313
314 $raw = @file_get_contents($path);
315 $data = is_string($raw) ? json_decode($raw, true) : null;
316 if (!is_array($data)) {
317 return ['lastSweep' => 0, 'folders' => []];
318 }
319
320 $folders = isset($data['folders']) && is_array($data['folders']) ? $data['folders'] : [];
321 $lastSweep = isset($data['lastSweep']) ? (int)$data['lastSweep'] : 0;
322
323 return ['lastSweep' => $lastSweep, 'folders' => $folders];
324 }
325
326 private static function saveResumableIndex(array $data): void
327 {

Callers 5

markResumablePendingMethod · 0.95
removeChunksMethod · 0.95

Calls 1

resumableIndexPathMethod · 0.95

Tested by

no test coverage detected