PHP 클래스 Phalcon\Db\Adapter\MongoDB\GridFS\WritableStream

파일 보기 프로젝트 열기: phalcon/incubator 1 사용 예제들

공개 메소드들

메소드 설명
__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