当前位置: 首页>>代码示例>>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;未经允许,请勿转载。