/** * @param MediaInfoStorageItem $mediaItem * @param array $operations * @param string $cdnType * * @return string */ protected function getSecureFilePath(MediaInfoStorageItem $mediaItem, array $operations, $cdnType) { if ($cdnType == MediaRequest::TYPE_ICON) { $isIcon = true; } else { $isIcon = false; } return $this->mediaCache->getCacheFilePath($mediaItem, $operations, $isIcon); }
/** * @param ImageTool $imageTool * @param MediaCache $cmsMediaCache * @param MediaInfoStorageItem $mediaItem * @param array $operations * @param string $isIcon * @param string $filePath * * @return string */ protected function createCmsCacheFile(ImageTool $imageTool, MediaCache $cmsMediaCache, MediaInfoStorageItem $mediaItem, array $operations, $isIcon, $filePath) { $cmsMediaCache->prepareCache($mediaItem); $cmsCacheFilePath = $cmsMediaCache->getCacheFilePath($mediaItem, $operations, $isIcon); if ($this->isCmsCacheFileValid($mediaItem, $filePath, $cmsCacheFilePath)) { return $cmsCacheFilePath; } $imageTool->open($filePath); $imageTool->modify($operations); $imageTool->save($cmsCacheFilePath); $imageTool->close(); return $cmsCacheFilePath; }