本文整理汇总了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;
}
示例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;
}
}
}
示例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;
}
示例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;
}