本文整理汇总了PHP中eZFileHandler::linkCopy方法的典型用法代码示例。如果您正苦于以下问题:PHP eZFileHandler::linkCopy方法的具体用法?PHP eZFileHandler::linkCopy怎么用?PHP eZFileHandler::linkCopy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eZFileHandler
的用法示例。
在下文中一共展示了eZFileHandler::linkCopy方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: convert
//.........这里部分代码省略.........
$nextMimeData['dirpath'] = $destinationMimeData['dirpath'];
}
else
{
$useTempImage = true;
$nextMimeData['dirpath'] = $this->temporaryImageDirPath();
}
eZMimeType::changeDirectoryPath( $nextMimeData, $nextMimeData['dirpath'] );
if ( $nextMimeData['dirpath'] and
!file_exists( $nextMimeData['dirpath'] ) )
eZDir::mkdir( $nextMimeData['dirpath'], false, true );
if ( $currentMimeData['name'] == $nextMimeData['name'] and
count( $handlerFilters ) == 0 )
{
if ( $currentMimeData['url'] != $nextMimeData['url'] )
{
if ( eZFileHandler::copy( $currentMimeData['url'], $nextMimeData['url'] ) )
{
if ( $useTempImage )
$tempFiles[] = $nextMimeData['url'];
}
else
{
$result = false;
break;
}
}
$currentMimeData = $nextMimeData;
}
else
{
if ( $nextHandler->convert( $this, $currentMimeData, $nextMimeData, $handlerFilters ) )
{
if ( $useTempImage )
$tempFiles[] = $nextMimeData['url'];
}
else
{
$result = false;
break;
}
// store the converted file to cluster if the conversion is between mime name
$fileHandler = eZClusterFileHandler::instance();
$fileHandler->fileStore( $nextMimeData['url'], 'image', false, $nextMimeData['name'] );
$currentMimeData = $nextMimeData;
}
$filters = $leftoverFilters;
}
}
else
{
$useCopy = false;
if ( $aliasName and
$aliasName != 'original' )
{
$destinationMimeData['filename'] = $destinationMimeData['basename'] . '_' . $aliasName . '.' . $destinationMimeData['suffix'];
if ( $destinationMimeData['dirpath'] )
$destinationMimeData['url'] = $destinationMimeData['dirpath'] . '/' . $destinationMimeData['filename'];
else
$destinationMimeData['url'] = $destinationMimeData['filename'];
}
if ( $sourceMimeData['url'] != $destinationMimeData['url'] )
{
if ( $useCopy )
{
eZFileHandler::copy( $sourceMimeData['url'], $destinationMimeData['url'] );
}
else
{
eZFileHandler::linkCopy( $sourceMimeData['url'], $destinationMimeData['url'], false );
}
$currentMimeData = $destinationMimeData;
}
}
foreach ( $tempFiles as $tempFile )
{
if ( !@unlink( $tempFile ) )
{
eZDebug::writeError( "Failed to unlink temporary image file $tempFile", __METHOD__ );
}
}
$destinationMimeData = $currentMimeData;
if ( $aliasName && $aliasName != 'original' )
{
if ( $result )
{
$destinationFilePath = $destinationMimeData['url'];
$fileHandler = eZClusterFileHandler::instance();
$fileHandler->fileStore( $destinationFilePath, 'image', true, $destinationMimeData['name'] );
}
if ( isset( $sourceFileHandler ) )
$sourceFileHandler->deleteLocal();
}
return $result;
}
示例2: fileLinkCopy
/**
* Create symbolic or hard link to file.
*
* \public
* \static
*/
function fileLinkCopy($srcPath, $dstPath, $symLink)
{
eZDebugSetting::writeDebug('kernel-clustering', "fs::fileLinkCopy( '{$srcPath}', '{$dstPath}' )", __METHOD__);
eZDebug::accumulatorStart('dbfile', false, 'dbfile');
eZFileHandler::linkCopy($srcPath, $dstPath, $symLink);
eZDebug::accumulatorStop('dbfile');
}