예제 #1
0
 private function cleanupChunks()
 {
     foreach ($this->filesystem->directories($this->temporaryChunksFolder) as $file) {
         if (time() - $this->filesystem->lastModified($file) > $this->chunksExpireIn) {
             $this->filesystem->deleteDirectory($file);
         }
     }
 }
예제 #2
0
파일: Storage.php 프로젝트: bugotech/io
 /**
  * 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);
 }
예제 #3
0
 /**
  * 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);
     }
 }
예제 #4
0
 public function date() : Carbon
 {
     return Carbon::createFromTimestamp($this->disk->lastModified($this->path));
 }