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


PHP FilesystemInterface::copy方法代码示例

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


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

示例1: copyFile

 protected function copyFile($fromFullPath, $toFullPath, $replace = false)
 {
     $this->createDirectory(dirname($toFullPath));
     if ($replace) {
         $this->filesystem->delete($toFullPath);
     }
     if (!$this->filesystem->copy($fromFullPath, $toFullPath)) {
         throw new CommandErrorException('File cannot be copied to the path ' . $toFullPath);
     }
 }
开发者ID:kivagant,项目名称:staticus-core,代码行数:10,代码来源:CopyResourceCommand.php

示例2: _copy

 /**
  * Copy file into another file
  *
  * @param  string $source source file path
  * @param  string $target target directory path
  * @param  string $name new file name
  * @return string|bool
  **/
 protected function _copy($source, $target, $name)
 {
     $path = $this->_joinPath($target, $name);
     if ($this->fs->copy($source, $path) === false) {
         return false;
     }
     return $path;
 }
开发者ID:barryvdh,项目名称:elfinder-flysystem-driver,代码行数:16,代码来源:Driver.php

示例3: copy

 /**
  * Copy a file.
  *
  * @param string $source
  * @param string $destination
  * @throws IoWriteException
  */
 public function copy($source, $destination)
 {
     try {
         $this->fs->copy($source, $destination);
     } catch (Error $ex) {
         throw new IoWriteException("File {$source} could not have benn copied to {$destination}.", $ex);
     } catch (Exception $ex) {
         throw new IoWriteException("File {$source} could not have benn copied to {$destination}.", $ex);
     }
 }
开发者ID:khelle,项目名称:surume,代码行数:17,代码来源:Filesystem.php

示例4: copyFolderRecursively

 /**
  * @param string $trimmedSourcePath
  * @param string $trimmedTargetPath
  * @return bool
  */
 protected function copyFolderRecursively($trimmedSourcePath, $trimmedTargetPath)
 {
     try {
         $contents = $this->filesystem->listContents($trimmedSourcePath, true);
         foreach ($contents as $item) {
             if ('file' === $item['type']) {
                 try {
                     $relPath = substr_replace($trimmedSourcePath, '', 0, strlen($item['path']));
                     $targetPath = $trimmedTargetPath . $relPath . '/' . $item['basename'];
                     $this->filesystem->copy($item['path'], $targetPath);
                 } catch (FileExistsException $fee) {
                     continue;
                 } catch (FileNotFoundException $fnfe) {
                     return false;
                 }
             }
         }
     } catch (\Exception $e) {
         return false;
     }
     return true;
 }
开发者ID:cedricziel,项目名称:fal-flysystem,代码行数:27,代码来源:FlysystemDriver.php

示例5: copy

 /**
  * Copy a file to a new location.
  *
  * @param  string  $from
  * @param  string  $to
  * @return bool
  */
 public function copy($from, $to)
 {
     return $this->driver->copy($from, $to);
 }
开发者ID:Ceciceciceci,项目名称:MySJSU-Class-Registration,代码行数:11,代码来源:FilesystemAdapter.php

示例6: _copy

 /**
  * Copy file into another file
  *
  * @param  string  $source     source file path
  * @param  string  $target  target directory path
  * @param  string  $name       new file name
  * @return bool
  **/
 protected function _copy($source, $target, $name)
 {
     return $this->fs->copy($source, $this->_joinPath($target, $name));
 }
开发者ID:quepasso,项目名称:dashboard,代码行数:12,代码来源:ElFinderVolumeFlysystem.php

示例7: move

 /**
  * Move a file to a new location.
  *
  * @param  string  $from
  * @param  string  $to
  * @return bool
  */
 public function move($from, $to)
 {
     $this->driver->copy($from, $to);
     $this->driver->delete($from);
 }
开发者ID:HarveyCheng,项目名称:myblog,代码行数:12,代码来源:FilesystemAdapter.php

示例8: _copy

 /**
  * Copy file into another file
  *
  * @param  string  $source     source file path
  * @param  string  $target  target directory path
  * @param  string  $name       new file name
  * @return string|bool
  **/
 protected function _copy($source, $target, $name)
 {
     $path = $this->_joinPath($target, $name);
     return $this->_resultPath($this->fs->copy($source, $path), $path);
 }
开发者ID:hectorgarcia83,项目名称:plataforma_eliana,代码行数:13,代码来源:Driver.php

示例9: copy

 /**
  * Copy a file.
  *
  * @param string $path    Path to the existing file.
  * @param string $newpath The new path of the file.
  *
  * @throws FileExistsException   Thrown if $newpath exists.
  * @throws FileNotFoundException Thrown if $path does not exist.
  *
  * @return bool True on success, false on failure.
  */
 public function copy($path, $newpath)
 {
     return $this->fileSystem->copy($path, $newpath);
 }
开发者ID:graze,项目名称:data-file,代码行数:15,代码来源:FilesystemWrapper.php


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