Make sure that we have a stream
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
parent
3edffdd581
commit
fc967a5ac2
|
@ -167,6 +167,13 @@ class File extends Node implements IFile {
|
|||
}
|
||||
|
||||
if ($partStorage->instanceOfStorage(Storage\IWriteStreamStorage::class)) {
|
||||
|
||||
if (!is_resource($data)) {
|
||||
$data = fopen('php://temp', 'r+');
|
||||
fwrite($data, 'foobar');
|
||||
rewind($data);
|
||||
}
|
||||
|
||||
$isEOF = false;
|
||||
$wrappedData = CallbackWrapper::wrap($data, null, null, null, null, function($stream) use (&$isEOF) {
|
||||
$isEOF = feof($stream);
|
||||
|
|
Loading…
Reference in New Issue