60 $resource = $this->flySystemFS->readStream(
$path);
61 if ($resource ===
false) {
62 throw new IOException(
"Could not open stream for file \"$path\"");
93 $resource = $stream->
detach();
95 if (!is_resource($resource)) {
96 throw new \InvalidArgumentException(
'The given stream must not be detached.');
99 $result = $this->flySystemFS->writeStream(
$path, $resource);
102 throw new IOException(
"Could not write stream to file \"$path\"");
107 if (is_resource($resource)) {
133 $resource = $stream->
detach();
135 if (!is_resource($resource)) {
136 throw new \InvalidArgumentException(
'The given stream must not be detached.');
139 $result = $this->flySystemFS->putStream(
$path, $resource);
142 throw new IOException(
"Could not put stream content into \"$path\"");
145 if (is_resource($resource)) {
170 $resource = $stream->
detach();
172 if (!is_resource($resource)) {
173 throw new \InvalidArgumentException(
'The given stream must not be detached.');
176 $result = $this->flySystemFS->updateStream(
$path, $resource);
179 throw new IOException(
"Could not update file \"$path\"");
184 if (is_resource($resource)) {
Class FileAlreadyExistsException.
detach()
Separates any underlying resources from the stream.
__construct(FilesystemInterface $flySystemFS)
FlySystemFileStreamAccess constructor.
$stream
PHP stream implementation.
Class FlySystemFileStreamAccess.
putStream($path, FileStream $stream)
Creates a new file or updates an existing one.
static ofResource($resource)
Wraps an already created resource with the stream abstraction.
writeStream($path, FileStream $stream)
Writes the stream to a new file.
readStream($path)
Opens a readable stream of the file.
Interface FileStreamAccess.
updateStream($path, FileStream $stream)
Updates an existing file.