PHP Class Imbo\Storage\GridFS

A GridFS storage driver for Imbo Valid parameters for this driver: -
(string) databaseName
Name of the database. Defaults to 'imbo_storage' -
(string) server
The server string to use when connecting to MongoDB. Defaults to 'mongodb://localhost:27017' -
(array) options
Options to use when creating the Mongo client instance. Defaults to ['connect' => true, 'connectTimeoutMS' => 1000].
Author: Christer Edvartsen ([email protected])
Inheritance: implements Imbo\Storage\StorageInterface
Exibir arquivo Open project: imbo/imbo Class Usage Examples

Public Methods

Method Description
__construct ( array $params = null, MongoClient $client = null, MongoGridFS $grid = null ) Class constructor
delete ( $user, $imageIdentifier )
getImage ( $user, $imageIdentifier )
getLastModified ( $user, $imageIdentifier )
getStatus ( )
imageExists ( $user, $imageIdentifier )
store ( $user, $imageIdentifier, $imageData )

Protected Methods

Method Description
getGrid ( ) : MongoGridFS Get the grid instance
getMongoClient ( ) : MongoClient Get the mongo client instance

Private Methods

Method Description
getImageObject ( string $user, string $imageIdentifier ) : boolean | MongoGridFSFile Get an image object

Method Details

__construct() public method

Class constructor
public __construct ( array $params = null, MongoClient $client = null, MongoGridFS $grid = null )
$params array Parameters for the driver
$client MongoClient Mongo client instance
$grid MongoGridFS MongoGridFS instance

delete() public method

public delete ( $user, $imageIdentifier )

getGrid() protected method

Get the grid instance
protected getGrid ( ) : MongoGridFS
return MongoGridFS

getImage() public method

public getImage ( $user, $imageIdentifier )

getLastModified() public method

public getLastModified ( $user, $imageIdentifier )

getMongoClient() protected method

Get the mongo client instance
protected getMongoClient ( ) : MongoClient
return MongoClient

getStatus() public method

public getStatus ( )

imageExists() public method

public imageExists ( $user, $imageIdentifier )

store() public method

public store ( $user, $imageIdentifier, $imageData )