本文整理汇总了PHP中kEventsManager类的典型用法代码示例。如果您正苦于以下问题:PHP kEventsManager类的具体用法?PHP kEventsManager怎么用?PHP kEventsManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了kEventsManager类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: updateBatchJob
public static function updateBatchJob(BatchJob $batchJob, $status, BatchJob $twinJob = null)
{
$batchJob->setStatus($status);
$batchJob->save();
$event = new kBatchJobStatusEvent($batchJob, $twinJob);
kEventsManager::raiseEvent($event);
$batchJob->reload();
return $batchJob;
}
开发者ID:richhl,项目名称:kalturaCE,代码行数:9,代码来源:kJobsManager.php
示例2: updateBatchJob
/**
* @param BatchJob $batchJob
* @param int $status
* @return BatchJob
*/
public static function updateBatchJob(BatchJob $batchJob, $status)
{
$batchJob->setStatus($status);
$changed = $batchJob->save();
if (!$changed) {
return $batchJob;
}
$event = new kBatchJobStatusEvent($batchJob);
kEventsManager::raiseEvent($event);
$batchJob->reload();
return $batchJob;
}
开发者ID:ace3535,项目名称:server,代码行数:17,代码来源:kJobsManager.php
示例3: postUpdate
public function postUpdate(PropelPDO $con = null)
{
$objectDeleted = false;
if ($this->isColumnModified(conversionProfile2Peer::DELETED_AT) && !is_null($this->getDeletedAt())) {
$objectDeleted = true;
}
$ret = parent::postUpdate($con);
if ($objectDeleted) {
kEventsManager::raiseEvent(new kObjectDeletedEvent($this));
}
return $ret;
}
开发者ID:richhl,项目名称:kalturaCE,代码行数:12,代码来源:conversionProfile2.php
示例4: postUpdate
public function postUpdate(PropelPDO $con = null)
{
$objectDeleted = false;
if ($this->isColumnModified(AnnotationPeer::STATUS) && $this->getStatus() == AnnotationStatus::ANNOTATION_STATUS_DELETED) {
$objectDeleted = true;
}
$ret = parent::postUpdate($con);
if ($objectDeleted) {
kEventsManager::raiseEvent(new kObjectDeletedEvent($this));
}
return $ret;
}
开发者ID:richhl,项目名称:kalturaCE,代码行数:12,代码来源:Annotation.php
示例5: postUpdate
public function postUpdate(PropelPDO $con = null)
{
$objectDeleted = false;
if ($this->isColumnModified(MetadataProfilePeer::STATUS) && $this->getStatus() == self::STATUS_DEPRECATED) {
$objectDeleted = true;
}
$ret = parent::postUpdate($con);
if ($objectDeleted) {
kEventsManager::raiseEvent(new kObjectDeletedEvent($this));
}
return $ret;
}
开发者ID:richhl,项目名称:kalturaCE,代码行数:12,代码来源:MetadataProfile.php
示例6: postUpdate
public function postUpdate(PropelPDO $con = null)
{
$objectDeleted = false;
if ($this->isColumnModified(BasesyndicationFeedPeer::STATUS) && $this->getStatus() == self::SYNDICATION_DELETED) {
$objectDeleted = true;
}
$ret = parent::postUpdate($con);
if ($objectDeleted) {
kEventsManager::raiseEvent(new kObjectDeletedEvent($this));
}
return $ret;
}
开发者ID:richhl,项目名称:kalturaCE,代码行数:12,代码来源:syndicationFeed.php
示例7: postUpdate
public function postUpdate(PropelPDO $con = null)
{
$objectDeleted = false;
if ($this->isColumnModified(UploadTokenPeer::STATUS) && $this->getStatus() == self::UPLOAD_TOKEN_DELETED) {
$objectDeleted = true;
}
$ret = parent::postUpdate($con);
if ($objectDeleted) {
kEventsManager::raiseEvent(new kObjectDeletedEvent($this));
}
return $ret;
}
开发者ID:richhl,项目名称:kalturaCE,代码行数:12,代码来源:UploadToken.php
示例8: resumeEvents
private function resumeEvents($flavorAsset)
{
$syncKey = $flavorAsset->getSyncKey(flavorAsset::FILE_SYNC_FLAVOR_ASSET_SUB_TYPE_ASSET);
$c = FileSyncPeer::getCriteriaForFileSyncKey($syncKey);
$fileSyncList = FileSyncPeer::doSelect($c);
foreach ($fileSyncList as $fileSync) {
// resume file sync added event
kEventsManager::continueEvent(new kObjectAddedEvent($fileSync), 'kVirusScanFlowManager');
}
// resume flavor asset added event consumption
kEventsManager::continueEvent(new kObjectAddedEvent($flavorAsset), 'kVirusScanFlowManager');
}
开发者ID:richhl,项目名称:kalturaCE,代码行数:12,代码来源:kVirusScanFlowManager.php
示例9: postUpdate
public function postUpdate(PropelPDO $con = null)
{
$objectDeleted = false;
if ($this->isColumnModified(flavorAssetPeer::STATUS) && $this->getStatus() == self::FLAVOR_ASSET_STATUS_DELETED || $this->isColumnModified(flavorAssetPeer::DELETED_AT) && !is_null($this->getDeletedAt(null))) {
$objectDeleted = true;
}
$ret = parent::postUpdate($con);
if ($objectDeleted) {
kEventsManager::raiseEvent(new kObjectDeletedEvent($this));
}
return $ret;
}
开发者ID:richhl,项目名称:kalturaCE,代码行数:12,代码来源:asset.php
示例10: entryDeleted
/**
* @param int $entryId
*/
protected function entryDeleted($entryId)
{
$c = new Criteria();
$c->add(CuePointPeer::ENTRY_ID, $entryId);
CuePointPeer::setUseCriteriaFilter(false);
$cuePoints = CuePointPeer::doSelect($c);
$update = new Criteria();
$update->add(CuePointPeer::STATUS, CuePointStatus::DELETED);
$con = Propel::getConnection(myDbHelper::DB_HELPER_CONN_MASTER);
BasePeer::doUpdate($c, $update, $con);
foreach ($cuePoints as $cuePoint) {
kEventsManager::raiseEvent(new kObjectDeletedEvent($cuePoint));
}
}
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:17,代码来源:kCuePointManager.php
示例11: postUpdate
public function postUpdate(PropelPDO $con = null)
{
if ($this->alreadyInSave) {
return parent::postUpdate($con);
}
$objectDeleted = false;
if ($this->isColumnModified(accessControlPeer::DELETED_AT) && !is_null($this->getDeletedAt())) {
$objectDeleted = true;
}
$ret = parent::postUpdate($con);
if ($objectDeleted) {
kEventsManager::raiseEvent(new kObjectDeletedEvent($this));
}
return $ret;
}
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:15,代码来源:accessControl.php
示例12: entryDeleted
/**
* @param int $entryId
*/
protected function entryDeleted($entryId)
{
$c = new Criteria();
$c->add(AnnotationPeer::ENTRY_ID, $entryId);
$c->add(AnnotationPeer::STATUS, AnnotationStatus::ANNOTATION_STATUS_DELETED, Criteria::NOT_EQUAL);
AnnotationPeer::setUseCriteriaFilter(false);
$annotations = AnnotationPeer::doSelect($c);
foreach ($annotations as $annotation) {
kEventsManager::raiseEvent(new kObjectDeletedEvent($annotation));
}
$update = new Criteria();
$update->add(AnnotationPeer::STATUS, AnnotationStatus::ANNOTATION_STATUS_DELETED);
$con = Propel::getConnection(AnnotationPeer::DATABASE_NAME, Propel::CONNECTION_READ);
BasePeer::doUpdate($c, $update, $con);
}
开发者ID:richhl,项目名称:kalturaCE,代码行数:18,代码来源:kAnnotationManager.php
示例13: postUpdate
public function postUpdate(PropelPDO $con = null)
{
if ($this->alreadyInSave) {
return parent::postUpdate($con);
}
$objectDeleted = false;
if ($this->isColumnModified(ShortLinkPeer::STATUS) && $this->getStatus() == ShortLinkStatus::DELETED) {
$objectDeleted = true;
}
$ret = parent::postUpdate($con);
if ($objectDeleted) {
kEventsManager::raiseEvent(new kObjectDeletedEvent($this));
}
return $ret;
}
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:15,代码来源:ShortLink.php
示例14: addFromUploadedFileAction
/**
* Add new document entry after the specific document file was uploaded and the upload token id exists
*
* @action addFromUploadedFile
* @param KalturaDocumentEntry $documentEntry Document entry metadata
* @param string $uploadTokenId Upload token id
* @return KalturaDocumentEntry The new document entry
*
* @throws KalturaErrors::PROPERTY_VALIDATION_MIN_LENGTH
* @throws KalturaErrors::PROPERTY_VALIDATION_CANNOT_BE_NULL
* @throws KalturaErrors::UPLOADED_FILE_NOT_FOUND_BY_TOKEN
*/
function addFromUploadedFileAction(KalturaDocumentEntry $documentEntry, $uploadTokenId)
{
try {
// check that the uploaded file exists
$entryFullPath = kUploadTokenMgr::getFullPathByUploadTokenId($uploadTokenId);
} catch (kCoreException $ex) {
if ($ex->getCode() == kUploadTokenException::UPLOAD_TOKEN_INVALID_STATUS) {
}
throw new KalturaAPIException(KalturaErrors::UPLOAD_TOKEN_INVALID_STATUS_FOR_ADD_ENTRY);
throw $ex;
}
if (!file_exists($entryFullPath)) {
$remoteDCHost = kUploadTokenMgr::getRemoteHostForUploadToken($uploadTokenId, kDataCenterMgr::getCurrentDcId());
if ($remoteDCHost) {
kFile::dumpApiRequest($remoteDCHost);
} else {
throw new KalturaAPIException(KalturaErrors::UPLOADED_FILE_NOT_FOUND_BY_TOKEN);
}
}
$dbEntry = $this->prepareEntryForInsert($documentEntry);
$dbEntry->setSource(KalturaSourceType::FILE);
$dbEntry->setSourceLink("file:{$entryFullPath}");
$dbEntry->save();
$te = new TrackEntry();
$te->setEntryId($dbEntry->getId());
$te->setTrackEventTypeId(TrackEntry::TRACK_ENTRY_EVENT_TYPE_ADD_ENTRY);
$te->setDescription(__METHOD__ . ":" . __LINE__ . "::ENTRY_MEDIA_SOURCE_FILE");
TrackEntry::addTrackEntry($te);
$msg = null;
$flavorAsset = kFlowHelper::createOriginalFlavorAsset($this->getPartnerId(), $dbEntry->getId(), $msg);
if (!$flavorAsset) {
KalturaLog::err("Flavor asset not created for entry [" . $dbEntry->getId() . "] reason [{$msg}]");
$dbEntry->setStatus(entryStatus::ERROR_CONVERTING);
$dbEntry->save();
} else {
$ext = pathinfo($entryFullPath, PATHINFO_EXTENSION);
KalturaLog::info("Uploaded file extension: {$ext}");
$flavorAsset->setFileExt($ext);
$flavorAsset->save();
$syncKey = $flavorAsset->getSyncKey(flavorAsset::FILE_SYNC_FLAVOR_ASSET_SUB_TYPE_ASSET);
kFileSyncUtils::moveFromFile($entryFullPath, $syncKey);
kEventsManager::raiseEvent(new kObjectAddedEvent($flavorAsset));
}
kUploadTokenMgr::closeUploadTokenById($uploadTokenId);
myNotificationMgr::createNotification(kNotificationJobData::NOTIFICATION_TYPE_ENTRY_ADD, $dbEntry);
$documentEntry->fromObject($dbEntry);
return $documentEntry;
}
开发者ID:richhl,项目名称:kalturaCE,代码行数:60,代码来源:DocumentsService.php
示例15: loadConsumers
protected static function loadConsumers()
{
$cachePath = kConf::get('cache_root_path') . '/EventConsumers.cache';
if (file_exists($cachePath)) {
self::$consumers = unserialize(file_get_contents($cachePath));
return;
}
$coreConsumers = kConf::get('event_consumers');
$pluginConsumers = array();
$pluginInstances = KalturaPluginManager::getPluginInstances('IKalturaEventConsumers');
foreach ($pluginInstances as $pluginInstance) {
foreach ($pluginInstance->getEventConsumers() as $pluginConsumer) {
$pluginConsumers[] = $pluginConsumer;
}
}
$consumers = array_merge($coreConsumers, $pluginConsumers);
$consumersLists = array();
foreach ($consumers as $consumer) {
if (!class_exists($consumer)) {
continue;
}
$clazz = new ReflectionClass($consumer);
$interfaces = $clazz->getInterfaces();
foreach ($interfaces as $interface) {
if ($interface->name == self::BASE_CONSUMER_INTERFACE) {
continue;
}
if (!$interface->implementsInterface(self::BASE_CONSUMER_INTERFACE)) {
continue;
}
if (!isset($consumersLists[$interface->name])) {
$consumersLists[$interface->name] = array();
}
$consumersLists[$interface->name][] = $consumer;
}
}
foreach ($consumersLists as $interfaceName => $interfaceConsumersArray) {
usort($interfaceConsumersArray, array('kEventsManager', 'compareConsumers'));
self::$consumers[$interfaceName] = $interfaceConsumersArray;
}
$cacheDir = dirname($cachePath);
if (!file_exists($cacheDir)) {
kFile::fullMkfileDir($cacheDir, 0777, true);
}
@file_put_contents($cachePath, serialize(self::$consumers));
}
开发者ID:richhl,项目名称:kalturaCE,代码行数:46,代码来源:kEventsManager.php
示例16: deleteMetadataObjects
/**
* @param int $objectType
* @param string $objectId
*/
protected function deleteMetadataObjects($objectType, $objectId)
{
$c = new Criteria();
$c->add(MetadataPeer::OBJECT_TYPE, $objectType);
$c->add(MetadataPeer::OBJECT_ID, $objectId);
$c->add(MetadataPeer::STATUS, Metadata::STATUS_DELETED, Criteria::NOT_EQUAL);
$peer = null;
MetadataPeer::setUseCriteriaFilter(false);
$metadatas = MetadataPeer::doSelect($c);
foreach ($metadatas as $metadata) {
kEventsManager::raiseEvent(new kObjectDeletedEvent($metadata));
}
$update = new Criteria();
$update->add(MetadataPeer::STATUS, Metadata::STATUS_DELETED);
$con = Propel::getConnection(MetadataPeer::DATABASE_NAME, Propel::CONNECTION_READ);
BasePeer::doUpdate($c, $update, $con);
}
开发者ID:richhl,项目名称:kalturaCE,代码行数:21,代码来源:kMetadataObjectDeletedHandler.php
示例17: updateSunStatusAction
/**
* updates entry distribution sun status in the search engine
*
* @action updateSunStatus
*/
function updateSunStatusAction()
{
$updatedEntries = array();
// serach all records that their sun status changed to after sunset
$criteria = KalturaCriteria::create(EntryDistributionPeer::OM_CLASS);
$criteria->add(EntryDistributionPeer::STATUS, EntryDistributionStatus::READY);
$criteria->add(EntryDistributionPeer::SUN_STATUS, EntryDistributionSunStatus::AFTER_SUNSET, Criteria::NOT_EQUAL);
$crit1 = $criteria->getNewCriterion(EntryDistributionPeer::SUNSET, time(), Criteria::LESS_THAN);
$criteria->add($crit1);
$entryDistributions = EntryDistributionPeer::doSelect($criteria);
foreach ($entryDistributions as $entryDistribution) {
/* @var $entryDistribution EntryDistribution */
$entryId = $entryDistribution->getEntryId();
if (isset($updatedEntries[$entryId])) {
continue;
}
$updatedEntries[$entryId] = true;
kEventsManager::raiseEvent(new kObjectUpdatedEvent($entryDistribution));
// raise the updated events to trigger index in search engine (sphinx)
kEventsManager::flushEvents();
// save entry changes to sphinx
kMemoryManager::clearMemory();
}
$updatedEntries = array();
// serach all records that their sun status changed to after sunrise
$criteria = KalturaCriteria::create(EntryDistributionPeer::OM_CLASS);
$criteria->add(EntryDistributionPeer::STATUS, EntryDistributionStatus::QUEUED);
$criteria->add(EntryDistributionPeer::SUN_STATUS, EntryDistributionSunStatus::BEFORE_SUNRISE);
$criteria->add(EntryDistributionPeer::SUNRISE, time(), Criteria::LESS_THAN);
$entryDistributions = EntryDistributionPeer::doSelect($criteria);
foreach ($entryDistributions as $entryDistribution) {
/* @var $entryDistribution EntryDistribution */
$entryId = $entryDistribution->getEntryId();
if (isset($updatedEntries[$entryId])) {
continue;
}
$updatedEntries[$entryId] = true;
kEventsManager::raiseEvent(new kObjectUpdatedEvent($entryDistribution));
// raise the updated events to trigger index in search engine (sphinx)
kEventsManager::flushEvents();
// save entry changes to sphinx
kMemoryManager::clearMemory();
}
}
开发者ID:DBezemer,项目名称:server,代码行数:49,代码来源:ContentDistributionBatchService.php
示例18: parseAction
/**
* Parse content of caption asset and index it
*
* @action parse
* @param string $captionAssetId
* @throws KalturaCaptionErrors::CAPTION_ASSET_ID_NOT_FOUND
*/
function parseAction($captionAssetId)
{
$captionAsset = assetPeer::retrieveById($captionAssetId);
if (!$captionAsset) {
throw new KalturaAPIException(KalturaCaptionErrors::CAPTION_ASSET_ID_NOT_FOUND, $captionAssetId);
}
$captionAssetItems = CaptionAssetItemPeer::retrieveByAssetId($captionAssetId);
foreach ($captionAssetItems as $captionAssetItem) {
/* @var $captionAssetItem CaptionAssetItem */
$captionAssetItem->delete();
}
// make sure that all old items are deleted from the sphinx before creating the new ones
kEventsManager::flushEvents();
$syncKey = $captionAsset->getSyncKey(asset::FILE_SYNC_FLAVOR_ASSET_SUB_TYPE_ASSET);
$content = kFileSyncUtils::file_get_contents($syncKey, true, false);
if (!$content) {
return;
}
$captionsContentManager = kCaptionsContentManager::getCoreContentManager($captionAsset->getContainerFormat());
if (!$captionsContentManager) {
return;
}
$itemsData = $captionsContentManager->parse($content);
foreach ($itemsData as $itemData) {
$item = new CaptionAssetItem();
$item->setCaptionAssetId($captionAsset->getId());
$item->setEntryId($captionAsset->getEntryId());
$item->setPartnerId($captionAsset->getPartnerId());
$item->setStartTime($itemData['startTime']);
$item->setEndTime($itemData['endTime']);
$content = '';
foreach ($itemData['content'] as $curChunk) {
$content .= $curChunk['text'];
}
//Make sure there are no invalid chars in the caption asset items to avoid braking the search request by providing invalid XML
$content = kString::stripUtf8InvalidChars($content);
$content = kXml::stripXMLInvalidChars($content);
$item->setContent($content);
$item->save();
}
}
开发者ID:DBezemer,项目名称:server,代码行数:48,代码来源:CaptionAssetItemService.php
示例19: updateSunStatusAction
/**
* updates entry distribution sun status in the search engine
*
* @action updateSunStatus
*/
function updateSunStatusAction()
{
// serach all records that their sun status changed to after sunset
$criteria = KalturaCriteria::create(EntryDistributionPeer::OM_CLASS);
$criteria->add(EntryDistributionPeer::SUN_STATUS, EntryDistributionSunStatus::AFTER_SUNSET, Criteria::NOT_EQUAL);
$crit1 = $criteria->getNewCriterion(EntryDistributionPeer::SUNSET, time(), Criteria::LESS_THAN);
$criteria->add($crit1);
$entryDistributions = EntryDistributionPeer::doSelect($criteria);
foreach ($entryDistributions as $entryDistribution) {
// raise the updated events to trigger index in search engine (sphinx)
kEventsManager::raiseEvent(new kObjectUpdatedEvent($entryDistribution));
}
// serach all records that their sun status changed to after sunrise
$criteria = KalturaCriteria::create(EntryDistributionPeer::OM_CLASS);
$criteria->add(EntryDistributionPeer::SUN_STATUS, EntryDistributionSunStatus::BEFORE_SUNRISE);
$criteria->add(EntryDistributionPeer::SUNRISE, time(), Criteria::LESS_THAN);
$entryDistributions = EntryDistributionPeer::doSelect($criteria);
foreach ($entryDistributions as $entryDistribution) {
// raise the updated events to trigger index in search engine (sphinx)
kEventsManager::raiseEvent(new kObjectUpdatedEvent($entryDistribution));
}
}
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:27,代码来源:ContentDistributionBatchService.php
示例20: execute
public function execute()
{
// can't read using $_REQUEST because the 'myaction' paramter is created in a routing.yml rule
$service_name = $this->getRequestParameter("myaction");
// remove all '_' and set to lowercase
$myaction_name = trim(strtolower(str_replace("_", "", $service_name)));
$clazz_name = $myaction_name . "Action";
// echo "[$myaction_name] [$clazz_name]<br>";
// $clazz = get_class ( $clazz_name );
//$multi_request = $this->getRequestParameter( "multirequest" , null );
$multi_request = $myaction_name == "multirequest";
if ($multi_request) {
$multi_request = new myMultiRequest($_REQUEST, $this);
$response = $multi_request->execute();
} else {
$include_result = @(include_once "{$clazz_name}.class.php");
if ($include_result) {
$myaction = new $clazz_name($this);
$myaction->setInputParams($_REQUEST);
$response = $myaction->execute();
kEventsManager::flushEvents();
} else {
$format = $this->getP("format");
$response = "Error: Invalid service [{$service_name}]";
}
}
$format = $this->getP("format");
if ($format == kalturaWebserviceRenderer::RESPONSE_TYPE_PHP_ARRAY || $format == kalturaWebserviceRenderer::RESPONSE_TYPE_PHP_OBJECT) {
//$this->setHttpHeader ( "Content-Type" , "text/html; charset=utf-8" );
$response = "<pre>" . print_r($response, true) . "</pre>";
}
// uncomment in order to cache api responses
if (kConf::get('enable_cache')) {
$this->cacheResponse($response);
}
$ret = $this->renderText($response);
KExternalErrors::terminateDispatch();
return $ret;
}
开发者ID:DBezemer,项目名称:server,代码行数:39,代码来源:defPartnerservices2baseAction.class.php
注:本文中的kEventsManager类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论