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


PHP FilesystemInterface::writeStream方法代码示例

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


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

示例1: create

 public function create(BinaryFileCreateStruct $binaryFileCreateStruct)
 {
     try {
         $this->filesystem->writeStream($binaryFileCreateStruct->id, $binaryFileCreateStruct->getInputStream(), array('mimetype' => $binaryFileCreateStruct->mimeType, 'visibility' => AdapterInterface::VISIBILITY_PUBLIC));
     } catch (FileExistsException $e) {
         $this->filesystem->updateStream($binaryFileCreateStruct->id, $binaryFileCreateStruct->getInputStream(), array('mimetype' => $binaryFileCreateStruct->mimeType, 'visibility' => AdapterInterface::VISIBILITY_PUBLIC));
     }
 }
开发者ID:Heyfara,项目名称:ezpublish-kernel,代码行数:8,代码来源:Flysystem.php

示例2: move

 /**
  * @param string|FilesystemInterface $moveTo
  * @return $this
  */
 public function move($moveTo)
 {
     if ($this->fileSystem) {
         $this->moveToFile($moveTo);
     } else {
         $fp = fopen($this->getFileName(), 'r+');
         $this->fileSystem->writeStream($moveTo, $fp);
         fclose($fp);
     }
     $this->config[self::FILE_LOC] = $moveTo;
     return $this;
 }
开发者ID:wscore,项目名称:site,代码行数:16,代码来源:FlyUpload.php

示例3: move

 /**
  * @param string $sourcePath
  * @param string $targetPath
  *
  * @return bool
  */
 protected function move($sourcePath, $targetPath)
 {
     if ($this->filesystem->has($targetPath)) {
         return false;
     }
     $stream = fopen($sourcePath, 'r+');
     if ($stream === null) {
         return false;
     }
     $success = $this->filesystem->writeStream($targetPath, $stream);
     if (fclose($stream) === false) {
         return false;
     }
     return $success;
 }
开发者ID:project-a,项目名称:spryker-file-upload,代码行数:21,代码来源:Storage.php

示例4: writeStream

 /**
  * Write a new file using a stream.
  *
  * @param string   $path     The path of the new file.
  * @param resource $resource The file handle.
  * @param array    $config   An optional configuration array.
  *
  * @throws \League\Flysystem\InvalidArgumentException If $resource is not a file handle.
  * @throws FileExistsException
  *
  * @return bool True on success, false on failure.
  */
 public function writeStream($path, $resource, array $config = [])
 {
     return $this->fileSystem->writeStream($path, $resource, $config);
 }
开发者ID:graze,项目名称:data-file,代码行数:16,代码来源:FilesystemWrapper.php

示例5: write

 /**
  * @param resource $stream
  */
 public function write($stream)
 {
     $this->_filesystem->delete($this->getPath());
     $this->_filesystem->writeStream($this->getPath(), $stream);
 }
开发者ID:stevenimle,项目名称:GMA,代码行数:8,代码来源:File.php


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