當前位置: 首頁>>代碼示例>>PHP>>正文


PHP myPartnerUtils::getIisHost方法代碼示例

本文整理匯總了PHP中myPartnerUtils::getIisHost方法的典型用法代碼示例。如果您正苦於以下問題:PHP myPartnerUtils::getIisHost方法的具體用法?PHP myPartnerUtils::getIisHost怎麽用?PHP myPartnerUtils::getIisHost使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在myPartnerUtils的用法示例。


在下文中一共展示了myPartnerUtils::getIisHost方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: doGetFileSyncUrl

 /**
  * @param FileSync $fileSync
  * @return string
  */
 protected function doGetFileSyncUrl(FileSync $fileSync)
 {
     $fileSync = kFileSyncUtils::resolve($fileSync);
     $storage = StorageProfilePeer::retrieveByPK($fileSync->getDc());
     if (!$storage) {
         return parent::doGetFileSyncUrl($fileSync);
     }
     $serverUrl = $storage->getDeliveryIisBaseUrl();
     $partnerPath = myPartnerUtils::getUrlForPartner($fileSync->getPartnerId(), $fileSync->getPartnerId() * 100);
     if ($this->protocol == StorageProfile::PLAY_FORMAT_APPLE_HTTP && isset($this->params["hd_ios"])) {
         $path = $fileSync->getFilePath();
         $urlSuffix = str_replace('\\', '/', $path) . "/index_0_av.m3u8";
         $urlPrefix = "http://" . $this->params["hd_ios"] . '/i/';
         return $urlPrefix . ltrim($urlSuffix, '/');
     }
     if ($this->protocol == "hdnetworksmil" && isset($this->params["hd_flash"])) {
         $path = $fileSync->getFilePath();
         $urlSuffix = str_replace('\\', '/', $path);
         $urlPrefix = "http://" . $this->params["hd_flash"];
         return $urlPrefix . '/' . ltrim($urlSuffix, '/');
     }
     if ($fileSync->getObjectSubType() != entry::FILE_SYNC_ENTRY_SUB_TYPE_ISM) {
         return parent::doGetFileSyncUrl($fileSync);
     }
     $serverUrl = myPartnerUtils::getIisHost($fileSync->getPartnerId(), "http");
     $path = $partnerPath . '/serveIsm/objectId/' . $fileSync->getObjectId() . '_' . $fileSync->getObjectSubType() . '_' . $fileSync->getVersion() . '.' . pathinfo(kFileSyncUtils::resolve($fileSync)->getFilePath(), PATHINFO_EXTENSION) . '/manifest';
     $matches = null;
     if (preg_match('/(https?:\\/\\/[^\\/]+)(.*)/', $serverUrl, $matches)) {
         $path = $matches[2] . $path;
     }
     $path = str_replace('//', '/', $path);
     return $path;
 }
開發者ID:EfncoPlugins,項目名稱:Media-Management-based-on-Kaltura,代碼行數:37,代碼來源:kAkamaiUrlManager.php

示例2: addIsmLink

 private static function addIsmLink(entry $entry, SimpleXMLElement $mrss)
 {
     if (self::$addedIsmUrl) {
         return;
     }
     self::$addedIsmUrl = true;
     $syncKey = $entry->getSyncKey(entry::FILE_SYNC_ENTRY_SUB_TYPE_ISM);
     $kalturaFileSync = kFileSyncUtils::getReadyInternalFileSyncForKey($syncKey);
     $urlPrefix = myPartnerUtils::getIisHost($entry->getPartnerId(), StorageProfile::PLAY_FORMAT_HTTP);
     $iisHost = parse_url($urlPrefix, PHP_URL_HOST);
     $matches = null;
     if (preg_match('/(https?:\\/\\/[^\\/]+)(.*)/', $urlPrefix, $matches)) {
         $urlPrefix = $matches[1];
     }
     $urlPrefix = rtrim($urlPrefix, '/') . '/';
     $urlManager = kUrlManager::getUrlManagerByCdn($iisHost, $entry->getId());
     if ($kalturaFileSync) {
         $urlManager->setFileExtension(pathinfo($kalturaFileSync->getFilePath(), PATHINFO_EXTENSION));
     }
     $urlManager->setProtocol(StorageProfile::PLAY_FORMAT_SILVER_LIGHT);
     $partner = $entry->getPartner();
     if (!$partner->getStorageServePriority() || $partner->getStorageServePriority() == StorageProfile::STORAGE_SERVE_PRIORITY_KALTURA_ONLY || $partner->getStorageServePriority() == StorageProfile::STORAGE_SERVE_PRIORITY_KALTURA_FIRST) {
         if ($kalturaFileSync) {
             $url = $urlManager->getFileSyncUrl($kalturaFileSync, false);
             $mrss->addChild('ismUrl', $urlPrefix . $url);
             return;
         }
     }
     if (!$partner->getStorageServePriority() || $partner->getStorageServePriority() == StorageProfile::STORAGE_SERVE_PRIORITY_KALTURA_ONLY) {
         return null;
     }
     $externalFileSync = kFileSyncUtils::getReadyExternalFileSyncForKey($syncKey);
     if ($externalFileSync) {
         $urlManager = kUrlManager::getUrlManagerByStorageProfile($externalFileSync->getDc(), $entry->getId());
         $urlManager->setFileExtension(pathinfo($externalFileSync->getFilePath(), PATHINFO_EXTENSION));
         $urlManager->setProtocol(StorageProfile::PLAY_FORMAT_SILVER_LIGHT);
         $url = $urlManager->getFileSyncUrl($externalFileSync, false);
         $url = ltrim($url, '/');
         if (strpos($url, "://") !== false) {
             $urlPrefix = '';
         }
         $mrss->addChild('ismUrl', $urlPrefix . $url);
         return;
     }
     if ($partner->getStorageServePriority() != StorageProfile::STORAGE_SERVE_PRIORITY_EXTERNAL_ONLY) {
         if ($kalturaFileSync) {
             $url = $urlManager->getFileSyncUrl($kalturaFileSync, false);
             $mrss->addChild('ismUrl', $urlPrefix . $url);
             return;
         }
     }
 }
開發者ID:EfncoPlugins,項目名稱:Media-Management-based-on-Kaltura,代碼行數:52,代碼來源:kMrssManager.php

示例3: getSmoothStreamUrl

 private function getSmoothStreamUrl(FileSyncKey $key)
 {
     $kalturaFileSync = kFileSyncUtils::getReadyInternalFileSyncForKey($key);
     $iisHost = myPartnerUtils::getIisHost($this->entry->getPartnerId(), $this->protocol);
     $kalturaUrlManager = kUrlManager::getUrlManagerByCdn($iisHost);
     $kalturaUrlManager->setClipTo($this->clipTo);
     $kalturaUrlManager->setProtocol(StorageProfile::PLAY_FORMAT_SILVER_LIGHT);
     $partner = $this->entry->getPartner();
     if (!$partner->getStorageServePriority() || $partner->getStorageServePriority() == StorageProfile::STORAGE_SERVE_PRIORITY_KALTURA_ONLY) {
         if ($kalturaFileSync) {
             return $kalturaUrlManager->getFileSyncUrl($kalturaFileSync);
         }
         return null;
     }
     if ($partner->getStorageServePriority() == StorageProfile::STORAGE_SERVE_PRIORITY_KALTURA_FIRST) {
         if ($kalturaFileSync) {
             return $kalturaUrlManager->getFileSyncUrl($kalturaFileSync);
         }
     }
     $externalFileSync = kFileSyncUtils::getReadyExternalFileSyncForKey($key);
     $externalUrlManager = kUrlManager::getUrlManagerByStorageProfile($externalFileSync->getDc());
     $externalUrlManager->setClipTo($this->clipTo);
     $externalUrlManager->setProtocol(StorageProfile::PLAY_FORMAT_SILVER_LIGHT);
     if ($partner->getStorageServePriority() == StorageProfile::STORAGE_SERVE_PRIORITY_EXTERNAL_FIRST) {
         if ($externalFileSync) {
             return $externalUrlManager->getFileSyncUrl($externalFileSync);
         }
         if ($kalturaFileSync) {
             return $kalturaUrlManager->getFileSyncUrl($kalturaFileSync);
         }
     }
     if ($partner->getStorageServePriority() == StorageProfile::STORAGE_SERVE_PRIORITY_EXTERNAL_ONLY) {
         if ($externalFileSync) {
             return $externalUrlManager->getFileSyncUrl($externalFileSync);
         }
         return null;
     }
     return null;
 }
開發者ID:richhl,項目名稱:kalturaCE,代碼行數:39,代碼來源:playManifestAction.class.php

示例4: getSmoothStreamUrl

 /**
  * @param FileSyncKey $key
  * @return array
  */
 private function getSmoothStreamUrl(FileSyncKey $key)
 {
     $kalturaFileSync = kFileSyncUtils::getReadyInternalFileSyncForKey($key);
     $urlPrefix = myPartnerUtils::getIisHost($this->entry->getPartnerId(), $this->protocol);
     $iisHost = parse_url($urlPrefix, PHP_URL_HOST);
     $matches = null;
     if (preg_match('/(https?:\\/\\/[^\\/]+)(.*)/', $urlPrefix, $matches)) {
         $urlPrefix = $matches[1];
     }
     $urlPrefix .= '/';
     $kalturaUrlManager = $this->getUrlManagerByCdn($iisHost, $kalturaFileSync);
     $partner = $this->entry->getPartner();
     if (!$partner->getStorageServePriority() || $partner->getStorageServePriority() == StorageProfile::STORAGE_SERVE_PRIORITY_KALTURA_ONLY || $partner->getStorageServePriority() == StorageProfile::STORAGE_SERVE_PRIORITY_KALTURA_FIRST) {
         if ($kalturaFileSync) {
             $this->tokenizer = $kalturaUrlManager->getTokenizer();
             $url = $kalturaUrlManager->getFileSyncUrl($kalturaFileSync, false);
             return $this->getFlavorAssetInfo($url, $urlPrefix);
         }
     }
     if (!$partner->getStorageServePriority() || $partner->getStorageServePriority() == StorageProfile::STORAGE_SERVE_PRIORITY_KALTURA_ONLY) {
         return null;
     }
     $externalFileSync = kFileSyncUtils::getReadyExternalFileSyncForKey($key);
     if ($externalFileSync) {
         $externalUrlManager = $this->getUrlManagerByStorageProfile($externalFileSync->getDc(), $externalFileSync);
         $this->tokenizer = $externalUrlManager->getTokenizer();
         $url = $externalUrlManager->getFileSyncUrl($externalFileSync, false);
         return $this->getFlavorAssetInfo($url, $urlPrefix);
     }
     if ($partner->getStorageServePriority() != StorageProfile::STORAGE_SERVE_PRIORITY_EXTERNAL_ONLY) {
         if ($kalturaFileSync) {
             $this->tokenizer = $kalturaUrlManager->getTokenizer();
             $url = $kalturaUrlManager->getFileSyncUrl($kalturaFileSync, false);
             return $this->getFlavorAssetInfo($url, $urlPrefix);
         }
     }
     return null;
 }
開發者ID:EfncoPlugins,項目名稱:Media-Management-based-on-Kaltura,代碼行數:42,代碼來源:playManifestAction.class.php


注:本文中的myPartnerUtils::getIisHost方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。