本文整理汇总了PHP中KalturaLog类的典型用法代码示例。如果您正苦于以下问题:PHP KalturaLog类的具体用法?PHP KalturaLog怎么用?PHP KalturaLog使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了KalturaLog类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: myServiceConfig
public function myServiceConfig($file_name, $service_name = null, $useDefualt = true)
{
$path = $this->getPath();
KalturaLog::debug("Path [{$path}] File [{$file_name}] Service [{$service_name}]");
$config_table_list = array();
if ($file_name == $this->getDefaultName()) {
} else {
if ($file_name) {
$config_table_list[] = $path . $file_name;
}
}
if (self::$secondary_config_tables) {
// add the secondary before the end
$config_table_list = array_merge($config_table_list, self::$secondary_config_tables);
}
// always append the defualt to the end
if ($useDefualt) {
$config_table_list[] = $path . $this->getDefaultName();
}
// don't use the common path feature - add it to each config file separatly
$this->config_chain = new kConfigTableChain($config_table_list, null);
$tables = $this->config_chain->getTables();
self::$default_config_table = end($tables);
$this->all_config_tables = $tables;
if ($service_name) {
$this->setServiceName($service_name);
}
}
开发者ID:GElkayam,项目名称:server,代码行数:28,代码来源:myServiceConfig.class.php
示例2: objectAdded
/**
* @param BaseObject $object
* @return bool true if should continue to the next consumer
*/
public function objectAdded(BaseObject $object)
{
if (!$object instanceof FileSync || $object->getStatus() != FileSync::FILE_SYNC_STATUS_PENDING || $object->getFileType() != FileSync::FILE_SYNC_FILE_TYPE_FILE || $object->getDc() == kDataCenterMgr::getCurrentDcId()) {
return true;
}
$c = new Criteria();
$c->addAnd(FileSyncPeer::OBJECT_ID, $object->getObjectId());
$c->addAnd(FileSyncPeer::VERSION, $object->getVersion());
$c->addAnd(FileSyncPeer::OBJECT_TYPE, $object->getObjectType());
$c->addAnd(FileSyncPeer::OBJECT_SUB_TYPE, $object->getObjectSubType());
$c->addAnd(FileSyncPeer::ORIGINAL, '1');
$original_filesync = FileSyncPeer::doSelectOne($c);
if (!$original_filesync) {
KalturaLog::err('Original filesync not found for object_id[' . $object->getObjectId() . '] version[' . $object->getVersion() . '] type[' . $object->getObjectType() . '] subtype[' . $object->getObjectSubType() . ']');
return true;
}
$sourceFileUrl = $original_filesync->getExternalUrl();
if (!$sourceFileUrl) {
KalturaLog::err('External URL not found for filesync id [' . $object->getId() . ']');
return true;
}
$job = kMultiCentersManager::addFileSyncImportJob($this->getEntryId($object), $object->getPartnerId(), $object->getId(), $sourceFileUrl);
$job->setDc($object->getDc());
$job->save();
return true;
}
开发者ID:richhl,项目名称:kalturaCE,代码行数:30,代码来源:kMultiCentersSynchronizer.php
示例3: validateForSubmission
public function validateForSubmission(EntryDistribution $entryDistribution, $action)
{
$validationErrors = parent::validateForSubmission($entryDistribution, $action);
//validation of flavor format
$flavorAsset = null;
$flavorAssets = assetPeer::retrieveByIds(explode(',', $entryDistribution->getFlavorAssetIds()));
// if we have specific flavor assets for this distribution, grab the first one
if (count($flavorAssets)) {
$flavorAsset = reset($flavorAssets);
$fileExt = $flavorAsset->getFileExt();
$allowedExts = explode(',', self::FLAVOR_VALID_FORMATS);
if (!in_array($fileExt, $allowedExts)) {
KalturaLog::debug('flavor asset id [' . $flavorAsset->getId() . '] does not have a valid extension [' . $fileExt . ']');
$errorMsg = 'Flavor format must be one of [' . self::FLAVOR_VALID_FORMATS . ']';
$validationError = $this->createValidationError($action, DistributionErrorType::INVALID_DATA);
$validationError->setValidationErrorType(DistributionValidationErrorType::CUSTOM_ERROR);
$validationError->setValidationErrorParam($errorMsg);
$validationError->setDescription($errorMsg);
$validationErrors[] = $validationError;
}
}
$inListOrNullFields = array(IdeticDistributionField::GENRE => explode(',', self::GENRE_VALID_VALUES));
$allFieldValues = $this->getAllFieldValues($entryDistribution);
if (!$allFieldValues || !is_array($allFieldValues)) {
KalturaLog::err('Error getting field values from entry distribution id [' . $entryDistribution->getId() . '] profile id [' . $this->getId() . ']');
return $validationErrors;
}
$validationErrors = array_merge($validationErrors, $this->validateInListOrNull($inListOrNullFields, $allFieldValues, $action));
//validating Slot is a whole number
$validationErrors = array_merge($validationErrors, $this->validateIsWholeNumber(IdeticDistributionField::SLOT, $allFieldValues, $action));
return $validationErrors;
}
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:32,代码来源:IdeticDistributionProfile.php
示例4: run
public function run($jobs = null)
{
if (KBatchBase::$taskConfig->isInitOnly()) {
return $this->init();
}
if (is_null($jobs)) {
$jobs = KBatchBase::$kClient->batch->getExclusiveAlmostDone($this->getExclusiveLockKey(), KBatchBase::$taskConfig->maximumExecutionTime, $this->getMaxJobsEachRun(), $this->getFilter(), static::getType());
}
KalturaLog::info(count($jobs) . " jobs to close");
if (!count($jobs) > 0) {
KalturaLog::info("Queue size: 0 sent to scheduler");
$this->saveSchedulerQueue(static::getType());
return null;
}
foreach ($jobs as &$job) {
try {
self::setCurrentJob($job);
$job = $this->exec($job);
} catch (KalturaException $kex) {
KBatchBase::unimpersonate();
$job = $this->closeJob($job, KalturaBatchJobErrorTypes::KALTURA_API, $kex->getCode(), "Error: " . $kex->getMessage(), KalturaBatchJobStatus::FAILED);
} catch (KalturaClientException $kcex) {
KBatchBase::unimpersonate();
$job = $this->closeJob($job, KalturaBatchJobErrorTypes::KALTURA_CLIENT, $kcex->getCode(), "Error: " . $kcex->getMessage(), KalturaBatchJobStatus::RETRY);
} catch (Exception $ex) {
KBatchBase::unimpersonate();
$job = $this->closeJob($job, KalturaBatchJobErrorTypes::RUNTIME, $ex->getCode(), "Error: " . $ex->getMessage(), KalturaBatchJobStatus::FAILED);
}
self::unsetCurrentJob();
}
return $jobs;
}
开发者ID:DBezemer,项目名称:server,代码行数:32,代码来源:KJobCloserWorker.class.php
示例5: writeFilterForType
private function writeFilterForType(KalturaTypeReflector $type)
{
$map = KAutoloader::getClassMap();
if (!isset($map[$type->getType()])) {
return;
}
$filterClassName = $type->getType() . "Filter";
$filterBaseClassName = $type->getType() . "BaseFilter";
$filterPath = dirname($map[$type->getType()]) . "/filters/{$filterClassName}.php";
if (file_exists($filterPath)) {
KalturaLog::notice("Filter already exists [{$filterPath}]");
return;
}
$this->_txt = "";
$parentType = $type;
while (1) {
$parentType = $parentType->getParentTypeReflector();
if ($parentType === null || $parentType->isFilterable()) {
break;
}
}
$partnetClassName = $parentType ? $parentType->getType() . "Filter" : "KalturaFilter";
$subpackage = ($type->getPackage() == 'api' ? '' : 'api.') . 'filters';
$this->appendLine("<?php");
$this->appendLine("/**");
$this->appendLine(" * @package " . $type->getPackage());
$this->appendLine(" * @subpackage {$subpackage}");
$this->appendLine(" */");
$this->appendLine("class {$filterClassName} extends {$filterBaseClassName}");
$this->appendLine("{");
$this->appendLine("}");
$this->writeToFile($filterPath, $this->_txt);
}
开发者ID:DBezemer,项目名称:server,代码行数:33,代码来源:FiltersGenerator.php
示例6: doConnect
protected function doConnect($http_server, &$http_port)
{
// try connecting to server
if (!$http_port || $http_port == 0) {
$http_port = 80;
}
$http_server .= $http_server . ':' . $http_port;
try {
$url_parts = parse_url($http_server);
if (isset($url_parts["scheme"])) {
if ($url_parts["scheme"] != "http" && $url_parts["scheme"] != "https") {
KalturaLog::err("URL [{$http_server}] is not http");
return false;
}
} else {
$http_server = 'http://' . $http_server;
}
} catch (Exception $exception) {
$http_server = 'http://' . $http_server;
}
$this->server = $http_server;
$this->ch = curl_init();
curl_setopt($this->ch, CURLOPT_USERAGENT, $this->userAgent);
curl_setopt($this->ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($this->ch, CURLOPT_NOSIGNAL, true);
curl_setopt($this->ch, CURLOPT_FORBID_REUSE, true);
curl_setopt($this->ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($this->ch, CURLOPT_HEADER, false);
curl_setopt($this->ch, CURLOPT_SSL_VERIFYPEER, false);
return $this->ch;
}
开发者ID:DBezemer,项目名称:server,代码行数:31,代码来源:httpMgr.class.php
示例7: getIdByStrId
public static function getIdByStrId($strId)
{
// try to get strId to id mapping form cache
$cacheKey = 'UserRolePeer_role_str_id_' . $strId;
if (kConf::get('enable_cache') && function_exists('apc_fetch') && function_exists('apc_store')) {
$id = apc_fetch($cacheKey);
// try to fetch from cache
if ($id) {
KalturaLog::debug("UserRole str_id [{$strId}] mapped to id [{$id}] - fetched from cache");
return $id;
}
}
// not found in cache - get from database
$c = new Criteria();
$c->addSelectColumn(UserRolePeer::ID);
$c->addAnd(UserRolePeer::STR_ID, $strId, Criteria::EQUAL);
$c->setLimit(1);
$stmt = UserRolePeer::doSelectStmt($c);
$id = $stmt->fetch(PDO::FETCH_COLUMN);
if ($id) {
// store the found id in cache for later use
if (kConf::get('enable_cache') && function_exists('apc_fetch') && function_exists('apc_store')) {
$success = apc_store($cacheKey, $id, kConf::get('apc_cache_ttl'));
if ($success) {
KalturaLog::debug("UserRole str_id [{$strId}] mapped to id [{$id}] - stored in cache");
}
}
}
if (!$id) {
KalturaLog::log("UserRole with str_id [{$strId}] not found in DB!");
}
return $id;
}
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:33,代码来源:UserRolePeer.php
示例8: parseCreatedFiles
protected function parseCreatedFiles()
{
$xmlPath = $this->outDir . DIRECTORY_SEPARATOR . $this->destFileName . '.ism';
KalturaLog::info("Parse created files from ism[{$xmlPath}]");
// in case of wma
if (!file_exists($xmlPath)) {
KalturaLog::info("ism file[{$xmlPath}] doesn't exist");
$wmaPath = $this->outDir . DIRECTORY_SEPARATOR . $this->destFileName . '.wma';
if (file_exists($wmaPath)) {
KalturaLog::info("wma file[{$wmaPath}] found");
$this->outFilesPath[0] = $wmaPath;
}
return;
}
$xml = file_get_contents($xmlPath);
$xml = mb_convert_encoding($xml, 'ASCII', 'UTF-16');
KalturaLog::debug("ism content:\n{$xml}");
$arr = null;
if (preg_match('/(<smil[\\s\\w\\W]+<\\/smil>)/', $xml, $arr)) {
$xml = $arr[1];
}
file_put_contents($xmlPath, $xml);
//echo $xml;
$doc = new DOMDocument();
$doc->loadXML($xml);
$videoEntities = $doc->getElementsByTagName('video');
foreach ($videoEntities as $videoEntity) {
$src = $this->outDir . DIRECTORY_SEPARATOR . $videoEntity->getAttribute("src");
$bitrate = $videoEntity->getAttribute("systemBitrate") / 1000;
KalturaLog::info("Media found in ism bitrate[{$bitrate}] source[{$src}]");
$this->outFilesPath[$bitrate] = $src;
}
}
开发者ID:DBezemer,项目名称:server,代码行数:33,代码来源:KOperationEngineExpressionEncoder3.php
示例9: checkIsLive
public function checkIsLive($url)
{
KalturaLog::info('url to check:' . $url);
$parts = parse_url($url);
parse_str($parts['query'], $query);
$token = $query[$this->getParamName()];
$data = $this->urlExists($url, array($this->getHdsManifestContentType()));
if (!$data) {
KalturaLog::Info("URL [{$url}] returned no valid data. Exiting.");
return false;
}
KalturaLog::info('Velocix HDS manifest data:' . $data);
$dom = new KDOMDocument();
$dom->loadXML($data);
$element = $dom->getElementsByTagName('baseURL')->item(0);
if (!$element) {
KalturaLog::Info("No base url was given");
return false;
}
$baseUrl = $element->nodeValue;
foreach ($dom->getElementsByTagName('media') as $media) {
$href = $media->getAttribute('href');
$streamUrl = $baseUrl . $href;
$streamUrl .= $token ? '?' . $this->getParamName() . "={$token}" : '';
if ($this->urlExists($streamUrl, array(), '0-0') !== false) {
KalturaLog::info('is live:' . $streamUrl);
return true;
}
}
return false;
}
开发者ID:DBezemer,项目名称:server,代码行数:31,代码来源:DeliveryProfileVelocixLiveHds.php
示例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();
}
}
开发者ID:kubrickfr,项目名称:server,代码行数:26,代码来源:KalturaHttpNotificationDataText.php
示例11: addAction
/**
* Allows you to add an cue point object associated with an entry
*
* @action add
* @param KalturaCuePoint $cuePoint
* @return KalturaCuePoint
*/
function addAction(KalturaCuePoint $cuePoint)
{
$dbCuePoint = $cuePoint->toInsertableObject();
if ($cuePoint->systemName) {
$existingCuePoint = CuePointPeer::retrieveBySystemName($cuePoint->entryId, $cuePoint->systemName);
if ($existingCuePoint) {
throw new KalturaAPIException(KalturaCuePointErrors::CUE_POINT_SYSTEM_NAME_EXISTS, $cuePoint->systemName, $existingCuePoint->getId());
}
}
/* @var $dbCuePoint CuePoint */
$dbCuePoint->setPartnerId($this->getPartnerId());
$dbCuePoint->setPuserId(is_null($cuePoint->userId) ? $this->getKuser()->getPuserId() : $cuePoint->userId);
$dbCuePoint->setStatus(CuePointStatus::READY);
if ($this->getCuePointType()) {
$dbCuePoint->setType($this->getCuePointType());
}
$created = $dbCuePoint->save();
if (!$created) {
KalturaLog::err("Cue point not created");
return null;
}
$cuePoint = KalturaCuePoint::getInstance($dbCuePoint->getType());
if (!$cuePoint) {
KalturaLog::err("API Cue point not instantiated");
return null;
}
$cuePoint->fromObject($dbCuePoint, $this->getResponseProfile());
return $cuePoint;
}
开发者ID:AdiTal,项目名称:server,代码行数:36,代码来源:CuePointService.php
示例12: applyFilterFields
protected function applyFilterFields(baseObjectFilter $filter)
{
/* @var $filter cuePointFilter */
// Reduce the cache expiry when fetching live stream cuepoints
$entryId = $filter->get('_in_entry_id');
if ($entryId && strpos($entryId, ',') === false) {
$entry = entryPeer::retrieveByPK($entryId);
if ($entry && $entry->getType() == entryType::LIVE_STREAM) {
kApiCache::setExpiry(self::LIVE_ENTRY_CUE_POINT_CACHE_EXPIRY_SECONDS);
}
}
if ($filter->get('_free_text')) {
$this->sphinxSkipped = false;
$freeTexts = $filter->get('_free_text');
KalturaLog::debug("Attach free text [{$freeTexts}]");
$this->addFreeTextToMatchClauseByMatchFields($freeTexts, CuePointFilter::FREE_TEXT_FIELDS);
}
$filter->unsetByName('_free_text');
if ($filter->get('_eq_is_public')) {
$this->sphinxSkipped = false;
$isPublic = $filter->get('_eq_is_public');
$this->addCondition('is_public' . " = " . $isPublic);
}
$filter->unsetByName('_eq_is_public');
return parent::applyFilterFields($filter);
}
开发者ID:kubrickfr,项目名称:server,代码行数:26,代码来源:SphinxCuePointCriteria.php
示例13: getSecureHdUrl
/**
* @return array
*/
protected function getSecureHdUrl()
{
$params = array();
if ($this->getSupportClipping()) {
$seekStart = $this->params->getSeekFromTime();
$seekEnd = $this->params->getClipTo();
if ($seekStart != -1) {
$params['start'] = floor($this->params->getSeekFromTime() / 1000);
$this->params->setSeekFromTime(-1);
} else {
if ($seekEnd) {
$params['start'] = 0;
}
}
if ($seekEnd) {
$params['end'] = ceil($this->params->getClipTo() / 1000);
$this->params->setClipTo(null);
}
}
$flavors = $this->buildHttpFlavorsArray();
$flavors = $this->sortFlavors($flavors);
$flavor = AkamaiDeliveryUtils::getHDN2ManifestUrl($flavors, $this->params->getMediaProtocol(), $this->getUrl(), '/master.m3u8', '/i', $params);
if (!$flavor) {
KalturaLog::info(get_class() . ' failed to find flavor');
return null;
}
return $flavor;
}
开发者ID:GElkayam,项目名称:server,代码行数:31,代码来源:DeliveryProfileAkamaiAppleHttpManifest.php
示例14: testAdd
/**
* Tests EntryDistributionService->addAction()
* @param KalturaEntryDistribution $entryDistribution
* @return int
* @dataProvider provideData
*/
public function testAdd(KalturaEntryDistribution $entryDistribution)
{
try {
$resultEntryDistribution = $this->client->entryDistribution->add($entryDistribution);
$this->assertType('KalturaEntryDistribution', $resultEntryDistribution);
$this->assertNotNull($resultEntryDistribution->id);
KalturaLog::debug("Returns Entry Distribution ID [{$resultEntryDistribution->id}]");
return $resultEntryDistribution->id;
} catch (KalturaException $e) {
KalturaLog::err("Add EntryDistribution Exception code [" . $e->getCode() . "] message [" . $e->getMessage() . "]");
if ($e->getCode() != 'ENTRY_DISTRIBUTION_ALREADY_EXISTS') {
throw $e;
}
}
$entryDistributionFilter = new KalturaEntryDistributionFilter();
$entryDistributionFilter->entryIdIn = $entryDistribution->entryId;
$entryDistributionFilter->distributionProfileIdEqual = $entryDistribution->distributionProfileId;
$entryDistributionList = $this->client->entryDistribution->listAction($entryDistributionFilter);
$this->assertType('KalturaEntryDistributionListResponse', $entryDistributionList);
$this->assertNotEquals($entryDistributionList->totalCount, 0);
$this->assertEquals($entryDistributionList->totalCount, count($entryDistributionList->objects));
$resultEntryDistribution = reset($entryDistributionList->objects);
$this->assertType('KalturaEntryDistribution', $resultEntryDistribution);
$this->assertNotNull($resultEntryDistribution->id);
KalturaLog::debug("Returns Entry Distribution ID [{$resultEntryDistribution->id}]");
return $resultEntryDistribution->id;
}
开发者ID:richhl,项目名称:kalturaCE,代码行数:33,代码来源:EntryDistributionServiceTest.php
示例15: getTotalVodTimeOffset
/**
* Get the total VOD offset for a given time. Total = the sum of all VOD delta times throughout the segments.
* @return int|null The offset that should be subtracted from the given time, or
* null to indicate that this time signature is in the gap between the end
* of a VOD segment and the end of the live segment (marked with x's below).
* <pre>
* Live Start VOD End Live End
* ^ ^ ^
* | |xxxxxxxxxxx|
* +------------------+-----------+
* </pre>
*/
public function getTotalVodTimeOffset($time)
{
$numSegments = count($this->segments);
$totalVodOffset = 0;
// Initially zero because there's no time drift in the first segment.
$i = 0;
$dbgPrevSegment = null;
while ($i < $numSegments) {
$segment = $this->segments[$i];
$liveStart = $segment[self::LIVE_START];
$vodAdjustedEndTime = $this->getVodAdjustedEndTime($segment);
if ($time <= $vodAdjustedEndTime) {
if ($time >= $liveStart) {
return $totalVodOffset;
} else {
KalturaLog::debug("Time [{$time}] <= {$vodAdjustedEndTime} but not >= {$liveStart}. Segment data: {$this->segmentAsString($dbgPrevSegment)}");
return null;
}
} else {
// Add up this segment's offset and move on to the next segment
$totalVodOffset += $segment[self::VOD_TO_LIVE_DELTA_TIME];
$dbgPrevSegment = $segment;
$i++;
}
}
// The time signature is greater than the total VOD duration
KalturaLog::debug("Couldn't get offset for time [{$time}]. Segment data: {$this->segmentAsString($segment)}");
return null;
}
开发者ID:GElkayam,项目名称:server,代码行数:41,代码来源:kRecordedSegmentsInfo.php
示例16: execute
/**
* Will return a JS library for integrating the KSR (similar to HTML5 in concept)
* uiconfId specifies from which uiconf to fetch different settings that should be replaced in the JS
*/
public function execute()
{
// make sure output is not parsed as HTML
header("Content-type: application/x-javascript");
$uiconfId = $this->getRequestParameter("uiconfId");
// replace all $_GET with $this->getRequestParameter()
// load uiconf from DB.
$this->uiconfObj = uiConfPeer::retrieveByPK($uiconfId);
if (!$this->uiconfObj) {
KExternalErrors::dieError(KExternalErrors::UI_CONF_NOT_FOUND);
}
$ui_conf_swf_url = $this->uiconfObj->getSwfUrl();
if (!$ui_conf_swf_url) {
KExternalErrors::dieError(KExternalErrors::ILLEGAL_UI_CONF, "SWF URL not found in UI conf");
}
@libxml_use_internal_errors(true);
try {
$this->uiconfXmlObj = new SimpleXMLElement(trim($this->uiconfObj->getConfFile()));
} catch (Exception $e) {
KalturaLog::debug("malformed uiconf XML - base64 encoded: [" . base64_encode(trim($this->uiconfObj->getConfFile())) . "]");
}
if (!$this->uiconfXmlObj instanceof SimpleXMLElement) {
// no xml or invalid XML, so throw exception
throw new Exception('uiconf XML is invalid');
}
// unsupress the xml errors
@libxml_use_internal_errors(false);
$this->_initReplacementTokens();
$this->_prepareLibJs();
$this->_prepareJs();
echo $this->jsResult;
die;
}
开发者ID:kubrickfr,项目名称:server,代码行数:37,代码来源:ksrAction.class.php
示例17: startBulkUpload
/**
*
* Starts the bulk upload
* @param KalturaBatchJob $job
*/
private function startBulkUpload(KalturaBatchJob $job)
{
KalturaLog::info("Start bulk upload ({$job->id})");
//Gets the right Engine instance
$engine = KBulkUploadEngine::getEngine($job->jobSubType, $job);
if (is_null($engine)) {
throw new KalturaException("Unable to find bulk upload engine", KalturaBatchJobAppErrors::ENGINE_NOT_FOUND);
}
$job = $this->updateJob($job, 'Parsing file [' . $engine->getName() . ']', KalturaBatchJobStatus::QUEUED, $engine->getData());
$engine->setJob($job);
$engine->setData($job->data);
$engine->handleBulkUpload();
$job = $engine->getJob();
$data = $engine->getData();
$countObjects = $this->countCreatedObjects($job->id, $job->data->bulkUploadObjectType);
$countHandledObjects = $countObjects[0];
$countErrorObjects = $countObjects[1];
if (!$countHandledObjects && !$engine->shouldRetry() && $countErrorObjects) {
throw new KalturaBatchException("None of the uploaded items were processed succsessfuly", KalturaBatchJobAppErrors::BULK_NO_ENTRIES_HANDLED, $engine->getData());
}
if ($engine->shouldRetry()) {
self::$kClient->batch->resetJobExecutionAttempts($job->id, $this->getExclusiveLockKey(), $job->jobType);
return $this->closeJob($job, null, null, "Retrying: " . $countHandledObjects . " " . $engine->getObjectTypeTitle() . " objects were handled untill now", KalturaBatchJobStatus::RETRY);
}
return $this->closeJob($job, null, null, 'Waiting for objects closure', KalturaBatchJobStatus::ALMOST_DONE, $data);
}
开发者ID:DBezemer,项目名称:server,代码行数:31,代码来源:KAsyncBulkUpload.class.php
示例18: call
private function call($method, $args = array())
{
KalturaLog::debug("Call [{$method}] args [" . print_r($args, true) . "]");
$result = $this->api->call($method, $args);
KalturaLog::debug("Result [" . print_r($result, true) . "]");
return $result;
}
开发者ID:kubrickfr,项目名称:server,代码行数:7,代码来源:DailymotionImpl.php
示例19: entryCreated
/**
* @param entry $object
* @return bool true if should continue to the next consumer
*/
public function entryCreated(entry $object)
{
$mediaType = null;
if ($object->getType() == entryType::AUTOMATIC) {
KalturaLog::debug("entry id [" . $object->getId() . "] type [" . $object->getType() . "] source link [" . $object->getSourceLink() . "]");
$mediaType = $object->getMediaType();
if (isset(self::$fileExtensions[$mediaType])) {
$object->setType(entryType::DOCUMENT);
} elseif (is_null($mediaType) || $mediaType == entry::ENTRY_MEDIA_TYPE_ANY || $mediaType == entry::ENTRY_MEDIA_TYPE_AUTOMATIC) {
$this->setDocumentType($object);
}
}
if ($object->getType() != entryType::DOCUMENT) {
KalturaLog::debug("entry id [" . $object->getId() . "] type [" . $object->getType() . "]");
return true;
}
if (is_null($mediaType) || $mediaType == entry::ENTRY_MEDIA_TYPE_ANY || $mediaType == entry::ENTRY_MEDIA_TYPE_AUTOMATIC) {
$this->setDocumentType($object);
}
if ($object instanceof DocumentEntry) {
KalturaLog::debug("entry id [" . $object->getId() . "] already handled");
return true;
}
KalturaLog::debug("Handling object [" . get_class($object) . "] type [" . $object->getType() . "] id [" . $object->getId() . "] status [" . $object->getStatus() . "]");
if ($object->getConversionProfileId()) {
$object->setStatus(entryStatus::PRECONVERT);
$object->save();
}
return true;
}
开发者ID:richhl,项目名称:kalturaCE,代码行数:34,代码来源:DocumentCreatedHandler.php
示例20: processObject
/**
* @param KalturaBaseEntry $object
*/
function processObject($object)
{
/** @var KalturaConvertEntryFlavorsObjectTask $objectTask */
$objectTask = $this->getObjectTask();
$entryId = $object->id;
$reconvert = $objectTask->reconvert;
$client = $this->getClient();
$flavorParamsIds = explode(',', $objectTask->flavorParamsIds);
foreach ($flavorParamsIds as $flavorParamsId) {
try {
$this->impersonate($object->partnerId);
$flavorAssetFilter = new KalturaFlavorAssetFilter();
$flavorAssetFilter->entryIdEqual = $entryId;
$flavorAssetFilter->flavorParamsIdEqual = $flavorParamsId;
$flavorAssetFilter->statusEqual = KalturaFlavorAssetStatus::READY;
$flavorAssetResponse = $client->flavorAsset->listAction($flavorAssetFilter);
if (!count($flavorAssetResponse->objects) || $reconvert) {
$client->flavorAsset->convert($entryId, $flavorParamsId);
}
$this->unimpersonate();
} catch (Exception $ex) {
KalturaLog::err(sprintf('Failed to convert entry id %s with flavor params id %s', $entryId, $flavorParamsId));
KalturaLog::err($ex);
}
}
}
开发者ID:DBezemer,项目名称:server,代码行数:29,代码来源:KObjectTaskConvertEntryFlavorsEngine.php
注:本文中的KalturaLog类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论