當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。