PHP Класс Phalcon\Db\Adapter\MongoDB\GridFS\WritableStream

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__construct ( CollectionWrapper $collectionWrapper, string $filename, array $options = [] ) Constructs a writable GridFS stream.
close ( ) Closes an active stream and flushes all buffered data to GridFS.
getChunkSize ( )
getFile ( )
getId ( )
getLength ( )
getSize ( )
insertChunks ( string $toWrite ) : integer Inserts binary data into GridFS via chunks.
isEOF ( )
uploadFromStream ( resource $source ) : MongoDB\BSON\ObjectId Writes the contents of a readable stream to a GridFS file.

Приватные методы

Метод Описание
abort ( )
fileCollectionInsert ( )
insertChunk ( $data )
readChunk ( $source )

Описание методов

__construct() публичный метод

Supported options: * _id (mixed): File document identifier. Defaults to a new ObjectId. * aliases (array of strings): DEPRECATED An array of aliases. Applications wishing to store aliases should add an aliases field to the metadata document instead. * chunkSizeBytes (integer): The chunk size in bytes. Defaults to 261120 (i.e. 255 KiB). * contentType (string): DEPRECATED content type to be stored with the file. This information should now be added to the metadata. * metadata (document): User data for the "metadata" field of the files collection document.
public __construct ( CollectionWrapper $collectionWrapper, string $filename, array $options = [] )
$collectionWrapper CollectionWrapper GridFS collection wrapper
$filename string Filename
$options array Upload options

close() публичный метод

Closes an active stream and flushes all buffered data to GridFS.
public close ( )

getChunkSize() публичный метод

public getChunkSize ( )

getFile() публичный метод

public getFile ( )

getId() публичный метод

public getId ( )

getLength() публичный метод

public getLength ( )

getSize() публичный метод

public getSize ( )

insertChunks() публичный метод

Data will be buffered internally until chunkSizeBytes are accumulated, at which point a chunk's worth of data will be inserted and the buffer reset.
public insertChunks ( string $toWrite ) : integer
$toWrite string Binary data to write
Результат integer

isEOF() публичный метод

public isEOF ( )

uploadFromStream() публичный метод

Writes the contents of a readable stream to a GridFS file.
public uploadFromStream ( resource $source ) : MongoDB\BSON\ObjectId
$source resource Readable stream
Результат MongoDB\BSON\ObjectId