本文整理匯總了PHP中kFileSyncUtils::copy方法的典型用法代碼示例。如果您正苦於以下問題:PHP kFileSyncUtils::copy方法的具體用法?PHP kFileSyncUtils::copy怎麽用?PHP kFileSyncUtils::copy使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類kFileSyncUtils
的用法示例。
在下文中一共展示了kFileSyncUtils::copy方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: rollbackVersion
public function rollbackVersion($desired_version)
{
// don't duplicate if staying in hte same version
$current_version = $this->getVersion();
if ($desired_version == $current_version) {
return $current_version;
}
$source_syc_key = $this->getSyncKey(self::FILE_SYNC_ENTRY_SUB_TYPE_DATA, $desired_version);
/*
// check that the file of the desired version really exists
$content = myContentStorage::getFSContentRootPath();
$path = $content . $this->getDataPath( $desired_version ); // replaced__getDataPath
if ( ! file_exists( $path ))
{
return null;
}
*/
// increment the counter of the file
$this->setData(parent::getData());
$target_syc_key = $this->getSyncKey(self::FILE_SYNC_ENTRY_SUB_TYPE_DATA);
/*
$new_path = $content . $this->getDataPath( ); //replaced__getDataPath
// make a copy
kFile::moveFile( $path , $new_path , true , true );
*/
kFileSyncUtils::copy($source_syc_key, $target_syc_key);
$this->save();
// return the new version
return $this->getVersion();
}