PHP 클래스 MongoGridFSFile

저자: Johannes Skov Frandsen ([email protected])
파일 보기 프로젝트 열기: alcaeus/mongo-php-adapter 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$file array

보호된 프로퍼티들

프로퍼티 타입 설명
$gridfs

공개 메소드들

메소드 설명
__construct ( MongoGridFS $gridfs, array $file )
getBytes ( ) : string This will load the file into memory. If the file is bigger than your memory, this will cause problems!
getFilename ( ) : string Returns this file's filename
getResource ( ) : resource This method returns a stream resource that can be used to read the stored file with all file functions in PHP.
getSize ( ) : integer Returns this file's size
write ( string $filename = null ) : integer Writes this file to the filesystem

비공개 메소드들

메소드 설명
copyToResource ( $handle )
getChunks ( )

메소드 상세

__construct() 공개 메소드

public __construct ( MongoGridFS $gridfs, array $file )
$gridfs MongoGridFS The parent MongoGridFS instance
$file array A file from the database

getBytes() 공개 메소드

This will load the file into memory. If the file is bigger than your memory, this will cause problems!
public getBytes ( ) : string
리턴 string Returns a string of the bytes in the file

getFilename() 공개 메소드

Returns this file's filename
public getFilename ( ) : string
리턴 string Returns the filename

getResource() 공개 메소드

The contents of the file are pulled out of MongoDB on the fly, so that the whole file does not have to be loaded into memory first. At most two GridFSFile chunks will be loaded in memory.
public getResource ( ) : resource
리턴 resource Returns a resource that can be used to read the file with

getSize() 공개 메소드

Returns this file's size
public getSize ( ) : integer
리턴 integer Returns this file's size

write() 공개 메소드

Writes this file to the filesystem
public write ( string $filename = null ) : integer
$filename string The location to which to write the file (path+filename+extension). If none is given, the stored filename will be used.
리턴 integer Returns the number of bytes written

프로퍼티 상세

$file 공개적으로 프로퍼티

public array $file
리턴 array

$gridfs 보호되어 있는 프로퍼티

protected $gridfs