interface GridFSRepository implements ObjectRepository (View source)

Methods

resource
openDownloadStream(mixed $id)

Opens a readable stream for reading a GridFS file.

downloadToStream(mixed $id, resource $destination)

Writes the contents of a GridFS file to a writable stream.

resource
openUploadStream(string $filename, UploadOptions|null $uploadOptions = null)

Opens a writable stream for writing a GridFS file.

object
uploadFromStream(string $filename, $source, UploadOptions|null $uploadOptions = null)

Writes the contents of a readable stream to a GridFS file.

object
uploadFromFile(string $source, string|null $filename = null, UploadOptions|null $uploadOptions = null)

Writes the contents of a file to a GridFS file.

Details

resource openDownloadStream(mixed $id)

Opens a readable stream for reading a GridFS file.

Parameters

mixed $id File ID

Return Value

resource

downloadToStream(mixed $id, resource $destination)

Writes the contents of a GridFS file to a writable stream.

Parameters

mixed $id File ID
resource $destination Writable Stream

resource openUploadStream(string $filename, UploadOptions|null $uploadOptions = null)

Opens a writable stream for writing a GridFS file.

Parameters

string $filename
UploadOptions|null $uploadOptions

Return Value

resource

object uploadFromStream(string $filename, $source, UploadOptions|null $uploadOptions = null)

Writes the contents of a readable stream to a GridFS file.

Parameters

string $filename
$source
UploadOptions|null $uploadOptions

Return Value

object The newly created GridFS file

object uploadFromFile(string $source, string|null $filename = null, UploadOptions|null $uploadOptions = null)

Writes the contents of a file to a GridFS file.

Parameters

string $source
string|null $filename
UploadOptions|null $uploadOptions

Return Value

object The newly created GridFS file