private function cleanupChunks() { foreach ($this->filesystem->directories($this->temporaryChunksFolder) as $file) { if (time() - $this->filesystem->lastModified($file) > $this->chunksExpireIn) { $this->filesystem->deleteDirectory($file); } } }
/** * Get the file's last modification time. * * @param string $path * * @return int */ public function lastModified($path) { $path = $this->getPathPrefix($path); return $this->drive->lastModified($path); }
/** * Remove old chunks. * * @param string $filePath * * @return void */ protected function removeOldData($filePath) { if ($this->storage->exists($filePath) && $this->storage->lastModified($filePath) < time() - $this->maxFileAge) { $this->storage->delete($filePath); } }
public function date() : Carbon { return Carbon::createFromTimestamp($this->disk->lastModified($this->path)); }