localCopy = $this->download($url); } /** * Returns the local copy's path. * * @return string The local copy's path. */ public function getLocalCopy(): string { return $this->localCopy; } /** * Downloads the remote file to the cache/downloads directory. * * @param string $url * @return string The local copy's file path or false */ private function download(string $url): string { $downloads = AM_BASE_DIR . AM_DIR_CACHE . '/downloads'; FileSystem::makeDir($downloads); $file = $downloads . '/' . sha1($url); $existing = FileSystem::glob("$file*"); if (!empty($existing)) { $file = $existing[0]; Debug::log(array($url, $file), 'Already downloaded before'); return $file; } if (!Fetch::download($url, $file)) { Debug::log($url, 'File not found'); return ''; } if ($extension = FileSystem::getImageExtensionFromMimeType($file)) { rename($file, "$file$extension"); $file = "$file$extension"; } Debug::log(array($url, $file), 'Downloaded'); return $file; } } __halt_compiler();----SIGNATURE:----sMmYm6Cqcxl1nFg2CTLgpveZzoFBcUzyhva/O4VT9uvo9Jfs0dCVsNV6EfbHPjPjMzp4TA+tpb4fGulCFsMIapR5kr27fYwYR9SbwZLgavgrbm/J7EBaeSoa1/oOHVJ8jKsSejPefeeTfLId83Cs6Zp7FIplbtv7UolINQ2Z+SaxblniUXTx0KRqMJ5vcaavA03EOEjgQDp3goInQTjv6SdVvDnvKTf2dM7kMU0MEUnkJqXhoW+w5eEI2A+/7utSriB132QtVymfxLqpS7ldEcD90kOU78cBmFy99Upup+Miyw6AD6UbcckM+x9zaxk+NjNshPUbL+hDJVS1LOzPsS0fwYTQD4ABJxll4VnodDzswZEyVv7AnnWNVFHdo67gk8RGVKJqD3wmBcb0SqOAIy7yjYStfKvlK/lVaAAdkFAlwz01ANQ1QJhsi0kzdK1tGUN7OPCLHlu/3idosBbv/MyUnwBVPb5z1AwyrvKJ+GcfKFimiv/MEUHlaF0ySgK17uvl+gohzSE5Qp0ljoFLj1xlFec2/h9Uv5ZBtATOIveE26P6cGlJIMnsyBw2X6DStdevbe0nQq/uZ0UpP10D77B6asInkbJxS7CMETgiSpR4Iq+NWKubS3njHYzQuOaz0s+ATEHXaRqbcXM7UyXGQDopaGaTmSLWz1mgCsTJ9Ls=----ATTACHMENT:----NTA0ODY2MDAxMzExNTE3MCA1NjI4Mzc4MzM0Mzk1OTU1IDI5OTQ4NjkyNTk1MjA1MjM=