本文整理汇总了PHP中kFileSyncUtils::createPendingExternalSyncFileForKey方法的典型用法代码示例。如果您正苦于以下问题:PHP kFileSyncUtils::createPendingExternalSyncFileForKey方法的具体用法?PHP kFileSyncUtils::createPendingExternalSyncFileForKey怎么用?PHP kFileSyncUtils::createPendingExternalSyncFileForKey使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kFileSyncUtils
的用法示例。
在下文中一共展示了kFileSyncUtils::createPendingExternalSyncFileForKey方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: export
/**
* @param entry $entry
* @param FileSyncKey $key
*/
protected function export(entry $entry, StorageProfile $externalStorage, FileSyncKey $key, $force = false)
{
if (!$this->shouldExport($key, $externalStorage)) {
KalturaLog::log(__METHOD__ . " no need to export key [{$key}] to externalStorage id[" . $externalStorage->getId() . "]");
return;
}
$fileSync = kFileSyncUtils::createPendingExternalSyncFileForKey($key, $externalStorage);
$srcFileSyncLocalPath = kFileSyncUtils::getLocalFilePathForKey($key, true);
kJobsManager::addStorageExportJob(null, $entry->getId(), $entry->getPartnerId(), $externalStorage, $fileSync, $srcFileSyncLocalPath, $force);
}
示例2: export
/**
* @param entry $entry
* @param FileSyncKey $key
*/
protected static function export(entry $entry, StorageProfile $externalStorage, FileSyncKey $key, $force = false)
{
/* @var $fileSync FileSync */
list($fileSync, $local) = kFileSyncUtils::getReadyFileSyncForKey($key, true, false);
if (!$fileSync || $fileSync->getFileType() == FileSync::FILE_SYNC_FILE_TYPE_URL) {
KalturaLog::info("no ready fileSync was found for key [{$key}]");
return;
}
$externalFileSync = kFileSyncUtils::createPendingExternalSyncFileForKey($key, $externalStorage, $fileSync->getIsDir());
$parent_file_sync = kFileSyncUtils::resolve($fileSync);
$srcFileSyncPath = $parent_file_sync->getFileRoot() . $parent_file_sync->getFilePath();
kJobsManager::addStorageExportJob(null, $entry->getId(), $entry->getPartnerId(), $externalStorage, $externalFileSync, $srcFileSyncPath, $force, $fileSync->getDc());
return true;
}
示例3: unset
continue;
}
if (kFileSyncUtils::getReadyExternalFileSyncForKey($key, $storageProfileId)) {
unset($keys[$index]);
}
if (!kFileSyncUtils::getReadyInternalFileSyncForKey($key)) {
echo 'file sync key does not have an internal file -' . serialize($key) . PHP_EOL;
unset($keys[$index]);
}
}
if (!count($keys)) {
echo $entry->getId() . " - has no keys to export\n";
continue;
}
foreach ($keys as $key) {
$fileSync = kFileSyncUtils::createPendingExternalSyncFileForKey($key, $storageProfile);
$dcFileSync = kFileSyncUtils::getReadyInternalFileSyncForKey($key);
/* @var $dcFileSync FileSync */
$srcFileSyncLocalPath = $dcFileSync->getFileRoot() . $dcFileSync->getFilePath();
kJobsManager::addStorageExportJob(null, $entry->getId(), $partnerId, $storageProfile, $fileSync, $srcFileSyncLocalPath, true, $dcFileSync->getDc());
}
echo $entry->getId() . " - " . count($keys) . " keys exported\n\n";
$totalExported++;
if ($maxEntriesToExport > 0 && $totalExported >= $maxEntriesToExport) {
echo 'Max entries limit of [' . $maxEntriesToExport . '] reached - stopping executin';
$moreEntries = false;
break;
}
usleep(100);
}
if (count($entries) < $curLimit) {