当前位置: 首页>>代码示例>>PHP>>正文


PHP BatchJob::getJobSubType方法代码示例

本文整理汇总了PHP中BatchJob::getJobSubType方法的典型用法代码示例。如果您正苦于以下问题:PHP BatchJob::getJobSubType方法的具体用法?PHP BatchJob::getJobSubType怎么用?PHP BatchJob::getJobSubType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BatchJob的用法示例。


在下文中一共展示了BatchJob::getJobSubType方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: doConsume

 /**
  * @param kBatchJobStatusEventConsumer $consumer
  * @return bool true if should continue to the next consumer
  */
 protected function doConsume(KalturaEventConsumer $consumer)
 {
     if (!$consumer->shouldConsumeJobStatusEvent($this->dbBatchJob)) {
         return true;
     }
     KalturaLog::debug(get_class($this) . " event consumed by " . get_class($consumer) . " job id [" . $this->dbBatchJob->getId() . "] type [" . $this->dbBatchJob->getJobType() . "] sub type [" . $this->dbBatchJob->getJobSubType() . "] status [" . $this->dbBatchJob->getStatus() . "]");
     return $consumer->updatedJob($this->dbBatchJob, $this->twinJob);
 }
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:12,代码来源:kBatchJobStatusEvent.php

示例2: doConsume

 /**
  * @param kBatchJobStatusEventConsumer $consumer
  * @return bool true if should continue to the next consumer
  */
 protected function doConsume(KalturaEventConsumer $consumer)
 {
     if (!$consumer->shouldConsumeJobStatusEvent($this->dbBatchJob)) {
         return true;
     }
     KalturaLog::debug('consumer [' . get_class($consumer) . '] started handling [' . get_class($this) . '] job id [' . $this->dbBatchJob->getId() . '] type [' . $this->dbBatchJob->getJobType() . '] sub type [' . $this->dbBatchJob->getJobSubType() . '] status [' . $this->dbBatchJob->getStatus() . ']');
     $result = $consumer->updatedJob($this->dbBatchJob);
     KalturaLog::debug('consumer [' . get_class($consumer) . '] finished handling [' . get_class($this) . '] job id [' . $this->dbBatchJob->getId() . '] type [' . $this->dbBatchJob->getJobType() . '] sub type [' . $this->dbBatchJob->getJobSubType() . '] status [' . $this->dbBatchJob->getStatus() . ']');
     return $result;
 }
开发者ID:DBezemer,项目名称:server,代码行数:14,代码来源:kBatchJobStatusEvent.php

示例3: shouldConsumeJobStatusEvent

 public function shouldConsumeJobStatusEvent(BatchJob $dbBatchJob)
 {
     if ($dbBatchJob->getJobType() == BatchJobType::STORAGE_EXPORT && $dbBatchJob->getJobSubType() == KontikiPlugin::getStorageProfileProtocolCoreValue(KontikiStorageProfileProtocol::KONTIKI)) {
         if (KontikiPlugin::isAllowedPartner($dbBatchJob->getPartnerId())) {
             return true;
         }
     }
     return false;
 }
开发者ID:DBezemer,项目名称:server,代码行数:9,代码来源:kKontikiManager.php

示例4: shouldConsumeJobStatusEvent

 public function shouldConsumeJobStatusEvent(BatchJob $dbBatchJob)
 {
     if (in_array($dbBatchJob->getStatus(), array(BatchJob::BATCHJOB_STATUS_FAILED, BatchJob::BATCHJOB_STATUS_DONT_PROCESS, BatchJob::BATCHJOB_STATUS_FINISHED)) && $dbBatchJob->getJobType() == IntegrationPlugin::getBatchJobTypeCoreValue(IntegrationBatchJobType::INTEGRATION)) {
         $providerType = $dbBatchJob->getJobSubType();
         if ($providerType == VoicebasePlugin::getProviderTypeCoreValue(VoicebaseIntegrationProviderType::VOICEBASE)) {
             return true;
         }
     }
     return false;
 }
开发者ID:DBezemer,项目名称:server,代码行数:10,代码来源:kVoicebaseFlowManager.php

示例5: handleFlavorReady

 public static function handleFlavorReady(BatchJob $dbBatchJob, $flavorAssetId)
 {
     // verifies that flavor asset created
     if (!$flavorAssetId) {
         throw new APIException(APIErrors::INVALID_FLAVOR_ASSET_ID, $flavorAssetId);
     }
     $currentFlavorAsset = flavorAssetPeer::retrieveById($flavorAssetId);
     // verifies that flavor asset exists
     if (!$currentFlavorAsset) {
         throw new APIException(APIErrors::INVALID_FLAVOR_ASSET_ID, $flavorAssetId);
     }
     // if the flavor deleted then it shouldn't be taken into ready calculations
     if ($currentFlavorAsset->getStatus() == flavorAsset::FLAVOR_ASSET_STATUS_DELETED) {
         return $currentFlavorAsset;
     }
     //		Remarked because we want the original flavor ready behavior to work the same as other flavors
     //
     //		$rootBatchJob = $dbBatchJob->getRootJob();
     //
     //		// happens in case of post convert on the original (in case of bypass)
     //		if($rootBatchJob && $currentFlavorAsset->getIsOriginal())
     //		{
     //			kJobsManager::updateBatchJob($rootBatchJob, BatchJob::BATCHJOB_STATUS_FINISHED);
     //			return $dbBatchJob;
     //		}
     $sourceMediaInfo = mediaInfoPeer::retrieveOriginalByEntryId($dbBatchJob->getEntryId());
     $productMediaInfo = mediaInfoPeer::retrieveByFlavorAssetId($currentFlavorAsset->getId());
     $targetFlavor = flavorParamsOutputPeer::retrieveByFlavorAssetId($currentFlavorAsset->getId());
     // don't validate in case of bypass, in case target flavor or media info are null
     if ($dbBatchJob->getJobSubType() != BatchJob::BATCHJOB_SUB_TYPE_POSTCONVERT_BYPASS && $targetFlavor && $productMediaInfo) {
         try {
             $productFlavor = KDLWrap::CDLValidateProduct($sourceMediaInfo, $targetFlavor, $productMediaInfo);
         } catch (Exception $e) {
             KalturaLog::err('KDL Error: ' . print_r($e, true));
         }
         $err = kBusinessConvertDL::parseFlavorDescription($productFlavor);
         KalturaLog::debug("BCDL: job id [" . $dbBatchJob->getId() . "] flavor params output id [" . $targetFlavor->getId() . "] flavor asset id [" . $currentFlavorAsset->getId() . "] desc: {$err}");
         if (!$productFlavor->IsValid()) {
             $description = $currentFlavorAsset->getDescription() . "\n{$err}";
             // mark the asset as ready
             $currentFlavorAsset->setDescription($description);
             $currentFlavorAsset->setStatus(flavorAsset::FLAVOR_ASSET_STATUS_ERROR);
             $currentFlavorAsset->save();
             if (!kConf::get('ignore_cdl_failure')) {
                 kJobsManager::failBatchJob($dbBatchJob, $err);
                 return null;
             }
         }
     }
     // mark the asset as ready
     $currentFlavorAsset->setStatus(flavorAsset::FLAVOR_ASSET_STATUS_READY);
     $currentFlavorAsset->save();
     kFlowHelper::generateThumbnailsFromFlavor($dbBatchJob->getEntryId(), $dbBatchJob, $currentFlavorAsset->getFlavorParamsId());
     return $currentFlavorAsset;
 }
开发者ID:richhl,项目名称:kalturaCE,代码行数:55,代码来源:kBusinessPostConvertDL.php

示例6: shouldConsumeJobStatusEvent

 public function shouldConsumeJobStatusEvent(BatchJob $dbBatchJob)
 {
     if ($dbBatchJob->getJobSubType() == LimeLightPlugin::getEntrySourceTypeCoreValue(LimeLightLiveEntrySourceType::LIMELIGHT_LIVE)) {
         if ($dbBatchJob->getJobType() == BatchJobType::PROVISION_PROVIDE) {
             return true;
         }
         if ($dbBatchJob->getJobType() == BatchJobType::PROVISION_DELETE) {
             return true;
         }
     }
     return false;
 }
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:12,代码来源:kLimeLightLiveFlowManager.php

示例7: shouldConsumeJobStatusEvent

 public function shouldConsumeJobStatusEvent(BatchJob $dbBatchJob)
 {
     if ($dbBatchJob->getJobType() != EventNotificationPlugin::getBatchJobTypeCoreValue(EventNotificationBatchType::EVENT_NOTIFICATION_HANDLER)) {
         return false;
     }
     if ($dbBatchJob->getJobSubType() != BusinessProcessNotificationPlugin::getBusinessProcessNotificationTemplateTypeCoreValue(BusinessProcessNotificationTemplateType::BPM_START)) {
         return false;
     }
     if ($dbBatchJob->getStatus() != BatchJob::BATCHJOB_STATUS_FINISHED) {
         return false;
     }
     return true;
 }
开发者ID:DBezemer,项目名称:server,代码行数:13,代码来源:kBusinessProcessNotificationFlowManager.php

示例8: writeBulkUploadLogFile

 /**
  * Returns the log file for bulk upload job
  * @param BatchJob $batchJob bulk upload batchjob
  */
 public static function writeBulkUploadLogFile($batchJob)
 {
     if ($batchJob->getJobSubType() != self::getBulkUploadTypeCoreValue(BulkUploadXmlType::XML)) {
         return;
     }
     $xmlElement = self::getBulkUploadMrssXml($batchJob);
     if (is_null($xmlElement)) {
         echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?><mrss><error>Log file is not ready: " . $batchJob->getMessage() . "</error></mrss>";
         kFile::closeDbConnections();
         exit;
     }
     echo $xmlElement->asXML();
     kFile::closeDbConnections();
     exit;
 }
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:19,代码来源:BulkUploadXmlPlugin.php

示例9: handleStorageExportFinished

 /**
  * @param BatchJob $dbBatchJob
  * @param kStorageExportJobData $data
  * @return BatchJob
  */
 public static function handleStorageExportFinished(BatchJob $dbBatchJob, kStorageExportJobData $data)
 {
     KalturaLog::debug("Export to storage finished for sync file[" . $data->getSrcFileSyncId() . "]");
     $fileSync = FileSyncPeer::retrieveByPK($data->getSrcFileSyncId());
     $fileSync->setStatus(FileSync::FILE_SYNC_STATUS_READY);
     $fileSync->save();
     if ($dbBatchJob->getJobSubType() != StorageProfile::STORAGE_KALTURA_DC) {
         $partner = $dbBatchJob->getPartner();
         if ($partner && $partner->getStorageDeleteFromKaltura()) {
             $syncKey = kFileSyncUtils::getKeyForFileSync($fileSync);
             kFileSyncUtils::deleteSyncFileForKey($syncKey, false, true);
         }
     }
     return $dbBatchJob;
 }
开发者ID:richhl,项目名称:kalturaCE,代码行数:20,代码来源:kFlowHelper.php

示例10: toData

 public function toData(BatchJob $dbBatchJob)
 {
     $dbData = null;
     if (is_null($this->jobType)) {
         $this->jobType = kPluginableEnumsManager::coreToApi('BatchJobType', $dbBatchJob->getJobType());
     }
     switch ($dbBatchJob->getJobType()) {
         case KalturaBatchJobType::BULKUPLOAD:
             $dbData = new kBulkUploadJobData();
             if (is_null($this->data)) {
                 $this->data = new KalturaBulkUploadJobData();
             }
             break;
         case KalturaBatchJobType::CONVERT:
             $dbData = new kConvertJobData();
             if (is_null($this->data)) {
                 $this->data = new KalturaConvertJobData();
             }
             break;
         case KalturaBatchJobType::CONVERT_PROFILE:
             $dbData = new kConvertProfileJobData();
             if (is_null($this->data)) {
                 $this->data = new KalturaConvertProfileJobData();
             }
             break;
         case KalturaBatchJobType::EXTRACT_MEDIA:
             $dbData = new kExtractMediaJobData();
             if (is_null($this->data)) {
                 $this->data = new KalturaExtractMediaJobData();
             }
             break;
         case KalturaBatchJobType::IMPORT:
             $dbData = new kImportJobData();
             if (is_null($this->data)) {
                 $this->data = new KalturaImportJobData();
             }
             break;
         case KalturaBatchJobType::POSTCONVERT:
             $dbData = new kPostConvertJobData();
             if (is_null($this->data)) {
                 $this->data = new KalturaPostConvertJobData();
             }
             break;
         case KalturaBatchJobType::MAIL:
             $dbData = new kMailJobData();
             if (is_null($this->data)) {
                 $this->data = new KalturaMailJobData();
             }
             break;
         case KalturaBatchJobType::NOTIFICATION:
             $dbData = new kNotificationJobData();
             if (is_null($this->data)) {
                 $this->data = new KalturaNotificationJobData();
             }
             break;
         case KalturaBatchJobType::BULKDOWNLOAD:
             $dbData = new kBulkDownloadJobData();
             if (is_null($this->data)) {
                 $this->data = new KalturaBulkDownloadJobData();
             }
             break;
         case KalturaBatchJobType::FLATTEN:
             $dbData = new kFlattenJobData();
             if (is_null($this->data)) {
                 $this->data = new KalturaFlattenJobData();
             }
             break;
         case KalturaBatchJobType::PROVISION_PROVIDE:
         case KalturaBatchJobType::PROVISION_DELETE:
             $jobSubType = $dbBatchJob->getJobSubType();
             $dbData = kAkamaiProvisionJobData::getInstance($jobSubType);
             if (is_null($this->data)) {
                 $this->data = KalturaProvisionJobData::getJobDataInstance($jobSubType);
             }
             break;
         case KalturaBatchJobType::CONVERT_COLLECTION:
             $dbData = new kConvertCollectionJobData();
             if (is_null($this->data)) {
                 $this->data = new KalturaConvertCollectionJobData();
             }
             break;
         case KalturaBatchJobType::STORAGE_EXPORT:
             $dbData = new kStorageExportJobData();
             if (is_null($this->data)) {
                 $this->data = new KalturaStorageExportJobData();
             }
             break;
         case KalturaBatchJobType::MOVE_CATEGORY_ENTRIES:
             $dbData = new kMoveCategoryEntriesJobData();
             if (is_null($this->data)) {
                 $this->data = new KalturaMoveCategoryEntriesJobData();
             }
             break;
         case KalturaBatchJobType::STORAGE_DELETE:
             $dbData = new kStorageDeleteJobData();
             if (is_null($this->data)) {
                 $this->data = new KalturaStorageDeleteJobData();
             }
             break;
         case KalturaBatchJobType::CAPTURE_THUMB:
//.........这里部分代码省略.........
开发者ID:DBezemer,项目名称:server,代码行数:101,代码来源:KalturaBatchJob.php

示例11: writeBulkUploadLogFile

 /**
  * Returns the log file for bulk upload job
  * @param BatchJob $batchJob bulk upload batchjob
  */
 public static function writeBulkUploadLogFile($batchJob)
 {
     if ($batchJob->getJobSubType() && $batchJob->getJobSubType() != self::getBulkUploadTypeCoreValue(BulkUploadCsvType::CSV)) {
         return;
     }
     header("Content-Type: text/plain; charset=UTF-8");
     $criteria = new Criteria();
     $criteria->add(BulkUploadResultPeer::BULK_UPLOAD_JOB_ID, $batchJob->getId());
     $criteria->addAscendingOrderByColumn(BulkUploadResultPeer::LINE_INDEX);
     $criteria->setLimit(100);
     $bulkUploadResults = BulkUploadResultPeer::doSelect($criteria);
     if (!count($bulkUploadResults)) {
         die("Log file is not ready");
     }
     $STDOUT = fopen('php://output', 'w');
     $data = $batchJob->getData();
     /* @var $data kBulkUploadJobData */
     //Add header row to the output CSV only if partner level permission for it exists
     $partnerId = kCurrentContext::$partner_id ? kCurrentContext::$partner_id : kCurrentContext::$ks_partner_id;
     if (PermissionPeer::isValidForPartner(self::FEATURE_CSV_HEADER_ROW, $partnerId)) {
         $headerRow = $data->getColumns();
         $headerRow[] = "resultStatus";
         $headerRow[] = "objectId";
         $headerRow[] = "objectStatus";
         $headerRow[] = "errorDescription";
         fputcsv($STDOUT, $headerRow);
     }
     $handledResults = 0;
     while (count($bulkUploadResults)) {
         $handledResults += count($bulkUploadResults);
         foreach ($bulkUploadResults as $bulkUploadResult) {
             /* @var $bulkUploadResult BulkUploadResult */
             $values = str_getcsv($bulkUploadResult->getRowData());
             //		    switch ($bulkUploadResult->getObjectType())
             //		    {
             //		        case BulkUploadObjectType::ENTRY:
             //		            $values = self::writeEntryBulkUploadResults($bulkUploadResult, $data);
             //		            break;
             //		        case BulkUploadObjectType::CATEGORY:
             //		            $values = self::writeCategoryBulkUploadResults($bulkUploadResult, $data);
             //		            break;
             //		        case BulkUploadObjectType::CATEGORY_USER:
             //		            $values = self::writeCategoryUserBulkUploadResults($bulkUploadResult, $data);
             //		            break;
             //		        case BulkUploadObjectType::USER:
             //		            $values = self::writeUserBulkUploadResults($bulkUploadResult, $data);
             //		            break;
             //		        default:
             //
             //		            break;
             //		    }
             $values[] = $bulkUploadResult->getStatus();
             $values[] = $bulkUploadResult->getObjectId();
             $values[] = $bulkUploadResult->getObjectStatus();
             $values[] = preg_replace('/[\\n\\r\\t]/', ' ', $bulkUploadResult->getErrorDescription());
             fputcsv($STDOUT, $values);
         }
         if (count($bulkUploadResults) < $criteria->getLimit()) {
             break;
         }
         kMemoryManager::clearMemory();
         $criteria->setOffset($handledResults);
         $bulkUploadResults = BulkUploadResultPeer::doSelect($criteria);
     }
     fclose($STDOUT);
     kFile::closeDbConnections();
     exit;
 }
开发者ID:kubrickfr,项目名称:server,代码行数:72,代码来源:BulkUploadCsvPlugin.php

示例12: exportSourceAssetFromJob

 public static function exportSourceAssetFromJob(BatchJob $dbBatchJob)
 {
     // convert profile finished - export source flavor
     if ($dbBatchJob->getJobType() == BatchJobType::CONVERT_PROFILE) {
         $externalStorages = StorageProfilePeer::retrieveAutomaticByPartnerId($dbBatchJob->getPartnerId());
         $sourceFlavor = assetPeer::retrieveOriginalByEntryId($dbBatchJob->getEntryId());
         if (!$sourceFlavor) {
             KalturaLog::debug('Cannot find source flavor for entry id [' . $dbBatchJob->getEntryId() . ']');
         } else {
             if (!$sourceFlavor->isLocalReadyStatus()) {
                 KalturaLog::debug('Source flavor id [' . $sourceFlavor->getId() . '] has status [' . $sourceFlavor->getStatus() . '] - not ready for export');
             } else {
                 foreach ($externalStorages as $externalStorage) {
                     if ($externalStorage->triggerFitsReadyAsset($dbBatchJob->getEntryId())) {
                         self::exportFlavorAsset($sourceFlavor, $externalStorage);
                     }
                 }
             }
         }
     }
     // convert collection finished - export ism and ismc files
     if ($dbBatchJob->getJobType() == BatchJobType::CONVERT_COLLECTION && $dbBatchJob->getJobSubType() == conversionEngineType::EXPRESSION_ENCODER3) {
         $entry = $dbBatchJob->getEntry();
         $externalStorages = StorageProfilePeer::retrieveAutomaticByPartnerId($dbBatchJob->getPartnerId());
         foreach ($externalStorages as $externalStorage) {
             if ($externalStorage->triggerFitsReadyAsset($entry->getId())) {
                 $ismKey = $entry->getSyncKey(entry::FILE_SYNC_ENTRY_SUB_TYPE_ISM);
                 if (kFileSyncUtils::fileSync_exists($ismKey)) {
                     self::export($entry, $externalStorage, $ismKey);
                 }
                 $ismcKey = $entry->getSyncKey(entry::FILE_SYNC_ENTRY_SUB_TYPE_ISMC);
                 if (kFileSyncUtils::fileSync_exists($ismcKey)) {
                     self::export($entry, $externalStorage, $ismcKey);
                 }
             }
         }
     }
     return true;
 }
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:39,代码来源:kStorageExporter.php

示例13: writeBulkUploadLogFile

 /**
  * Returns the log file for bulk upload job
  * @param BatchJob $batchJob bulk upload batchjob
  * @param bool $addHeaderRow flag signifying whether the header row should be added to the CSV. Default value is false.
  */
 public static function writeBulkUploadLogFile($batchJob, $addHeaderRow = false)
 {
     if ($batchJob->getJobSubType() != null && $batchJob->getJobSubType() != self::getBulkUploadTypeCoreValue(BulkUploadCsvType::CSV)) {
         return;
     }
     header("Content-Type: text/plain; charset=UTF-8");
     $bulkUploadResults = BulkUploadResultPeer::retrieveByBulkUploadId($batchJob->getId());
     if (!count($bulkUploadResults)) {
         die("Log file is not ready");
     }
     $STDOUT = fopen('php://output', 'w');
     $data = $batchJob->getData();
     /* @var $data kBulkUploadJobData */
     //Add header row to the output CSV
     if ($addHeaderRow) {
         $headerRow = self::getHeaderRow($data->getBulkUploadObjectType());
         $headerRow[] = "action";
         $headerRow[] = "resultStatus";
         $headerRow[] = "objectId";
         $headerRow[] = "objectStatus";
         $headerRow[] = "errorDescription";
         fputcsv($STDOUT, $headerRow);
     }
     foreach ($bulkUploadResults as $bulkUploadResult) {
         /* @var $bulkUploadResult BulkUploadResult */
         switch ($bulkUploadResult->getObjectType()) {
             case BulkUploadObjectType::ENTRY:
                 $values = self::writeEntryBulkUploadResults($bulkUploadResult, $data);
                 break;
             case BulkUploadObjectType::CATEGORY:
                 $values = self::writeCategoryBulkUploadResults($bulkUploadResult, $data);
                 break;
             case BulkUploadObjectType::CATEGORY_USER:
                 $values = self::writeCategoryUserBulkUploadResults($bulkUploadResult, $data);
                 break;
             case BulkUploadObjectType::USER:
                 $values = self::writeUserBulkUploadResults($bulkUploadResult, $data);
                 break;
             default:
                 break;
         }
         $values[] = $bulkUploadResult->getAction();
         $values[] = $bulkUploadResult->getStatus();
         $values[] = $bulkUploadResult->getObjectId();
         $values[] = $bulkUploadResult->getObjectStatus();
         $values[] = preg_replace('/[\\n\\r\\t]/', ' ', $bulkUploadResult->getErrorDescription());
         fputcsv($STDOUT, $values);
     }
     fclose($STDOUT);
     kFile::closeDbConnections();
     exit;
 }
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:57,代码来源:BulkUploadCsvPlugin.php

示例14: exportSourceAssetFromJob

 public static function exportSourceAssetFromJob(BatchJob $dbBatchJob)
 {
     // convert collection finished - export ism and ismc files
     if ($dbBatchJob->getJobType() == BatchJobType::CONVERT_COLLECTION && $dbBatchJob->getJobSubType() == conversionEngineType::EXPRESSION_ENCODER3) {
         $entry = $dbBatchJob->getEntry();
         $externalStorages = StorageProfilePeer::retrieveAutomaticByPartnerId($dbBatchJob->getPartnerId());
         foreach ($externalStorages as $externalStorage) {
             if ($externalStorage->triggerFitsReadyAsset($entry->getId())) {
                 $ismKey = $entry->getSyncKey(entry::FILE_SYNC_ENTRY_SUB_TYPE_ISM);
                 if (kFileSyncUtils::fileSync_exists($ismKey)) {
                     self::export($entry, $externalStorage, $ismKey);
                 }
                 $ismcKey = $entry->getSyncKey(entry::FILE_SYNC_ENTRY_SUB_TYPE_ISMC);
                 if (kFileSyncUtils::fileSync_exists($ismcKey)) {
                     self::export($entry, $externalStorage, $ismcKey);
                 }
             }
         }
     }
     return true;
 }
开发者ID:DBezemer,项目名称:server,代码行数:21,代码来源:kStorageExporter.php

示例15: writeBulkUploadLogFile

 /**
  * Returns the log file for bulk upload job
  * @param BatchJob $batchJob bulk upload batchjob
  */
 public static function writeBulkUploadLogFile($batchJob)
 {
     if ($batchJob->getJobSubType() && $batchJob->getJobSubType() != self::getBulkUploadTypeCoreValue(BulkUploadFilterType::FILTER)) {
         return;
     }
     //TODO:
     header("Content-Type: text/plain; charset=UTF-8");
     $criteria = new Criteria();
     $criteria->add(BulkUploadResultPeer::BULK_UPLOAD_JOB_ID, $batchJob->getId());
     $criteria->addAscendingOrderByColumn(BulkUploadResultPeer::LINE_INDEX);
     $criteria->setLimit(100);
     $bulkUploadResults = BulkUploadResultPeer::doSelect($criteria);
     if (!count($bulkUploadResults)) {
         die("Log file is not ready");
     }
     $STDOUT = fopen('php://output', 'w');
     $data = $batchJob->getData();
     /* @var $data kBulkUploadFilterJobData */
     $handledResults = 0;
     while (count($bulkUploadResults)) {
         $handledResults += count($bulkUploadResults);
         foreach ($bulkUploadResults as $bulkUploadResult) {
             $values = array();
             $values['bulkUploadResultStatus'] = $bulkUploadResult->getStatus();
             $values['objectId'] = $bulkUploadResult->getObjectId();
             $values['objectStatus'] = $bulkUploadResult->getObjectStatus();
             $values['errorDescription'] = preg_replace('/[\\n\\r\\t]/', ' ', $bulkUploadResult->getErrorDescription());
             fwrite($STDOUT, print_r($values, true));
         }
         if (count($bulkUploadResults) < $criteria->getLimit()) {
             break;
         }
         kMemoryManager::clearMemory();
         $criteria->setOffset($handledResults);
         $bulkUploadResults = BulkUploadResultPeer::doSelect($criteria);
     }
     fclose($STDOUT);
     kFile::closeDbConnections();
     exit;
 }
开发者ID:DBezemer,项目名称:server,代码行数:44,代码来源:BulkUploadFilterPlugin.php


注:本文中的BatchJob::getJobSubType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。