Mongo.php 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. <?php
  2. /*
  3. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  4. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  5. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  6. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  7. * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  8. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  9. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  10. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  11. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  12. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  13. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  14. */
  15. /**
  16. * The connection point between MongoDB and PHP.
  17. * This class is used to initiate a connection and for database server commands.
  18. * @link http://www.php.net/manual/en/class.mongo.php
  19. * @deprecated This class has been DEPRECATED as of version 1.3.0.
  20. * Relying on this feature is highly discouraged. Please use MongoClient instead.
  21. * @see MongoClient
  22. */
  23. class Mongo extends MongoClient {
  24. /**
  25. * @deprecated This feature has been DEPRECATED as of version 1.2.3. Relying on this feature is highly discouraged. Please use MongoPool::getSize() instead.
  26. * (PECL mongo &gt;= 1.2.0)<br/>
  27. * Get pool size for connection pools
  28. * @link http://php.net/manual/en/mongo.getpoolsize.php
  29. * @return int Returns the current pool size.
  30. */
  31. public function getPoolSize() {}
  32. /**
  33. * (PECL mongo &gt;= 1.1.0)<br/>
  34. * Returns the address being used by this for slaveOkay reads
  35. * @link http://php.net/manual/en/mongo.getslave.php
  36. * @return bool <p>The address of the secondary this connection is using for reads.
  37. * </p>
  38. * <p>
  39. * This returns <b>NULL</b> if this is not connected to a replica set or not yet
  40. * initialized.
  41. * </p>
  42. */
  43. public function getSlave() {}
  44. /**
  45. * (PECL mongo &gt;= 1.1.0)<br/>
  46. * Get slaveOkay setting for this connection
  47. * @link http://php.net/manual/en/mongo.getslaveokay.php
  48. * @return bool Returns the value of slaveOkay for this instance.
  49. */
  50. public function getSlaveOkay() {}
  51. /**
  52. * Connects to paired database server
  53. * @deprecated Pass a string of the form "mongodb://server1,server2" to the constructor instead of using this method.
  54. * @link http://www.php.net/manual/en/mongo.pairconnect.php
  55. * @throws MongoConnectionException
  56. * @return boolean
  57. */
  58. public function pairConnect() {}
  59. /**
  60. * (PECL mongo &gt;= 1.2.0)<br/>
  61. * @deprecated This feature has been DEPRECATED as of version 1.2.3. Relying on this feature is highly discouraged. Please use MongoPool::info() instead.
  62. * Returns information about all connection pools.
  63. * @link http://php.net/manual/en/mongo.pooldebug.php
  64. * @return array Each connection pool has an identifier, which starts with the host. For each pool, this function shows the following fields:
  65. * <p><b>in use</b></p>
  66. * <p>The number of connections currently being used by MongoClient instances.
  67. * in pool
  68. * The number of connections currently in the pool (not being used).</p>
  69. * <p><b>remaining</b></p>
  70. *
  71. * <p>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).
  72. *
  73. * A negative number means that this pool will spawn unlimited connections.
  74. *
  75. * 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.</p>
  76. * <p><b>timeout</b></p>
  77. *
  78. * <p>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.</p>
  79. *
  80. */
  81. public function poolDebug() {}
  82. /**
  83. * (PECL mongo &gt;= 1.1.0)<br/>
  84. * Change slaveOkay setting for this connection
  85. * @link http://php.net/manual/en/mongo.setslaveokay.php
  86. * @param bool $ok [optional] <p class="para">
  87. * If reads should be sent to secondary members of a replica set for all
  88. * possible queries using this {@see MongoClient} instance.
  89. * </p>
  90. * @return bool returns the former value of slaveOkay for this instance.
  91. */
  92. public function setSlaveOkay ($ok) {}
  93. /**
  94. * @deprecated Relying on this feature is highly discouraged. Please use MongoPool::setSize() instead.
  95. *(PECL mongo &gt;= 1.2.0)<br/>
  96. * Set the size for future connection pools.
  97. * @link http://php.net/manual/en/mongo.setpoolsize.php
  98. * @param $size <p>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.</p>
  99. * @return bool Returns the former value of pool size.
  100. */
  101. public function setPoolSize($size) {}
  102. /**
  103. * Creates a persistent connection with a database server
  104. * @link http://www.php.net/manual/en/mongo.persistconnect.php
  105. * @deprecated Pass array("persist" => $id) to the constructor instead of using this method.
  106. * @param string $username A username used to identify the connection.
  107. * @param string $password A password used to identify the connection.
  108. * @throws MongoConnectionException
  109. * @return boolean If the connection was successful.
  110. */
  111. public function persistConnect($username = "", $password = "") {}
  112. /**
  113. * Creates a persistent connection with paired database servers
  114. * @deprecated Pass "mongodb://server1,server2" and array("persist" => $id) to the constructor instead of using this method.
  115. * @link http://www.php.net/manual/en/mongo.pairpersistconnect.php
  116. * @param string $username A username used to identify the connection.
  117. * @param string $password A password used to identify the connection.
  118. * @throws MongoConnectionException
  119. * @return boolean If the connection was successful.
  120. */
  121. public function pairPersistConnect($username = "", $password = "") {}
  122. /**
  123. * Connects with a database server
  124. *
  125. * @link http://www.php.net/manual/en/mongo.connectutil.php
  126. * @throws MongoConnectionException
  127. * @return boolean If the connection was successful.
  128. */
  129. protected function connectUtil() {}
  130. /**
  131. * Check if there was an error on the most recent db operation performed
  132. * @deprecated Use MongoDB::lastError() instead.
  133. * @link http://www.php.net/manual/en/mongo.lasterror.php
  134. * @return array|null Returns the error, if there was one, or NULL.
  135. */
  136. public function lastError() {}
  137. /**
  138. * Checks for the last error thrown during a database operation
  139. * @deprecated Use MongoDB::prevError() instead.
  140. * @link http://www.php.net/manual/en/mongo.preverror.php
  141. * @return array Returns the error and the number of operations ago it occurred.
  142. */
  143. public function prevError() {}
  144. /**
  145. * Clears any flagged errors on the connection
  146. * @deprecated Use MongoDB::resetError() instead.
  147. * @link http://www.php.net/manual/en/mongo.reseterror.php
  148. * @return array Returns the database response.
  149. */
  150. public function resetError() {}
  151. /**
  152. * Creates a database error on the database.
  153. * @deprecated Use MongoDB::forceError() instead.
  154. * @link http://www.php.net/manual/en/mongo.forceerror.php
  155. * @return boolean The database response.
  156. */
  157. public function forceError() {}
  158. }