本文整理汇总了PHP中KalturaPluginManager类的典型用法代码示例。如果您正苦于以下问题:PHP KalturaPluginManager类的具体用法?PHP KalturaPluginManager怎么用?PHP KalturaPluginManager使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了KalturaPluginManager类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getInstanceByClass
/**
* @param string $class class name of the core object
* @return KalturaEventCondition
*/
public static function getInstanceByClass($class)
{
if ($class == kEventFieldCondition) {
return new KalturaEventFieldCondition();
}
return KalturaPluginManager::loadObject('KalturaEventCondition', $class);
}
示例2: doFromObject
public function doFromObject($dbData, KalturaDetachedResponseProfile $responseProfile = null)
{
/* @var $dbData kIndexJobData */
$filter = $dbData->getFilter();
$filterType = get_class($filter);
switch ($filterType) {
case 'entryFilter':
$this->filter = new KalturaBaseEntryFilter();
break;
case 'categoryFilter':
$this->filter = new KalturaCategoryFilter();
break;
case 'categoryEntryFilter':
$this->filter = new KalturaCategoryEntryFilter();
break;
case 'categoryKuserFilter':
$this->filter = new KalturaCategoryUserFilter();
break;
case 'kuserFilter':
$this->filter = new KalturaUserFilter();
break;
default:
$this->filter = KalturaPluginManager::loadObject('KalturaFilter', $filterType);
}
if ($this->filter) {
$this->filter->fromObject($filter);
}
parent::doFromObject($dbData, $responseProfile);
}
示例3: getGeoCoder
/**
* @param int $type of enum geoCoderType
* @return kGeoCoder
*/
public static function getGeoCoder($type = null)
{
if (!$type || $type == geoCoderType::KALTURA) {
return new myIPGeocoder();
}
return KalturaPluginManager::loadObject('kGeoCoder', $type);
}
示例4: fromObject
public function fromObject($dbData)
{
/* @var $dbData kCopyJobData */
$filter = $dbData->getFilter();
$filterType = get_class($filter);
switch ($filterType) {
case 'entryFilter':
$this->filter = new KalturaBaseEntryFilter();
$this->templateObject = new KalturaBaseEntry();
break;
case 'categoryFilter':
$this->filter = new KalturaCategoryFilter();
$this->templateObject = new KalturaCategory();
break;
case 'categoryEntryFilter':
$this->filter = new KalturaCategoryEntryFilter();
$this->templateObject = new KalturaCategoryEntry();
break;
case 'categoryKuserFilter':
$this->filter = new KalturaCategoryUserFilter();
$this->templateObject = new KalturaCategoryUser();
break;
default:
$this->filter = KalturaPluginManager::loadObject('KalturaFilter', $filterType);
}
if ($this->filter) {
$this->filter->fromObject($filter);
}
if ($this->templateObject) {
$this->templateObject->fromObject($dbData->getTemplateObject());
}
return parent::fromObject($dbData);
}
示例5: createNewEngine
/**
* @param int $type
* @param KSchedularTaskConfig $taskConfig
* @param KalturaConvartableJobData $data
* @return KOperationEngine
*/
protected static function createNewEngine($type, KSchedularTaskConfig $taskConfig, KalturaConvartableJobData $data)
{
// TODO - remove after old version deprecated
if (!$data->flavorParamsOutput->engineVersion) {
return new KOperationEngineOldVersionWrapper($type, $taskConfig, $data);
}
switch ($type) {
case KalturaConversionEngineType::MENCODER:
return new KOperationEngineMencoder($taskConfig->params->mencderCmd, $data->destFileSyncLocalPath);
case KalturaConversionEngineType::ON2:
return new KOperationEngineFlix($taskConfig->params->on2Cmd, $data->destFileSyncLocalPath);
case KalturaConversionEngineType::FFMPEG:
return new KOperationEngineFfmpeg($taskConfig->params->ffmpegCmd, $data->destFileSyncLocalPath);
case KalturaConversionEngineType::FFMPEG_AUX:
return new KOperationEngineFfmpegAux($taskConfig->params->ffmpegAuxCmd, $data->destFileSyncLocalPath);
case KalturaConversionEngineType::FFMPEG_VP8:
return new KOperationEngineFfmpegVp8($taskConfig->params->ffmpegVp8Cmd, $data->destFileSyncLocalPath);
case KalturaConversionEngineType::ENCODING_COM:
return new KOperationEngineEncodingCom($taskConfig->params->EncodingComUserId, $taskConfig->params->EncodingComUserKey, $taskConfig->params->EncodingComUrl);
}
if ($data instanceof KalturaConvertCollectionJobData) {
$engine = self::getCollectionEngine($type, $taskConfig, $data);
if ($engine) {
return $engine;
}
}
$engine = KalturaPluginManager::loadObject('KOperationEngine', $type, array('params' => $taskConfig->params, 'outFilePath' => $data->destFileSyncLocalPath));
return $engine;
}
示例6: fromDbArray
public static function fromDbArray($arr, KalturaDetachedResponseProfile $responseProfile = null)
{
$newArr = new KalturaEventNotificationParameterArray();
if ($arr == null) {
return $newArr;
}
foreach ($arr as $obj) {
$parameterType = get_class($obj);
switch ($parameterType) {
case 'kEventNotificationParameter':
$nObj = new KalturaEventNotificationParameter();
break;
case 'kEventNotificationArrayParameter':
$nObj = new KalturaEventNotificationArrayParameter();
break;
default:
$nObj = KalturaPluginManager::loadObject('KalturaEventNotificationParameter', $parameterType);
}
if ($nObj) {
$nObj->fromObject($obj, $responseProfile);
$newArr[] = $nObj;
}
}
return $newArr;
}
示例7: getInstanceByType
/**
* @param int $type
* @param bool $isAdmin
* @return KalturaBaseEntry
*/
static function getInstanceByType($type, $isAdmin = false)
{
switch ($type) {
case KalturaEntryType::MEDIA_CLIP:
$obj = new KalturaMediaEntry();
break;
case KalturaEntryType::MIX:
$obj = new KalturaMixEntry();
break;
case KalturaEntryType::PLAYLIST:
$obj = new KalturaPlaylist();
break;
case KalturaEntryType::DATA:
$obj = new KalturaDataEntry();
break;
case KalturaEntryType::LIVE_STREAM:
if ($isAdmin) {
$obj = new KalturaLiveStreamAdminEntry();
} else {
$obj = new KalturaLiveStreamEntry();
}
break;
case KalturaEntryType::LIVE_CHANNEL:
$obj = new KalturaLiveChannel();
break;
default:
$obj = KalturaPluginManager::loadObject('KalturaBaseEntry', $type);
if (!$obj) {
$obj = new KalturaBaseEntry();
}
break;
}
return $obj;
}
示例8: getInstanceByDbObject
static function getInstanceByDbObject(kCondition $dbObject)
{
switch ($dbObject->getType()) {
case ConditionType::AUTHENTICATED:
return new KalturaAuthenticatedCondition();
case ConditionType::COUNTRY:
return new KalturaCountryCondition();
case ConditionType::IP_ADDRESS:
return new KalturaIpAddressCondition();
case ConditionType::SITE:
return new KalturaSiteCondition();
case ConditionType::USER_AGENT:
return new KalturaUserAgentCondition();
case ConditionType::FIELD_COMPARE:
return new KalturaFieldCompareCondition();
case ConditionType::FIELD_MATCH:
return new KalturaFieldMatchCondition();
case ConditionType::ASSET_PROPERTIES_COMPARE:
return new KalturaAssetPropertiesCompareCondition();
case ConditionType::USER_ROLE:
return new KalturaUserRoleCondition();
case ConditionType::GEO_DISTANCE:
return new KalturaGeoDistanceCondition();
case ConditionType::OR_OPERATOR:
return new KalturaOrCondition();
case ConditionType::HASH:
return new KalturaHashCondition();
case ConditionType::DELIVERY_PROFILE:
return new KalturaDeliveryProfileCondition();
case ConditionType::ACTIVE_EDGE_VALIDATE:
return new KalturaValidateActiveEdgeCondition();
default:
return KalturaPluginManager::loadObject('KalturaCondition', $dbObject->getType());
}
}
示例9: listAction
/**
* List all distribution providers
*
* @action list
* @param KalturaDistributionProviderFilter $filter
* @param KalturaFilterPager $pager
* @return KalturaDistributionProviderListResponse
*/
function listAction(KalturaDistributionProviderFilter $filter = null, KalturaFilterPager $pager = null)
{
if (!$filter) {
$filter = new KalturaDistributionProviderFilter();
}
$c = new Criteria();
if ($filter instanceof KalturaGenericDistributionProviderFilter) {
$genericDistributionProviderFilter = new GenericDistributionProviderFilter();
$filter->toObject($genericDistributionProviderFilter);
$genericDistributionProviderFilter->attachToCriteria($c);
}
$count = GenericDistributionProviderPeer::doCount($c);
if (!$pager) {
$pager = new KalturaFilterPager();
}
$pager->attachToCriteria($c);
$list = GenericDistributionProviderPeer::doSelect($c);
$response = new KalturaDistributionProviderListResponse();
$response->objects = KalturaDistributionProviderArray::fromDbArray($list, $this->getResponseProfile());
$response->totalCount = $count;
$syndicationProvider = new KalturaSyndicationDistributionProvider();
$syndicationProvider->fromObject(SyndicationDistributionProvider::get());
$response->objects[] = $syndicationProvider;
$response->totalCount++;
$pluginInstances = KalturaPluginManager::getPluginInstances('IKalturaContentDistributionProvider');
foreach ($pluginInstances as $pluginInstance) {
$provider = $pluginInstance->getKalturaProvider();
if ($provider) {
$response->objects[] = $provider;
$response->totalCount++;
}
}
return $response;
}
示例10: doFromObject
public function doFromObject($dbObject, KalturaDetachedResponseProfile $responseProfile = null)
{
/* @var $dbObject kHttpNotificationDataText */
parent::doFromObject($dbObject, $responseProfile);
if ($this->shouldGet('content', $responseProfile)) {
$contentType = get_class($dbObject->getContent());
KalturaLog::debug("Loading KalturaStringValue from type [{$contentType}]");
switch ($contentType) {
case 'kStringValue':
$this->content = new KalturaStringValue();
break;
case 'kEvalStringField':
$this->content = new KalturaEvalStringField();
break;
default:
$this->content = KalturaPluginManager::loadObject('KalturaStringValue', $contentType);
break;
}
if ($this->content) {
$this->content->fromObject($dbObject->getContent());
}
}
if ($this->shouldGet('data', $responseProfile)) {
$this->data = $dbObject->getData();
}
}
示例11: addXMLBulkUploadJob
/**
* Add bulk upload job
* @param DropFolder $folder
* @param DropFolderFile $leadDropFolderFile
* @throws Exception
*/
private function addXMLBulkUploadJob(DropFolder $folder, DropFolderFile $leadDropFolderFile)
{
/* @var $leadDropFolderFile FeedDropFolderFile */
KalturaLog::info('Adding BulkUpload job');
try {
$coreBulkUploadType = BulkUploadXmlPlugin::getBulkUploadTypeCoreValue(BulkUploadXmlType::XML);
$objectId = $leadDropFolderFile->getId();
$objectType = DropFolderXmlBulkUploadPlugin::getBatchJobObjectTypeCoreValue(DropFolderBatchJobObjectType::DROP_FOLDER_FILE);
$partner = PartnerPeer::retrieveByPK($folder->getPartnerId());
$data = KalturaPluginManager::loadObject('kBulkUploadJobData', $coreBulkUploadType);
/* @var $data kBulkUploadJobData */
$data->setUploadedBy(kDropFolderXmlEventsConsumer::UPLOADED_BY);
KalturaLog::info("Feed XML path: " . $leadDropFolderFile->getFeedXmlPath());
$data->setFilePath($leadDropFolderFile->getFeedXmlPath());
$data->setFileName(basename($data->getFilePath()) . '.xml');
$objectData = new kBulkUploadEntryData();
KalturaLog::info('Conversion profile id: ' . $folder->getConversionProfileId());
$objectData->setConversionProfileId($folder->getConversionProfileId());
$data->setObjectData($objectData);
$job = kJobsManager::addBulkUploadJob($partner, $data, $coreBulkUploadType, $objectId, $objectType);
$this->setFileToProcessing($leadDropFolderFile);
return $job;
} catch (Exception $e) {
KalturaLog::err("Error adding BulkUpload job -" . $e->getMessage());
throw new Exception(DropFolderXmlBulkUploadPlugin::ERROR_ADDING_BULK_UPLOAD_MESSAGE, DropFolderXmlBulkUploadPlugin::getErrorCodeCoreValue(DropFolderXmlBulkUploadErrorCode::ERROR_ADDING_BULK_UPLOAD));
}
}
示例12: doFromObject
public function doFromObject($dbObject, KalturaDetachedResponseProfile $responseProfile = null)
{
parent::doFromObject($dbObject, $responseProfile);
/* @var $dbObject kEmailNotificationCategoryRecipientProvider */
$categoryIdFieldType = get_class($dbObject->getCategoryId());
KalturaLog::info("Retrieving API object for categoryId fild of type [{$categoryIdFieldType}]");
switch ($categoryIdFieldType) {
case 'kObjectIdField':
$this->categoryId = new KalturaObjectIdField();
break;
case 'kEvalStringField':
$this->categoryId = new KalturaEvalStringField();
break;
case 'kStringValue':
$this->categoryId = new KalturaStringValue();
break;
default:
$this->categoryId = KalturaPluginManager::loadObject('KalturaStringValue', $categoryIdFieldType);
break;
}
if ($this->categoryId) {
$this->categoryId->fromObject($dbObject->getCategoryId());
}
if ($dbObject->getCategoryUserFilter()) {
$this->categoryUserFilter = new KalturaCategoryUserProviderFilter();
$this->categoryUserFilter->fromObject($dbObject->getCategoryUserFilter());
}
}
示例13: getMrssContributors
/**
* @return array<IKalturaMrssContributor>
*/
public static function getMrssContributors()
{
if (self::$mrssContributors) {
return self::$mrssContributors;
}
self::$mrssContributors = KalturaPluginManager::getPluginInstances('IKalturaMrssContributor');
return self::$mrssContributors;
}
示例14: getInstanceByType
/**
* @param int $type
* @return KalturaDrmDevice
*/
static function getInstanceByType($provider)
{
$obj = KalturaPluginManager::loadObject('KalturaDrmDevice', $provider);
if (!$obj) {
$obj = new KalturaDrmDevice();
}
return $obj;
}
示例15: getInstanceByType
/**
* Function returns KalturaUserEntry sub-type according to protocol
* @var string $type
* @return KalturaUserEntry
*
*/
public static function getInstanceByType($type)
{
$obj = KalturaPluginManager::loadObject("KalturaUserEntry", $type);
if (is_null($obj)) {
KalturaLog::err("The type '{$type}' is unknown");
}
return $obj;
}