Exemplo n.º 1
0
 /**
  * @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());
 }
Exemplo n.º 2
0
 /**
  * @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())));
 }
Exemplo n.º 3
0
 /**
  * @param MediaInfoStorageItem $mediaItem
  * @param MediaRequest         $mediaRequest
  *
  * @return bool
  */
 public function isValidRequest(MediaInfoStorageItem $mediaItem, MediaRequest $mediaRequest)
 {
     return count($mediaRequest->getOperations()) <= 0;
 }
Exemplo n.º 4
0
 /**
  * @param MediaRequest $mediaRequest
  *
  * @return MediaInfoStorageItem
  */
 protected function getMediaItem(MediaRequest $mediaRequest)
 {
     $infoStorage = $this->getMediaContext()->getMediaInfoStorage();
     return $infoStorage->getItem($mediaRequest->getMediaId());
 }