Example #1
0
 private function getNativeTimestamp(FileSystemInfo $info, $searchOptions = self::WITHOUT_CONTENT)
 {
     if ($info instanceof FileInfo) {
         $timestamp = $info->getLastWriteTime();
         $this->cache->save($info->getFullName(), $timestamp);
         return $timestamp;
     } else {
         $directorySearchOptions = $searchOptions == self::WITHOUT_CONTENT ? DirectoryInfo::TOP_DIRECTORY_ONLY : DirectoryInfo::ALL_DIRECTORIES;
         $innerInfos = $info->getFileSystemInfos($directorySearchOptions);
         $timestamp = $info->getLastWriteTime();
         foreach ($innerInfos as $innerInfo) {
             $innerTimestamp = $this->getTimestampHelper($innerInfo, $searchOptions);
             $timestamp = max($innerTimestamp, $timestamp);
         }
         $this->cache->save($info->getFullName(), $timestamp);
         return $timestamp;
     }
 }