Example #1
0
 public function downloadCached(string $url)
 {
     $path = sprintf('%s/%s.%s', $this->tmpDir->getTempDir('downloads'), md5($url), $this->utils->extension($url));
     return file_exists($path) ? $path : $this->download($url, $path);
 }
Example #2
0
 public function getMimeType(string $path)
 {
     $ext = strtolower($this->pathUtils->extension($path));
     return $this->map[$ext] ?? 'application/octet-stream';
 }