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


PHP kFileSyncUtils::deleteSyncFileForKey方法代码示例

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


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

示例1: syncableDeleted

 /**
  * @param string $id
  * @param int $type
  */
 protected function syncableDeleted($id, $type)
 {
     $c = new Criteria();
     $c->add(FileSyncPeer::OBJECT_ID, $id);
     $c->add(FileSyncPeer::OBJECT_TYPE, $type);
     $c->add(FileSyncPeer::STATUS, array(FileSync::FILE_SYNC_STATUS_PURGED, FileSync::FILE_SYNC_STATUS_DELETED), Criteria::NOT_IN);
     $fileSyncs = FileSyncPeer::doSelect($c);
     foreach ($fileSyncs as $fileSync) {
         $key = kFileSyncUtils::getKeyForFileSync($fileSync);
         kFileSyncUtils::deleteSyncFileForKey($key);
     }
 }
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:16,代码来源:kObjectDeleteHandler.php

示例2: 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

示例3: handleConvertFailed

 public static function handleConvertFailed(BatchJob $dbBatchJob, $engineType, $flavorAssetId, $flavorParamsOutputId, $mediaInfoId)
 {
     $flavorAsset = assetPeer::retrieveById($flavorAssetId);
     // verifies that flavor asset exists
     if (!$flavorAsset) {
         throw new APIException(APIErrors::INVALID_FLAVOR_ASSET_ID, $flavorAssetId);
     }
     /*
      * On Webex error, roll back the inter-src asset version in order to allow the retry to get ARF as a source, 
      * rather than the invlaid WMV file (product of bad nbrplayer session)
      */
     if ($dbBatchJob->getErrNumber() == BatchJobAppErrors::BLACK_OR_SILENT_CONTENT) {
         $prevVer = $flavorAsset->getPreviousVersion();
         $currVer = $flavorAsset->getVersion();
         KalturaLog::log("Webex conversion - Garbled Audio or Black frame or Silence. Rolling back asset/file-sync version - curr({$currVer}), prev({$prevVer})");
         if (isset($prevVer)) {
             $syncKey = $flavorAsset->getSyncKey(asset::FILE_SYNC_ASSET_SUB_TYPE_ASSET, $currVer);
             if (isset($syncKey)) {
                 kFileSyncUtils::deleteSyncFileForKey($syncKey, false, true);
                 $flavorAsset->setVersion($prevVer);
                 $flavorAsset->setPreviousVersion(null);
                 KalturaLog::log("Webex conversion - Rolled back");
             }
         }
     }
     $flavorAsset->setStatus(flavorAsset::FLAVOR_ASSET_STATUS_ERROR);
     $flavorAsset->save();
     // try to create a convert job with the next engine
     if (!is_null($engineType)) {
         $data = $dbBatchJob->getData();
         if ($data instanceof kConvartableJobData) {
             $data->incrementOperationSet();
             $dbBatchJob->setData($data);
             $dbBatchJob->save();
         }
         $newDbBatchJob = kBusinessPreConvertDL::redecideFlavorConvert($flavorAssetId, $flavorParamsOutputId, $mediaInfoId, $dbBatchJob, $engineType);
         if ($newDbBatchJob) {
             return true;
         }
     }
     // find the root job
     $rootBatchJob = $dbBatchJob->getRootJob();
     if (!$rootBatchJob) {
         return false;
     }
     // the root is already failed
     if ($rootBatchJob->getStatus() == BatchJob::BATCHJOB_STATUS_FAILED || $rootBatchJob->getStatus() == BatchJob::BATCHJOB_STATUS_FATAL) {
         return false;
     }
     // bulk download root job no need to handle
     if ($rootBatchJob->getJobType() == BatchJobType::BULKDOWNLOAD) {
         kJobsManager::failBatchJob($rootBatchJob, "Convert job " . $dbBatchJob->getId() . " failed");
         return false;
     }
     if (is_null($flavorParamsOutputId)) {
         kJobsManager::failBatchJob($rootBatchJob, "Job " . $dbBatchJob->getId() . " failed");
         kBatchManager::updateEntry($dbBatchJob->getEntryId(), entryStatus::ERROR_CONVERTING);
         return false;
     }
     $readyBehavior = $dbBatchJob->getData()->getReadyBehavior();
     if ($readyBehavior == flavorParamsConversionProfile::READY_BEHAVIOR_REQUIRED) {
         kJobsManager::failBatchJob($rootBatchJob, "Job " . $dbBatchJob->getId() . " failed");
         kBatchManager::updateEntry($dbBatchJob->getEntryId(), entryStatus::ERROR_CONVERTING);
         return false;
     }
     // failing the root profile job if all child jobs failed
     if ($rootBatchJob->getJobType() != BatchJobType::CONVERT_PROFILE) {
         return false;
     }
     $siblingJobs = $rootBatchJob->getChildJobs();
     foreach ($siblingJobs as $siblingJob) {
         /* @var $siblingJob BatchJob */
         // not conversion job and should be ignored
         if ($siblingJob->getJobType() != BatchJobType::CONVERT && $siblingJob->getJobType() != BatchJobType::POSTCONVERT) {
             continue;
         }
         $jobData = $siblingJob->getData();
         if (!$jobData || !$jobData instanceof kConvertJobData && !$jobData instanceof kPostConvertJobData) {
             KalturaLog::err("Job id [" . $siblingJob->getId() . "] has no valid job data");
             continue;
         }
         // found child flavor asset that hasn't failed, no need to fail the root job
         $siblingFlavorAssetId = $jobData->getFlavorAssetId();
         $siblingFlavorAsset = assetPeer::retrieveById($siblingFlavorAssetId);
         if ($siblingFlavorAsset && $siblingFlavorAsset->getStatus() != flavorAsset::FLAVOR_ASSET_STATUS_ERROR && $siblingFlavorAsset->getStatus() != flavorAsset::FLAVOR_ASSET_STATUS_NOT_APPLICABLE && $siblingFlavorAsset->getStatus() != flavorAsset::FLAVOR_ASSET_STATUS_DELETED) {
             return false;
         }
     }
     // all conversions failed, should fail the root job
     kJobsManager::failBatchJob($rootBatchJob, "All conversions failed");
     kBatchManager::updateEntry($dbBatchJob->getEntryId(), entryStatus::ERROR_CONVERTING);
     return false;
 }
开发者ID:AdiTal,项目名称:server,代码行数:93,代码来源:kBusinessPostConvertDL.php

示例4: deleteFileSync

 /**
  * @param FileSync $fileSync
  */
 protected static function deleteFileSync(FileSync $fileSync)
 {
     KalturaLog::info("Deleting file sync [" . $fileSync->getId() . "]");
     $key = kFileSyncUtils::getKeyForFileSync($fileSync);
     try {
         kFileSyncUtils::deleteSyncFileForKey($key);
     } catch (Exception $e) {
         KalturaLog::err($e);
     }
     self::incrementSummary('FileSync');
 }
开发者ID:DBezemer,项目名称:server,代码行数:14,代码来源:deleteOldContent.php

示例5: deleteAssetLocalFileSyncs

 private static function deleteAssetLocalFileSyncs($fileSyncVersion, asset $asset)
 {
     $syncKey = $asset->getSyncKey(asset::FILE_SYNC_ASSET_SUB_TYPE_ASSET, $fileSyncVersion);
     kFileSyncUtils::deleteSyncFileForKey($syncKey, false, true);
     $syncKey = $asset->getSyncKey(asset::FILE_SYNC_ASSET_SUB_TYPE_ISM, $fileSyncVersion);
     kFileSyncUtils::deleteSyncFileForKey($syncKey, false, true);
     $syncKey = $asset->getSyncKey(asset::FILE_SYNC_ASSET_SUB_TYPE_ISMC, $fileSyncVersion);
     kFileSyncUtils::deleteSyncFileForKey($syncKey, false, true);
 }
开发者ID:GElkayam,项目名称:server,代码行数:9,代码来源:kFlowHelper.php

示例6: Criteria

    // ----------------------------
    $exportedFileSyncsCriteria = new Criteria();
    $exportedFileSyncsCriteria->setLimit($loopLimit);
    $exportedFileSyncsCriteria->addAscendingOrderByColumn(FileSyncPeer::ID);
    $exportedFileSyncsCriteria->addAnd(FileSyncPeer::DC, $storageProfileId, Criteria::EQUAL);
    $exportedFileSyncsCriteria->addAnd(FileSyncPeer::STATUS, FileSync::FILE_SYNC_STATUS_READY, Criteria::EQUAL);
    $exportedFileSyncsCriteria->addAnd(FileSyncPeer::PARTNER_ID, $partnerId, Criteria::EQUAL);
    if ($lastFileSyncId) {
        $exportedFileSyncsCriteria->addAnd(FileSyncPeer::ID, $lastFileSyncId, Criteria::GREATER_THAN);
    }
    $exportedFileSyncs = FileSyncPeer::doSelect($exportedFileSyncsCriteria, myDbHelper::getConnection(myDbHelper::DB_HELPER_CONN_PROPEL3));
    // -----------------------------------------------
    //  delete the local dcs copies of each file sync
    // -----------------------------------------------
    foreach ($exportedFileSyncs as $exportedFileSync) {
        $lastFileSyncId = $exportedFileSync->getId();
        $syncKey = kFileSyncUtils::getKeyForFileSync($exportedFileSync);
        echo 'Deleting file sync key - ' . serialize($syncKey) . PHP_EOL;
        kFileSyncUtils::deleteSyncFileForKey($syncKey, false, true);
        // 3rd param = true -> only delete from local dcs
    }
    // --------------------------
    //  check if loop should end
    // --------------------------
    if (count($exportedFileSyncs) < $loopLimit) {
        $moreFileSyncs = false;
    }
    $exportedFileSyncs = null;
    kMemoryManager::clearMemory();
}
echo '-- Done --' . PHP_EOL;
开发者ID:DBezemer,项目名称:server,代码行数:31,代码来源:deleteExportedStorageFromLocal.php

示例7: 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 an asset was exported - check if should set its status to READY
     $asset = assetPeer::retrieveByFileSync($fileSync);
     if ($asset && in_array($asset->getStatus(), array(asset::ASSET_STATUS_EXPORTING, asset::ASSET_STATUS_ERROR))) {
         $asset->setStatusLocalReady();
         $asset->save();
         if ($asset instanceof flavorAsset && $asset->getStatus() == asset::ASSET_STATUS_READY) {
             kBusinessPostConvertDL::handleConvertFinished($dbBatchJob, $asset);
         }
     }
     // check if all exports finished and delete local file sync according to configuration
     if ($asset && $asset->getStatus() == asset::ASSET_STATUS_READY && $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:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:30,代码来源:kFlowHelper.php


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