當前位置: 首頁>>代碼示例>>PHP>>正文


PHP kFileSyncUtils::getReadyPendingExternalFileSyncForKey方法代碼示例

本文整理匯總了PHP中kFileSyncUtils::getReadyPendingExternalFileSyncForKey方法的典型用法代碼示例。如果您正苦於以下問題:PHP kFileSyncUtils::getReadyPendingExternalFileSyncForKey方法的具體用法?PHP kFileSyncUtils::getReadyPendingExternalFileSyncForKey怎麽用?PHP kFileSyncUtils::getReadyPendingExternalFileSyncForKey使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在kFileSyncUtils的用法示例。


在下文中一共展示了kFileSyncUtils::getReadyPendingExternalFileSyncForKey方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: shouldExport

 /**
  * @param FileSyncKey $key
  * @return bool
  */
 public static function shouldExport(FileSyncKey $key, StorageProfile $externalStorage)
 {
     KalturaLog::log(__METHOD__ . " - key [{$key}], externalStorage id[" . $externalStorage->getId() . "]");
     list($kalturaFileSync, $local) = kFileSyncUtils::getReadyFileSyncForKey($key, false, false);
     if (!$kalturaFileSync) {
         KalturaLog::log(__METHOD__ . " key [{$key}] not found localy");
         return false;
     }
     KalturaLog::log(__METHOD__ . " validating file size [" . $kalturaFileSync->getFileSize() . "] is between min [" . $externalStorage->getMinFileSize() . "] and max [" . $externalStorage->getMaxFileSize() . "]");
     if ($externalStorage->getMaxFileSize() && $kalturaFileSync->getFileSize() > $externalStorage->getMaxFileSize()) {
         KalturaLog::log(__METHOD__ . " key [{$key}] file too big");
         return false;
     }
     if ($externalStorage->getMinFileSize() && $kalturaFileSync->getFileSize() < $externalStorage->getMinFileSize()) {
         KalturaLog::log(__METHOD__ . " key [{$key}] file too small");
         return false;
     }
     $storageFileSync = kFileSyncUtils::getReadyPendingExternalFileSyncForKey($key, $externalStorage->getId());
     if ($storageFileSync) {
         KalturaLog::log(__METHOD__ . " key [{$key}] already exported or being exported");
         return false;
     }
     return true;
 }
開發者ID:EfncoPlugins,項目名稱:Media-Management-based-on-Kaltura,代碼行數:28,代碼來源:kStorageExporter.php

示例2: isExported

 /**
  * Check if input key was already exported for this storage profile
  * 
  * @param FileSyncKey $key
  */
 public function isExported(FileSyncKey $key)
 {
     $storageFileSync = kFileSyncUtils::getReadyPendingExternalFileSyncForKey($key, $this->getId());
     if ($storageFileSync) {
         KalturaLog::log(__METHOD__ . " key [{$key}] already exported or being exported");
         return true;
     } else {
         return false;
     }
 }
開發者ID:kubrickfr,項目名稱:server,代碼行數:15,代碼來源:StorageProfile.php

示例3: delete

 /**
  * 
  * add DeleteStorage job for key
  * 
  * @param entry $entry
  * @param StorageProfile $profile
  * @param FileSyncKey $key
  */
 protected static function delete(entry $entry, StorageProfile $profile, FileSyncKey $key)
 {
     $externalFileSync = kFileSyncUtils::getReadyPendingExternalFileSyncForKey($key, $profile->getId());
     if (!$externalFileSync) {
         return;
     }
     $c = new Criteria();
     $c->add(BatchJobPeer::OBJECT_ID, $externalFileSync->getId());
     $c->add(BatchJobPeer::OBJECT_TYPE, BatchJobObjectType::FILE_SYNC);
     $c->add(BatchJobPeer::JOB_TYPE, BatchJobType::STORAGE_EXPORT);
     $c->add(BatchJobPeer::JOB_SUB_TYPE, $profile->getProtocol());
     $c->add(BatchJobPeer::ENTRY_ID, $entry->getId());
     $c->add(BatchJobPeer::STATUS, array(BatchJob::BATCHJOB_STATUS_RETRY, BatchJob::BATCHJOB_STATUS_PENDING), Criteria::IN);
     $exportJobs = BatchJobPeer::doSelect($c);
     if (!$exportJobs) {
         kJobsManager::addStorageDeleteJob(null, $entry->getId(), $profile, $externalFileSync);
     } else {
         foreach ($exportJobs as $exportJob) {
             kJobsManager::abortDbBatchJob($exportJob);
         }
     }
 }
開發者ID:DBezemer,項目名稱:server,代碼行數:30,代碼來源:kStorageExporter.php


注:本文中的kFileSyncUtils::getReadyPendingExternalFileSyncForKey方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。