mtime:size" 스냅샷을 만듭니다. * * @param string|null $base 검사할 디렉토리 절대 경로 (null 이거나 미존재면 빈 배열) * @return array 경로를 키로 정렬된 스냅샷 */ protected function serSnapshot(?string $base): array { if ($base === null || ! is_dir($base)) { return []; } $snapshot = []; $it = new \RecursiveIteratorIterator( new \RecursiveDirectoryIterator($base, \FilesystemIterator::SKIP_DOTS) ); foreach ($it as $file) { if ($file->isFile() && str_ends_with($file->getFilename(), '.ser')) { $snapshot[$file->getPathname()] = $file->getMTime().':'.$file->getSize(); } } ksort($snapshot); return $snapshot; } }