BlueSpice MediaWiki master
 All Classes Namespaces Files Functions Variables Groups Pages
Mongo Class Reference
Inheritance diagram for Mongo:
Collaboration diagram for Mongo:

Public Member Functions

 getPoolSize ()
 
 getSlave ()
 
 getSlaveOkay ()
 
 pairConnect ()
 
 poolDebug ()
 
 setSlaveOkay ($ok)
 
 setPoolSize ($size)
 
 persistConnect ($username="", $password="")
 
 pairPersistConnect ($username="", $password="")
 
 lastError ()
 
 prevError ()
 
 resetError ()
 
 forceError ()
 
- Public Member Functions inherited from MongoClient
 __construct ($server="mongodb://localhost:27017", array $options=array("connect"=> TRUE), $driver_options)
 
 close ($connection)
 
 connect ()
 
 dropDB ($db)
 
 __get ($dbname)
 
 getHosts ()
 
 getReadPreference ()
 
 getWriteConcern ()
 
 killCursor ($server_hash, $id)
 
 listDBs ()
 
 selectCollection ($db, $collection)
 
 selectDB ($name)
 
 setReadPreference ($readPreference, $tags=null)
 
 switchSlave ()
 
 __toString ()
 

Protected Member Functions

 connectUtil ()
 

Additional Inherited Members

- Static Public Member Functions inherited from MongoClient
static getConnections ()
 
- Public Attributes inherited from MongoClient
const VERSION = '3.x'
 
const DEFAULT_HOST = "localhost"
 
const DEFAULT_PORT = 27017
 
const RP_PRIMARY = "primary"
 
const RP_PRIMARY_PREFERRED = "primaryPreferred"
 
const RP_SECONDARY = "secondary"
 
const RP_SECONDARY_PREFERRED = "secondaryPreferred"
 
const RP_NEAREST = "nearest"
 
 $connected = FALSE
 
 $status = NULL
 
- Protected Attributes inherited from MongoClient
 $server = NULL
 
 $persistent = NULL
 

Detailed Description

The connection point between MongoDB and PHP. This class is used to initiate a connection and for database server commands. deprecated 675.

Member Function Documentation

Mongo::connectUtil ( )
protected
Mongo::forceError ( )

Creates a database error on the database.

Deprecated:
Use MongoDB::forceError() instead. boolean The database response.
Mongo::getPoolSize ( )
Deprecated:
This feature has been DEPRECATED as of version 1.2.3. Relying on this feature is highly discouraged. Please use MongoPool::getSize() instead. (PECL mongo >= 1.2.0)
Get pool size for connection pools int Returns the current pool size.
Mongo::getSlave ( )

(PECL mongo >= 1.1.0)
Returns the address being used by this for slaveOkay reads bool 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.

Mongo::getSlaveOkay ( )

(PECL mongo >= 1.1.0)
Get slaveOkay setting for this connection bool Returns the value of slaveOkay for this instance.

Mongo::lastError ( )

Check if there was an error on the most recent db operation performed

Deprecated:
Use MongoDB::lastError() instead. array|null Returns the error, if there was one, or NULL.
Mongo::pairConnect ( )

Connects to paired database server

Deprecated:
Pass a string of the form "mongodb://server1,server2" to the constructor instead of using this method. MongoConnectionException boolean
Mongo::pairPersistConnect (   $username = "",
  $password = "" 
)

Creates a persistent connection with paired database servers

Deprecated:
Pass "mongodb://server1,server2" and array("persist" => $id) to the constructor instead of using this method. string $username A username used to identify the connection. string $password A password used to identify the connection. MongoConnectionException boolean If the connection was successful.
Mongo::persistConnect (   $username = "",
  $password = "" 
)

Creates a persistent connection with a database server deprecated 681.

Mongo::poolDebug ( )

(PECL mongo >= 1.2.0)

Deprecated:
This feature has been DEPRECATED as of version 1.2.3. Relying on this feature is highly discouraged. Please use MongoPool::info() instead. Returns information about all connection pools. array Each connection pool has an identifier, which starts with the host. For each pool, this function shows the following fields:

in use

The number of connections currently being used by MongoClient instances. in pool The number of connections currently in the pool (not being used).

remaining

The number of connections that could be created by this pool. For example, suppose a pool had 5 connections remaining and 3 connections in the pool. We could create 8 new instances of MongoClient before we exhausted this pool (assuming no instances of MongoClient went out of scope, returning their connections to the pool).

A negative number means that this pool will spawn unlimited connections.

Before a pool is created, you can change the max number of connections by calling Mongo::setPoolSize(). Once a pool is showing up in the output of this function, its size cannot be changed.

timeout

The socket timeout for connections in this pool. This is how long connections in this pool will attempt to connect to a server before giving up.

Mongo::prevError ( )

Checks for the last error thrown during a database operation

Deprecated:
Use MongoDB::prevError() instead. array Returns the error and the number of operations ago it occurred.
Mongo::resetError ( )

Clears any flagged errors on the connection

Deprecated:
Use MongoDB::resetError() instead. array Returns the database response.
Mongo::setPoolSize (   $size)
Deprecated:
Relying on this feature is highly discouraged. Please use MongoPool::setSize() instead. (PECL mongo >= 1.2.0)
Set the size for future connection pools. $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.

Returns
bool Returns the former value of pool size.
Mongo::setSlaveOkay (   $ok)

(PECL mongo >= 1.1.0)
Change slaveOkay setting for this connection bool $ok [optional] If reads should be sent to secondary members of a replica set for all possible queries using this {

See Also
MongoClient} instance.
Returns
bool returns the former value of slaveOkay for this instance.

The documentation for this class was generated from the following file: