当前位置: 首页>>代码示例>>PHP>>正文


PHP kDataCenterMgr::dcExists方法代码示例

本文整理汇总了PHP中kDataCenterMgr::dcExists方法的典型用法代码示例。如果您正苦于以下问题:PHP kDataCenterMgr::dcExists方法的具体用法?PHP kDataCenterMgr::dcExists怎么用?PHP kDataCenterMgr::dcExists使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在kDataCenterMgr的用法示例。


在下文中一共展示了kDataCenterMgr::dcExists方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: addFromRecordedWebcamAction

 /**
  * Add new entry after the file was recored on the server and the token id exists
  *
  * @action addFromRecordedWebcam
  * @param KalturaMediaEntry $mediaEntry Media entry metadata
  * @param string $webcamTokenId Token id for the recored webcam file
  * @return KalturaMediaEntry The new media entry
  *
  * @throws KalturaErrors::PROPERTY_VALIDATION_MIN_LENGTH
  * @throws KalturaErrors::PROPERTY_VALIDATION_CANNOT_BE_NULL
  * @throws KalturaErrors::RECORDED_WEBCAM_FILE_NOT_FOUND
  *
  * @deprecated use media.add instead
  */
 function addFromRecordedWebcamAction(KalturaMediaEntry $mediaEntry, $webcamTokenId)
 {
     if ($mediaEntry->conversionQuality && !$mediaEntry->conversionProfileId) {
         $mediaEntry->conversionProfileId = $mediaEntry->conversionQuality;
     }
     // check that the webcam file exists
     $content = myContentStorage::getFSContentRootPath();
     $webcamContentRootDir = $content . "/content/webcam/";
     $webcamBasePath = $webcamContentRootDir . $webcamTokenId;
     // Make sure that the root path of the webcam content is not modified by $webcamTokenId (with the value of "../" for example )
     $webcamContentRootDir = realpath($webcamContentRootDir);
     $webcamBaseRootDir = realpath(dirname($webcamBasePath));
     // Get realpath of target directory
     if (strpos($webcamBaseRootDir, $webcamContentRootDir) !== 0) {
         KalturaLog::err("webcamTokenId [{$webcamTokenId}] points outside of webcam content directory");
         throw new KalturaAPIException(KalturaErrors::INVALID_WEBCAM_TOKEN_ID);
     }
     if (!file_exists("{$webcamBasePath}.flv") && !file_exists("{$webcamBasePath}.f4v") && !file_exists("{$webcamBasePath}.f4v.mp4")) {
         if (kDataCenterMgr::dcExists(1 - kDataCenterMgr::getCurrentDcId())) {
             kFileUtils::dumpApiRequest(kDataCenterMgr::getRemoteDcExternalUrlByDcId(1 - kDataCenterMgr::getCurrentDcId()));
         }
         throw new KalturaAPIException(KalturaErrors::RECORDED_WEBCAM_FILE_NOT_FOUND);
     }
     $dbEntry = $this->prepareEntryForInsert($mediaEntry);
     $kshowId = $dbEntry->getKshowId();
     // setup the needed params for my insert entry helper
     $paramsArray = array("entry_media_source" => KalturaSourceType::WEBCAM, "entry_media_type" => $dbEntry->getMediaType(), "webcam_suffix" => $webcamTokenId, "entry_license" => $dbEntry->getLicenseType(), "entry_credit" => $dbEntry->getCredit(), "entry_source_link" => $dbEntry->getSourceLink(), "entry_tags" => $dbEntry->getTags());
     $token = $this->getKsUniqueString();
     $insert_entry_helper = new myInsertEntryHelper(null, $dbEntry->getKuserId(), $kshowId, $paramsArray);
     $insert_entry_helper->setPartnerId($this->getPartnerId(), $this->getPartnerId() * 100);
     $insert_entry_helper->insertEntry($token, $dbEntry->getType(), $dbEntry->getId(), $dbEntry->getName(), $dbEntry->getTags(), $dbEntry);
     $dbEntry = $insert_entry_helper->getEntry();
     myNotificationMgr::createNotification(kNotificationJobData::NOTIFICATION_TYPE_ENTRY_ADD, $dbEntry);
     $mediaEntry->fromObject($dbEntry, $this->getResponseProfile());
     return $mediaEntry;
 }
开发者ID:AdiTal,项目名称:server,代码行数:50,代码来源:MediaService.php

示例2: updateAction

 /**
  * Update an existing KalturaDropFolder object
  * 
  * @action update
  * @param int $dropFolderId
  * @param KalturaDropFolder $dropFolder
  * @return KalturaDropFolder
  *
  * @throws KalturaErrors::INVALID_OBJECT_ID
  * @throws KalturaErrors::INGESTION_PROFILE_ID_NOT_FOUND
  * @throws KalturaErrors::DATA_CENTER_ID_NOT_FOUND
  */
 public function updateAction($dropFolderId, KalturaDropFolder $dropFolder)
 {
     $dbDropFolder = DropFolderPeer::retrieveByPK($dropFolderId);
     if (!$dbDropFolder) {
         throw new KalturaAPIException(KalturaErrors::INVALID_OBJECT_ID, $dropFolderId);
     }
     $dropFolder->validatePropertyMinValue('fileSizeCheckInterval', 0, true);
     $dropFolder->validatePropertyMinValue('autoFileDeleteDays', 0, true);
     if (!is_null($dropFolder->path) && $dropFolder->path != $dbDropFolder->getPath() && $dropFolder->type == KalturaDropFolderType::LOCAL) {
         $existingDropFolder = DropFolderPeer::retrieveByPathDefaultFilter($dropFolder->path);
         if ($existingDropFolder) {
             throw new KalturaAPIException(KalturaDropFolderErrors::DROP_FOLDER_ALREADY_EXISTS, $dropFolder->path);
         }
     }
     if (!is_null($dropFolder->dc)) {
         if (!kDataCenterMgr::dcExists($dropFolder->dc)) {
             throw new KalturaAPIException(KalturaErrors::DATA_CENTER_ID_NOT_FOUND, $dropFolder->dc);
         }
     }
     if (!is_null($dropFolder->conversionProfileId)) {
         $conversionProfileDb = conversionProfile2Peer::retrieveByPK($dropFolder->conversionProfileId);
         if (!$conversionProfileDb) {
             throw new KalturaAPIException(KalturaErrors::INGESTION_PROFILE_ID_NOT_FOUND, $dropFolder->conversionProfileId);
         }
     }
     $dbDropFolder = $dropFolder->toUpdatableObject($dbDropFolder);
     $dbDropFolder->save();
     $dropFolder = KalturaDropFolder::getInstanceByType($dbDropFolder->getType());
     $dropFolder->fromObject($dbDropFolder, $this->getResponseProfile());
     return $dropFolder;
 }
开发者ID:DBezemer,项目名称:server,代码行数:43,代码来源:DropFolderService.php


注:本文中的kDataCenterMgr::dcExists方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。