本文整理匯總了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]);
}
示例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();
}
示例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();
}
示例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);
}
示例5: getStream
/**
* Get a stream from file.
*
* @param $name
* @return \Gaufrette\Stream|\Gaufrette\Stream\InMemoryBuffer
*/
public function getStream($name)
{
return $this->filesystem->createStream($name);
}