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); }
public function getMimeType(string $path) { $ext = strtolower($this->pathUtils->extension($path)); return $this->map[$ext] ?? 'application/octet-stream'; }