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