/** * @param MediaInfoStorageItem $mediaItem * @param MediaRequest $mediaRequest * * @return bool */ public function isValidRequest(MediaInfoStorageItem $mediaItem, MediaRequest $mediaRequest) { $operations = $mediaRequest->getOperations(); if (count($operations) <= 0) { return true; } return $this->secureFileExists($mediaItem, $operations, $mediaRequest->getCdnType()); }
/** * @param MediaInfoStorageItem $mediaItem * @param MediaRequest $mediaRequest * * @return string */ private function uniqueKey(MediaInfoStorageItem $mediaItem, MediaRequest $mediaRequest) { return md5(json_encode(array('id' => $mediaItem->getId(), 'type' => $mediaRequest->getCdnType(), 'operations' => $mediaRequest->getOperations()))); }
/** * @param MediaInfoStorageItem $mediaItem * @param MediaRequest $mediaRequest * * @return bool */ public function isValidRequest(MediaInfoStorageItem $mediaItem, MediaRequest $mediaRequest) { return count($mediaRequest->getOperations()) <= 0; }
/** * @param MediaRequest $mediaRequest * * @return MediaInfoStorageItem */ protected function getMediaItem(MediaRequest $mediaRequest) { $infoStorage = $this->getMediaContext()->getMediaInfoStorage(); return $infoStorage->getItem($mediaRequest->getMediaId()); }