fetchExistingMediaByHash example

$pathInfo = pathinfo($parsed['path'] ?? '');

            $media = $this->fetchFileFromURL((string) $url$pathInfo['extension'] ?? '');

            if ($media === null) {
                $deserialized['_error'] = new MediaDownloadException($url);

                return $deserialized;
            }

            if ($isNew && $media->getHash()) {
                $deserialized = $this->fetchExistingMediaByHash($deserialized$media->getHash());
            }

            $this->cacheMediaFiles[(string) $deserialized['id']] = [
                'media' => $media,
                'destination' => urldecode($pathInfo['filename']),
            ];
        }

        return $deserialized;
    }

    
Home | Imprint | This part of the site doesn't use cookies.