PHP 클래스 Mongo

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

공개 메소드들

메소드 설명
__construct ( ) Dummy constructor to throw an exception
forceError ( ) : boolean Creates a database error on the database.
getPoolSize ( ) : integer Get pool size for connection pools
getSlave ( ) : boolean Returns the address being used by this for slaveOkay reads
getSlaveOkay ( ) : boolean Get slaveOkay setting for this connection
lastError ( ) : array | null Check if there was an error on the most recent db operation performed
pairConnect ( ) : boolean Connects to paired database server
pairPersistConnect ( string $username = "", string $password = "" ) : boolean Creates a persistent connection with paired database servers
persistConnect ( string $username = "", string $password = "" ) : boolean Creates a persistent connection with a database server
poolDebug ( ) : array Returns information about all connection pools.
prevError ( ) : array Checks for the last error thrown during a database operation
resetError ( ) : array Clears any flagged errors on the connection
setPoolSize ( $size ) : boolean Set the size for future connection pools.
setSlaveOkay ( boolean $ok ) : boolean Change slaveOkay setting for this connection
switchSlave ( ) : string Choose a new secondary for slaveOkay reads

보호된 메소드들

메소드 설명
connectUtil ( ) : boolean Connects with a database server
notImplemented ( )

메소드 상세

__construct() 공개 메소드

Dummy constructor to throw an exception
public __construct ( )

connectUtil() 보호된 메소드

Connects with a database server
protected connectUtil ( ) : boolean
리턴 boolean If the connection was successful.

forceError() 공개 메소드

Creates a database error on the database.
사용 중단: Use MongoDB::forceError() instead.
public forceError ( ) : boolean
리턴 boolean The database response.

getPoolSize() 공개 메소드

Get pool size for connection pools
사용 중단: This feature has been DEPRECATED as of version 1.2.3. Relying on this feature is highly discouraged. Please use MongoPool::getSize() instead.
public getPoolSize ( ) : integer
리턴 integer Returns the current pool size.

getSlave() 공개 메소드

Returns the address being used by this for slaveOkay reads
public getSlave ( ) : boolean
리턴 boolean The address of the secondary this connection is using for reads. This returns NULL if this is not connected to a replica set or not yet initialized.

getSlaveOkay() 공개 메소드

Get slaveOkay setting for this connection
public getSlaveOkay ( ) : boolean
리턴 boolean Returns the value of slaveOkay for this instance.

lastError() 공개 메소드

Check if there was an error on the most recent db operation performed
사용 중단: Use MongoDB::lastError() instead.
public lastError ( ) : array | null
리턴 array | null Returns the error, if there was one, or NULL.

notImplemented() 보호된 메소드

protected notImplemented ( )

pairConnect() 공개 메소드

Connects to paired database server
사용 중단: Pass a string of the form "mongodb://server1,server2" to the constructor instead of using this method.
public pairConnect ( ) : boolean
리턴 boolean

pairPersistConnect() 공개 메소드

Creates a persistent connection with paired database servers
사용 중단: Pass "mongodb://server1,server2" and array("persist" => $id) to the constructor instead of using this method.
public pairPersistConnect ( string $username = "", string $password = "" ) : boolean
$username string A username used to identify the connection.
$password string A password used to identify the connection.
리턴 boolean If the connection was successful.

persistConnect() 공개 메소드

Creates a persistent connection with a database server
사용 중단: Pass array("persist" => $id) to the constructor instead of using this method.
public persistConnect ( string $username = "", string $password = "" ) : boolean
$username string A username used to identify the connection.
$password string A password used to identify the connection.
리턴 boolean If the connection was successful.

poolDebug() 공개 메소드

Returns information about all connection pools.
사용 중단: This feature has been DEPRECATED as of version 1.2.3. Relying on this feature is highly discouraged. Please use MongoPool::info() instead.
public poolDebug ( ) : array
리턴 array

prevError() 공개 메소드

Checks for the last error thrown during a database operation
사용 중단: Use MongoDB::prevError() instead.
public prevError ( ) : array
리턴 array Returns the error and the number of operations ago it occurred.

resetError() 공개 메소드

Clears any flagged errors on the connection
사용 중단: Use MongoDB::resetError() instead.
public resetError ( ) : array
리턴 array Returns the database response.

setPoolSize() 공개 메소드

Set the size for future connection pools.
사용 중단: Relying on this feature is highly discouraged. Please use MongoPool::setSize() instead.
public setPoolSize ( $size ) : boolean
$size

The max number of connections future pools will be able to create. Negative numbers mean that the pool will spawn an infinite number of connections.

리턴 boolean Returns the former value of pool size.

setSlaveOkay() 공개 메소드

Change slaveOkay setting for this connection
public setSlaveOkay ( boolean $ok ) : boolean
$ok boolean
리턴 boolean returns the former value of slaveOkay for this instance.

switchSlave() 공개 메소드

Choose a new secondary for slaveOkay reads
public switchSlave ( ) : string
리턴 string The address of the secondary this connection is using for reads. This may be the same as the previous address as addresses are randomly chosen. It may return only one address if only one secondary (or only the primary) is available.