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


PHP eZFileHandler::linkCopy方法代码示例

本文整理汇总了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;
    }
开发者ID:nottavi,项目名称:ezpublish,代码行数:101,代码来源:ezimagemanager.php

示例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');
 }
开发者ID:schwabokaner,项目名称:ezpublish-legacy,代码行数:13,代码来源:ezfsfilehandler.php


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