本文整理汇总了PHP中KalturaLog::notice方法的典型用法代码示例。如果您正苦于以下问题:PHP KalturaLog::notice方法的具体用法?PHP KalturaLog::notice怎么用?PHP KalturaLog::notice使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KalturaLog
的用法示例。
在下文中一共展示了KalturaLog::notice方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: parseMetadataValues
/**
* Returns values from the metadata object according to the xPath
* @param Metadata $metadata
* @param string $xPathPattern
* @return array
*/
public static function parseMetadataValues(Metadata $metadata, $xPathPattern, $version = null)
{
$key = $metadata->getSyncKey(Metadata::FILE_SYNC_METADATA_DATA, $version);
$source = kFileSyncUtils::file_get_contents($key, true, false);
if (!$source) {
KalturaLog::notice("Metadata key {$key} not found.");
return null;
}
$xml = new KDOMDocument();
$xml->loadXML($source);
if (preg_match('/^\\w[\\w\\d]*$/', $xPathPattern)) {
$xPathPattern = "//{$xPathPattern}";
}
$matches = null;
if (preg_match_all('/\\/(\\w[\\w\\d]*)/', $xPathPattern, $matches)) {
if (count($matches) == 2 && implode('', $matches[0]) == $xPathPattern) {
$xPathPattern = '';
foreach ($matches[1] as $match) {
$xPathPattern .= "/*[local-name()='{$match}']";
}
}
}
KalturaLog::debug("Metadata xpath [{$xPathPattern}]");
$xPath = new DOMXPath($xml);
$elementsList = $xPath->query($xPathPattern);
$values = array();
foreach ($elementsList as $element) {
/* @var $element DOMNode */
$values[] = $element->textContent;
}
return $values;
}
示例2: 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);
}
示例3: scan
protected function scan(KalturaBatchJob $job, KalturaVirusScanJobData $data)
{
KalturaLog::debug("scan({$job->id})");
try {
$engine = VirusScanEngine::getEngine($job->jobSubType);
if (!$engine) {
KalturaLog::err('Cannot create VirusScanEngine of type [' . $job->jobSubType . ']');
$this->closeJob($job, KalturaBatchJobErrorTypes::APP, null, 'Error: Cannot create VirusScanEngine of type [' . $job->jobSubType . ']', KalturaBatchJobStatus::FAILED);
return $job;
}
// configure engine
if (!$engine->config(self::$taskConfig->params)) {
KalturaLog::err('Cannot configure VirusScanEngine of type [' . $job->jobSubType . ']');
$this->closeJob($job, KalturaBatchJobErrorTypes::APP, null, 'Error: Cannot configure VirusScanEngine of type [' . $job->jobSubType . ']', KalturaBatchJobStatus::FAILED);
return $job;
}
$cleanIfInfected = $data->virusFoundAction == KalturaVirusFoundAction::CLEAN_NONE || $data->virusFoundAction == KalturaVirusFoundAction::CLEAN_DELETE;
$errorDescription = null;
$output = null;
// execute scan
$data->scanResult = $engine->execute($data->srcFilePath, $cleanIfInfected, $output, $errorDescription);
if (!$output) {
KalturaLog::notice('Virus scan engine [' . get_class($engine) . '] did not return any log for file [' . $data->srcFilePath . ']');
$output = 'Virus scan engine [' . get_class($engine) . '] did not return any log';
}
try {
self::$kClient->batch->logConversion($data->flavorAssetId, $output);
} catch (Exception $e) {
KalturaLog::err("Log conversion: " . $e->getMessage());
}
// check scan results
switch ($data->scanResult) {
case KalturaVirusScanJobResult::SCAN_ERROR:
$this->closeJob($job, KalturaBatchJobErrorTypes::APP, null, "Error: " . $errorDescription, KalturaBatchJobStatus::RETRY, $data);
break;
case KalturaVirusScanJobResult::FILE_IS_CLEAN:
$this->closeJob($job, null, null, "Scan finished - file was found to be clean", KalturaBatchJobStatus::FINISHED, $data);
break;
case KalturaVirusScanJobResult::FILE_WAS_CLEANED:
$this->closeJob($job, null, null, "Scan finished - file was infected but scan has managed to clean it", KalturaBatchJobStatus::FINISHED, $data);
break;
case KalturaVirusScanJobResult::FILE_INFECTED:
$this->closeJob($job, null, null, "File was found INFECTED and wasn't cleaned!", KalturaBatchJobStatus::FINISHED, $data);
break;
default:
$data->scanResult = KalturaVirusScanJobResult::SCAN_ERROR;
$this->closeJob($job, KalturaBatchJobErrorTypes::APP, null, "Error: Emtpy scan result returned", KalturaBatchJobStatus::RETRY, $data);
break;
}
} catch (Exception $ex) {
$data->scanResult = KalturaVirusScanJobResult::SCAN_ERROR;
$this->closeJob($job, KalturaBatchJobErrorTypes::RUNTIME, $ex->getCode(), "Error: " . $ex->getMessage(), KalturaBatchJobStatus::FAILED, $data);
}
return $job;
}
示例4: provision
protected function provision(KalturaBatchJob $job, KalturaProvisionJobData $data)
{
KalturaLog::notice("Provision entry");
$job = $this->updateJob($job, null, KalturaBatchJobStatus::QUEUED, 1);
$engine = KProvisionEngine::getInstance($job->jobSubType, $this->taskConfig);
if ($engine == null) {
$err = "Cannot find provision engine [{$job->jobSubType}] for job id [{$job->id}]";
return $this->closeJob($job, KalturaBatchJobErrorTypes::APP, KalturaBatchJobAppErrors::ENGINE_NOT_FOUND, $err, KalturaBatchJobStatus::FAILED);
}
KalturaLog::info("Using engine: " . $engine->getName());
$results = $engine->delete($job, $data);
if ($results->status == KalturaBatchJobStatus::FINISHED) {
return $this->closeJob($job, null, null, null, KalturaBatchJobStatus::FINISHED, $results->data);
}
return $this->closeJob($job, KalturaBatchJobErrorTypes::APP, null, $results->errMessage, $results->status, $results->data);
}
示例5: raiseEvent
public static function raiseEvent(KalturaEvent $event)
{
$consumerInterface = $event->getConsumerInterface();
KalturaLog::debug("Event [" . get_class($event) . "] raised looking for consumers [{$consumerInterface}]");
$consumers = self::getConsumers($consumerInterface);
foreach ($consumers as $consumerClass) {
// KalturaLog::debug("Event consumer [$consumerClass] called");
$continue = $event->consume(new $consumerClass());
if (!$continue) {
if ($event instanceof IKalturaCancelableEvent) {
KalturaLog::notice("Event [" . get_class($event) . "] paused by consumer [{$consumerClass}]");
break;
} else {
KalturaLog::debug("Event [" . get_class($event) . "] is not cancelable event");
}
}
}
}
示例6: checkForPendingLiveClips
public static function checkForPendingLiveClips(entry $entry)
{
if ($entry->getSource() != EntrySourceType::RECORDED_LIVE) {
KalturaLog::notice("Entry [" . $entry->getId() . "] is not a recorded live");
return;
}
$liveEntry = entryPeer::retrieveByPKNoFilter($entry->getRootEntryId());
if (!$liveEntry || $liveEntry->getStatus() == entryStatus::DELETED || !$liveEntry instanceof LiveEntry) {
KalturaLog::notice("Entry root [" . $entry->getRootEntryId() . "] is not a valid live entry");
return;
}
/* @var $liveEntry LiveEntry */
$pendingMediaEntries = $liveEntry->getAttachedPendingMediaEntries();
foreach ($pendingMediaEntries as $pendingMediaEntry) {
/* @var $pendingMediaEntry kPendingMediaEntry */
if ($pendingMediaEntry->getRequiredDuration() && $pendingMediaEntry->getRequiredDuration() > $entry->getLengthInMsecs()) {
KalturaLog::info("Pending entry [" . $pendingMediaEntry->getEntryId() . "] required duration [" . $pendingMediaEntry->getRequiredDuration() . "] while entry duration [" . $entry->getLengthInMsecs() . "] is too short");
continue;
}
$liveEntry->dettachPendingMediaEntry($pendingMediaEntry->getEntryId());
$pendingEntry = entryPeer::retrieveByPK($pendingMediaEntry->getEntryId());
if (!$pendingEntry) {
KalturaLog::info("Pending entry [" . $pendingMediaEntry->getEntryId() . "] not found");
continue;
}
$sourceAsset = assetPeer::retrieveOriginalByEntryId($entry->getId());
if (!$sourceAsset) {
$sourceAssets = assetPeer::retrieveReadyFlavorsByEntryId($entry->getId());
$sourceAsset = array_pop($sourceAssets);
}
if (!$sourceAsset) {
KalturaLog::info("Pending entry [" . $pendingMediaEntry->getEntryId() . "] source asset not found");
continue;
}
/* @var $sourceAsset flavorAsset */
$operationAttributes = new kClipAttributes();
$operationAttributes->setOffset($pendingMediaEntry->getOffset());
$operationAttributes->setDuration($pendingMediaEntry->getDuration());
$targetAsset = assetPeer::retrieveOriginalByEntryId($pendingMediaEntry->getEntryId());
if (!$targetAsset) {
$targetAsset = kFlowHelper::createOriginalFlavorAsset($entry->getPartnerId(), $pendingMediaEntry->getEntryId());
}
$targetAsset->setFileExt($sourceAsset->getFileExt());
$targetAsset->save();
$sourceSyncKey = $sourceAsset->getSyncKey(asset::FILE_SYNC_ASSET_SUB_TYPE_ASSET);
$targetSyncKey = $targetAsset->getSyncKey(asset::FILE_SYNC_ASSET_SUB_TYPE_ASSET);
kFileSyncUtils::createSyncFileLinkForKey($targetSyncKey, $sourceSyncKey);
$errDescription = '';
kBusinessPreConvertDL::decideAddEntryFlavor(null, $pendingMediaEntry->getEntryId(), $operationAttributes->getAssetParamsId(), $errDescription, $targetAsset->getId(), array($operationAttributes));
}
$liveEntry->save();
}
示例7: operate
public function operate(kOperator $operator = null, $inFilePath, $configFilePath = null)
{
KalturaLog::debug("document : operator [" . print_r($operator, true) . "] inFilePath [{$inFilePath}]");
if ($configFilePath) {
$configFilePath = realpath($configFilePath);
}
// bypassing PDF Creator for source PDF files
$inputExtension = strtolower(pathinfo($inFilePath, PATHINFO_EXTENSION));
if ($inputExtension == 'pdf' && !$this->data->flavorParamsOutput->readonly) {
KalturaLog::notice('Bypassing PDF Creator for source PDF files');
if (!@copy($inFilePath, $this->outFilePath)) {
$error = '';
if (function_exists('error_get_last')) {
$error = error_get_last();
}
throw new KOperationEngineException('Cannot copy PDF file [' . $this->inFilePath . '] to [' . $this->outFilePath . '] - [' . $error . ']');
} else {
// PDF input file copied as is to output file
return true;
}
}
// renaming with unique name to allow conversion 2 conversions of same input file to be done together (PDF+SWF)
$tmpUniqInFilePath = dirname($inFilePath) . '/' . uniqid() . '_' . basename($inFilePath);
$realInFilePath = '';
$uniqueName = false;
if (@copy($inFilePath, $tmpUniqInFilePath)) {
$realInFilePath = realpath($tmpUniqInFilePath);
$uniqueName = true;
} else {
KalturaLog::notice('Could not rename input file [' . $inFilePath . '] with a unique name [' . $tmpUniqInFilePath . ']');
$realInFilePath = realpath($inFilePath);
}
$filePrefix = file_get_contents($realInFilePath, false, null, 0, strlen(self::OLD_OFFICE_SIGNATURE));
$path_info = pathinfo($realInFilePath);
$ext = $path_info['extension'];
$newOfficeExtensions = array('pptx', 'docx', 'xlsx');
$ext = strtolower($ext);
//checks if $realInFilePath is an old office document with a new extension ('pptx|docx|xlsx')
//if $realInFilePath is not the fileSync itself ($uniqueName = true) , rename the file by removing the 'x' from the extension.
if ($uniqueName && in_array($ext, $newOfficeExtensions) && $filePrefix == self::OLD_OFFICE_SIGNATURE) {
$RealInFilePathWithoutX = substr($realInFilePath, 0, -1);
if (rename($realInFilePath, $RealInFilePathWithoutX)) {
KalturaLog::notice("renamed file [{$realInFilePath}] to [{$RealInFilePathWithoutX}]");
$realInFilePath = $RealInFilePathWithoutX;
}
}
$finalOutputPath = $this->outFilePath;
if ($inputExtension == 'pdf' && $this->data->flavorParamsOutput->readonly == true) {
$tmpFile = $this->outFilePath . '.pdf';
} else {
$tmpFile = kFile::replaceExt(basename($realInFilePath), 'pdf');
$tmpFile = dirname($this->outFilePath) . '/' . $tmpFile;
}
$this->outFilePath = $tmpFile;
// Create popups log file
$killPopupsPath = $this->getKillPopupsPath();
if (file_exists($killPopupsPath)) {
unlink($killPopupsPath);
}
// Test file type
$errorMsg = $this->checkFileType($realInFilePath, $this->SUPPORTED_FILE_TYPES);
if (!is_null($errorMsg)) {
$this->data->engineMessage = $errorMsg;
}
parent::operate($operator, $realInFilePath, $configFilePath);
$this->outFilePath = $finalOutputPath;
if ($uniqueName) {
@unlink($tmpUniqInFilePath);
}
$sleepTimes = KBatchBase::$taskConfig->fileExistReties;
if (!$sleepTimes) {
$sleepTimes = self::DEFAULT_SLEEP_TIMES;
}
$sleepSeconds = KBatchBase::$taskConfig->fileExistInterval;
if (!$sleepSeconds) {
$sleepSeconds = self::DEFAULT_SLEEP_SECONDS;
}
// sleeping while file not ready, since PDFCreator exists a bit before the file is actually ready
while (!file_exists(realpath($tmpFile)) && $sleepTimes > 0) {
sleep($sleepSeconds);
$sleepTimes--;
clearstatcache();
}
// Read popup log file
if (file_exists($killPopupsPath)) {
$data = file_get_contents($killPopupsPath);
$data = trim($data);
if (!empty($data)) {
KalturaLog::notice("Convert popups warnings - " . $data);
if (is_null($this->message)) {
$this->message = $data;
} else {
$this->message .= $data;
}
}
unlink($killPopupsPath);
}
if (!file_exists(realpath($tmpFile))) {
throw new kTemporaryException('Temp PDF Creator file not found [' . $tmpFile . '] output file [' . $this->outFilePath . ']
Convert Engine message [' . $this->message . ']');
//.........这里部分代码省略.........
示例8: submitAddEntryDistribution
/**
* @param EntryDistribution $entryDistribution
* @param DistributionProfile $distributionProfile
* @param bool $submitWhenReady
* @return BatchJob
*/
public static function submitAddEntryDistribution(EntryDistribution $entryDistribution, DistributionProfile $distributionProfile, $submitWhenReady = true)
{
if ($distributionProfile->getStatus() != DistributionProfileStatus::ENABLED || $distributionProfile->getSubmitEnabled() == DistributionProfileActionStatus::DISABLED) {
KalturaLog::debug("Submission is not enabled");
return null;
}
$validStatus = array(EntryDistributionStatus::ERROR_DELETING, EntryDistributionStatus::ERROR_SUBMITTING, EntryDistributionStatus::ERROR_UPDATING, EntryDistributionStatus::IMPORT_SUBMITTING, EntryDistributionStatus::PENDING, EntryDistributionStatus::QUEUED, EntryDistributionStatus::READY, EntryDistributionStatus::REMOVED);
if (!in_array($entryDistribution->getStatus(), $validStatus)) {
KalturaLog::notice("Wrong entry distribution status [" . $entryDistribution->getStatus() . "]");
return null;
}
$returnValue = false;
$validationErrors = $entryDistribution->getValidationErrors();
if (!count($validationErrors)) {
KalturaLog::debug("No validation errors found");
$returnValue = true;
$sunrise = $entryDistribution->getSunrise(null);
if ($sunrise) {
KalturaLog::debug("Applying sunrise [{$sunrise}]");
$distributionProvider = $distributionProfile->getProvider();
if (!$distributionProvider->isScheduleUpdateEnabled() && !$distributionProvider->isAvailabilityUpdateEnabled()) {
$sunrise -= $distributionProvider->getJobIntervalBeforeSunrise();
if ($sunrise > time()) {
KalturaLog::log("Will be sent on exact time [{$sunrise}] for sunrise time [" . $entryDistribution->getSunrise() . "]");
$entryDistribution->setDirtyStatus(EntryDistributionDirtyStatus::SUBMIT_REQUIRED);
$entryDistribution->save();
$returnValue = null;
}
}
}
if ($returnValue) {
$returnValue = self::addSubmitAddJob($entryDistribution, $distributionProfile);
}
}
if (!$returnValue && $submitWhenReady && $entryDistribution->getStatus() != EntryDistributionStatus::QUEUED) {
$entryDistribution->setStatus(EntryDistributionStatus::QUEUED);
$entryDistribution->save();
KalturaLog::debug("Will be submitted when ready");
}
if (!count($validationErrors)) {
return $returnValue;
}
KalturaLog::log("Validation errors found");
$entry = entryPeer::retrieveByPK($entryDistribution->getEntryId());
if (!$entry) {
KalturaLog::err("Entry [" . $entryDistribution->getEntryId() . "] not found");
return null;
}
$autoCreateFlavors = $distributionProfile->getAutoCreateFlavorsArray();
$autoCreateThumbs = $distributionProfile->getAutoCreateThumbArray();
foreach ($validationErrors as $validationError) {
if ($validationError->getErrorType() == DistributionErrorType::MISSING_FLAVOR && in_array($validationError->getData(), $autoCreateFlavors)) {
$errDescription = null;
KalturaLog::log("Adding flavor [" . $validationError->getData() . "] to entry [" . $entryDistribution->getEntryId() . "]");
kBusinessPreConvertDL::decideAddEntryFlavor(null, $entryDistribution->getEntryId(), $validationError->getData(), $errDescription);
if ($errDescription) {
KalturaLog::log($errDescription);
}
}
if ($validationError->getErrorType() == DistributionErrorType::MISSING_THUMBNAIL && count($autoCreateThumbs)) {
list($requiredWidth, $requiredHeight) = explode('x', $validationError->getData());
$foundThumbParams = false;
$thumbParamsObjects = assetParamsPeer::retrieveByPKs($autoCreateThumbs);
foreach ($thumbParamsObjects as $thumbParams) {
/* @var $thumbParams thumbParams */
if ($thumbParams->getWidth() == intval($requiredWidth) && $thumbParams->getHeight() == intval($requiredHeight)) {
$foundThumbParams = true;
KalturaLog::log("Adding thumbnail [" . $thumbParams->getId() . "] to entry [" . $entryDistribution->getEntryId() . "]");
kBusinessPreConvertDL::decideThumbGenerate($entry, $thumbParams);
break;
}
}
if (!$foundThumbParams) {
KalturaLog::err("Required thumbnail params not found [" . $validationError->getData() . "]");
}
}
}
return null;
}
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:85,代码来源:kContentDistributionManager.php
示例9: generateThumbnailsFromFlavor
/**
* @param BatchJob $parentJob
* @param int $srcParamsId
*/
public static function generateThumbnailsFromFlavor($entryId, BatchJob $parentJob = null, $srcParamsId = null)
{
$profile = null;
try {
$profile = myPartnerUtils::getConversionProfile2ForEntry($entryId);
} catch (Exception $e) {
KalturaLog::err('getConversionProfile2ForEntry Error: ' . $e->getMessage());
}
if (!$profile) {
KalturaLog::notice("Profile not found for entry id [{$entryId}]");
return;
}
$entry = entryPeer::retrieveByPK($entryId);
if (!$entry) {
KalturaLog::notice("Entry id [{$entryId}] not found");
return;
}
$assetParamsIds = flavorParamsConversionProfilePeer::getFlavorIdsByProfileId($profile->getId());
if (!count($assetParamsIds)) {
KalturaLog::notice("No asset params objects found for profile id [" . $profile->getId() . "]");
return;
}
// the alternative is the source or the highest bitrate if source not defined
$alternateFlavorParamsId = null;
if (is_null($srcParamsId)) {
$flavorParamsObjects = flavorParamsPeer::retrieveByPKs($assetParamsIds);
foreach ($flavorParamsObjects as $flavorParams) {
if ($flavorParams->hasTag(flavorParams::TAG_SOURCE)) {
$alternateFlavorParamsId = $flavorParams->getId();
}
}
if (is_null($alternateFlavorParamsId)) {
$srcFlavorAsset = flavorAssetPeer::retrieveHighestBitrateByEntryId($entryId);
$alternateFlavorParamsId = $srcFlavorAsset->getFlavorParamsId();
}
if (is_null($alternateFlavorParamsId)) {
KalturaLog::notice("No source flavor params object found for entry id [{$entryId}]");
return;
}
}
// create list of created thumbnails
$thumbAssetsList = array();
$thumbAssets = thumbAssetPeer::retrieveByEntryId($entryId);
if (count($thumbAssets)) {
foreach ($thumbAssets as $thumbAsset) {
if (!is_null($thumbAsset->getFlavorParamsId())) {
$thumbAssetsList[$thumbAsset->getFlavorParamsId()] = $thumbAsset;
}
}
}
$thumbParamsObjects = thumbParamsPeer::retrieveByPKs($assetParamsIds);
foreach ($thumbParamsObjects as $thumbParams) {
// check if this thumbnail already created
if (isset($thumbAssetsList[$thumbParams->getId()])) {
continue;
}
if (is_null($srcParamsId) && is_null($thumbParams->getSourceParamsId())) {
// alternative should be used
$thumbParams->setSourceParamsId($alternateFlavorParamsId);
} elseif ($thumbParams->getSourceParamsId() != $srcParamsId) {
// only thumbnails that uses srcParamsId should be generated for now
continue;
}
kBusinessPreConvertDL::decideThumbGenerate($entry, $thumbParams, $parentJob);
}
}
示例10: UserLoginData
$new_login_data = new UserLoginData();
$partner = PartnerPeer::retrieveByPK($user->getPartnerId());
if (!$partner) {
KalturaLog::alert('!!! ERROR - Partner ID [' . $user->getPartnerId() . '] not found on DB but set for admin user id [' . $lastUser . '] !!!');
echo '!!! ERROR - Partner ID [' . $user->getPartnerId() . '] not found on DB but set for admin user id [' . $lastUser . '] !!!';
continue;
}
list($firstName, $lastName) = kString::nameSplit($user->getFullName());
$c = new Criteria();
$c->addAnd(UserLoginDataPeer::LOGIN_EMAIL, $user->getEmail());
$existing_login_data = UserLoginDataPeer::doSelectOne($c);
if ($existing_login_data) {
if ($user->getPartnerId() === $existing_login_data->getConfigPartnerId()) {
$checkKuser = kuserPeer::getByLoginDataAndPartner($existing_login_data->getId(), $user->getPartnerId());
if ($checkKuser && $checkKuser->getIsAdmin()) {
KalturaLog::notice('!!! NOTICE - Existing ADMIN login data found with id [' . $existing_login_data->getId() . '] partner [' . $existing_login_data->getConfigPartnerId() . '] - skipping user id [' . $lastUser . '] of partner [' . $user->getPartnerId() . '] since this was probably caused by a bug');
echo '!!! NOTICE - Existing ADMIN login data found with id [' . $existing_login_data->getId() . '] partner [' . $existing_login_data->getConfigPartnerId() . '] - skipping user id [' . $lastUser . '] of partner [' . $user->getPartnerId() . '] since this was probably caused by a bug';
continue;
}
}
KalturaLog::alert('!!! ERROR - Existing login data found with id [' . $existing_login_data->getId() . '] partner [' . $existing_login_data->getConfigPartnerId() . '] - skipping user id [' . $lastUser . '] of partner [' . $user->getPartnerId() . '] !!!!');
echo '!!! ERROR - Existing login data found with id [' . $existing_login_data->getId() . '] partner [' . $existing_login_data->getConfigPartnerId() . '] - skipping user id [' . $lastUser . '] of partner [' . $user->getPartnerId() . '] !!!!';
continue;
}
$new_login_data->setConfigPartnerId($user->getPartnerId());
$new_login_data->setLoginEmail($user->getEmail());
$new_login_data->setFirstName($firstName);
$new_login_data->setLastName($lastName);
$new_login_data->setSalt($user->getSalt());
$new_login_data->setSha1Password($user->getSha1Password());
$new_login_data->setCreatedAt($user->getCreatedAt());
示例11: createCategoryAssociations
/**
* Function which creates KalturaCategoryEntry objects for the entry which was added
* via the bulk upload CSV.
* @param string $entryId
* @param string $categories
* @param KalturaBulkUploadResultEntry $bulkuploadResult
*/
private function createCategoryAssociations($entryId, $categories, KalturaBulkUploadResultEntry $bulkuploadResult)
{
if (!$categories) {
// skip this prcoess if no categories are present
KalturaLog::notice("No categories found for entry ID [{$entryId}], skipping association creating");
return;
}
$this->impersonate();
$categoriesArr = explode(",", $categories);
$ret = array();
foreach ($categoriesArr as $categoryName) {
$categoryFilter = new KalturaCategoryFilter();
$categoryFilter->fullNameEqual = $categoryName;
$res = $this->kClient->category->listAction($categoryFilter, new KalturaFilterPager());
if (!count($res->objects)) {
$res = $this->createCategoryByPath($categoryName);
if (!$res instanceof KalturaCategory) {
$bulkuploadResult->errorDescription .= $res;
continue;
}
$category = $res;
} else {
$category = $res->objects[0];
}
$categoryEntry = new KalturaCategoryEntry();
$categoryEntry->categoryId = $category->id;
$categoryEntry->entryId = $entryId;
try {
$this->kClient->categoryEntry->add($categoryEntry);
} catch (Exception $e) {
$bulkuploadResult->errorDescription .= $e->getMessage();
}
}
$this->unimpersonate();
return;
}
示例12: run
public function run($jobs = null)
{
KalturaLog::notice("Convert collection batch is running");
return parent::run($jobs);
}
示例13: handleStorageExportFailed
/**
* @param BatchJob $dbBatchJob
* @param kStorageExportJobData $data
* @return BatchJob
*/
public static function handleStorageExportFailed(BatchJob $dbBatchJob, kStorageExportJobData $data)
{
if ($dbBatchJob->getErrType() == BatchJobErrorTypes::APP && $dbBatchJob->getErrNumber() == BatchJobAppErrors::FILE_ALREADY_EXISTS) {
KalturaLog::notice("remote file already exists");
return $dbBatchJob;
}
$fileSync = FileSyncPeer::retrieveByPK($data->getSrcFileSyncId());
if (!$fileSync) {
KalturaLog::err("FileSync [" . $data->getSrcFileSyncId() . "] not found");
return $dbBatchJob;
}
$fileSync->setStatus(FileSync::FILE_SYNC_STATUS_ERROR);
$fileSync->save();
// if an asset was exported - check if should set its status to ERROR
$asset = assetPeer::retrieveByFileSync($fileSync);
if ($asset && $asset->getStatus() == asset::ASSET_STATUS_EXPORTING) {
$asset->setStatus(asset::ASSET_STATUS_ERROR);
$asset->save();
if ($asset instanceof flavorAsset) {
$flavorParamsOutput = $asset->getFlavorParamsOutput();
$flavorParamsOutputId = $flavorParamsOutput ? $flavorParamsOutput->getId() : null;
$mediaInfo = mediaInfoPeer::retrieveByFlavorAssetId($asset->getId());
$mediaInfoId = $mediaInfo ? $mediaInfo->getId() : null;
kBusinessPostConvertDL::handleConvertFailed($dbBatchJob, null, $asset->getId(), $flavorParamsOutputId, $mediaInfoId);
}
}
return $dbBatchJob;
}
示例14: getOrCreatePartnerGroupPermission
$partner->setAlwaysAllowedPermissionNames($currentPerms);
$partner->save();
}
// check if partner group is set for the action
$partnerGroup = $serviceConfig->getPartnerGroup();
if ($partnerGroup) {
// partner group is set - add a special partner group permission to all relevant partners and add current permission item to it
$partnerGroupPermission = getOrCreatePartnerGroupPermission($partner->getId(), $partnerGroup);
$partnerGroupPermission->addPermissionItem($permissionItem->getId(), true);
}
}
}
}
}
$msg = 'Done!';
KalturaLog::notice($msg);
echo $msg . PHP_EOL;
// -- helper functions ------------------------------------------
/**
* Return all partners with $file set as their SERVICE_CONFIG_ID
* @param string $file file name
* @return array of Partner objects
*/
function getPartners($file)
{
$file = substr($file, 3);
PartnerPeer::clearInstancePool();
$c = new Criteria();
$c->addAnd(PartnerPeer::SERVICE_CONFIG_ID, $file, Criteria::EQUAL);
$partners = PartnerPeer::doSelect($c);
return $partners;
示例15: getStartIndex
/**
*
* Gets the start line number for the given job id
* @return int - the start line for the job id
*/
protected function getStartIndex()
{
try {
$result = KBatchBase::$kClient->batch->getBulkUploadLastResult($this->job->id);
if ($result) {
return $result->lineIndex;
}
} catch (Exception $e) {
KalturaLog::notice("getBulkUploadLastResult: " . $e->getMessage());
}
return 0;
}