當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Filesystem::createStream方法代碼示例

本文整理匯總了PHP中Gaufrette\Filesystem::createStream方法的典型用法代碼示例。如果您正苦於以下問題:PHP Filesystem::createStream方法的具體用法?PHP Filesystem::createStream怎麽用?PHP Filesystem::createStream使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Gaufrette\Filesystem的用法示例。


在下文中一共展示了Filesystem::createStream方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getArchive

 /**
  * {@inheritdoc}
  */
 public function getArchive(JobExecution $jobExecution, $key)
 {
     $archives = $this->getArchives($jobExecution);
     if (!isset($archives[$key])) {
         throw new \InvalidArgumentException(sprintf('Key "%s" does not exist', $key));
     }
     return $this->filesystem->createStream($archives[$key]);
 }
開發者ID:javiersantos,項目名稱:pim-community-dev,代碼行數:11,代碼來源:AbstractFilesystemArchiver.php

示例2: copyStreamToStorage

 /**
  * Copy stream to storage
  *
  * @param Stream $srcStream
  * @param string $destinationFileName
  */
 protected function copyStreamToStorage(Stream $srcStream, $destinationFileName)
 {
     $dstStream = $this->filesystem->createStream($destinationFileName);
     $srcStream->open(new StreamMode('rb+'));
     $dstStream->open(new StreamMode('wb+'));
     while (!$srcStream->eof()) {
         $dstStream->write($srcStream->read(self::READ_COUNT));
     }
     $dstStream->close();
     $srcStream->close();
 }
開發者ID:Maksold,項目名稱:platform,代碼行數:17,代碼來源:AttachmentManager.php

示例3: copyLocalFileToStorage

 /**
  * Copy file from local filesystem to attachment storage with new name
  *
  * @param string $localFilePath
  * @param string $destinationFileName
  */
 public function copyLocalFileToStorage($localFilePath, $destinationFileName)
 {
     $src = new LocalStream($localFilePath);
     $dst = $this->filesystem->createStream($destinationFileName);
     $src->open(new StreamMode('rb+'));
     $dst->open(new StreamMode('wb+'));
     while (!$src->eof()) {
         $dst->write($src->read(100000));
     }
     $dst->close();
     $src->close();
 }
開發者ID:xamin123,項目名稱:platform,代碼行數:18,代碼來源:AttachmentManager.php

示例4: let

 /**
  * @param \Gaufrette\FilesystemMap $map
  * @param \Gaufrette\Filesystem    $filesystem
  * @param \Gaufrette\Stream        $stream
  */
 function let($map, $filesystem, $stream)
 {
     $filesystem->createStream('filename')->willReturn($stream);
     $map->get('some')->willReturn($filesystem);
     $this->setFilesystemMap($map);
 }
開發者ID:saberyounis,項目名稱:Sonata-Project,代碼行數:11,代碼來源:StreamWrapper.php

示例5: getStream

 /**
  * Get a stream from file.
  *
  * @param $name
  * @return \Gaufrette\Stream|\Gaufrette\Stream\InMemoryBuffer
  */
 public function getStream($name)
 {
     return $this->filesystem->createStream($name);
 }
開發者ID:WeClipApp,項目名稱:SRIORestUploadBundle,代碼行數:10,代碼來源:FileStorage.php


注:本文中的Gaufrette\Filesystem::createStream方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。