本文整理汇总了PHP中KalturaLog::crit方法的典型用法代码示例。如果您正苦于以下问题:PHP KalturaLog::crit方法的具体用法?PHP KalturaLog::crit怎么用?PHP KalturaLog::crit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KalturaLog
的用法示例。
在下文中一共展示了KalturaLog::crit方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: processProfile
/**
* @param KalturaScheduledTaskProfile $profile
*/
protected function processProfile(KalturaScheduledTaskProfile $profile)
{
$this->updateProfileBeforeExecution($profile);
if ($profile->maxTotalCountAllowed) {
$maxTotalCountAllowed = $profile->maxTotalCountAllowed;
} else {
$maxTotalCountAllowed = $this->getParams('maxTotalCountAllowed');
}
$pager = new KalturaFilterPager();
$pager->pageIndex = 1;
$pager->pageSize = 500;
while (true) {
$this->impersonate($profile->partnerId);
try {
$result = ScheduledTaskBatchHelper::query($this->getClient(), $profile, $pager);
$this->unimpersonate();
} catch (Exception $ex) {
$this->unimpersonate();
throw $ex;
}
if ($result->totalCount > $maxTotalCountAllowed) {
KalturaLog::crit("List query for profile {$profile->id} returned too many results ({$result->totalCount} when the allowed total count is {$maxTotalCountAllowed}), suspending the profile");
$this->suspendProfile($profile);
break;
}
if (!count($result->objects)) {
break;
}
foreach ($result->objects as $object) {
$this->processObject($profile, $object);
}
$pager->pageIndex++;
}
}
示例2: __construct
public function __construct($key)
{
if (self::$exists) {
KalturaLog::crit('Unexpected - query cache key already exists');
}
self::$exists = true;
$this->key = $key;
}
示例3: onDistributionJobUpdatedAlmostDone
/**
* @param BatchJob $dbBatchJob
* @param kDistributionJobData $data
* @param BatchJob $twinJob
* @return BatchJob
*/
public static function onDistributionJobUpdatedAlmostDone(BatchJob $dbBatchJob, kDistributionJobData $data, BatchJob $twinJob = null)
{
$entryDistribution = EntryDistributionPeer::retrieveByPK($data->getEntryDistributionId());
if (!$entryDistribution) {
KalturaLog::err("Entry distribution [" . $data->getEntryDistributionId() . "] not found");
return $dbBatchJob;
}
$providerData = $data->getProviderData();
KalturaLog::crit('provider data type' . get_class($providerData));
if ($providerData instanceof kYouTubeDistributionJobProviderData) {
KalturaLog::debug('setting currentPlaylists to entryDistribution custom data');
$entryDistribution->putInCustomData('currentPlaylists', $providerData->getCurrentPlaylists());
$entryDistribution->save();
}
return $dbBatchJob;
}
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:22,代码来源:kYouTubeDistributionEventConsumer.php
示例4: fromDbArray
public static function fromDbArray($arr, KalturaDetachedResponseProfile $responseProfile = null)
{
$newArr = new KalturaPermissionItemArray();
if ($arr == null) {
return $newArr;
}
foreach ($arr as $obj) {
if ($obj->getType() == PermissionItemType::API_ACTION_ITEM) {
$nObj = new KalturaApiActionPermissionItem();
} else {
if ($obj->getType() == PermissionItemType::API_PARAMETER_ITEM) {
$nObj = new KalturaApiParameterPermissionItem();
} else {
KalturaLog::crit('Unknown permission item type [' . $obj->getType() . '] defined with id [' . $obj->getId() . '] - skipping!');
continue;
}
}
$nObj->fromObject($obj, $responseProfile);
$newArr[] = $nObj;
}
return $newArr;
}
示例5: run
public function run()
{
KalturaLog::info("Email ingestion batch is running");
if ($this->taskConfig->isInitOnly()) {
return $this->init();
}
// get parameters from ini file
try {
$this->TEMP_FILE_DIR = $this->taskConfig->params->localTempPath;
} catch (Exception $e) {
KalturaLog::crit("Cannot find all required parameters from config file");
}
// create a temp file path
if (!self::createDir($this->TEMP_FILE_DIR)) {
KalturaLog::crit("Cannot continue email ingestion without a temp directory");
return false;
// quit run()
}
// ----------------------------------
// loop through all defined mailboxes
// ----------------------------------
$mailboxNumber = 0;
while (isset($this->taskConfig->params->{'mailbox' . ($mailboxNumber + 1)})) {
$mailboxNumber++;
$mailesProcessed = 0;
$keepCurMailbox = true;
$params = $this->taskConfig->params->{'mailbox' . $mailboxNumber};
// get parameters
try {
$host = $params->hostname;
$port = $params->port;
$user = $params->user;
$pass = $params->pass;
$options = $params->options;
$maxMails = $params->maxMailsPerRun;
} catch (Exception $e) {
KalturaLog::crit("Cannot find all required parameters from config file for mailbox number [{$mailboxNumber}]");
continue;
// skip current mailbox
}
// connect to current mailbox
$mailChecker = new KMailChecker($host, $port, $user, $pass, $options);
if (!$mailChecker->connect()) {
KalturaLog::crit("Error connecting to [{$host}:{$port}] as [{$user}] - " . imap_last_error());
continue;
// skip current mailbox
}
KalturaLog::info("Sucessfuly connected to [{$host}:{$port}] as [{$user}]");
// check for unread mails
$newMails = $mailChecker->getUnreadIds();
if (!$newMails || count($newMails) <= 0) {
// no new mail availble in current mailbox
KalturaLog::info("No new mails found on [{$user}@{$host}]");
continue;
// skip current mailbox
}
KalturaLog::info('[' . count($newMails) . "] unread mails found on [{$user}@{$host}]");
// -----------------------------------------
// loop through all mails in current mailbox
// -----------------------------------------
while ($keepCurMailbox && (list(, $curId) = each($newMails))) {
if ($mailesProcessed >= $maxMails) {
KalturaLog::info("Reached the max mails per job for current mailbox [{$mailboxNumber}] - skipping to next mailbox");
$keepCurMailbox = false;
// skip current mailbox
continue;
// skip current mail --> skip current mailbox
}
$mailesProcessed++;
// fetch current message
$curMail = $mailChecker->fetchMsg($curId);
if (!$curMail) {
KalturaLog::err("Error fetching message with folder ID [{$curId}] from [{$user}@{$host}] - " . imap_last_error());
continue;
// skip current mail - error fetching
}
// check if mail contains attachments
if (!$curMail->attachments || count($curMail->attachments) == 0) {
// no attachments found
KalturaLog::info('No attachments found for mail [' . $curMail->header->msgid . "] on [{$user}@{$host}] from [" . $curMail->header->fromadd . '] with subject [' . $curMail->header->subject . ']');
if (!$mailChecker->moveMsg($curId, self::NO_ATTACHMENT)) {
KalturaLog::err('Failed moving msg [' . $curMail->header->msgid . '] to the [' . self::NO_ATTACHMENT . '] folder - ' . imap_last_error());
}
continue;
// skip current mail - no attachments
}
// validate partner and get email profile
$email_profiles = $this->validePartnerAndGetProfile($curMail->header->toadd, $user . '@' . $host);
if (!$email_profiles) {
// error validating partner
KalturaLog::err('Partner validation failed for [' . $curMail->header->msgid . "] on [{$user}@{$host}] from [" . $curMail->header->fromadd . '] with subject [' . $curMail->header->subject . ']');
if (!$mailChecker->moveMsg($curId, self::PARTNER_INVALID)) {
KalturaLog::err('Failed moving msg [' . $curMail->header->msgid . '] to the [' . self::PARTNER_INVALID . '] folder - ' . imap_last_error());
}
continue;
// skip current mail - partner invalid
}
// create a new media entry from data in mail body text
$mediaEntry = $this->createMediaEntry($curMail->header, $curMail->body);
// add the mail's attachment for each valid email profile
//.........这里部分代码省略.........
示例6: getExceptionObject
public function getExceptionObject($ex, $service, $action)
{
KalturaResponseCacher::adjustApiCacheForException($ex);
if ($ex instanceof KalturaAPIException) {
KalturaLog::err($ex);
$object = $ex;
} else {
if ($ex instanceof APIException) {
$args = $ex->extra_data;
$reflectionException = new ReflectionClass("KalturaAPIException");
$ex = $reflectionException->newInstanceArgs($args);
KalturaLog::err($ex);
$object = $ex;
} else {
if ($ex instanceof kCoreException) {
switch ($ex->getCode()) {
case kCoreException::USER_BLOCKED:
$object = new KalturaAPIException(KalturaErrors::USER_BLOCKED);
break;
case kCoreException::PARTNER_BLOCKED:
$object = new KalturaAPIException(KalturaErrors::SERVICE_FORBIDDEN_CONTENT_BLOCKED);
break;
case kCoreException::INVALID_KS:
$object = new KalturaAPIException(KalturaErrors::INVALID_KS, $ex->getData(), ks::INVALID_STR, 'INVALID_STR');
break;
case kCoreException::MAX_NUMBER_OF_ACCESS_CONTROLS_REACHED:
$object = new KalturaAPIException(KalturaErrors::MAX_NUMBER_OF_ACCESS_CONTROLS_REACHED, $ex->getData());
break;
case kCoreException::MAX_CATEGORIES_PER_ENTRY:
$object = new KalturaAPIException(KalturaErrors::MAX_CATEGORIES_FOR_ENTRY_REACHED, $ex->getData());
break;
case kCoreException::MAX_ASSETS_PER_ENTRY:
$object = new KalturaAPIException(KalturaErrors::MAX_ASSETS_FOR_ENTRY_REACHED, asset::MAX_ASSETS_PER_ENTRY);
break;
case kCoreException::SEARCH_TOO_GENERAL:
$object = new KalturaAPIException(KalturaErrors::SEARCH_TOO_GENERAL);
break;
case kCoreException::SOURCE_FILE_NOT_FOUND:
$object = new KalturaAPIException(KalturaErrors::SOURCE_FILE_NOT_FOUND);
break;
case APIErrors::INVALID_ACTIONS_LIMIT:
$object = new KalturaAPIException(APIErrors::INVALID_ACTIONS_LIMIT);
break;
case APIErrors::PRIVILEGE_IP_RESTRICTION:
$object = new KalturaAPIException(APIErrors::PRIVILEGE_IP_RESTRICTION);
break;
case APIErrors::INVALID_SET_ROLE:
$object = new KalturaAPIException(APIErrors::INVALID_SET_ROLE);
break;
case APIErrors::UNKNOWN_ROLE_ID:
$object = new KalturaAPIException(APIErrors::UNKNOWN_ROLE_ID);
break;
case APIErrors::SEARCH_ENGINE_QUERY_FAILED:
$object = new KalturaAPIException(APIErrors::SEARCH_ENGINE_QUERY_FAILED);
break;
case kCoreException::FILE_NOT_FOUND:
$object = new KalturaAPIException(KalturaErrors::FILE_NOT_FOUND);
break;
case kCoreException::LOCK_TIMED_OUT:
$object = new KalturaAPIException(KalturaErrors::LOCK_TIMED_OUT);
break;
case kCoreException::SPHINX_CRITERIA_EXCEEDED_MAX_MATCHES_ALLOWED:
$object = new KalturaAPIException(KalturaErrors::SPHINX_CRITERIA_EXCEEDED_MAX_MATCHES_ALLOWED);
break;
case kCoreException::INVALID_ENTRY_ID:
$object = new KalturaAPIException(KalturaErrors::INVALID_ENTRY_ID, $ex->getData());
break;
case kCoreException::MAX_FILE_SYNCS_FOR_OBJECT_PER_DAY_REACHED:
$object = new KalturaAPIException(KalturaErrors::MAX_FILE_SYNCS_FOR_OBJECT_PER_DAY_REACHED, $ex->getData());
break;
case kCoreException::ID_NOT_FOUND:
$object = new KalturaAPIException(KalturaErrors::INVALID_OBJECT_ID, $ex->getData());
break;
default:
KalturaLog::crit($ex);
$object = new KalturaAPIException(KalturaErrors::INTERNAL_SERVERL_ERROR);
}
} else {
if ($ex instanceof PropelException) {
KalturaLog::alert($ex);
$object = new KalturaAPIException(KalturaErrors::INTERNAL_DATABASE_ERROR);
} else {
KalturaLog::crit($ex);
$object = new KalturaAPIException(KalturaErrors::INTERNAL_SERVERL_ERROR);
}
}
}
}
return $this->handleErrorMapping($object, $service, $action);
}
示例7: dispatch
public function dispatch($service, $action, $params = array())
{
$start = microtime(true);
// prevent impersonate to partner zero
$p = isset($params["p"]) && $params["p"] ? $params["p"] : null;
if (!$p) {
$p = isset($params["partnerId"]) && $params["partnerId"] ? $params["partnerId"] : null;
}
$GLOBALS["partnerId"] = $p;
// set for logger
$userId = "";
$ksStr = isset($params["ks"]) ? $params["ks"] : null;
if (!$service) {
throw new KalturaAPIException(KalturaErrors::SERVICE_NOT_SPECIFIED);
}
//strtolower on service - map is indexed according to lower-case service IDs
$service = strtolower($service);
$serviceActionItem = KalturaServicesMap::retrieveServiceActionItem($service, $action);
$action = strtolower($action);
if (!isset($serviceActionItem->actionMap[$action])) {
KalturaLog::crit("Action does not exist!");
throw new KalturaAPIException(KalturaErrors::ACTION_DOES_NOT_EXISTS, $action, $service);
}
try {
$actionReflector = new KalturaActionReflector($service, $action, $serviceActionItem->actionMap[$action]);
} catch (Exception $e) {
throw new Exception("Could not create action reflector for service [{$service}], action [{$action}]. Received error: " . $e->getMessage());
}
$actionParams = $actionReflector->getActionParams();
$actionInfo = $actionReflector->getActionInfo();
// services.ct - check if partner is allowed to access service ...
kCurrentContext::$host = isset($_SERVER["HOSTNAME"]) ? $_SERVER["HOSTNAME"] : gethostname();
kCurrentContext::$user_ip = requestUtils::getRemoteAddress();
kCurrentContext::$ps_vesion = "ps3";
kCurrentContext::$service = $serviceActionItem->serviceInfo->serviceName;
kCurrentContext::$action = $action;
kCurrentContext::$client_lang = isset($params['clientTag']) ? $params['clientTag'] : null;
kCurrentContext::initKsPartnerUser($ksStr, $p, $userId);
// validate it's ok to access this service
$deserializer = new KalturaRequestDeserializer($params);
$this->arguments = $deserializer->buildActionArguments($actionParams);
KalturaLog::debug("Dispatching service [" . $service . "], action [" . $action . "], reqIndex [" . kCurrentContext::$multiRequest_index . "] with params " . print_r($this->arguments, true));
$responseProfile = $deserializer->getResponseProfile();
if ($responseProfile) {
KalturaLog::debug("Response profile: " . print_r($responseProfile, true));
}
kPermissionManager::init(kConf::get('enable_cache'));
kEntitlementUtils::initEntitlementEnforcement();
$disableTags = $actionInfo->disableTags;
if ($disableTags && is_array($disableTags) && count($disableTags)) {
foreach ($disableTags as $disableTag) {
KalturaCriterion::disableTag($disableTag);
}
}
if ($actionInfo->validateUserObjectClass && $actionInfo->validateUserIdParamName && isset($actionParams[$actionInfo->validateUserIdParamName])) {
// // TODO maybe if missing should throw something, maybe a bone?
// if(!isset($actionParams[$actionInfo->validateUserIdParamName]))
// throw new KalturaAPIException(KalturaErrors::MISSING_MANDATORY_PARAMETER, $actionInfo->validateUserIdParamName);
KalturaLog::debug("validateUserIdParamName: " . $actionInfo->validateUserIdParamName);
$objectId = $params[$actionInfo->validateUserIdParamName];
$this->validateUser($actionInfo->validateUserObjectClass, $objectId, $actionInfo->validateUserPrivilege, $actionInfo->validateOptions);
}
// initialize the service before invoking the action on it
// action reflector will init the service to maintain the pluginable action transparency
$actionReflector->initService($responseProfile);
$invokeStart = microtime(true);
KalturaLog::debug("Invoke start");
try {
$res = $actionReflector->invoke($this->arguments);
} catch (KalturaAPIException $e) {
if ($actionInfo->returnType != 'file') {
throw $e;
}
KalturaResponseCacher::adjustApiCacheForException($e);
$res = new kRendererDieError($e->getCode(), $e->getMessage());
}
kEventsManager::flushEvents();
KalturaLog::debug("Invoke took - " . (microtime(true) - $invokeStart) . " seconds");
KalturaLog::debug("Dispatch took - " . (microtime(true) - $start) . " seconds, memory: " . memory_get_peak_usage(true));
return $res;
}
示例8: retrieveServiceActionItem
/**
* Function tpo retrieve a specific KalturaServiceActionItem from the cache by a service ID and action ID.
* If the item was not found, it is retrieved from the services map and cached.
* @param string $serviceId
* @param string $actionId
* @throws KalturaAPIException
* @return KalturaServiceActionItem
*/
public static function retrieveServiceActionItem($serviceId, $actionId)
{
if (function_exists('apc_fetch')) {
$apcFetchSuccess = null;
$serviceItemFromCache = apc_fetch($serviceId, $apcFetchSuccess);
if ($apcFetchSuccess && $serviceItemFromCache[KalturaServicesMap::SERVICES_MAP_MODIFICATION_TIME] == self::getServiceMapModificationTime()) {
return $serviceItemFromCache["serviceActionItem"];
}
}
// load the service reflector
$serviceMap = self::getMap();
if (!isset($serviceMap[$serviceId])) {
KalturaLog::crit("Service does not exist!");
throw new KalturaAPIException(KalturaErrors::SERVICE_DOES_NOT_EXISTS, $serviceId);
}
// check if action exists
if (!$actionId) {
KalturaLog::crit("Action not specified!");
throw new KalturaAPIException(KalturaErrors::ACTION_NOT_SPECIFIED, $serviceId);
}
$reflector = $serviceMap[$serviceId];
if (function_exists('apc_store')) {
$servicesMapLastModTime = self::getServiceMapModificationTime();
$success = apc_store($serviceId, array("serviceActionItem" => $serviceMap[$serviceId], KalturaServicesMap::SERVICES_MAP_MODIFICATION_TIME => $servicesMapLastModTime));
}
return $reflector;
}
示例9: getExceptionObject
public function getExceptionObject($ex)
{
if ($ex instanceof KalturaAPIException) {
KalturaLog::err($ex);
$object = $ex;
} else {
if ($ex instanceof APIException) {
$args = $ex->extra_data;
$reflectionException = new ReflectionClass("KalturaAPIException");
$ex = $reflectionException->newInstanceArgs($args);
KalturaLog::err($ex);
$object = $ex;
} else {
if ($ex instanceof kCoreException) {
switch ($ex->getCode()) {
case kCoreException::MAX_CATEGORY_DEPTH_REACHED:
KalturaLog::err($ex);
$object = new KalturaAPIException(KalturaErrors::MAX_CATEGORY_DEPTH_REACHED, category::MAX_CATEGORY_DEPTH);
break;
case kCoreException::MAX_NUMBER_OF_CATEGORIES_REACHED:
KalturaLog::err($ex);
$object = new KalturaAPIException(KalturaErrors::MAX_NUMBER_OF_CATEGORIES_REACHED, Partner::MAX_NUMBER_OF_CATEGORIES);
break;
case kCoreException::MAX_NUMBER_OF_ACCESS_CONTROLS_REACHED:
KalturaLog::err($ex);
$object = new KalturaAPIException(KalturaErrors::MAX_NUMBER_OF_ACCESS_CONTROLS_REACHED, Partner::MAX_ACCESS_CONTROLS);
break;
case kCoreException::MAX_CATEGORIES_PER_ENTRY:
KalturaLog::err($ex);
$object = new KalturaAPIException(KalturaErrors::MAX_CATEGORIES_FOR_ENTRY_REACHED, entry::MAX_CATEGORIES_PER_ENTRY);
break;
default:
KalturaLog::crit($ex);
$object = new KalturaAPIException(KalturaErrors::INTERNAL_SERVERL_ERROR);
}
} else {
KalturaLog::crit($ex);
$object = new KalturaAPIException(KalturaErrors::INTERNAL_SERVERL_ERROR);
}
}
}
return $object;
}
示例10: initConfig
protected function initConfig($language = null)
{
KalturaLog::debug(__METHOD__ . "()");
$languages = array($language ? $language : self::DEFAULT_LANGUAGE);
// now we read the ini files with the texts
// NOTE: '=' signs CANNOT be used inside the ini files, instead use "<EQ>"
$rootdir = realpath(dirname(__FILE__) . '');
foreach ($languages as $language) {
if (!isset($this->texts_array[$language])) {
$filename = $rootdir . "/emails_" . $language . ".ini";
KalturaLog::debug('ini filename = ' . $filename);
if (!file_exists($filename)) {
KalturaLog::crit('Fatal:::: Cannot find file: ' . $filename);
continue;
}
$ini_array = parse_ini_file($filename, true);
$this->texts_array[$language] = array('subjects' => $ini_array['subjects'], 'bodies' => $ini_array['bodies'], 'common_text' => $ini_array['common_text']);
}
}
}
示例11: initPartnerUserObjects
private static function initPartnerUserObjects()
{
if (self::$ksPartnerId == Partner::BATCH_PARTNER_ID) {
self::$operatingPartner = null;
self::$operatingPartnerId = self::$ksPartnerId;
return;
}
$ksPartner = null;
$requestedPartner = null;
// init ks partner = operating partner
if (!is_null(self::$ksPartnerId)) {
$ksPartner = PartnerPeer::retrieveByPK(self::$ksPartnerId);
if (!$ksPartner) {
KalturaLog::crit('Unknown partner id [' . self::$ksPartnerId . ']');
throw new kCoreException("Unknown partner Id [" . self::$ksPartnerId . "]", kCoreException::ID_NOT_FOUND);
}
}
// init requested partner
if (!is_null(self::$requestedPartnerId)) {
$requestedPartner = PartnerPeer::retrieveByPK(self::$requestedPartnerId);
if (!$requestedPartner) {
KalturaLog::crit('Unknown partner id [' . self::$requestedPartnerId . ']');
throw new kCoreException("Unknown partner Id [" . self::$requestedPartnerId . "]", kCoreException::ID_NOT_FOUND);
}
}
// init current kuser
if (self::$ksUserId && !self::$kuser) {
// will never be null because ks::uid is never null
kuserPeer::setUseCriteriaFilter(false);
self::$kuser = kuserPeer::getActiveKuserByPartnerAndUid(self::$ksPartnerId, self::$ksUserId);
kuserPeer::setUseCriteriaFilter(true);
if (!self::$kuser) {
self::$kuser = null;
// error not thrown to support adding users 'on-demand'
// current session will get default role according to session type (user/admin)
}
}
// choose operating partner!
if ($ksPartner) {
self::$operatingPartner = $ksPartner;
self::$operatingPartnerId = $ksPartner->getId();
} else {
if (!self::$ksString && $requestedPartner) {
self::$operatingPartner = $requestedPartner;
self::$operatingPartnerId = $requestedPartner->getId();
self::$kuser = null;
}
}
}
示例12: initConfig
protected function initConfig()
{
KalturaLog::debug(__METHOD__ . "()");
$cultures = array('en');
// now we read the ini files with the texts
// NOTE: '=' signs CANNOT be used inside the ini files, instead use "<EQ>"
$rootdir = realpath(dirname(__FILE__) . '');
foreach ($cultures as $culture) {
$filename = $rootdir . "/emails_" . $culture . ".ini";
KalturaLog::debug('ini filename = ' . $filename);
if (!file_exists($filename)) {
KalturaLog::crit('Fatal:::: Cannot find file: ' . $filename);
die;
}
$ini_array = parse_ini_file($filename, true);
$this->texts_array[$culture] = array('subjects' => $ini_array['subjects'], 'bodies' => $ini_array['bodies'], 'common_text' => $ini_array['common_text']);
}
}
示例13: getExceptionObject
public function getExceptionObject($ex)
{
$this->adjustApiCacheForException($ex);
if ($ex instanceof KalturaAPIException) {
KalturaLog::err($ex);
$object = $ex;
} else {
if ($ex instanceof APIException) {
$args = $ex->extra_data;
$reflectionException = new ReflectionClass("KalturaAPIException");
$ex = $reflectionException->newInstanceArgs($args);
KalturaLog::err($ex);
$object = $ex;
} else {
if ($ex instanceof kCoreException) {
switch ($ex->getCode()) {
case kCoreException::INVALID_KS:
$object = new KalturaAPIException(KalturaErrors::INVALID_KS, $ex->getData(), ks::INVALID_STR, 'INVALID_STR');
break;
case kCoreException::MAX_NUMBER_OF_ACCESS_CONTROLS_REACHED:
$object = new KalturaAPIException(KalturaErrors::MAX_NUMBER_OF_ACCESS_CONTROLS_REACHED, $ex->getData());
break;
case kCoreException::MAX_CATEGORIES_PER_ENTRY:
$object = new KalturaAPIException(KalturaErrors::MAX_CATEGORIES_FOR_ENTRY_REACHED, entry::MAX_CATEGORIES_PER_ENTRY);
break;
case kCoreException::SEARCH_TOO_GENERAL:
throw new KalturaAPIException(KalturaErrors::SEARCH_TOO_GENERAL);
break;
case kCoreException::SOURCE_FILE_NOT_FOUND:
$object = new KalturaAPIException(KalturaErrors::SOURCE_FILE_NOT_FOUND);
break;
case APIErrors::INVALID_ACTIONS_LIMIT:
$object = new KalturaAPIException(APIErrors::INVALID_ACTIONS_LIMIT);
break;
case APIErrors::PRIVILEGE_IP_RESTRICTION:
$object = new KalturaAPIException(APIErrors::PRIVILEGE_IP_RESTRICTION);
break;
case APIErrors::INVALID_SET_ROLE:
$object = new KalturaAPIException(APIErrors::INVALID_SET_ROLE);
break;
case APIErrors::UNKNOWN_ROLE_ID:
$object = new KalturaAPIException(APIErrors::UNKNOWN_ROLE_ID);
break;
case APIErrors::SEARCH_ENGINE_QUERY_FAILED:
$object = new KalturaAPIException(APIErrors::SEARCH_ENGINE_QUERY_FAILED);
break;
default:
KalturaLog::crit($ex);
$object = new KalturaAPIException(KalturaErrors::INTERNAL_SERVERL_ERROR);
}
} else {
if ($ex instanceof PropelException) {
KalturaLog::alert($ex);
$object = new KalturaAPIException(KalturaErrors::INTERNAL_DATABASE_ERROR);
} else {
KalturaLog::crit($ex);
$object = new KalturaAPIException(KalturaErrors::INTERNAL_SERVERL_ERROR);
}
}
}
}
return $object;
}
示例14: contributeMRSS
/**
* Append provider specific nodes and attributes to the MRSS
*
* @param EntryDistribution $entryDistribution
* @param SimpleXMLElement $mrss
*/
public static function contributeMRSS(EntryDistribution $entryDistribution, SimpleXMLElement $mrss)
{
// append Msn specific report statistics
$distributionProfile = DistributionProfilePeer::retrieveByPK($entryDistribution->getDistributionProfileId());
if (!$distributionProfile) {
return KalturaLog::err('Distribution profile #' . $entryDistribution->getDistributionProfileId() . ' not found');
}
if (!$distributionProfile instanceof MsnDistributionProfile) {
return KalturaLog::crit('Distribution profile #' . $entryDistribution->getDistributionProfileId() . ' is not instanceof MsnDistributionProfile');
}
$mrss->addChild('csid', $distributionProfile->getCsId());
$mrss->addChild('source', $distributionProfile->getSource());
$mrss->addChild('source_friendly_name', $distributionProfile->getSourceFriendlyName());
$mrss->addChild('page_group', $distributionProfile->getPageGroup());
$mrss->addChild('msnvideo_cat', $distributionProfile->getMsnvideoCat());
$mrss->addChild('msnvideo_top', $distributionProfile->getMsnvideoTop());
$mrss->addChild('msnvideo_top_cat', $distributionProfile->getMsnvideoTopCat());
}