@@ -16,240 +16,240 @@ discard block |
||
| 16 | 16 | */ |
| 17 | 17 | class MongoClient |
| 18 | 18 | { |
| 19 | - public const VERSION = '3.x'; |
|
| 20 | - public const DEFAULT_HOST = "localhost"; |
|
| 21 | - public const DEFAULT_PORT = 27017; |
|
| 22 | - public const RP_PRIMARY = "primary"; |
|
| 23 | - public const RP_PRIMARY_PREFERRED = "primaryPreferred"; |
|
| 24 | - public const RP_SECONDARY = "secondary"; |
|
| 25 | - public const RP_SECONDARY_PREFERRED = "secondaryPreferred"; |
|
| 26 | - public const RP_NEAREST = "nearest"; |
|
| 27 | - |
|
| 28 | - /* Properties */ |
|
| 29 | - public $connected = false; |
|
| 30 | - public $status = null; |
|
| 31 | - protected $server = null; |
|
| 32 | - protected $persistent = null; |
|
| 33 | - |
|
| 34 | - /* Methods */ |
|
| 35 | - /** |
|
| 36 | - * Creates a new database connection object |
|
| 37 | - * @link https://php.net/manual/en/mongo.construct.php |
|
| 38 | - * @param string $server [optional] The server name. |
|
| 39 | - * @param array $options [optional] An array of options for the connection. Currently |
|
| 40 | - * available options include: "connect" If the constructor should connect before |
|
| 41 | - * returning. Default is true. "timeout" For how long the driver should try to |
|
| 42 | - * connect to the database (in milliseconds). "replicaSet" The name of the replica |
|
| 43 | - * set to connect to. If this is given, the master will be determined by using the |
|
| 44 | - * ismaster database command on the seeds, so the driver may end up connecting to a |
|
| 45 | - * server that was not even listed. See the replica set example below for details. |
|
| 46 | - * "username" The username can be specified here, instead of including it in the |
|
| 47 | - * host list. This is especially useful if a username has a ":" in it. This |
|
| 48 | - * overrides a username set in the host list. "password" The password can be |
|
| 49 | - * specified here, instead of including it in the host list. This is especially |
|
| 50 | - * useful if a password has a "@" in it. This overrides a password set in the host |
|
| 51 | - * list. "db" The database to authenticate against can be specified here, instead |
|
| 52 | - * of including it in the host list. This overrides a database given in the host |
|
| 53 | - * list "fsync" When "fsync" is set, all write operations will block until the database has flushed the changes to disk. This makes the write operations slower, but it guarantees that writes have succeeded and that the operations can be recovered in case of total system failure. |
|
| 54 | - * If the MongoDB server has journaling enabled, this option is identical to "journal". If journaling is not enabled, this option ensures that write operations will be synced to database files on disk. |
|
| 55 | - * "journal" |
|
| 56 | - * When "journal" is set, all write operations will block until the database has flushed the changes to the journal on disk. This makes the write operations slower, but it guarantees that writes have succeeded and that the operations can be recovered in case of total system failure. |
|
| 57 | - * Note: If this option is used and journaling is disabled, MongoDB 2.6+ will raise an error and the write will fail; older server versions will simply ignore the option. |
|
| 58 | - * "gssapiServiceName" |
|
| 59 | - * Sets the » Kerberos service principal. Only applicable when authMechanism=GSSAPI. Defaults to "mongodb". |
|
| 60 | - * "password" |
|
| 61 | - * The password can be specified here, instead of including it in the host list. This is especially useful if a password has a "@" in it. This overrides a password set in the host list. |
|
| 62 | - * "readPreference" |
|
| 63 | - * Specifies the read preference type. Read preferences provide you with control from which secondaries data can be read from. |
|
| 64 | - * Allowed values are: MongoClient::RP_PRIMARY, MongoClient::RP_PRIMARY_PREFERRED, MongoClient::RP_SECONDARY, MongoClient::RP_SECONDARY_PREFERRED and MongoClient::RP_NEAREST. |
|
| 65 | - * See the documentation on read preferences for more information. |
|
| 66 | - * "readPreferenceTags" |
|
| 67 | - * Specifies the read preference tags as an array of strings. Tags can be used in combination with the readPreference option to further control which secondaries data might be read from. |
|
| 68 | - * See the documentation on read preferences for more information. |
|
| 69 | - * "replicaSet" |
|
| 70 | - * The name of the replica set to connect to. If this is given, the primary will be automatically be determined. This means that the driver may end up connecting to a server that was not even listed. See the replica set example below for details. |
|
| 71 | - * "secondaryAcceptableLatencyMS" |
|
| 72 | - * When reading from a secondary (using ReadPreferences), do not read from secondaries known to be more then secondaryAcceptableLatencyMS away from us. Defaults to 15 |
|
| 73 | - * "socketTimeoutMS" |
|
| 74 | - * How long a socket operation (read or write) can take before timing out in milliseconds. Defaults to 30000 (30 seconds). |
|
| 75 | - * If -1 is specified, socket operations may block indefinitely. This option may also be set on a per-operation basis using MongoCursor::timeout() for queries or the "socketTimeoutMS" option for write methods. |
|
| 76 | - * Note: This is a client-side timeout. If a write operation times out, there is no way to know if the server actually handled the write or not, as a MongoCursorTimeoutException will be thrown in lieu of returning a write result. |
|
| 77 | - * "ssl" |
|
| 78 | - * A boolean to specify whether you want to enable SSL for the connections to MongoDB. Extra options such as certificates can be set with SSL context options. |
|
| 79 | - * "username" |
|
| 80 | - * The username can be specified here, instead of including it in the host list. This is especially useful if a username has a ":" in it. This overrides a username set in the host list. |
|
| 81 | - * "w" |
|
| 82 | - * The w option specifies the Write Concern for the driver, which determines how long the driver blocks when writing. The default value is 1. |
|
| 83 | - * This option is applicable when connecting to both single servers and replica sets. A positive value controls how many nodes must acknowledge the write instruction before the driver continues. A value of 1 would require the single server or primary (in a replica set) to acknowledge the write operation. A value of 3 would cause the driver to block until the write has been applied to the primary as well as two secondary servers (in a replica set). |
|
| 84 | - * A string value is used to control which tag sets are taken into account for write concerns. "majority" is special and ensures that the write operation has been applied to the majority (more than 50%) of the participating nodes. |
|
| 85 | - * "wTimeoutMS" This option specifies the time limit, in milliseconds, for write concern acknowledgement. It is only applicable for write operations where "w" is greater than 1, as the timeout pertains to replication. If the write concern is not satisfied within the time limit, a MongoCursorException will be thrown. A value of 0 may be specified to block indefinitely. The default value is 10000 (ten seconds). |
|
| 86 | - * @param array $driver_options [optional] <p> |
|
| 87 | - * An array of options for the MongoDB driver. Options include setting |
|
| 88 | - * connection {@link https://php.net/manual/en/mongo.connecting.ssl.php#mongo.connecting.context.ssl context options for SSL} |
|
| 89 | - * or {@link https://php.net/manual/en/context.mongodb.php logging callbacks}. |
|
| 90 | - * </p><ul> |
|
| 91 | - * <li> |
|
| 92 | - * <p> |
|
| 93 | - * <em>"context"</em> |
|
| 94 | - * </p> |
|
| 95 | - * <p> |
|
| 96 | - * The Stream Context to attach to all new connections. This allows you |
|
| 97 | - * for example to configure SSL certificates and are described at |
|
| 98 | - * {@link https://php.net/manual/en/context.ssl.php SSL context options}. See the |
|
| 99 | - * {@link https://php.net/manual/en/mongo.connecting.ssl.php#mongo.connecting.context.ssl Connecting over SSL} tutorial. |
|
| 100 | - * </p> |
|
| 101 | - * </li> |
|
| 102 | - * </ul> |
|
| 103 | - * @throws MongoConnectionException |
|
| 104 | - */ |
|
| 105 | - public function __construct($server = "mongodb://localhost:27017", array $options = ["connect" => true], $driver_options) {} |
|
| 106 | - |
|
| 107 | - /** |
|
| 108 | - * (PECL mongo >= 1.3.0)<br/> |
|
| 109 | - * Closes this database connection |
|
| 110 | - * This method does not need to be called, except in unusual circumstances. |
|
| 111 | - * The driver will cleanly close the database connection when the Mongo object goes out of scope. |
|
| 112 | - * @link https://secure.php.net/manual/en/mongoclient.close.php |
|
| 113 | - * @param bool|string $connection [optional] <p> |
|
| 114 | - * If connection is not given, or <b>FALSE</b> then connection that would be selected for writes would be closed. In a single-node configuration, that is then the whole connection, but if you are connected to a replica set, close() will only close the connection to the primary server. |
|
| 115 | - * If connection is <b>TRUE</b> then all connections as known by the connection manager will be closed. This can include connections that are not referenced in the connection string used to create the object that you are calling close on. |
|
| 116 | - * If connection is a string argument, then it will only close the connection identified by this hash. Hashes are identifiers for a connection and can be obtained by calling {@see MongoClient::getConnections()}. |
|
| 117 | - * </p> |
|
| 118 | - * @return bool If the connection was successfully closed. |
|
| 119 | - */ |
|
| 120 | - public function close($connection) {} |
|
| 121 | - /** |
|
| 122 | - * Connects to a database server |
|
| 123 | - * |
|
| 124 | - * @link https://secure.php.net/manual/en/mongoclient.connect.php |
|
| 125 | - * |
|
| 126 | - * @throws MongoConnectionException |
|
| 127 | - * @return bool If the connection was successful. |
|
| 128 | - */ |
|
| 129 | - public function connect() {} |
|
| 130 | - |
|
| 131 | - /** |
|
| 132 | - * Drops a database |
|
| 133 | - * |
|
| 134 | - * @link https://secure.php.net/manual/en/mongoclient.dropdb.php |
|
| 135 | - * @param mixed $db The database to drop. Can be a MongoDB object or the name of the database. |
|
| 136 | - * @return array The database response. |
|
| 137 | - */ |
|
| 138 | - #[Deprecated(replacement: "%class%->drop()")] |
|
| 139 | - public function dropDB($db) {} |
|
| 140 | - |
|
| 141 | - /** |
|
| 142 | - * (PECL mongo >= 1.3.0)<br/> |
|
| 143 | - * Gets a database |
|
| 144 | - * @link https://php.net/manual/en/mongoclient.get.php |
|
| 145 | - * @param string $dbname The database name. |
|
| 146 | - * @return MongoDB The database name. |
|
| 147 | - */ |
|
| 148 | - public function __get($dbname) {} |
|
| 149 | - |
|
| 150 | - /** |
|
| 151 | - * Get connections |
|
| 152 | - * Returns an array of all open connections, and information about each of the servers |
|
| 153 | - * @return array |
|
| 154 | - */ |
|
| 155 | - public static function getConnections() {} |
|
| 156 | - |
|
| 157 | - /** |
|
| 158 | - * Get hosts |
|
| 159 | - * This method is only useful with a connection to a replica set. It returns the status of all of the hosts in the |
|
| 160 | - * set. Without a replica set, it will just return an array with one element containing the host that you are |
|
| 161 | - * connected to. |
|
| 162 | - * @return array |
|
| 163 | - */ |
|
| 164 | - public function getHosts() {} |
|
| 165 | - |
|
| 166 | - /** |
|
| 167 | - * Get read preference |
|
| 168 | - * Get the read preference for this connection |
|
| 169 | - * @return array |
|
| 170 | - */ |
|
| 171 | - public function getReadPreference() {} |
|
| 172 | - |
|
| 173 | - /** |
|
| 174 | - * (PECL mongo >= 1.5.0)<br/> |
|
| 175 | - * Get the write concern for this connection |
|
| 176 | - * @return array <p>This function returns an array describing the write concern. |
|
| 177 | - * The array contains the values w for an integer acknowledgement level or string mode, |
|
| 178 | - * and wtimeout denoting the maximum number of milliseconds to wait for the server to satisfy the write concern.</p> |
|
| 179 | - */ |
|
| 180 | - public function getWriteConcern() {} |
|
| 181 | - |
|
| 182 | - /** |
|
| 183 | - * Kills a specific cursor on the server |
|
| 184 | - * @link https://secure.php.net/manual/en/mongoclient.killcursor.php |
|
| 185 | - * @param string $server_hash <p> |
|
| 186 | - * The server hash that has the cursor. This can be obtained through |
|
| 187 | - * {@link https://secure.php.net/manual/en/mongocursor.info.php MongoCursor::info()}. |
|
| 188 | - * </p> |
|
| 189 | - * @param int|MongoInt64 $id |
|
| 190 | - * <p> |
|
| 191 | - * The ID of the cursor to kill. You can either supply an {@link https://secure.php.net/manual/en/language.types.integer.php int} |
|
| 192 | - * containing the 64 bit cursor ID, or an object of the |
|
| 193 | - * {@link https://secure.php.net/manual/en/class.mongoint64.php MongoInt64} class. The latter is necessary on 32 |
|
| 194 | - * bit platforms (and Windows). |
|
| 195 | - * </p> |
|
| 196 | - */ |
|
| 197 | - public function killCursor($server_hash, $id) {} |
|
| 198 | - |
|
| 199 | - /** |
|
| 200 | - * (PECL mongo >= 1.3.0)<br/> |
|
| 201 | - * Lists all of the databases available |
|
| 202 | - * @link https://php.net/manual/en/mongoclient.listdbs.php |
|
| 203 | - * @return array Returns an associative array containing three fields. The first field is databases, which in turn contains an array. Each element of the array is an associative array corresponding to a database, giving the database's name, size, and if it's empty. The other two fields are totalSize (in bytes) and ok, which is 1 if this method ran successfully. |
|
| 204 | - */ |
|
| 205 | - public function listDBs() {} |
|
| 206 | - |
|
| 207 | - /** |
|
| 208 | - * (PECL mongo >= 1.3.0)<br/> |
|
| 209 | - * Gets a database collection |
|
| 210 | - * @link https://secure.php.net/manual/en/mongoclient.selectcollection.php |
|
| 211 | - * @param string $db The database name. |
|
| 212 | - * @param string $collection The collection name. |
|
| 213 | - * @throws Exception Throws Exception if the database or collection name is invalid. |
|
| 214 | - * @return MongoCollection Returns a new collection object. |
|
| 215 | - */ |
|
| 216 | - public function selectCollection($db, $collection) {} |
|
| 217 | - |
|
| 218 | - /** |
|
| 219 | - * (PECL mongo >= 1.3.0)<br/> |
|
| 220 | - * Gets a database |
|
| 221 | - * @link https://secure.php.net/manual/en/mongo.selectdb.php |
|
| 222 | - * @param string $name The database name. |
|
| 223 | - * @throws InvalidArgumentException |
|
| 224 | - * @return MongoDB Returns a new db object. |
|
| 225 | - */ |
|
| 226 | - public function selectDB($name) {} |
|
| 227 | - |
|
| 228 | - /** |
|
| 229 | - * (PECL mongo >= 1.3.0)<br/> |
|
| 230 | - * Set read preference |
|
| 231 | - * @param string $readPreference |
|
| 232 | - * @param array $tags |
|
| 233 | - * @return bool |
|
| 234 | - */ |
|
| 235 | - public function setReadPreference($readPreference, $tags = null) {} |
|
| 236 | - |
|
| 237 | - /** |
|
| 238 | - * (PECL mongo >= 1.1.0)<br/> |
|
| 239 | - * Choose a new secondary for slaveOkay reads |
|
| 240 | - * @link https://secure.php.net/manual/en/mongo.switchslave.php |
|
| 241 | - * @return 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. |
|
| 242 | - * For example, if we had a three member replica set with a primary, secondary, and arbiter this method would always return the address of the secondary. If the secondary became unavailable, this method would always return the address of the primary. If the primary also became unavailable, this method would throw an exception, as an arbiter cannot handle reads. |
|
| 243 | - * @throws MongoException (error code 15) if it is called on a non-replica-set connection. It will also throw MongoExceptions if it cannot find anyone (primary or secondary) to read from (error code 16). |
|
| 244 | - */ |
|
| 245 | - public function switchSlave() {} |
|
| 246 | - |
|
| 247 | - /** |
|
| 248 | - * String representation of this connection |
|
| 249 | - * @link https://secure.php.net/manual/en/mongoclient.tostring.php |
|
| 250 | - * @return string Returns hostname and port for this connection. |
|
| 251 | - */ |
|
| 252 | - public function __toString() {} |
|
| 19 | + public const VERSION = '3.x'; |
|
| 20 | + public const DEFAULT_HOST = "localhost"; |
|
| 21 | + public const DEFAULT_PORT = 27017; |
|
| 22 | + public const RP_PRIMARY = "primary"; |
|
| 23 | + public const RP_PRIMARY_PREFERRED = "primaryPreferred"; |
|
| 24 | + public const RP_SECONDARY = "secondary"; |
|
| 25 | + public const RP_SECONDARY_PREFERRED = "secondaryPreferred"; |
|
| 26 | + public const RP_NEAREST = "nearest"; |
|
| 27 | + |
|
| 28 | + /* Properties */ |
|
| 29 | + public $connected = false; |
|
| 30 | + public $status = null; |
|
| 31 | + protected $server = null; |
|
| 32 | + protected $persistent = null; |
|
| 33 | + |
|
| 34 | + /* Methods */ |
|
| 35 | + /** |
|
| 36 | + * Creates a new database connection object |
|
| 37 | + * @link https://php.net/manual/en/mongo.construct.php |
|
| 38 | + * @param string $server [optional] The server name. |
|
| 39 | + * @param array $options [optional] An array of options for the connection. Currently |
|
| 40 | + * available options include: "connect" If the constructor should connect before |
|
| 41 | + * returning. Default is true. "timeout" For how long the driver should try to |
|
| 42 | + * connect to the database (in milliseconds). "replicaSet" The name of the replica |
|
| 43 | + * set to connect to. If this is given, the master will be determined by using the |
|
| 44 | + * ismaster database command on the seeds, so the driver may end up connecting to a |
|
| 45 | + * server that was not even listed. See the replica set example below for details. |
|
| 46 | + * "username" The username can be specified here, instead of including it in the |
|
| 47 | + * host list. This is especially useful if a username has a ":" in it. This |
|
| 48 | + * overrides a username set in the host list. "password" The password can be |
|
| 49 | + * specified here, instead of including it in the host list. This is especially |
|
| 50 | + * useful if a password has a "@" in it. This overrides a password set in the host |
|
| 51 | + * list. "db" The database to authenticate against can be specified here, instead |
|
| 52 | + * of including it in the host list. This overrides a database given in the host |
|
| 53 | + * list "fsync" When "fsync" is set, all write operations will block until the database has flushed the changes to disk. This makes the write operations slower, but it guarantees that writes have succeeded and that the operations can be recovered in case of total system failure. |
|
| 54 | + * If the MongoDB server has journaling enabled, this option is identical to "journal". If journaling is not enabled, this option ensures that write operations will be synced to database files on disk. |
|
| 55 | + * "journal" |
|
| 56 | + * When "journal" is set, all write operations will block until the database has flushed the changes to the journal on disk. This makes the write operations slower, but it guarantees that writes have succeeded and that the operations can be recovered in case of total system failure. |
|
| 57 | + * Note: If this option is used and journaling is disabled, MongoDB 2.6+ will raise an error and the write will fail; older server versions will simply ignore the option. |
|
| 58 | + * "gssapiServiceName" |
|
| 59 | + * Sets the » Kerberos service principal. Only applicable when authMechanism=GSSAPI. Defaults to "mongodb". |
|
| 60 | + * "password" |
|
| 61 | + * The password can be specified here, instead of including it in the host list. This is especially useful if a password has a "@" in it. This overrides a password set in the host list. |
|
| 62 | + * "readPreference" |
|
| 63 | + * Specifies the read preference type. Read preferences provide you with control from which secondaries data can be read from. |
|
| 64 | + * Allowed values are: MongoClient::RP_PRIMARY, MongoClient::RP_PRIMARY_PREFERRED, MongoClient::RP_SECONDARY, MongoClient::RP_SECONDARY_PREFERRED and MongoClient::RP_NEAREST. |
|
| 65 | + * See the documentation on read preferences for more information. |
|
| 66 | + * "readPreferenceTags" |
|
| 67 | + * Specifies the read preference tags as an array of strings. Tags can be used in combination with the readPreference option to further control which secondaries data might be read from. |
|
| 68 | + * See the documentation on read preferences for more information. |
|
| 69 | + * "replicaSet" |
|
| 70 | + * The name of the replica set to connect to. If this is given, the primary will be automatically be determined. This means that the driver may end up connecting to a server that was not even listed. See the replica set example below for details. |
|
| 71 | + * "secondaryAcceptableLatencyMS" |
|
| 72 | + * When reading from a secondary (using ReadPreferences), do not read from secondaries known to be more then secondaryAcceptableLatencyMS away from us. Defaults to 15 |
|
| 73 | + * "socketTimeoutMS" |
|
| 74 | + * How long a socket operation (read or write) can take before timing out in milliseconds. Defaults to 30000 (30 seconds). |
|
| 75 | + * If -1 is specified, socket operations may block indefinitely. This option may also be set on a per-operation basis using MongoCursor::timeout() for queries or the "socketTimeoutMS" option for write methods. |
|
| 76 | + * Note: This is a client-side timeout. If a write operation times out, there is no way to know if the server actually handled the write or not, as a MongoCursorTimeoutException will be thrown in lieu of returning a write result. |
|
| 77 | + * "ssl" |
|
| 78 | + * A boolean to specify whether you want to enable SSL for the connections to MongoDB. Extra options such as certificates can be set with SSL context options. |
|
| 79 | + * "username" |
|
| 80 | + * The username can be specified here, instead of including it in the host list. This is especially useful if a username has a ":" in it. This overrides a username set in the host list. |
|
| 81 | + * "w" |
|
| 82 | + * The w option specifies the Write Concern for the driver, which determines how long the driver blocks when writing. The default value is 1. |
|
| 83 | + * This option is applicable when connecting to both single servers and replica sets. A positive value controls how many nodes must acknowledge the write instruction before the driver continues. A value of 1 would require the single server or primary (in a replica set) to acknowledge the write operation. A value of 3 would cause the driver to block until the write has been applied to the primary as well as two secondary servers (in a replica set). |
|
| 84 | + * A string value is used to control which tag sets are taken into account for write concerns. "majority" is special and ensures that the write operation has been applied to the majority (more than 50%) of the participating nodes. |
|
| 85 | + * "wTimeoutMS" This option specifies the time limit, in milliseconds, for write concern acknowledgement. It is only applicable for write operations where "w" is greater than 1, as the timeout pertains to replication. If the write concern is not satisfied within the time limit, a MongoCursorException will be thrown. A value of 0 may be specified to block indefinitely. The default value is 10000 (ten seconds). |
|
| 86 | + * @param array $driver_options [optional] <p> |
|
| 87 | + * An array of options for the MongoDB driver. Options include setting |
|
| 88 | + * connection {@link https://php.net/manual/en/mongo.connecting.ssl.php#mongo.connecting.context.ssl context options for SSL} |
|
| 89 | + * or {@link https://php.net/manual/en/context.mongodb.php logging callbacks}. |
|
| 90 | + * </p><ul> |
|
| 91 | + * <li> |
|
| 92 | + * <p> |
|
| 93 | + * <em>"context"</em> |
|
| 94 | + * </p> |
|
| 95 | + * <p> |
|
| 96 | + * The Stream Context to attach to all new connections. This allows you |
|
| 97 | + * for example to configure SSL certificates and are described at |
|
| 98 | + * {@link https://php.net/manual/en/context.ssl.php SSL context options}. See the |
|
| 99 | + * {@link https://php.net/manual/en/mongo.connecting.ssl.php#mongo.connecting.context.ssl Connecting over SSL} tutorial. |
|
| 100 | + * </p> |
|
| 101 | + * </li> |
|
| 102 | + * </ul> |
|
| 103 | + * @throws MongoConnectionException |
|
| 104 | + */ |
|
| 105 | + public function __construct($server = "mongodb://localhost:27017", array $options = ["connect" => true], $driver_options) {} |
|
| 106 | + |
|
| 107 | + /** |
|
| 108 | + * (PECL mongo >= 1.3.0)<br/> |
|
| 109 | + * Closes this database connection |
|
| 110 | + * This method does not need to be called, except in unusual circumstances. |
|
| 111 | + * The driver will cleanly close the database connection when the Mongo object goes out of scope. |
|
| 112 | + * @link https://secure.php.net/manual/en/mongoclient.close.php |
|
| 113 | + * @param bool|string $connection [optional] <p> |
|
| 114 | + * If connection is not given, or <b>FALSE</b> then connection that would be selected for writes would be closed. In a single-node configuration, that is then the whole connection, but if you are connected to a replica set, close() will only close the connection to the primary server. |
|
| 115 | + * If connection is <b>TRUE</b> then all connections as known by the connection manager will be closed. This can include connections that are not referenced in the connection string used to create the object that you are calling close on. |
|
| 116 | + * If connection is a string argument, then it will only close the connection identified by this hash. Hashes are identifiers for a connection and can be obtained by calling {@see MongoClient::getConnections()}. |
|
| 117 | + * </p> |
|
| 118 | + * @return bool If the connection was successfully closed. |
|
| 119 | + */ |
|
| 120 | + public function close($connection) {} |
|
| 121 | + /** |
|
| 122 | + * Connects to a database server |
|
| 123 | + * |
|
| 124 | + * @link https://secure.php.net/manual/en/mongoclient.connect.php |
|
| 125 | + * |
|
| 126 | + * @throws MongoConnectionException |
|
| 127 | + * @return bool If the connection was successful. |
|
| 128 | + */ |
|
| 129 | + public function connect() {} |
|
| 130 | + |
|
| 131 | + /** |
|
| 132 | + * Drops a database |
|
| 133 | + * |
|
| 134 | + * @link https://secure.php.net/manual/en/mongoclient.dropdb.php |
|
| 135 | + * @param mixed $db The database to drop. Can be a MongoDB object or the name of the database. |
|
| 136 | + * @return array The database response. |
|
| 137 | + */ |
|
| 138 | + #[Deprecated(replacement: "%class%->drop()")] |
|
| 139 | + public function dropDB($db) {} |
|
| 140 | + |
|
| 141 | + /** |
|
| 142 | + * (PECL mongo >= 1.3.0)<br/> |
|
| 143 | + * Gets a database |
|
| 144 | + * @link https://php.net/manual/en/mongoclient.get.php |
|
| 145 | + * @param string $dbname The database name. |
|
| 146 | + * @return MongoDB The database name. |
|
| 147 | + */ |
|
| 148 | + public function __get($dbname) {} |
|
| 149 | + |
|
| 150 | + /** |
|
| 151 | + * Get connections |
|
| 152 | + * Returns an array of all open connections, and information about each of the servers |
|
| 153 | + * @return array |
|
| 154 | + */ |
|
| 155 | + public static function getConnections() {} |
|
| 156 | + |
|
| 157 | + /** |
|
| 158 | + * Get hosts |
|
| 159 | + * This method is only useful with a connection to a replica set. It returns the status of all of the hosts in the |
|
| 160 | + * set. Without a replica set, it will just return an array with one element containing the host that you are |
|
| 161 | + * connected to. |
|
| 162 | + * @return array |
|
| 163 | + */ |
|
| 164 | + public function getHosts() {} |
|
| 165 | + |
|
| 166 | + /** |
|
| 167 | + * Get read preference |
|
| 168 | + * Get the read preference for this connection |
|
| 169 | + * @return array |
|
| 170 | + */ |
|
| 171 | + public function getReadPreference() {} |
|
| 172 | + |
|
| 173 | + /** |
|
| 174 | + * (PECL mongo >= 1.5.0)<br/> |
|
| 175 | + * Get the write concern for this connection |
|
| 176 | + * @return array <p>This function returns an array describing the write concern. |
|
| 177 | + * The array contains the values w for an integer acknowledgement level or string mode, |
|
| 178 | + * and wtimeout denoting the maximum number of milliseconds to wait for the server to satisfy the write concern.</p> |
|
| 179 | + */ |
|
| 180 | + public function getWriteConcern() {} |
|
| 181 | + |
|
| 182 | + /** |
|
| 183 | + * Kills a specific cursor on the server |
|
| 184 | + * @link https://secure.php.net/manual/en/mongoclient.killcursor.php |
|
| 185 | + * @param string $server_hash <p> |
|
| 186 | + * The server hash that has the cursor. This can be obtained through |
|
| 187 | + * {@link https://secure.php.net/manual/en/mongocursor.info.php MongoCursor::info()}. |
|
| 188 | + * </p> |
|
| 189 | + * @param int|MongoInt64 $id |
|
| 190 | + * <p> |
|
| 191 | + * The ID of the cursor to kill. You can either supply an {@link https://secure.php.net/manual/en/language.types.integer.php int} |
|
| 192 | + * containing the 64 bit cursor ID, or an object of the |
|
| 193 | + * {@link https://secure.php.net/manual/en/class.mongoint64.php MongoInt64} class. The latter is necessary on 32 |
|
| 194 | + * bit platforms (and Windows). |
|
| 195 | + * </p> |
|
| 196 | + */ |
|
| 197 | + public function killCursor($server_hash, $id) {} |
|
| 198 | + |
|
| 199 | + /** |
|
| 200 | + * (PECL mongo >= 1.3.0)<br/> |
|
| 201 | + * Lists all of the databases available |
|
| 202 | + * @link https://php.net/manual/en/mongoclient.listdbs.php |
|
| 203 | + * @return array Returns an associative array containing three fields. The first field is databases, which in turn contains an array. Each element of the array is an associative array corresponding to a database, giving the database's name, size, and if it's empty. The other two fields are totalSize (in bytes) and ok, which is 1 if this method ran successfully. |
|
| 204 | + */ |
|
| 205 | + public function listDBs() {} |
|
| 206 | + |
|
| 207 | + /** |
|
| 208 | + * (PECL mongo >= 1.3.0)<br/> |
|
| 209 | + * Gets a database collection |
|
| 210 | + * @link https://secure.php.net/manual/en/mongoclient.selectcollection.php |
|
| 211 | + * @param string $db The database name. |
|
| 212 | + * @param string $collection The collection name. |
|
| 213 | + * @throws Exception Throws Exception if the database or collection name is invalid. |
|
| 214 | + * @return MongoCollection Returns a new collection object. |
|
| 215 | + */ |
|
| 216 | + public function selectCollection($db, $collection) {} |
|
| 217 | + |
|
| 218 | + /** |
|
| 219 | + * (PECL mongo >= 1.3.0)<br/> |
|
| 220 | + * Gets a database |
|
| 221 | + * @link https://secure.php.net/manual/en/mongo.selectdb.php |
|
| 222 | + * @param string $name The database name. |
|
| 223 | + * @throws InvalidArgumentException |
|
| 224 | + * @return MongoDB Returns a new db object. |
|
| 225 | + */ |
|
| 226 | + public function selectDB($name) {} |
|
| 227 | + |
|
| 228 | + /** |
|
| 229 | + * (PECL mongo >= 1.3.0)<br/> |
|
| 230 | + * Set read preference |
|
| 231 | + * @param string $readPreference |
|
| 232 | + * @param array $tags |
|
| 233 | + * @return bool |
|
| 234 | + */ |
|
| 235 | + public function setReadPreference($readPreference, $tags = null) {} |
|
| 236 | + |
|
| 237 | + /** |
|
| 238 | + * (PECL mongo >= 1.1.0)<br/> |
|
| 239 | + * Choose a new secondary for slaveOkay reads |
|
| 240 | + * @link https://secure.php.net/manual/en/mongo.switchslave.php |
|
| 241 | + * @return 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. |
|
| 242 | + * For example, if we had a three member replica set with a primary, secondary, and arbiter this method would always return the address of the secondary. If the secondary became unavailable, this method would always return the address of the primary. If the primary also became unavailable, this method would throw an exception, as an arbiter cannot handle reads. |
|
| 243 | + * @throws MongoException (error code 15) if it is called on a non-replica-set connection. It will also throw MongoExceptions if it cannot find anyone (primary or secondary) to read from (error code 16). |
|
| 244 | + */ |
|
| 245 | + public function switchSlave() {} |
|
| 246 | + |
|
| 247 | + /** |
|
| 248 | + * String representation of this connection |
|
| 249 | + * @link https://secure.php.net/manual/en/mongoclient.tostring.php |
|
| 250 | + * @return string Returns hostname and port for this connection. |
|
| 251 | + */ |
|
| 252 | + public function __toString() {} |
|
| 253 | 253 | } |
| 254 | 254 | |
| 255 | 255 | /** |
@@ -262,118 +262,118 @@ discard block |
||
| 262 | 262 | #[Deprecated("This class has been DEPRECATED as of version 1.3.0.")] |
| 263 | 263 | class Mongo extends MongoClient |
| 264 | 264 | { |
| 265 | - /** |
|
| 266 | - * (PECL mongo >= 1.2.0)<br/> |
|
| 267 | - * Get pool size for connection pools |
|
| 268 | - * @link https://php.net/manual/en/mongo.getpoolsize.php |
|
| 269 | - * @return int Returns the current pool size. |
|
| 270 | - * @see MongoPool::getSize() |
|
| 271 | - */ |
|
| 272 | - #[Deprecated('This feature has been DEPRECATED as of version 1.2.3. Relying on this feature is highly discouraged. Please use MongoPool::getSize() instead.')] |
|
| 273 | - public function getPoolSize() {} |
|
| 274 | - /** |
|
| 275 | - * (PECL mongo >= 1.1.0)<br/> |
|
| 276 | - * Returns the address being used by this for slaveOkay reads |
|
| 277 | - * @link https://php.net/manual/en/mongo.getslave.php |
|
| 278 | - * @return bool <p>The address of the secondary this connection is using for reads. |
|
| 279 | - * </p> |
|
| 280 | - * <p> |
|
| 281 | - * This returns <b>NULL</b> if this is not connected to a replica set or not yet |
|
| 282 | - * initialized. |
|
| 283 | - * </p> |
|
| 284 | - */ |
|
| 285 | - public function getSlave() {} |
|
| 286 | - /** |
|
| 287 | - * (PECL mongo >= 1.1.0)<br/> |
|
| 288 | - * Get slaveOkay setting for this connection |
|
| 289 | - * @link https://php.net/manual/en/mongo.getslaveokay.php |
|
| 290 | - * @return bool Returns the value of slaveOkay for this instance. |
|
| 291 | - */ |
|
| 292 | - public function getSlaveOkay() {} |
|
| 293 | - /** |
|
| 294 | - * Connects to paired database server |
|
| 295 | - * @link https://secure.php.net/manual/en/mongo.pairconnect.php |
|
| 296 | - * @throws MongoConnectionException |
|
| 297 | - * @return bool |
|
| 298 | - */ |
|
| 299 | - #[Deprecated('Pass a string of the form "mongodb://server1,server2" to the constructor instead of using this method.')] |
|
| 300 | - public function pairConnect() {} |
|
| 301 | - |
|
| 302 | - /** |
|
| 303 | - * (PECL mongo >= 1.2.0)<br/> |
|
| 304 | - * Returns information about all connection pools. |
|
| 305 | - * @link https://php.net/manual/en/mongo.pooldebug.php |
|
| 306 | - * @return array Each connection pool has an identifier, which starts with the host. For each pool, this function shows the following fields: |
|
| 307 | - * <p><b>in use</b></p> |
|
| 308 | - * <p>The number of connections currently being used by MongoClient instances. |
|
| 309 | - * in pool |
|
| 310 | - * The number of connections currently in the pool (not being used).</p> |
|
| 311 | - * <p><b>remaining</b></p> |
|
| 312 | - * |
|
| 313 | - * <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). |
|
| 314 | - * |
|
| 315 | - * A negative number means that this pool will spawn unlimited connections. |
|
| 316 | - * |
|
| 317 | - * 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> |
|
| 318 | - * <p><b>timeout</b></p> |
|
| 319 | - * |
|
| 320 | - * <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> |
|
| 321 | - * @see MongoPool::info() |
|
| 322 | - */ |
|
| 323 | - #[Deprecated('@deprecated This feature has been DEPRECATED as of version 1.2.3. Relying on this feature is highly discouraged. Please use MongoPool::info() instead.')] |
|
| 324 | - public function poolDebug() {} |
|
| 325 | - |
|
| 326 | - /** |
|
| 327 | - * (PECL mongo >= 1.1.0)<br/> |
|
| 328 | - * Change slaveOkay setting for this connection |
|
| 329 | - * @link https://php.net/manual/en/mongo.setslaveokay.php |
|
| 330 | - * @param bool $ok [optional] <p class="para"> |
|
| 331 | - * If reads should be sent to secondary members of a replica set for all |
|
| 332 | - * possible queries using this {@see MongoClient} instance. |
|
| 333 | - * </p> |
|
| 334 | - * @return bool returns the former value of slaveOkay for this instance. |
|
| 335 | - */ |
|
| 336 | - public function setSlaveOkay($ok) {} |
|
| 337 | - /** |
|
| 338 | - *(PECL mongo >= 1.2.0)<br/> |
|
| 339 | - * Set the size for future connection pools. |
|
| 340 | - * @link https://php.net/manual/en/mongo.setpoolsize.php |
|
| 341 | - * @param int $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> |
|
| 342 | - * @return bool Returns the former value of pool size. |
|
| 343 | - * @see MongoPool::setSize() |
|
| 344 | - */ |
|
| 345 | - #[Deprecated('Relying on this feature is highly discouraged. Please use MongoPool::setSize() instead.')] |
|
| 346 | - public function setPoolSize($size) {} |
|
| 347 | - /** |
|
| 348 | - * Creates a persistent connection with a database server |
|
| 349 | - * @link https://secure.php.net/manual/en/mongo.persistconnect.php |
|
| 350 | - * @param string $username A username used to identify the connection. |
|
| 351 | - * @param string $password A password used to identify the connection. |
|
| 352 | - * @throws MongoConnectionException |
|
| 353 | - * @return bool If the connection was successful. |
|
| 354 | - */ |
|
| 355 | - #[Deprecated('Pass array("persist" => $id) to the constructor instead of using this method.')] |
|
| 356 | - public function persistConnect($username = "", $password = "") {} |
|
| 357 | - |
|
| 358 | - /** |
|
| 359 | - * Creates a persistent connection with paired database servers |
|
| 360 | - * @link https://secure.php.net/manual/en/mongo.pairpersistconnect.php |
|
| 361 | - * @param string $username A username used to identify the connection. |
|
| 362 | - * @param string $password A password used to identify the connection. |
|
| 363 | - * @throws MongoConnectionException |
|
| 364 | - * @return bool If the connection was successful. |
|
| 365 | - */ |
|
| 366 | - #[Deprecated('Pass "mongodb://server1,server2" and array("persist" => $id) to the constructor instead of using this method.')] |
|
| 367 | - public function pairPersistConnect($username = "", $password = "") {} |
|
| 368 | - |
|
| 369 | - /** |
|
| 370 | - * Connects with a database server |
|
| 371 | - * |
|
| 372 | - * @link https://secure.php.net/manual/en/mongo.connectutil.php |
|
| 373 | - * @throws MongoConnectionException |
|
| 374 | - * @return bool If the connection was successful. |
|
| 375 | - */ |
|
| 376 | - protected function connectUtil() {} |
|
| 265 | + /** |
|
| 266 | + * (PECL mongo >= 1.2.0)<br/> |
|
| 267 | + * Get pool size for connection pools |
|
| 268 | + * @link https://php.net/manual/en/mongo.getpoolsize.php |
|
| 269 | + * @return int Returns the current pool size. |
|
| 270 | + * @see MongoPool::getSize() |
|
| 271 | + */ |
|
| 272 | + #[Deprecated('This feature has been DEPRECATED as of version 1.2.3. Relying on this feature is highly discouraged. Please use MongoPool::getSize() instead.')] |
|
| 273 | + public function getPoolSize() {} |
|
| 274 | + /** |
|
| 275 | + * (PECL mongo >= 1.1.0)<br/> |
|
| 276 | + * Returns the address being used by this for slaveOkay reads |
|
| 277 | + * @link https://php.net/manual/en/mongo.getslave.php |
|
| 278 | + * @return bool <p>The address of the secondary this connection is using for reads. |
|
| 279 | + * </p> |
|
| 280 | + * <p> |
|
| 281 | + * This returns <b>NULL</b> if this is not connected to a replica set or not yet |
|
| 282 | + * initialized. |
|
| 283 | + * </p> |
|
| 284 | + */ |
|
| 285 | + public function getSlave() {} |
|
| 286 | + /** |
|
| 287 | + * (PECL mongo >= 1.1.0)<br/> |
|
| 288 | + * Get slaveOkay setting for this connection |
|
| 289 | + * @link https://php.net/manual/en/mongo.getslaveokay.php |
|
| 290 | + * @return bool Returns the value of slaveOkay for this instance. |
|
| 291 | + */ |
|
| 292 | + public function getSlaveOkay() {} |
|
| 293 | + /** |
|
| 294 | + * Connects to paired database server |
|
| 295 | + * @link https://secure.php.net/manual/en/mongo.pairconnect.php |
|
| 296 | + * @throws MongoConnectionException |
|
| 297 | + * @return bool |
|
| 298 | + */ |
|
| 299 | + #[Deprecated('Pass a string of the form "mongodb://server1,server2" to the constructor instead of using this method.')] |
|
| 300 | + public function pairConnect() {} |
|
| 301 | + |
|
| 302 | + /** |
|
| 303 | + * (PECL mongo >= 1.2.0)<br/> |
|
| 304 | + * Returns information about all connection pools. |
|
| 305 | + * @link https://php.net/manual/en/mongo.pooldebug.php |
|
| 306 | + * @return array Each connection pool has an identifier, which starts with the host. For each pool, this function shows the following fields: |
|
| 307 | + * <p><b>in use</b></p> |
|
| 308 | + * <p>The number of connections currently being used by MongoClient instances. |
|
| 309 | + * in pool |
|
| 310 | + * The number of connections currently in the pool (not being used).</p> |
|
| 311 | + * <p><b>remaining</b></p> |
|
| 312 | + * |
|
| 313 | + * <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). |
|
| 314 | + * |
|
| 315 | + * A negative number means that this pool will spawn unlimited connections. |
|
| 316 | + * |
|
| 317 | + * 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> |
|
| 318 | + * <p><b>timeout</b></p> |
|
| 319 | + * |
|
| 320 | + * <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> |
|
| 321 | + * @see MongoPool::info() |
|
| 322 | + */ |
|
| 323 | + #[Deprecated('@deprecated This feature has been DEPRECATED as of version 1.2.3. Relying on this feature is highly discouraged. Please use MongoPool::info() instead.')] |
|
| 324 | + public function poolDebug() {} |
|
| 325 | + |
|
| 326 | + /** |
|
| 327 | + * (PECL mongo >= 1.1.0)<br/> |
|
| 328 | + * Change slaveOkay setting for this connection |
|
| 329 | + * @link https://php.net/manual/en/mongo.setslaveokay.php |
|
| 330 | + * @param bool $ok [optional] <p class="para"> |
|
| 331 | + * If reads should be sent to secondary members of a replica set for all |
|
| 332 | + * possible queries using this {@see MongoClient} instance. |
|
| 333 | + * </p> |
|
| 334 | + * @return bool returns the former value of slaveOkay for this instance. |
|
| 335 | + */ |
|
| 336 | + public function setSlaveOkay($ok) {} |
|
| 337 | + /** |
|
| 338 | + *(PECL mongo >= 1.2.0)<br/> |
|
| 339 | + * Set the size for future connection pools. |
|
| 340 | + * @link https://php.net/manual/en/mongo.setpoolsize.php |
|
| 341 | + * @param int $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> |
|
| 342 | + * @return bool Returns the former value of pool size. |
|
| 343 | + * @see MongoPool::setSize() |
|
| 344 | + */ |
|
| 345 | + #[Deprecated('Relying on this feature is highly discouraged. Please use MongoPool::setSize() instead.')] |
|
| 346 | + public function setPoolSize($size) {} |
|
| 347 | + /** |
|
| 348 | + * Creates a persistent connection with a database server |
|
| 349 | + * @link https://secure.php.net/manual/en/mongo.persistconnect.php |
|
| 350 | + * @param string $username A username used to identify the connection. |
|
| 351 | + * @param string $password A password used to identify the connection. |
|
| 352 | + * @throws MongoConnectionException |
|
| 353 | + * @return bool If the connection was successful. |
|
| 354 | + */ |
|
| 355 | + #[Deprecated('Pass array("persist" => $id) to the constructor instead of using this method.')] |
|
| 356 | + public function persistConnect($username = "", $password = "") {} |
|
| 357 | + |
|
| 358 | + /** |
|
| 359 | + * Creates a persistent connection with paired database servers |
|
| 360 | + * @link https://secure.php.net/manual/en/mongo.pairpersistconnect.php |
|
| 361 | + * @param string $username A username used to identify the connection. |
|
| 362 | + * @param string $password A password used to identify the connection. |
|
| 363 | + * @throws MongoConnectionException |
|
| 364 | + * @return bool If the connection was successful. |
|
| 365 | + */ |
|
| 366 | + #[Deprecated('Pass "mongodb://server1,server2" and array("persist" => $id) to the constructor instead of using this method.')] |
|
| 367 | + public function pairPersistConnect($username = "", $password = "") {} |
|
| 368 | + |
|
| 369 | + /** |
|
| 370 | + * Connects with a database server |
|
| 371 | + * |
|
| 372 | + * @link https://secure.php.net/manual/en/mongo.connectutil.php |
|
| 373 | + * @throws MongoConnectionException |
|
| 374 | + * @return bool If the connection was successful. |
|
| 375 | + */ |
|
| 376 | + protected function connectUtil() {} |
|
| 377 | 377 | |
| 378 | 378 | /** |
| 379 | 379 | * Check if there was an error on the most recent db operation performed |
@@ -382,7 +382,7 @@ discard block |
||
| 382 | 382 | * @see MongoDB::lastError() |
| 383 | 383 | */ |
| 384 | 384 | #[Deprecated('Use MongoDB::lastError() instead.')] |
| 385 | - public function lastError() {} |
|
| 385 | + public function lastError() {} |
|
| 386 | 386 | |
| 387 | 387 | /** |
| 388 | 388 | * Checks for the last error thrown during a database operation |
@@ -391,25 +391,25 @@ discard block |
||
| 391 | 391 | * @see MongoDB::prevError() |
| 392 | 392 | */ |
| 393 | 393 | #[Deprecated('Use MongoDB::prevError() instead.')] |
| 394 | - public function prevError() {} |
|
| 395 | - |
|
| 396 | - /** |
|
| 397 | - * Clears any flagged errors on the connection |
|
| 398 | - * @link https://secure.php.net/manual/en/mongo.reseterror.php |
|
| 399 | - * @return array Returns the database response. |
|
| 400 | - * @see MongoDB::resetError() |
|
| 401 | - */ |
|
| 402 | - #[Deprecated('Use MongoDB::resetError() instead.')] |
|
| 403 | - public function resetError() {} |
|
| 404 | - |
|
| 405 | - /** |
|
| 406 | - * Creates a database error on the database. |
|
| 407 | - * @link https://secure.php.net/manual/en/mongo.forceerror.php |
|
| 408 | - * @return bool The database response. |
|
| 409 | - * @see MongoDB::forceError() |
|
| 410 | - */ |
|
| 411 | - #[Deprecated('Use MongoDB::forceError() instead.')] |
|
| 412 | - public function forceError() {} |
|
| 394 | + public function prevError() {} |
|
| 395 | + |
|
| 396 | + /** |
|
| 397 | + * Clears any flagged errors on the connection |
|
| 398 | + * @link https://secure.php.net/manual/en/mongo.reseterror.php |
|
| 399 | + * @return array Returns the database response. |
|
| 400 | + * @see MongoDB::resetError() |
|
| 401 | + */ |
|
| 402 | + #[Deprecated('Use MongoDB::resetError() instead.')] |
|
| 403 | + public function resetError() {} |
|
| 404 | + |
|
| 405 | + /** |
|
| 406 | + * Creates a database error on the database. |
|
| 407 | + * @link https://secure.php.net/manual/en/mongo.forceerror.php |
|
| 408 | + * @return bool The database response. |
|
| 409 | + * @see MongoDB::forceError() |
|
| 410 | + */ |
|
| 411 | + #[Deprecated('Use MongoDB::forceError() instead.')] |
|
| 412 | + public function forceError() {} |
|
| 413 | 413 | } |
| 414 | 414 | |
| 415 | 415 | /** |
@@ -418,405 +418,405 @@ discard block |
||
| 418 | 418 | */ |
| 419 | 419 | class MongoDB |
| 420 | 420 | { |
| 421 | - /** |
|
| 422 | - * Profiling is off. |
|
| 423 | - * @link https://php.net/manual/en/class.mongodb.php#mongodb.constants.profiling-off |
|
| 424 | - */ |
|
| 425 | - public const PROFILING_OFF = 0; |
|
| 426 | - |
|
| 427 | - /** |
|
| 428 | - * Profiling is on for slow operations (>100 ms). |
|
| 429 | - * @link https://php.net/manual/en/class.mongodb.php#mongodb.constants.profiling-slow |
|
| 430 | - */ |
|
| 431 | - public const PROFILING_SLOW = 1; |
|
| 432 | - |
|
| 433 | - /** |
|
| 434 | - * Profiling is on for all operations. |
|
| 435 | - * @link https://php.net/manual/en/class.mongodb.php#mongodb.constants.profiling-on |
|
| 436 | - */ |
|
| 437 | - public const PROFILING_ON = 2; |
|
| 438 | - |
|
| 439 | - /** |
|
| 440 | - * @var int |
|
| 441 | - * <p> |
|
| 442 | - * The number of servers to replicate a change to before returning success. |
|
| 443 | - * Inherited by instances of {@link https://php.net/manual/en/class.mongocollection.php MongoCollection} derived |
|
| 444 | - * from this. <em>w</em> functionality is only available in |
|
| 445 | - * version 1.5.1+ of the MongoDB server and 1.0.8+ of the driver. |
|
| 446 | - * </p> |
|
| 447 | - * <p> |
|
| 448 | - * <em>w</em> is used whenever you need to adjust the |
|
| 449 | - * acknowledgement level |
|
| 450 | - * ( {@link https://php.net/manual/en/mongocollection.insert.php MongoCollection::insert()}, |
|
| 451 | - * {@link https://php.net/manual/en/mongocollection.update.php MongoCollection::update()}, |
|
| 452 | - * {@link https://php.net/manual/en/mongocollection.remove.php MongoCollection::remove()}, |
|
| 453 | - * {@link https://php.net/manual/en/mongocollection.save.php MongoCollection::save()}, and |
|
| 454 | - * {@link https://php.net/manual/en/mongocollection.ensureindex.php MongoCollection::ensureIndex()} all support this |
|
| 455 | - * option). With the default value (1), an acknowledged operation will return once |
|
| 456 | - * the database server has the operation. If the server goes down before |
|
| 457 | - * the operation has been replicated to a secondary, it is possible to lose |
|
| 458 | - * the operation forever. Thus, you can specify <em>w</em> to be |
|
| 459 | - * higher than one and guarantee that at least one secondary has the |
|
| 460 | - * operation before it is considered successful. |
|
| 461 | - * </p> |
|
| 462 | - * <p> |
|
| 463 | - * For example, if <em>w</em> is 2, the primary and one secondary |
|
| 464 | - * must have a record of the operation or the driver will throw a |
|
| 465 | - * {@link https://php.net/manual/en/class.mongocursorexception.php MongoCursorException}. It is tempting to set |
|
| 466 | - * <em>w</em> to the total number of secondaries + primary, but |
|
| 467 | - * then if one secondary is down the operation will fail and an exception |
|
| 468 | - * will be thrown, so usually <em>w=2</em> is safest (primary and |
|
| 469 | - * one secondary). |
|
| 470 | - * </p> |
|
| 471 | - */ |
|
| 472 | - public $w = 1; |
|
| 473 | - |
|
| 474 | - /** |
|
| 475 | - * @var int <p> |
|
| 476 | - * T he number of milliseconds to wait for <em>MongoDB::$w</em> |
|
| 477 | - * replications to take place. Inherited by instances of |
|
| 478 | - * {@link https://secure.php.net/manual/en/class.mongocollection.php MongoCollection} derived from this. |
|
| 479 | - * <em>w</em> functionality is only available in version 1.5.1+ of |
|
| 480 | - * the MongoDB server and 1.0.8+ of the driver. |
|
| 481 | - * </p> |
|
| 482 | - * <p> |
|
| 483 | - * Unless <em>wtimeout</em> is set, the server waits forever for |
|
| 484 | - * replicating to <em>w</em> servers to finish. The driver |
|
| 485 | - * defaults to waiting for 10 seconds, you can change this value to alter |
|
| 486 | - * its behavior. |
|
| 487 | - * </p> |
|
| 488 | - */ |
|
| 489 | - public $wtimeout = 10000; |
|
| 490 | - |
|
| 491 | - /** |
|
| 492 | - * (PECL mongo >= 0.9.0)<br/> |
|
| 493 | - * Creates a new database |
|
| 494 | - * This method is not meant to be called directly. The preferred way to create an instance of MongoDB is through {@see Mongo::__get()} or {@see Mongo::selectDB()}. |
|
| 495 | - * @link https://secure.php.net/manual/en/mongodb.construct.php |
|
| 496 | - * @param MongoClient $conn Database connection. |
|
| 497 | - * @param string $name Database name. |
|
| 498 | - * @throws Exception |
|
| 499 | - */ |
|
| 500 | - public function __construct($conn, $name) {} |
|
| 501 | - |
|
| 502 | - /** |
|
| 503 | - * The name of this database |
|
| 504 | - * @link https://secure.php.net/manual/en/mongodb.--tostring.php |
|
| 505 | - * @return string Returns this database's name. |
|
| 506 | - */ |
|
| 507 | - public function __toString() {} |
|
| 508 | - |
|
| 509 | - /** |
|
| 510 | - * (PECL mongo >= 1.0.2)<br/> |
|
| 511 | - * Gets a collection |
|
| 512 | - * @link https://secure.php.net/manual/en/mongodb.get.php |
|
| 513 | - * @param string $name The name of the collection. |
|
| 514 | - * @return MongoCollection |
|
| 515 | - */ |
|
| 516 | - public function __get($name) {} |
|
| 517 | - |
|
| 518 | - /** |
|
| 519 | - * (PECL mongo >= 1.3.0)<br/> |
|
| 520 | - * @link https://secure.php.net/manual/en/mongodb.getcollectionnames.php |
|
| 521 | - * Get all collections from this database |
|
| 522 | - * @param bool $includeSystemCollections [optional] Include system collections. |
|
| 523 | - * @return array Returns the names of the all the collections in the database as an |
|
| 524 | - * {@link https://secure.php.net/manual/en/language.types.array.php array}. |
|
| 525 | - */ |
|
| 526 | - public function getCollectionNames($includeSystemCollections = false) {} |
|
| 527 | - |
|
| 528 | - /** |
|
| 529 | - * (PECL mongo >= 0.9.0)<br/> |
|
| 530 | - * Fetches toolkit for dealing with files stored in this database |
|
| 531 | - * @link https://secure.php.net/manual/en/mongodb.getgridfs.php |
|
| 532 | - * @param string $prefix [optional] The prefix for the files and chunks collections. |
|
| 533 | - * @return MongoGridFS Returns a new gridfs object for this database. |
|
| 534 | - */ |
|
| 535 | - public function getGridFS($prefix = "fs") {} |
|
| 536 | - |
|
| 537 | - /** |
|
| 538 | - * (PECL mongo >= 0.9.0)<br/> |
|
| 539 | - * Gets this database's profiling level |
|
| 540 | - * @link https://secure.php.net/manual/en/mongodb.getprofilinglevel.php |
|
| 541 | - * @return int Returns the profiling level. |
|
| 542 | - */ |
|
| 543 | - public function getProfilingLevel() {} |
|
| 544 | - |
|
| 545 | - /** |
|
| 546 | - * (PECL mongo >= 1.1.0)<br/> |
|
| 547 | - * Get slaveOkay setting for this database |
|
| 548 | - * @link https://secure.php.net/manual/en/mongodb.getslaveokay.php |
|
| 549 | - * @return bool Returns the value of slaveOkay for this instance. |
|
| 550 | - */ |
|
| 551 | - public function getSlaveOkay() {} |
|
| 552 | - /** |
|
| 553 | - * (PECL mongo >= 0.9.0)<br/> |
|
| 554 | - * Sets this database's profiling level |
|
| 555 | - * @link https://secure.php.net/manual/en/mongodb.setprofilinglevel.php |
|
| 556 | - * @param int $level Profiling level. |
|
| 557 | - * @return int Returns the previous profiling level. |
|
| 558 | - */ |
|
| 559 | - public function setProfilingLevel($level) {} |
|
| 560 | - |
|
| 561 | - /** |
|
| 562 | - * (PECL mongo >= 0.9.0)<br/> |
|
| 563 | - * Drops this database |
|
| 564 | - * @link https://secure.php.net/manual/en/mongodb.drop.php |
|
| 565 | - * @return array Returns the database response. |
|
| 566 | - */ |
|
| 567 | - public function drop() {} |
|
| 568 | - |
|
| 569 | - /** |
|
| 570 | - * Repairs and compacts this database |
|
| 571 | - * @link https://secure.php.net/manual/en/mongodb.repair.php |
|
| 572 | - * @param bool $preserve_cloned_files [optional] <p>If cloned files should be kept if the repair fails.</p> |
|
| 573 | - * @param bool $backup_original_files [optional] <p>If original files should be backed up.</p> |
|
| 574 | - * @return array <p>Returns db response.</p> |
|
| 575 | - */ |
|
| 576 | - public function repair($preserve_cloned_files = false, $backup_original_files = false) {} |
|
| 577 | - |
|
| 578 | - /** |
|
| 579 | - * (PECL mongo >= 0.9.0)<br/> |
|
| 580 | - * Gets a collection |
|
| 581 | - * @link https://secure.php.net/manual/en/mongodb.selectcollection.php |
|
| 582 | - * @param string $name <b>The collection name.</b> |
|
| 583 | - * @throws Exception if the collection name is invalid. |
|
| 584 | - * @return MongoCollection <p> |
|
| 585 | - * Returns a new collection object. |
|
| 586 | - * </p> |
|
| 587 | - */ |
|
| 588 | - public function selectCollection($name) {} |
|
| 589 | - |
|
| 590 | - /** |
|
| 591 | - * (PECL mongo >= 1.1.0)<br/> |
|
| 592 | - * Change slaveOkay setting for this database |
|
| 593 | - * @link https://php.net/manual/en/mongodb.setslaveokay.php |
|
| 594 | - * @param bool $ok [optional] <p> |
|
| 595 | - * If reads should be sent to secondary members of a replica set for all |
|
| 596 | - * possible queries using this {@link https://secure.php.net/manual/en/class.mongodb.php MongoDB} instance. |
|
| 597 | - * </p> |
|
| 598 | - * @return bool Returns the former value of slaveOkay for this instance. |
|
| 599 | - */ |
|
| 600 | - public function setSlaveOkay($ok = true) {} |
|
| 601 | - |
|
| 602 | - /** |
|
| 603 | - * Creates a collection |
|
| 604 | - * @link https://secure.php.net/manual/en/mongodb.createcollection.php |
|
| 605 | - * @param string $name The name of the collection. |
|
| 606 | - * @param array $options [optional] <p> |
|
| 607 | - * <p> |
|
| 608 | - * An array containing options for the collections. Each option is its own |
|
| 609 | - * element in the options array, with the option name listed below being |
|
| 610 | - * the key of the element. The supported options depend on the MongoDB |
|
| 611 | - * server version. At the moment, the following options are supported: |
|
| 612 | - * </p> |
|
| 613 | - * <p> |
|
| 614 | - * <b>capped</b> |
|
| 615 | - * <p> |
|
| 616 | - * If the collection should be a fixed size. |
|
| 617 | - * </p> |
|
| 618 | - * </p> |
|
| 619 | - * <p> |
|
| 620 | - * <b>size</b> |
|
| 621 | - * <p> |
|
| 622 | - * If the collection is fixed size, its size in bytes.</p></p> |
|
| 623 | - * <p><b>max</b> |
|
| 624 | - * <p>If the collection is fixed size, the maximum number of elements to store in the collection.</p></p> |
|
| 625 | - * <i>autoIndexId</i> |
|
| 626 | - * |
|
| 627 | - * <p> |
|
| 628 | - * If capped is <b>TRUE</b> you can specify <b>FALSE</b> to disable the |
|
| 629 | - * automatic index created on the <em>_id</em> field. |
|
| 630 | - * Before MongoDB 2.2, the default value for |
|
| 631 | - * <em>autoIndexId</em> was <b>FALSE</b>. |
|
| 632 | - * </p> |
|
| 633 | - * </p> |
|
| 634 | - * @return MongoCollection <p>Returns a collection object representing the new collection.</p> |
|
| 635 | - */ |
|
| 636 | - public function createCollection($name, $options) {} |
|
| 637 | - |
|
| 638 | - /** |
|
| 639 | - * (PECL mongo >= 0.9.0)<br/> |
|
| 640 | - * Drops a collection |
|
| 641 | - * @link https://secure.php.net/manual/en/mongodb.dropcollection.php |
|
| 642 | - * @param MongoCollection|string $coll MongoCollection or name of collection to drop. |
|
| 643 | - * @return array Returns the database response. |
|
| 644 | - * @see MongoCollection::drop() |
|
| 645 | - */ |
|
| 646 | - #[Deprecated('Use MongoCollection::drop() instead.')] |
|
| 647 | - public function dropCollection($coll) {} |
|
| 648 | - |
|
| 649 | - /** |
|
| 650 | - * (PECL mongo >= 0.9.0)<br/> |
|
| 651 | - * Get a list of collections in this database |
|
| 652 | - * @link https://secure.php.net/manual/en/mongodb.listcollections.php |
|
| 653 | - * @param bool $includeSystemCollections [optional] <p>Include system collections.</p> |
|
| 654 | - * @return array Returns a list of MongoCollections. |
|
| 655 | - */ |
|
| 656 | - public function listCollections($includeSystemCollections = false) {} |
|
| 657 | - |
|
| 658 | - /** |
|
| 659 | - * (PECL mongo >= 0.9.0)<br/> |
|
| 660 | - * Creates a database reference |
|
| 661 | - * @link https://secure.php.net/manual/en/mongodb.createdbref.php |
|
| 662 | - * @param string $collection The collection to which the database reference will point. |
|
| 663 | - * @param mixed $document_or_id <p> |
|
| 664 | - * If an array or object is given, its <em>_id</em> field will be |
|
| 665 | - * used as the reference ID. If a {@see MongoId} or scalar |
|
| 666 | - * is given, it will be used as the reference ID. |
|
| 667 | - * </p> |
|
| 668 | - * @return array <p>Returns a database reference array.</p> |
|
| 669 | - * <p> |
|
| 670 | - * If an array without an <em>_id</em> field was provided as the |
|
| 671 | - * <em>document_or_id</em> parameter, <b>NULL</b> will be returned. |
|
| 672 | - * </p> |
|
| 673 | - */ |
|
| 674 | - public function createDBRef($collection, $document_or_id) {} |
|
| 675 | - |
|
| 676 | - /** |
|
| 677 | - * (PECL mongo >= 0.9.0)<br/> |
|
| 678 | - * Fetches the document pointed to by a database reference |
|
| 679 | - * @link https://secure.php.net/manual/en/mongodb.getdbref.php |
|
| 680 | - * @param array $ref A database reference. |
|
| 681 | - * @return array Returns the document pointed to by the reference. |
|
| 682 | - */ |
|
| 683 | - public function getDBRef(array $ref) {} |
|
| 684 | - |
|
| 685 | - /** |
|
| 686 | - * (PECL mongo >= 1.5.0)<br/> |
|
| 687 | - * Get the write concern for this database |
|
| 688 | - * @link https://php.net/manual/en/mongodb.getwriteconcern.php |
|
| 689 | - * @return array <p>This function returns an array describing the write concern. |
|
| 690 | - * The array contains the values w for an integer acknowledgement level or string mode, |
|
| 691 | - * and wtimeout denoting the maximum number of milliseconds to wait for the server to satisfy the write concern.</p> |
|
| 692 | - */ |
|
| 693 | - public function getWriteConcern() {} |
|
| 694 | - /** |
|
| 695 | - * (PECL mongo >= 0.9.3)<br/> |
|
| 696 | - * Runs JavaScript code on the database server. |
|
| 697 | - * @link https://secure.php.net/manual/en/mongodb.execute.php |
|
| 698 | - * @param MongoCode|string $code Code to execute. |
|
| 699 | - * @param array $args [optional] Arguments to be passed to code. |
|
| 700 | - * @return array Returns the result of the evaluation. |
|
| 701 | - */ |
|
| 702 | - public function execute($code, array $args = []) {} |
|
| 703 | - |
|
| 704 | - /** |
|
| 705 | - * Execute a database command |
|
| 706 | - * @link https://secure.php.net/manual/en/mongodb.command.php |
|
| 707 | - * @param array $data The query to send. |
|
| 708 | - * @param array $options [optional] <p> |
|
| 709 | - * This parameter is an associative array of the form |
|
| 710 | - * <em>array("optionname" => <boolean>, ...)</em>. Currently |
|
| 711 | - * supported options are: |
|
| 712 | - * </p><ul> |
|
| 713 | - * <li><p><em>"timeout"</em></p><p>Deprecated alias for <em>"socketTimeoutMS"</em>.</p></li> |
|
| 714 | - * </ul> |
|
| 715 | - * @return array Returns database response. |
|
| 716 | - * Every database response is always maximum one document, |
|
| 717 | - * which means that the result of a database command can never exceed 16MB. |
|
| 718 | - * The resulting document's structure depends on the command, |
|
| 719 | - * but most results will have the ok field to indicate success or failure and results containing an array of each of the resulting documents. |
|
| 720 | - */ |
|
| 721 | - public function command(array $data, $options) {} |
|
| 722 | - |
|
| 723 | - /** |
|
| 724 | - * (PECL mongo >= 0.9.5)<br/> |
|
| 725 | - * Check if there was an error on the most recent db operation performed |
|
| 726 | - * @link https://secure.php.net/manual/en/mongodb.lasterror.php |
|
| 727 | - * @return array Returns the error, if there was one. |
|
| 728 | - */ |
|
| 729 | - public function lastError() {} |
|
| 730 | - |
|
| 731 | - /** |
|
| 732 | - * (PECL mongo >= 0.9.5)<br/> |
|
| 733 | - * Checks for the last error thrown during a database operation |
|
| 734 | - * @link https://secure.php.net/manual/en/mongodb.preverror.php |
|
| 735 | - * @return array Returns the error and the number of operations ago it occurred. |
|
| 736 | - */ |
|
| 737 | - public function prevError() {} |
|
| 738 | - |
|
| 739 | - /** |
|
| 740 | - * (PECL mongo >= 0.9.5)<br/> |
|
| 741 | - * Clears any flagged errors on the database |
|
| 742 | - * @link https://secure.php.net/manual/en/mongodb.reseterror.php |
|
| 743 | - * @return array Returns the database response. |
|
| 744 | - */ |
|
| 745 | - public function resetError() {} |
|
| 746 | - |
|
| 747 | - /** |
|
| 748 | - * (PECL mongo >= 0.9.5)<br/> |
|
| 749 | - * Creates a database error |
|
| 750 | - * @link https://secure.php.net/manual/en/mongodb.forceerror.php |
|
| 751 | - * @return bool Returns the database response. |
|
| 752 | - */ |
|
| 753 | - public function forceError() {} |
|
| 754 | - |
|
| 755 | - /** |
|
| 756 | - * (PECL mongo >= 1.0.1)<br/> |
|
| 757 | - * Log in to this database |
|
| 758 | - * |
|
| 759 | - * @link https://secure.php.net/manual/en/mongodb.authenticate.php |
|
| 760 | - * |
|
| 761 | - * @param string $username The username. |
|
| 762 | - * @param string $password The password (in plaintext). |
|
| 763 | - * |
|
| 764 | - * @return array <p>Returns database response. If the login was successful, it will return 1.</p> |
|
| 765 | - * <p> |
|
| 766 | - * <span style="color: #0000BB"><?php<br></span> |
|
| 767 | - * <span style="color: #007700">array(</span> |
|
| 768 | - * <span style="color: #DD0000">"ok" </span> |
|
| 769 | - * <span style="color: #007700">=> </span> |
|
| 770 | - * <span style="color: #0000BB">1</span> |
|
| 771 | - * <span style="color: #007700">);<br></span> |
|
| 772 | - * <span style="color: #0000BB">?></span> |
|
| 773 | - * </p> |
|
| 774 | - * <p> If something went wrong, it will return </p> |
|
| 775 | - * <p> |
|
| 776 | - * <span style="color: #0000BB"><?php<br></span> |
|
| 777 | - * <span style="color: #007700">array(</span> |
|
| 778 | - * <span style="color: #DD0000">"ok" </span> |
|
| 779 | - * <span style="color: #007700">=> </span> |
|
| 780 | - * <span style="color: #0000BB">0</span> |
|
| 781 | - * <span style="color: #007700">, </span> |
|
| 782 | - * <span style="color: #DD0000">"errmsg" </span> |
|
| 783 | - * <span style="color: #007700">=> </span> |
|
| 784 | - * <span style="color: #DD0000">"auth fails"</span> |
|
| 785 | - * <span style="color: #007700">);<br></span> |
|
| 786 | - * <span style="color: #0000BB">?></span> |
|
| 787 | - * </p> |
|
| 788 | - * <p>("auth fails" could be another message, depending on database version and |
|
| 789 | - * what went wrong)</p> |
|
| 790 | - */ |
|
| 791 | - public function authenticate($username, $password) {} |
|
| 792 | - |
|
| 793 | - /** |
|
| 794 | - * (PECL mongo >= 1.3.0)<br/> |
|
| 795 | - * Get the read preference for this database |
|
| 796 | - * @link https://secure.php.net/manual/en/mongodb.getreadpreference.php |
|
| 797 | - * @return array This function returns an array describing the read preference. The array contains the values type for the string read preference mode (corresponding to the MongoClient constants), and tagsets containing a list of all tag set criteria. If no tag sets were specified, tagsets will not be present in the array. |
|
| 798 | - */ |
|
| 799 | - public function getReadPreference() {} |
|
| 800 | - |
|
| 801 | - /** |
|
| 802 | - * (PECL mongo >= 1.3.0)<br/> |
|
| 803 | - * Set the read preference for this database |
|
| 804 | - * @link https://secure.php.net/manual/en/mongodb.setreadpreference.php |
|
| 805 | - * @param string $read_preference <p>The read preference mode: <b>MongoClient::RP_PRIMARY</b>, <b>MongoClient::RP_PRIMARY_PREFERRED</b>, <b>MongoClient::RP_SECONDARY</b>, <b>MongoClient::RP_SECONDARY_PREFERRED</b>, or <b>MongoClient::RP_NEAREST</b>.</p> |
|
| 806 | - * @param array $tags [optional] <p>An array of zero or more tag sets, where each tag set is itself an array of criteria used to match tags on replica set members.</p> |
|
| 807 | - * @return bool Returns <b>TRUE</b> on success, or <b>FALSE</b> otherwise. |
|
| 808 | - */ |
|
| 809 | - public function setReadPreference($read_preference, array $tags) {} |
|
| 810 | - |
|
| 811 | - /** |
|
| 812 | - * (PECL mongo >= 1.5.0)<br/> |
|
| 813 | - * @link https://php.net/manual/en/mongodb.setwriteconcern.php |
|
| 814 | - * Set the write concern for this database |
|
| 815 | - * @param mixed $w <p>The write concern. This may be an integer denoting the number of servers required to acknowledge the write, or a string mode (e.g. "majority").</p> |
|
| 816 | - * @param int $wtimeout [optional] <p>The maximum number of milliseconds to wait for the server to satisfy the write concern.</p> |
|
| 817 | - * @return bool Returns <b>TRUE</b> on success, or <b>FALSE</b> otherwise. |
|
| 818 | - */ |
|
| 819 | - public function setWriteConcern($w, $wtimeout) {} |
|
| 421 | + /** |
|
| 422 | + * Profiling is off. |
|
| 423 | + * @link https://php.net/manual/en/class.mongodb.php#mongodb.constants.profiling-off |
|
| 424 | + */ |
|
| 425 | + public const PROFILING_OFF = 0; |
|
| 426 | + |
|
| 427 | + /** |
|
| 428 | + * Profiling is on for slow operations (>100 ms). |
|
| 429 | + * @link https://php.net/manual/en/class.mongodb.php#mongodb.constants.profiling-slow |
|
| 430 | + */ |
|
| 431 | + public const PROFILING_SLOW = 1; |
|
| 432 | + |
|
| 433 | + /** |
|
| 434 | + * Profiling is on for all operations. |
|
| 435 | + * @link https://php.net/manual/en/class.mongodb.php#mongodb.constants.profiling-on |
|
| 436 | + */ |
|
| 437 | + public const PROFILING_ON = 2; |
|
| 438 | + |
|
| 439 | + /** |
|
| 440 | + * @var int |
|
| 441 | + * <p> |
|
| 442 | + * The number of servers to replicate a change to before returning success. |
|
| 443 | + * Inherited by instances of {@link https://php.net/manual/en/class.mongocollection.php MongoCollection} derived |
|
| 444 | + * from this. <em>w</em> functionality is only available in |
|
| 445 | + * version 1.5.1+ of the MongoDB server and 1.0.8+ of the driver. |
|
| 446 | + * </p> |
|
| 447 | + * <p> |
|
| 448 | + * <em>w</em> is used whenever you need to adjust the |
|
| 449 | + * acknowledgement level |
|
| 450 | + * ( {@link https://php.net/manual/en/mongocollection.insert.php MongoCollection::insert()}, |
|
| 451 | + * {@link https://php.net/manual/en/mongocollection.update.php MongoCollection::update()}, |
|
| 452 | + * {@link https://php.net/manual/en/mongocollection.remove.php MongoCollection::remove()}, |
|
| 453 | + * {@link https://php.net/manual/en/mongocollection.save.php MongoCollection::save()}, and |
|
| 454 | + * {@link https://php.net/manual/en/mongocollection.ensureindex.php MongoCollection::ensureIndex()} all support this |
|
| 455 | + * option). With the default value (1), an acknowledged operation will return once |
|
| 456 | + * the database server has the operation. If the server goes down before |
|
| 457 | + * the operation has been replicated to a secondary, it is possible to lose |
|
| 458 | + * the operation forever. Thus, you can specify <em>w</em> to be |
|
| 459 | + * higher than one and guarantee that at least one secondary has the |
|
| 460 | + * operation before it is considered successful. |
|
| 461 | + * </p> |
|
| 462 | + * <p> |
|
| 463 | + * For example, if <em>w</em> is 2, the primary and one secondary |
|
| 464 | + * must have a record of the operation or the driver will throw a |
|
| 465 | + * {@link https://php.net/manual/en/class.mongocursorexception.php MongoCursorException}. It is tempting to set |
|
| 466 | + * <em>w</em> to the total number of secondaries + primary, but |
|
| 467 | + * then if one secondary is down the operation will fail and an exception |
|
| 468 | + * will be thrown, so usually <em>w=2</em> is safest (primary and |
|
| 469 | + * one secondary). |
|
| 470 | + * </p> |
|
| 471 | + */ |
|
| 472 | + public $w = 1; |
|
| 473 | + |
|
| 474 | + /** |
|
| 475 | + * @var int <p> |
|
| 476 | + * T he number of milliseconds to wait for <em>MongoDB::$w</em> |
|
| 477 | + * replications to take place. Inherited by instances of |
|
| 478 | + * {@link https://secure.php.net/manual/en/class.mongocollection.php MongoCollection} derived from this. |
|
| 479 | + * <em>w</em> functionality is only available in version 1.5.1+ of |
|
| 480 | + * the MongoDB server and 1.0.8+ of the driver. |
|
| 481 | + * </p> |
|
| 482 | + * <p> |
|
| 483 | + * Unless <em>wtimeout</em> is set, the server waits forever for |
|
| 484 | + * replicating to <em>w</em> servers to finish. The driver |
|
| 485 | + * defaults to waiting for 10 seconds, you can change this value to alter |
|
| 486 | + * its behavior. |
|
| 487 | + * </p> |
|
| 488 | + */ |
|
| 489 | + public $wtimeout = 10000; |
|
| 490 | + |
|
| 491 | + /** |
|
| 492 | + * (PECL mongo >= 0.9.0)<br/> |
|
| 493 | + * Creates a new database |
|
| 494 | + * This method is not meant to be called directly. The preferred way to create an instance of MongoDB is through {@see Mongo::__get()} or {@see Mongo::selectDB()}. |
|
| 495 | + * @link https://secure.php.net/manual/en/mongodb.construct.php |
|
| 496 | + * @param MongoClient $conn Database connection. |
|
| 497 | + * @param string $name Database name. |
|
| 498 | + * @throws Exception |
|
| 499 | + */ |
|
| 500 | + public function __construct($conn, $name) {} |
|
| 501 | + |
|
| 502 | + /** |
|
| 503 | + * The name of this database |
|
| 504 | + * @link https://secure.php.net/manual/en/mongodb.--tostring.php |
|
| 505 | + * @return string Returns this database's name. |
|
| 506 | + */ |
|
| 507 | + public function __toString() {} |
|
| 508 | + |
|
| 509 | + /** |
|
| 510 | + * (PECL mongo >= 1.0.2)<br/> |
|
| 511 | + * Gets a collection |
|
| 512 | + * @link https://secure.php.net/manual/en/mongodb.get.php |
|
| 513 | + * @param string $name The name of the collection. |
|
| 514 | + * @return MongoCollection |
|
| 515 | + */ |
|
| 516 | + public function __get($name) {} |
|
| 517 | + |
|
| 518 | + /** |
|
| 519 | + * (PECL mongo >= 1.3.0)<br/> |
|
| 520 | + * @link https://secure.php.net/manual/en/mongodb.getcollectionnames.php |
|
| 521 | + * Get all collections from this database |
|
| 522 | + * @param bool $includeSystemCollections [optional] Include system collections. |
|
| 523 | + * @return array Returns the names of the all the collections in the database as an |
|
| 524 | + * {@link https://secure.php.net/manual/en/language.types.array.php array}. |
|
| 525 | + */ |
|
| 526 | + public function getCollectionNames($includeSystemCollections = false) {} |
|
| 527 | + |
|
| 528 | + /** |
|
| 529 | + * (PECL mongo >= 0.9.0)<br/> |
|
| 530 | + * Fetches toolkit for dealing with files stored in this database |
|
| 531 | + * @link https://secure.php.net/manual/en/mongodb.getgridfs.php |
|
| 532 | + * @param string $prefix [optional] The prefix for the files and chunks collections. |
|
| 533 | + * @return MongoGridFS Returns a new gridfs object for this database. |
|
| 534 | + */ |
|
| 535 | + public function getGridFS($prefix = "fs") {} |
|
| 536 | + |
|
| 537 | + /** |
|
| 538 | + * (PECL mongo >= 0.9.0)<br/> |
|
| 539 | + * Gets this database's profiling level |
|
| 540 | + * @link https://secure.php.net/manual/en/mongodb.getprofilinglevel.php |
|
| 541 | + * @return int Returns the profiling level. |
|
| 542 | + */ |
|
| 543 | + public function getProfilingLevel() {} |
|
| 544 | + |
|
| 545 | + /** |
|
| 546 | + * (PECL mongo >= 1.1.0)<br/> |
|
| 547 | + * Get slaveOkay setting for this database |
|
| 548 | + * @link https://secure.php.net/manual/en/mongodb.getslaveokay.php |
|
| 549 | + * @return bool Returns the value of slaveOkay for this instance. |
|
| 550 | + */ |
|
| 551 | + public function getSlaveOkay() {} |
|
| 552 | + /** |
|
| 553 | + * (PECL mongo >= 0.9.0)<br/> |
|
| 554 | + * Sets this database's profiling level |
|
| 555 | + * @link https://secure.php.net/manual/en/mongodb.setprofilinglevel.php |
|
| 556 | + * @param int $level Profiling level. |
|
| 557 | + * @return int Returns the previous profiling level. |
|
| 558 | + */ |
|
| 559 | + public function setProfilingLevel($level) {} |
|
| 560 | + |
|
| 561 | + /** |
|
| 562 | + * (PECL mongo >= 0.9.0)<br/> |
|
| 563 | + * Drops this database |
|
| 564 | + * @link https://secure.php.net/manual/en/mongodb.drop.php |
|
| 565 | + * @return array Returns the database response. |
|
| 566 | + */ |
|
| 567 | + public function drop() {} |
|
| 568 | + |
|
| 569 | + /** |
|
| 570 | + * Repairs and compacts this database |
|
| 571 | + * @link https://secure.php.net/manual/en/mongodb.repair.php |
|
| 572 | + * @param bool $preserve_cloned_files [optional] <p>If cloned files should be kept if the repair fails.</p> |
|
| 573 | + * @param bool $backup_original_files [optional] <p>If original files should be backed up.</p> |
|
| 574 | + * @return array <p>Returns db response.</p> |
|
| 575 | + */ |
|
| 576 | + public function repair($preserve_cloned_files = false, $backup_original_files = false) {} |
|
| 577 | + |
|
| 578 | + /** |
|
| 579 | + * (PECL mongo >= 0.9.0)<br/> |
|
| 580 | + * Gets a collection |
|
| 581 | + * @link https://secure.php.net/manual/en/mongodb.selectcollection.php |
|
| 582 | + * @param string $name <b>The collection name.</b> |
|
| 583 | + * @throws Exception if the collection name is invalid. |
|
| 584 | + * @return MongoCollection <p> |
|
| 585 | + * Returns a new collection object. |
|
| 586 | + * </p> |
|
| 587 | + */ |
|
| 588 | + public function selectCollection($name) {} |
|
| 589 | + |
|
| 590 | + /** |
|
| 591 | + * (PECL mongo >= 1.1.0)<br/> |
|
| 592 | + * Change slaveOkay setting for this database |
|
| 593 | + * @link https://php.net/manual/en/mongodb.setslaveokay.php |
|
| 594 | + * @param bool $ok [optional] <p> |
|
| 595 | + * If reads should be sent to secondary members of a replica set for all |
|
| 596 | + * possible queries using this {@link https://secure.php.net/manual/en/class.mongodb.php MongoDB} instance. |
|
| 597 | + * </p> |
|
| 598 | + * @return bool Returns the former value of slaveOkay for this instance. |
|
| 599 | + */ |
|
| 600 | + public function setSlaveOkay($ok = true) {} |
|
| 601 | + |
|
| 602 | + /** |
|
| 603 | + * Creates a collection |
|
| 604 | + * @link https://secure.php.net/manual/en/mongodb.createcollection.php |
|
| 605 | + * @param string $name The name of the collection. |
|
| 606 | + * @param array $options [optional] <p> |
|
| 607 | + * <p> |
|
| 608 | + * An array containing options for the collections. Each option is its own |
|
| 609 | + * element in the options array, with the option name listed below being |
|
| 610 | + * the key of the element. The supported options depend on the MongoDB |
|
| 611 | + * server version. At the moment, the following options are supported: |
|
| 612 | + * </p> |
|
| 613 | + * <p> |
|
| 614 | + * <b>capped</b> |
|
| 615 | + * <p> |
|
| 616 | + * If the collection should be a fixed size. |
|
| 617 | + * </p> |
|
| 618 | + * </p> |
|
| 619 | + * <p> |
|
| 620 | + * <b>size</b> |
|
| 621 | + * <p> |
|
| 622 | + * If the collection is fixed size, its size in bytes.</p></p> |
|
| 623 | + * <p><b>max</b> |
|
| 624 | + * <p>If the collection is fixed size, the maximum number of elements to store in the collection.</p></p> |
|
| 625 | + * <i>autoIndexId</i> |
|
| 626 | + * |
|
| 627 | + * <p> |
|
| 628 | + * If capped is <b>TRUE</b> you can specify <b>FALSE</b> to disable the |
|
| 629 | + * automatic index created on the <em>_id</em> field. |
|
| 630 | + * Before MongoDB 2.2, the default value for |
|
| 631 | + * <em>autoIndexId</em> was <b>FALSE</b>. |
|
| 632 | + * </p> |
|
| 633 | + * </p> |
|
| 634 | + * @return MongoCollection <p>Returns a collection object representing the new collection.</p> |
|
| 635 | + */ |
|
| 636 | + public function createCollection($name, $options) {} |
|
| 637 | + |
|
| 638 | + /** |
|
| 639 | + * (PECL mongo >= 0.9.0)<br/> |
|
| 640 | + * Drops a collection |
|
| 641 | + * @link https://secure.php.net/manual/en/mongodb.dropcollection.php |
|
| 642 | + * @param MongoCollection|string $coll MongoCollection or name of collection to drop. |
|
| 643 | + * @return array Returns the database response. |
|
| 644 | + * @see MongoCollection::drop() |
|
| 645 | + */ |
|
| 646 | + #[Deprecated('Use MongoCollection::drop() instead.')] |
|
| 647 | + public function dropCollection($coll) {} |
|
| 648 | + |
|
| 649 | + /** |
|
| 650 | + * (PECL mongo >= 0.9.0)<br/> |
|
| 651 | + * Get a list of collections in this database |
|
| 652 | + * @link https://secure.php.net/manual/en/mongodb.listcollections.php |
|
| 653 | + * @param bool $includeSystemCollections [optional] <p>Include system collections.</p> |
|
| 654 | + * @return array Returns a list of MongoCollections. |
|
| 655 | + */ |
|
| 656 | + public function listCollections($includeSystemCollections = false) {} |
|
| 657 | + |
|
| 658 | + /** |
|
| 659 | + * (PECL mongo >= 0.9.0)<br/> |
|
| 660 | + * Creates a database reference |
|
| 661 | + * @link https://secure.php.net/manual/en/mongodb.createdbref.php |
|
| 662 | + * @param string $collection The collection to which the database reference will point. |
|
| 663 | + * @param mixed $document_or_id <p> |
|
| 664 | + * If an array or object is given, its <em>_id</em> field will be |
|
| 665 | + * used as the reference ID. If a {@see MongoId} or scalar |
|
| 666 | + * is given, it will be used as the reference ID. |
|
| 667 | + * </p> |
|
| 668 | + * @return array <p>Returns a database reference array.</p> |
|
| 669 | + * <p> |
|
| 670 | + * If an array without an <em>_id</em> field was provided as the |
|
| 671 | + * <em>document_or_id</em> parameter, <b>NULL</b> will be returned. |
|
| 672 | + * </p> |
|
| 673 | + */ |
|
| 674 | + public function createDBRef($collection, $document_or_id) {} |
|
| 675 | + |
|
| 676 | + /** |
|
| 677 | + * (PECL mongo >= 0.9.0)<br/> |
|
| 678 | + * Fetches the document pointed to by a database reference |
|
| 679 | + * @link https://secure.php.net/manual/en/mongodb.getdbref.php |
|
| 680 | + * @param array $ref A database reference. |
|
| 681 | + * @return array Returns the document pointed to by the reference. |
|
| 682 | + */ |
|
| 683 | + public function getDBRef(array $ref) {} |
|
| 684 | + |
|
| 685 | + /** |
|
| 686 | + * (PECL mongo >= 1.5.0)<br/> |
|
| 687 | + * Get the write concern for this database |
|
| 688 | + * @link https://php.net/manual/en/mongodb.getwriteconcern.php |
|
| 689 | + * @return array <p>This function returns an array describing the write concern. |
|
| 690 | + * The array contains the values w for an integer acknowledgement level or string mode, |
|
| 691 | + * and wtimeout denoting the maximum number of milliseconds to wait for the server to satisfy the write concern.</p> |
|
| 692 | + */ |
|
| 693 | + public function getWriteConcern() {} |
|
| 694 | + /** |
|
| 695 | + * (PECL mongo >= 0.9.3)<br/> |
|
| 696 | + * Runs JavaScript code on the database server. |
|
| 697 | + * @link https://secure.php.net/manual/en/mongodb.execute.php |
|
| 698 | + * @param MongoCode|string $code Code to execute. |
|
| 699 | + * @param array $args [optional] Arguments to be passed to code. |
|
| 700 | + * @return array Returns the result of the evaluation. |
|
| 701 | + */ |
|
| 702 | + public function execute($code, array $args = []) {} |
|
| 703 | + |
|
| 704 | + /** |
|
| 705 | + * Execute a database command |
|
| 706 | + * @link https://secure.php.net/manual/en/mongodb.command.php |
|
| 707 | + * @param array $data The query to send. |
|
| 708 | + * @param array $options [optional] <p> |
|
| 709 | + * This parameter is an associative array of the form |
|
| 710 | + * <em>array("optionname" => <boolean>, ...)</em>. Currently |
|
| 711 | + * supported options are: |
|
| 712 | + * </p><ul> |
|
| 713 | + * <li><p><em>"timeout"</em></p><p>Deprecated alias for <em>"socketTimeoutMS"</em>.</p></li> |
|
| 714 | + * </ul> |
|
| 715 | + * @return array Returns database response. |
|
| 716 | + * Every database response is always maximum one document, |
|
| 717 | + * which means that the result of a database command can never exceed 16MB. |
|
| 718 | + * The resulting document's structure depends on the command, |
|
| 719 | + * but most results will have the ok field to indicate success or failure and results containing an array of each of the resulting documents. |
|
| 720 | + */ |
|
| 721 | + public function command(array $data, $options) {} |
|
| 722 | + |
|
| 723 | + /** |
|
| 724 | + * (PECL mongo >= 0.9.5)<br/> |
|
| 725 | + * Check if there was an error on the most recent db operation performed |
|
| 726 | + * @link https://secure.php.net/manual/en/mongodb.lasterror.php |
|
| 727 | + * @return array Returns the error, if there was one. |
|
| 728 | + */ |
|
| 729 | + public function lastError() {} |
|
| 730 | + |
|
| 731 | + /** |
|
| 732 | + * (PECL mongo >= 0.9.5)<br/> |
|
| 733 | + * Checks for the last error thrown during a database operation |
|
| 734 | + * @link https://secure.php.net/manual/en/mongodb.preverror.php |
|
| 735 | + * @return array Returns the error and the number of operations ago it occurred. |
|
| 736 | + */ |
|
| 737 | + public function prevError() {} |
|
| 738 | + |
|
| 739 | + /** |
|
| 740 | + * (PECL mongo >= 0.9.5)<br/> |
|
| 741 | + * Clears any flagged errors on the database |
|
| 742 | + * @link https://secure.php.net/manual/en/mongodb.reseterror.php |
|
| 743 | + * @return array Returns the database response. |
|
| 744 | + */ |
|
| 745 | + public function resetError() {} |
|
| 746 | + |
|
| 747 | + /** |
|
| 748 | + * (PECL mongo >= 0.9.5)<br/> |
|
| 749 | + * Creates a database error |
|
| 750 | + * @link https://secure.php.net/manual/en/mongodb.forceerror.php |
|
| 751 | + * @return bool Returns the database response. |
|
| 752 | + */ |
|
| 753 | + public function forceError() {} |
|
| 754 | + |
|
| 755 | + /** |
|
| 756 | + * (PECL mongo >= 1.0.1)<br/> |
|
| 757 | + * Log in to this database |
|
| 758 | + * |
|
| 759 | + * @link https://secure.php.net/manual/en/mongodb.authenticate.php |
|
| 760 | + * |
|
| 761 | + * @param string $username The username. |
|
| 762 | + * @param string $password The password (in plaintext). |
|
| 763 | + * |
|
| 764 | + * @return array <p>Returns database response. If the login was successful, it will return 1.</p> |
|
| 765 | + * <p> |
|
| 766 | + * <span style="color: #0000BB"><?php<br></span> |
|
| 767 | + * <span style="color: #007700">array(</span> |
|
| 768 | + * <span style="color: #DD0000">"ok" </span> |
|
| 769 | + * <span style="color: #007700">=> </span> |
|
| 770 | + * <span style="color: #0000BB">1</span> |
|
| 771 | + * <span style="color: #007700">);<br></span> |
|
| 772 | + * <span style="color: #0000BB">?></span> |
|
| 773 | + * </p> |
|
| 774 | + * <p> If something went wrong, it will return </p> |
|
| 775 | + * <p> |
|
| 776 | + * <span style="color: #0000BB"><?php<br></span> |
|
| 777 | + * <span style="color: #007700">array(</span> |
|
| 778 | + * <span style="color: #DD0000">"ok" </span> |
|
| 779 | + * <span style="color: #007700">=> </span> |
|
| 780 | + * <span style="color: #0000BB">0</span> |
|
| 781 | + * <span style="color: #007700">, </span> |
|
| 782 | + * <span style="color: #DD0000">"errmsg" </span> |
|
| 783 | + * <span style="color: #007700">=> </span> |
|
| 784 | + * <span style="color: #DD0000">"auth fails"</span> |
|
| 785 | + * <span style="color: #007700">);<br></span> |
|
| 786 | + * <span style="color: #0000BB">?></span> |
|
| 787 | + * </p> |
|
| 788 | + * <p>("auth fails" could be another message, depending on database version and |
|
| 789 | + * what went wrong)</p> |
|
| 790 | + */ |
|
| 791 | + public function authenticate($username, $password) {} |
|
| 792 | + |
|
| 793 | + /** |
|
| 794 | + * (PECL mongo >= 1.3.0)<br/> |
|
| 795 | + * Get the read preference for this database |
|
| 796 | + * @link https://secure.php.net/manual/en/mongodb.getreadpreference.php |
|
| 797 | + * @return array This function returns an array describing the read preference. The array contains the values type for the string read preference mode (corresponding to the MongoClient constants), and tagsets containing a list of all tag set criteria. If no tag sets were specified, tagsets will not be present in the array. |
|
| 798 | + */ |
|
| 799 | + public function getReadPreference() {} |
|
| 800 | + |
|
| 801 | + /** |
|
| 802 | + * (PECL mongo >= 1.3.0)<br/> |
|
| 803 | + * Set the read preference for this database |
|
| 804 | + * @link https://secure.php.net/manual/en/mongodb.setreadpreference.php |
|
| 805 | + * @param string $read_preference <p>The read preference mode: <b>MongoClient::RP_PRIMARY</b>, <b>MongoClient::RP_PRIMARY_PREFERRED</b>, <b>MongoClient::RP_SECONDARY</b>, <b>MongoClient::RP_SECONDARY_PREFERRED</b>, or <b>MongoClient::RP_NEAREST</b>.</p> |
|
| 806 | + * @param array $tags [optional] <p>An array of zero or more tag sets, where each tag set is itself an array of criteria used to match tags on replica set members.</p> |
|
| 807 | + * @return bool Returns <b>TRUE</b> on success, or <b>FALSE</b> otherwise. |
|
| 808 | + */ |
|
| 809 | + public function setReadPreference($read_preference, array $tags) {} |
|
| 810 | + |
|
| 811 | + /** |
|
| 812 | + * (PECL mongo >= 1.5.0)<br/> |
|
| 813 | + * @link https://php.net/manual/en/mongodb.setwriteconcern.php |
|
| 814 | + * Set the write concern for this database |
|
| 815 | + * @param mixed $w <p>The write concern. This may be an integer denoting the number of servers required to acknowledge the write, or a string mode (e.g. "majority").</p> |
|
| 816 | + * @param int $wtimeout [optional] <p>The maximum number of milliseconds to wait for the server to satisfy the write concern.</p> |
|
| 817 | + * @return bool Returns <b>TRUE</b> on success, or <b>FALSE</b> otherwise. |
|
| 818 | + */ |
|
| 819 | + public function setWriteConcern($w, $wtimeout) {} |
|
| 820 | 820 | } |
| 821 | 821 | |
| 822 | 822 | /** |
@@ -825,452 +825,452 @@ discard block |
||
| 825 | 825 | */ |
| 826 | 826 | class MongoCollection |
| 827 | 827 | { |
| 828 | - /** |
|
| 829 | - * @link https://php.net/manual/en/class.mongocollection.php#mongocollection.constants.ascending |
|
| 830 | - */ |
|
| 831 | - public const ASCENDING = 1; |
|
| 832 | - |
|
| 833 | - /** |
|
| 834 | - * @link https://php.net/manual/en/class.mongocollection.php#mongocollection.constants.descending |
|
| 835 | - */ |
|
| 836 | - public const DESCENDING = -1; |
|
| 837 | - |
|
| 838 | - /** |
|
| 839 | - * @var MongoDB |
|
| 840 | - */ |
|
| 841 | - public $db = null; |
|
| 842 | - |
|
| 843 | - /** |
|
| 844 | - * @var int <p> |
|
| 845 | - * The number of servers to replicate a change to before returning success. |
|
| 846 | - * Value is inherited from the parent database. The |
|
| 847 | - * {@link https://secure.php.net/manual/en/class.mongodb.php MongoDB} class has a more detailed description of |
|
| 848 | - * how <em>w</em> works. |
|
| 849 | - * </p> |
|
| 850 | - */ |
|
| 851 | - public $w; |
|
| 852 | - |
|
| 853 | - /** |
|
| 854 | - * @var int <p> |
|
| 855 | - * The number of milliseconds to wait for <em>$this->w</em> |
|
| 856 | - * replications to take place. Value is inherited from the parent database. |
|
| 857 | - * The {@link https://secure.php.net/manual/en/class.mongodb.php MongoDB} class has a more detailed description |
|
| 858 | - * of how <em>wtimeout</em> works. |
|
| 859 | - * </p> |
|
| 860 | - */ |
|
| 861 | - public $wtimeout; |
|
| 862 | - |
|
| 863 | - /** |
|
| 864 | - * Creates a new collection |
|
| 865 | - * @link https://secure.php.net/manual/en/mongocollection.construct.php |
|
| 866 | - * @param MongoDB $db Parent database. |
|
| 867 | - * @param string $name Name for this collection. |
|
| 868 | - * @throws Exception |
|
| 869 | - */ |
|
| 870 | - public function __construct(MongoDB $db, $name) {} |
|
| 871 | - |
|
| 872 | - /** |
|
| 873 | - * String representation of this collection |
|
| 874 | - * @link https://secure.php.net/manual/en/mongocollection.--tostring.php |
|
| 875 | - * @return string Returns the full name of this collection. |
|
| 876 | - */ |
|
| 877 | - public function __toString() {} |
|
| 878 | - |
|
| 879 | - /** |
|
| 880 | - * Gets a collection |
|
| 881 | - * @link https://secure.php.net/manual/en/mongocollection.get.php |
|
| 882 | - * @param string $name The next string in the collection name. |
|
| 883 | - * @return MongoCollection |
|
| 884 | - */ |
|
| 885 | - public function __get($name) {} |
|
| 886 | - |
|
| 887 | - /** |
|
| 888 | - * (PECL mongo >= 1.3.0)<br/> |
|
| 889 | - * <p> |
|
| 890 | - * The MongoDB |
|
| 891 | - * {@link https://docs.mongodb.org/manual/applications/aggregation/ aggregation framework} |
|
| 892 | - * provides a means to calculate aggregated values without having to use |
|
| 893 | - * MapReduce. While MapReduce is powerful, it is often more difficult than |
|
| 894 | - * necessary for many simple aggregation tasks, such as totaling or averaging |
|
| 895 | - * field values. |
|
| 896 | - * </p> |
|
| 897 | - * <p> |
|
| 898 | - * This method accepts either a variable amount of pipeline operators, or a |
|
| 899 | - * single array of operators constituting the pipeline. |
|
| 900 | - * </p> |
|
| 901 | - * @link https://secure.php.net/manual/en/mongocollection.aggregate.php |
|
| 902 | - * @param array $pipeline <p> An array of pipeline operators, or just the first operator. </p> |
|
| 903 | - * @param array $op [optional] <p> The second pipeline operator.</p> |
|
| 904 | - * @param array $pipelineOperators [optional] <p> Additional pipeline operators. </p> |
|
| 905 | - * @return array The result of the aggregation as an array. The ok will be set to 1 on success, 0 on failure. |
|
| 906 | - */ |
|
| 907 | - public function aggregate(array $pipeline, array $op, array $pipelineOperators) {} |
|
| 908 | - |
|
| 909 | - /** |
|
| 910 | - * (PECL mongo >= 1.5.0)<br/> |
|
| 911 | - * |
|
| 912 | - * <p> |
|
| 913 | - * With this method you can execute Aggregation Framework pipelines and retrieve the results |
|
| 914 | - * through a cursor, instead of getting just one document back as you would with |
|
| 915 | - * {@link https://php.net/manual/en/mongocollection.aggregate.php MongoCollection::aggregate()}. |
|
| 916 | - * This method returns a {@link https://php.net/manual/en/class.mongocommandcursor.php MongoCommandCursor} object. |
|
| 917 | - * This cursor object implements the {@link https://php.net/manual/en/class.iterator.php Iterator} interface |
|
| 918 | - * just like the {@link https://php.net/manual/en/class.mongocursor.php MongoCursor} objects that are returned |
|
| 919 | - * by the {@link https://php.net/manual/en/mongocollection.find.php MongoCollection::find()} method |
|
| 920 | - * </p> |
|
| 921 | - * |
|
| 922 | - * @link https://php.net/manual/en/mongocollection.aggregatecursor.php |
|
| 923 | - * |
|
| 924 | - * @param array $pipeline <p> The Aggregation Framework pipeline to execute. </p> |
|
| 925 | - * @param array $options [optional] <p> Options for the aggregation command </p> |
|
| 926 | - * |
|
| 927 | - * @return MongoCommandCursor Returns a {@link https://php.net/manual/en/class.mongocommandcursor.php MongoCommandCursor} object |
|
| 928 | - */ |
|
| 929 | - public function aggregateCursor(array $pipeline, array $options) {} |
|
| 930 | - |
|
| 931 | - /** |
|
| 932 | - * Returns this collection's name |
|
| 933 | - * @link https://secure.php.net/manual/en/mongocollection.getname.php |
|
| 934 | - * @return string |
|
| 935 | - */ |
|
| 936 | - public function getName() {} |
|
| 937 | - |
|
| 938 | - /** |
|
| 939 | - * (PECL mongo >= 1.1.0)<br/> |
|
| 940 | - * <p> |
|
| 941 | - * See {@link https://secure.php.net/manual/en/mongo.queries.php the query section} of this manual for |
|
| 942 | - * information on distributing reads to secondaries. |
|
| 943 | - * </p> |
|
| 944 | - * @link https://secure.php.net/manual/en/mongocollection.getslaveokay.php |
|
| 945 | - * @return bool Returns the value of slaveOkay for this instance. |
|
| 946 | - */ |
|
| 947 | - public function getSlaveOkay() {} |
|
| 948 | - |
|
| 949 | - /** |
|
| 950 | - * (PECL mongo >= 1.1.0)<br/> |
|
| 951 | - * <p> |
|
| 952 | - * See {@link https://secure.php.net/manual/en/mongo.queries.php the query section} of this manual for |
|
| 953 | - * information on distributing reads to secondaries. |
|
| 954 | - * </p> |
|
| 955 | - * @link https://secure.php.net/manual/en/mongocollection.setslaveokay.php |
|
| 956 | - * @param bool $ok [optional] <p> |
|
| 957 | - * If reads should be sent to secondary members of a replica set for all |
|
| 958 | - * possible queries using this {@link https://secure.php.net/manual/en/class.mongocollection.php MongoCollection} |
|
| 959 | - * instance. |
|
| 960 | - * @return bool Returns the former value of slaveOkay for this instance. |
|
| 961 | - * </p> |
|
| 962 | - */ |
|
| 963 | - public function setSlaveOkay($ok = true) {} |
|
| 964 | - |
|
| 965 | - /** |
|
| 966 | - * (PECL mongo >= 1.3.0)<br/> |
|
| 967 | - * @link https://secure.php.net/manual/en/mongocollection.getreadpreference.php |
|
| 968 | - * @return array This function returns an array describing the read preference. The array contains the values <em>type</em> for the string read preference mode |
|
| 969 | - * (corresponding to the {@link https://secure.php.net/manual/en/class.mongoclient.php MongoClient} constants), and <em>tagsets</em> containing a list of all tag set criteria. If no tag sets were specified, <em>tagsets</em> will not be present in the array. |
|
| 970 | - */ |
|
| 971 | - public function getReadPreference() {} |
|
| 972 | - |
|
| 973 | - /** |
|
| 974 | - * (PECL mongo >= 1.3.0)<br/> |
|
| 975 | - * @param string $read_preference <p>The read preference mode: <b>MongoClient::RP_PRIMARY</b>, <b>MongoClient::RP_PRIMARY_PREFERRED</b>, <b>MongoClient::RP_SECONDARY</b>, <b>MongoClient::RP_SECONDARY_PREFERRED</b>, or <b>MongoClient::RP_NEAREST</b>.</p> |
|
| 976 | - * @param array $tags [optional] <p>An array of zero or more tag sets, where each tag set is itself an array of criteria used to match tags on replica set members.<p> |
|
| 977 | - * @return bool Returns <b>TRUE</b> on success, or <b>FALSE</b> otherwise. |
|
| 978 | - */ |
|
| 979 | - public function setReadPreference($read_preference, array $tags) {} |
|
| 980 | - |
|
| 981 | - /** |
|
| 982 | - * Drops this collection |
|
| 983 | - * @link https://secure.php.net/manual/en/mongocollection.drop.php |
|
| 984 | - * @return array Returns the database response. |
|
| 985 | - */ |
|
| 986 | - public function drop() {} |
|
| 987 | - |
|
| 988 | - /** |
|
| 989 | - * Validates this collection |
|
| 990 | - * @link https://secure.php.net/manual/en/mongocollection.validate.php |
|
| 991 | - * @param bool $scan_data Only validate indices, not the base collection. |
|
| 992 | - * @return array Returns the database's evaluation of this object. |
|
| 993 | - */ |
|
| 994 | - public function validate($scan_data = false) {} |
|
| 995 | - |
|
| 996 | - /** |
|
| 997 | - * Inserts an array into the collection |
|
| 998 | - * @link https://secure.php.net/manual/en/mongocollection.insert.php |
|
| 999 | - * @param array|object $a An array or object. If an object is used, it may not have protected or private properties. |
|
| 1000 | - * Note: If the parameter does not have an _id key or property, a new MongoId instance will be created and assigned to it. |
|
| 1001 | - * This special behavior does not mean that the parameter is passed by reference. |
|
| 1002 | - * @param array $options Options for the insert. |
|
| 1003 | - * <dl> |
|
| 1004 | - * <dt>"w"</dt> |
|
| 1005 | - * <dd>See WriteConcerns. The default value for MongoClient is 1.</dd> |
|
| 1006 | - * <dt>"fsync"</dt> |
|
| 1007 | - * <dd>Boolean, defaults to FALSE. Forces the insert to be synced to disk before returning success. If TRUE, an acknowledged insert is implied and will override setting w to 0.</dd> |
|
| 1008 | - * <dt>"timeout"</dt> |
|
| 1009 | - * <dd>Integer, defaults to MongoCursor::$timeout. If "safe" is set, this sets how long (in milliseconds) for the client to wait for a database response. If the database does not respond within the timeout period, a MongoCursorTimeoutException will be thrown.</dd> |
|
| 1010 | - * <dt>"safe"</dt> |
|
| 1011 | - * <dd>Deprecated. Please use the WriteConcern w option.</dd> |
|
| 1012 | - * </dl> |
|
| 1013 | - * @throws MongoException if the inserted document is empty or if it contains zero-length keys. Attempting to insert an object with protected and private properties will cause a zero-length key error. |
|
| 1014 | - * @throws MongoCursorException if the "w" option is set and the write fails. |
|
| 1015 | - * @throws MongoCursorTimeoutException if the "w" option is set to a value greater than one and the operation takes longer than MongoCursor::$timeout milliseconds to complete. This does not kill the operation on the server, it is a client-side timeout. The operation in MongoCollection::$wtimeout is milliseconds. |
|
| 1016 | - * @return bool|array Returns an array containing the status of the insertion if the "w" option is set. |
|
| 1017 | - * Otherwise, returns TRUE if the inserted array is not empty (a MongoException will be thrown if the inserted array is empty). |
|
| 1018 | - * If an array is returned, the following keys may be present: |
|
| 1019 | - * <dl> |
|
| 1020 | - * <dt>ok</dt> |
|
| 1021 | - * <dd>This should almost be 1 (unless last_error itself failed).</dd> |
|
| 1022 | - * <dt>err</dt> |
|
| 1023 | - * <dd>If this field is non-null, an error occurred on the previous operation. If this field is set, it will be a string describing the error that occurred.</dd> |
|
| 1024 | - * <dt>code</dt> |
|
| 1025 | - * <dd>If a database error occurred, the relevant error code will be passed back to the client.</dd> |
|
| 1026 | - * <dt>errmsg</dt> |
|
| 1027 | - * <dd>This field is set if something goes wrong with a database command. It is coupled with ok being 0. For example, if w is set and times out, errmsg will be set to "timed out waiting for slaves" and ok will be 0. If this field is set, it will be a string describing the error that occurred.</dd> |
|
| 1028 | - * <dt>n</dt> |
|
| 1029 | - * <dd>If the last operation was an update, upsert, or a remove, the number of documents affected will be returned. For insert operations, this value is always 0.</dd> |
|
| 1030 | - * <dt>wtimeout</dt> |
|
| 1031 | - * <dd>If the previous option timed out waiting for replication.</dd> |
|
| 1032 | - * <dt>waited</dt> |
|
| 1033 | - * <dd>How long the operation waited before timing out.</dd> |
|
| 1034 | - * <dt>wtime</dt> |
|
| 1035 | - * <dd>If w was set and the operation succeeded, how long it took to replicate to w servers.</dd> |
|
| 1036 | - * <dt>upserted</dt> |
|
| 1037 | - * <dd>If an upsert occurred, this field will contain the new record's _id field. For upserts, either this field or updatedExisting will be present (unless an error occurred).</dd> |
|
| 1038 | - * <dt>updatedExisting</dt> |
|
| 1039 | - * <dd>If an upsert updated an existing element, this field will be true. For upserts, either this field or upserted will be present (unless an error occurred).</dd> |
|
| 1040 | - * </dl> |
|
| 1041 | - */ |
|
| 1042 | - public function insert($a, array $options = []) {} |
|
| 1043 | - |
|
| 1044 | - /** |
|
| 1045 | - * Inserts multiple documents into this collection |
|
| 1046 | - * @link https://secure.php.net/manual/en/mongocollection.batchinsert.php |
|
| 1047 | - * @param array $a An array of arrays. |
|
| 1048 | - * @param array $options Options for the inserts. |
|
| 1049 | - * @throws MongoCursorException |
|
| 1050 | - * @return array|bool if "safe" is set, returns an associative array with the status of the inserts ("ok") and any error that may have occurred ("err"). Otherwise, returns TRUE if the batch insert was successfully sent, FALSE otherwise. |
|
| 1051 | - */ |
|
| 1052 | - public function batchInsert(array $a, array $options = []) {} |
|
| 1053 | - |
|
| 1054 | - /** |
|
| 1055 | - * Update records based on a given criteria |
|
| 1056 | - * @link https://secure.php.net/manual/en/mongocollection.update.php |
|
| 1057 | - * @param array $criteria Description of the objects to update. |
|
| 1058 | - * @param array $newobj The object with which to update the matching records. |
|
| 1059 | - * @param array $options This parameter is an associative array of the form |
|
| 1060 | - * array("optionname" => boolean, ...). |
|
| 1061 | - * |
|
| 1062 | - * Currently supported options are: |
|
| 1063 | - * "upsert": If no document matches $$criteria, a new document will be created from $$criteria and $$new_object (see upsert example). |
|
| 1064 | - * |
|
| 1065 | - * "multiple": All documents matching $criteria will be updated. MongoCollection::update has exactly the opposite behavior of MongoCollection::remove- it updates one document by |
|
| 1066 | - * default, not all matching documents. It is recommended that you always specify whether you want to update multiple documents or a single document, as the |
|
| 1067 | - * database may change its default behavior at some point in the future. |
|
| 1068 | - * |
|
| 1069 | - * "safe" Can be a boolean or integer, defaults to false. If false, the program continues executing without waiting for a database response. If true, the program will wait for |
|
| 1070 | - * the database response and throw a MongoCursorException if the update did not succeed. If you are using replication and the master has changed, using "safe" will make the driver |
|
| 1071 | - * disconnect from the master, throw and exception, and attempt to find a new master on the next operation (your application must decide whether or not to retry the operation on the new master). |
|
| 1072 | - * If you do not use "safe" with a replica set and the master changes, there will be no way for the driver to know about the change so it will continuously and silently fail to write. |
|
| 1073 | - * If safe is an integer, will replicate the update to that many machines before returning success (or throw an exception if the replication times out, see wtimeout). |
|
| 1074 | - * This overrides the w variable set on the collection. |
|
| 1075 | - * |
|
| 1076 | - * "fsync": Boolean, defaults to false. Forces the update to be synced to disk before returning success. If true, a safe update is implied and will override setting safe to false. |
|
| 1077 | - * |
|
| 1078 | - * "timeout" Integer, defaults to MongoCursor::$timeout. If "safe" is set, this sets how long (in milliseconds) for the client to wait for a database response. If the database does |
|
| 1079 | - * not respond within the timeout period, a MongoCursorTimeoutException will be thrown |
|
| 1080 | - * @throws MongoCursorException |
|
| 1081 | - * @return bool |
|
| 1082 | - */ |
|
| 1083 | - public function update(array $criteria, array $newobj, array $options = []) {} |
|
| 1084 | - |
|
| 1085 | - /** |
|
| 1086 | - * (PECL mongo >= 0.9.0)<br/> |
|
| 1087 | - * Remove records from this collection |
|
| 1088 | - * @link https://secure.php.net/manual/en/mongocollection.remove.php |
|
| 1089 | - * @param array $criteria [optional] <p>Query criteria for the documents to delete.</p> |
|
| 1090 | - * @param array $options [optional] <p>An array of options for the remove operation. Currently available options |
|
| 1091 | - * include: |
|
| 1092 | - * </p><ul> |
|
| 1093 | - * <li><p><em>"w"</em></p><p>See {@link https://secure.php.net/manual/en/mongo.writeconcerns.php Write Concerns}. The default value for <b>MongoClient</b> is <em>1</em>.</p></li> |
|
| 1094 | - * <li> |
|
| 1095 | - * <p> |
|
| 1096 | - * <em>"justOne"</em> |
|
| 1097 | - * </p> |
|
| 1098 | - * <p> |
|
| 1099 | - * Specify <strong><code>TRUE</code></strong> to limit deletion to just one document. If <strong><code>FALSE</code></strong> or |
|
| 1100 | - * omitted, all documents matching the criteria will be deleted. |
|
| 1101 | - * </p> |
|
| 1102 | - * </li> |
|
| 1103 | - * <li><p><em>"fsync"</em></p><p>Boolean, defaults to <b>FALSE</b>. If journaling is enabled, it works exactly like <em>"j"</em>. If journaling is not enabled, the write operation blocks until it is synced to database files on disk. If <strong><code>TRUE</code></strong>, an acknowledged insert is implied and this option will override setting <em>"w"</em> to <em>0</em>.</p><blockquote class="note"><p><strong class="note">Note</strong>: <span class="simpara">If journaling is enabled, users are strongly encouraged to use the <em>"j"</em> option instead of <em>"fsync"</em>. Do not use <em>"fsync"</em> and <em>"j"</em> simultaneously, as that will result in an error.</p></blockquote></li> |
|
| 1104 | - * <li><p><em>"j"</em></p><p>Boolean, defaults to <b>FALSE</b>. Forces the write operation to block until it is synced to the journal on disk. If <strong><code>TRUE</code></strong>, an acknowledged write is implied and this option will override setting <em>"w"</em> to <em>0</em>.</p><blockquote class="note"><p><strong class="note">Note</strong>: <span class="simpara">If this option is used and journaling is disabled, MongoDB 2.6+ will raise an error and the write will fail; older server versions will simply ignore the option.</p></blockquote></li> |
|
| 1105 | - * <li><p><em>"socketTimeoutMS"</em></p><p>This option specifies the time limit, in milliseconds, for socket communication. If the server does not respond within the timeout period, a <b>MongoCursorTimeoutException</b> will be thrown and there will be no way to determine if the server actually handled the write or not. A value of <em>-1</em> may be specified to block indefinitely. The default value for <b>MongoClient</b> is <em>30000</em> (30 seconds).</p></li> |
|
| 1106 | - * <li><p><em>"w"</em></p><p>See {@link https://secure.php.net/manual/en/mongo.writeconcerns.php Write Concerns}. The default value for <b>MongoClient</b> is <em>1</em>.</p></li> |
|
| 1107 | - * <li><p><em>"wTimeoutMS"</em></p><p>This option specifies the time limit, in milliseconds, for {@link https://secure.php.net/manual/en/mongo.writeconcerns.php write concern} acknowledgement. It is only applicable when <em>"w"</em> is greater than <em>1</em>, as the timeout pertains to replication. If the write concern is not satisfied within the time limit, a <a href="class.mongocursorexception.php" class="classname">MongoCursorException</a> will be thrown. A value of <em>0</em> may be specified to block indefinitely. The default value for {@link https://secure.php.net/manual/en/class.mongoclient.php MongoClient} is <em>10000</em> (ten seconds).</p></li> |
|
| 1108 | - * </ul> |
|
| 1109 | - * |
|
| 1110 | - * <p> |
|
| 1111 | - * The following options are deprecated and should no longer be used: |
|
| 1112 | - * </p><ul> |
|
| 1113 | - * <li><p><em>"safe"</em></p><p>Deprecated. Please use the {@link https://secure.php.net/manual/en/mongo.writeconcerns.php write concern} <em>"w"</em> option.</p></li> |
|
| 1114 | - * <li><p><em>"timeout"</em></p><p>Deprecated alias for <em>"socketTimeoutMS"</em>.</p></li> |
|
| 1115 | - * <li><p><b>"wtimeout"</b></p><p>Deprecated alias for <em>"wTimeoutMS"</em>.</p></li></ul> |
|
| 1116 | - * @throws MongoCursorException |
|
| 1117 | - * @throws MongoCursorTimeoutException |
|
| 1118 | - * @return bool|array <p>Returns an array containing the status of the removal if the |
|
| 1119 | - * <em>"w"</em> option is set. Otherwise, returns <b>TRUE</b>. |
|
| 1120 | - * </p> |
|
| 1121 | - * <p> |
|
| 1122 | - * Fields in the status array are described in the documentation for |
|
| 1123 | - * <b>MongoCollection::insert()</b>. |
|
| 1124 | - * </p> |
|
| 1125 | - */ |
|
| 1126 | - public function remove(array $criteria = [], array $options = []) {} |
|
| 1127 | - |
|
| 1128 | - /** |
|
| 1129 | - * Querys this collection |
|
| 1130 | - * @link https://secure.php.net/manual/en/mongocollection.find.php |
|
| 1131 | - * @param array $query The fields for which to search. |
|
| 1132 | - * @param array $fields Fields of the results to return. |
|
| 1133 | - * @return MongoCursor |
|
| 1134 | - */ |
|
| 1135 | - public function find(array $query = [], array $fields = []) {} |
|
| 1136 | - |
|
| 1137 | - /** |
|
| 1138 | - * Retrieve a list of distinct values for the given key across a collection |
|
| 1139 | - * @link https://secure.php.net/manual/en/mongocollection.distinct.php |
|
| 1140 | - * @param string $key The key to use. |
|
| 1141 | - * @param array $query An optional query parameters |
|
| 1142 | - * @return array|false Returns an array of distinct values, or <b>FALSE</b> on failure |
|
| 1143 | - */ |
|
| 1144 | - public function distinct($key, array $query = null) {} |
|
| 1145 | - |
|
| 1146 | - /** |
|
| 1147 | - * Update a document and return it |
|
| 1148 | - * @link https://secure.php.net/manual/en/mongocollection.findandmodify.php |
|
| 1149 | - * @param array $query The query criteria to search for. |
|
| 1150 | - * @param array $update The update criteria. |
|
| 1151 | - * @param array $fields Optionally only return these fields. |
|
| 1152 | - * @param array $options An array of options to apply, such as remove the match document from the DB and return it. |
|
| 1153 | - * @return array Returns the original document, or the modified document when new is set. |
|
| 1154 | - */ |
|
| 1155 | - public function findAndModify(array $query, array $update = null, array $fields = null, array $options = null) {} |
|
| 1156 | - |
|
| 1157 | - /** |
|
| 1158 | - * Querys this collection, returning a single element |
|
| 1159 | - * @link https://secure.php.net/manual/en/mongocollection.findone.php |
|
| 1160 | - * @param array $query The fields for which to search. |
|
| 1161 | - * @param array $fields Fields of the results to return. |
|
| 1162 | - * @param array $options This parameter is an associative array of the form array("name" => `<value>`, ...). |
|
| 1163 | - * @return array|null |
|
| 1164 | - */ |
|
| 1165 | - public function findOne(array $query = [], array $fields = [], array $options = []) {} |
|
| 1166 | - |
|
| 1167 | - /** |
|
| 1168 | - * Creates an index on the given field(s), or does nothing if the index already exists |
|
| 1169 | - * @link https://secure.php.net/manual/en/mongocollection.createindex.php |
|
| 1170 | - * @param array $keys Field or fields to use as index. |
|
| 1171 | - * @param array $options [optional] This parameter is an associative array of the form array("optionname" => `<boolean>`, ...). |
|
| 1172 | - * @return array Returns the database response. |
|
| 1173 | - */ |
|
| 1174 | - public function createIndex(array $keys, array $options = []) {} |
|
| 1175 | - |
|
| 1176 | - /** |
|
| 1177 | - * Creates an index on the given field(s), or does nothing if the index already exists |
|
| 1178 | - * @link https://secure.php.net/manual/en/mongocollection.ensureindex.php |
|
| 1179 | - * @param array $keys Field or fields to use as index. |
|
| 1180 | - * @param array $options [optional] This parameter is an associative array of the form array("optionname" => `<boolean>`, ...). |
|
| 1181 | - * @return true always true |
|
| 1182 | - * @see MongoCollection::createIndex() |
|
| 1183 | - */ |
|
| 1184 | - #[Deprecated('Use MongoCollection::createIndex() instead.')] |
|
| 1185 | - public function ensureIndex(array $keys, array $options = []) {} |
|
| 1186 | - |
|
| 1187 | - /** |
|
| 1188 | - * Deletes an index from this collection |
|
| 1189 | - * @link https://secure.php.net/manual/en/mongocollection.deleteindex.php |
|
| 1190 | - * @param string|array $keys Field or fields from which to delete the index. |
|
| 1191 | - * @return array Returns the database response. |
|
| 1192 | - */ |
|
| 1193 | - public function deleteIndex($keys) {} |
|
| 1194 | - |
|
| 1195 | - /** |
|
| 1196 | - * Delete all indexes for this collection |
|
| 1197 | - * @link https://secure.php.net/manual/en/mongocollection.deleteindexes.php |
|
| 1198 | - * @return array Returns the database response. |
|
| 1199 | - */ |
|
| 1200 | - public function deleteIndexes() {} |
|
| 1201 | - |
|
| 1202 | - /** |
|
| 1203 | - * Returns an array of index names for this collection |
|
| 1204 | - * @link https://secure.php.net/manual/en/mongocollection.getindexinfo.php |
|
| 1205 | - * @return array Returns a list of index names. |
|
| 1206 | - */ |
|
| 1207 | - public function getIndexInfo() {} |
|
| 1208 | - |
|
| 1209 | - /** |
|
| 1210 | - * Counts the number of documents in this collection |
|
| 1211 | - * @link https://secure.php.net/manual/en/mongocollection.count.php |
|
| 1212 | - * @param array|stdClass $query |
|
| 1213 | - * @return int Returns the number of documents matching the query. |
|
| 1214 | - */ |
|
| 1215 | - public function count($query = []) {} |
|
| 1216 | - |
|
| 1217 | - /** |
|
| 1218 | - * Saves an object to this collection |
|
| 1219 | - * @link https://secure.php.net/manual/en/mongocollection.save.php |
|
| 1220 | - * @param array|object $a Array to save. If an object is used, it may not have protected or private properties. |
|
| 1221 | - * Note: If the parameter does not have an _id key or property, a new MongoId instance will be created and assigned to it. |
|
| 1222 | - * See MongoCollection::insert() for additional information on this behavior. |
|
| 1223 | - * @param array $options Options for the save. |
|
| 1224 | - * <dl> |
|
| 1225 | - * <dt>"w" |
|
| 1226 | - * <dd>See WriteConcerns. The default value for MongoClient is 1. |
|
| 1227 | - * <dt>"fsync" |
|
| 1228 | - * <dd>Boolean, defaults to FALSE. Forces the insert to be synced to disk before returning success. If TRUE, an acknowledged insert is implied and will override setting w to 0. |
|
| 1229 | - * <dt>"timeout" |
|
| 1230 | - * <dd>Integer, defaults to MongoCursor::$timeout. If "safe" is set, this sets how long (in milliseconds) for the client to wait for a database response. If the database does not respond within the timeout period, a MongoCursorTimeoutException will be thrown. |
|
| 1231 | - * <dt>"safe" |
|
| 1232 | - * <dd>Deprecated. Please use the WriteConcern w option. |
|
| 1233 | - * </dl> |
|
| 1234 | - * @throws MongoException if the inserted document is empty or if it contains zero-length keys. Attempting to insert an object with protected and private properties will cause a zero-length key error. |
|
| 1235 | - * @throws MongoCursorException if the "w" option is set and the write fails. |
|
| 1236 | - * @throws MongoCursorTimeoutException if the "w" option is set to a value greater than one and the operation takes longer than MongoCursor::$timeout milliseconds to complete. This does not kill the operation on the server, it is a client-side timeout. The operation in MongoCollection::$wtimeout is milliseconds. |
|
| 1237 | - * @return array|bool If w was set, returns an array containing the status of the save. |
|
| 1238 | - * Otherwise, returns a boolean representing if the array was not empty (an empty array will not be inserted). |
|
| 1239 | - */ |
|
| 1240 | - public function save($a, array $options = []) {} |
|
| 1241 | - |
|
| 1242 | - /** |
|
| 1243 | - * Creates a database reference |
|
| 1244 | - * @link https://secure.php.net/manual/en/mongocollection.createdbref.php |
|
| 1245 | - * @param array $a Object to which to create a reference. |
|
| 1246 | - * @return array Returns a database reference array. |
|
| 1247 | - */ |
|
| 1248 | - public function createDBRef(array $a) {} |
|
| 1249 | - |
|
| 1250 | - /** |
|
| 1251 | - * Fetches the document pointed to by a database reference |
|
| 1252 | - * @link https://secure.php.net/manual/en/mongocollection.getdbref.php |
|
| 1253 | - * @param array $ref A database reference. |
|
| 1254 | - * @return array Returns the database document pointed to by the reference. |
|
| 1255 | - */ |
|
| 1256 | - public function getDBRef(array $ref) {} |
|
| 1257 | - |
|
| 1258 | - /** |
|
| 1259 | - * @param mixed $keys |
|
| 1260 | - * @return string |
|
| 1261 | - */ |
|
| 1262 | - protected static function toIndexString($keys) {} |
|
| 1263 | - |
|
| 1264 | - /** |
|
| 1265 | - * Performs an operation similar to SQL's GROUP BY command |
|
| 1266 | - * @link https://secure.php.net/manual/en/mongocollection.group.php |
|
| 1267 | - * @param mixed $keys Fields to group by. If an array or non-code object is passed, it will be the key used to group results. |
|
| 1268 | - * @param array $initial Initial value of the aggregation counter object. |
|
| 1269 | - * @param MongoCode $reduce A function that aggregates (reduces) the objects iterated. |
|
| 1270 | - * @param array $condition An condition that must be true for a row to be considered. |
|
| 1271 | - * @return array |
|
| 1272 | - */ |
|
| 1273 | - public function group($keys, array $initial, MongoCode $reduce, array $condition = []) {} |
|
| 828 | + /** |
|
| 829 | + * @link https://php.net/manual/en/class.mongocollection.php#mongocollection.constants.ascending |
|
| 830 | + */ |
|
| 831 | + public const ASCENDING = 1; |
|
| 832 | + |
|
| 833 | + /** |
|
| 834 | + * @link https://php.net/manual/en/class.mongocollection.php#mongocollection.constants.descending |
|
| 835 | + */ |
|
| 836 | + public const DESCENDING = -1; |
|
| 837 | + |
|
| 838 | + /** |
|
| 839 | + * @var MongoDB |
|
| 840 | + */ |
|
| 841 | + public $db = null; |
|
| 842 | + |
|
| 843 | + /** |
|
| 844 | + * @var int <p> |
|
| 845 | + * The number of servers to replicate a change to before returning success. |
|
| 846 | + * Value is inherited from the parent database. The |
|
| 847 | + * {@link https://secure.php.net/manual/en/class.mongodb.php MongoDB} class has a more detailed description of |
|
| 848 | + * how <em>w</em> works. |
|
| 849 | + * </p> |
|
| 850 | + */ |
|
| 851 | + public $w; |
|
| 852 | + |
|
| 853 | + /** |
|
| 854 | + * @var int <p> |
|
| 855 | + * The number of milliseconds to wait for <em>$this->w</em> |
|
| 856 | + * replications to take place. Value is inherited from the parent database. |
|
| 857 | + * The {@link https://secure.php.net/manual/en/class.mongodb.php MongoDB} class has a more detailed description |
|
| 858 | + * of how <em>wtimeout</em> works. |
|
| 859 | + * </p> |
|
| 860 | + */ |
|
| 861 | + public $wtimeout; |
|
| 862 | + |
|
| 863 | + /** |
|
| 864 | + * Creates a new collection |
|
| 865 | + * @link https://secure.php.net/manual/en/mongocollection.construct.php |
|
| 866 | + * @param MongoDB $db Parent database. |
|
| 867 | + * @param string $name Name for this collection. |
|
| 868 | + * @throws Exception |
|
| 869 | + */ |
|
| 870 | + public function __construct(MongoDB $db, $name) {} |
|
| 871 | + |
|
| 872 | + /** |
|
| 873 | + * String representation of this collection |
|
| 874 | + * @link https://secure.php.net/manual/en/mongocollection.--tostring.php |
|
| 875 | + * @return string Returns the full name of this collection. |
|
| 876 | + */ |
|
| 877 | + public function __toString() {} |
|
| 878 | + |
|
| 879 | + /** |
|
| 880 | + * Gets a collection |
|
| 881 | + * @link https://secure.php.net/manual/en/mongocollection.get.php |
|
| 882 | + * @param string $name The next string in the collection name. |
|
| 883 | + * @return MongoCollection |
|
| 884 | + */ |
|
| 885 | + public function __get($name) {} |
|
| 886 | + |
|
| 887 | + /** |
|
| 888 | + * (PECL mongo >= 1.3.0)<br/> |
|
| 889 | + * <p> |
|
| 890 | + * The MongoDB |
|
| 891 | + * {@link https://docs.mongodb.org/manual/applications/aggregation/ aggregation framework} |
|
| 892 | + * provides a means to calculate aggregated values without having to use |
|
| 893 | + * MapReduce. While MapReduce is powerful, it is often more difficult than |
|
| 894 | + * necessary for many simple aggregation tasks, such as totaling or averaging |
|
| 895 | + * field values. |
|
| 896 | + * </p> |
|
| 897 | + * <p> |
|
| 898 | + * This method accepts either a variable amount of pipeline operators, or a |
|
| 899 | + * single array of operators constituting the pipeline. |
|
| 900 | + * </p> |
|
| 901 | + * @link https://secure.php.net/manual/en/mongocollection.aggregate.php |
|
| 902 | + * @param array $pipeline <p> An array of pipeline operators, or just the first operator. </p> |
|
| 903 | + * @param array $op [optional] <p> The second pipeline operator.</p> |
|
| 904 | + * @param array $pipelineOperators [optional] <p> Additional pipeline operators. </p> |
|
| 905 | + * @return array The result of the aggregation as an array. The ok will be set to 1 on success, 0 on failure. |
|
| 906 | + */ |
|
| 907 | + public function aggregate(array $pipeline, array $op, array $pipelineOperators) {} |
|
| 908 | + |
|
| 909 | + /** |
|
| 910 | + * (PECL mongo >= 1.5.0)<br/> |
|
| 911 | + * |
|
| 912 | + * <p> |
|
| 913 | + * With this method you can execute Aggregation Framework pipelines and retrieve the results |
|
| 914 | + * through a cursor, instead of getting just one document back as you would with |
|
| 915 | + * {@link https://php.net/manual/en/mongocollection.aggregate.php MongoCollection::aggregate()}. |
|
| 916 | + * This method returns a {@link https://php.net/manual/en/class.mongocommandcursor.php MongoCommandCursor} object. |
|
| 917 | + * This cursor object implements the {@link https://php.net/manual/en/class.iterator.php Iterator} interface |
|
| 918 | + * just like the {@link https://php.net/manual/en/class.mongocursor.php MongoCursor} objects that are returned |
|
| 919 | + * by the {@link https://php.net/manual/en/mongocollection.find.php MongoCollection::find()} method |
|
| 920 | + * </p> |
|
| 921 | + * |
|
| 922 | + * @link https://php.net/manual/en/mongocollection.aggregatecursor.php |
|
| 923 | + * |
|
| 924 | + * @param array $pipeline <p> The Aggregation Framework pipeline to execute. </p> |
|
| 925 | + * @param array $options [optional] <p> Options for the aggregation command </p> |
|
| 926 | + * |
|
| 927 | + * @return MongoCommandCursor Returns a {@link https://php.net/manual/en/class.mongocommandcursor.php MongoCommandCursor} object |
|
| 928 | + */ |
|
| 929 | + public function aggregateCursor(array $pipeline, array $options) {} |
|
| 930 | + |
|
| 931 | + /** |
|
| 932 | + * Returns this collection's name |
|
| 933 | + * @link https://secure.php.net/manual/en/mongocollection.getname.php |
|
| 934 | + * @return string |
|
| 935 | + */ |
|
| 936 | + public function getName() {} |
|
| 937 | + |
|
| 938 | + /** |
|
| 939 | + * (PECL mongo >= 1.1.0)<br/> |
|
| 940 | + * <p> |
|
| 941 | + * See {@link https://secure.php.net/manual/en/mongo.queries.php the query section} of this manual for |
|
| 942 | + * information on distributing reads to secondaries. |
|
| 943 | + * </p> |
|
| 944 | + * @link https://secure.php.net/manual/en/mongocollection.getslaveokay.php |
|
| 945 | + * @return bool Returns the value of slaveOkay for this instance. |
|
| 946 | + */ |
|
| 947 | + public function getSlaveOkay() {} |
|
| 948 | + |
|
| 949 | + /** |
|
| 950 | + * (PECL mongo >= 1.1.0)<br/> |
|
| 951 | + * <p> |
|
| 952 | + * See {@link https://secure.php.net/manual/en/mongo.queries.php the query section} of this manual for |
|
| 953 | + * information on distributing reads to secondaries. |
|
| 954 | + * </p> |
|
| 955 | + * @link https://secure.php.net/manual/en/mongocollection.setslaveokay.php |
|
| 956 | + * @param bool $ok [optional] <p> |
|
| 957 | + * If reads should be sent to secondary members of a replica set for all |
|
| 958 | + * possible queries using this {@link https://secure.php.net/manual/en/class.mongocollection.php MongoCollection} |
|
| 959 | + * instance. |
|
| 960 | + * @return bool Returns the former value of slaveOkay for this instance. |
|
| 961 | + * </p> |
|
| 962 | + */ |
|
| 963 | + public function setSlaveOkay($ok = true) {} |
|
| 964 | + |
|
| 965 | + /** |
|
| 966 | + * (PECL mongo >= 1.3.0)<br/> |
|
| 967 | + * @link https://secure.php.net/manual/en/mongocollection.getreadpreference.php |
|
| 968 | + * @return array This function returns an array describing the read preference. The array contains the values <em>type</em> for the string read preference mode |
|
| 969 | + * (corresponding to the {@link https://secure.php.net/manual/en/class.mongoclient.php MongoClient} constants), and <em>tagsets</em> containing a list of all tag set criteria. If no tag sets were specified, <em>tagsets</em> will not be present in the array. |
|
| 970 | + */ |
|
| 971 | + public function getReadPreference() {} |
|
| 972 | + |
|
| 973 | + /** |
|
| 974 | + * (PECL mongo >= 1.3.0)<br/> |
|
| 975 | + * @param string $read_preference <p>The read preference mode: <b>MongoClient::RP_PRIMARY</b>, <b>MongoClient::RP_PRIMARY_PREFERRED</b>, <b>MongoClient::RP_SECONDARY</b>, <b>MongoClient::RP_SECONDARY_PREFERRED</b>, or <b>MongoClient::RP_NEAREST</b>.</p> |
|
| 976 | + * @param array $tags [optional] <p>An array of zero or more tag sets, where each tag set is itself an array of criteria used to match tags on replica set members.<p> |
|
| 977 | + * @return bool Returns <b>TRUE</b> on success, or <b>FALSE</b> otherwise. |
|
| 978 | + */ |
|
| 979 | + public function setReadPreference($read_preference, array $tags) {} |
|
| 980 | + |
|
| 981 | + /** |
|
| 982 | + * Drops this collection |
|
| 983 | + * @link https://secure.php.net/manual/en/mongocollection.drop.php |
|
| 984 | + * @return array Returns the database response. |
|
| 985 | + */ |
|
| 986 | + public function drop() {} |
|
| 987 | + |
|
| 988 | + /** |
|
| 989 | + * Validates this collection |
|
| 990 | + * @link https://secure.php.net/manual/en/mongocollection.validate.php |
|
| 991 | + * @param bool $scan_data Only validate indices, not the base collection. |
|
| 992 | + * @return array Returns the database's evaluation of this object. |
|
| 993 | + */ |
|
| 994 | + public function validate($scan_data = false) {} |
|
| 995 | + |
|
| 996 | + /** |
|
| 997 | + * Inserts an array into the collection |
|
| 998 | + * @link https://secure.php.net/manual/en/mongocollection.insert.php |
|
| 999 | + * @param array|object $a An array or object. If an object is used, it may not have protected or private properties. |
|
| 1000 | + * Note: If the parameter does not have an _id key or property, a new MongoId instance will be created and assigned to it. |
|
| 1001 | + * This special behavior does not mean that the parameter is passed by reference. |
|
| 1002 | + * @param array $options Options for the insert. |
|
| 1003 | + * <dl> |
|
| 1004 | + * <dt>"w"</dt> |
|
| 1005 | + * <dd>See WriteConcerns. The default value for MongoClient is 1.</dd> |
|
| 1006 | + * <dt>"fsync"</dt> |
|
| 1007 | + * <dd>Boolean, defaults to FALSE. Forces the insert to be synced to disk before returning success. If TRUE, an acknowledged insert is implied and will override setting w to 0.</dd> |
|
| 1008 | + * <dt>"timeout"</dt> |
|
| 1009 | + * <dd>Integer, defaults to MongoCursor::$timeout. If "safe" is set, this sets how long (in milliseconds) for the client to wait for a database response. If the database does not respond within the timeout period, a MongoCursorTimeoutException will be thrown.</dd> |
|
| 1010 | + * <dt>"safe"</dt> |
|
| 1011 | + * <dd>Deprecated. Please use the WriteConcern w option.</dd> |
|
| 1012 | + * </dl> |
|
| 1013 | + * @throws MongoException if the inserted document is empty or if it contains zero-length keys. Attempting to insert an object with protected and private properties will cause a zero-length key error. |
|
| 1014 | + * @throws MongoCursorException if the "w" option is set and the write fails. |
|
| 1015 | + * @throws MongoCursorTimeoutException if the "w" option is set to a value greater than one and the operation takes longer than MongoCursor::$timeout milliseconds to complete. This does not kill the operation on the server, it is a client-side timeout. The operation in MongoCollection::$wtimeout is milliseconds. |
|
| 1016 | + * @return bool|array Returns an array containing the status of the insertion if the "w" option is set. |
|
| 1017 | + * Otherwise, returns TRUE if the inserted array is not empty (a MongoException will be thrown if the inserted array is empty). |
|
| 1018 | + * If an array is returned, the following keys may be present: |
|
| 1019 | + * <dl> |
|
| 1020 | + * <dt>ok</dt> |
|
| 1021 | + * <dd>This should almost be 1 (unless last_error itself failed).</dd> |
|
| 1022 | + * <dt>err</dt> |
|
| 1023 | + * <dd>If this field is non-null, an error occurred on the previous operation. If this field is set, it will be a string describing the error that occurred.</dd> |
|
| 1024 | + * <dt>code</dt> |
|
| 1025 | + * <dd>If a database error occurred, the relevant error code will be passed back to the client.</dd> |
|
| 1026 | + * <dt>errmsg</dt> |
|
| 1027 | + * <dd>This field is set if something goes wrong with a database command. It is coupled with ok being 0. For example, if w is set and times out, errmsg will be set to "timed out waiting for slaves" and ok will be 0. If this field is set, it will be a string describing the error that occurred.</dd> |
|
| 1028 | + * <dt>n</dt> |
|
| 1029 | + * <dd>If the last operation was an update, upsert, or a remove, the number of documents affected will be returned. For insert operations, this value is always 0.</dd> |
|
| 1030 | + * <dt>wtimeout</dt> |
|
| 1031 | + * <dd>If the previous option timed out waiting for replication.</dd> |
|
| 1032 | + * <dt>waited</dt> |
|
| 1033 | + * <dd>How long the operation waited before timing out.</dd> |
|
| 1034 | + * <dt>wtime</dt> |
|
| 1035 | + * <dd>If w was set and the operation succeeded, how long it took to replicate to w servers.</dd> |
|
| 1036 | + * <dt>upserted</dt> |
|
| 1037 | + * <dd>If an upsert occurred, this field will contain the new record's _id field. For upserts, either this field or updatedExisting will be present (unless an error occurred).</dd> |
|
| 1038 | + * <dt>updatedExisting</dt> |
|
| 1039 | + * <dd>If an upsert updated an existing element, this field will be true. For upserts, either this field or upserted will be present (unless an error occurred).</dd> |
|
| 1040 | + * </dl> |
|
| 1041 | + */ |
|
| 1042 | + public function insert($a, array $options = []) {} |
|
| 1043 | + |
|
| 1044 | + /** |
|
| 1045 | + * Inserts multiple documents into this collection |
|
| 1046 | + * @link https://secure.php.net/manual/en/mongocollection.batchinsert.php |
|
| 1047 | + * @param array $a An array of arrays. |
|
| 1048 | + * @param array $options Options for the inserts. |
|
| 1049 | + * @throws MongoCursorException |
|
| 1050 | + * @return array|bool if "safe" is set, returns an associative array with the status of the inserts ("ok") and any error that may have occurred ("err"). Otherwise, returns TRUE if the batch insert was successfully sent, FALSE otherwise. |
|
| 1051 | + */ |
|
| 1052 | + public function batchInsert(array $a, array $options = []) {} |
|
| 1053 | + |
|
| 1054 | + /** |
|
| 1055 | + * Update records based on a given criteria |
|
| 1056 | + * @link https://secure.php.net/manual/en/mongocollection.update.php |
|
| 1057 | + * @param array $criteria Description of the objects to update. |
|
| 1058 | + * @param array $newobj The object with which to update the matching records. |
|
| 1059 | + * @param array $options This parameter is an associative array of the form |
|
| 1060 | + * array("optionname" => boolean, ...). |
|
| 1061 | + * |
|
| 1062 | + * Currently supported options are: |
|
| 1063 | + * "upsert": If no document matches $$criteria, a new document will be created from $$criteria and $$new_object (see upsert example). |
|
| 1064 | + * |
|
| 1065 | + * "multiple": All documents matching $criteria will be updated. MongoCollection::update has exactly the opposite behavior of MongoCollection::remove- it updates one document by |
|
| 1066 | + * default, not all matching documents. It is recommended that you always specify whether you want to update multiple documents or a single document, as the |
|
| 1067 | + * database may change its default behavior at some point in the future. |
|
| 1068 | + * |
|
| 1069 | + * "safe" Can be a boolean or integer, defaults to false. If false, the program continues executing without waiting for a database response. If true, the program will wait for |
|
| 1070 | + * the database response and throw a MongoCursorException if the update did not succeed. If you are using replication and the master has changed, using "safe" will make the driver |
|
| 1071 | + * disconnect from the master, throw and exception, and attempt to find a new master on the next operation (your application must decide whether or not to retry the operation on the new master). |
|
| 1072 | + * If you do not use "safe" with a replica set and the master changes, there will be no way for the driver to know about the change so it will continuously and silently fail to write. |
|
| 1073 | + * If safe is an integer, will replicate the update to that many machines before returning success (or throw an exception if the replication times out, see wtimeout). |
|
| 1074 | + * This overrides the w variable set on the collection. |
|
| 1075 | + * |
|
| 1076 | + * "fsync": Boolean, defaults to false. Forces the update to be synced to disk before returning success. If true, a safe update is implied and will override setting safe to false. |
|
| 1077 | + * |
|
| 1078 | + * "timeout" Integer, defaults to MongoCursor::$timeout. If "safe" is set, this sets how long (in milliseconds) for the client to wait for a database response. If the database does |
|
| 1079 | + * not respond within the timeout period, a MongoCursorTimeoutException will be thrown |
|
| 1080 | + * @throws MongoCursorException |
|
| 1081 | + * @return bool |
|
| 1082 | + */ |
|
| 1083 | + public function update(array $criteria, array $newobj, array $options = []) {} |
|
| 1084 | + |
|
| 1085 | + /** |
|
| 1086 | + * (PECL mongo >= 0.9.0)<br/> |
|
| 1087 | + * Remove records from this collection |
|
| 1088 | + * @link https://secure.php.net/manual/en/mongocollection.remove.php |
|
| 1089 | + * @param array $criteria [optional] <p>Query criteria for the documents to delete.</p> |
|
| 1090 | + * @param array $options [optional] <p>An array of options for the remove operation. Currently available options |
|
| 1091 | + * include: |
|
| 1092 | + * </p><ul> |
|
| 1093 | + * <li><p><em>"w"</em></p><p>See {@link https://secure.php.net/manual/en/mongo.writeconcerns.php Write Concerns}. The default value for <b>MongoClient</b> is <em>1</em>.</p></li> |
|
| 1094 | + * <li> |
|
| 1095 | + * <p> |
|
| 1096 | + * <em>"justOne"</em> |
|
| 1097 | + * </p> |
|
| 1098 | + * <p> |
|
| 1099 | + * Specify <strong><code>TRUE</code></strong> to limit deletion to just one document. If <strong><code>FALSE</code></strong> or |
|
| 1100 | + * omitted, all documents matching the criteria will be deleted. |
|
| 1101 | + * </p> |
|
| 1102 | + * </li> |
|
| 1103 | + * <li><p><em>"fsync"</em></p><p>Boolean, defaults to <b>FALSE</b>. If journaling is enabled, it works exactly like <em>"j"</em>. If journaling is not enabled, the write operation blocks until it is synced to database files on disk. If <strong><code>TRUE</code></strong>, an acknowledged insert is implied and this option will override setting <em>"w"</em> to <em>0</em>.</p><blockquote class="note"><p><strong class="note">Note</strong>: <span class="simpara">If journaling is enabled, users are strongly encouraged to use the <em>"j"</em> option instead of <em>"fsync"</em>. Do not use <em>"fsync"</em> and <em>"j"</em> simultaneously, as that will result in an error.</p></blockquote></li> |
|
| 1104 | + * <li><p><em>"j"</em></p><p>Boolean, defaults to <b>FALSE</b>. Forces the write operation to block until it is synced to the journal on disk. If <strong><code>TRUE</code></strong>, an acknowledged write is implied and this option will override setting <em>"w"</em> to <em>0</em>.</p><blockquote class="note"><p><strong class="note">Note</strong>: <span class="simpara">If this option is used and journaling is disabled, MongoDB 2.6+ will raise an error and the write will fail; older server versions will simply ignore the option.</p></blockquote></li> |
|
| 1105 | + * <li><p><em>"socketTimeoutMS"</em></p><p>This option specifies the time limit, in milliseconds, for socket communication. If the server does not respond within the timeout period, a <b>MongoCursorTimeoutException</b> will be thrown and there will be no way to determine if the server actually handled the write or not. A value of <em>-1</em> may be specified to block indefinitely. The default value for <b>MongoClient</b> is <em>30000</em> (30 seconds).</p></li> |
|
| 1106 | + * <li><p><em>"w"</em></p><p>See {@link https://secure.php.net/manual/en/mongo.writeconcerns.php Write Concerns}. The default value for <b>MongoClient</b> is <em>1</em>.</p></li> |
|
| 1107 | + * <li><p><em>"wTimeoutMS"</em></p><p>This option specifies the time limit, in milliseconds, for {@link https://secure.php.net/manual/en/mongo.writeconcerns.php write concern} acknowledgement. It is only applicable when <em>"w"</em> is greater than <em>1</em>, as the timeout pertains to replication. If the write concern is not satisfied within the time limit, a <a href="class.mongocursorexception.php" class="classname">MongoCursorException</a> will be thrown. A value of <em>0</em> may be specified to block indefinitely. The default value for {@link https://secure.php.net/manual/en/class.mongoclient.php MongoClient} is <em>10000</em> (ten seconds).</p></li> |
|
| 1108 | + * </ul> |
|
| 1109 | + * |
|
| 1110 | + * <p> |
|
| 1111 | + * The following options are deprecated and should no longer be used: |
|
| 1112 | + * </p><ul> |
|
| 1113 | + * <li><p><em>"safe"</em></p><p>Deprecated. Please use the {@link https://secure.php.net/manual/en/mongo.writeconcerns.php write concern} <em>"w"</em> option.</p></li> |
|
| 1114 | + * <li><p><em>"timeout"</em></p><p>Deprecated alias for <em>"socketTimeoutMS"</em>.</p></li> |
|
| 1115 | + * <li><p><b>"wtimeout"</b></p><p>Deprecated alias for <em>"wTimeoutMS"</em>.</p></li></ul> |
|
| 1116 | + * @throws MongoCursorException |
|
| 1117 | + * @throws MongoCursorTimeoutException |
|
| 1118 | + * @return bool|array <p>Returns an array containing the status of the removal if the |
|
| 1119 | + * <em>"w"</em> option is set. Otherwise, returns <b>TRUE</b>. |
|
| 1120 | + * </p> |
|
| 1121 | + * <p> |
|
| 1122 | + * Fields in the status array are described in the documentation for |
|
| 1123 | + * <b>MongoCollection::insert()</b>. |
|
| 1124 | + * </p> |
|
| 1125 | + */ |
|
| 1126 | + public function remove(array $criteria = [], array $options = []) {} |
|
| 1127 | + |
|
| 1128 | + /** |
|
| 1129 | + * Querys this collection |
|
| 1130 | + * @link https://secure.php.net/manual/en/mongocollection.find.php |
|
| 1131 | + * @param array $query The fields for which to search. |
|
| 1132 | + * @param array $fields Fields of the results to return. |
|
| 1133 | + * @return MongoCursor |
|
| 1134 | + */ |
|
| 1135 | + public function find(array $query = [], array $fields = []) {} |
|
| 1136 | + |
|
| 1137 | + /** |
|
| 1138 | + * Retrieve a list of distinct values for the given key across a collection |
|
| 1139 | + * @link https://secure.php.net/manual/en/mongocollection.distinct.php |
|
| 1140 | + * @param string $key The key to use. |
|
| 1141 | + * @param array $query An optional query parameters |
|
| 1142 | + * @return array|false Returns an array of distinct values, or <b>FALSE</b> on failure |
|
| 1143 | + */ |
|
| 1144 | + public function distinct($key, array $query = null) {} |
|
| 1145 | + |
|
| 1146 | + /** |
|
| 1147 | + * Update a document and return it |
|
| 1148 | + * @link https://secure.php.net/manual/en/mongocollection.findandmodify.php |
|
| 1149 | + * @param array $query The query criteria to search for. |
|
| 1150 | + * @param array $update The update criteria. |
|
| 1151 | + * @param array $fields Optionally only return these fields. |
|
| 1152 | + * @param array $options An array of options to apply, such as remove the match document from the DB and return it. |
|
| 1153 | + * @return array Returns the original document, or the modified document when new is set. |
|
| 1154 | + */ |
|
| 1155 | + public function findAndModify(array $query, array $update = null, array $fields = null, array $options = null) {} |
|
| 1156 | + |
|
| 1157 | + /** |
|
| 1158 | + * Querys this collection, returning a single element |
|
| 1159 | + * @link https://secure.php.net/manual/en/mongocollection.findone.php |
|
| 1160 | + * @param array $query The fields for which to search. |
|
| 1161 | + * @param array $fields Fields of the results to return. |
|
| 1162 | + * @param array $options This parameter is an associative array of the form array("name" => `<value>`, ...). |
|
| 1163 | + * @return array|null |
|
| 1164 | + */ |
|
| 1165 | + public function findOne(array $query = [], array $fields = [], array $options = []) {} |
|
| 1166 | + |
|
| 1167 | + /** |
|
| 1168 | + * Creates an index on the given field(s), or does nothing if the index already exists |
|
| 1169 | + * @link https://secure.php.net/manual/en/mongocollection.createindex.php |
|
| 1170 | + * @param array $keys Field or fields to use as index. |
|
| 1171 | + * @param array $options [optional] This parameter is an associative array of the form array("optionname" => `<boolean>`, ...). |
|
| 1172 | + * @return array Returns the database response. |
|
| 1173 | + */ |
|
| 1174 | + public function createIndex(array $keys, array $options = []) {} |
|
| 1175 | + |
|
| 1176 | + /** |
|
| 1177 | + * Creates an index on the given field(s), or does nothing if the index already exists |
|
| 1178 | + * @link https://secure.php.net/manual/en/mongocollection.ensureindex.php |
|
| 1179 | + * @param array $keys Field or fields to use as index. |
|
| 1180 | + * @param array $options [optional] This parameter is an associative array of the form array("optionname" => `<boolean>`, ...). |
|
| 1181 | + * @return true always true |
|
| 1182 | + * @see MongoCollection::createIndex() |
|
| 1183 | + */ |
|
| 1184 | + #[Deprecated('Use MongoCollection::createIndex() instead.')] |
|
| 1185 | + public function ensureIndex(array $keys, array $options = []) {} |
|
| 1186 | + |
|
| 1187 | + /** |
|
| 1188 | + * Deletes an index from this collection |
|
| 1189 | + * @link https://secure.php.net/manual/en/mongocollection.deleteindex.php |
|
| 1190 | + * @param string|array $keys Field or fields from which to delete the index. |
|
| 1191 | + * @return array Returns the database response. |
|
| 1192 | + */ |
|
| 1193 | + public function deleteIndex($keys) {} |
|
| 1194 | + |
|
| 1195 | + /** |
|
| 1196 | + * Delete all indexes for this collection |
|
| 1197 | + * @link https://secure.php.net/manual/en/mongocollection.deleteindexes.php |
|
| 1198 | + * @return array Returns the database response. |
|
| 1199 | + */ |
|
| 1200 | + public function deleteIndexes() {} |
|
| 1201 | + |
|
| 1202 | + /** |
|
| 1203 | + * Returns an array of index names for this collection |
|
| 1204 | + * @link https://secure.php.net/manual/en/mongocollection.getindexinfo.php |
|
| 1205 | + * @return array Returns a list of index names. |
|
| 1206 | + */ |
|
| 1207 | + public function getIndexInfo() {} |
|
| 1208 | + |
|
| 1209 | + /** |
|
| 1210 | + * Counts the number of documents in this collection |
|
| 1211 | + * @link https://secure.php.net/manual/en/mongocollection.count.php |
|
| 1212 | + * @param array|stdClass $query |
|
| 1213 | + * @return int Returns the number of documents matching the query. |
|
| 1214 | + */ |
|
| 1215 | + public function count($query = []) {} |
|
| 1216 | + |
|
| 1217 | + /** |
|
| 1218 | + * Saves an object to this collection |
|
| 1219 | + * @link https://secure.php.net/manual/en/mongocollection.save.php |
|
| 1220 | + * @param array|object $a Array to save. If an object is used, it may not have protected or private properties. |
|
| 1221 | + * Note: If the parameter does not have an _id key or property, a new MongoId instance will be created and assigned to it. |
|
| 1222 | + * See MongoCollection::insert() for additional information on this behavior. |
|
| 1223 | + * @param array $options Options for the save. |
|
| 1224 | + * <dl> |
|
| 1225 | + * <dt>"w" |
|
| 1226 | + * <dd>See WriteConcerns. The default value for MongoClient is 1. |
|
| 1227 | + * <dt>"fsync" |
|
| 1228 | + * <dd>Boolean, defaults to FALSE. Forces the insert to be synced to disk before returning success. If TRUE, an acknowledged insert is implied and will override setting w to 0. |
|
| 1229 | + * <dt>"timeout" |
|
| 1230 | + * <dd>Integer, defaults to MongoCursor::$timeout. If "safe" is set, this sets how long (in milliseconds) for the client to wait for a database response. If the database does not respond within the timeout period, a MongoCursorTimeoutException will be thrown. |
|
| 1231 | + * <dt>"safe" |
|
| 1232 | + * <dd>Deprecated. Please use the WriteConcern w option. |
|
| 1233 | + * </dl> |
|
| 1234 | + * @throws MongoException if the inserted document is empty or if it contains zero-length keys. Attempting to insert an object with protected and private properties will cause a zero-length key error. |
|
| 1235 | + * @throws MongoCursorException if the "w" option is set and the write fails. |
|
| 1236 | + * @throws MongoCursorTimeoutException if the "w" option is set to a value greater than one and the operation takes longer than MongoCursor::$timeout milliseconds to complete. This does not kill the operation on the server, it is a client-side timeout. The operation in MongoCollection::$wtimeout is milliseconds. |
|
| 1237 | + * @return array|bool If w was set, returns an array containing the status of the save. |
|
| 1238 | + * Otherwise, returns a boolean representing if the array was not empty (an empty array will not be inserted). |
|
| 1239 | + */ |
|
| 1240 | + public function save($a, array $options = []) {} |
|
| 1241 | + |
|
| 1242 | + /** |
|
| 1243 | + * Creates a database reference |
|
| 1244 | + * @link https://secure.php.net/manual/en/mongocollection.createdbref.php |
|
| 1245 | + * @param array $a Object to which to create a reference. |
|
| 1246 | + * @return array Returns a database reference array. |
|
| 1247 | + */ |
|
| 1248 | + public function createDBRef(array $a) {} |
|
| 1249 | + |
|
| 1250 | + /** |
|
| 1251 | + * Fetches the document pointed to by a database reference |
|
| 1252 | + * @link https://secure.php.net/manual/en/mongocollection.getdbref.php |
|
| 1253 | + * @param array $ref A database reference. |
|
| 1254 | + * @return array Returns the database document pointed to by the reference. |
|
| 1255 | + */ |
|
| 1256 | + public function getDBRef(array $ref) {} |
|
| 1257 | + |
|
| 1258 | + /** |
|
| 1259 | + * @param mixed $keys |
|
| 1260 | + * @return string |
|
| 1261 | + */ |
|
| 1262 | + protected static function toIndexString($keys) {} |
|
| 1263 | + |
|
| 1264 | + /** |
|
| 1265 | + * Performs an operation similar to SQL's GROUP BY command |
|
| 1266 | + * @link https://secure.php.net/manual/en/mongocollection.group.php |
|
| 1267 | + * @param mixed $keys Fields to group by. If an array or non-code object is passed, it will be the key used to group results. |
|
| 1268 | + * @param array $initial Initial value of the aggregation counter object. |
|
| 1269 | + * @param MongoCode $reduce A function that aggregates (reduces) the objects iterated. |
|
| 1270 | + * @param array $condition An condition that must be true for a row to be considered. |
|
| 1271 | + * @return array |
|
| 1272 | + */ |
|
| 1273 | + public function group($keys, array $initial, MongoCode $reduce, array $condition = []) {} |
|
| 1274 | 1274 | } |
| 1275 | 1275 | |
| 1276 | 1276 | /** |
@@ -1279,629 +1279,629 @@ discard block |
||
| 1279 | 1279 | */ |
| 1280 | 1280 | class MongoCursor implements Iterator |
| 1281 | 1281 | { |
| 1282 | - /** |
|
| 1283 | - * @link https://php.net/manual/en/class.mongocursor.php#mongocursor.props.slaveokay |
|
| 1284 | - * @var bool |
|
| 1285 | - */ |
|
| 1286 | - public static $slaveOkay = false; |
|
| 1287 | - |
|
| 1288 | - /** |
|
| 1289 | - * @var int <p> |
|
| 1290 | - * Set timeout in milliseconds for all database responses. Use |
|
| 1291 | - * <em>-1</em> to wait forever. Can be overridden with |
|
| 1292 | - * {link https://secure.php.net/manual/en/mongocursor.timeout.php MongoCursor::timeout()}. This does not cause the |
|
| 1293 | - * MongoDB server to cancel the operation; it only instructs the driver to |
|
| 1294 | - * stop waiting for a response and throw a |
|
| 1295 | - * {@link https://php.net/manual/en/class.mongocursortimeoutexception.php MongoCursorTimeoutException} after a set time. |
|
| 1296 | - * </p> |
|
| 1297 | - */ |
|
| 1298 | - public static $timeout = 30000; |
|
| 1299 | - /** |
|
| 1300 | - * Create a new cursor |
|
| 1301 | - * @link https://secure.php.net/manual/en/mongocursor.construct.php |
|
| 1302 | - * @param MongoClient $connection Database connection. |
|
| 1303 | - * @param string $ns Full name of database and collection. |
|
| 1304 | - * @param array $query Database query. |
|
| 1305 | - * @param array $fields Fields to return. |
|
| 1306 | - */ |
|
| 1307 | - public function __construct($connection, $ns, array $query = [], array $fields = []) {} |
|
| 1308 | - |
|
| 1309 | - /** |
|
| 1310 | - * (PECL mongo >= 1.2.11)<br/> |
|
| 1311 | - * Sets whether this cursor will wait for a while for a tailable cursor to return more data |
|
| 1312 | - * @param bool $wait [optional] <p>If the cursor should wait for more data to become available.</p> |
|
| 1313 | - * @return MongoCursor Returns this cursor. |
|
| 1314 | - */ |
|
| 1315 | - public function awaitData($wait = true) {} |
|
| 1316 | - /** |
|
| 1317 | - * Checks if there are any more elements in this cursor |
|
| 1318 | - * @link https://secure.php.net/manual/en/mongocursor.hasnext.php |
|
| 1319 | - * @throws MongoConnectionException |
|
| 1320 | - * @throws MongoCursorTimeoutException |
|
| 1321 | - * @return bool Returns true if there is another element |
|
| 1322 | - */ |
|
| 1323 | - public function hasNext() {} |
|
| 1324 | - |
|
| 1325 | - /** |
|
| 1326 | - * Return the next object to which this cursor points, and advance the cursor |
|
| 1327 | - * @link https://secure.php.net/manual/en/mongocursor.getnext.php |
|
| 1328 | - * @throws MongoConnectionException |
|
| 1329 | - * @throws MongoCursorTimeoutException |
|
| 1330 | - * @return array Returns the next object |
|
| 1331 | - */ |
|
| 1332 | - public function getNext() {} |
|
| 1333 | - |
|
| 1334 | - /** |
|
| 1335 | - * (PECL mongo >= 1.3.3)<br/> |
|
| 1336 | - * @link https://secure.php.net/manual/en/mongocursor.getreadpreference.php |
|
| 1337 | - * @return array This function returns an array describing the read preference. The array contains the values <em>type</em> for the string |
|
| 1338 | - * read preference mode (corresponding to the {@link https://secure.php.net/manual/en/class.mongoclient.php MongoClient} constants), and <em>tagsets</em> containing a list of all tag set criteria. If no tag sets were specified, <em>tagsets</em> will not be present in the array. |
|
| 1339 | - */ |
|
| 1340 | - public function getReadPreference() {} |
|
| 1341 | - |
|
| 1342 | - /** |
|
| 1343 | - * Limits the number of results returned |
|
| 1344 | - * @link https://secure.php.net/manual/en/mongocursor.limit.php |
|
| 1345 | - * @param int $num The number of results to return. |
|
| 1346 | - * @throws MongoCursorException |
|
| 1347 | - * @return MongoCursor Returns this cursor |
|
| 1348 | - */ |
|
| 1349 | - public function limit($num) {} |
|
| 1350 | - |
|
| 1351 | - /** |
|
| 1352 | - * (PECL mongo >= 1.2.0)<br/> |
|
| 1353 | - * @link https://secure.php.net/manual/en/mongocursor.partial.php |
|
| 1354 | - * @param bool $okay [optional] <p>If receiving partial results is okay.</p> |
|
| 1355 | - * @return MongoCursor Returns this cursor. |
|
| 1356 | - */ |
|
| 1357 | - public function partial($okay = true) {} |
|
| 1358 | - |
|
| 1359 | - /** |
|
| 1360 | - * (PECL mongo >= 1.2.1)<br/> |
|
| 1361 | - * @link https://secure.php.net/manual/en/mongocursor.setflag.php |
|
| 1362 | - * @param int $flag <p> |
|
| 1363 | - * Which flag to set. You can not set flag 6 (EXHAUST) as the driver does |
|
| 1364 | - * not know how to handle them. You will get a warning if you try to use |
|
| 1365 | - * this flag. For available flags, please refer to the wire protocol |
|
| 1366 | - * {@link https://www.mongodb.org/display/DOCS/Mongo+Wire+Protocol#MongoWireProtocol-OPQUERY documentation}. |
|
| 1367 | - * </p> |
|
| 1368 | - * @param bool $set [optional] <p>Whether the flag should be set (<b>TRUE</b>) or unset (<b>FALSE</b>).</p> |
|
| 1369 | - * @return MongoCursor |
|
| 1370 | - */ |
|
| 1371 | - public function setFlag($flag, $set = true) {} |
|
| 1372 | - |
|
| 1373 | - /** |
|
| 1374 | - * (PECL mongo >= 1.3.3)<br/> |
|
| 1375 | - * @link https://secure.php.net/manual/en/mongocursor.setreadpreference.php |
|
| 1376 | - * @param string $read_preference <p>The read preference mode: MongoClient::RP_PRIMARY, MongoClient::RP_PRIMARY_PREFERRED, MongoClient::RP_SECONDARY, MongoClient::RP_SECONDARY_PREFERRED, or MongoClient::RP_NEAREST.</p> |
|
| 1377 | - * @param array $tags [optional] <p>The read preference mode: MongoClient::RP_PRIMARY, MongoClient::RP_PRIMARY_PREFERRED, MongoClient::RP_SECONDARY, MongoClient::RP_SECONDARY_PREFERRED, or MongoClient::RP_NEAREST.</p> |
|
| 1378 | - * @return MongoCursor Returns this cursor. |
|
| 1379 | - */ |
|
| 1380 | - public function setReadPreference($read_preference, array $tags) {} |
|
| 1381 | - |
|
| 1382 | - /** |
|
| 1383 | - * Skips a number of results |
|
| 1384 | - * @link https://secure.php.net/manual/en/mongocursor.skip.php |
|
| 1385 | - * @param int $num The number of results to skip. |
|
| 1386 | - * @throws MongoCursorException |
|
| 1387 | - * @return MongoCursor Returns this cursor |
|
| 1388 | - */ |
|
| 1389 | - public function skip($num) {} |
|
| 1390 | - |
|
| 1391 | - /** |
|
| 1392 | - * Sets whether this query can be done on a slave |
|
| 1393 | - * This method will override the static class variable slaveOkay. |
|
| 1394 | - * @link https://secure.php.net/manual/en/mongocursor.slaveOkay.php |
|
| 1395 | - * @param bool $okay If it is okay to query the slave. |
|
| 1396 | - * @throws MongoCursorException |
|
| 1397 | - * @return MongoCursor Returns this cursor |
|
| 1398 | - */ |
|
| 1399 | - public function slaveOkay($okay = true) {} |
|
| 1400 | - |
|
| 1401 | - /** |
|
| 1402 | - * Sets whether this cursor will be left open after fetching the last results |
|
| 1403 | - * @link https://secure.php.net/manual/en/mongocursor.tailable.php |
|
| 1404 | - * @param bool $tail If the cursor should be tailable. |
|
| 1405 | - * @return MongoCursor Returns this cursor |
|
| 1406 | - */ |
|
| 1407 | - public function tailable($tail = true) {} |
|
| 1408 | - |
|
| 1409 | - /** |
|
| 1410 | - * Sets whether this cursor will timeout |
|
| 1411 | - * @link https://secure.php.net/manual/en/mongocursor.immortal.php |
|
| 1412 | - * @param bool $liveForever If the cursor should be immortal. |
|
| 1413 | - * @throws MongoCursorException |
|
| 1414 | - * @return MongoCursor Returns this cursor |
|
| 1415 | - */ |
|
| 1416 | - public function immortal($liveForever = true) {} |
|
| 1417 | - |
|
| 1418 | - /** |
|
| 1419 | - * Sets a client-side timeout for this query |
|
| 1420 | - * @link https://secure.php.net/manual/en/mongocursor.timeout.php |
|
| 1421 | - * @param int $ms The number of milliseconds for the cursor to wait for a response. By default, the cursor will wait forever. |
|
| 1422 | - * @throws MongoCursorTimeoutException |
|
| 1423 | - * @return MongoCursor Returns this cursor |
|
| 1424 | - */ |
|
| 1425 | - public function timeout($ms) {} |
|
| 1426 | - |
|
| 1427 | - /** |
|
| 1428 | - * Checks if there are documents that have not been sent yet from the database for this cursor |
|
| 1429 | - * @link https://secure.php.net/manual/en/mongocursor.dead.php |
|
| 1430 | - * @return bool Returns if there are more results that have not been sent to the client, yet. |
|
| 1431 | - */ |
|
| 1432 | - public function dead() {} |
|
| 1433 | - |
|
| 1434 | - /** |
|
| 1435 | - * Use snapshot mode for the query |
|
| 1436 | - * @link https://secure.php.net/manual/en/mongocursor.snapshot.php |
|
| 1437 | - * @throws MongoCursorException |
|
| 1438 | - * @return MongoCursor Returns this cursor |
|
| 1439 | - */ |
|
| 1440 | - public function snapshot() {} |
|
| 1441 | - |
|
| 1442 | - /** |
|
| 1443 | - * Sorts the results by given fields |
|
| 1444 | - * @link https://secure.php.net/manual/en/mongocursor.sort.php |
|
| 1445 | - * @param array $fields An array of fields by which to sort. Each element in the array has as key the field name, and as value either 1 for ascending sort, or -1 for descending sort |
|
| 1446 | - * @throws MongoCursorException |
|
| 1447 | - * @return MongoCursor Returns the same cursor that this method was called on |
|
| 1448 | - */ |
|
| 1449 | - public function sort(array $fields) {} |
|
| 1450 | - |
|
| 1451 | - /** |
|
| 1452 | - * Gives the database a hint about the query |
|
| 1453 | - * @link https://secure.php.net/manual/en/mongocursor.hint.php |
|
| 1454 | - * @param mixed $key_pattern Indexes to use for the query. |
|
| 1455 | - * @throws MongoCursorException |
|
| 1456 | - * @return MongoCursor Returns this cursor |
|
| 1457 | - */ |
|
| 1458 | - public function hint($key_pattern) {} |
|
| 1459 | - |
|
| 1460 | - /** |
|
| 1461 | - * Adds a top-level key/value pair to a query |
|
| 1462 | - * @link https://secure.php.net/manual/en/mongocursor.addoption.php |
|
| 1463 | - * @param string $key Fieldname to add. |
|
| 1464 | - * @param mixed $value Value to add. |
|
| 1465 | - * @throws MongoCursorException |
|
| 1466 | - * @return MongoCursor Returns this cursor |
|
| 1467 | - */ |
|
| 1468 | - public function addOption($key, $value) {} |
|
| 1469 | - |
|
| 1470 | - /** |
|
| 1471 | - * Execute the query |
|
| 1472 | - * @link https://secure.php.net/manual/en/mongocursor.doquery.php |
|
| 1473 | - * @throws MongoConnectionException if it cannot reach the database. |
|
| 1474 | - * @return void |
|
| 1475 | - */ |
|
| 1476 | - protected function doQuery() {} |
|
| 1477 | - |
|
| 1478 | - /** |
|
| 1479 | - * Returns the current element |
|
| 1480 | - * @link https://secure.php.net/manual/en/mongocursor.current.php |
|
| 1481 | - * @return array |
|
| 1482 | - */ |
|
| 1483 | - public function current() {} |
|
| 1484 | - |
|
| 1485 | - /** |
|
| 1486 | - * Returns the current result's _id |
|
| 1487 | - * @link https://secure.php.net/manual/en/mongocursor.key.php |
|
| 1488 | - * @return string The current result's _id as a string. |
|
| 1489 | - */ |
|
| 1490 | - public function key() {} |
|
| 1491 | - |
|
| 1492 | - /** |
|
| 1493 | - * Advances the cursor to the next result |
|
| 1494 | - * @link https://secure.php.net/manual/en/mongocursor.next.php |
|
| 1495 | - * @throws MongoConnectionException |
|
| 1496 | - * @throws MongoCursorTimeoutException |
|
| 1497 | - * @return void |
|
| 1498 | - */ |
|
| 1499 | - public function next() {} |
|
| 1500 | - |
|
| 1501 | - /** |
|
| 1502 | - * Returns the cursor to the beginning of the result set |
|
| 1503 | - * @throws MongoConnectionException |
|
| 1504 | - * @throws MongoCursorTimeoutException |
|
| 1505 | - * @return void |
|
| 1506 | - */ |
|
| 1507 | - public function rewind() {} |
|
| 1508 | - |
|
| 1509 | - /** |
|
| 1510 | - * Checks if the cursor is reading a valid result. |
|
| 1511 | - * @link https://secure.php.net/manual/en/mongocursor.valid.php |
|
| 1512 | - * @return bool If the current result is not null. |
|
| 1513 | - */ |
|
| 1514 | - public function valid() {} |
|
| 1515 | - |
|
| 1516 | - /** |
|
| 1517 | - * Clears the cursor |
|
| 1518 | - * @link https://secure.php.net/manual/en/mongocursor.reset.php |
|
| 1519 | - * @return void |
|
| 1520 | - */ |
|
| 1521 | - public function reset() {} |
|
| 1522 | - |
|
| 1523 | - /** |
|
| 1524 | - * Return an explanation of the query, often useful for optimization and debugging |
|
| 1525 | - * @link https://secure.php.net/manual/en/mongocursor.explain.php |
|
| 1526 | - * @return array Returns an explanation of the query. |
|
| 1527 | - */ |
|
| 1528 | - public function explain() {} |
|
| 1529 | - |
|
| 1530 | - /** |
|
| 1531 | - * Counts the number of results for this query |
|
| 1532 | - * @link https://secure.php.net/manual/en/mongocursor.count.php |
|
| 1533 | - * @param bool $all Send cursor limit and skip information to the count function, if applicable. |
|
| 1534 | - * @return int The number of documents returned by this cursor's query. |
|
| 1535 | - */ |
|
| 1536 | - public function count($all = false) {} |
|
| 1537 | - |
|
| 1538 | - /** |
|
| 1539 | - * Sets the fields for a query |
|
| 1540 | - * @link https://secure.php.net/manual/en/mongocursor.fields.php |
|
| 1541 | - * @param array $f Fields to return (or not return). |
|
| 1542 | - * @throws MongoCursorException |
|
| 1543 | - * @return MongoCursor |
|
| 1544 | - */ |
|
| 1545 | - public function fields(array $f) {} |
|
| 1546 | - |
|
| 1547 | - /** |
|
| 1548 | - * Gets the query, fields, limit, and skip for this cursor |
|
| 1549 | - * @link https://secure.php.net/manual/en/mongocursor.info.php |
|
| 1550 | - * @return array The query, fields, limit, and skip for this cursor as an associative array. |
|
| 1551 | - */ |
|
| 1552 | - public function info() {} |
|
| 1553 | - |
|
| 1554 | - /** |
|
| 1555 | - * PECL mongo >= 1.0.11 |
|
| 1556 | - * Limits the number of elements returned in one batch. |
|
| 1557 | - * <p>A cursor typically fetches a batch of result objects and store them locally. |
|
| 1558 | - * This method sets the batchSize value to configure the amount of documents retrieved from the server in one data packet. |
|
| 1559 | - * However, it will never return more documents than fit in the max batch size limit (usually 4MB). |
|
| 1560 | - * </p> |
|
| 1561 | - * |
|
| 1562 | - * @param int $batchSize The number of results to return per batch. Each batch requires a round-trip to the server. |
|
| 1563 | - * <p>If batchSize is 2 or more, it represents the size of each batch of objects retrieved. |
|
| 1564 | - * It can be adjusted to optimize performance and limit data transfer. |
|
| 1565 | - * </p> |
|
| 1566 | - * |
|
| 1567 | - * <p>If batchSize is 1 or negative, it will limit of number returned documents to the absolute value of batchSize, |
|
| 1568 | - * and the cursor will be closed. For example if batchSize is -10, then the server will return a maximum of 10 |
|
| 1569 | - * documents and as many as can fit in 4MB, then close the cursor. |
|
| 1570 | - * </p> |
|
| 1571 | - * <b>Warning</b> |
|
| 1572 | - * <p>A batchSize of 1 is special, and means the same as -1, i.e. a value of 1 makes the cursor only capable of returning one document. |
|
| 1573 | - * </p> |
|
| 1574 | - * <p>Note that this feature is different from MongoCursor::limit() in that documents must fit within a maximum size, |
|
| 1575 | - * and it removes the need to send a request to close the cursor server-side. |
|
| 1576 | - * The batch size can be changed even after a cursor is iterated, in which case the setting will apply on the next batch retrieval. |
|
| 1577 | - * </p> |
|
| 1578 | - * <p>This cannot override MongoDB's limit on the amount of data it will return to the client (i.e., |
|
| 1579 | - * if you set batch size to 1,000,000,000, MongoDB will still only return 4-16MB of results per batch). |
|
| 1580 | - * </p> |
|
| 1581 | - * <p>To ensure consistent behavior, the rules of MongoCursor::batchSize() and MongoCursor::limit() behave a little complex |
|
| 1582 | - * but work "as expected". The rules are: hard limits override soft limits with preference given to MongoCursor::limit() over |
|
| 1583 | - * MongoCursor::batchSize(). After that, whichever is set and lower than the other will take precedence. |
|
| 1584 | - * See below. section for some examples. |
|
| 1585 | - * </p> |
|
| 1586 | - * |
|
| 1587 | - * @return MongoCursor Returns this cursor. |
|
| 1588 | - * @link https://secure.php.net/manual/en/mongocursor.batchsize.php |
|
| 1589 | - */ |
|
| 1590 | - public function batchSize($batchSize) {} |
|
| 1591 | - |
|
| 1592 | - /** |
|
| 1593 | - * (PECL mongo >= 1.5.0) |
|
| 1594 | - * Sets a server-side timeout for this query |
|
| 1595 | - * @link https://php.net/manual/en/mongocursor.maxtimems.php |
|
| 1596 | - * @param int $ms <p> |
|
| 1597 | - * Specifies a cumulative time limit in milliseconds to be allowed by the |
|
| 1598 | - * server for processing operations on the cursor. |
|
| 1599 | - * </p> |
|
| 1600 | - * @return MongoCursor This cursor. |
|
| 1601 | - */ |
|
| 1602 | - public function maxTimeMS($ms) {} |
|
| 1282 | + /** |
|
| 1283 | + * @link https://php.net/manual/en/class.mongocursor.php#mongocursor.props.slaveokay |
|
| 1284 | + * @var bool |
|
| 1285 | + */ |
|
| 1286 | + public static $slaveOkay = false; |
|
| 1287 | + |
|
| 1288 | + /** |
|
| 1289 | + * @var int <p> |
|
| 1290 | + * Set timeout in milliseconds for all database responses. Use |
|
| 1291 | + * <em>-1</em> to wait forever. Can be overridden with |
|
| 1292 | + * {link https://secure.php.net/manual/en/mongocursor.timeout.php MongoCursor::timeout()}. This does not cause the |
|
| 1293 | + * MongoDB server to cancel the operation; it only instructs the driver to |
|
| 1294 | + * stop waiting for a response and throw a |
|
| 1295 | + * {@link https://php.net/manual/en/class.mongocursortimeoutexception.php MongoCursorTimeoutException} after a set time. |
|
| 1296 | + * </p> |
|
| 1297 | + */ |
|
| 1298 | + public static $timeout = 30000; |
|
| 1299 | + /** |
|
| 1300 | + * Create a new cursor |
|
| 1301 | + * @link https://secure.php.net/manual/en/mongocursor.construct.php |
|
| 1302 | + * @param MongoClient $connection Database connection. |
|
| 1303 | + * @param string $ns Full name of database and collection. |
|
| 1304 | + * @param array $query Database query. |
|
| 1305 | + * @param array $fields Fields to return. |
|
| 1306 | + */ |
|
| 1307 | + public function __construct($connection, $ns, array $query = [], array $fields = []) {} |
|
| 1308 | + |
|
| 1309 | + /** |
|
| 1310 | + * (PECL mongo >= 1.2.11)<br/> |
|
| 1311 | + * Sets whether this cursor will wait for a while for a tailable cursor to return more data |
|
| 1312 | + * @param bool $wait [optional] <p>If the cursor should wait for more data to become available.</p> |
|
| 1313 | + * @return MongoCursor Returns this cursor. |
|
| 1314 | + */ |
|
| 1315 | + public function awaitData($wait = true) {} |
|
| 1316 | + /** |
|
| 1317 | + * Checks if there are any more elements in this cursor |
|
| 1318 | + * @link https://secure.php.net/manual/en/mongocursor.hasnext.php |
|
| 1319 | + * @throws MongoConnectionException |
|
| 1320 | + * @throws MongoCursorTimeoutException |
|
| 1321 | + * @return bool Returns true if there is another element |
|
| 1322 | + */ |
|
| 1323 | + public function hasNext() {} |
|
| 1324 | + |
|
| 1325 | + /** |
|
| 1326 | + * Return the next object to which this cursor points, and advance the cursor |
|
| 1327 | + * @link https://secure.php.net/manual/en/mongocursor.getnext.php |
|
| 1328 | + * @throws MongoConnectionException |
|
| 1329 | + * @throws MongoCursorTimeoutException |
|
| 1330 | + * @return array Returns the next object |
|
| 1331 | + */ |
|
| 1332 | + public function getNext() {} |
|
| 1333 | + |
|
| 1334 | + /** |
|
| 1335 | + * (PECL mongo >= 1.3.3)<br/> |
|
| 1336 | + * @link https://secure.php.net/manual/en/mongocursor.getreadpreference.php |
|
| 1337 | + * @return array This function returns an array describing the read preference. The array contains the values <em>type</em> for the string |
|
| 1338 | + * read preference mode (corresponding to the {@link https://secure.php.net/manual/en/class.mongoclient.php MongoClient} constants), and <em>tagsets</em> containing a list of all tag set criteria. If no tag sets were specified, <em>tagsets</em> will not be present in the array. |
|
| 1339 | + */ |
|
| 1340 | + public function getReadPreference() {} |
|
| 1341 | + |
|
| 1342 | + /** |
|
| 1343 | + * Limits the number of results returned |
|
| 1344 | + * @link https://secure.php.net/manual/en/mongocursor.limit.php |
|
| 1345 | + * @param int $num The number of results to return. |
|
| 1346 | + * @throws MongoCursorException |
|
| 1347 | + * @return MongoCursor Returns this cursor |
|
| 1348 | + */ |
|
| 1349 | + public function limit($num) {} |
|
| 1350 | + |
|
| 1351 | + /** |
|
| 1352 | + * (PECL mongo >= 1.2.0)<br/> |
|
| 1353 | + * @link https://secure.php.net/manual/en/mongocursor.partial.php |
|
| 1354 | + * @param bool $okay [optional] <p>If receiving partial results is okay.</p> |
|
| 1355 | + * @return MongoCursor Returns this cursor. |
|
| 1356 | + */ |
|
| 1357 | + public function partial($okay = true) {} |
|
| 1358 | + |
|
| 1359 | + /** |
|
| 1360 | + * (PECL mongo >= 1.2.1)<br/> |
|
| 1361 | + * @link https://secure.php.net/manual/en/mongocursor.setflag.php |
|
| 1362 | + * @param int $flag <p> |
|
| 1363 | + * Which flag to set. You can not set flag 6 (EXHAUST) as the driver does |
|
| 1364 | + * not know how to handle them. You will get a warning if you try to use |
|
| 1365 | + * this flag. For available flags, please refer to the wire protocol |
|
| 1366 | + * {@link https://www.mongodb.org/display/DOCS/Mongo+Wire+Protocol#MongoWireProtocol-OPQUERY documentation}. |
|
| 1367 | + * </p> |
|
| 1368 | + * @param bool $set [optional] <p>Whether the flag should be set (<b>TRUE</b>) or unset (<b>FALSE</b>).</p> |
|
| 1369 | + * @return MongoCursor |
|
| 1370 | + */ |
|
| 1371 | + public function setFlag($flag, $set = true) {} |
|
| 1372 | + |
|
| 1373 | + /** |
|
| 1374 | + * (PECL mongo >= 1.3.3)<br/> |
|
| 1375 | + * @link https://secure.php.net/manual/en/mongocursor.setreadpreference.php |
|
| 1376 | + * @param string $read_preference <p>The read preference mode: MongoClient::RP_PRIMARY, MongoClient::RP_PRIMARY_PREFERRED, MongoClient::RP_SECONDARY, MongoClient::RP_SECONDARY_PREFERRED, or MongoClient::RP_NEAREST.</p> |
|
| 1377 | + * @param array $tags [optional] <p>The read preference mode: MongoClient::RP_PRIMARY, MongoClient::RP_PRIMARY_PREFERRED, MongoClient::RP_SECONDARY, MongoClient::RP_SECONDARY_PREFERRED, or MongoClient::RP_NEAREST.</p> |
|
| 1378 | + * @return MongoCursor Returns this cursor. |
|
| 1379 | + */ |
|
| 1380 | + public function setReadPreference($read_preference, array $tags) {} |
|
| 1381 | + |
|
| 1382 | + /** |
|
| 1383 | + * Skips a number of results |
|
| 1384 | + * @link https://secure.php.net/manual/en/mongocursor.skip.php |
|
| 1385 | + * @param int $num The number of results to skip. |
|
| 1386 | + * @throws MongoCursorException |
|
| 1387 | + * @return MongoCursor Returns this cursor |
|
| 1388 | + */ |
|
| 1389 | + public function skip($num) {} |
|
| 1390 | + |
|
| 1391 | + /** |
|
| 1392 | + * Sets whether this query can be done on a slave |
|
| 1393 | + * This method will override the static class variable slaveOkay. |
|
| 1394 | + * @link https://secure.php.net/manual/en/mongocursor.slaveOkay.php |
|
| 1395 | + * @param bool $okay If it is okay to query the slave. |
|
| 1396 | + * @throws MongoCursorException |
|
| 1397 | + * @return MongoCursor Returns this cursor |
|
| 1398 | + */ |
|
| 1399 | + public function slaveOkay($okay = true) {} |
|
| 1400 | + |
|
| 1401 | + /** |
|
| 1402 | + * Sets whether this cursor will be left open after fetching the last results |
|
| 1403 | + * @link https://secure.php.net/manual/en/mongocursor.tailable.php |
|
| 1404 | + * @param bool $tail If the cursor should be tailable. |
|
| 1405 | + * @return MongoCursor Returns this cursor |
|
| 1406 | + */ |
|
| 1407 | + public function tailable($tail = true) {} |
|
| 1408 | + |
|
| 1409 | + /** |
|
| 1410 | + * Sets whether this cursor will timeout |
|
| 1411 | + * @link https://secure.php.net/manual/en/mongocursor.immortal.php |
|
| 1412 | + * @param bool $liveForever If the cursor should be immortal. |
|
| 1413 | + * @throws MongoCursorException |
|
| 1414 | + * @return MongoCursor Returns this cursor |
|
| 1415 | + */ |
|
| 1416 | + public function immortal($liveForever = true) {} |
|
| 1417 | + |
|
| 1418 | + /** |
|
| 1419 | + * Sets a client-side timeout for this query |
|
| 1420 | + * @link https://secure.php.net/manual/en/mongocursor.timeout.php |
|
| 1421 | + * @param int $ms The number of milliseconds for the cursor to wait for a response. By default, the cursor will wait forever. |
|
| 1422 | + * @throws MongoCursorTimeoutException |
|
| 1423 | + * @return MongoCursor Returns this cursor |
|
| 1424 | + */ |
|
| 1425 | + public function timeout($ms) {} |
|
| 1426 | + |
|
| 1427 | + /** |
|
| 1428 | + * Checks if there are documents that have not been sent yet from the database for this cursor |
|
| 1429 | + * @link https://secure.php.net/manual/en/mongocursor.dead.php |
|
| 1430 | + * @return bool Returns if there are more results that have not been sent to the client, yet. |
|
| 1431 | + */ |
|
| 1432 | + public function dead() {} |
|
| 1433 | + |
|
| 1434 | + /** |
|
| 1435 | + * Use snapshot mode for the query |
|
| 1436 | + * @link https://secure.php.net/manual/en/mongocursor.snapshot.php |
|
| 1437 | + * @throws MongoCursorException |
|
| 1438 | + * @return MongoCursor Returns this cursor |
|
| 1439 | + */ |
|
| 1440 | + public function snapshot() {} |
|
| 1441 | + |
|
| 1442 | + /** |
|
| 1443 | + * Sorts the results by given fields |
|
| 1444 | + * @link https://secure.php.net/manual/en/mongocursor.sort.php |
|
| 1445 | + * @param array $fields An array of fields by which to sort. Each element in the array has as key the field name, and as value either 1 for ascending sort, or -1 for descending sort |
|
| 1446 | + * @throws MongoCursorException |
|
| 1447 | + * @return MongoCursor Returns the same cursor that this method was called on |
|
| 1448 | + */ |
|
| 1449 | + public function sort(array $fields) {} |
|
| 1450 | + |
|
| 1451 | + /** |
|
| 1452 | + * Gives the database a hint about the query |
|
| 1453 | + * @link https://secure.php.net/manual/en/mongocursor.hint.php |
|
| 1454 | + * @param mixed $key_pattern Indexes to use for the query. |
|
| 1455 | + * @throws MongoCursorException |
|
| 1456 | + * @return MongoCursor Returns this cursor |
|
| 1457 | + */ |
|
| 1458 | + public function hint($key_pattern) {} |
|
| 1459 | + |
|
| 1460 | + /** |
|
| 1461 | + * Adds a top-level key/value pair to a query |
|
| 1462 | + * @link https://secure.php.net/manual/en/mongocursor.addoption.php |
|
| 1463 | + * @param string $key Fieldname to add. |
|
| 1464 | + * @param mixed $value Value to add. |
|
| 1465 | + * @throws MongoCursorException |
|
| 1466 | + * @return MongoCursor Returns this cursor |
|
| 1467 | + */ |
|
| 1468 | + public function addOption($key, $value) {} |
|
| 1469 | + |
|
| 1470 | + /** |
|
| 1471 | + * Execute the query |
|
| 1472 | + * @link https://secure.php.net/manual/en/mongocursor.doquery.php |
|
| 1473 | + * @throws MongoConnectionException if it cannot reach the database. |
|
| 1474 | + * @return void |
|
| 1475 | + */ |
|
| 1476 | + protected function doQuery() {} |
|
| 1477 | + |
|
| 1478 | + /** |
|
| 1479 | + * Returns the current element |
|
| 1480 | + * @link https://secure.php.net/manual/en/mongocursor.current.php |
|
| 1481 | + * @return array |
|
| 1482 | + */ |
|
| 1483 | + public function current() {} |
|
| 1484 | + |
|
| 1485 | + /** |
|
| 1486 | + * Returns the current result's _id |
|
| 1487 | + * @link https://secure.php.net/manual/en/mongocursor.key.php |
|
| 1488 | + * @return string The current result's _id as a string. |
|
| 1489 | + */ |
|
| 1490 | + public function key() {} |
|
| 1491 | + |
|
| 1492 | + /** |
|
| 1493 | + * Advances the cursor to the next result |
|
| 1494 | + * @link https://secure.php.net/manual/en/mongocursor.next.php |
|
| 1495 | + * @throws MongoConnectionException |
|
| 1496 | + * @throws MongoCursorTimeoutException |
|
| 1497 | + * @return void |
|
| 1498 | + */ |
|
| 1499 | + public function next() {} |
|
| 1500 | + |
|
| 1501 | + /** |
|
| 1502 | + * Returns the cursor to the beginning of the result set |
|
| 1503 | + * @throws MongoConnectionException |
|
| 1504 | + * @throws MongoCursorTimeoutException |
|
| 1505 | + * @return void |
|
| 1506 | + */ |
|
| 1507 | + public function rewind() {} |
|
| 1508 | + |
|
| 1509 | + /** |
|
| 1510 | + * Checks if the cursor is reading a valid result. |
|
| 1511 | + * @link https://secure.php.net/manual/en/mongocursor.valid.php |
|
| 1512 | + * @return bool If the current result is not null. |
|
| 1513 | + */ |
|
| 1514 | + public function valid() {} |
|
| 1515 | + |
|
| 1516 | + /** |
|
| 1517 | + * Clears the cursor |
|
| 1518 | + * @link https://secure.php.net/manual/en/mongocursor.reset.php |
|
| 1519 | + * @return void |
|
| 1520 | + */ |
|
| 1521 | + public function reset() {} |
|
| 1522 | + |
|
| 1523 | + /** |
|
| 1524 | + * Return an explanation of the query, often useful for optimization and debugging |
|
| 1525 | + * @link https://secure.php.net/manual/en/mongocursor.explain.php |
|
| 1526 | + * @return array Returns an explanation of the query. |
|
| 1527 | + */ |
|
| 1528 | + public function explain() {} |
|
| 1529 | + |
|
| 1530 | + /** |
|
| 1531 | + * Counts the number of results for this query |
|
| 1532 | + * @link https://secure.php.net/manual/en/mongocursor.count.php |
|
| 1533 | + * @param bool $all Send cursor limit and skip information to the count function, if applicable. |
|
| 1534 | + * @return int The number of documents returned by this cursor's query. |
|
| 1535 | + */ |
|
| 1536 | + public function count($all = false) {} |
|
| 1537 | + |
|
| 1538 | + /** |
|
| 1539 | + * Sets the fields for a query |
|
| 1540 | + * @link https://secure.php.net/manual/en/mongocursor.fields.php |
|
| 1541 | + * @param array $f Fields to return (or not return). |
|
| 1542 | + * @throws MongoCursorException |
|
| 1543 | + * @return MongoCursor |
|
| 1544 | + */ |
|
| 1545 | + public function fields(array $f) {} |
|
| 1546 | + |
|
| 1547 | + /** |
|
| 1548 | + * Gets the query, fields, limit, and skip for this cursor |
|
| 1549 | + * @link https://secure.php.net/manual/en/mongocursor.info.php |
|
| 1550 | + * @return array The query, fields, limit, and skip for this cursor as an associative array. |
|
| 1551 | + */ |
|
| 1552 | + public function info() {} |
|
| 1553 | + |
|
| 1554 | + /** |
|
| 1555 | + * PECL mongo >= 1.0.11 |
|
| 1556 | + * Limits the number of elements returned in one batch. |
|
| 1557 | + * <p>A cursor typically fetches a batch of result objects and store them locally. |
|
| 1558 | + * This method sets the batchSize value to configure the amount of documents retrieved from the server in one data packet. |
|
| 1559 | + * However, it will never return more documents than fit in the max batch size limit (usually 4MB). |
|
| 1560 | + * </p> |
|
| 1561 | + * |
|
| 1562 | + * @param int $batchSize The number of results to return per batch. Each batch requires a round-trip to the server. |
|
| 1563 | + * <p>If batchSize is 2 or more, it represents the size of each batch of objects retrieved. |
|
| 1564 | + * It can be adjusted to optimize performance and limit data transfer. |
|
| 1565 | + * </p> |
|
| 1566 | + * |
|
| 1567 | + * <p>If batchSize is 1 or negative, it will limit of number returned documents to the absolute value of batchSize, |
|
| 1568 | + * and the cursor will be closed. For example if batchSize is -10, then the server will return a maximum of 10 |
|
| 1569 | + * documents and as many as can fit in 4MB, then close the cursor. |
|
| 1570 | + * </p> |
|
| 1571 | + * <b>Warning</b> |
|
| 1572 | + * <p>A batchSize of 1 is special, and means the same as -1, i.e. a value of 1 makes the cursor only capable of returning one document. |
|
| 1573 | + * </p> |
|
| 1574 | + * <p>Note that this feature is different from MongoCursor::limit() in that documents must fit within a maximum size, |
|
| 1575 | + * and it removes the need to send a request to close the cursor server-side. |
|
| 1576 | + * The batch size can be changed even after a cursor is iterated, in which case the setting will apply on the next batch retrieval. |
|
| 1577 | + * </p> |
|
| 1578 | + * <p>This cannot override MongoDB's limit on the amount of data it will return to the client (i.e., |
|
| 1579 | + * if you set batch size to 1,000,000,000, MongoDB will still only return 4-16MB of results per batch). |
|
| 1580 | + * </p> |
|
| 1581 | + * <p>To ensure consistent behavior, the rules of MongoCursor::batchSize() and MongoCursor::limit() behave a little complex |
|
| 1582 | + * but work "as expected". The rules are: hard limits override soft limits with preference given to MongoCursor::limit() over |
|
| 1583 | + * MongoCursor::batchSize(). After that, whichever is set and lower than the other will take precedence. |
|
| 1584 | + * See below. section for some examples. |
|
| 1585 | + * </p> |
|
| 1586 | + * |
|
| 1587 | + * @return MongoCursor Returns this cursor. |
|
| 1588 | + * @link https://secure.php.net/manual/en/mongocursor.batchsize.php |
|
| 1589 | + */ |
|
| 1590 | + public function batchSize($batchSize) {} |
|
| 1591 | + |
|
| 1592 | + /** |
|
| 1593 | + * (PECL mongo >= 1.5.0) |
|
| 1594 | + * Sets a server-side timeout for this query |
|
| 1595 | + * @link https://php.net/manual/en/mongocursor.maxtimems.php |
|
| 1596 | + * @param int $ms <p> |
|
| 1597 | + * Specifies a cumulative time limit in milliseconds to be allowed by the |
|
| 1598 | + * server for processing operations on the cursor. |
|
| 1599 | + * </p> |
|
| 1600 | + * @return MongoCursor This cursor. |
|
| 1601 | + */ |
|
| 1602 | + public function maxTimeMS($ms) {} |
|
| 1603 | 1603 | } |
| 1604 | 1604 | |
| 1605 | 1605 | class MongoCommandCursor implements MongoCursorInterface |
| 1606 | 1606 | { |
| 1607 | - /** |
|
| 1608 | - * Return the current element |
|
| 1609 | - * @link https://php.net/manual/en/iterator.current.php |
|
| 1610 | - * @return mixed Can return any type. |
|
| 1611 | - * @since 5.0.0 |
|
| 1612 | - */ |
|
| 1613 | - public function current() {} |
|
| 1614 | - |
|
| 1615 | - /** |
|
| 1616 | - * Move forward to next element |
|
| 1617 | - * @link https://php.net/manual/en/iterator.next.php |
|
| 1618 | - * @return void Any returned value is ignored. |
|
| 1619 | - * @since 5.0.0 |
|
| 1620 | - */ |
|
| 1621 | - public function next() {} |
|
| 1622 | - |
|
| 1623 | - /** |
|
| 1624 | - * Return the key of the current element |
|
| 1625 | - * @link https://php.net/manual/en/iterator.key.php |
|
| 1626 | - * @return mixed scalar on success, or null on failure. |
|
| 1627 | - * @since 5.0.0 |
|
| 1628 | - */ |
|
| 1629 | - public function key() {} |
|
| 1630 | - |
|
| 1631 | - /** |
|
| 1632 | - * Checks if current position is valid |
|
| 1633 | - * @link https://php.net/manual/en/iterator.valid.php |
|
| 1634 | - * @return bool The return value will be casted to boolean and then evaluated. |
|
| 1635 | - * Returns true on success or false on failure. |
|
| 1636 | - * @since 5.0.0 |
|
| 1637 | - */ |
|
| 1638 | - public function valid() {} |
|
| 1639 | - |
|
| 1640 | - /** |
|
| 1641 | - * Rewind the Iterator to the first element |
|
| 1642 | - * @link https://php.net/manual/en/iterator.rewind.php |
|
| 1643 | - * @return void Any returned value is ignored. |
|
| 1644 | - * @since 5.0.0 |
|
| 1645 | - */ |
|
| 1646 | - public function rewind() {} |
|
| 1647 | - |
|
| 1648 | - public function batchSize(int $batchSize): MongoCursorInterface {} |
|
| 1649 | - |
|
| 1650 | - public function dead(): bool {} |
|
| 1651 | - |
|
| 1652 | - public function info(): array {} |
|
| 1653 | - |
|
| 1654 | - public function getReadPreference(): array {} |
|
| 1655 | - |
|
| 1656 | - public function setReadPreference(string $read_preference, array $tags = null): MongoCursorInterface {} |
|
| 1657 | - |
|
| 1658 | - public function timeout(int $ms): MongoCursorInterface {} |
|
| 1607 | + /** |
|
| 1608 | + * Return the current element |
|
| 1609 | + * @link https://php.net/manual/en/iterator.current.php |
|
| 1610 | + * @return mixed Can return any type. |
|
| 1611 | + * @since 5.0.0 |
|
| 1612 | + */ |
|
| 1613 | + public function current() {} |
|
| 1614 | + |
|
| 1615 | + /** |
|
| 1616 | + * Move forward to next element |
|
| 1617 | + * @link https://php.net/manual/en/iterator.next.php |
|
| 1618 | + * @return void Any returned value is ignored. |
|
| 1619 | + * @since 5.0.0 |
|
| 1620 | + */ |
|
| 1621 | + public function next() {} |
|
| 1622 | + |
|
| 1623 | + /** |
|
| 1624 | + * Return the key of the current element |
|
| 1625 | + * @link https://php.net/manual/en/iterator.key.php |
|
| 1626 | + * @return mixed scalar on success, or null on failure. |
|
| 1627 | + * @since 5.0.0 |
|
| 1628 | + */ |
|
| 1629 | + public function key() {} |
|
| 1630 | + |
|
| 1631 | + /** |
|
| 1632 | + * Checks if current position is valid |
|
| 1633 | + * @link https://php.net/manual/en/iterator.valid.php |
|
| 1634 | + * @return bool The return value will be casted to boolean and then evaluated. |
|
| 1635 | + * Returns true on success or false on failure. |
|
| 1636 | + * @since 5.0.0 |
|
| 1637 | + */ |
|
| 1638 | + public function valid() {} |
|
| 1639 | + |
|
| 1640 | + /** |
|
| 1641 | + * Rewind the Iterator to the first element |
|
| 1642 | + * @link https://php.net/manual/en/iterator.rewind.php |
|
| 1643 | + * @return void Any returned value is ignored. |
|
| 1644 | + * @since 5.0.0 |
|
| 1645 | + */ |
|
| 1646 | + public function rewind() {} |
|
| 1647 | + |
|
| 1648 | + public function batchSize(int $batchSize): MongoCursorInterface {} |
|
| 1649 | + |
|
| 1650 | + public function dead(): bool {} |
|
| 1651 | + |
|
| 1652 | + public function info(): array {} |
|
| 1653 | + |
|
| 1654 | + public function getReadPreference(): array {} |
|
| 1655 | + |
|
| 1656 | + public function setReadPreference(string $read_preference, array $tags = null): MongoCursorInterface {} |
|
| 1657 | + |
|
| 1658 | + public function timeout(int $ms): MongoCursorInterface {} |
|
| 1659 | 1659 | } |
| 1660 | 1660 | |
| 1661 | 1661 | interface MongoCursorInterface extends Iterator |
| 1662 | 1662 | { |
| 1663 | - public function batchSize(int $batchSize): MongoCursorInterface; |
|
| 1663 | + public function batchSize(int $batchSize): MongoCursorInterface; |
|
| 1664 | 1664 | |
| 1665 | - public function dead(): bool; |
|
| 1665 | + public function dead(): bool; |
|
| 1666 | 1666 | |
| 1667 | - public function info(): array; |
|
| 1667 | + public function info(): array; |
|
| 1668 | 1668 | |
| 1669 | - public function getReadPreference(): array; |
|
| 1669 | + public function getReadPreference(): array; |
|
| 1670 | 1670 | |
| 1671 | - public function setReadPreference(string $read_preference, array $tags = null): MongoCursorInterface; |
|
| 1671 | + public function setReadPreference(string $read_preference, array $tags = null): MongoCursorInterface; |
|
| 1672 | 1672 | |
| 1673 | - public function timeout(int $ms): MongoCursorInterface; |
|
| 1673 | + public function timeout(int $ms): MongoCursorInterface; |
|
| 1674 | 1674 | } |
| 1675 | 1675 | |
| 1676 | 1676 | class MongoGridFS extends MongoCollection |
| 1677 | 1677 | { |
| 1678 | - public const ASCENDING = 1; |
|
| 1679 | - public const DESCENDING = -1; |
|
| 1680 | - |
|
| 1681 | - /** |
|
| 1682 | - * @link https://php.net/manual/en/class.mongogridfs.php#mongogridfs.props.chunks |
|
| 1683 | - * @var MongoCollection |
|
| 1684 | - */ |
|
| 1685 | - public $chunks; |
|
| 1686 | - |
|
| 1687 | - /** |
|
| 1688 | - * @link https://php.net/manual/en/class.mongogridfs.php#mongogridfs.props.filesname |
|
| 1689 | - * @var string |
|
| 1690 | - */ |
|
| 1691 | - protected $filesName; |
|
| 1692 | - |
|
| 1693 | - /** |
|
| 1694 | - * @link https://php.net/manual/en/class.mongogridfs.php#mongogridfs.props.chunksname |
|
| 1695 | - * @var string |
|
| 1696 | - */ |
|
| 1697 | - protected $chunksName; |
|
| 1698 | - |
|
| 1699 | - /** |
|
| 1700 | - * Files as stored across two collections, the first containing file meta |
|
| 1701 | - * information, the second containing chunks of the actual file. By default, |
|
| 1702 | - * fs.files and fs.chunks are the collection names used. |
|
| 1703 | - * |
|
| 1704 | - * @link https://php.net/manual/en/mongogridfs.construct.php |
|
| 1705 | - * @param MongoDB $db Database |
|
| 1706 | - * @param string $prefix [optional] <p>Optional collection name prefix.</p> |
|
| 1707 | - * @param mixed $chunks [optional] |
|
| 1708 | - */ |
|
| 1709 | - public function __construct($db, $prefix = "fs", $chunks = "fs") {} |
|
| 1710 | - |
|
| 1711 | - /** |
|
| 1712 | - * Drops the files and chunks collections |
|
| 1713 | - * @link https://php.net/manual/en/mongogridfs.drop.php |
|
| 1714 | - * @return array The database response |
|
| 1715 | - */ |
|
| 1716 | - public function drop() {} |
|
| 1717 | - |
|
| 1718 | - /** |
|
| 1719 | - * @link https://php.net/manual/en/mongogridfs.find.php |
|
| 1720 | - * @param array $query The query |
|
| 1721 | - * @param array $fields Fields to return |
|
| 1722 | - * @return MongoGridFSCursor A MongoGridFSCursor |
|
| 1723 | - */ |
|
| 1724 | - public function find(array $query = [], array $fields = []) {} |
|
| 1725 | - |
|
| 1726 | - /** |
|
| 1727 | - * Stores a file in the database |
|
| 1728 | - * @link https://php.net/manual/en/mongogridfs.storefile.php |
|
| 1729 | - * @param string|resource $filename The name of the file |
|
| 1730 | - * @param array $extra Other metadata to add to the file saved |
|
| 1731 | - * @param array $options Options for the store. "safe": Check that this store succeeded |
|
| 1732 | - * @return mixed Returns the _id of the saved object |
|
| 1733 | - */ |
|
| 1734 | - public function storeFile($filename, $extra = [], $options = []) {} |
|
| 1735 | - |
|
| 1736 | - /** |
|
| 1737 | - * Chunkifies and stores bytes in the database |
|
| 1738 | - * @link https://php.net/manual/en/mongogridfs.storebytes.php |
|
| 1739 | - * @param string $bytes A string of bytes to store |
|
| 1740 | - * @param array $extra Other metadata to add to the file saved |
|
| 1741 | - * @param array $options Options for the store. "safe": Check that this store succeeded |
|
| 1742 | - * @return mixed The _id of the object saved |
|
| 1743 | - */ |
|
| 1744 | - public function storeBytes($bytes, $extra = [], $options = []) {} |
|
| 1745 | - |
|
| 1746 | - /** |
|
| 1747 | - * Returns a single file matching the criteria |
|
| 1748 | - * @link https://secure.php.net/manual/en/mongogridfs.findone.php |
|
| 1749 | - * @param array $query The fields for which to search. |
|
| 1750 | - * @param array $fields Fields of the results to return. |
|
| 1751 | - * @return MongoGridFSFile|null |
|
| 1752 | - */ |
|
| 1753 | - public function findOne(array $query = [], array $fields = []) {} |
|
| 1754 | - |
|
| 1755 | - /** |
|
| 1756 | - * Removes files from the collections |
|
| 1757 | - * @link https://secure.php.net/manual/en/mongogridfs.remove.php |
|
| 1758 | - * @param array $criteria Description of records to remove. |
|
| 1759 | - * @param array $options Options for remove. Valid options are: "safe"- Check that the remove succeeded. |
|
| 1760 | - * @throws MongoCursorException |
|
| 1761 | - * @return bool |
|
| 1762 | - */ |
|
| 1763 | - public function remove(array $criteria = [], array $options = []) {} |
|
| 1764 | - |
|
| 1765 | - /** |
|
| 1766 | - * Delete a file from the database |
|
| 1767 | - * @link https://php.net/manual/en/mongogridfs.delete.php |
|
| 1768 | - * @param mixed $id _id of the file to remove |
|
| 1769 | - * @return bool Returns true if the remove was successfully sent to the database. |
|
| 1770 | - */ |
|
| 1771 | - public function delete($id) {} |
|
| 1772 | - |
|
| 1773 | - /** |
|
| 1774 | - * Saves an uploaded file directly from a POST to the database |
|
| 1775 | - * @link https://secure.php.net/manual/en/mongogridfs.storeupload.php |
|
| 1776 | - * @param string $name The name attribute of the uploaded file, from <code><input type="file" name="something"/></code> |
|
| 1777 | - * @param array $metadata An array of extra fields for the uploaded file. |
|
| 1778 | - * @return mixed Returns the _id of the uploaded file. |
|
| 1779 | - */ |
|
| 1780 | - public function storeUpload($name, array $metadata = []) {} |
|
| 1781 | - |
|
| 1782 | - /** |
|
| 1783 | - * Retrieve a file from the database |
|
| 1784 | - * @link https://secure.php.net/manual/en/mongogridfs.get.php |
|
| 1785 | - * @param mixed $id _id of the file to find. |
|
| 1786 | - * @return MongoGridFSFile|null Returns the file, if found, or NULL. |
|
| 1787 | - */ |
|
| 1788 | - public function get($id) {} |
|
| 1789 | - |
|
| 1790 | - /** |
|
| 1791 | - * Stores a file in the database |
|
| 1792 | - * @link https://php.net/manual/en/mongogridfs.put.php |
|
| 1793 | - * @param string $filename The name of the file |
|
| 1794 | - * @param array $extra Other metadata to add to the file saved |
|
| 1795 | - * @return mixed Returns the _id of the saved object |
|
| 1796 | - */ |
|
| 1797 | - public function put($filename, array $extra = []) {} |
|
| 1678 | + public const ASCENDING = 1; |
|
| 1679 | + public const DESCENDING = -1; |
|
| 1680 | + |
|
| 1681 | + /** |
|
| 1682 | + * @link https://php.net/manual/en/class.mongogridfs.php#mongogridfs.props.chunks |
|
| 1683 | + * @var MongoCollection |
|
| 1684 | + */ |
|
| 1685 | + public $chunks; |
|
| 1686 | + |
|
| 1687 | + /** |
|
| 1688 | + * @link https://php.net/manual/en/class.mongogridfs.php#mongogridfs.props.filesname |
|
| 1689 | + * @var string |
|
| 1690 | + */ |
|
| 1691 | + protected $filesName; |
|
| 1692 | + |
|
| 1693 | + /** |
|
| 1694 | + * @link https://php.net/manual/en/class.mongogridfs.php#mongogridfs.props.chunksname |
|
| 1695 | + * @var string |
|
| 1696 | + */ |
|
| 1697 | + protected $chunksName; |
|
| 1698 | + |
|
| 1699 | + /** |
|
| 1700 | + * Files as stored across two collections, the first containing file meta |
|
| 1701 | + * information, the second containing chunks of the actual file. By default, |
|
| 1702 | + * fs.files and fs.chunks are the collection names used. |
|
| 1703 | + * |
|
| 1704 | + * @link https://php.net/manual/en/mongogridfs.construct.php |
|
| 1705 | + * @param MongoDB $db Database |
|
| 1706 | + * @param string $prefix [optional] <p>Optional collection name prefix.</p> |
|
| 1707 | + * @param mixed $chunks [optional] |
|
| 1708 | + */ |
|
| 1709 | + public function __construct($db, $prefix = "fs", $chunks = "fs") {} |
|
| 1710 | + |
|
| 1711 | + /** |
|
| 1712 | + * Drops the files and chunks collections |
|
| 1713 | + * @link https://php.net/manual/en/mongogridfs.drop.php |
|
| 1714 | + * @return array The database response |
|
| 1715 | + */ |
|
| 1716 | + public function drop() {} |
|
| 1717 | + |
|
| 1718 | + /** |
|
| 1719 | + * @link https://php.net/manual/en/mongogridfs.find.php |
|
| 1720 | + * @param array $query The query |
|
| 1721 | + * @param array $fields Fields to return |
|
| 1722 | + * @return MongoGridFSCursor A MongoGridFSCursor |
|
| 1723 | + */ |
|
| 1724 | + public function find(array $query = [], array $fields = []) {} |
|
| 1725 | + |
|
| 1726 | + /** |
|
| 1727 | + * Stores a file in the database |
|
| 1728 | + * @link https://php.net/manual/en/mongogridfs.storefile.php |
|
| 1729 | + * @param string|resource $filename The name of the file |
|
| 1730 | + * @param array $extra Other metadata to add to the file saved |
|
| 1731 | + * @param array $options Options for the store. "safe": Check that this store succeeded |
|
| 1732 | + * @return mixed Returns the _id of the saved object |
|
| 1733 | + */ |
|
| 1734 | + public function storeFile($filename, $extra = [], $options = []) {} |
|
| 1735 | + |
|
| 1736 | + /** |
|
| 1737 | + * Chunkifies and stores bytes in the database |
|
| 1738 | + * @link https://php.net/manual/en/mongogridfs.storebytes.php |
|
| 1739 | + * @param string $bytes A string of bytes to store |
|
| 1740 | + * @param array $extra Other metadata to add to the file saved |
|
| 1741 | + * @param array $options Options for the store. "safe": Check that this store succeeded |
|
| 1742 | + * @return mixed The _id of the object saved |
|
| 1743 | + */ |
|
| 1744 | + public function storeBytes($bytes, $extra = [], $options = []) {} |
|
| 1745 | + |
|
| 1746 | + /** |
|
| 1747 | + * Returns a single file matching the criteria |
|
| 1748 | + * @link https://secure.php.net/manual/en/mongogridfs.findone.php |
|
| 1749 | + * @param array $query The fields for which to search. |
|
| 1750 | + * @param array $fields Fields of the results to return. |
|
| 1751 | + * @return MongoGridFSFile|null |
|
| 1752 | + */ |
|
| 1753 | + public function findOne(array $query = [], array $fields = []) {} |
|
| 1754 | + |
|
| 1755 | + /** |
|
| 1756 | + * Removes files from the collections |
|
| 1757 | + * @link https://secure.php.net/manual/en/mongogridfs.remove.php |
|
| 1758 | + * @param array $criteria Description of records to remove. |
|
| 1759 | + * @param array $options Options for remove. Valid options are: "safe"- Check that the remove succeeded. |
|
| 1760 | + * @throws MongoCursorException |
|
| 1761 | + * @return bool |
|
| 1762 | + */ |
|
| 1763 | + public function remove(array $criteria = [], array $options = []) {} |
|
| 1764 | + |
|
| 1765 | + /** |
|
| 1766 | + * Delete a file from the database |
|
| 1767 | + * @link https://php.net/manual/en/mongogridfs.delete.php |
|
| 1768 | + * @param mixed $id _id of the file to remove |
|
| 1769 | + * @return bool Returns true if the remove was successfully sent to the database. |
|
| 1770 | + */ |
|
| 1771 | + public function delete($id) {} |
|
| 1772 | + |
|
| 1773 | + /** |
|
| 1774 | + * Saves an uploaded file directly from a POST to the database |
|
| 1775 | + * @link https://secure.php.net/manual/en/mongogridfs.storeupload.php |
|
| 1776 | + * @param string $name The name attribute of the uploaded file, from <code><input type="file" name="something"/></code> |
|
| 1777 | + * @param array $metadata An array of extra fields for the uploaded file. |
|
| 1778 | + * @return mixed Returns the _id of the uploaded file. |
|
| 1779 | + */ |
|
| 1780 | + public function storeUpload($name, array $metadata = []) {} |
|
| 1781 | + |
|
| 1782 | + /** |
|
| 1783 | + * Retrieve a file from the database |
|
| 1784 | + * @link https://secure.php.net/manual/en/mongogridfs.get.php |
|
| 1785 | + * @param mixed $id _id of the file to find. |
|
| 1786 | + * @return MongoGridFSFile|null Returns the file, if found, or NULL. |
|
| 1787 | + */ |
|
| 1788 | + public function get($id) {} |
|
| 1789 | + |
|
| 1790 | + /** |
|
| 1791 | + * Stores a file in the database |
|
| 1792 | + * @link https://php.net/manual/en/mongogridfs.put.php |
|
| 1793 | + * @param string $filename The name of the file |
|
| 1794 | + * @param array $extra Other metadata to add to the file saved |
|
| 1795 | + * @return mixed Returns the _id of the saved object |
|
| 1796 | + */ |
|
| 1797 | + public function put($filename, array $extra = []) {} |
|
| 1798 | 1798 | } |
| 1799 | 1799 | |
| 1800 | 1800 | class MongoGridFSFile |
| 1801 | 1801 | { |
| 1802 | - /** |
|
| 1803 | - * @link https://php.net/manual/en/class.mongogridfsfile.php#mongogridfsfile.props.file |
|
| 1804 | - * @var array|null |
|
| 1805 | - */ |
|
| 1806 | - public $file; |
|
| 1807 | - |
|
| 1808 | - /** |
|
| 1809 | - * @link https://php.net/manual/en/class.mongogridfsfile.php#mongogridfsfile.props.gridfs |
|
| 1810 | - * @var MongoGridFS|null |
|
| 1811 | - */ |
|
| 1812 | - protected $gridfs; |
|
| 1813 | - |
|
| 1814 | - /** |
|
| 1815 | - * @link https://php.net/manual/en/mongogridfsfile.construct.php |
|
| 1816 | - * @param MongoGridFS $gridfs The parent MongoGridFS instance |
|
| 1817 | - * @param array $file A file from the database |
|
| 1818 | - */ |
|
| 1819 | - public function __construct($gridfs, array $file) {} |
|
| 1820 | - |
|
| 1821 | - /** |
|
| 1822 | - * Returns this file's filename |
|
| 1823 | - * @link https://php.net/manual/en/mongogridfsfile.getfilename.php |
|
| 1824 | - * @return string Returns the filename |
|
| 1825 | - */ |
|
| 1826 | - public function getFilename() {} |
|
| 1827 | - |
|
| 1828 | - /** |
|
| 1829 | - * Returns this file's size |
|
| 1830 | - * @link https://php.net/manual/en/mongogridfsfile.getsize.php |
|
| 1831 | - * @return int Returns this file's size |
|
| 1832 | - */ |
|
| 1833 | - public function getSize() {} |
|
| 1834 | - |
|
| 1835 | - /** |
|
| 1836 | - * Writes this file to the filesystem |
|
| 1837 | - * @link https://php.net/manual/en/mongogridfsfile.write.php |
|
| 1838 | - * @param string $filename The location to which to write the file (path+filename+extension). If none is given, the stored filename will be used. |
|
| 1839 | - * @return int Returns the number of bytes written |
|
| 1840 | - */ |
|
| 1841 | - public function write($filename = null) {} |
|
| 1842 | - |
|
| 1843 | - /** |
|
| 1844 | - * This will load the file into memory. If the file is bigger than your memory, this will cause problems! |
|
| 1845 | - * @link https://php.net/manual/en/mongogridfsfile.getbytes.php |
|
| 1846 | - * @return string Returns a string of the bytes in the file |
|
| 1847 | - */ |
|
| 1848 | - public function getBytes() {} |
|
| 1849 | - |
|
| 1850 | - /** |
|
| 1851 | - * This method returns a stream resource that can be used to read the stored file with all file functions in PHP. |
|
| 1852 | - * 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. |
|
| 1853 | - * At most two GridFSFile chunks will be loaded in memory. |
|
| 1854 | - * |
|
| 1855 | - * @link https://php.net/manual/en/mongogridfsfile.getresource.php |
|
| 1856 | - * @return resource Returns a resource that can be used to read the file with |
|
| 1857 | - */ |
|
| 1858 | - public function getResource() {} |
|
| 1802 | + /** |
|
| 1803 | + * @link https://php.net/manual/en/class.mongogridfsfile.php#mongogridfsfile.props.file |
|
| 1804 | + * @var array|null |
|
| 1805 | + */ |
|
| 1806 | + public $file; |
|
| 1807 | + |
|
| 1808 | + /** |
|
| 1809 | + * @link https://php.net/manual/en/class.mongogridfsfile.php#mongogridfsfile.props.gridfs |
|
| 1810 | + * @var MongoGridFS|null |
|
| 1811 | + */ |
|
| 1812 | + protected $gridfs; |
|
| 1813 | + |
|
| 1814 | + /** |
|
| 1815 | + * @link https://php.net/manual/en/mongogridfsfile.construct.php |
|
| 1816 | + * @param MongoGridFS $gridfs The parent MongoGridFS instance |
|
| 1817 | + * @param array $file A file from the database |
|
| 1818 | + */ |
|
| 1819 | + public function __construct($gridfs, array $file) {} |
|
| 1820 | + |
|
| 1821 | + /** |
|
| 1822 | + * Returns this file's filename |
|
| 1823 | + * @link https://php.net/manual/en/mongogridfsfile.getfilename.php |
|
| 1824 | + * @return string Returns the filename |
|
| 1825 | + */ |
|
| 1826 | + public function getFilename() {} |
|
| 1827 | + |
|
| 1828 | + /** |
|
| 1829 | + * Returns this file's size |
|
| 1830 | + * @link https://php.net/manual/en/mongogridfsfile.getsize.php |
|
| 1831 | + * @return int Returns this file's size |
|
| 1832 | + */ |
|
| 1833 | + public function getSize() {} |
|
| 1834 | + |
|
| 1835 | + /** |
|
| 1836 | + * Writes this file to the filesystem |
|
| 1837 | + * @link https://php.net/manual/en/mongogridfsfile.write.php |
|
| 1838 | + * @param string $filename The location to which to write the file (path+filename+extension). If none is given, the stored filename will be used. |
|
| 1839 | + * @return int Returns the number of bytes written |
|
| 1840 | + */ |
|
| 1841 | + public function write($filename = null) {} |
|
| 1842 | + |
|
| 1843 | + /** |
|
| 1844 | + * This will load the file into memory. If the file is bigger than your memory, this will cause problems! |
|
| 1845 | + * @link https://php.net/manual/en/mongogridfsfile.getbytes.php |
|
| 1846 | + * @return string Returns a string of the bytes in the file |
|
| 1847 | + */ |
|
| 1848 | + public function getBytes() {} |
|
| 1849 | + |
|
| 1850 | + /** |
|
| 1851 | + * This method returns a stream resource that can be used to read the stored file with all file functions in PHP. |
|
| 1852 | + * 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. |
|
| 1853 | + * At most two GridFSFile chunks will be loaded in memory. |
|
| 1854 | + * |
|
| 1855 | + * @link https://php.net/manual/en/mongogridfsfile.getresource.php |
|
| 1856 | + * @return resource Returns a resource that can be used to read the file with |
|
| 1857 | + */ |
|
| 1858 | + public function getResource() {} |
|
| 1859 | 1859 | } |
| 1860 | 1860 | |
| 1861 | 1861 | class MongoGridFSCursor extends MongoCursor implements Traversable, Iterator |
| 1862 | 1862 | { |
| 1863 | - /** |
|
| 1864 | - * @var bool |
|
| 1865 | - */ |
|
| 1866 | - public static $slaveOkay; |
|
| 1867 | - |
|
| 1868 | - /** |
|
| 1869 | - * @link https://php.net/manual/en/class.mongogridfscursor.php#mongogridfscursor.props.gridfs |
|
| 1870 | - * @var MongoGridFS|null |
|
| 1871 | - */ |
|
| 1872 | - protected $gridfs; |
|
| 1873 | - |
|
| 1874 | - /** |
|
| 1875 | - * Create a new cursor |
|
| 1876 | - * @link https://php.net/manual/en/mongogridfscursor.construct.php |
|
| 1877 | - * @param MongoGridFS $gridfs Related GridFS collection |
|
| 1878 | - * @param resource $connection Database connection |
|
| 1879 | - * @param string $ns Full name of database and collection |
|
| 1880 | - * @param array $query Database query |
|
| 1881 | - * @param array $fields Fields to return |
|
| 1882 | - */ |
|
| 1883 | - public function __construct($gridfs, $connection, $ns, $query, $fields) {} |
|
| 1884 | - |
|
| 1885 | - /** |
|
| 1886 | - * Return the next file to which this cursor points, and advance the cursor |
|
| 1887 | - * @link https://php.net/manual/en/mongogridfscursor.getnext.php |
|
| 1888 | - * @return MongoGridFSFile Returns the next file |
|
| 1889 | - */ |
|
| 1890 | - public function getNext() {} |
|
| 1891 | - |
|
| 1892 | - /** |
|
| 1893 | - * Returns the current file |
|
| 1894 | - * @link https://php.net/manual/en/mongogridfscursor.current.php |
|
| 1895 | - * @return MongoGridFSFile The current file |
|
| 1896 | - */ |
|
| 1897 | - public function current() {} |
|
| 1898 | - |
|
| 1899 | - /** |
|
| 1900 | - * Returns the current result's filename |
|
| 1901 | - * @link https://php.net/manual/en/mongogridfscursor.key.php |
|
| 1902 | - * @return string The current results filename |
|
| 1903 | - */ |
|
| 1904 | - public function key() {} |
|
| 1863 | + /** |
|
| 1864 | + * @var bool |
|
| 1865 | + */ |
|
| 1866 | + public static $slaveOkay; |
|
| 1867 | + |
|
| 1868 | + /** |
|
| 1869 | + * @link https://php.net/manual/en/class.mongogridfscursor.php#mongogridfscursor.props.gridfs |
|
| 1870 | + * @var MongoGridFS|null |
|
| 1871 | + */ |
|
| 1872 | + protected $gridfs; |
|
| 1873 | + |
|
| 1874 | + /** |
|
| 1875 | + * Create a new cursor |
|
| 1876 | + * @link https://php.net/manual/en/mongogridfscursor.construct.php |
|
| 1877 | + * @param MongoGridFS $gridfs Related GridFS collection |
|
| 1878 | + * @param resource $connection Database connection |
|
| 1879 | + * @param string $ns Full name of database and collection |
|
| 1880 | + * @param array $query Database query |
|
| 1881 | + * @param array $fields Fields to return |
|
| 1882 | + */ |
|
| 1883 | + public function __construct($gridfs, $connection, $ns, $query, $fields) {} |
|
| 1884 | + |
|
| 1885 | + /** |
|
| 1886 | + * Return the next file to which this cursor points, and advance the cursor |
|
| 1887 | + * @link https://php.net/manual/en/mongogridfscursor.getnext.php |
|
| 1888 | + * @return MongoGridFSFile Returns the next file |
|
| 1889 | + */ |
|
| 1890 | + public function getNext() {} |
|
| 1891 | + |
|
| 1892 | + /** |
|
| 1893 | + * Returns the current file |
|
| 1894 | + * @link https://php.net/manual/en/mongogridfscursor.current.php |
|
| 1895 | + * @return MongoGridFSFile The current file |
|
| 1896 | + */ |
|
| 1897 | + public function current() {} |
|
| 1898 | + |
|
| 1899 | + /** |
|
| 1900 | + * Returns the current result's filename |
|
| 1901 | + * @link https://php.net/manual/en/mongogridfscursor.key.php |
|
| 1902 | + * @return string The current results filename |
|
| 1903 | + */ |
|
| 1904 | + public function key() {} |
|
| 1905 | 1905 | } |
| 1906 | 1906 | |
| 1907 | 1907 | /** |
@@ -1910,406 +1910,406 @@ discard block |
||
| 1910 | 1910 | */ |
| 1911 | 1911 | class MongoId |
| 1912 | 1912 | { |
| 1913 | - /** |
|
| 1914 | - * @var string <p> Note: The property name begins with a $ character. It may be accessed using |
|
| 1915 | - * {@link https://php.net/manual/en/language.types.string.php#language.types.string.parsing.complex complex variable parsed syntax} (e.g. $mongoId->{'$id'}).</p> |
|
| 1916 | - */ |
|
| 1917 | - public $id = null; |
|
| 1918 | - |
|
| 1919 | - /** |
|
| 1920 | - * (PECL mongo >= 0.8.0) |
|
| 1921 | - * Creates a new id |
|
| 1922 | - * @link https://secure.php.net/manual/en/mongoid.construct.php |
|
| 1923 | - * @param MongoId|string $id [optional] A string to use as the id. Must be 24 hexadecimal characters. If an invalid string is passed to this constructor, the constructor will ignore it and create a new id value. |
|
| 1924 | - */ |
|
| 1925 | - public function __construct($id = null) {} |
|
| 1926 | - |
|
| 1927 | - /** |
|
| 1928 | - * (PECL mongo >= 0.8.0) |
|
| 1929 | - * Check if a value is a valid ObjectId |
|
| 1930 | - * @link https://php.net/manual/en/mongoid.isvalid.php |
|
| 1931 | - * @param mixed $value The value to check for validity. |
|
| 1932 | - * @return bool <p> |
|
| 1933 | - * Returns <b>TRUE</b> if <i>value</i> is a |
|
| 1934 | - * MongoId instance or a string consisting of exactly 24 |
|
| 1935 | - * hexadecimal characters; otherwise, <b>FALSE</b> is returned. |
|
| 1936 | - * </p> |
|
| 1937 | - */ |
|
| 1938 | - public static function isValid($value) {} |
|
| 1939 | - /** |
|
| 1940 | - * (PECL mongo >= 0.8.0) |
|
| 1941 | - * Returns a hexadecimal representation of this id |
|
| 1942 | - * @link https://secure.php.net/manual/en/mongoid.tostring.php |
|
| 1943 | - * @return string This id. |
|
| 1944 | - */ |
|
| 1945 | - public function __toString() {} |
|
| 1946 | - |
|
| 1947 | - /** |
|
| 1948 | - * (PECL mongo >= 1.0.11) |
|
| 1949 | - * Gets the incremented value to create this id |
|
| 1950 | - * @link https://php.net/manual/en/mongoid.getinc.php |
|
| 1951 | - * @return int Returns the incremented value used to create this MongoId. |
|
| 1952 | - */ |
|
| 1953 | - public function getInc() {} |
|
| 1954 | - |
|
| 1955 | - /** |
|
| 1956 | - * (PECL mongo >= 1.0.11) |
|
| 1957 | - * Gets the process ID |
|
| 1958 | - * @link https://php.net/manual/en/mongoid.getpid.php |
|
| 1959 | - * @return int Returns the PID of the MongoId. |
|
| 1960 | - */ |
|
| 1961 | - public function getPID() {} |
|
| 1962 | - |
|
| 1963 | - /** |
|
| 1964 | - * (PECL mongo >= 1.0.1) |
|
| 1965 | - * Gets the number of seconds since the epoch that this id was created |
|
| 1966 | - * @link https://secure.php.net/manual/en/mongoid.gettimestamp.php |
|
| 1967 | - * @return int |
|
| 1968 | - */ |
|
| 1969 | - public function getTimestamp() {} |
|
| 1970 | - |
|
| 1971 | - /** |
|
| 1972 | - * (PECL mongo >= 1.0.8) |
|
| 1973 | - * Gets the hostname being used for this machine's ids |
|
| 1974 | - * @link https://secure.php.net/manual/en/mongoid.gethostname.php |
|
| 1975 | - * @return string Returns the hostname. |
|
| 1976 | - */ |
|
| 1977 | - public static function getHostname() {} |
|
| 1978 | - |
|
| 1979 | - /** |
|
| 1980 | - * (PECL mongo >= 1.0.8) |
|
| 1981 | - * Create a dummy MongoId |
|
| 1982 | - * @link https://php.net/manual/en/mongoid.set-state.php |
|
| 1983 | - * @param array $props <p>Theoretically, an array of properties used to create the new id. However, as MongoId instances have no properties, this is not used.</p> |
|
| 1984 | - * @return MongoId A new id with the value "000000000000000000000000". |
|
| 1985 | - */ |
|
| 1986 | - public static function __set_state(array $props) {} |
|
| 1913 | + /** |
|
| 1914 | + * @var string <p> Note: The property name begins with a $ character. It may be accessed using |
|
| 1915 | + * {@link https://php.net/manual/en/language.types.string.php#language.types.string.parsing.complex complex variable parsed syntax} (e.g. $mongoId->{'$id'}).</p> |
|
| 1916 | + */ |
|
| 1917 | + public $id = null; |
|
| 1918 | + |
|
| 1919 | + /** |
|
| 1920 | + * (PECL mongo >= 0.8.0) |
|
| 1921 | + * Creates a new id |
|
| 1922 | + * @link https://secure.php.net/manual/en/mongoid.construct.php |
|
| 1923 | + * @param MongoId|string $id [optional] A string to use as the id. Must be 24 hexadecimal characters. If an invalid string is passed to this constructor, the constructor will ignore it and create a new id value. |
|
| 1924 | + */ |
|
| 1925 | + public function __construct($id = null) {} |
|
| 1926 | + |
|
| 1927 | + /** |
|
| 1928 | + * (PECL mongo >= 0.8.0) |
|
| 1929 | + * Check if a value is a valid ObjectId |
|
| 1930 | + * @link https://php.net/manual/en/mongoid.isvalid.php |
|
| 1931 | + * @param mixed $value The value to check for validity. |
|
| 1932 | + * @return bool <p> |
|
| 1933 | + * Returns <b>TRUE</b> if <i>value</i> is a |
|
| 1934 | + * MongoId instance or a string consisting of exactly 24 |
|
| 1935 | + * hexadecimal characters; otherwise, <b>FALSE</b> is returned. |
|
| 1936 | + * </p> |
|
| 1937 | + */ |
|
| 1938 | + public static function isValid($value) {} |
|
| 1939 | + /** |
|
| 1940 | + * (PECL mongo >= 0.8.0) |
|
| 1941 | + * Returns a hexadecimal representation of this id |
|
| 1942 | + * @link https://secure.php.net/manual/en/mongoid.tostring.php |
|
| 1943 | + * @return string This id. |
|
| 1944 | + */ |
|
| 1945 | + public function __toString() {} |
|
| 1946 | + |
|
| 1947 | + /** |
|
| 1948 | + * (PECL mongo >= 1.0.11) |
|
| 1949 | + * Gets the incremented value to create this id |
|
| 1950 | + * @link https://php.net/manual/en/mongoid.getinc.php |
|
| 1951 | + * @return int Returns the incremented value used to create this MongoId. |
|
| 1952 | + */ |
|
| 1953 | + public function getInc() {} |
|
| 1954 | + |
|
| 1955 | + /** |
|
| 1956 | + * (PECL mongo >= 1.0.11) |
|
| 1957 | + * Gets the process ID |
|
| 1958 | + * @link https://php.net/manual/en/mongoid.getpid.php |
|
| 1959 | + * @return int Returns the PID of the MongoId. |
|
| 1960 | + */ |
|
| 1961 | + public function getPID() {} |
|
| 1962 | + |
|
| 1963 | + /** |
|
| 1964 | + * (PECL mongo >= 1.0.1) |
|
| 1965 | + * Gets the number of seconds since the epoch that this id was created |
|
| 1966 | + * @link https://secure.php.net/manual/en/mongoid.gettimestamp.php |
|
| 1967 | + * @return int |
|
| 1968 | + */ |
|
| 1969 | + public function getTimestamp() {} |
|
| 1970 | + |
|
| 1971 | + /** |
|
| 1972 | + * (PECL mongo >= 1.0.8) |
|
| 1973 | + * Gets the hostname being used for this machine's ids |
|
| 1974 | + * @link https://secure.php.net/manual/en/mongoid.gethostname.php |
|
| 1975 | + * @return string Returns the hostname. |
|
| 1976 | + */ |
|
| 1977 | + public static function getHostname() {} |
|
| 1978 | + |
|
| 1979 | + /** |
|
| 1980 | + * (PECL mongo >= 1.0.8) |
|
| 1981 | + * Create a dummy MongoId |
|
| 1982 | + * @link https://php.net/manual/en/mongoid.set-state.php |
|
| 1983 | + * @param array $props <p>Theoretically, an array of properties used to create the new id. However, as MongoId instances have no properties, this is not used.</p> |
|
| 1984 | + * @return MongoId A new id with the value "000000000000000000000000". |
|
| 1985 | + */ |
|
| 1986 | + public static function __set_state(array $props) {} |
|
| 1987 | 1987 | } |
| 1988 | 1988 | |
| 1989 | 1989 | class MongoCode |
| 1990 | 1990 | { |
| 1991 | - /** |
|
| 1992 | - * @var string |
|
| 1993 | - */ |
|
| 1994 | - public $code; |
|
| 1995 | - |
|
| 1996 | - /** |
|
| 1997 | - * @var array |
|
| 1998 | - */ |
|
| 1999 | - public $scope; |
|
| 2000 | - |
|
| 2001 | - /** |
|
| 2002 | - * . |
|
| 2003 | - * |
|
| 2004 | - * @link https://php.net/manual/en/mongocode.construct.php |
|
| 2005 | - * @param string $code A string of code |
|
| 2006 | - * @param array $scope The scope to use for the code |
|
| 2007 | - */ |
|
| 2008 | - public function __construct($code, array $scope = []) {} |
|
| 2009 | - |
|
| 2010 | - /** |
|
| 2011 | - * Returns this code as a string |
|
| 2012 | - * @return string |
|
| 2013 | - */ |
|
| 2014 | - public function __toString() {} |
|
| 1991 | + /** |
|
| 1992 | + * @var string |
|
| 1993 | + */ |
|
| 1994 | + public $code; |
|
| 1995 | + |
|
| 1996 | + /** |
|
| 1997 | + * @var array |
|
| 1998 | + */ |
|
| 1999 | + public $scope; |
|
| 2000 | + |
|
| 2001 | + /** |
|
| 2002 | + * . |
|
| 2003 | + * |
|
| 2004 | + * @link https://php.net/manual/en/mongocode.construct.php |
|
| 2005 | + * @param string $code A string of code |
|
| 2006 | + * @param array $scope The scope to use for the code |
|
| 2007 | + */ |
|
| 2008 | + public function __construct($code, array $scope = []) {} |
|
| 2009 | + |
|
| 2010 | + /** |
|
| 2011 | + * Returns this code as a string |
|
| 2012 | + * @return string |
|
| 2013 | + */ |
|
| 2014 | + public function __toString() {} |
|
| 2015 | 2015 | } |
| 2016 | 2016 | |
| 2017 | 2017 | class MongoRegex |
| 2018 | 2018 | { |
| 2019 | - /** |
|
| 2020 | - * @link https://php.net/manual/en/class.mongoregex.php#mongoregex.props.regex |
|
| 2021 | - * @var string |
|
| 2022 | - */ |
|
| 2023 | - public $regex; |
|
| 2024 | - |
|
| 2025 | - /** |
|
| 2026 | - * @link https://php.net/manual/en/class.mongoregex.php#mongoregex.props.flags |
|
| 2027 | - * @var string |
|
| 2028 | - */ |
|
| 2029 | - public $flags; |
|
| 2030 | - |
|
| 2031 | - /** |
|
| 2032 | - * Creates a new regular expression. |
|
| 2033 | - * |
|
| 2034 | - * @link https://php.net/manual/en/mongoregex.construct.php |
|
| 2035 | - * @param string $regex Regular expression string of the form /expr/flags |
|
| 2036 | - */ |
|
| 2037 | - public function __construct($regex) {} |
|
| 2038 | - |
|
| 2039 | - /** |
|
| 2040 | - * Returns a string representation of this regular expression. |
|
| 2041 | - * @return string This regular expression in the form "/expr/flags". |
|
| 2042 | - */ |
|
| 2043 | - public function __toString() {} |
|
| 2019 | + /** |
|
| 2020 | + * @link https://php.net/manual/en/class.mongoregex.php#mongoregex.props.regex |
|
| 2021 | + * @var string |
|
| 2022 | + */ |
|
| 2023 | + public $regex; |
|
| 2024 | + |
|
| 2025 | + /** |
|
| 2026 | + * @link https://php.net/manual/en/class.mongoregex.php#mongoregex.props.flags |
|
| 2027 | + * @var string |
|
| 2028 | + */ |
|
| 2029 | + public $flags; |
|
| 2030 | + |
|
| 2031 | + /** |
|
| 2032 | + * Creates a new regular expression. |
|
| 2033 | + * |
|
| 2034 | + * @link https://php.net/manual/en/mongoregex.construct.php |
|
| 2035 | + * @param string $regex Regular expression string of the form /expr/flags |
|
| 2036 | + */ |
|
| 2037 | + public function __construct($regex) {} |
|
| 2038 | + |
|
| 2039 | + /** |
|
| 2040 | + * Returns a string representation of this regular expression. |
|
| 2041 | + * @return string This regular expression in the form "/expr/flags". |
|
| 2042 | + */ |
|
| 2043 | + public function __toString() {} |
|
| 2044 | 2044 | } |
| 2045 | 2045 | |
| 2046 | 2046 | class MongoDate |
| 2047 | 2047 | { |
| 2048 | - /** |
|
| 2049 | - * @link https://php.net/manual/en/class.mongodate.php#mongodate.props.sec |
|
| 2050 | - * @var int |
|
| 2051 | - */ |
|
| 2052 | - public $sec; |
|
| 2053 | - |
|
| 2054 | - /** |
|
| 2055 | - * @link https://php.net/manual/en/class.mongodate.php#mongodate.props.usec |
|
| 2056 | - * @var int |
|
| 2057 | - */ |
|
| 2058 | - public $usec; |
|
| 2059 | - |
|
| 2060 | - /** |
|
| 2061 | - * Creates a new date. If no parameters are given, the current time is used. |
|
| 2062 | - * |
|
| 2063 | - * @link https://php.net/manual/en/mongodate.construct.php |
|
| 2064 | - * @param int $sec Number of seconds since January 1st, 1970 |
|
| 2065 | - * @param int $usec Microseconds |
|
| 2066 | - */ |
|
| 2067 | - public function __construct($sec = 0, $usec = 0) {} |
|
| 2068 | - |
|
| 2069 | - /** |
|
| 2070 | - * Returns a DateTime object representing this date |
|
| 2071 | - * @link https://php.net/manual/en/mongodate.todatetime.php |
|
| 2072 | - * @return DateTime |
|
| 2073 | - */ |
|
| 2074 | - public function toDateTime() {} |
|
| 2075 | - |
|
| 2076 | - /** |
|
| 2077 | - * Returns a string representation of this date |
|
| 2078 | - * @return string |
|
| 2079 | - */ |
|
| 2080 | - public function __toString() {} |
|
| 2048 | + /** |
|
| 2049 | + * @link https://php.net/manual/en/class.mongodate.php#mongodate.props.sec |
|
| 2050 | + * @var int |
|
| 2051 | + */ |
|
| 2052 | + public $sec; |
|
| 2053 | + |
|
| 2054 | + /** |
|
| 2055 | + * @link https://php.net/manual/en/class.mongodate.php#mongodate.props.usec |
|
| 2056 | + * @var int |
|
| 2057 | + */ |
|
| 2058 | + public $usec; |
|
| 2059 | + |
|
| 2060 | + /** |
|
| 2061 | + * Creates a new date. If no parameters are given, the current time is used. |
|
| 2062 | + * |
|
| 2063 | + * @link https://php.net/manual/en/mongodate.construct.php |
|
| 2064 | + * @param int $sec Number of seconds since January 1st, 1970 |
|
| 2065 | + * @param int $usec Microseconds |
|
| 2066 | + */ |
|
| 2067 | + public function __construct($sec = 0, $usec = 0) {} |
|
| 2068 | + |
|
| 2069 | + /** |
|
| 2070 | + * Returns a DateTime object representing this date |
|
| 2071 | + * @link https://php.net/manual/en/mongodate.todatetime.php |
|
| 2072 | + * @return DateTime |
|
| 2073 | + */ |
|
| 2074 | + public function toDateTime() {} |
|
| 2075 | + |
|
| 2076 | + /** |
|
| 2077 | + * Returns a string representation of this date |
|
| 2078 | + * @return string |
|
| 2079 | + */ |
|
| 2080 | + public function __toString() {} |
|
| 2081 | 2081 | } |
| 2082 | 2082 | |
| 2083 | 2083 | class MongoBinData |
| 2084 | 2084 | { |
| 2085 | - /** |
|
| 2086 | - * Generic binary data. |
|
| 2087 | - * @link https://php.net/manual/en/class.mongobindata.php#mongobindata.constants.custom |
|
| 2088 | - */ |
|
| 2089 | - public const GENERIC = 0x0; |
|
| 2090 | - |
|
| 2091 | - /** |
|
| 2092 | - * Function |
|
| 2093 | - * @link https://php.net/manual/en/class.mongobindata.php#mongobindata.constants.func |
|
| 2094 | - */ |
|
| 2095 | - public const FUNC = 0x1; |
|
| 2096 | - |
|
| 2097 | - /** |
|
| 2098 | - * Generic binary data (deprecated in favor of MongoBinData::GENERIC) |
|
| 2099 | - * @link https://php.net/manual/en/class.mongobindata.php#mongobindata.constants.byte-array |
|
| 2100 | - */ |
|
| 2101 | - public const BYTE_ARRAY = 0x2; |
|
| 2102 | - |
|
| 2103 | - /** |
|
| 2104 | - * Universally unique identifier (deprecated in favor of MongoBinData::UUID_RFC4122) |
|
| 2105 | - * @link https://php.net/manual/en/class.mongobindata.php#mongobindata.constants.uuid |
|
| 2106 | - */ |
|
| 2107 | - public const UUID = 0x3; |
|
| 2108 | - |
|
| 2109 | - /** |
|
| 2110 | - * Universally unique identifier (according to » RFC 4122) |
|
| 2111 | - * @link https://php.net/manual/en/class.mongobindata.php#mongobindata.constants.custom |
|
| 2112 | - */ |
|
| 2113 | - public const UUID_RFC4122 = 0x4; |
|
| 2114 | - |
|
| 2115 | - /** |
|
| 2116 | - * MD5 |
|
| 2117 | - * @link https://php.net/manual/en/class.mongobindata.php#mongobindata.constants.md5 |
|
| 2118 | - */ |
|
| 2119 | - public const MD5 = 0x5; |
|
| 2120 | - |
|
| 2121 | - /** |
|
| 2122 | - * User-defined type |
|
| 2123 | - * @link https://php.net/manual/en/class.mongobindata.php#mongobindata.constants.custom |
|
| 2124 | - */ |
|
| 2125 | - public const CUSTOM = 0x80; |
|
| 2126 | - |
|
| 2127 | - /** |
|
| 2128 | - * @link https://php.net/manual/en/class.mongobindata.php#mongobindata.props.bin |
|
| 2129 | - * @var string |
|
| 2130 | - */ |
|
| 2131 | - public $bin; |
|
| 2132 | - |
|
| 2133 | - /** |
|
| 2134 | - * @link https://php.net/manual/en/class.mongobindata.php#mongobindata.props.type |
|
| 2135 | - * @var int |
|
| 2136 | - */ |
|
| 2137 | - public $type; |
|
| 2138 | - |
|
| 2139 | - /** |
|
| 2140 | - * Creates a new binary data object. |
|
| 2141 | - * |
|
| 2142 | - * @link https://php.net/manual/en/mongobindata.construct.php |
|
| 2143 | - * @param string $data Binary data |
|
| 2144 | - * @param int $type Data type |
|
| 2145 | - */ |
|
| 2146 | - public function __construct($data, $type = 2) {} |
|
| 2147 | - |
|
| 2148 | - /** |
|
| 2149 | - * Returns the string representation of this binary data object. |
|
| 2150 | - * @return string |
|
| 2151 | - */ |
|
| 2152 | - public function __toString() {} |
|
| 2085 | + /** |
|
| 2086 | + * Generic binary data. |
|
| 2087 | + * @link https://php.net/manual/en/class.mongobindata.php#mongobindata.constants.custom |
|
| 2088 | + */ |
|
| 2089 | + public const GENERIC = 0x0; |
|
| 2090 | + |
|
| 2091 | + /** |
|
| 2092 | + * Function |
|
| 2093 | + * @link https://php.net/manual/en/class.mongobindata.php#mongobindata.constants.func |
|
| 2094 | + */ |
|
| 2095 | + public const FUNC = 0x1; |
|
| 2096 | + |
|
| 2097 | + /** |
|
| 2098 | + * Generic binary data (deprecated in favor of MongoBinData::GENERIC) |
|
| 2099 | + * @link https://php.net/manual/en/class.mongobindata.php#mongobindata.constants.byte-array |
|
| 2100 | + */ |
|
| 2101 | + public const BYTE_ARRAY = 0x2; |
|
| 2102 | + |
|
| 2103 | + /** |
|
| 2104 | + * Universally unique identifier (deprecated in favor of MongoBinData::UUID_RFC4122) |
|
| 2105 | + * @link https://php.net/manual/en/class.mongobindata.php#mongobindata.constants.uuid |
|
| 2106 | + */ |
|
| 2107 | + public const UUID = 0x3; |
|
| 2108 | + |
|
| 2109 | + /** |
|
| 2110 | + * Universally unique identifier (according to » RFC 4122) |
|
| 2111 | + * @link https://php.net/manual/en/class.mongobindata.php#mongobindata.constants.custom |
|
| 2112 | + */ |
|
| 2113 | + public const UUID_RFC4122 = 0x4; |
|
| 2114 | + |
|
| 2115 | + /** |
|
| 2116 | + * MD5 |
|
| 2117 | + * @link https://php.net/manual/en/class.mongobindata.php#mongobindata.constants.md5 |
|
| 2118 | + */ |
|
| 2119 | + public const MD5 = 0x5; |
|
| 2120 | + |
|
| 2121 | + /** |
|
| 2122 | + * User-defined type |
|
| 2123 | + * @link https://php.net/manual/en/class.mongobindata.php#mongobindata.constants.custom |
|
| 2124 | + */ |
|
| 2125 | + public const CUSTOM = 0x80; |
|
| 2126 | + |
|
| 2127 | + /** |
|
| 2128 | + * @link https://php.net/manual/en/class.mongobindata.php#mongobindata.props.bin |
|
| 2129 | + * @var string |
|
| 2130 | + */ |
|
| 2131 | + public $bin; |
|
| 2132 | + |
|
| 2133 | + /** |
|
| 2134 | + * @link https://php.net/manual/en/class.mongobindata.php#mongobindata.props.type |
|
| 2135 | + * @var int |
|
| 2136 | + */ |
|
| 2137 | + public $type; |
|
| 2138 | + |
|
| 2139 | + /** |
|
| 2140 | + * Creates a new binary data object. |
|
| 2141 | + * |
|
| 2142 | + * @link https://php.net/manual/en/mongobindata.construct.php |
|
| 2143 | + * @param string $data Binary data |
|
| 2144 | + * @param int $type Data type |
|
| 2145 | + */ |
|
| 2146 | + public function __construct($data, $type = 2) {} |
|
| 2147 | + |
|
| 2148 | + /** |
|
| 2149 | + * Returns the string representation of this binary data object. |
|
| 2150 | + * @return string |
|
| 2151 | + */ |
|
| 2152 | + public function __toString() {} |
|
| 2153 | 2153 | } |
| 2154 | 2154 | |
| 2155 | 2155 | class MongoDBRef |
| 2156 | 2156 | { |
| 2157 | - /** |
|
| 2158 | - * @var string |
|
| 2159 | - */ |
|
| 2160 | - protected static $refKey = '$ref'; |
|
| 2161 | - |
|
| 2162 | - /** |
|
| 2163 | - * @var string |
|
| 2164 | - */ |
|
| 2165 | - protected static $idKey = '$id'; |
|
| 2166 | - |
|
| 2167 | - /** |
|
| 2168 | - * If no database is given, the current database is used. |
|
| 2169 | - * |
|
| 2170 | - * @link https://php.net/manual/en/mongodbref.create.php |
|
| 2171 | - * @param string $collection Collection name (without the database name) |
|
| 2172 | - * @param mixed $id The _id field of the object to which to link |
|
| 2173 | - * @param string $database Database name |
|
| 2174 | - * @return array Returns the reference |
|
| 2175 | - */ |
|
| 2176 | - public static function create($collection, $id, $database = null) {} |
|
| 2177 | - |
|
| 2178 | - /** |
|
| 2179 | - * This not actually follow the reference, so it does not determine if it is broken or not. |
|
| 2180 | - * It merely checks that $ref is in valid database reference format (in that it is an object or array with $ref and $id fields). |
|
| 2181 | - * |
|
| 2182 | - * @link https://php.net/manual/en/mongodbref.isref.php |
|
| 2183 | - * @param mixed $ref Array or object to check |
|
| 2184 | - * @return bool Returns true if $ref is a reference |
|
| 2185 | - */ |
|
| 2186 | - public static function isRef($ref) {} |
|
| 2187 | - |
|
| 2188 | - /** |
|
| 2189 | - * Fetches the object pointed to by a reference |
|
| 2190 | - * @link https://php.net/manual/en/mongodbref.get.php |
|
| 2191 | - * @param MongoDB $db Database to use |
|
| 2192 | - * @param array $ref Reference to fetch |
|
| 2193 | - * @return array|null Returns the document to which the reference refers or null if the document does not exist (the reference is broken) |
|
| 2194 | - */ |
|
| 2195 | - public static function get($db, $ref) {} |
|
| 2157 | + /** |
|
| 2158 | + * @var string |
|
| 2159 | + */ |
|
| 2160 | + protected static $refKey = '$ref'; |
|
| 2161 | + |
|
| 2162 | + /** |
|
| 2163 | + * @var string |
|
| 2164 | + */ |
|
| 2165 | + protected static $idKey = '$id'; |
|
| 2166 | + |
|
| 2167 | + /** |
|
| 2168 | + * If no database is given, the current database is used. |
|
| 2169 | + * |
|
| 2170 | + * @link https://php.net/manual/en/mongodbref.create.php |
|
| 2171 | + * @param string $collection Collection name (without the database name) |
|
| 2172 | + * @param mixed $id The _id field of the object to which to link |
|
| 2173 | + * @param string $database Database name |
|
| 2174 | + * @return array Returns the reference |
|
| 2175 | + */ |
|
| 2176 | + public static function create($collection, $id, $database = null) {} |
|
| 2177 | + |
|
| 2178 | + /** |
|
| 2179 | + * This not actually follow the reference, so it does not determine if it is broken or not. |
|
| 2180 | + * It merely checks that $ref is in valid database reference format (in that it is an object or array with $ref and $id fields). |
|
| 2181 | + * |
|
| 2182 | + * @link https://php.net/manual/en/mongodbref.isref.php |
|
| 2183 | + * @param mixed $ref Array or object to check |
|
| 2184 | + * @return bool Returns true if $ref is a reference |
|
| 2185 | + */ |
|
| 2186 | + public static function isRef($ref) {} |
|
| 2187 | + |
|
| 2188 | + /** |
|
| 2189 | + * Fetches the object pointed to by a reference |
|
| 2190 | + * @link https://php.net/manual/en/mongodbref.get.php |
|
| 2191 | + * @param MongoDB $db Database to use |
|
| 2192 | + * @param array $ref Reference to fetch |
|
| 2193 | + * @return array|null Returns the document to which the reference refers or null if the document does not exist (the reference is broken) |
|
| 2194 | + */ |
|
| 2195 | + public static function get($db, $ref) {} |
|
| 2196 | 2196 | } |
| 2197 | 2197 | |
| 2198 | 2198 | class MongoWriteBatch |
| 2199 | 2199 | { |
| 2200 | - public const COMMAND_INSERT = 1; |
|
| 2201 | - public const COMMAND_UPDATE = 2; |
|
| 2202 | - public const COMMAND_DELETE = 3; |
|
| 2203 | - |
|
| 2204 | - /** |
|
| 2205 | - * <p>(PECL mongo >= 1.5.0)</p> |
|
| 2206 | - * MongoWriteBatch constructor. |
|
| 2207 | - * @link https://php.net/manual/en/mongowritebatch.construct.php |
|
| 2208 | - * @param MongoCollection $collection The {@see MongoCollection} to execute the batch on. |
|
| 2209 | - * Its {@link https://php.net/manual/en/mongo.writeconcerns.php write concern} |
|
| 2210 | - * will be copied and used as the default write concern if none is given as <code >$write_options</code> or during |
|
| 2211 | - * {@see MongoWriteBatch::execute()}. |
|
| 2212 | - * @param string $batch_type [optional] <p> |
|
| 2213 | - * One of: |
|
| 2214 | - * </p><ul> |
|
| 2215 | - * <li class="member"><em>0</em> - make an MongoWriteBatch::COMMAND_INSERT batch</li> |
|
| 2216 | - * <li class="member"><em>1</em> - make an MongoWriteBatch::COMMAND_UPDATE batch</li> |
|
| 2217 | - * <li class="member"><em>2</em> - make a MongoWriteBatch::COMMAND_DELETE batch</li> |
|
| 2218 | - * </ul> |
|
| 2219 | - * @param array $write_options [optional] |
|
| 2220 | - * <p> An array of Write Options.</p><table><thead><tr><th>key</th><th>value meaning</th></tr> |
|
| 2221 | - * </thead> |
|
| 2222 | - * <tbody><tr><td>w (int|string)</td><td>{@link https://php.net/manual/en/mongo.writeconcerns.php Write concern} value</td></tr> |
|
| 2223 | - * <tr><td>wtimeout (int)</td><td>{@link https://php.net/manual/en/mongo.writeconcerns.php Maximum time to wait for replication}</td></tr> |
|
| 2224 | - * <tr><td>ordered</td><td>Determins if MongoDB must apply this batch in order (sequentally, one item at a time) or can rearrange it. |
|
| 2225 | - * Defaults to <strong><code>TRUE</code></strong></td></tr> |
|
| 2226 | - * <tr><td>j (bool)</td><td>Wait for journaling on the primary. This value is discouraged, use WriteConcern instead</td></tr> |
|
| 2227 | - * <tr><td>fsync (bool)</td><td>Wait for fsync on the primary. This value is discouraged, use WriteConcern instead</td></tr> |
|
| 2228 | - * </tbody></table> |
|
| 2229 | - */ |
|
| 2230 | - protected function __construct($collection, $batch_type, $write_options) {} |
|
| 2231 | - |
|
| 2232 | - /** |
|
| 2233 | - * <p>(PECL mongo >= 1.5.0)</p> |
|
| 2234 | - * Adds a write operation to a batch |
|
| 2235 | - * @link https://php.net/manual/en/mongowritebatch.add.php |
|
| 2236 | - * @param array $item <p> |
|
| 2237 | - * An array that describes a write operation. The structure of this value |
|
| 2238 | - * depends on the batch's operation type. |
|
| 2239 | - * </p><table> |
|
| 2240 | - * <thead> |
|
| 2241 | - * <tr> |
|
| 2242 | - * <th>Batch type</th> |
|
| 2243 | - * <th>Argument expectation</th> |
|
| 2244 | - * </tr> |
|
| 2245 | - * |
|
| 2246 | - * </thead> |
|
| 2247 | - * |
|
| 2248 | - * <tbody> |
|
| 2249 | - * <tr> |
|
| 2250 | - * <td><strong><code>MongoWriteBatch::COMMAND_INSERT</code></strong></td> |
|
| 2251 | - * <td> |
|
| 2252 | - * The document to add. |
|
| 2253 | - * </td> |
|
| 2254 | - * </tr> |
|
| 2255 | - * <tr> |
|
| 2256 | - * <td><strong><code>MongoWriteBatch::COMMAND_UPDATE</code></strong></td> |
|
| 2257 | - * <td> |
|
| 2258 | - * <p>Raw update operation.</p> |
|
| 2259 | - * <p>Required keys are <em>"q"</em> and <em>"u"</em>, which correspond to the |
|
| 2260 | - * <code>$criteria</code> and <code>$new_object</code> parameters of {@see MongoCollection::update()}, respectively.</p> |
|
| 2261 | - * <p>Optional keys are <em>"multi"</em> and <em>"upsert"</em>, which correspond to the |
|
| 2262 | - * <em>"multiple"</em> and <em>"upsert"</em> options for {@see MongoCollection::update()}, respectively. |
|
| 2263 | - * If unspecified, both options default to <strong><code>FALSE</code></strong>.</p> |
|
| 2264 | - * </td> |
|
| 2265 | - * </tr> |
|
| 2266 | - * <tr> |
|
| 2267 | - * <td><strong><code>MongoWriteBatch::COMMAND_DELETE</code></strong></td> |
|
| 2268 | - * <td> |
|
| 2269 | - * <p class="para">Raw delete operation.</p> |
|
| 2270 | - * <p>Required keys are: <em>"q"</em> and <em>"limit"</em>, which correspond to the <code>$criteria</code> parameter |
|
| 2271 | - * and <em>"justOne"</em> option of {@see MongoCollection::remove()}, respectively.</p> |
|
| 2272 | - * <p>The <em>"limit"</em> option is an integer; however, MongoDB only supports <em>0</em> (i.e. remove all matching |
|
| 2273 | - * ocuments) and <em>1</em> (i.e. remove at most one matching document) at this time.</p> |
|
| 2274 | - * </td> |
|
| 2275 | - * </tr> |
|
| 2276 | - * </tbody> |
|
| 2277 | - * </table> |
|
| 2278 | - * @return bool <b>Returns TRUE on success and throws an exception on failure.</b> |
|
| 2279 | - */ |
|
| 2280 | - public function add(array $item) {} |
|
| 2281 | - |
|
| 2282 | - /** |
|
| 2283 | - * <p>(PECL mongo >= 1.5.0)</p> |
|
| 2284 | - * Executes a batch of write operations |
|
| 2285 | - * @link https://php.net/manual/en/mongowritebatch.execute.php |
|
| 2286 | - * @param array $write_options See {@see MongoWriteBatch::__construct} |
|
| 2287 | - * @return array Returns an array containing statistical information for the full batch. |
|
| 2288 | - * If the batch had to be split into multiple batches, the return value will aggregate the values from individual batches and return only the totals. |
|
| 2289 | - * If the batch was empty, an array containing only the 'ok' field is returned (as <b>TRUE</b>) although nothing will be shipped over the wire (NOOP). |
|
| 2290 | - */ |
|
| 2291 | - final public function execute(array $write_options) {} |
|
| 2200 | + public const COMMAND_INSERT = 1; |
|
| 2201 | + public const COMMAND_UPDATE = 2; |
|
| 2202 | + public const COMMAND_DELETE = 3; |
|
| 2203 | + |
|
| 2204 | + /** |
|
| 2205 | + * <p>(PECL mongo >= 1.5.0)</p> |
|
| 2206 | + * MongoWriteBatch constructor. |
|
| 2207 | + * @link https://php.net/manual/en/mongowritebatch.construct.php |
|
| 2208 | + * @param MongoCollection $collection The {@see MongoCollection} to execute the batch on. |
|
| 2209 | + * Its {@link https://php.net/manual/en/mongo.writeconcerns.php write concern} |
|
| 2210 | + * will be copied and used as the default write concern if none is given as <code >$write_options</code> or during |
|
| 2211 | + * {@see MongoWriteBatch::execute()}. |
|
| 2212 | + * @param string $batch_type [optional] <p> |
|
| 2213 | + * One of: |
|
| 2214 | + * </p><ul> |
|
| 2215 | + * <li class="member"><em>0</em> - make an MongoWriteBatch::COMMAND_INSERT batch</li> |
|
| 2216 | + * <li class="member"><em>1</em> - make an MongoWriteBatch::COMMAND_UPDATE batch</li> |
|
| 2217 | + * <li class="member"><em>2</em> - make a MongoWriteBatch::COMMAND_DELETE batch</li> |
|
| 2218 | + * </ul> |
|
| 2219 | + * @param array $write_options [optional] |
|
| 2220 | + * <p> An array of Write Options.</p><table><thead><tr><th>key</th><th>value meaning</th></tr> |
|
| 2221 | + * </thead> |
|
| 2222 | + * <tbody><tr><td>w (int|string)</td><td>{@link https://php.net/manual/en/mongo.writeconcerns.php Write concern} value</td></tr> |
|
| 2223 | + * <tr><td>wtimeout (int)</td><td>{@link https://php.net/manual/en/mongo.writeconcerns.php Maximum time to wait for replication}</td></tr> |
|
| 2224 | + * <tr><td>ordered</td><td>Determins if MongoDB must apply this batch in order (sequentally, one item at a time) or can rearrange it. |
|
| 2225 | + * Defaults to <strong><code>TRUE</code></strong></td></tr> |
|
| 2226 | + * <tr><td>j (bool)</td><td>Wait for journaling on the primary. This value is discouraged, use WriteConcern instead</td></tr> |
|
| 2227 | + * <tr><td>fsync (bool)</td><td>Wait for fsync on the primary. This value is discouraged, use WriteConcern instead</td></tr> |
|
| 2228 | + * </tbody></table> |
|
| 2229 | + */ |
|
| 2230 | + protected function __construct($collection, $batch_type, $write_options) {} |
|
| 2231 | + |
|
| 2232 | + /** |
|
| 2233 | + * <p>(PECL mongo >= 1.5.0)</p> |
|
| 2234 | + * Adds a write operation to a batch |
|
| 2235 | + * @link https://php.net/manual/en/mongowritebatch.add.php |
|
| 2236 | + * @param array $item <p> |
|
| 2237 | + * An array that describes a write operation. The structure of this value |
|
| 2238 | + * depends on the batch's operation type. |
|
| 2239 | + * </p><table> |
|
| 2240 | + * <thead> |
|
| 2241 | + * <tr> |
|
| 2242 | + * <th>Batch type</th> |
|
| 2243 | + * <th>Argument expectation</th> |
|
| 2244 | + * </tr> |
|
| 2245 | + * |
|
| 2246 | + * </thead> |
|
| 2247 | + * |
|
| 2248 | + * <tbody> |
|
| 2249 | + * <tr> |
|
| 2250 | + * <td><strong><code>MongoWriteBatch::COMMAND_INSERT</code></strong></td> |
|
| 2251 | + * <td> |
|
| 2252 | + * The document to add. |
|
| 2253 | + * </td> |
|
| 2254 | + * </tr> |
|
| 2255 | + * <tr> |
|
| 2256 | + * <td><strong><code>MongoWriteBatch::COMMAND_UPDATE</code></strong></td> |
|
| 2257 | + * <td> |
|
| 2258 | + * <p>Raw update operation.</p> |
|
| 2259 | + * <p>Required keys are <em>"q"</em> and <em>"u"</em>, which correspond to the |
|
| 2260 | + * <code>$criteria</code> and <code>$new_object</code> parameters of {@see MongoCollection::update()}, respectively.</p> |
|
| 2261 | + * <p>Optional keys are <em>"multi"</em> and <em>"upsert"</em>, which correspond to the |
|
| 2262 | + * <em>"multiple"</em> and <em>"upsert"</em> options for {@see MongoCollection::update()}, respectively. |
|
| 2263 | + * If unspecified, both options default to <strong><code>FALSE</code></strong>.</p> |
|
| 2264 | + * </td> |
|
| 2265 | + * </tr> |
|
| 2266 | + * <tr> |
|
| 2267 | + * <td><strong><code>MongoWriteBatch::COMMAND_DELETE</code></strong></td> |
|
| 2268 | + * <td> |
|
| 2269 | + * <p class="para">Raw delete operation.</p> |
|
| 2270 | + * <p>Required keys are: <em>"q"</em> and <em>"limit"</em>, which correspond to the <code>$criteria</code> parameter |
|
| 2271 | + * and <em>"justOne"</em> option of {@see MongoCollection::remove()}, respectively.</p> |
|
| 2272 | + * <p>The <em>"limit"</em> option is an integer; however, MongoDB only supports <em>0</em> (i.e. remove all matching |
|
| 2273 | + * ocuments) and <em>1</em> (i.e. remove at most one matching document) at this time.</p> |
|
| 2274 | + * </td> |
|
| 2275 | + * </tr> |
|
| 2276 | + * </tbody> |
|
| 2277 | + * </table> |
|
| 2278 | + * @return bool <b>Returns TRUE on success and throws an exception on failure.</b> |
|
| 2279 | + */ |
|
| 2280 | + public function add(array $item) {} |
|
| 2281 | + |
|
| 2282 | + /** |
|
| 2283 | + * <p>(PECL mongo >= 1.5.0)</p> |
|
| 2284 | + * Executes a batch of write operations |
|
| 2285 | + * @link https://php.net/manual/en/mongowritebatch.execute.php |
|
| 2286 | + * @param array $write_options See {@see MongoWriteBatch::__construct} |
|
| 2287 | + * @return array Returns an array containing statistical information for the full batch. |
|
| 2288 | + * If the batch had to be split into multiple batches, the return value will aggregate the values from individual batches and return only the totals. |
|
| 2289 | + * If the batch was empty, an array containing only the 'ok' field is returned (as <b>TRUE</b>) although nothing will be shipped over the wire (NOOP). |
|
| 2290 | + */ |
|
| 2291 | + final public function execute(array $write_options) {} |
|
| 2292 | 2292 | } |
| 2293 | 2293 | |
| 2294 | 2294 | class MongoUpdateBatch extends MongoWriteBatch |
| 2295 | 2295 | { |
| 2296 | - /** |
|
| 2297 | - * <p>(PECL mongo >= 1.5.0)</p> |
|
| 2298 | - * MongoUpdateBatch constructor. |
|
| 2299 | - * @link https://php.net/manual/en/mongoupdatebatch.construct.php |
|
| 2300 | - * @param MongoCollection $collection <p>The MongoCollection to execute the batch on. |
|
| 2301 | - * Its write concern will be copied and used as the default write concern |
|
| 2302 | - * if none is given as $write_options or during {@see MongoWriteBatch::execute()}.</p> |
|
| 2303 | - * @param array $write_options <p class="para">An array of Write Options.</p><table class="doctable informaltable"><thead><tr><th>key</th><th>value meaning</th></tr> |
|
| 2304 | - * </thead> |
|
| 2305 | - * <tbody class="tbody"><tr><td>w (int|string)</td><td>{@link https://php.net/manual/en/mongo.writeconcerns.php Write concern} value</td></tr> |
|
| 2306 | - * <tr><td>wtimeout (int)</td><td>{@link https://php.net/manual/en/mongo.writeconcerns.php Maximum time to wait for replication}</td></tr> |
|
| 2307 | - * <tr><td>ordered</td><td>Determins if MongoDB must apply this batch in order (sequentally, one item at a time) or can rearrange it. Defaults to <strong><code>TRUE</code></strong></td></tr> |
|
| 2308 | - * <tr><td>j (bool)</td><td>Wait for journaling on the primary. This value is discouraged, use WriteConcern instead</td></tr> |
|
| 2309 | - * <tr><td>fsync (bool)</td><td>Wait for fsync on the primary. This value is discouraged, use WriteConcern instead</td></tr> |
|
| 2310 | - * </tbody></table> |
|
| 2311 | - */ |
|
| 2312 | - public function __construct(MongoCollection $collection, array $write_options) {} |
|
| 2296 | + /** |
|
| 2297 | + * <p>(PECL mongo >= 1.5.0)</p> |
|
| 2298 | + * MongoUpdateBatch constructor. |
|
| 2299 | + * @link https://php.net/manual/en/mongoupdatebatch.construct.php |
|
| 2300 | + * @param MongoCollection $collection <p>The MongoCollection to execute the batch on. |
|
| 2301 | + * Its write concern will be copied and used as the default write concern |
|
| 2302 | + * if none is given as $write_options or during {@see MongoWriteBatch::execute()}.</p> |
|
| 2303 | + * @param array $write_options <p class="para">An array of Write Options.</p><table class="doctable informaltable"><thead><tr><th>key</th><th>value meaning</th></tr> |
|
| 2304 | + * </thead> |
|
| 2305 | + * <tbody class="tbody"><tr><td>w (int|string)</td><td>{@link https://php.net/manual/en/mongo.writeconcerns.php Write concern} value</td></tr> |
|
| 2306 | + * <tr><td>wtimeout (int)</td><td>{@link https://php.net/manual/en/mongo.writeconcerns.php Maximum time to wait for replication}</td></tr> |
|
| 2307 | + * <tr><td>ordered</td><td>Determins if MongoDB must apply this batch in order (sequentally, one item at a time) or can rearrange it. Defaults to <strong><code>TRUE</code></strong></td></tr> |
|
| 2308 | + * <tr><td>j (bool)</td><td>Wait for journaling on the primary. This value is discouraged, use WriteConcern instead</td></tr> |
|
| 2309 | + * <tr><td>fsync (bool)</td><td>Wait for fsync on the primary. This value is discouraged, use WriteConcern instead</td></tr> |
|
| 2310 | + * </tbody></table> |
|
| 2311 | + */ |
|
| 2312 | + public function __construct(MongoCollection $collection, array $write_options) {} |
|
| 2313 | 2313 | } |
| 2314 | 2314 | |
| 2315 | 2315 | class MongoException extends Exception {} |
@@ -2328,12 +2328,12 @@ discard block |
||
| 2328 | 2328 | */ |
| 2329 | 2329 | class MongoWriteConcernException extends MongoCursorException |
| 2330 | 2330 | { |
| 2331 | - /** |
|
| 2332 | - * Get the error document |
|
| 2333 | - * @link https://php.net/manual/en/mongowriteconcernexception.getdocument.php |
|
| 2334 | - * @return array <p>A MongoDB document, if available, as an array.</p> |
|
| 2335 | - */ |
|
| 2336 | - public function getDocument() {} |
|
| 2331 | + /** |
|
| 2332 | + * Get the error document |
|
| 2333 | + * @link https://php.net/manual/en/mongowriteconcernexception.getdocument.php |
|
| 2334 | + * @return array <p>A MongoDB document, if available, as an array.</p> |
|
| 2335 | + */ |
|
| 2336 | + public function getDocument() {} |
|
| 2337 | 2337 | } |
| 2338 | 2338 | |
| 2339 | 2339 | /** |
@@ -2359,271 +2359,271 @@ discard block |
||
| 2359 | 2359 | */ |
| 2360 | 2360 | class MongoResultException extends MongoException |
| 2361 | 2361 | { |
| 2362 | - /** |
|
| 2363 | - * <p>(PECL mongo >= 1.3.0)</p> |
|
| 2364 | - * Retrieve the full result document |
|
| 2365 | - * https://secure.php.net/manual/en/mongoresultexception.getdocument.php |
|
| 2366 | - * @return array <p>The full result document as an array, including partial data if available and additional keys.</p> |
|
| 2367 | - */ |
|
| 2368 | - public function getDocument() {} |
|
| 2369 | - |
|
| 2370 | - public $document; |
|
| 2362 | + /** |
|
| 2363 | + * <p>(PECL mongo >= 1.3.0)</p> |
|
| 2364 | + * Retrieve the full result document |
|
| 2365 | + * https://secure.php.net/manual/en/mongoresultexception.getdocument.php |
|
| 2366 | + * @return array <p>The full result document as an array, including partial data if available and additional keys.</p> |
|
| 2367 | + */ |
|
| 2368 | + public function getDocument() {} |
|
| 2369 | + |
|
| 2370 | + public $document; |
|
| 2371 | 2371 | } |
| 2372 | 2372 | |
| 2373 | 2373 | class MongoTimestamp |
| 2374 | 2374 | { |
| 2375 | - /** |
|
| 2376 | - * @link https://php.net/manual/en/class.mongotimestamp.php#mongotimestamp.props.sec |
|
| 2377 | - * @var int |
|
| 2378 | - */ |
|
| 2379 | - public $sec; |
|
| 2380 | - |
|
| 2381 | - /** |
|
| 2382 | - * @link https://php.net/manual/en/class.mongotimestamp.php#mongotimestamp.props.inc |
|
| 2383 | - * @var int |
|
| 2384 | - */ |
|
| 2385 | - public $inc; |
|
| 2386 | - |
|
| 2387 | - /** |
|
| 2388 | - * Creates a new timestamp. If no parameters are given, the current time is used |
|
| 2389 | - * and the increment is automatically provided. The increment is set to 0 when the |
|
| 2390 | - * module is loaded and is incremented every time this constructor is called |
|
| 2391 | - * (without the $inc parameter passed in). |
|
| 2392 | - * |
|
| 2393 | - * @link https://php.net/manual/en/mongotimestamp.construct.php |
|
| 2394 | - * @param int $sec [optional] Number of seconds since January 1st, 1970 |
|
| 2395 | - * @param int $inc [optional] Increment |
|
| 2396 | - */ |
|
| 2397 | - public function __construct($sec = 0, $inc) {} |
|
| 2398 | - |
|
| 2399 | - /** |
|
| 2400 | - * @return string |
|
| 2401 | - */ |
|
| 2402 | - public function __toString() {} |
|
| 2375 | + /** |
|
| 2376 | + * @link https://php.net/manual/en/class.mongotimestamp.php#mongotimestamp.props.sec |
|
| 2377 | + * @var int |
|
| 2378 | + */ |
|
| 2379 | + public $sec; |
|
| 2380 | + |
|
| 2381 | + /** |
|
| 2382 | + * @link https://php.net/manual/en/class.mongotimestamp.php#mongotimestamp.props.inc |
|
| 2383 | + * @var int |
|
| 2384 | + */ |
|
| 2385 | + public $inc; |
|
| 2386 | + |
|
| 2387 | + /** |
|
| 2388 | + * Creates a new timestamp. If no parameters are given, the current time is used |
|
| 2389 | + * and the increment is automatically provided. The increment is set to 0 when the |
|
| 2390 | + * module is loaded and is incremented every time this constructor is called |
|
| 2391 | + * (without the $inc parameter passed in). |
|
| 2392 | + * |
|
| 2393 | + * @link https://php.net/manual/en/mongotimestamp.construct.php |
|
| 2394 | + * @param int $sec [optional] Number of seconds since January 1st, 1970 |
|
| 2395 | + * @param int $inc [optional] Increment |
|
| 2396 | + */ |
|
| 2397 | + public function __construct($sec = 0, $inc) {} |
|
| 2398 | + |
|
| 2399 | + /** |
|
| 2400 | + * @return string |
|
| 2401 | + */ |
|
| 2402 | + public function __toString() {} |
|
| 2403 | 2403 | } |
| 2404 | 2404 | |
| 2405 | 2405 | class MongoInt32 |
| 2406 | 2406 | { |
| 2407 | - /** |
|
| 2408 | - * @link https://php.net/manual/en/class.mongoint32.php#mongoint32.props.value |
|
| 2409 | - * @var string |
|
| 2410 | - */ |
|
| 2411 | - public $value; |
|
| 2412 | - |
|
| 2413 | - /** |
|
| 2414 | - * Creates a new 32-bit number with the given value. |
|
| 2415 | - * |
|
| 2416 | - * @link https://php.net/manual/en/mongoint32.construct.php |
|
| 2417 | - * @param string $value A number |
|
| 2418 | - */ |
|
| 2419 | - public function __construct($value) {} |
|
| 2420 | - |
|
| 2421 | - /** |
|
| 2422 | - * @return string |
|
| 2423 | - */ |
|
| 2424 | - public function __toString() {} |
|
| 2407 | + /** |
|
| 2408 | + * @link https://php.net/manual/en/class.mongoint32.php#mongoint32.props.value |
|
| 2409 | + * @var string |
|
| 2410 | + */ |
|
| 2411 | + public $value; |
|
| 2412 | + |
|
| 2413 | + /** |
|
| 2414 | + * Creates a new 32-bit number with the given value. |
|
| 2415 | + * |
|
| 2416 | + * @link https://php.net/manual/en/mongoint32.construct.php |
|
| 2417 | + * @param string $value A number |
|
| 2418 | + */ |
|
| 2419 | + public function __construct($value) {} |
|
| 2420 | + |
|
| 2421 | + /** |
|
| 2422 | + * @return string |
|
| 2423 | + */ |
|
| 2424 | + public function __toString() {} |
|
| 2425 | 2425 | } |
| 2426 | 2426 | |
| 2427 | 2427 | class MongoInt64 |
| 2428 | 2428 | { |
| 2429 | - /** |
|
| 2430 | - * @link https://php.net/manual/en/class.mongoint64.php#mongoint64.props.value |
|
| 2431 | - * @var string |
|
| 2432 | - */ |
|
| 2433 | - public $value; |
|
| 2434 | - |
|
| 2435 | - /** |
|
| 2436 | - * Creates a new 64-bit number with the given value. |
|
| 2437 | - * |
|
| 2438 | - * @link https://php.net/manual/en/mongoint64.construct.php |
|
| 2439 | - * @param string $value A number |
|
| 2440 | - */ |
|
| 2441 | - public function __construct($value) {} |
|
| 2442 | - |
|
| 2443 | - /** |
|
| 2444 | - * @return string |
|
| 2445 | - */ |
|
| 2446 | - public function __toString() {} |
|
| 2429 | + /** |
|
| 2430 | + * @link https://php.net/manual/en/class.mongoint64.php#mongoint64.props.value |
|
| 2431 | + * @var string |
|
| 2432 | + */ |
|
| 2433 | + public $value; |
|
| 2434 | + |
|
| 2435 | + /** |
|
| 2436 | + * Creates a new 64-bit number with the given value. |
|
| 2437 | + * |
|
| 2438 | + * @link https://php.net/manual/en/mongoint64.construct.php |
|
| 2439 | + * @param string $value A number |
|
| 2440 | + */ |
|
| 2441 | + public function __construct($value) {} |
|
| 2442 | + |
|
| 2443 | + /** |
|
| 2444 | + * @return string |
|
| 2445 | + */ |
|
| 2446 | + public function __toString() {} |
|
| 2447 | 2447 | } |
| 2448 | 2448 | |
| 2449 | 2449 | class MongoLog |
| 2450 | 2450 | { |
| 2451 | - /** |
|
| 2452 | - * @link https://php.net/manual/en/class.mongolog.php#mongolog.constants.none |
|
| 2453 | - */ |
|
| 2454 | - public const NONE = 0; |
|
| 2455 | - |
|
| 2456 | - /** |
|
| 2457 | - * @link https://php.net/manual/en/class.mongolog.php#mongolog.constants.all |
|
| 2458 | - */ |
|
| 2459 | - public const ALL = 0; |
|
| 2460 | - |
|
| 2461 | - /** |
|
| 2462 | - * @link https://php.net/manual/en/class.mongolog.php#mongolog.constants.warning |
|
| 2463 | - */ |
|
| 2464 | - public const WARNING = 0; |
|
| 2465 | - |
|
| 2466 | - /** |
|
| 2467 | - * @link https://php.net/manual/en/class.mongolog.php#mongolog.constants.info |
|
| 2468 | - */ |
|
| 2469 | - public const INFO = 0; |
|
| 2470 | - |
|
| 2471 | - /** |
|
| 2472 | - * @link https://php.net/manual/en/class.mongolog.php#mongolog.constants.fine |
|
| 2473 | - */ |
|
| 2474 | - public const FINE = 0; |
|
| 2475 | - |
|
| 2476 | - /** |
|
| 2477 | - * @link https://php.net/manual/en/class.mongolog.php#mongolog.constants.rs |
|
| 2478 | - */ |
|
| 2479 | - public const RS = 0; |
|
| 2480 | - |
|
| 2481 | - /** |
|
| 2482 | - * @link https://php.net/manual/en/class.mongolog.php#mongolog.constants.pool |
|
| 2483 | - */ |
|
| 2484 | - public const POOL = 0; |
|
| 2485 | - |
|
| 2486 | - /** |
|
| 2487 | - * @link https://php.net/manual/en/class.mongolog.php#mongolog.constants.io |
|
| 2488 | - */ |
|
| 2489 | - public const IO = 0; |
|
| 2490 | - |
|
| 2491 | - /** |
|
| 2492 | - * @link https://php.net/manual/en/class.mongolog.php#mongolog.constants.server |
|
| 2493 | - */ |
|
| 2494 | - public const SERVER = 0; |
|
| 2495 | - |
|
| 2496 | - /** |
|
| 2497 | - * @link https://php.net/manual/en/class.mongolog.php#mongolog.constants.parse |
|
| 2498 | - */ |
|
| 2499 | - public const PARSE = 0; |
|
| 2500 | - |
|
| 2501 | - public const CON = 2; |
|
| 2502 | - |
|
| 2503 | - /** |
|
| 2504 | - * (PECL mongo >= 1.3.0)<br/> |
|
| 2505 | - * <p> |
|
| 2506 | - * This function will set a callback function to be called for {@link https://secure.php.net/manual/en/class.mongolog.php MongoLog} events |
|
| 2507 | - * instead of triggering warnings. |
|
| 2508 | - * </p> |
|
| 2509 | - * @link https://secure.php.net/manual/en/mongolog.setcallback.php |
|
| 2510 | - * @param callable $log_function <p> |
|
| 2511 | - * The function to be called on events. |
|
| 2512 | - * </p> |
|
| 2513 | - * <p> |
|
| 2514 | - * The function should have the following prototype |
|
| 2515 | - * </p> |
|
| 2516 | - * |
|
| 2517 | - * <em>log_function</em> ( <em>int</em> <em>$module</em> , <em>int</em> <em>$level</em>, <em>string</em> <em>$message</em>) |
|
| 2518 | - * <ul> |
|
| 2519 | - * <li> |
|
| 2520 | - * <b><i>module</i></b> |
|
| 2521 | - * |
|
| 2522 | - * <p>One of the {@link https://secure.php.net/manual/en/class.mongolog.php#mongolog.constants.module MongoLog module constants}.</p> |
|
| 2523 | - * </li> |
|
| 2524 | - * <li> |
|
| 2525 | - * <b><i>level</i></b> |
|
| 2526 | - * |
|
| 2527 | - * <p>One of the {@link https://secure.php.net/manual/en/class.mongolog.php#mongolog.constants.level MongoLog level constants}.</p> |
|
| 2528 | - * </li> |
|
| 2529 | - * <li> |
|
| 2530 | - * <b><i>message</i></b> |
|
| 2531 | - * |
|
| 2532 | - * <p>The log message itself.</p></li> |
|
| 2533 | - * <ul> |
|
| 2534 | - * @return bool Returns <b>TRUE</b> on success or <b>FALSE</b> on failure. |
|
| 2535 | - */ |
|
| 2536 | - public static function setCallback(callable $log_function) {} |
|
| 2537 | - |
|
| 2538 | - /** |
|
| 2539 | - * This function can be used to set how verbose logging should be and the types of |
|
| 2540 | - * activities that should be logged. Use the constants described in the MongoLog |
|
| 2541 | - * section with bitwise operators to specify levels. |
|
| 2542 | - * |
|
| 2543 | - * @link https://php.net/manual/en/mongolog.setlevel.php |
|
| 2544 | - * @param int $level The levels you would like to log |
|
| 2545 | - * @return void |
|
| 2546 | - */ |
|
| 2547 | - public static function setLevel($level) {} |
|
| 2548 | - |
|
| 2549 | - /** |
|
| 2550 | - * This can be used to see the log level. Use the constants described in the |
|
| 2551 | - * MongoLog section with bitwise operators to check the level. |
|
| 2552 | - * |
|
| 2553 | - * @link https://php.net/manual/en/mongolog.getlevel.php |
|
| 2554 | - * @return int Returns the current level |
|
| 2555 | - */ |
|
| 2556 | - public static function getLevel() {} |
|
| 2557 | - |
|
| 2558 | - /** |
|
| 2559 | - * This function can be used to set which parts of the driver's functionality |
|
| 2560 | - * should be logged. Use the constants described in the MongoLog section with |
|
| 2561 | - * bitwise operators to specify modules. |
|
| 2562 | - * |
|
| 2563 | - * @link https://php.net/manual/en/mongolog.setmodule.php |
|
| 2564 | - * @param int $module The module(s) you would like to log |
|
| 2565 | - * @return void |
|
| 2566 | - */ |
|
| 2567 | - public static function setModule($module) {} |
|
| 2568 | - |
|
| 2569 | - /** |
|
| 2570 | - * This function can be used to see which parts of the driver's functionality are |
|
| 2571 | - * being logged. Use the constants described in the MongoLog section with bitwise |
|
| 2572 | - * operators to check if specific modules are being logged. |
|
| 2573 | - * |
|
| 2574 | - * @link https://php.net/manual/en/mongolog.getmodule.php |
|
| 2575 | - * @return int Returns the modules currently being logged |
|
| 2576 | - */ |
|
| 2577 | - public static function getModule() {} |
|
| 2451 | + /** |
|
| 2452 | + * @link https://php.net/manual/en/class.mongolog.php#mongolog.constants.none |
|
| 2453 | + */ |
|
| 2454 | + public const NONE = 0; |
|
| 2455 | + |
|
| 2456 | + /** |
|
| 2457 | + * @link https://php.net/manual/en/class.mongolog.php#mongolog.constants.all |
|
| 2458 | + */ |
|
| 2459 | + public const ALL = 0; |
|
| 2460 | + |
|
| 2461 | + /** |
|
| 2462 | + * @link https://php.net/manual/en/class.mongolog.php#mongolog.constants.warning |
|
| 2463 | + */ |
|
| 2464 | + public const WARNING = 0; |
|
| 2465 | + |
|
| 2466 | + /** |
|
| 2467 | + * @link https://php.net/manual/en/class.mongolog.php#mongolog.constants.info |
|
| 2468 | + */ |
|
| 2469 | + public const INFO = 0; |
|
| 2470 | + |
|
| 2471 | + /** |
|
| 2472 | + * @link https://php.net/manual/en/class.mongolog.php#mongolog.constants.fine |
|
| 2473 | + */ |
|
| 2474 | + public const FINE = 0; |
|
| 2475 | + |
|
| 2476 | + /** |
|
| 2477 | + * @link https://php.net/manual/en/class.mongolog.php#mongolog.constants.rs |
|
| 2478 | + */ |
|
| 2479 | + public const RS = 0; |
|
| 2480 | + |
|
| 2481 | + /** |
|
| 2482 | + * @link https://php.net/manual/en/class.mongolog.php#mongolog.constants.pool |
|
| 2483 | + */ |
|
| 2484 | + public const POOL = 0; |
|
| 2485 | + |
|
| 2486 | + /** |
|
| 2487 | + * @link https://php.net/manual/en/class.mongolog.php#mongolog.constants.io |
|
| 2488 | + */ |
|
| 2489 | + public const IO = 0; |
|
| 2490 | + |
|
| 2491 | + /** |
|
| 2492 | + * @link https://php.net/manual/en/class.mongolog.php#mongolog.constants.server |
|
| 2493 | + */ |
|
| 2494 | + public const SERVER = 0; |
|
| 2495 | + |
|
| 2496 | + /** |
|
| 2497 | + * @link https://php.net/manual/en/class.mongolog.php#mongolog.constants.parse |
|
| 2498 | + */ |
|
| 2499 | + public const PARSE = 0; |
|
| 2500 | + |
|
| 2501 | + public const CON = 2; |
|
| 2502 | + |
|
| 2503 | + /** |
|
| 2504 | + * (PECL mongo >= 1.3.0)<br/> |
|
| 2505 | + * <p> |
|
| 2506 | + * This function will set a callback function to be called for {@link https://secure.php.net/manual/en/class.mongolog.php MongoLog} events |
|
| 2507 | + * instead of triggering warnings. |
|
| 2508 | + * </p> |
|
| 2509 | + * @link https://secure.php.net/manual/en/mongolog.setcallback.php |
|
| 2510 | + * @param callable $log_function <p> |
|
| 2511 | + * The function to be called on events. |
|
| 2512 | + * </p> |
|
| 2513 | + * <p> |
|
| 2514 | + * The function should have the following prototype |
|
| 2515 | + * </p> |
|
| 2516 | + * |
|
| 2517 | + * <em>log_function</em> ( <em>int</em> <em>$module</em> , <em>int</em> <em>$level</em>, <em>string</em> <em>$message</em>) |
|
| 2518 | + * <ul> |
|
| 2519 | + * <li> |
|
| 2520 | + * <b><i>module</i></b> |
|
| 2521 | + * |
|
| 2522 | + * <p>One of the {@link https://secure.php.net/manual/en/class.mongolog.php#mongolog.constants.module MongoLog module constants}.</p> |
|
| 2523 | + * </li> |
|
| 2524 | + * <li> |
|
| 2525 | + * <b><i>level</i></b> |
|
| 2526 | + * |
|
| 2527 | + * <p>One of the {@link https://secure.php.net/manual/en/class.mongolog.php#mongolog.constants.level MongoLog level constants}.</p> |
|
| 2528 | + * </li> |
|
| 2529 | + * <li> |
|
| 2530 | + * <b><i>message</i></b> |
|
| 2531 | + * |
|
| 2532 | + * <p>The log message itself.</p></li> |
|
| 2533 | + * <ul> |
|
| 2534 | + * @return bool Returns <b>TRUE</b> on success or <b>FALSE</b> on failure. |
|
| 2535 | + */ |
|
| 2536 | + public static function setCallback(callable $log_function) {} |
|
| 2537 | + |
|
| 2538 | + /** |
|
| 2539 | + * This function can be used to set how verbose logging should be and the types of |
|
| 2540 | + * activities that should be logged. Use the constants described in the MongoLog |
|
| 2541 | + * section with bitwise operators to specify levels. |
|
| 2542 | + * |
|
| 2543 | + * @link https://php.net/manual/en/mongolog.setlevel.php |
|
| 2544 | + * @param int $level The levels you would like to log |
|
| 2545 | + * @return void |
|
| 2546 | + */ |
|
| 2547 | + public static function setLevel($level) {} |
|
| 2548 | + |
|
| 2549 | + /** |
|
| 2550 | + * This can be used to see the log level. Use the constants described in the |
|
| 2551 | + * MongoLog section with bitwise operators to check the level. |
|
| 2552 | + * |
|
| 2553 | + * @link https://php.net/manual/en/mongolog.getlevel.php |
|
| 2554 | + * @return int Returns the current level |
|
| 2555 | + */ |
|
| 2556 | + public static function getLevel() {} |
|
| 2557 | + |
|
| 2558 | + /** |
|
| 2559 | + * This function can be used to set which parts of the driver's functionality |
|
| 2560 | + * should be logged. Use the constants described in the MongoLog section with |
|
| 2561 | + * bitwise operators to specify modules. |
|
| 2562 | + * |
|
| 2563 | + * @link https://php.net/manual/en/mongolog.setmodule.php |
|
| 2564 | + * @param int $module The module(s) you would like to log |
|
| 2565 | + * @return void |
|
| 2566 | + */ |
|
| 2567 | + public static function setModule($module) {} |
|
| 2568 | + |
|
| 2569 | + /** |
|
| 2570 | + * This function can be used to see which parts of the driver's functionality are |
|
| 2571 | + * being logged. Use the constants described in the MongoLog section with bitwise |
|
| 2572 | + * operators to check if specific modules are being logged. |
|
| 2573 | + * |
|
| 2574 | + * @link https://php.net/manual/en/mongolog.getmodule.php |
|
| 2575 | + * @return int Returns the modules currently being logged |
|
| 2576 | + */ |
|
| 2577 | + public static function getModule() {} |
|
| 2578 | 2578 | } |
| 2579 | 2579 | |
| 2580 | 2580 | class MongoPool |
| 2581 | 2581 | { |
| 2582 | - /** |
|
| 2583 | - * Returns an array of information about all connection pools. |
|
| 2584 | - * |
|
| 2585 | - * @link https://php.net/manual/en/mongopool.info.php |
|
| 2586 | - * @return array Each connection pool has an identifier, which starts with the host. For |
|
| 2587 | - * each pool, this function shows the following fields: $in use The number of |
|
| 2588 | - * connections currently being used by Mongo instances. $in pool The number of |
|
| 2589 | - * connections currently in the pool (not being used). $remaining The number of |
|
| 2590 | - * connections that could be created by this pool. For example, suppose a pool had |
|
| 2591 | - * 5 connections remaining and 3 connections in the pool. We could create 8 new |
|
| 2592 | - * instances of Mongo before we exhausted this pool (assuming no instances of Mongo |
|
| 2593 | - * went out of scope, returning their connections to the pool). A negative number |
|
| 2594 | - * means that this pool will spawn unlimited connections. Before a pool is created, |
|
| 2595 | - * you can change the max number of connections by calling Mongo::setPoolSize. Once |
|
| 2596 | - * a pool is showing up in the output of this function, its size cannot be changed. |
|
| 2597 | - * $total The total number of connections allowed for this pool. This should be |
|
| 2598 | - * greater than or equal to "in use" + "in pool" (or -1). $timeout The socket |
|
| 2599 | - * timeout for connections in this pool. This is how long connections in this pool |
|
| 2600 | - * will attempt to connect to a server before giving up. $waiting If you have |
|
| 2601 | - * capped the pool size, workers requesting connections from the pool may block |
|
| 2602 | - * until other workers return their connections. This field shows how many |
|
| 2603 | - * milliseconds workers have blocked for connections to be released. If this number |
|
| 2604 | - * keeps increasing, you may want to use MongoPool::setSize to add more connections |
|
| 2605 | - * to your pool |
|
| 2606 | - */ |
|
| 2607 | - public static function info() {} |
|
| 2608 | - |
|
| 2609 | - /** |
|
| 2610 | - * Sets the max number of connections new pools will be able to create. |
|
| 2611 | - * |
|
| 2612 | - * @link https://php.net/manual/en/mongopool.setsize.php |
|
| 2613 | - * @param int $size The max number of connections future pools will be able to |
|
| 2614 | - * create. Negative numbers mean that the pool will spawn an infinite number of |
|
| 2615 | - * connections |
|
| 2616 | - * @return bool Returns the former value of pool size |
|
| 2617 | - */ |
|
| 2618 | - public static function setSize($size) {} |
|
| 2619 | - |
|
| 2620 | - /** |
|
| 2621 | - * . |
|
| 2622 | - * |
|
| 2623 | - * @link https://php.net/manual/en/mongopool.getsize.php |
|
| 2624 | - * @return int Returns the current pool size |
|
| 2625 | - */ |
|
| 2626 | - public static function getSize() {} |
|
| 2582 | + /** |
|
| 2583 | + * Returns an array of information about all connection pools. |
|
| 2584 | + * |
|
| 2585 | + * @link https://php.net/manual/en/mongopool.info.php |
|
| 2586 | + * @return array Each connection pool has an identifier, which starts with the host. For |
|
| 2587 | + * each pool, this function shows the following fields: $in use The number of |
|
| 2588 | + * connections currently being used by Mongo instances. $in pool The number of |
|
| 2589 | + * connections currently in the pool (not being used). $remaining The number of |
|
| 2590 | + * connections that could be created by this pool. For example, suppose a pool had |
|
| 2591 | + * 5 connections remaining and 3 connections in the pool. We could create 8 new |
|
| 2592 | + * instances of Mongo before we exhausted this pool (assuming no instances of Mongo |
|
| 2593 | + * went out of scope, returning their connections to the pool). A negative number |
|
| 2594 | + * means that this pool will spawn unlimited connections. Before a pool is created, |
|
| 2595 | + * you can change the max number of connections by calling Mongo::setPoolSize. Once |
|
| 2596 | + * a pool is showing up in the output of this function, its size cannot be changed. |
|
| 2597 | + * $total The total number of connections allowed for this pool. This should be |
|
| 2598 | + * greater than or equal to "in use" + "in pool" (or -1). $timeout The socket |
|
| 2599 | + * timeout for connections in this pool. This is how long connections in this pool |
|
| 2600 | + * will attempt to connect to a server before giving up. $waiting If you have |
|
| 2601 | + * capped the pool size, workers requesting connections from the pool may block |
|
| 2602 | + * until other workers return their connections. This field shows how many |
|
| 2603 | + * milliseconds workers have blocked for connections to be released. If this number |
|
| 2604 | + * keeps increasing, you may want to use MongoPool::setSize to add more connections |
|
| 2605 | + * to your pool |
|
| 2606 | + */ |
|
| 2607 | + public static function info() {} |
|
| 2608 | + |
|
| 2609 | + /** |
|
| 2610 | + * Sets the max number of connections new pools will be able to create. |
|
| 2611 | + * |
|
| 2612 | + * @link https://php.net/manual/en/mongopool.setsize.php |
|
| 2613 | + * @param int $size The max number of connections future pools will be able to |
|
| 2614 | + * create. Negative numbers mean that the pool will spawn an infinite number of |
|
| 2615 | + * connections |
|
| 2616 | + * @return bool Returns the former value of pool size |
|
| 2617 | + */ |
|
| 2618 | + public static function setSize($size) {} |
|
| 2619 | + |
|
| 2620 | + /** |
|
| 2621 | + * . |
|
| 2622 | + * |
|
| 2623 | + * @link https://php.net/manual/en/mongopool.getsize.php |
|
| 2624 | + * @return int Returns the current pool size |
|
| 2625 | + */ |
|
| 2626 | + public static function getSize() {} |
|
| 2627 | 2627 | } |
| 2628 | 2628 | |
| 2629 | 2629 | class MongoMaxKey {} |
@@ -14,8 +14,7 @@ discard block |
||
| 14 | 14 | * See MongoClient::__construct() and the section on connecting for more information about creating connections. |
| 15 | 15 | * @link https://secure.php.net/manual/en/class.mongoclient.php |
| 16 | 16 | */ |
| 17 | -class MongoClient |
|
| 18 | -{ |
|
| 17 | +class MongoClient { |
|
| 19 | 18 | public const VERSION = '3.x'; |
| 20 | 19 | public const DEFAULT_HOST = "localhost"; |
| 21 | 20 | public const DEFAULT_PORT = 27017; |
@@ -260,8 +259,7 @@ discard block |
||
| 260 | 259 | * @see MongoClient |
| 261 | 260 | */ |
| 262 | 261 | #[Deprecated("This class has been DEPRECATED as of version 1.3.0.")] |
| 263 | -class Mongo extends MongoClient |
|
| 264 | -{ |
|
| 262 | +class Mongo extends MongoClient { |
|
| 265 | 263 | /** |
| 266 | 264 | * (PECL mongo >= 1.2.0)<br/> |
| 267 | 265 | * Get pool size for connection pools |
@@ -416,8 +414,7 @@ discard block |
||
| 416 | 414 | * Instances of this class are used to interact with a database. |
| 417 | 415 | * @link https://secure.php.net/manual/en/class.mongodb.php |
| 418 | 416 | */ |
| 419 | -class MongoDB |
|
| 420 | -{ |
|
| 417 | +class MongoDB { |
|
| 421 | 418 | /** |
| 422 | 419 | * Profiling is off. |
| 423 | 420 | * @link https://php.net/manual/en/class.mongodb.php#mongodb.constants.profiling-off |
@@ -823,8 +820,7 @@ discard block |
||
| 823 | 820 | * Represents a database collection. |
| 824 | 821 | * @link https://secure.php.net/manual/en/class.mongocollection.php |
| 825 | 822 | */ |
| 826 | -class MongoCollection |
|
| 827 | -{ |
|
| 823 | +class MongoCollection { |
|
| 828 | 824 | /** |
| 829 | 825 | * @link https://php.net/manual/en/class.mongocollection.php#mongocollection.constants.ascending |
| 830 | 826 | */ |
@@ -1277,8 +1273,7 @@ discard block |
||
| 1277 | 1273 | * Result object for database query. |
| 1278 | 1274 | * @link https://secure.php.net/manual/en/class.mongocursor.php |
| 1279 | 1275 | */ |
| 1280 | -class MongoCursor implements Iterator |
|
| 1281 | -{ |
|
| 1276 | +class MongoCursor implements Iterator { |
|
| 1282 | 1277 | /** |
| 1283 | 1278 | * @link https://php.net/manual/en/class.mongocursor.php#mongocursor.props.slaveokay |
| 1284 | 1279 | * @var bool |
@@ -1602,8 +1597,7 @@ discard block |
||
| 1602 | 1597 | public function maxTimeMS($ms) {} |
| 1603 | 1598 | } |
| 1604 | 1599 | |
| 1605 | -class MongoCommandCursor implements MongoCursorInterface |
|
| 1606 | -{ |
|
| 1600 | +class MongoCommandCursor implements MongoCursorInterface { |
|
| 1607 | 1601 | /** |
| 1608 | 1602 | * Return the current element |
| 1609 | 1603 | * @link https://php.net/manual/en/iterator.current.php |
@@ -1658,8 +1652,7 @@ discard block |
||
| 1658 | 1652 | public function timeout(int $ms): MongoCursorInterface {} |
| 1659 | 1653 | } |
| 1660 | 1654 | |
| 1661 | -interface MongoCursorInterface extends Iterator |
|
| 1662 | -{ |
|
| 1655 | +interface MongoCursorInterface extends Iterator { |
|
| 1663 | 1656 | public function batchSize(int $batchSize): MongoCursorInterface; |
| 1664 | 1657 | |
| 1665 | 1658 | public function dead(): bool; |
@@ -1673,8 +1666,7 @@ discard block |
||
| 1673 | 1666 | public function timeout(int $ms): MongoCursorInterface; |
| 1674 | 1667 | } |
| 1675 | 1668 | |
| 1676 | -class MongoGridFS extends MongoCollection |
|
| 1677 | -{ |
|
| 1669 | +class MongoGridFS extends MongoCollection { |
|
| 1678 | 1670 | public const ASCENDING = 1; |
| 1679 | 1671 | public const DESCENDING = -1; |
| 1680 | 1672 | |
@@ -1797,8 +1789,7 @@ discard block |
||
| 1797 | 1789 | public function put($filename, array $extra = []) {} |
| 1798 | 1790 | } |
| 1799 | 1791 | |
| 1800 | -class MongoGridFSFile |
|
| 1801 | -{ |
|
| 1792 | +class MongoGridFSFile { |
|
| 1802 | 1793 | /** |
| 1803 | 1794 | * @link https://php.net/manual/en/class.mongogridfsfile.php#mongogridfsfile.props.file |
| 1804 | 1795 | * @var array|null |
@@ -1908,8 +1899,7 @@ discard block |
||
| 1908 | 1899 | * A unique identifier created for database objects. |
| 1909 | 1900 | * @link https://secure.php.net/manual/en/class.mongoid.php |
| 1910 | 1901 | */ |
| 1911 | -class MongoId |
|
| 1912 | -{ |
|
| 1902 | +class MongoId { |
|
| 1913 | 1903 | /** |
| 1914 | 1904 | * @var string <p> Note: The property name begins with a $ character. It may be accessed using |
| 1915 | 1905 | * {@link https://php.net/manual/en/language.types.string.php#language.types.string.parsing.complex complex variable parsed syntax} (e.g. $mongoId->{'$id'}).</p> |
@@ -1986,8 +1976,7 @@ discard block |
||
| 1986 | 1976 | public static function __set_state(array $props) {} |
| 1987 | 1977 | } |
| 1988 | 1978 | |
| 1989 | -class MongoCode |
|
| 1990 | -{ |
|
| 1979 | +class MongoCode { |
|
| 1991 | 1980 | /** |
| 1992 | 1981 | * @var string |
| 1993 | 1982 | */ |
@@ -2014,8 +2003,7 @@ discard block |
||
| 2014 | 2003 | public function __toString() {} |
| 2015 | 2004 | } |
| 2016 | 2005 | |
| 2017 | -class MongoRegex |
|
| 2018 | -{ |
|
| 2006 | +class MongoRegex { |
|
| 2019 | 2007 | /** |
| 2020 | 2008 | * @link https://php.net/manual/en/class.mongoregex.php#mongoregex.props.regex |
| 2021 | 2009 | * @var string |
@@ -2043,8 +2031,7 @@ discard block |
||
| 2043 | 2031 | public function __toString() {} |
| 2044 | 2032 | } |
| 2045 | 2033 | |
| 2046 | -class MongoDate |
|
| 2047 | -{ |
|
| 2034 | +class MongoDate { |
|
| 2048 | 2035 | /** |
| 2049 | 2036 | * @link https://php.net/manual/en/class.mongodate.php#mongodate.props.sec |
| 2050 | 2037 | * @var int |
@@ -2080,8 +2067,7 @@ discard block |
||
| 2080 | 2067 | public function __toString() {} |
| 2081 | 2068 | } |
| 2082 | 2069 | |
| 2083 | -class MongoBinData |
|
| 2084 | -{ |
|
| 2070 | +class MongoBinData { |
|
| 2085 | 2071 | /** |
| 2086 | 2072 | * Generic binary data. |
| 2087 | 2073 | * @link https://php.net/manual/en/class.mongobindata.php#mongobindata.constants.custom |
@@ -2152,8 +2138,7 @@ discard block |
||
| 2152 | 2138 | public function __toString() {} |
| 2153 | 2139 | } |
| 2154 | 2140 | |
| 2155 | -class MongoDBRef |
|
| 2156 | -{ |
|
| 2141 | +class MongoDBRef { |
|
| 2157 | 2142 | /** |
| 2158 | 2143 | * @var string |
| 2159 | 2144 | */ |
@@ -2195,8 +2180,7 @@ discard block |
||
| 2195 | 2180 | public static function get($db, $ref) {} |
| 2196 | 2181 | } |
| 2197 | 2182 | |
| 2198 | -class MongoWriteBatch |
|
| 2199 | -{ |
|
| 2183 | +class MongoWriteBatch { |
|
| 2200 | 2184 | public const COMMAND_INSERT = 1; |
| 2201 | 2185 | public const COMMAND_UPDATE = 2; |
| 2202 | 2186 | public const COMMAND_DELETE = 3; |
@@ -2291,8 +2275,7 @@ discard block |
||
| 2291 | 2275 | final public function execute(array $write_options) {} |
| 2292 | 2276 | } |
| 2293 | 2277 | |
| 2294 | -class MongoUpdateBatch extends MongoWriteBatch |
|
| 2295 | -{ |
|
| 2278 | +class MongoUpdateBatch extends MongoWriteBatch { |
|
| 2296 | 2279 | /** |
| 2297 | 2280 | * <p>(PECL mongo >= 1.5.0)</p> |
| 2298 | 2281 | * MongoUpdateBatch constructor. |
@@ -2326,8 +2309,7 @@ discard block |
||
| 2326 | 2309 | * <p>(PECL mongo >= 1.5.0)</p> |
| 2327 | 2310 | * @link https://php.net/manual/en/class.mongowriteconcernexception.php#class.mongowriteconcernexception |
| 2328 | 2311 | */ |
| 2329 | -class MongoWriteConcernException extends MongoCursorException |
|
| 2330 | -{ |
|
| 2312 | +class MongoWriteConcernException extends MongoCursorException { |
|
| 2331 | 2313 | /** |
| 2332 | 2314 | * Get the error document |
| 2333 | 2315 | * @link https://php.net/manual/en/mongowriteconcernexception.getdocument.php |
@@ -2357,8 +2339,7 @@ discard block |
||
| 2357 | 2339 | * <p>(PECL mongo >= 1.3.0)</p> |
| 2358 | 2340 | * @link https://php.net/manual/en/class.mongoresultexception.php#mongoresultexception.props.document |
| 2359 | 2341 | */ |
| 2360 | -class MongoResultException extends MongoException |
|
| 2361 | -{ |
|
| 2342 | +class MongoResultException extends MongoException { |
|
| 2362 | 2343 | /** |
| 2363 | 2344 | * <p>(PECL mongo >= 1.3.0)</p> |
| 2364 | 2345 | * Retrieve the full result document |
@@ -2370,8 +2351,7 @@ discard block |
||
| 2370 | 2351 | public $document; |
| 2371 | 2352 | } |
| 2372 | 2353 | |
| 2373 | -class MongoTimestamp |
|
| 2374 | -{ |
|
| 2354 | +class MongoTimestamp { |
|
| 2375 | 2355 | /** |
| 2376 | 2356 | * @link https://php.net/manual/en/class.mongotimestamp.php#mongotimestamp.props.sec |
| 2377 | 2357 | * @var int |
@@ -2402,8 +2382,7 @@ discard block |
||
| 2402 | 2382 | public function __toString() {} |
| 2403 | 2383 | } |
| 2404 | 2384 | |
| 2405 | -class MongoInt32 |
|
| 2406 | -{ |
|
| 2385 | +class MongoInt32 { |
|
| 2407 | 2386 | /** |
| 2408 | 2387 | * @link https://php.net/manual/en/class.mongoint32.php#mongoint32.props.value |
| 2409 | 2388 | * @var string |
@@ -2424,8 +2403,7 @@ discard block |
||
| 2424 | 2403 | public function __toString() {} |
| 2425 | 2404 | } |
| 2426 | 2405 | |
| 2427 | -class MongoInt64 |
|
| 2428 | -{ |
|
| 2406 | +class MongoInt64 { |
|
| 2429 | 2407 | /** |
| 2430 | 2408 | * @link https://php.net/manual/en/class.mongoint64.php#mongoint64.props.value |
| 2431 | 2409 | * @var string |
@@ -2446,8 +2424,7 @@ discard block |
||
| 2446 | 2424 | public function __toString() {} |
| 2447 | 2425 | } |
| 2448 | 2426 | |
| 2449 | -class MongoLog |
|
| 2450 | -{ |
|
| 2427 | +class MongoLog { |
|
| 2451 | 2428 | /** |
| 2452 | 2429 | * @link https://php.net/manual/en/class.mongolog.php#mongolog.constants.none |
| 2453 | 2430 | */ |
@@ -2577,8 +2554,7 @@ discard block |
||
| 2577 | 2554 | public static function getModule() {} |
| 2578 | 2555 | } |
| 2579 | 2556 | |
| 2580 | -class MongoPool |
|
| 2581 | -{ |
|
| 2557 | +class MongoPool { |
|
| 2582 | 2558 | /** |
| 2583 | 2559 | * Returns an array of information about all connection pools. |
| 2584 | 2560 | * |
@@ -14,20 +14,20 @@ discard block |
||
| 14 | 14 | */ |
| 15 | 15 | final class mysqli_sql_exception extends RuntimeException |
| 16 | 16 | { |
| 17 | - /** |
|
| 18 | - * The sql state with the error. |
|
| 19 | - * |
|
| 20 | - * @var string |
|
| 21 | - */ |
|
| 22 | - #[LanguageLevelTypeAware(['8.1' => 'string'], default: '')] |
|
| 23 | - protected $sqlstate; |
|
| 24 | - |
|
| 25 | - /** |
|
| 26 | - * The error code |
|
| 27 | - * |
|
| 28 | - * @var int |
|
| 29 | - */ |
|
| 30 | - protected $code; |
|
| 17 | + /** |
|
| 18 | + * The sql state with the error. |
|
| 19 | + * |
|
| 20 | + * @var string |
|
| 21 | + */ |
|
| 22 | + #[LanguageLevelTypeAware(['8.1' => 'string'], default: '')] |
|
| 23 | + protected $sqlstate; |
|
| 24 | + |
|
| 25 | + /** |
|
| 26 | + * The error code |
|
| 27 | + * |
|
| 28 | + * @var int |
|
| 29 | + */ |
|
| 30 | + protected $code; |
|
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | /** |
@@ -36,35 +36,35 @@ discard block |
||
| 36 | 36 | */ |
| 37 | 37 | final class mysqli_driver |
| 38 | 38 | { |
| 39 | - /** |
|
| 40 | - * @var string |
|
| 41 | - */ |
|
| 42 | - #[LanguageLevelTypeAware(['8.1' => 'string'], default: '')] |
|
| 43 | - public $client_info; |
|
| 44 | - /** |
|
| 45 | - * @var string |
|
| 46 | - */ |
|
| 47 | - #[LanguageLevelTypeAware(['8.1' => 'int'], default: '')] |
|
| 48 | - public $client_version; |
|
| 49 | - /** |
|
| 50 | - * @var string |
|
| 51 | - */ |
|
| 52 | - #[LanguageLevelTypeAware(['8.1' => 'int'], default: '')] |
|
| 53 | - public $driver_version; |
|
| 54 | - /** |
|
| 55 | - * @var string |
|
| 56 | - */ |
|
| 57 | - public $embedded; |
|
| 58 | - /** |
|
| 59 | - * @var bool |
|
| 60 | - */ |
|
| 61 | - #[LanguageLevelTypeAware(['8.1' => 'bool'], default: '')] |
|
| 62 | - public $reconnect; |
|
| 63 | - /** |
|
| 64 | - * @var int |
|
| 65 | - */ |
|
| 66 | - #[LanguageLevelTypeAware(['8.1' => 'int'], default: '')] |
|
| 67 | - public $report_mode; |
|
| 39 | + /** |
|
| 40 | + * @var string |
|
| 41 | + */ |
|
| 42 | + #[LanguageLevelTypeAware(['8.1' => 'string'], default: '')] |
|
| 43 | + public $client_info; |
|
| 44 | + /** |
|
| 45 | + * @var string |
|
| 46 | + */ |
|
| 47 | + #[LanguageLevelTypeAware(['8.1' => 'int'], default: '')] |
|
| 48 | + public $client_version; |
|
| 49 | + /** |
|
| 50 | + * @var string |
|
| 51 | + */ |
|
| 52 | + #[LanguageLevelTypeAware(['8.1' => 'int'], default: '')] |
|
| 53 | + public $driver_version; |
|
| 54 | + /** |
|
| 55 | + * @var string |
|
| 56 | + */ |
|
| 57 | + public $embedded; |
|
| 58 | + /** |
|
| 59 | + * @var bool |
|
| 60 | + */ |
|
| 61 | + #[LanguageLevelTypeAware(['8.1' => 'bool'], default: '')] |
|
| 62 | + public $reconnect; |
|
| 63 | + /** |
|
| 64 | + * @var int |
|
| 65 | + */ |
|
| 66 | + #[LanguageLevelTypeAware(['8.1' => 'int'], default: '')] |
|
| 67 | + public $report_mode; |
|
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | /** |
@@ -73,787 +73,787 @@ discard block |
||
| 73 | 73 | */ |
| 74 | 74 | class mysqli |
| 75 | 75 | { |
| 76 | - /** |
|
| 77 | - * @var int |
|
| 78 | - */ |
|
| 79 | - #[LanguageLevelTypeAware(['8.1' => 'string|int'], default: '')] |
|
| 80 | - public $affected_rows; |
|
| 81 | - /** |
|
| 82 | - * @var string |
|
| 83 | - */ |
|
| 84 | - #[LanguageLevelTypeAware(['8.1' => 'string'], default: '')] |
|
| 85 | - public $client_info; |
|
| 86 | - /** |
|
| 87 | - * @var int |
|
| 88 | - */ |
|
| 89 | - #[LanguageLevelTypeAware(['8.1' => 'int'], default: '')] |
|
| 90 | - public $client_version; |
|
| 91 | - /** |
|
| 92 | - * @var int |
|
| 93 | - */ |
|
| 94 | - #[LanguageLevelTypeAware(['8.1' => 'int'], default: '')] |
|
| 95 | - public $connect_errno; |
|
| 96 | - /** |
|
| 97 | - * @var string |
|
| 98 | - */ |
|
| 99 | - #[LanguageLevelTypeAware(['8.1' => 'string|null'], default: '')] |
|
| 100 | - public $connect_error; |
|
| 101 | - /** |
|
| 102 | - * @var int |
|
| 103 | - */ |
|
| 104 | - #[LanguageLevelTypeAware(['8.1' => 'int'], default: '')] |
|
| 105 | - public $errno; |
|
| 106 | - /** |
|
| 107 | - * @var string |
|
| 108 | - */ |
|
| 109 | - #[LanguageLevelTypeAware(['8.1' => 'string'], default: '')] |
|
| 110 | - public $error; |
|
| 111 | - /** |
|
| 112 | - * @var int |
|
| 113 | - */ |
|
| 114 | - #[LanguageLevelTypeAware(['8.1' => 'int'], default: '')] |
|
| 115 | - public $field_count; |
|
| 116 | - /** |
|
| 117 | - * @var string |
|
| 118 | - */ |
|
| 119 | - #[LanguageLevelTypeAware(['8.1' => 'string'], default: '')] |
|
| 120 | - public $host_info; |
|
| 121 | - /** |
|
| 122 | - * @var string |
|
| 123 | - */ |
|
| 124 | - #[LanguageLevelTypeAware(['8.1' => 'string|null'], default: '')] |
|
| 125 | - public $info; |
|
| 126 | - /** |
|
| 127 | - * @var int|string |
|
| 128 | - */ |
|
| 129 | - #[LanguageLevelTypeAware(['8.1' => 'int|string'], default: '')] |
|
| 130 | - public $insert_id; |
|
| 131 | - /** |
|
| 132 | - * @var string |
|
| 133 | - */ |
|
| 134 | - #[LanguageLevelTypeAware(['8.1' => 'string'], default: '')] |
|
| 135 | - public $server_info; |
|
| 136 | - /** |
|
| 137 | - * @var int |
|
| 138 | - */ |
|
| 139 | - #[LanguageLevelTypeAware(['8.1' => 'int'], default: '')] |
|
| 140 | - public $server_version; |
|
| 141 | - /** |
|
| 142 | - * @var string |
|
| 143 | - */ |
|
| 144 | - #[LanguageLevelTypeAware(['8.1' => 'string'], default: '')] |
|
| 145 | - public $sqlstate; |
|
| 146 | - /** |
|
| 147 | - * @var string |
|
| 148 | - */ |
|
| 149 | - #[LanguageLevelTypeAware(['8.1' => 'int'], default: '')] |
|
| 150 | - public $protocol_version; |
|
| 151 | - /** |
|
| 152 | - * @var int |
|
| 153 | - */ |
|
| 154 | - #[LanguageLevelTypeAware(['8.1' => 'int'], default: '')] |
|
| 155 | - public $thread_id; |
|
| 156 | - /** |
|
| 157 | - * @var int |
|
| 158 | - */ |
|
| 159 | - #[LanguageLevelTypeAware(['8.1' => 'int'], default: '')] |
|
| 160 | - public $warning_count; |
|
| 161 | - |
|
| 162 | - /** |
|
| 163 | - * @var array A list of errors, each as an associative array containing the errno, error, and sqlstate. |
|
| 164 | - * @link https://secure.php.net/manual/en/mysqli.error-list.php |
|
| 165 | - */ |
|
| 166 | - #[LanguageLevelTypeAware(['8.1' => 'array'], default: '')] |
|
| 167 | - public $error_list; |
|
| 168 | - |
|
| 169 | - public $stat; |
|
| 170 | - |
|
| 171 | - /** |
|
| 172 | - * Open a new connection to the MySQL server |
|
| 173 | - * @link https://php.net/manual/en/mysqli.construct.php |
|
| 174 | - * @param string $hostname [optional] Can be either a host name or an IP address. Passing the NULL value or the string "localhost" to this parameter, the local host is assumed. When possible, pipes will be used instead of the TCP/IP protocol. Prepending host by p: opens a persistent connection. mysqli_change_user() is automatically called on connections opened from the connection pool. Defaults to ini_get("mysqli.default_host") |
|
| 175 | - * @param string $username [optional] The MySQL user name. Defaults to ini_get("mysqli.default_user") |
|
| 176 | - * @param string $password [optional] If not provided or NULL, the MySQL server will attempt to authenticate the user against those user records which have no password only. This allows one username to be used with different permissions (depending on if a password as provided or not). Defaults to ini_get("mysqli.default_pw") |
|
| 177 | - * @param string $database [optional] If provided will specify the default database to be used when performing queries. Defaults to "" |
|
| 178 | - * @param int $port [optional] Specifies the port number to attempt to connect to the MySQL server. Defaults to ini_get("mysqli.default_port") |
|
| 179 | - * @param string $socket [optional] Specifies the socket or named pipe that should be used. Defaults to ini_get("mysqli.default_socket") |
|
| 180 | - */ |
|
| 181 | - public function __construct( |
|
| 182 | - ?string $hostname = null, |
|
| 183 | - ?string $username = null, |
|
| 184 | - ?string $password = null, |
|
| 185 | - ?string $database = null, |
|
| 186 | - ?int $port = null, |
|
| 187 | - ?string $socket = null |
|
| 188 | - ) {} |
|
| 189 | - |
|
| 190 | - /** |
|
| 191 | - * Turns on or off auto-committing database modifications |
|
| 192 | - * @link https://php.net/manual/en/mysqli.autocommit.php |
|
| 193 | - * @param bool $enable <p> |
|
| 194 | - * Whether to turn on auto-commit or not. |
|
| 195 | - * </p> |
|
| 196 | - * @return bool true on success or false on failure. |
|
| 197 | - */ |
|
| 198 | - #[TentativeType] |
|
| 199 | - public function autocommit(bool $enable): bool {} |
|
| 200 | - |
|
| 201 | - /** |
|
| 202 | - * Starts a transaction |
|
| 203 | - * @link https://secure.php.net/manual/en/mysqli.begin-transaction.php |
|
| 204 | - * @param int $flags [optional] |
|
| 205 | - * @param string $name [optional] |
|
| 206 | - * @return bool true on success or false on failure. |
|
| 207 | - * @since 5.5 |
|
| 208 | - */ |
|
| 209 | - #[TentativeType] |
|
| 210 | - public function begin_transaction( |
|
| 211 | - #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $flags = 0, |
|
| 212 | - #[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $name = null |
|
| 213 | - ): bool {} |
|
| 214 | - |
|
| 215 | - /** |
|
| 216 | - * Changes the user of the specified database connection |
|
| 217 | - * @link https://php.net/manual/en/mysqli.change-user.php |
|
| 218 | - * @param string $username <p> |
|
| 219 | - * The MySQL user name. |
|
| 220 | - * </p> |
|
| 221 | - * @param string $password <p> |
|
| 222 | - * The MySQL password. |
|
| 223 | - * </p> |
|
| 224 | - * @param string $database <p> |
|
| 225 | - * The database to change to. |
|
| 226 | - * </p> |
|
| 227 | - * <p> |
|
| 228 | - * If desired, the null value may be passed resulting in only changing |
|
| 229 | - * the user and not selecting a database. To select a database in this |
|
| 230 | - * case use the <b>mysqli_select_db</b> function. |
|
| 231 | - * </p> |
|
| 232 | - * @return bool true on success or false on failure. |
|
| 233 | - */ |
|
| 234 | - #[TentativeType] |
|
| 235 | - public function change_user(string $username, string $password, ?string $database): bool {} |
|
| 236 | - |
|
| 237 | - /** |
|
| 238 | - * Returns the default character set for the database connection |
|
| 239 | - * @link https://php.net/manual/en/mysqli.character-set-name.php |
|
| 240 | - * @return string The default character set for the current connection |
|
| 241 | - */ |
|
| 242 | - #[TentativeType] |
|
| 243 | - public function character_set_name(): string {} |
|
| 244 | - |
|
| 245 | - /** |
|
| 246 | - * @removed 5.4 |
|
| 247 | - */ |
|
| 248 | - #[Deprecated(since: '5.3')] |
|
| 249 | - public function client_encoding() {} |
|
| 250 | - |
|
| 251 | - /** |
|
| 252 | - * Closes a previously opened database connection |
|
| 253 | - * @link https://php.net/manual/en/mysqli.close.php |
|
| 254 | - * @return bool true on success or false on failure. |
|
| 255 | - */ |
|
| 256 | - public function close() {} |
|
| 257 | - |
|
| 258 | - /** |
|
| 259 | - * Commits the current transaction |
|
| 260 | - * @link https://php.net/manual/en/mysqli.commit.php |
|
| 261 | - * @param int $flags A bitmask of MYSQLI_TRANS_COR_* constants. |
|
| 262 | - * @param string $name If provided then COMMIT $name is executed. |
|
| 263 | - * @return bool true on success or false on failure. |
|
| 264 | - */ |
|
| 265 | - #[TentativeType] |
|
| 266 | - public function commit(int $flags = -1, ?string $name = null): bool {} |
|
| 267 | - |
|
| 268 | - /** |
|
| 269 | - * @link https://php.net/manual/en/function.mysqli-connect.php |
|
| 270 | - * @param string|null $hostname [optional] |
|
| 271 | - * @param string|null $username [optional] |
|
| 272 | - * @param string|null $password [optional] |
|
| 273 | - * @param string|null $database [optional] |
|
| 274 | - * @param int|null $port [optional] |
|
| 275 | - * @param string|null $socket [optional] |
|
| 276 | - * @return bool |
|
| 277 | - */ |
|
| 278 | - #[TentativeType] |
|
| 279 | - public function connect( |
|
| 280 | - ?string $hostname = null, |
|
| 281 | - ?string $username = null, |
|
| 282 | - ?string $password = null, |
|
| 283 | - ?string $database = null, |
|
| 284 | - ?int $port = null, |
|
| 285 | - ?string $socket = null |
|
| 286 | - ): bool {} |
|
| 287 | - |
|
| 288 | - /** |
|
| 289 | - * Dump debugging information into the log |
|
| 290 | - * @link https://php.net/manual/en/mysqli.dump-debug-info.php |
|
| 291 | - * @return bool true on success or false on failure. |
|
| 292 | - */ |
|
| 293 | - #[TentativeType] |
|
| 294 | - public function dump_debug_info(): bool {} |
|
| 295 | - |
|
| 296 | - /** |
|
| 297 | - * Performs debugging operations |
|
| 298 | - * @link https://php.net/manual/en/mysqli.debug.php |
|
| 299 | - * @param string $options <p> |
|
| 300 | - * A string representing the debugging operation to perform |
|
| 301 | - * </p> |
|
| 302 | - * @return bool true. |
|
| 303 | - */ |
|
| 304 | - public function debug(string $options) {} |
|
| 305 | - |
|
| 306 | - /** |
|
| 307 | - * Returns a character set object |
|
| 308 | - * @link https://php.net/manual/en/mysqli.get-charset.php |
|
| 309 | - * @return object|null The function returns a character set object with the following properties: |
|
| 310 | - * <i>charset</i> |
|
| 311 | - * <p>Character set name</p> |
|
| 312 | - * <i>collation</i> |
|
| 313 | - * <p>Collation name</p> |
|
| 314 | - * <i>dir</i> |
|
| 315 | - * <p>Directory the charset description was fetched from (?) or "" for built-in character sets</p> |
|
| 316 | - * <i>min_length</i> |
|
| 317 | - * <p>Minimum character length in bytes</p> |
|
| 318 | - * <i>max_length</i> |
|
| 319 | - * <p>Maximum character length in bytes</p> |
|
| 320 | - * <i>number</i> |
|
| 321 | - * <p>Internal character set number</p> |
|
| 322 | - * <i>state</i> |
|
| 323 | - * <p>Character set status (?)</p> |
|
| 324 | - */ |
|
| 325 | - #[TentativeType] |
|
| 326 | - public function get_charset(): ?object {} |
|
| 327 | - |
|
| 328 | - /** |
|
| 329 | - * Returns the MySQL client version as a string |
|
| 330 | - * @link https://php.net/manual/en/mysqli.get-client-info.php |
|
| 331 | - * @return string A string that represents the MySQL client library version |
|
| 332 | - */ |
|
| 333 | - #[TentativeType] |
|
| 334 | - public function get_client_info(): string {} |
|
| 335 | - |
|
| 336 | - /** |
|
| 337 | - * Returns statistics about the client connection |
|
| 338 | - * @link https://php.net/manual/en/mysqli.get-connection-stats.php |
|
| 339 | - * @return array|false an array with connection stats if success, false otherwise. |
|
| 340 | - */ |
|
| 341 | - #[TentativeType] |
|
| 342 | - public function get_connection_stats(): array {} |
|
| 343 | - |
|
| 344 | - /** |
|
| 345 | - * An undocumented function equivalent to the $server_info property |
|
| 346 | - * @link https://php.net/manual/en/mysqli.get-server-info.php |
|
| 347 | - * @return string A character string representing the server version. |
|
| 348 | - */ |
|
| 349 | - #[TentativeType] |
|
| 350 | - public function get_server_info(): string {} |
|
| 351 | - |
|
| 352 | - /** |
|
| 353 | - * Get result of SHOW WARNINGS |
|
| 354 | - * @link https://php.net/manual/en/mysqli.get-warnings.php |
|
| 355 | - * @return mysqli_warning|false |
|
| 356 | - */ |
|
| 357 | - #[TentativeType] |
|
| 358 | - public function get_warnings(): mysqli_warning|false {} |
|
| 359 | - |
|
| 360 | - /** |
|
| 361 | - * Initializes MySQLi and returns a resource for use with mysqli_real_connect() |
|
| 362 | - * @link https://php.net/manual/en/mysqli.init.php |
|
| 363 | - * @return mysqli an object. |
|
| 364 | - * @deprecated 8.1 |
|
| 365 | - */ |
|
| 366 | - public function init() {} |
|
| 367 | - |
|
| 368 | - /** |
|
| 369 | - * Asks the server to kill a MySQL thread |
|
| 370 | - * @link https://php.net/manual/en/mysqli.kill.php |
|
| 371 | - * @param int $process_id |
|
| 372 | - * @return bool true on success or false on failure. |
|
| 373 | - */ |
|
| 374 | - #[TentativeType] |
|
| 375 | - public function kill(int $process_id): bool {} |
|
| 376 | - |
|
| 377 | - /** |
|
| 378 | - * Performs a query on the database |
|
| 379 | - * @link https://php.net/manual/en/mysqli.multi-query.php |
|
| 380 | - * @param string $query <p> |
|
| 381 | - * The query, as a string. |
|
| 382 | - * </p> |
|
| 383 | - * <p> |
|
| 384 | - * Data inside the query should be properly escaped. |
|
| 385 | - * </p> |
|
| 386 | - * @return bool false if the first statement failed. |
|
| 387 | - * To retrieve subsequent errors from other statements you have to call |
|
| 388 | - * <b>mysqli_next_result</b> first. |
|
| 389 | - */ |
|
| 390 | - #[TentativeType] |
|
| 391 | - public function multi_query(string $query): bool {} |
|
| 392 | - |
|
| 393 | - /** |
|
| 394 | - * @link https://php.net/manual/en/mysqli.construct.php |
|
| 395 | - * @param string $host [optional] |
|
| 396 | - * @param string $username [optional] |
|
| 397 | - * @param string $password [optional] |
|
| 398 | - * @param string $database [optional] |
|
| 399 | - * @param int $port [optional] |
|
| 400 | - * @param string $socket [optional] |
|
| 401 | - * |
|
| 402 | - * @removed 8.0 |
|
| 403 | - */ |
|
| 404 | - public function mysqli($host = null, $username = null, $password = null, $database = null, $port = null, $socket = null) {} |
|
| 405 | - |
|
| 406 | - /** |
|
| 407 | - * Check if there are any more query results from a multi query |
|
| 408 | - * @link https://php.net/manual/en/mysqli.more-results.php |
|
| 409 | - * @return bool true on success or false on failure. |
|
| 410 | - */ |
|
| 411 | - #[TentativeType] |
|
| 412 | - public function more_results(): bool {} |
|
| 413 | - |
|
| 414 | - /** |
|
| 415 | - * Prepare next result from multi_query |
|
| 416 | - * @link https://php.net/manual/en/mysqli.next-result.php |
|
| 417 | - * @return bool true on success or false on failure. |
|
| 418 | - */ |
|
| 419 | - #[TentativeType] |
|
| 420 | - public function next_result(): bool {} |
|
| 421 | - |
|
| 422 | - /** |
|
| 423 | - * Set options |
|
| 424 | - * @link https://php.net/manual/en/mysqli.options.php |
|
| 425 | - * @param int $option <p> |
|
| 426 | - * The option that you want to set. It can be one of the following values: |
|
| 427 | - * <table> |
|
| 428 | - * Valid options |
|
| 429 | - * <tr valign="top"> |
|
| 430 | - * <td>Name</td> |
|
| 431 | - * <td>Description</td> |
|
| 432 | - * </tr> |
|
| 433 | - * <tr valign="top"> |
|
| 434 | - * <td><b>MYSQLI_OPT_CONNECT_TIMEOUT</b></td> |
|
| 435 | - * <td>connection timeout in seconds (supported on Windows with TCP/IP since PHP 5.3.1)</td> |
|
| 436 | - * </tr> |
|
| 437 | - * <tr valign="top"> |
|
| 438 | - * <td><b>MYSQLI_OPT_LOCAL_INFILE</b></td> |
|
| 439 | - * <td>enable/disable use of LOAD LOCAL INFILE</td> |
|
| 440 | - * </tr> |
|
| 441 | - * <tr valign="top"> |
|
| 442 | - * <td><b>MYSQLI_INIT_COMMAND</b></td> |
|
| 443 | - * <td>command to execute after when connecting to MySQL server</td> |
|
| 444 | - * </tr> |
|
| 445 | - * <tr valign="top"> |
|
| 446 | - * <td><b>MYSQLI_READ_DEFAULT_FILE</b></td> |
|
| 447 | - * <td> |
|
| 448 | - * Read options from named option file instead of my.cnf |
|
| 449 | - * </td> |
|
| 450 | - * </tr> |
|
| 451 | - * <tr valign="top"> |
|
| 452 | - * <td><b>MYSQLI_READ_DEFAULT_GROUP</b></td> |
|
| 453 | - * <td> |
|
| 454 | - * Read options from the named group from my.cnf |
|
| 455 | - * or the file specified with <b>MYSQL_READ_DEFAULT_FILE</b> |
|
| 456 | - * </td> |
|
| 457 | - * </tr> |
|
| 458 | - * <tr valign="top"> |
|
| 459 | - * <td><b>MYSQLI_SERVER_PUBLIC_KEY</b></td> |
|
| 460 | - * <td> |
|
| 461 | - * RSA public key file used with the SHA-256 based authentication. |
|
| 462 | - * </td> |
|
| 463 | - * </tr> |
|
| 464 | - * </table> |
|
| 465 | - * </p> |
|
| 466 | - * @param mixed $value <p> |
|
| 467 | - * The value for the option. |
|
| 468 | - * </p> |
|
| 469 | - * @return bool true on success or false on failure. |
|
| 470 | - */ |
|
| 471 | - #[TentativeType] |
|
| 472 | - public function options(int $option, $value): bool {} |
|
| 473 | - |
|
| 474 | - /** |
|
| 475 | - * Pings a server connection, or tries to reconnect if the connection has gone down |
|
| 476 | - * @link https://php.net/manual/en/mysqli.ping.php |
|
| 477 | - * @return bool true on success or false on failure. |
|
| 478 | - */ |
|
| 479 | - #[TentativeType] |
|
| 480 | - public function ping(): bool {} |
|
| 481 | - |
|
| 482 | - /** |
|
| 483 | - * Prepare an SQL statement for execution |
|
| 484 | - * @link https://php.net/manual/en/mysqli.prepare.php |
|
| 485 | - * @param string $query <p> |
|
| 486 | - * The query, as a string. |
|
| 487 | - * </p> |
|
| 488 | - * <p> |
|
| 489 | - * You should not add a terminating semicolon or \g |
|
| 490 | - * to the statement. |
|
| 491 | - * </p> |
|
| 492 | - * <p> |
|
| 493 | - * This parameter can include one or more parameter markers in the SQL |
|
| 494 | - * statement by embedding question mark (?) characters |
|
| 495 | - * at the appropriate positions. |
|
| 496 | - * </p> |
|
| 497 | - * <p> |
|
| 498 | - * The markers are legal only in certain places in SQL statements. |
|
| 499 | - * For example, they are allowed in the VALUES() |
|
| 500 | - * list of an INSERT statement (to specify column |
|
| 501 | - * values for a row), or in a comparison with a column in a |
|
| 502 | - * WHERE clause to specify a comparison value. |
|
| 503 | - * </p> |
|
| 504 | - * <p> |
|
| 505 | - * However, they are not allowed for identifiers (such as table or |
|
| 506 | - * column names), in the select list that names the columns to be |
|
| 507 | - * returned by a SELECT statement, or to specify both |
|
| 508 | - * operands of a binary operator such as the = equal |
|
| 509 | - * sign. The latter restriction is necessary because it would be |
|
| 510 | - * impossible to determine the parameter type. It's not allowed to |
|
| 511 | - * compare marker with NULL by |
|
| 512 | - * ? IS NULL too. In general, parameters are legal |
|
| 513 | - * only in Data Manipulation Language (DML) statements, and not in Data |
|
| 514 | - * Definition Language (DDL) statements. |
|
| 515 | - * </p> |
|
| 516 | - * @return mysqli_stmt|false <b>mysqli_prepare</b> returns a statement object or false if an error occurred. |
|
| 517 | - */ |
|
| 518 | - #[TentativeType] |
|
| 519 | - public function prepare(string $query): mysqli_stmt|false {} |
|
| 520 | - |
|
| 521 | - /** |
|
| 522 | - * Performs a query on the database |
|
| 523 | - * @link https://php.net/manual/en/mysqli.query.php |
|
| 524 | - * @param string $query <p> |
|
| 525 | - * The query string. |
|
| 526 | - * </p> |
|
| 527 | - * <p> |
|
| 528 | - * Data inside the query should be properly escaped. |
|
| 529 | - * </p> |
|
| 530 | - * @param int $result_mode [optional] <p> |
|
| 531 | - * Either the constant <b>MYSQLI_USE_RESULT</b> or |
|
| 532 | - * <b>MYSQLI_STORE_RESULT</b> depending on the desired |
|
| 533 | - * behavior. By default, <b>MYSQLI_STORE_RESULT</b> is used. |
|
| 534 | - * </p> |
|
| 535 | - * <p> |
|
| 536 | - * If you use <b>MYSQLI_USE_RESULT</b> all subsequent calls |
|
| 537 | - * will return error Commands out of sync unless you |
|
| 538 | - * call <b>mysqli_free_result</b> |
|
| 539 | - * </p> |
|
| 540 | - * <p> |
|
| 541 | - * With <b>MYSQLI_ASYNC</b> (available with mysqlnd), it is |
|
| 542 | - * possible to perform query asynchronously. |
|
| 543 | - * <b>mysqli_poll</b> is then used to get results from such |
|
| 544 | - * queries. |
|
| 545 | - * </p> |
|
| 546 | - * @return mysqli_result|bool For successful SELECT, SHOW, DESCRIBE or |
|
| 547 | - * EXPLAIN queries <b>mysqli_query</b> will return |
|
| 548 | - * a <b>mysqli_result</b> object. For other successful queries <b>mysqli_query</b> will |
|
| 549 | - * return true and false on failure. |
|
| 550 | - */ |
|
| 551 | - #[TentativeType] |
|
| 552 | - public function query(string $query, int $result_mode = MYSQLI_STORE_RESULT): mysqli_result|bool {} |
|
| 553 | - |
|
| 554 | - /** |
|
| 555 | - * Opens a connection to a mysql server |
|
| 556 | - * @link https://php.net/manual/en/mysqli.real-connect.php |
|
| 557 | - * @param string $hostname [optional] <p> |
|
| 558 | - * Can be either a host name or an IP address. Passing the null value |
|
| 559 | - * or the string "localhost" to this parameter, the local host is |
|
| 560 | - * assumed. When possible, pipes will be used instead of the TCP/IP |
|
| 561 | - * protocol. |
|
| 562 | - * </p> |
|
| 563 | - * @param string $username [optional] <p> |
|
| 564 | - * The MySQL user name. |
|
| 565 | - * </p> |
|
| 566 | - * @param string $password [optional] <p> |
|
| 567 | - * If provided or null, the MySQL server will attempt to authenticate |
|
| 568 | - * the user against those user records which have no password only. This |
|
| 569 | - * allows one username to be used with different permissions (depending |
|
| 570 | - * on if a password as provided or not). |
|
| 571 | - * </p> |
|
| 572 | - * @param string $database [optional] <p> |
|
| 573 | - * If provided will specify the default database to be used when |
|
| 574 | - * performing queries. |
|
| 575 | - * </p> |
|
| 576 | - * @param int $port [optional] <p> |
|
| 577 | - * Specifies the port number to attempt to connect to the MySQL server. |
|
| 578 | - * </p> |
|
| 579 | - * @param string $socket [optional] <p> |
|
| 580 | - * Specifies the socket or named pipe that should be used. |
|
| 581 | - * </p> |
|
| 582 | - * <p> |
|
| 583 | - * Specifying the <i>socket</i> parameter will not |
|
| 584 | - * explicitly determine the type of connection to be used when |
|
| 585 | - * connecting to the MySQL server. How the connection is made to the |
|
| 586 | - * MySQL database is determined by the <i>host</i> |
|
| 587 | - * parameter. |
|
| 588 | - * </p> |
|
| 589 | - * @param int $flags [optional] <p> |
|
| 590 | - * With the parameter <i>flags</i> you can set different |
|
| 591 | - * connection options: |
|
| 592 | - * </p> |
|
| 593 | - * <table> |
|
| 594 | - * Supported flags |
|
| 595 | - * <tr valign="top"> |
|
| 596 | - * <td>Name</td> |
|
| 597 | - * <td>Description</td> |
|
| 598 | - * </tr> |
|
| 599 | - * <tr valign="top"> |
|
| 600 | - * <td><b>MYSQLI_CLIENT_COMPRESS</b></td> |
|
| 601 | - * <td>Use compression protocol</td> |
|
| 602 | - * </tr> |
|
| 603 | - * <tr valign="top"> |
|
| 604 | - * <td><b>MYSQLI_CLIENT_FOUND_ROWS</b></td> |
|
| 605 | - * <td>return number of matched rows, not the number of affected rows</td> |
|
| 606 | - * </tr> |
|
| 607 | - * <tr valign="top"> |
|
| 608 | - * <td><b>MYSQLI_CLIENT_IGNORE_SPACE</b></td> |
|
| 609 | - * <td>Allow spaces after function names. Makes all function names reserved words.</td> |
|
| 610 | - * </tr> |
|
| 611 | - * <tr valign="top"> |
|
| 612 | - * <td><b>MYSQLI_CLIENT_INTERACTIVE</b></td> |
|
| 613 | - * <td> |
|
| 614 | - * Allow interactive_timeout seconds (instead of |
|
| 615 | - * wait_timeout seconds) of inactivity before closing the connection |
|
| 616 | - * </td> |
|
| 617 | - * </tr> |
|
| 618 | - * <tr valign="top"> |
|
| 619 | - * <td><b>MYSQLI_CLIENT_SSL</b></td> |
|
| 620 | - * <td>Use SSL (encryption)</td> |
|
| 621 | - * </tr> |
|
| 622 | - * </table> |
|
| 623 | - * <p> |
|
| 624 | - * For security reasons the <b>MULTI_STATEMENT</b> flag is |
|
| 625 | - * not supported in PHP. If you want to execute multiple queries use the |
|
| 626 | - * <b>mysqli_multi_query</b> function. |
|
| 627 | - * </p> |
|
| 628 | - * @return bool true on success or false on failure. |
|
| 629 | - */ |
|
| 630 | - #[TentativeType] |
|
| 631 | - public function real_connect( |
|
| 632 | - ?string $hostname = null, |
|
| 633 | - ?string $username = null, |
|
| 634 | - ?string $password = null, |
|
| 635 | - ?string $database = null, |
|
| 636 | - ?int $port = null, |
|
| 637 | - ?string $socket = null, |
|
| 638 | - int $flags = null |
|
| 639 | - ): bool {} |
|
| 640 | - |
|
| 641 | - /** |
|
| 642 | - * Escapes special characters in a string for use in an SQL statement, taking into account the current charset of the connection |
|
| 643 | - * @link https://php.net/manual/en/mysqli.real-escape-string.php |
|
| 644 | - * @param string $string <p> |
|
| 645 | - * The string to be escaped. |
|
| 646 | - * </p> |
|
| 647 | - * <p> |
|
| 648 | - * Characters encoded are NUL (ASCII 0), \n, \r, \, ', ", and |
|
| 649 | - * Control-Z. |
|
| 650 | - * </p> |
|
| 651 | - * @return string an escaped string. |
|
| 652 | - */ |
|
| 653 | - #[TentativeType] |
|
| 654 | - public function real_escape_string(string $string): string {} |
|
| 655 | - |
|
| 656 | - /** |
|
| 657 | - * Poll connections |
|
| 658 | - * @link https://php.net/manual/en/mysqli.poll.php |
|
| 659 | - * @param array &$read <p> |
|
| 660 | - * </p> |
|
| 661 | - * @param array &$error <p> |
|
| 662 | - * </p> |
|
| 663 | - * @param array &$reject <p> |
|
| 664 | - * </p> |
|
| 665 | - * @param int $seconds <p> |
|
| 666 | - * Number of seconds to wait, must be non-negative. |
|
| 667 | - * </p> |
|
| 668 | - * @param int $microseconds [optional] <p> |
|
| 669 | - * Number of microseconds to wait, must be non-negative. |
|
| 670 | - * </p> |
|
| 671 | - * @return int|false number of ready connections in success, false otherwise. |
|
| 672 | - */ |
|
| 673 | - #[TentativeType] |
|
| 674 | - public static function poll(?array &$read, ?array &$error, array &$reject, int $seconds, int $microseconds = 0): int|false {} |
|
| 675 | - |
|
| 676 | - /** |
|
| 677 | - * Get result from async query |
|
| 678 | - * @link https://php.net/manual/en/mysqli.reap-async-query.php |
|
| 679 | - * @return mysqli_result|false mysqli_result in success, false otherwise. |
|
| 680 | - */ |
|
| 681 | - #[TentativeType] |
|
| 682 | - public function reap_async_query(): mysqli_result|bool {} |
|
| 683 | - |
|
| 684 | - /** |
|
| 685 | - * Escapes special characters in a string for use in an SQL statement, taking into account the current charset of the connection |
|
| 686 | - * @param string $string The string to be escaped. |
|
| 687 | - * Characters encoded are NUL (ASCII 0), \n, \r, \, ', ", and Control-Z. |
|
| 688 | - * @return string |
|
| 689 | - * @link https://secure.php.net/manual/en/mysqli.real-escape-string.php |
|
| 690 | - */ |
|
| 691 | - #[TentativeType] |
|
| 692 | - public function escape_string(string $string): string {} |
|
| 693 | - |
|
| 694 | - /** |
|
| 695 | - * Execute an SQL query |
|
| 696 | - * @link https://php.net/manual/en/mysqli.real-query.php |
|
| 697 | - * @param string $query <p> |
|
| 698 | - * The query, as a string. |
|
| 699 | - * </p> |
|
| 700 | - * <p> |
|
| 701 | - * Data inside the query should be properly escaped. |
|
| 702 | - * </p> |
|
| 703 | - * @return bool true on success or false on failure. |
|
| 704 | - */ |
|
| 705 | - #[TentativeType] |
|
| 706 | - public function real_query(string $query): bool {} |
|
| 707 | - |
|
| 708 | - /** |
|
| 709 | - * Execute an SQL query |
|
| 710 | - * @link https://php.net/manual/en/mysqli.release-savepoint.php |
|
| 711 | - * @param string $name |
|
| 712 | - * @return bool Returns TRUE on success or FALSE on failure. |
|
| 713 | - * @since 5.5 |
|
| 714 | - */ |
|
| 715 | - #[TentativeType] |
|
| 716 | - public function release_savepoint(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $name): bool {} |
|
| 717 | - |
|
| 718 | - /** |
|
| 719 | - * Rolls back current transaction |
|
| 720 | - * @link https://php.net/manual/en/mysqli.rollback.php |
|
| 721 | - * @param int $flags [optional] A bitmask of MYSQLI_TRANS_COR_* constants. |
|
| 722 | - * @param string $name [optional] If provided then ROLLBACK $name is executed. |
|
| 723 | - * @return bool true on success or false on failure. |
|
| 724 | - * @since 5.5 Added flags and name parameters. |
|
| 725 | - */ |
|
| 726 | - #[TentativeType] |
|
| 727 | - public function rollback( |
|
| 728 | - #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $flags = 0, |
|
| 729 | - #[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $name = null |
|
| 730 | - ): bool {} |
|
| 731 | - |
|
| 732 | - /** |
|
| 733 | - * Set a named transaction savepoint |
|
| 734 | - * @link https://secure.php.net/manual/en/mysqli.savepoint.php |
|
| 735 | - * @param string $name |
|
| 736 | - * @return bool Returns TRUE on success or FALSE on failure. |
|
| 737 | - * @since 5.5 |
|
| 738 | - */ |
|
| 739 | - #[TentativeType] |
|
| 740 | - public function savepoint(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $name): bool {} |
|
| 741 | - |
|
| 742 | - /** |
|
| 743 | - * Selects the default database for database queries |
|
| 744 | - * @link https://php.net/manual/en/mysqli.select-db.php |
|
| 745 | - * @param string $database <p> |
|
| 746 | - * The database name. |
|
| 747 | - * </p> |
|
| 748 | - * @return bool true on success or false on failure. |
|
| 749 | - */ |
|
| 750 | - #[TentativeType] |
|
| 751 | - public function select_db(string $database): bool {} |
|
| 752 | - |
|
| 753 | - /** |
|
| 754 | - * Sets the default client character set |
|
| 755 | - * @link https://php.net/manual/en/mysqli.set-charset.php |
|
| 756 | - * @param string $charset <p> |
|
| 757 | - * The charset to be set as default. |
|
| 758 | - * </p> |
|
| 759 | - * @return bool true on success or false on failure..5 |
|
| 760 | - */ |
|
| 761 | - #[TentativeType] |
|
| 762 | - public function set_charset(string $charset): bool {} |
|
| 763 | - |
|
| 764 | - /** |
|
| 765 | - * @link https://php.net/manual/en/function.mysqli-set-opt |
|
| 766 | - * @param int $option |
|
| 767 | - * @param mixed $value |
|
| 768 | - */ |
|
| 769 | - #[TentativeType] |
|
| 770 | - public function set_opt(int $option, $value): bool {} |
|
| 771 | - |
|
| 772 | - /** |
|
| 773 | - * Used for establishing secure connections using SSL |
|
| 774 | - * @link https://secure.php.net/manual/en/mysqli.ssl-set.php |
|
| 775 | - * @param string $key <p> |
|
| 776 | - * The path name to the key file. |
|
| 777 | - * </p> |
|
| 778 | - * @param string $certificate <p> |
|
| 779 | - * The path name to the certificate file. |
|
| 780 | - * </p> |
|
| 781 | - * @param string $ca_certificate <p> |
|
| 782 | - * The path name to the certificate authority file. |
|
| 783 | - * </p> |
|
| 784 | - * @param string $ca_path <p> |
|
| 785 | - * The pathname to a directory that contains trusted SSL CA certificates in PEM format. |
|
| 786 | - * </p> |
|
| 787 | - * @param string $cipher_algos <p> |
|
| 788 | - * A list of allowable ciphers to use for SSL encryption. |
|
| 789 | - * </p> |
|
| 790 | - * @return bool This function always returns TRUE value. |
|
| 791 | - */ |
|
| 792 | - public function ssl_set(?string $key, ?string $certificate, ?string $ca_certificate, ?string $ca_path, ?string $cipher_algos) {} |
|
| 793 | - |
|
| 794 | - /** |
|
| 795 | - * Gets the current system status |
|
| 796 | - * @link https://php.net/manual/en/mysqli.stat.php |
|
| 797 | - * @return string|false A string describing the server status. false if an error occurred. |
|
| 798 | - */ |
|
| 799 | - #[TentativeType] |
|
| 800 | - public function stat(): string|false {} |
|
| 801 | - |
|
| 802 | - /** |
|
| 803 | - * Initializes a statement and returns an object for use with mysqli_stmt_prepare |
|
| 804 | - * @link https://php.net/manual/en/mysqli.stmt-init.php |
|
| 805 | - * @return mysqli_stmt an object. |
|
| 806 | - */ |
|
| 807 | - #[TentativeType] |
|
| 808 | - public function stmt_init(): mysqli_stmt|false {} |
|
| 809 | - |
|
| 810 | - /** |
|
| 811 | - * Transfers a result set from the last query |
|
| 812 | - * @link https://php.net/manual/en/mysqli.store-result.php |
|
| 813 | - * @param int $mode [optional] The option that you want to set |
|
| 814 | - * @return mysqli_result|false a buffered result object or false if an error occurred. |
|
| 815 | - * </p> |
|
| 816 | - * <p> |
|
| 817 | - * <b>mysqli_store_result</b> returns false in case the query |
|
| 818 | - * didn't return a result set (if the query was, for example an INSERT |
|
| 819 | - * statement). This function also returns false if the reading of the |
|
| 820 | - * result set failed. You can check if you have got an error by checking |
|
| 821 | - * if <b>mysqli_error</b> doesn't return an empty string, if |
|
| 822 | - * <b>mysqli_errno</b> returns a non zero value, or if |
|
| 823 | - * <b>mysqli_field_count</b> returns a non zero value. |
|
| 824 | - * Also possible reason for this function returning false after |
|
| 825 | - * successful call to <b>mysqli_query</b> can be too large |
|
| 826 | - * result set (memory for it cannot be allocated). If |
|
| 827 | - * <b>mysqli_field_count</b> returns a non-zero value, the |
|
| 828 | - * statement should have produced a non-empty result set. |
|
| 829 | - */ |
|
| 830 | - #[TentativeType] |
|
| 831 | - public function store_result(int $mode = null): mysqli_result|false {} |
|
| 832 | - |
|
| 833 | - /** |
|
| 834 | - * Returns whether thread safety is given or not |
|
| 835 | - * @link https://php.net/manual/en/mysqli.thread-safe.php |
|
| 836 | - * @return bool true if the client library is thread-safe, otherwise false. |
|
| 837 | - */ |
|
| 838 | - #[TentativeType] |
|
| 839 | - public function thread_safe(): bool {} |
|
| 840 | - |
|
| 841 | - /** |
|
| 842 | - * Initiate a result set retrieval |
|
| 843 | - * @link https://php.net/manual/en/mysqli.use-result.php |
|
| 844 | - * @return mysqli_result|false an unbuffered result object or false if an error occurred. |
|
| 845 | - */ |
|
| 846 | - #[TentativeType] |
|
| 847 | - public function use_result(): mysqli_result|false {} |
|
| 848 | - |
|
| 849 | - /** |
|
| 850 | - * @link https://php.net/manual/en/mysqli.refresh |
|
| 851 | - * @param int $flags MYSQLI_REFRESH_* |
|
| 852 | - * @return bool TRUE if the refresh was a success, otherwise FALSE |
|
| 853 | - * @since 5.3 |
|
| 854 | - */ |
|
| 855 | - #[TentativeType] |
|
| 856 | - public function refresh(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $flags): bool {} |
|
| 76 | + /** |
|
| 77 | + * @var int |
|
| 78 | + */ |
|
| 79 | + #[LanguageLevelTypeAware(['8.1' => 'string|int'], default: '')] |
|
| 80 | + public $affected_rows; |
|
| 81 | + /** |
|
| 82 | + * @var string |
|
| 83 | + */ |
|
| 84 | + #[LanguageLevelTypeAware(['8.1' => 'string'], default: '')] |
|
| 85 | + public $client_info; |
|
| 86 | + /** |
|
| 87 | + * @var int |
|
| 88 | + */ |
|
| 89 | + #[LanguageLevelTypeAware(['8.1' => 'int'], default: '')] |
|
| 90 | + public $client_version; |
|
| 91 | + /** |
|
| 92 | + * @var int |
|
| 93 | + */ |
|
| 94 | + #[LanguageLevelTypeAware(['8.1' => 'int'], default: '')] |
|
| 95 | + public $connect_errno; |
|
| 96 | + /** |
|
| 97 | + * @var string |
|
| 98 | + */ |
|
| 99 | + #[LanguageLevelTypeAware(['8.1' => 'string|null'], default: '')] |
|
| 100 | + public $connect_error; |
|
| 101 | + /** |
|
| 102 | + * @var int |
|
| 103 | + */ |
|
| 104 | + #[LanguageLevelTypeAware(['8.1' => 'int'], default: '')] |
|
| 105 | + public $errno; |
|
| 106 | + /** |
|
| 107 | + * @var string |
|
| 108 | + */ |
|
| 109 | + #[LanguageLevelTypeAware(['8.1' => 'string'], default: '')] |
|
| 110 | + public $error; |
|
| 111 | + /** |
|
| 112 | + * @var int |
|
| 113 | + */ |
|
| 114 | + #[LanguageLevelTypeAware(['8.1' => 'int'], default: '')] |
|
| 115 | + public $field_count; |
|
| 116 | + /** |
|
| 117 | + * @var string |
|
| 118 | + */ |
|
| 119 | + #[LanguageLevelTypeAware(['8.1' => 'string'], default: '')] |
|
| 120 | + public $host_info; |
|
| 121 | + /** |
|
| 122 | + * @var string |
|
| 123 | + */ |
|
| 124 | + #[LanguageLevelTypeAware(['8.1' => 'string|null'], default: '')] |
|
| 125 | + public $info; |
|
| 126 | + /** |
|
| 127 | + * @var int|string |
|
| 128 | + */ |
|
| 129 | + #[LanguageLevelTypeAware(['8.1' => 'int|string'], default: '')] |
|
| 130 | + public $insert_id; |
|
| 131 | + /** |
|
| 132 | + * @var string |
|
| 133 | + */ |
|
| 134 | + #[LanguageLevelTypeAware(['8.1' => 'string'], default: '')] |
|
| 135 | + public $server_info; |
|
| 136 | + /** |
|
| 137 | + * @var int |
|
| 138 | + */ |
|
| 139 | + #[LanguageLevelTypeAware(['8.1' => 'int'], default: '')] |
|
| 140 | + public $server_version; |
|
| 141 | + /** |
|
| 142 | + * @var string |
|
| 143 | + */ |
|
| 144 | + #[LanguageLevelTypeAware(['8.1' => 'string'], default: '')] |
|
| 145 | + public $sqlstate; |
|
| 146 | + /** |
|
| 147 | + * @var string |
|
| 148 | + */ |
|
| 149 | + #[LanguageLevelTypeAware(['8.1' => 'int'], default: '')] |
|
| 150 | + public $protocol_version; |
|
| 151 | + /** |
|
| 152 | + * @var int |
|
| 153 | + */ |
|
| 154 | + #[LanguageLevelTypeAware(['8.1' => 'int'], default: '')] |
|
| 155 | + public $thread_id; |
|
| 156 | + /** |
|
| 157 | + * @var int |
|
| 158 | + */ |
|
| 159 | + #[LanguageLevelTypeAware(['8.1' => 'int'], default: '')] |
|
| 160 | + public $warning_count; |
|
| 161 | + |
|
| 162 | + /** |
|
| 163 | + * @var array A list of errors, each as an associative array containing the errno, error, and sqlstate. |
|
| 164 | + * @link https://secure.php.net/manual/en/mysqli.error-list.php |
|
| 165 | + */ |
|
| 166 | + #[LanguageLevelTypeAware(['8.1' => 'array'], default: '')] |
|
| 167 | + public $error_list; |
|
| 168 | + |
|
| 169 | + public $stat; |
|
| 170 | + |
|
| 171 | + /** |
|
| 172 | + * Open a new connection to the MySQL server |
|
| 173 | + * @link https://php.net/manual/en/mysqli.construct.php |
|
| 174 | + * @param string $hostname [optional] Can be either a host name or an IP address. Passing the NULL value or the string "localhost" to this parameter, the local host is assumed. When possible, pipes will be used instead of the TCP/IP protocol. Prepending host by p: opens a persistent connection. mysqli_change_user() is automatically called on connections opened from the connection pool. Defaults to ini_get("mysqli.default_host") |
|
| 175 | + * @param string $username [optional] The MySQL user name. Defaults to ini_get("mysqli.default_user") |
|
| 176 | + * @param string $password [optional] If not provided or NULL, the MySQL server will attempt to authenticate the user against those user records which have no password only. This allows one username to be used with different permissions (depending on if a password as provided or not). Defaults to ini_get("mysqli.default_pw") |
|
| 177 | + * @param string $database [optional] If provided will specify the default database to be used when performing queries. Defaults to "" |
|
| 178 | + * @param int $port [optional] Specifies the port number to attempt to connect to the MySQL server. Defaults to ini_get("mysqli.default_port") |
|
| 179 | + * @param string $socket [optional] Specifies the socket or named pipe that should be used. Defaults to ini_get("mysqli.default_socket") |
|
| 180 | + */ |
|
| 181 | + public function __construct( |
|
| 182 | + ?string $hostname = null, |
|
| 183 | + ?string $username = null, |
|
| 184 | + ?string $password = null, |
|
| 185 | + ?string $database = null, |
|
| 186 | + ?int $port = null, |
|
| 187 | + ?string $socket = null |
|
| 188 | + ) {} |
|
| 189 | + |
|
| 190 | + /** |
|
| 191 | + * Turns on or off auto-committing database modifications |
|
| 192 | + * @link https://php.net/manual/en/mysqli.autocommit.php |
|
| 193 | + * @param bool $enable <p> |
|
| 194 | + * Whether to turn on auto-commit or not. |
|
| 195 | + * </p> |
|
| 196 | + * @return bool true on success or false on failure. |
|
| 197 | + */ |
|
| 198 | + #[TentativeType] |
|
| 199 | + public function autocommit(bool $enable): bool {} |
|
| 200 | + |
|
| 201 | + /** |
|
| 202 | + * Starts a transaction |
|
| 203 | + * @link https://secure.php.net/manual/en/mysqli.begin-transaction.php |
|
| 204 | + * @param int $flags [optional] |
|
| 205 | + * @param string $name [optional] |
|
| 206 | + * @return bool true on success or false on failure. |
|
| 207 | + * @since 5.5 |
|
| 208 | + */ |
|
| 209 | + #[TentativeType] |
|
| 210 | + public function begin_transaction( |
|
| 211 | + #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $flags = 0, |
|
| 212 | + #[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $name = null |
|
| 213 | + ): bool {} |
|
| 214 | + |
|
| 215 | + /** |
|
| 216 | + * Changes the user of the specified database connection |
|
| 217 | + * @link https://php.net/manual/en/mysqli.change-user.php |
|
| 218 | + * @param string $username <p> |
|
| 219 | + * The MySQL user name. |
|
| 220 | + * </p> |
|
| 221 | + * @param string $password <p> |
|
| 222 | + * The MySQL password. |
|
| 223 | + * </p> |
|
| 224 | + * @param string $database <p> |
|
| 225 | + * The database to change to. |
|
| 226 | + * </p> |
|
| 227 | + * <p> |
|
| 228 | + * If desired, the null value may be passed resulting in only changing |
|
| 229 | + * the user and not selecting a database. To select a database in this |
|
| 230 | + * case use the <b>mysqli_select_db</b> function. |
|
| 231 | + * </p> |
|
| 232 | + * @return bool true on success or false on failure. |
|
| 233 | + */ |
|
| 234 | + #[TentativeType] |
|
| 235 | + public function change_user(string $username, string $password, ?string $database): bool {} |
|
| 236 | + |
|
| 237 | + /** |
|
| 238 | + * Returns the default character set for the database connection |
|
| 239 | + * @link https://php.net/manual/en/mysqli.character-set-name.php |
|
| 240 | + * @return string The default character set for the current connection |
|
| 241 | + */ |
|
| 242 | + #[TentativeType] |
|
| 243 | + public function character_set_name(): string {} |
|
| 244 | + |
|
| 245 | + /** |
|
| 246 | + * @removed 5.4 |
|
| 247 | + */ |
|
| 248 | + #[Deprecated(since: '5.3')] |
|
| 249 | + public function client_encoding() {} |
|
| 250 | + |
|
| 251 | + /** |
|
| 252 | + * Closes a previously opened database connection |
|
| 253 | + * @link https://php.net/manual/en/mysqli.close.php |
|
| 254 | + * @return bool true on success or false on failure. |
|
| 255 | + */ |
|
| 256 | + public function close() {} |
|
| 257 | + |
|
| 258 | + /** |
|
| 259 | + * Commits the current transaction |
|
| 260 | + * @link https://php.net/manual/en/mysqli.commit.php |
|
| 261 | + * @param int $flags A bitmask of MYSQLI_TRANS_COR_* constants. |
|
| 262 | + * @param string $name If provided then COMMIT $name is executed. |
|
| 263 | + * @return bool true on success or false on failure. |
|
| 264 | + */ |
|
| 265 | + #[TentativeType] |
|
| 266 | + public function commit(int $flags = -1, ?string $name = null): bool {} |
|
| 267 | + |
|
| 268 | + /** |
|
| 269 | + * @link https://php.net/manual/en/function.mysqli-connect.php |
|
| 270 | + * @param string|null $hostname [optional] |
|
| 271 | + * @param string|null $username [optional] |
|
| 272 | + * @param string|null $password [optional] |
|
| 273 | + * @param string|null $database [optional] |
|
| 274 | + * @param int|null $port [optional] |
|
| 275 | + * @param string|null $socket [optional] |
|
| 276 | + * @return bool |
|
| 277 | + */ |
|
| 278 | + #[TentativeType] |
|
| 279 | + public function connect( |
|
| 280 | + ?string $hostname = null, |
|
| 281 | + ?string $username = null, |
|
| 282 | + ?string $password = null, |
|
| 283 | + ?string $database = null, |
|
| 284 | + ?int $port = null, |
|
| 285 | + ?string $socket = null |
|
| 286 | + ): bool {} |
|
| 287 | + |
|
| 288 | + /** |
|
| 289 | + * Dump debugging information into the log |
|
| 290 | + * @link https://php.net/manual/en/mysqli.dump-debug-info.php |
|
| 291 | + * @return bool true on success or false on failure. |
|
| 292 | + */ |
|
| 293 | + #[TentativeType] |
|
| 294 | + public function dump_debug_info(): bool {} |
|
| 295 | + |
|
| 296 | + /** |
|
| 297 | + * Performs debugging operations |
|
| 298 | + * @link https://php.net/manual/en/mysqli.debug.php |
|
| 299 | + * @param string $options <p> |
|
| 300 | + * A string representing the debugging operation to perform |
|
| 301 | + * </p> |
|
| 302 | + * @return bool true. |
|
| 303 | + */ |
|
| 304 | + public function debug(string $options) {} |
|
| 305 | + |
|
| 306 | + /** |
|
| 307 | + * Returns a character set object |
|
| 308 | + * @link https://php.net/manual/en/mysqli.get-charset.php |
|
| 309 | + * @return object|null The function returns a character set object with the following properties: |
|
| 310 | + * <i>charset</i> |
|
| 311 | + * <p>Character set name</p> |
|
| 312 | + * <i>collation</i> |
|
| 313 | + * <p>Collation name</p> |
|
| 314 | + * <i>dir</i> |
|
| 315 | + * <p>Directory the charset description was fetched from (?) or "" for built-in character sets</p> |
|
| 316 | + * <i>min_length</i> |
|
| 317 | + * <p>Minimum character length in bytes</p> |
|
| 318 | + * <i>max_length</i> |
|
| 319 | + * <p>Maximum character length in bytes</p> |
|
| 320 | + * <i>number</i> |
|
| 321 | + * <p>Internal character set number</p> |
|
| 322 | + * <i>state</i> |
|
| 323 | + * <p>Character set status (?)</p> |
|
| 324 | + */ |
|
| 325 | + #[TentativeType] |
|
| 326 | + public function get_charset(): ?object {} |
|
| 327 | + |
|
| 328 | + /** |
|
| 329 | + * Returns the MySQL client version as a string |
|
| 330 | + * @link https://php.net/manual/en/mysqli.get-client-info.php |
|
| 331 | + * @return string A string that represents the MySQL client library version |
|
| 332 | + */ |
|
| 333 | + #[TentativeType] |
|
| 334 | + public function get_client_info(): string {} |
|
| 335 | + |
|
| 336 | + /** |
|
| 337 | + * Returns statistics about the client connection |
|
| 338 | + * @link https://php.net/manual/en/mysqli.get-connection-stats.php |
|
| 339 | + * @return array|false an array with connection stats if success, false otherwise. |
|
| 340 | + */ |
|
| 341 | + #[TentativeType] |
|
| 342 | + public function get_connection_stats(): array {} |
|
| 343 | + |
|
| 344 | + /** |
|
| 345 | + * An undocumented function equivalent to the $server_info property |
|
| 346 | + * @link https://php.net/manual/en/mysqli.get-server-info.php |
|
| 347 | + * @return string A character string representing the server version. |
|
| 348 | + */ |
|
| 349 | + #[TentativeType] |
|
| 350 | + public function get_server_info(): string {} |
|
| 351 | + |
|
| 352 | + /** |
|
| 353 | + * Get result of SHOW WARNINGS |
|
| 354 | + * @link https://php.net/manual/en/mysqli.get-warnings.php |
|
| 355 | + * @return mysqli_warning|false |
|
| 356 | + */ |
|
| 357 | + #[TentativeType] |
|
| 358 | + public function get_warnings(): mysqli_warning|false {} |
|
| 359 | + |
|
| 360 | + /** |
|
| 361 | + * Initializes MySQLi and returns a resource for use with mysqli_real_connect() |
|
| 362 | + * @link https://php.net/manual/en/mysqli.init.php |
|
| 363 | + * @return mysqli an object. |
|
| 364 | + * @deprecated 8.1 |
|
| 365 | + */ |
|
| 366 | + public function init() {} |
|
| 367 | + |
|
| 368 | + /** |
|
| 369 | + * Asks the server to kill a MySQL thread |
|
| 370 | + * @link https://php.net/manual/en/mysqli.kill.php |
|
| 371 | + * @param int $process_id |
|
| 372 | + * @return bool true on success or false on failure. |
|
| 373 | + */ |
|
| 374 | + #[TentativeType] |
|
| 375 | + public function kill(int $process_id): bool {} |
|
| 376 | + |
|
| 377 | + /** |
|
| 378 | + * Performs a query on the database |
|
| 379 | + * @link https://php.net/manual/en/mysqli.multi-query.php |
|
| 380 | + * @param string $query <p> |
|
| 381 | + * The query, as a string. |
|
| 382 | + * </p> |
|
| 383 | + * <p> |
|
| 384 | + * Data inside the query should be properly escaped. |
|
| 385 | + * </p> |
|
| 386 | + * @return bool false if the first statement failed. |
|
| 387 | + * To retrieve subsequent errors from other statements you have to call |
|
| 388 | + * <b>mysqli_next_result</b> first. |
|
| 389 | + */ |
|
| 390 | + #[TentativeType] |
|
| 391 | + public function multi_query(string $query): bool {} |
|
| 392 | + |
|
| 393 | + /** |
|
| 394 | + * @link https://php.net/manual/en/mysqli.construct.php |
|
| 395 | + * @param string $host [optional] |
|
| 396 | + * @param string $username [optional] |
|
| 397 | + * @param string $password [optional] |
|
| 398 | + * @param string $database [optional] |
|
| 399 | + * @param int $port [optional] |
|
| 400 | + * @param string $socket [optional] |
|
| 401 | + * |
|
| 402 | + * @removed 8.0 |
|
| 403 | + */ |
|
| 404 | + public function mysqli($host = null, $username = null, $password = null, $database = null, $port = null, $socket = null) {} |
|
| 405 | + |
|
| 406 | + /** |
|
| 407 | + * Check if there are any more query results from a multi query |
|
| 408 | + * @link https://php.net/manual/en/mysqli.more-results.php |
|
| 409 | + * @return bool true on success or false on failure. |
|
| 410 | + */ |
|
| 411 | + #[TentativeType] |
|
| 412 | + public function more_results(): bool {} |
|
| 413 | + |
|
| 414 | + /** |
|
| 415 | + * Prepare next result from multi_query |
|
| 416 | + * @link https://php.net/manual/en/mysqli.next-result.php |
|
| 417 | + * @return bool true on success or false on failure. |
|
| 418 | + */ |
|
| 419 | + #[TentativeType] |
|
| 420 | + public function next_result(): bool {} |
|
| 421 | + |
|
| 422 | + /** |
|
| 423 | + * Set options |
|
| 424 | + * @link https://php.net/manual/en/mysqli.options.php |
|
| 425 | + * @param int $option <p> |
|
| 426 | + * The option that you want to set. It can be one of the following values: |
|
| 427 | + * <table> |
|
| 428 | + * Valid options |
|
| 429 | + * <tr valign="top"> |
|
| 430 | + * <td>Name</td> |
|
| 431 | + * <td>Description</td> |
|
| 432 | + * </tr> |
|
| 433 | + * <tr valign="top"> |
|
| 434 | + * <td><b>MYSQLI_OPT_CONNECT_TIMEOUT</b></td> |
|
| 435 | + * <td>connection timeout in seconds (supported on Windows with TCP/IP since PHP 5.3.1)</td> |
|
| 436 | + * </tr> |
|
| 437 | + * <tr valign="top"> |
|
| 438 | + * <td><b>MYSQLI_OPT_LOCAL_INFILE</b></td> |
|
| 439 | + * <td>enable/disable use of LOAD LOCAL INFILE</td> |
|
| 440 | + * </tr> |
|
| 441 | + * <tr valign="top"> |
|
| 442 | + * <td><b>MYSQLI_INIT_COMMAND</b></td> |
|
| 443 | + * <td>command to execute after when connecting to MySQL server</td> |
|
| 444 | + * </tr> |
|
| 445 | + * <tr valign="top"> |
|
| 446 | + * <td><b>MYSQLI_READ_DEFAULT_FILE</b></td> |
|
| 447 | + * <td> |
|
| 448 | + * Read options from named option file instead of my.cnf |
|
| 449 | + * </td> |
|
| 450 | + * </tr> |
|
| 451 | + * <tr valign="top"> |
|
| 452 | + * <td><b>MYSQLI_READ_DEFAULT_GROUP</b></td> |
|
| 453 | + * <td> |
|
| 454 | + * Read options from the named group from my.cnf |
|
| 455 | + * or the file specified with <b>MYSQL_READ_DEFAULT_FILE</b> |
|
| 456 | + * </td> |
|
| 457 | + * </tr> |
|
| 458 | + * <tr valign="top"> |
|
| 459 | + * <td><b>MYSQLI_SERVER_PUBLIC_KEY</b></td> |
|
| 460 | + * <td> |
|
| 461 | + * RSA public key file used with the SHA-256 based authentication. |
|
| 462 | + * </td> |
|
| 463 | + * </tr> |
|
| 464 | + * </table> |
|
| 465 | + * </p> |
|
| 466 | + * @param mixed $value <p> |
|
| 467 | + * The value for the option. |
|
| 468 | + * </p> |
|
| 469 | + * @return bool true on success or false on failure. |
|
| 470 | + */ |
|
| 471 | + #[TentativeType] |
|
| 472 | + public function options(int $option, $value): bool {} |
|
| 473 | + |
|
| 474 | + /** |
|
| 475 | + * Pings a server connection, or tries to reconnect if the connection has gone down |
|
| 476 | + * @link https://php.net/manual/en/mysqli.ping.php |
|
| 477 | + * @return bool true on success or false on failure. |
|
| 478 | + */ |
|
| 479 | + #[TentativeType] |
|
| 480 | + public function ping(): bool {} |
|
| 481 | + |
|
| 482 | + /** |
|
| 483 | + * Prepare an SQL statement for execution |
|
| 484 | + * @link https://php.net/manual/en/mysqli.prepare.php |
|
| 485 | + * @param string $query <p> |
|
| 486 | + * The query, as a string. |
|
| 487 | + * </p> |
|
| 488 | + * <p> |
|
| 489 | + * You should not add a terminating semicolon or \g |
|
| 490 | + * to the statement. |
|
| 491 | + * </p> |
|
| 492 | + * <p> |
|
| 493 | + * This parameter can include one or more parameter markers in the SQL |
|
| 494 | + * statement by embedding question mark (?) characters |
|
| 495 | + * at the appropriate positions. |
|
| 496 | + * </p> |
|
| 497 | + * <p> |
|
| 498 | + * The markers are legal only in certain places in SQL statements. |
|
| 499 | + * For example, they are allowed in the VALUES() |
|
| 500 | + * list of an INSERT statement (to specify column |
|
| 501 | + * values for a row), or in a comparison with a column in a |
|
| 502 | + * WHERE clause to specify a comparison value. |
|
| 503 | + * </p> |
|
| 504 | + * <p> |
|
| 505 | + * However, they are not allowed for identifiers (such as table or |
|
| 506 | + * column names), in the select list that names the columns to be |
|
| 507 | + * returned by a SELECT statement, or to specify both |
|
| 508 | + * operands of a binary operator such as the = equal |
|
| 509 | + * sign. The latter restriction is necessary because it would be |
|
| 510 | + * impossible to determine the parameter type. It's not allowed to |
|
| 511 | + * compare marker with NULL by |
|
| 512 | + * ? IS NULL too. In general, parameters are legal |
|
| 513 | + * only in Data Manipulation Language (DML) statements, and not in Data |
|
| 514 | + * Definition Language (DDL) statements. |
|
| 515 | + * </p> |
|
| 516 | + * @return mysqli_stmt|false <b>mysqli_prepare</b> returns a statement object or false if an error occurred. |
|
| 517 | + */ |
|
| 518 | + #[TentativeType] |
|
| 519 | + public function prepare(string $query): mysqli_stmt|false {} |
|
| 520 | + |
|
| 521 | + /** |
|
| 522 | + * Performs a query on the database |
|
| 523 | + * @link https://php.net/manual/en/mysqli.query.php |
|
| 524 | + * @param string $query <p> |
|
| 525 | + * The query string. |
|
| 526 | + * </p> |
|
| 527 | + * <p> |
|
| 528 | + * Data inside the query should be properly escaped. |
|
| 529 | + * </p> |
|
| 530 | + * @param int $result_mode [optional] <p> |
|
| 531 | + * Either the constant <b>MYSQLI_USE_RESULT</b> or |
|
| 532 | + * <b>MYSQLI_STORE_RESULT</b> depending on the desired |
|
| 533 | + * behavior. By default, <b>MYSQLI_STORE_RESULT</b> is used. |
|
| 534 | + * </p> |
|
| 535 | + * <p> |
|
| 536 | + * If you use <b>MYSQLI_USE_RESULT</b> all subsequent calls |
|
| 537 | + * will return error Commands out of sync unless you |
|
| 538 | + * call <b>mysqli_free_result</b> |
|
| 539 | + * </p> |
|
| 540 | + * <p> |
|
| 541 | + * With <b>MYSQLI_ASYNC</b> (available with mysqlnd), it is |
|
| 542 | + * possible to perform query asynchronously. |
|
| 543 | + * <b>mysqli_poll</b> is then used to get results from such |
|
| 544 | + * queries. |
|
| 545 | + * </p> |
|
| 546 | + * @return mysqli_result|bool For successful SELECT, SHOW, DESCRIBE or |
|
| 547 | + * EXPLAIN queries <b>mysqli_query</b> will return |
|
| 548 | + * a <b>mysqli_result</b> object. For other successful queries <b>mysqli_query</b> will |
|
| 549 | + * return true and false on failure. |
|
| 550 | + */ |
|
| 551 | + #[TentativeType] |
|
| 552 | + public function query(string $query, int $result_mode = MYSQLI_STORE_RESULT): mysqli_result|bool {} |
|
| 553 | + |
|
| 554 | + /** |
|
| 555 | + * Opens a connection to a mysql server |
|
| 556 | + * @link https://php.net/manual/en/mysqli.real-connect.php |
|
| 557 | + * @param string $hostname [optional] <p> |
|
| 558 | + * Can be either a host name or an IP address. Passing the null value |
|
| 559 | + * or the string "localhost" to this parameter, the local host is |
|
| 560 | + * assumed. When possible, pipes will be used instead of the TCP/IP |
|
| 561 | + * protocol. |
|
| 562 | + * </p> |
|
| 563 | + * @param string $username [optional] <p> |
|
| 564 | + * The MySQL user name. |
|
| 565 | + * </p> |
|
| 566 | + * @param string $password [optional] <p> |
|
| 567 | + * If provided or null, the MySQL server will attempt to authenticate |
|
| 568 | + * the user against those user records which have no password only. This |
|
| 569 | + * allows one username to be used with different permissions (depending |
|
| 570 | + * on if a password as provided or not). |
|
| 571 | + * </p> |
|
| 572 | + * @param string $database [optional] <p> |
|
| 573 | + * If provided will specify the default database to be used when |
|
| 574 | + * performing queries. |
|
| 575 | + * </p> |
|
| 576 | + * @param int $port [optional] <p> |
|
| 577 | + * Specifies the port number to attempt to connect to the MySQL server. |
|
| 578 | + * </p> |
|
| 579 | + * @param string $socket [optional] <p> |
|
| 580 | + * Specifies the socket or named pipe that should be used. |
|
| 581 | + * </p> |
|
| 582 | + * <p> |
|
| 583 | + * Specifying the <i>socket</i> parameter will not |
|
| 584 | + * explicitly determine the type of connection to be used when |
|
| 585 | + * connecting to the MySQL server. How the connection is made to the |
|
| 586 | + * MySQL database is determined by the <i>host</i> |
|
| 587 | + * parameter. |
|
| 588 | + * </p> |
|
| 589 | + * @param int $flags [optional] <p> |
|
| 590 | + * With the parameter <i>flags</i> you can set different |
|
| 591 | + * connection options: |
|
| 592 | + * </p> |
|
| 593 | + * <table> |
|
| 594 | + * Supported flags |
|
| 595 | + * <tr valign="top"> |
|
| 596 | + * <td>Name</td> |
|
| 597 | + * <td>Description</td> |
|
| 598 | + * </tr> |
|
| 599 | + * <tr valign="top"> |
|
| 600 | + * <td><b>MYSQLI_CLIENT_COMPRESS</b></td> |
|
| 601 | + * <td>Use compression protocol</td> |
|
| 602 | + * </tr> |
|
| 603 | + * <tr valign="top"> |
|
| 604 | + * <td><b>MYSQLI_CLIENT_FOUND_ROWS</b></td> |
|
| 605 | + * <td>return number of matched rows, not the number of affected rows</td> |
|
| 606 | + * </tr> |
|
| 607 | + * <tr valign="top"> |
|
| 608 | + * <td><b>MYSQLI_CLIENT_IGNORE_SPACE</b></td> |
|
| 609 | + * <td>Allow spaces after function names. Makes all function names reserved words.</td> |
|
| 610 | + * </tr> |
|
| 611 | + * <tr valign="top"> |
|
| 612 | + * <td><b>MYSQLI_CLIENT_INTERACTIVE</b></td> |
|
| 613 | + * <td> |
|
| 614 | + * Allow interactive_timeout seconds (instead of |
|
| 615 | + * wait_timeout seconds) of inactivity before closing the connection |
|
| 616 | + * </td> |
|
| 617 | + * </tr> |
|
| 618 | + * <tr valign="top"> |
|
| 619 | + * <td><b>MYSQLI_CLIENT_SSL</b></td> |
|
| 620 | + * <td>Use SSL (encryption)</td> |
|
| 621 | + * </tr> |
|
| 622 | + * </table> |
|
| 623 | + * <p> |
|
| 624 | + * For security reasons the <b>MULTI_STATEMENT</b> flag is |
|
| 625 | + * not supported in PHP. If you want to execute multiple queries use the |
|
| 626 | + * <b>mysqli_multi_query</b> function. |
|
| 627 | + * </p> |
|
| 628 | + * @return bool true on success or false on failure. |
|
| 629 | + */ |
|
| 630 | + #[TentativeType] |
|
| 631 | + public function real_connect( |
|
| 632 | + ?string $hostname = null, |
|
| 633 | + ?string $username = null, |
|
| 634 | + ?string $password = null, |
|
| 635 | + ?string $database = null, |
|
| 636 | + ?int $port = null, |
|
| 637 | + ?string $socket = null, |
|
| 638 | + int $flags = null |
|
| 639 | + ): bool {} |
|
| 640 | + |
|
| 641 | + /** |
|
| 642 | + * Escapes special characters in a string for use in an SQL statement, taking into account the current charset of the connection |
|
| 643 | + * @link https://php.net/manual/en/mysqli.real-escape-string.php |
|
| 644 | + * @param string $string <p> |
|
| 645 | + * The string to be escaped. |
|
| 646 | + * </p> |
|
| 647 | + * <p> |
|
| 648 | + * Characters encoded are NUL (ASCII 0), \n, \r, \, ', ", and |
|
| 649 | + * Control-Z. |
|
| 650 | + * </p> |
|
| 651 | + * @return string an escaped string. |
|
| 652 | + */ |
|
| 653 | + #[TentativeType] |
|
| 654 | + public function real_escape_string(string $string): string {} |
|
| 655 | + |
|
| 656 | + /** |
|
| 657 | + * Poll connections |
|
| 658 | + * @link https://php.net/manual/en/mysqli.poll.php |
|
| 659 | + * @param array &$read <p> |
|
| 660 | + * </p> |
|
| 661 | + * @param array &$error <p> |
|
| 662 | + * </p> |
|
| 663 | + * @param array &$reject <p> |
|
| 664 | + * </p> |
|
| 665 | + * @param int $seconds <p> |
|
| 666 | + * Number of seconds to wait, must be non-negative. |
|
| 667 | + * </p> |
|
| 668 | + * @param int $microseconds [optional] <p> |
|
| 669 | + * Number of microseconds to wait, must be non-negative. |
|
| 670 | + * </p> |
|
| 671 | + * @return int|false number of ready connections in success, false otherwise. |
|
| 672 | + */ |
|
| 673 | + #[TentativeType] |
|
| 674 | + public static function poll(?array &$read, ?array &$error, array &$reject, int $seconds, int $microseconds = 0): int|false {} |
|
| 675 | + |
|
| 676 | + /** |
|
| 677 | + * Get result from async query |
|
| 678 | + * @link https://php.net/manual/en/mysqli.reap-async-query.php |
|
| 679 | + * @return mysqli_result|false mysqli_result in success, false otherwise. |
|
| 680 | + */ |
|
| 681 | + #[TentativeType] |
|
| 682 | + public function reap_async_query(): mysqli_result|bool {} |
|
| 683 | + |
|
| 684 | + /** |
|
| 685 | + * Escapes special characters in a string for use in an SQL statement, taking into account the current charset of the connection |
|
| 686 | + * @param string $string The string to be escaped. |
|
| 687 | + * Characters encoded are NUL (ASCII 0), \n, \r, \, ', ", and Control-Z. |
|
| 688 | + * @return string |
|
| 689 | + * @link https://secure.php.net/manual/en/mysqli.real-escape-string.php |
|
| 690 | + */ |
|
| 691 | + #[TentativeType] |
|
| 692 | + public function escape_string(string $string): string {} |
|
| 693 | + |
|
| 694 | + /** |
|
| 695 | + * Execute an SQL query |
|
| 696 | + * @link https://php.net/manual/en/mysqli.real-query.php |
|
| 697 | + * @param string $query <p> |
|
| 698 | + * The query, as a string. |
|
| 699 | + * </p> |
|
| 700 | + * <p> |
|
| 701 | + * Data inside the query should be properly escaped. |
|
| 702 | + * </p> |
|
| 703 | + * @return bool true on success or false on failure. |
|
| 704 | + */ |
|
| 705 | + #[TentativeType] |
|
| 706 | + public function real_query(string $query): bool {} |
|
| 707 | + |
|
| 708 | + /** |
|
| 709 | + * Execute an SQL query |
|
| 710 | + * @link https://php.net/manual/en/mysqli.release-savepoint.php |
|
| 711 | + * @param string $name |
|
| 712 | + * @return bool Returns TRUE on success or FALSE on failure. |
|
| 713 | + * @since 5.5 |
|
| 714 | + */ |
|
| 715 | + #[TentativeType] |
|
| 716 | + public function release_savepoint(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $name): bool {} |
|
| 717 | + |
|
| 718 | + /** |
|
| 719 | + * Rolls back current transaction |
|
| 720 | + * @link https://php.net/manual/en/mysqli.rollback.php |
|
| 721 | + * @param int $flags [optional] A bitmask of MYSQLI_TRANS_COR_* constants. |
|
| 722 | + * @param string $name [optional] If provided then ROLLBACK $name is executed. |
|
| 723 | + * @return bool true on success or false on failure. |
|
| 724 | + * @since 5.5 Added flags and name parameters. |
|
| 725 | + */ |
|
| 726 | + #[TentativeType] |
|
| 727 | + public function rollback( |
|
| 728 | + #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $flags = 0, |
|
| 729 | + #[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $name = null |
|
| 730 | + ): bool {} |
|
| 731 | + |
|
| 732 | + /** |
|
| 733 | + * Set a named transaction savepoint |
|
| 734 | + * @link https://secure.php.net/manual/en/mysqli.savepoint.php |
|
| 735 | + * @param string $name |
|
| 736 | + * @return bool Returns TRUE on success or FALSE on failure. |
|
| 737 | + * @since 5.5 |
|
| 738 | + */ |
|
| 739 | + #[TentativeType] |
|
| 740 | + public function savepoint(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $name): bool {} |
|
| 741 | + |
|
| 742 | + /** |
|
| 743 | + * Selects the default database for database queries |
|
| 744 | + * @link https://php.net/manual/en/mysqli.select-db.php |
|
| 745 | + * @param string $database <p> |
|
| 746 | + * The database name. |
|
| 747 | + * </p> |
|
| 748 | + * @return bool true on success or false on failure. |
|
| 749 | + */ |
|
| 750 | + #[TentativeType] |
|
| 751 | + public function select_db(string $database): bool {} |
|
| 752 | + |
|
| 753 | + /** |
|
| 754 | + * Sets the default client character set |
|
| 755 | + * @link https://php.net/manual/en/mysqli.set-charset.php |
|
| 756 | + * @param string $charset <p> |
|
| 757 | + * The charset to be set as default. |
|
| 758 | + * </p> |
|
| 759 | + * @return bool true on success or false on failure..5 |
|
| 760 | + */ |
|
| 761 | + #[TentativeType] |
|
| 762 | + public function set_charset(string $charset): bool {} |
|
| 763 | + |
|
| 764 | + /** |
|
| 765 | + * @link https://php.net/manual/en/function.mysqli-set-opt |
|
| 766 | + * @param int $option |
|
| 767 | + * @param mixed $value |
|
| 768 | + */ |
|
| 769 | + #[TentativeType] |
|
| 770 | + public function set_opt(int $option, $value): bool {} |
|
| 771 | + |
|
| 772 | + /** |
|
| 773 | + * Used for establishing secure connections using SSL |
|
| 774 | + * @link https://secure.php.net/manual/en/mysqli.ssl-set.php |
|
| 775 | + * @param string $key <p> |
|
| 776 | + * The path name to the key file. |
|
| 777 | + * </p> |
|
| 778 | + * @param string $certificate <p> |
|
| 779 | + * The path name to the certificate file. |
|
| 780 | + * </p> |
|
| 781 | + * @param string $ca_certificate <p> |
|
| 782 | + * The path name to the certificate authority file. |
|
| 783 | + * </p> |
|
| 784 | + * @param string $ca_path <p> |
|
| 785 | + * The pathname to a directory that contains trusted SSL CA certificates in PEM format. |
|
| 786 | + * </p> |
|
| 787 | + * @param string $cipher_algos <p> |
|
| 788 | + * A list of allowable ciphers to use for SSL encryption. |
|
| 789 | + * </p> |
|
| 790 | + * @return bool This function always returns TRUE value. |
|
| 791 | + */ |
|
| 792 | + public function ssl_set(?string $key, ?string $certificate, ?string $ca_certificate, ?string $ca_path, ?string $cipher_algos) {} |
|
| 793 | + |
|
| 794 | + /** |
|
| 795 | + * Gets the current system status |
|
| 796 | + * @link https://php.net/manual/en/mysqli.stat.php |
|
| 797 | + * @return string|false A string describing the server status. false if an error occurred. |
|
| 798 | + */ |
|
| 799 | + #[TentativeType] |
|
| 800 | + public function stat(): string|false {} |
|
| 801 | + |
|
| 802 | + /** |
|
| 803 | + * Initializes a statement and returns an object for use with mysqli_stmt_prepare |
|
| 804 | + * @link https://php.net/manual/en/mysqli.stmt-init.php |
|
| 805 | + * @return mysqli_stmt an object. |
|
| 806 | + */ |
|
| 807 | + #[TentativeType] |
|
| 808 | + public function stmt_init(): mysqli_stmt|false {} |
|
| 809 | + |
|
| 810 | + /** |
|
| 811 | + * Transfers a result set from the last query |
|
| 812 | + * @link https://php.net/manual/en/mysqli.store-result.php |
|
| 813 | + * @param int $mode [optional] The option that you want to set |
|
| 814 | + * @return mysqli_result|false a buffered result object or false if an error occurred. |
|
| 815 | + * </p> |
|
| 816 | + * <p> |
|
| 817 | + * <b>mysqli_store_result</b> returns false in case the query |
|
| 818 | + * didn't return a result set (if the query was, for example an INSERT |
|
| 819 | + * statement). This function also returns false if the reading of the |
|
| 820 | + * result set failed. You can check if you have got an error by checking |
|
| 821 | + * if <b>mysqli_error</b> doesn't return an empty string, if |
|
| 822 | + * <b>mysqli_errno</b> returns a non zero value, or if |
|
| 823 | + * <b>mysqli_field_count</b> returns a non zero value. |
|
| 824 | + * Also possible reason for this function returning false after |
|
| 825 | + * successful call to <b>mysqli_query</b> can be too large |
|
| 826 | + * result set (memory for it cannot be allocated). If |
|
| 827 | + * <b>mysqli_field_count</b> returns a non-zero value, the |
|
| 828 | + * statement should have produced a non-empty result set. |
|
| 829 | + */ |
|
| 830 | + #[TentativeType] |
|
| 831 | + public function store_result(int $mode = null): mysqli_result|false {} |
|
| 832 | + |
|
| 833 | + /** |
|
| 834 | + * Returns whether thread safety is given or not |
|
| 835 | + * @link https://php.net/manual/en/mysqli.thread-safe.php |
|
| 836 | + * @return bool true if the client library is thread-safe, otherwise false. |
|
| 837 | + */ |
|
| 838 | + #[TentativeType] |
|
| 839 | + public function thread_safe(): bool {} |
|
| 840 | + |
|
| 841 | + /** |
|
| 842 | + * Initiate a result set retrieval |
|
| 843 | + * @link https://php.net/manual/en/mysqli.use-result.php |
|
| 844 | + * @return mysqli_result|false an unbuffered result object or false if an error occurred. |
|
| 845 | + */ |
|
| 846 | + #[TentativeType] |
|
| 847 | + public function use_result(): mysqli_result|false {} |
|
| 848 | + |
|
| 849 | + /** |
|
| 850 | + * @link https://php.net/manual/en/mysqli.refresh |
|
| 851 | + * @param int $flags MYSQLI_REFRESH_* |
|
| 852 | + * @return bool TRUE if the refresh was a success, otherwise FALSE |
|
| 853 | + * @since 5.3 |
|
| 854 | + */ |
|
| 855 | + #[TentativeType] |
|
| 856 | + public function refresh(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $flags): bool {} |
|
| 857 | 857 | } |
| 858 | 858 | |
| 859 | 859 | /** |
@@ -862,42 +862,42 @@ discard block |
||
| 862 | 862 | */ |
| 863 | 863 | final class mysqli_warning |
| 864 | 864 | { |
| 865 | - /** |
|
| 866 | - * @var string |
|
| 867 | - */ |
|
| 868 | - #[LanguageLevelTypeAware(['8.1' => 'string'], default: '')] |
|
| 869 | - public $message; |
|
| 870 | - /** |
|
| 871 | - * @var string |
|
| 872 | - */ |
|
| 873 | - #[LanguageLevelTypeAware(['8.1' => 'string'], default: '')] |
|
| 874 | - public $sqlstate; |
|
| 875 | - /** |
|
| 876 | - * @var int |
|
| 877 | - */ |
|
| 878 | - #[LanguageLevelTypeAware(['8.1' => 'int'], default: '')] |
|
| 879 | - public $errno; |
|
| 880 | - |
|
| 881 | - /** |
|
| 882 | - * The __construct purpose |
|
| 883 | - * @link https://php.net/manual/en/mysqli-warning.construct.php |
|
| 884 | - */ |
|
| 885 | - #[PhpStormStubsElementAvailable(from: '8.0')] |
|
| 886 | - private function __construct() {} |
|
| 887 | - |
|
| 888 | - /** |
|
| 889 | - * The __construct purpose |
|
| 890 | - * @link https://php.net/manual/en/mysqli-warning.construct.php |
|
| 891 | - */ |
|
| 892 | - #[PhpStormStubsElementAvailable(from: '5.3', to: '7.4')] |
|
| 893 | - protected function __construct() {} |
|
| 894 | - |
|
| 895 | - /** |
|
| 896 | - * Move to the next warning |
|
| 897 | - * @link https://php.net/manual/en/mysqli-warning.next.php |
|
| 898 | - * @return bool True if it successfully moved to the next warning |
|
| 899 | - */ |
|
| 900 | - public function next(): bool {} |
|
| 865 | + /** |
|
| 866 | + * @var string |
|
| 867 | + */ |
|
| 868 | + #[LanguageLevelTypeAware(['8.1' => 'string'], default: '')] |
|
| 869 | + public $message; |
|
| 870 | + /** |
|
| 871 | + * @var string |
|
| 872 | + */ |
|
| 873 | + #[LanguageLevelTypeAware(['8.1' => 'string'], default: '')] |
|
| 874 | + public $sqlstate; |
|
| 875 | + /** |
|
| 876 | + * @var int |
|
| 877 | + */ |
|
| 878 | + #[LanguageLevelTypeAware(['8.1' => 'int'], default: '')] |
|
| 879 | + public $errno; |
|
| 880 | + |
|
| 881 | + /** |
|
| 882 | + * The __construct purpose |
|
| 883 | + * @link https://php.net/manual/en/mysqli-warning.construct.php |
|
| 884 | + */ |
|
| 885 | + #[PhpStormStubsElementAvailable(from: '8.0')] |
|
| 886 | + private function __construct() {} |
|
| 887 | + |
|
| 888 | + /** |
|
| 889 | + * The __construct purpose |
|
| 890 | + * @link https://php.net/manual/en/mysqli-warning.construct.php |
|
| 891 | + */ |
|
| 892 | + #[PhpStormStubsElementAvailable(from: '5.3', to: '7.4')] |
|
| 893 | + protected function __construct() {} |
|
| 894 | + |
|
| 895 | + /** |
|
| 896 | + * Move to the next warning |
|
| 897 | + * @link https://php.net/manual/en/mysqli-warning.next.php |
|
| 898 | + * @return bool True if it successfully moved to the next warning |
|
| 899 | + */ |
|
| 900 | + public function next(): bool {} |
|
| 901 | 901 | } |
| 902 | 902 | |
| 903 | 903 | /** |
@@ -907,376 +907,376 @@ discard block |
||
| 907 | 907 | */ |
| 908 | 908 | class mysqli_result implements IteratorAggregate |
| 909 | 909 | { |
| 910 | - /** |
|
| 911 | - * @var int |
|
| 912 | - */ |
|
| 913 | - #[LanguageLevelTypeAware(['8.1' => 'int'], default: '')] |
|
| 914 | - public $current_field; |
|
| 915 | - /** |
|
| 916 | - * @var int |
|
| 917 | - */ |
|
| 918 | - #[LanguageLevelTypeAware(['8.1' => 'int'], default: '')] |
|
| 919 | - public $field_count; |
|
| 920 | - /** |
|
| 921 | - * @var array |
|
| 922 | - */ |
|
| 923 | - #[LanguageLevelTypeAware(['8.1' => 'array|null'], default: '')] |
|
| 924 | - public $lengths; |
|
| 925 | - /** |
|
| 926 | - * @var int |
|
| 927 | - */ |
|
| 928 | - #[LanguageLevelTypeAware(['8.1' => 'int|string'], default: '')] |
|
| 929 | - public $num_rows; |
|
| 930 | - /** |
|
| 931 | - * @var mixed |
|
| 932 | - */ |
|
| 933 | - #[LanguageLevelTypeAware(['8.1' => 'int'], default: '')] |
|
| 934 | - public $type; |
|
| 935 | - |
|
| 936 | - /** |
|
| 937 | - * Constructor (no docs available) |
|
| 938 | - * @param object $mysql [optional] |
|
| 939 | - * @param int $result_mode [optional] |
|
| 940 | - */ |
|
| 941 | - public function __construct( |
|
| 942 | - #[PhpStormStubsElementAvailable(from: '8.0')] mysqli $mysql = null, |
|
| 943 | - #[PhpStormStubsElementAvailable(from: '8.0')] int $result_mode = 0 |
|
| 944 | - ) {} |
|
| 945 | - |
|
| 946 | - /** |
|
| 947 | - * Frees the memory associated with a result |
|
| 948 | - * @return void |
|
| 949 | - * @link https://php.net/manual/en/mysqli-result.free.php |
|
| 950 | - */ |
|
| 951 | - #[TentativeType] |
|
| 952 | - public function close(): void {} |
|
| 953 | - |
|
| 954 | - /** |
|
| 955 | - * Frees the memory associated with a result |
|
| 956 | - * @link https://php.net/manual/en/mysqli-result.free.php |
|
| 957 | - * @return void |
|
| 958 | - */ |
|
| 959 | - #[TentativeType] |
|
| 960 | - public function free(): void {} |
|
| 961 | - |
|
| 962 | - /** |
|
| 963 | - * Adjusts the result pointer to an arbitrary row in the result |
|
| 964 | - * @link https://php.net/manual/en/mysqli-result.data-seek.php |
|
| 965 | - * @param int $offset <p> |
|
| 966 | - * The field offset. Must be between zero and the total number of rows |
|
| 967 | - * minus one (0..<b>mysqli_num_rows</b> - 1). |
|
| 968 | - * </p> |
|
| 969 | - * @return bool true on success or false on failure. |
|
| 970 | - */ |
|
| 971 | - #[TentativeType] |
|
| 972 | - public function data_seek(int $offset): bool {} |
|
| 973 | - |
|
| 974 | - /** |
|
| 975 | - * Returns the next field in the result set |
|
| 976 | - * @link https://php.net/manual/en/mysqli-result.fetch-field.php |
|
| 977 | - * @return object|false an object which contains field definition information or false |
|
| 978 | - * if no field information is available. |
|
| 979 | - * </p> |
|
| 980 | - * <p> |
|
| 981 | - * <table> |
|
| 982 | - * Object properties |
|
| 983 | - * <tr valign="top"> |
|
| 984 | - * <td>Property</td> |
|
| 985 | - * <td>Description</td> |
|
| 986 | - * </tr> |
|
| 987 | - * <tr valign="top"> |
|
| 988 | - * <td>name</td> |
|
| 989 | - * <td>The name of the column</td> |
|
| 990 | - * </tr> |
|
| 991 | - * <tr valign="top"> |
|
| 992 | - * <td>orgname</td> |
|
| 993 | - * <td>Original column name if an alias was specified</td> |
|
| 994 | - * </tr> |
|
| 995 | - * <tr valign="top"> |
|
| 996 | - * <td>table</td> |
|
| 997 | - * <td>The name of the table this field belongs to (if not calculated)</td> |
|
| 998 | - * </tr> |
|
| 999 | - * <tr valign="top"> |
|
| 1000 | - * <td>orgtable</td> |
|
| 1001 | - * <td>Original table name if an alias was specified</td> |
|
| 1002 | - * </tr> |
|
| 1003 | - * <tr valign="top"> |
|
| 1004 | - * <td>def</td> |
|
| 1005 | - * <td>Reserved for default value, currently always ""</td> |
|
| 1006 | - * </tr> |
|
| 1007 | - * <tr valign="top"> |
|
| 1008 | - * <td>db</td> |
|
| 1009 | - * <td>Database (since PHP 5.3.6)</td> |
|
| 1010 | - * </tr> |
|
| 1011 | - * <tr valign="top"> |
|
| 1012 | - * <td>catalog</td> |
|
| 1013 | - * <td>The catalog name, always "def" (since PHP 5.3.6)</td> |
|
| 1014 | - * </tr> |
|
| 1015 | - * <tr valign="top"> |
|
| 1016 | - * <td>max_length</td> |
|
| 1017 | - * <td>The maximum width of the field for the result set.</td> |
|
| 1018 | - * </tr> |
|
| 1019 | - * <tr valign="top"> |
|
| 1020 | - * <td>length</td> |
|
| 1021 | - * <td>The width of the field, as specified in the table definition.</td> |
|
| 1022 | - * </tr> |
|
| 1023 | - * <tr valign="top"> |
|
| 1024 | - * <td>charsetnr</td> |
|
| 1025 | - * <td>The character set number for the field.</td> |
|
| 1026 | - * </tr> |
|
| 1027 | - * <tr valign="top"> |
|
| 1028 | - * <td>flags</td> |
|
| 1029 | - * <td>An integer representing the bit-flags for the field.</td> |
|
| 1030 | - * </tr> |
|
| 1031 | - * <tr valign="top"> |
|
| 1032 | - * <td>type</td> |
|
| 1033 | - * <td>The data type used for this field</td> |
|
| 1034 | - * </tr> |
|
| 1035 | - * <tr valign="top"> |
|
| 1036 | - * <td>decimals</td> |
|
| 1037 | - * <td>The number of decimals used (for integer fields)</td> |
|
| 1038 | - * </tr> |
|
| 1039 | - * </table> |
|
| 1040 | - */ |
|
| 1041 | - #[TentativeType] |
|
| 1042 | - public function fetch_field(): object|false {} |
|
| 1043 | - |
|
| 1044 | - /** |
|
| 1045 | - * Returns an array of objects representing the fields in a result set |
|
| 1046 | - * @link https://php.net/manual/en/mysqli-result.fetch-fields.php |
|
| 1047 | - * @return array|false an array of objects which contains field definition information or |
|
| 1048 | - * false if no field information is available. |
|
| 1049 | - * </p> |
|
| 1050 | - * <p> |
|
| 1051 | - * <table> |
|
| 1052 | - * Object properties |
|
| 1053 | - * <tr valign="top"> |
|
| 1054 | - * <td>Property</td> |
|
| 1055 | - * <td>Description</td> |
|
| 1056 | - * </tr> |
|
| 1057 | - * <tr valign="top"> |
|
| 1058 | - * <td>name</td> |
|
| 1059 | - * <td>The name of the column</td> |
|
| 1060 | - * </tr> |
|
| 1061 | - * <tr valign="top"> |
|
| 1062 | - * <td>orgname</td> |
|
| 1063 | - * <td>Original column name if an alias was specified</td> |
|
| 1064 | - * </tr> |
|
| 1065 | - * <tr valign="top"> |
|
| 1066 | - * <td>table</td> |
|
| 1067 | - * <td>The name of the table this field belongs to (if not calculated)</td> |
|
| 1068 | - * </tr> |
|
| 1069 | - * <tr valign="top"> |
|
| 1070 | - * <td>orgtable</td> |
|
| 1071 | - * <td>Original table name if an alias was specified</td> |
|
| 1072 | - * </tr> |
|
| 1073 | - * <tr valign="top"> |
|
| 1074 | - * <td>def</td> |
|
| 1075 | - * <td>The default value for this field, represented as a string</td> |
|
| 1076 | - * </tr> |
|
| 1077 | - * <tr valign="top"> |
|
| 1078 | - * <td>max_length</td> |
|
| 1079 | - * <td>The maximum width of the field for the result set.</td> |
|
| 1080 | - * </tr> |
|
| 1081 | - * <tr valign="top"> |
|
| 1082 | - * <td>length</td> |
|
| 1083 | - * <td>The width of the field, as specified in the table definition.</td> |
|
| 1084 | - * </tr> |
|
| 1085 | - * <tr valign="top"> |
|
| 1086 | - * <td>charsetnr</td> |
|
| 1087 | - * <td>The character set number for the field.</td> |
|
| 1088 | - * </tr> |
|
| 1089 | - * <tr valign="top"> |
|
| 1090 | - * <td>flags</td> |
|
| 1091 | - * <td>An integer representing the bit-flags for the field.</td> |
|
| 1092 | - * </tr> |
|
| 1093 | - * <tr valign="top"> |
|
| 1094 | - * <td>type</td> |
|
| 1095 | - * <td>The data type used for this field</td> |
|
| 1096 | - * </tr> |
|
| 1097 | - * <tr valign="top"> |
|
| 1098 | - * <td>decimals</td> |
|
| 1099 | - * <td>The number of decimals used (for integer fields)</td> |
|
| 1100 | - * </tr> |
|
| 1101 | - * </table> |
|
| 1102 | - */ |
|
| 1103 | - #[TentativeType] |
|
| 1104 | - public function fetch_fields(): array {} |
|
| 1105 | - |
|
| 1106 | - /** |
|
| 1107 | - * Fetch meta-data for a single field |
|
| 1108 | - * @link https://php.net/manual/en/mysqli-result.fetch-field-direct.php |
|
| 1109 | - * @param int $index <p> |
|
| 1110 | - * The field number. This value must be in the range from |
|
| 1111 | - * 0 to number of fields - 1. |
|
| 1112 | - * </p> |
|
| 1113 | - * @return object|false an object which contains field definition information or false |
|
| 1114 | - * if no field information for specified fieldnr is |
|
| 1115 | - * available. |
|
| 1116 | - * </p> |
|
| 1117 | - * <p> |
|
| 1118 | - * <table> |
|
| 1119 | - * Object attributes |
|
| 1120 | - * <tr valign="top"> |
|
| 1121 | - * <td>Attribute</td> |
|
| 1122 | - * <td>Description</td> |
|
| 1123 | - * </tr> |
|
| 1124 | - * <tr valign="top"> |
|
| 1125 | - * <td>name</td> |
|
| 1126 | - * <td>The name of the column</td> |
|
| 1127 | - * </tr> |
|
| 1128 | - * <tr valign="top"> |
|
| 1129 | - * <td>orgname</td> |
|
| 1130 | - * <td>Original column name if an alias was specified</td> |
|
| 1131 | - * </tr> |
|
| 1132 | - * <tr valign="top"> |
|
| 1133 | - * <td>table</td> |
|
| 1134 | - * <td>The name of the table this field belongs to (if not calculated)</td> |
|
| 1135 | - * </tr> |
|
| 1136 | - * <tr valign="top"> |
|
| 1137 | - * <td>orgtable</td> |
|
| 1138 | - * <td>Original table name if an alias was specified</td> |
|
| 1139 | - * </tr> |
|
| 1140 | - * <tr valign="top"> |
|
| 1141 | - * <td>def</td> |
|
| 1142 | - * <td>The default value for this field, represented as a string</td> |
|
| 1143 | - * </tr> |
|
| 1144 | - * <tr valign="top"> |
|
| 1145 | - * <td>max_length</td> |
|
| 1146 | - * <td>The maximum width of the field for the result set.</td> |
|
| 1147 | - * </tr> |
|
| 1148 | - * <tr valign="top"> |
|
| 1149 | - * <td>length</td> |
|
| 1150 | - * <td>The width of the field, as specified in the table definition.</td> |
|
| 1151 | - * </tr> |
|
| 1152 | - * <tr valign="top"> |
|
| 1153 | - * <td>charsetnr</td> |
|
| 1154 | - * <td>The character set number for the field.</td> |
|
| 1155 | - * </tr> |
|
| 1156 | - * <tr valign="top"> |
|
| 1157 | - * <td>flags</td> |
|
| 1158 | - * <td>An integer representing the bit-flags for the field.</td> |
|
| 1159 | - * </tr> |
|
| 1160 | - * <tr valign="top"> |
|
| 1161 | - * <td>type</td> |
|
| 1162 | - * <td>The data type used for this field</td> |
|
| 1163 | - * </tr> |
|
| 1164 | - * <tr valign="top"> |
|
| 1165 | - * <td>decimals</td> |
|
| 1166 | - * <td>The number of decimals used (for integer fields)</td> |
|
| 1167 | - * </tr> |
|
| 1168 | - * </table> |
|
| 1169 | - */ |
|
| 1170 | - #[TentativeType] |
|
| 1171 | - public function fetch_field_direct(int $index): object|false {} |
|
| 1172 | - |
|
| 1173 | - /** |
|
| 1174 | - * Fetches all result rows as an associative array, a numeric array, or both |
|
| 1175 | - * @link https://php.net/manual/en/mysqli-result.fetch-all.php |
|
| 1176 | - * @param int $mode [optional] <p> |
|
| 1177 | - * This optional parameter is a constant indicating what type of array |
|
| 1178 | - * should be produced from the current row data. The possible values for |
|
| 1179 | - * this parameter are the constants MYSQLI_ASSOC, |
|
| 1180 | - * MYSQLI_NUM, or MYSQLI_BOTH. |
|
| 1181 | - * </p> |
|
| 1182 | - * @return mixed an array of associative or numeric arrays holding result rows. |
|
| 1183 | - */ |
|
| 1184 | - #[TentativeType] |
|
| 1185 | - public function fetch_all(int $mode = MYSQLI_NUM): array {} |
|
| 1186 | - |
|
| 1187 | - /** |
|
| 1188 | - * Fetch a result row as an associative, a numeric array, or both |
|
| 1189 | - * @link https://php.net/manual/en/mysqli-result.fetch-array.php |
|
| 1190 | - * @param int $mode [optional] <p> |
|
| 1191 | - * This optional parameter is a constant indicating what type of array |
|
| 1192 | - * should be produced from the current row data. The possible values for |
|
| 1193 | - * this parameter are the constants <b>MYSQLI_ASSOC</b>, |
|
| 1194 | - * <b>MYSQLI_NUM</b>, or <b>MYSQLI_BOTH</b>. |
|
| 1195 | - * </p> |
|
| 1196 | - * <p> |
|
| 1197 | - * By using the <b>MYSQLI_ASSOC</b> constant this function |
|
| 1198 | - * will behave identically to the <b>mysqli_fetch_assoc</b>, |
|
| 1199 | - * while <b>MYSQLI_NUM</b> will behave identically to the |
|
| 1200 | - * <b>mysqli_fetch_row</b> function. The final option |
|
| 1201 | - * <b>MYSQLI_BOTH</b> will create a single array with the |
|
| 1202 | - * attributes of both. |
|
| 1203 | - * </p> |
|
| 1204 | - * @return mixed an array of strings that corresponds to the fetched row or null if there |
|
| 1205 | - * are no more rows in resultset. |
|
| 1206 | - */ |
|
| 1207 | - #[TentativeType] |
|
| 1208 | - public function fetch_array(int $mode = MYSQLI_BOTH): array|false|null {} |
|
| 1209 | - |
|
| 1210 | - /** |
|
| 1211 | - * Fetch a result row as an associative array |
|
| 1212 | - * @link https://php.net/manual/en/mysqli-result.fetch-assoc.php |
|
| 1213 | - * @return array|null an associative array of strings representing the fetched row in the result |
|
| 1214 | - * set, where each key in the array represents the name of one of the result |
|
| 1215 | - * set's columns or null if there are no more rows in resultset. |
|
| 1216 | - * </p> |
|
| 1217 | - * <p> |
|
| 1218 | - * If two or more columns of the result have the same field names, the last |
|
| 1219 | - * column will take precedence. To access the other column(s) of the same |
|
| 1220 | - * name, you either need to access the result with numeric indices by using |
|
| 1221 | - * <b>mysqli_fetch_row</b> or add alias names. |
|
| 1222 | - */ |
|
| 1223 | - #[TentativeType] |
|
| 1224 | - public function fetch_assoc(): array|false|null {} |
|
| 1225 | - |
|
| 1226 | - /** |
|
| 1227 | - * Returns the current row of a result set as an object |
|
| 1228 | - * @link https://php.net/manual/en/mysqli-result.fetch-object.php |
|
| 1229 | - * @param string $class [optional] <p> |
|
| 1230 | - * The name of the class to instantiate, set the properties of and return. |
|
| 1231 | - * If not specified, a <b>stdClass</b> object is returned. |
|
| 1232 | - * </p> |
|
| 1233 | - * @param null|array $constructor_args [optional] <p> |
|
| 1234 | - * An optional array of parameters to pass to the constructor |
|
| 1235 | - * for <i>class_name</i> objects. |
|
| 1236 | - * </p> |
|
| 1237 | - * @return stdClass|object an object with string properties that corresponds to the fetched |
|
| 1238 | - * row or null if there are no more rows in resultset. |
|
| 1239 | - */ |
|
| 1240 | - #[TentativeType] |
|
| 1241 | - public function fetch_object(string $class = 'stdClass', array $constructor_args = null): object|false|null {} |
|
| 1242 | - |
|
| 1243 | - /** |
|
| 1244 | - * Get a result row as an enumerated array |
|
| 1245 | - * @link https://php.net/manual/en/mysqli-result.fetch-row.php |
|
| 1246 | - * @return array|false|null mysqli_fetch_row returns an array of strings that corresponds to the fetched row |
|
| 1247 | - * or null if there are no more rows in result set. |
|
| 1248 | - */ |
|
| 1249 | - #[TentativeType] |
|
| 1250 | - public function fetch_row(): array|false|null {} |
|
| 1251 | - |
|
| 1252 | - #[PhpStormStubsElementAvailable('8.1')] |
|
| 1253 | - public function fetch_column(int $column = null): string|int|float|false|null {} |
|
| 1254 | - |
|
| 1255 | - /** |
|
| 1256 | - * Set result pointer to a specified field offset |
|
| 1257 | - * @link https://php.net/manual/en/mysqli-result.field-seek.php |
|
| 1258 | - * @param int $index <p> |
|
| 1259 | - * The field number. This value must be in the range from |
|
| 1260 | - * 0 to number of fields - 1. |
|
| 1261 | - * </p> |
|
| 1262 | - * @return bool true on success or false on failure. |
|
| 1263 | - */ |
|
| 1264 | - #[TentativeType] |
|
| 1265 | - public function field_seek(int $index): bool {} |
|
| 1266 | - |
|
| 1267 | - /** |
|
| 1268 | - * Frees the memory associated with a result |
|
| 1269 | - * @return void |
|
| 1270 | - * @link https://php.net/manual/en/mysqli-result.free.php |
|
| 1271 | - */ |
|
| 1272 | - #[TentativeType] |
|
| 1273 | - public function free_result(): void {} |
|
| 1274 | - |
|
| 1275 | - /** |
|
| 1276 | - * @return Iterator |
|
| 1277 | - * @since 8.0 |
|
| 1278 | - */ |
|
| 1279 | - public function getIterator(): Iterator {} |
|
| 910 | + /** |
|
| 911 | + * @var int |
|
| 912 | + */ |
|
| 913 | + #[LanguageLevelTypeAware(['8.1' => 'int'], default: '')] |
|
| 914 | + public $current_field; |
|
| 915 | + /** |
|
| 916 | + * @var int |
|
| 917 | + */ |
|
| 918 | + #[LanguageLevelTypeAware(['8.1' => 'int'], default: '')] |
|
| 919 | + public $field_count; |
|
| 920 | + /** |
|
| 921 | + * @var array |
|
| 922 | + */ |
|
| 923 | + #[LanguageLevelTypeAware(['8.1' => 'array|null'], default: '')] |
|
| 924 | + public $lengths; |
|
| 925 | + /** |
|
| 926 | + * @var int |
|
| 927 | + */ |
|
| 928 | + #[LanguageLevelTypeAware(['8.1' => 'int|string'], default: '')] |
|
| 929 | + public $num_rows; |
|
| 930 | + /** |
|
| 931 | + * @var mixed |
|
| 932 | + */ |
|
| 933 | + #[LanguageLevelTypeAware(['8.1' => 'int'], default: '')] |
|
| 934 | + public $type; |
|
| 935 | + |
|
| 936 | + /** |
|
| 937 | + * Constructor (no docs available) |
|
| 938 | + * @param object $mysql [optional] |
|
| 939 | + * @param int $result_mode [optional] |
|
| 940 | + */ |
|
| 941 | + public function __construct( |
|
| 942 | + #[PhpStormStubsElementAvailable(from: '8.0')] mysqli $mysql = null, |
|
| 943 | + #[PhpStormStubsElementAvailable(from: '8.0')] int $result_mode = 0 |
|
| 944 | + ) {} |
|
| 945 | + |
|
| 946 | + /** |
|
| 947 | + * Frees the memory associated with a result |
|
| 948 | + * @return void |
|
| 949 | + * @link https://php.net/manual/en/mysqli-result.free.php |
|
| 950 | + */ |
|
| 951 | + #[TentativeType] |
|
| 952 | + public function close(): void {} |
|
| 953 | + |
|
| 954 | + /** |
|
| 955 | + * Frees the memory associated with a result |
|
| 956 | + * @link https://php.net/manual/en/mysqli-result.free.php |
|
| 957 | + * @return void |
|
| 958 | + */ |
|
| 959 | + #[TentativeType] |
|
| 960 | + public function free(): void {} |
|
| 961 | + |
|
| 962 | + /** |
|
| 963 | + * Adjusts the result pointer to an arbitrary row in the result |
|
| 964 | + * @link https://php.net/manual/en/mysqli-result.data-seek.php |
|
| 965 | + * @param int $offset <p> |
|
| 966 | + * The field offset. Must be between zero and the total number of rows |
|
| 967 | + * minus one (0..<b>mysqli_num_rows</b> - 1). |
|
| 968 | + * </p> |
|
| 969 | + * @return bool true on success or false on failure. |
|
| 970 | + */ |
|
| 971 | + #[TentativeType] |
|
| 972 | + public function data_seek(int $offset): bool {} |
|
| 973 | + |
|
| 974 | + /** |
|
| 975 | + * Returns the next field in the result set |
|
| 976 | + * @link https://php.net/manual/en/mysqli-result.fetch-field.php |
|
| 977 | + * @return object|false an object which contains field definition information or false |
|
| 978 | + * if no field information is available. |
|
| 979 | + * </p> |
|
| 980 | + * <p> |
|
| 981 | + * <table> |
|
| 982 | + * Object properties |
|
| 983 | + * <tr valign="top"> |
|
| 984 | + * <td>Property</td> |
|
| 985 | + * <td>Description</td> |
|
| 986 | + * </tr> |
|
| 987 | + * <tr valign="top"> |
|
| 988 | + * <td>name</td> |
|
| 989 | + * <td>The name of the column</td> |
|
| 990 | + * </tr> |
|
| 991 | + * <tr valign="top"> |
|
| 992 | + * <td>orgname</td> |
|
| 993 | + * <td>Original column name if an alias was specified</td> |
|
| 994 | + * </tr> |
|
| 995 | + * <tr valign="top"> |
|
| 996 | + * <td>table</td> |
|
| 997 | + * <td>The name of the table this field belongs to (if not calculated)</td> |
|
| 998 | + * </tr> |
|
| 999 | + * <tr valign="top"> |
|
| 1000 | + * <td>orgtable</td> |
|
| 1001 | + * <td>Original table name if an alias was specified</td> |
|
| 1002 | + * </tr> |
|
| 1003 | + * <tr valign="top"> |
|
| 1004 | + * <td>def</td> |
|
| 1005 | + * <td>Reserved for default value, currently always ""</td> |
|
| 1006 | + * </tr> |
|
| 1007 | + * <tr valign="top"> |
|
| 1008 | + * <td>db</td> |
|
| 1009 | + * <td>Database (since PHP 5.3.6)</td> |
|
| 1010 | + * </tr> |
|
| 1011 | + * <tr valign="top"> |
|
| 1012 | + * <td>catalog</td> |
|
| 1013 | + * <td>The catalog name, always "def" (since PHP 5.3.6)</td> |
|
| 1014 | + * </tr> |
|
| 1015 | + * <tr valign="top"> |
|
| 1016 | + * <td>max_length</td> |
|
| 1017 | + * <td>The maximum width of the field for the result set.</td> |
|
| 1018 | + * </tr> |
|
| 1019 | + * <tr valign="top"> |
|
| 1020 | + * <td>length</td> |
|
| 1021 | + * <td>The width of the field, as specified in the table definition.</td> |
|
| 1022 | + * </tr> |
|
| 1023 | + * <tr valign="top"> |
|
| 1024 | + * <td>charsetnr</td> |
|
| 1025 | + * <td>The character set number for the field.</td> |
|
| 1026 | + * </tr> |
|
| 1027 | + * <tr valign="top"> |
|
| 1028 | + * <td>flags</td> |
|
| 1029 | + * <td>An integer representing the bit-flags for the field.</td> |
|
| 1030 | + * </tr> |
|
| 1031 | + * <tr valign="top"> |
|
| 1032 | + * <td>type</td> |
|
| 1033 | + * <td>The data type used for this field</td> |
|
| 1034 | + * </tr> |
|
| 1035 | + * <tr valign="top"> |
|
| 1036 | + * <td>decimals</td> |
|
| 1037 | + * <td>The number of decimals used (for integer fields)</td> |
|
| 1038 | + * </tr> |
|
| 1039 | + * </table> |
|
| 1040 | + */ |
|
| 1041 | + #[TentativeType] |
|
| 1042 | + public function fetch_field(): object|false {} |
|
| 1043 | + |
|
| 1044 | + /** |
|
| 1045 | + * Returns an array of objects representing the fields in a result set |
|
| 1046 | + * @link https://php.net/manual/en/mysqli-result.fetch-fields.php |
|
| 1047 | + * @return array|false an array of objects which contains field definition information or |
|
| 1048 | + * false if no field information is available. |
|
| 1049 | + * </p> |
|
| 1050 | + * <p> |
|
| 1051 | + * <table> |
|
| 1052 | + * Object properties |
|
| 1053 | + * <tr valign="top"> |
|
| 1054 | + * <td>Property</td> |
|
| 1055 | + * <td>Description</td> |
|
| 1056 | + * </tr> |
|
| 1057 | + * <tr valign="top"> |
|
| 1058 | + * <td>name</td> |
|
| 1059 | + * <td>The name of the column</td> |
|
| 1060 | + * </tr> |
|
| 1061 | + * <tr valign="top"> |
|
| 1062 | + * <td>orgname</td> |
|
| 1063 | + * <td>Original column name if an alias was specified</td> |
|
| 1064 | + * </tr> |
|
| 1065 | + * <tr valign="top"> |
|
| 1066 | + * <td>table</td> |
|
| 1067 | + * <td>The name of the table this field belongs to (if not calculated)</td> |
|
| 1068 | + * </tr> |
|
| 1069 | + * <tr valign="top"> |
|
| 1070 | + * <td>orgtable</td> |
|
| 1071 | + * <td>Original table name if an alias was specified</td> |
|
| 1072 | + * </tr> |
|
| 1073 | + * <tr valign="top"> |
|
| 1074 | + * <td>def</td> |
|
| 1075 | + * <td>The default value for this field, represented as a string</td> |
|
| 1076 | + * </tr> |
|
| 1077 | + * <tr valign="top"> |
|
| 1078 | + * <td>max_length</td> |
|
| 1079 | + * <td>The maximum width of the field for the result set.</td> |
|
| 1080 | + * </tr> |
|
| 1081 | + * <tr valign="top"> |
|
| 1082 | + * <td>length</td> |
|
| 1083 | + * <td>The width of the field, as specified in the table definition.</td> |
|
| 1084 | + * </tr> |
|
| 1085 | + * <tr valign="top"> |
|
| 1086 | + * <td>charsetnr</td> |
|
| 1087 | + * <td>The character set number for the field.</td> |
|
| 1088 | + * </tr> |
|
| 1089 | + * <tr valign="top"> |
|
| 1090 | + * <td>flags</td> |
|
| 1091 | + * <td>An integer representing the bit-flags for the field.</td> |
|
| 1092 | + * </tr> |
|
| 1093 | + * <tr valign="top"> |
|
| 1094 | + * <td>type</td> |
|
| 1095 | + * <td>The data type used for this field</td> |
|
| 1096 | + * </tr> |
|
| 1097 | + * <tr valign="top"> |
|
| 1098 | + * <td>decimals</td> |
|
| 1099 | + * <td>The number of decimals used (for integer fields)</td> |
|
| 1100 | + * </tr> |
|
| 1101 | + * </table> |
|
| 1102 | + */ |
|
| 1103 | + #[TentativeType] |
|
| 1104 | + public function fetch_fields(): array {} |
|
| 1105 | + |
|
| 1106 | + /** |
|
| 1107 | + * Fetch meta-data for a single field |
|
| 1108 | + * @link https://php.net/manual/en/mysqli-result.fetch-field-direct.php |
|
| 1109 | + * @param int $index <p> |
|
| 1110 | + * The field number. This value must be in the range from |
|
| 1111 | + * 0 to number of fields - 1. |
|
| 1112 | + * </p> |
|
| 1113 | + * @return object|false an object which contains field definition information or false |
|
| 1114 | + * if no field information for specified fieldnr is |
|
| 1115 | + * available. |
|
| 1116 | + * </p> |
|
| 1117 | + * <p> |
|
| 1118 | + * <table> |
|
| 1119 | + * Object attributes |
|
| 1120 | + * <tr valign="top"> |
|
| 1121 | + * <td>Attribute</td> |
|
| 1122 | + * <td>Description</td> |
|
| 1123 | + * </tr> |
|
| 1124 | + * <tr valign="top"> |
|
| 1125 | + * <td>name</td> |
|
| 1126 | + * <td>The name of the column</td> |
|
| 1127 | + * </tr> |
|
| 1128 | + * <tr valign="top"> |
|
| 1129 | + * <td>orgname</td> |
|
| 1130 | + * <td>Original column name if an alias was specified</td> |
|
| 1131 | + * </tr> |
|
| 1132 | + * <tr valign="top"> |
|
| 1133 | + * <td>table</td> |
|
| 1134 | + * <td>The name of the table this field belongs to (if not calculated)</td> |
|
| 1135 | + * </tr> |
|
| 1136 | + * <tr valign="top"> |
|
| 1137 | + * <td>orgtable</td> |
|
| 1138 | + * <td>Original table name if an alias was specified</td> |
|
| 1139 | + * </tr> |
|
| 1140 | + * <tr valign="top"> |
|
| 1141 | + * <td>def</td> |
|
| 1142 | + * <td>The default value for this field, represented as a string</td> |
|
| 1143 | + * </tr> |
|
| 1144 | + * <tr valign="top"> |
|
| 1145 | + * <td>max_length</td> |
|
| 1146 | + * <td>The maximum width of the field for the result set.</td> |
|
| 1147 | + * </tr> |
|
| 1148 | + * <tr valign="top"> |
|
| 1149 | + * <td>length</td> |
|
| 1150 | + * <td>The width of the field, as specified in the table definition.</td> |
|
| 1151 | + * </tr> |
|
| 1152 | + * <tr valign="top"> |
|
| 1153 | + * <td>charsetnr</td> |
|
| 1154 | + * <td>The character set number for the field.</td> |
|
| 1155 | + * </tr> |
|
| 1156 | + * <tr valign="top"> |
|
| 1157 | + * <td>flags</td> |
|
| 1158 | + * <td>An integer representing the bit-flags for the field.</td> |
|
| 1159 | + * </tr> |
|
| 1160 | + * <tr valign="top"> |
|
| 1161 | + * <td>type</td> |
|
| 1162 | + * <td>The data type used for this field</td> |
|
| 1163 | + * </tr> |
|
| 1164 | + * <tr valign="top"> |
|
| 1165 | + * <td>decimals</td> |
|
| 1166 | + * <td>The number of decimals used (for integer fields)</td> |
|
| 1167 | + * </tr> |
|
| 1168 | + * </table> |
|
| 1169 | + */ |
|
| 1170 | + #[TentativeType] |
|
| 1171 | + public function fetch_field_direct(int $index): object|false {} |
|
| 1172 | + |
|
| 1173 | + /** |
|
| 1174 | + * Fetches all result rows as an associative array, a numeric array, or both |
|
| 1175 | + * @link https://php.net/manual/en/mysqli-result.fetch-all.php |
|
| 1176 | + * @param int $mode [optional] <p> |
|
| 1177 | + * This optional parameter is a constant indicating what type of array |
|
| 1178 | + * should be produced from the current row data. The possible values for |
|
| 1179 | + * this parameter are the constants MYSQLI_ASSOC, |
|
| 1180 | + * MYSQLI_NUM, or MYSQLI_BOTH. |
|
| 1181 | + * </p> |
|
| 1182 | + * @return mixed an array of associative or numeric arrays holding result rows. |
|
| 1183 | + */ |
|
| 1184 | + #[TentativeType] |
|
| 1185 | + public function fetch_all(int $mode = MYSQLI_NUM): array {} |
|
| 1186 | + |
|
| 1187 | + /** |
|
| 1188 | + * Fetch a result row as an associative, a numeric array, or both |
|
| 1189 | + * @link https://php.net/manual/en/mysqli-result.fetch-array.php |
|
| 1190 | + * @param int $mode [optional] <p> |
|
| 1191 | + * This optional parameter is a constant indicating what type of array |
|
| 1192 | + * should be produced from the current row data. The possible values for |
|
| 1193 | + * this parameter are the constants <b>MYSQLI_ASSOC</b>, |
|
| 1194 | + * <b>MYSQLI_NUM</b>, or <b>MYSQLI_BOTH</b>. |
|
| 1195 | + * </p> |
|
| 1196 | + * <p> |
|
| 1197 | + * By using the <b>MYSQLI_ASSOC</b> constant this function |
|
| 1198 | + * will behave identically to the <b>mysqli_fetch_assoc</b>, |
|
| 1199 | + * while <b>MYSQLI_NUM</b> will behave identically to the |
|
| 1200 | + * <b>mysqli_fetch_row</b> function. The final option |
|
| 1201 | + * <b>MYSQLI_BOTH</b> will create a single array with the |
|
| 1202 | + * attributes of both. |
|
| 1203 | + * </p> |
|
| 1204 | + * @return mixed an array of strings that corresponds to the fetched row or null if there |
|
| 1205 | + * are no more rows in resultset. |
|
| 1206 | + */ |
|
| 1207 | + #[TentativeType] |
|
| 1208 | + public function fetch_array(int $mode = MYSQLI_BOTH): array|false|null {} |
|
| 1209 | + |
|
| 1210 | + /** |
|
| 1211 | + * Fetch a result row as an associative array |
|
| 1212 | + * @link https://php.net/manual/en/mysqli-result.fetch-assoc.php |
|
| 1213 | + * @return array|null an associative array of strings representing the fetched row in the result |
|
| 1214 | + * set, where each key in the array represents the name of one of the result |
|
| 1215 | + * set's columns or null if there are no more rows in resultset. |
|
| 1216 | + * </p> |
|
| 1217 | + * <p> |
|
| 1218 | + * If two or more columns of the result have the same field names, the last |
|
| 1219 | + * column will take precedence. To access the other column(s) of the same |
|
| 1220 | + * name, you either need to access the result with numeric indices by using |
|
| 1221 | + * <b>mysqli_fetch_row</b> or add alias names. |
|
| 1222 | + */ |
|
| 1223 | + #[TentativeType] |
|
| 1224 | + public function fetch_assoc(): array|false|null {} |
|
| 1225 | + |
|
| 1226 | + /** |
|
| 1227 | + * Returns the current row of a result set as an object |
|
| 1228 | + * @link https://php.net/manual/en/mysqli-result.fetch-object.php |
|
| 1229 | + * @param string $class [optional] <p> |
|
| 1230 | + * The name of the class to instantiate, set the properties of and return. |
|
| 1231 | + * If not specified, a <b>stdClass</b> object is returned. |
|
| 1232 | + * </p> |
|
| 1233 | + * @param null|array $constructor_args [optional] <p> |
|
| 1234 | + * An optional array of parameters to pass to the constructor |
|
| 1235 | + * for <i>class_name</i> objects. |
|
| 1236 | + * </p> |
|
| 1237 | + * @return stdClass|object an object with string properties that corresponds to the fetched |
|
| 1238 | + * row or null if there are no more rows in resultset. |
|
| 1239 | + */ |
|
| 1240 | + #[TentativeType] |
|
| 1241 | + public function fetch_object(string $class = 'stdClass', array $constructor_args = null): object|false|null {} |
|
| 1242 | + |
|
| 1243 | + /** |
|
| 1244 | + * Get a result row as an enumerated array |
|
| 1245 | + * @link https://php.net/manual/en/mysqli-result.fetch-row.php |
|
| 1246 | + * @return array|false|null mysqli_fetch_row returns an array of strings that corresponds to the fetched row |
|
| 1247 | + * or null if there are no more rows in result set. |
|
| 1248 | + */ |
|
| 1249 | + #[TentativeType] |
|
| 1250 | + public function fetch_row(): array|false|null {} |
|
| 1251 | + |
|
| 1252 | + #[PhpStormStubsElementAvailable('8.1')] |
|
| 1253 | + public function fetch_column(int $column = null): string|int|float|false|null {} |
|
| 1254 | + |
|
| 1255 | + /** |
|
| 1256 | + * Set result pointer to a specified field offset |
|
| 1257 | + * @link https://php.net/manual/en/mysqli-result.field-seek.php |
|
| 1258 | + * @param int $index <p> |
|
| 1259 | + * The field number. This value must be in the range from |
|
| 1260 | + * 0 to number of fields - 1. |
|
| 1261 | + * </p> |
|
| 1262 | + * @return bool true on success or false on failure. |
|
| 1263 | + */ |
|
| 1264 | + #[TentativeType] |
|
| 1265 | + public function field_seek(int $index): bool {} |
|
| 1266 | + |
|
| 1267 | + /** |
|
| 1268 | + * Frees the memory associated with a result |
|
| 1269 | + * @return void |
|
| 1270 | + * @link https://php.net/manual/en/mysqli-result.free.php |
|
| 1271 | + */ |
|
| 1272 | + #[TentativeType] |
|
| 1273 | + public function free_result(): void {} |
|
| 1274 | + |
|
| 1275 | + /** |
|
| 1276 | + * @return Iterator |
|
| 1277 | + * @since 8.0 |
|
| 1278 | + */ |
|
| 1279 | + public function getIterator(): Iterator {} |
|
| 1280 | 1280 | } |
| 1281 | 1281 | |
| 1282 | 1282 | /** |
@@ -1285,341 +1285,341 @@ discard block |
||
| 1285 | 1285 | */ |
| 1286 | 1286 | class mysqli_stmt |
| 1287 | 1287 | { |
| 1288 | - /** |
|
| 1289 | - * @var int |
|
| 1290 | - */ |
|
| 1291 | - #[LanguageLevelTypeAware(['8.1' => 'int|string'], default: '')] |
|
| 1292 | - public $affected_rows; |
|
| 1293 | - /** |
|
| 1294 | - * @var int |
|
| 1295 | - */ |
|
| 1296 | - #[LanguageLevelTypeAware(['8.1' => 'int|string'], default: '')] |
|
| 1297 | - public $insert_id; |
|
| 1298 | - /** |
|
| 1299 | - * @var int |
|
| 1300 | - */ |
|
| 1301 | - #[LanguageLevelTypeAware(['8.1' => 'int|string'], default: '')] |
|
| 1302 | - public $num_rows; |
|
| 1303 | - /** |
|
| 1304 | - * @var int |
|
| 1305 | - */ |
|
| 1306 | - #[LanguageLevelTypeAware(['8.1' => 'int'], default: '')] |
|
| 1307 | - public $param_count; |
|
| 1308 | - /** |
|
| 1309 | - * @var int |
|
| 1310 | - */ |
|
| 1311 | - #[LanguageLevelTypeAware(['8.1' => 'int'], default: '')] |
|
| 1312 | - public $field_count; |
|
| 1313 | - /** |
|
| 1314 | - * @var int |
|
| 1315 | - */ |
|
| 1316 | - #[LanguageLevelTypeAware(['8.1' => 'int'], default: '')] |
|
| 1317 | - public $errno; |
|
| 1318 | - /** |
|
| 1319 | - * @var string |
|
| 1320 | - */ |
|
| 1321 | - #[LanguageLevelTypeAware(['8.1' => 'string'], default: '')] |
|
| 1322 | - public $error; |
|
| 1323 | - /** |
|
| 1324 | - * @var array |
|
| 1325 | - */ |
|
| 1326 | - #[LanguageLevelTypeAware(['8.1' => 'array'], default: '')] |
|
| 1327 | - public $error_list; |
|
| 1328 | - /** |
|
| 1329 | - * @var string |
|
| 1330 | - */ |
|
| 1331 | - #[LanguageLevelTypeAware(['8.1' => 'string'], default: '')] |
|
| 1332 | - public $sqlstate; |
|
| 1333 | - /** |
|
| 1334 | - * @var string |
|
| 1335 | - */ |
|
| 1336 | - #[LanguageLevelTypeAware(['8.1' => 'int'], default: '')] |
|
| 1337 | - public $id; |
|
| 1338 | - |
|
| 1339 | - /** |
|
| 1340 | - * mysqli_stmt constructor |
|
| 1341 | - * @param mysqli $mysql |
|
| 1342 | - * @param string $query [optional] |
|
| 1343 | - */ |
|
| 1344 | - public function __construct($mysql, $query) {} |
|
| 1345 | - |
|
| 1346 | - /** |
|
| 1347 | - * Used to get the current value of a statement attribute |
|
| 1348 | - * @link https://php.net/manual/en/mysqli-stmt.attr-get.php |
|
| 1349 | - * @param int $attribute <p> |
|
| 1350 | - * The attribute that you want to get. |
|
| 1351 | - * </p> |
|
| 1352 | - * @return int|false false if the attribute is not found, otherwise returns the value of the attribute. |
|
| 1353 | - */ |
|
| 1354 | - #[TentativeType] |
|
| 1355 | - public function attr_get(int $attribute): int {} |
|
| 1356 | - |
|
| 1357 | - /** |
|
| 1358 | - * Used to modify the behavior of a prepared statement |
|
| 1359 | - * @link https://php.net/manual/en/mysqli-stmt.attr-set.php |
|
| 1360 | - * @param int $attribute <p> |
|
| 1361 | - * The attribute that you want to set. It can have one of the following values: |
|
| 1362 | - * <table> |
|
| 1363 | - * Attribute values |
|
| 1364 | - * <tr valign="top"> |
|
| 1365 | - * <td>Character</td> |
|
| 1366 | - * <td>Description</td> |
|
| 1367 | - * </tr> |
|
| 1368 | - * <tr valign="top"> |
|
| 1369 | - * <td>MYSQLI_STMT_ATTR_UPDATE_MAX_LENGTH</td> |
|
| 1370 | - * <td> |
|
| 1371 | - * If set to 1, causes <b>mysqli_stmt_store_result</b> to |
|
| 1372 | - * update the metadata MYSQL_FIELD->max_length value. |
|
| 1373 | - * </td> |
|
| 1374 | - * </tr> |
|
| 1375 | - * <tr valign="top"> |
|
| 1376 | - * <td>MYSQLI_STMT_ATTR_CURSOR_TYPE</td> |
|
| 1377 | - * <td> |
|
| 1378 | - * Type of cursor to open for statement when <b>mysqli_stmt_execute</b> |
|
| 1379 | - * is invoked. <i>mode</i> can be MYSQLI_CURSOR_TYPE_NO_CURSOR |
|
| 1380 | - * (the default) or MYSQLI_CURSOR_TYPE_READ_ONLY. |
|
| 1381 | - * </td> |
|
| 1382 | - * </tr> |
|
| 1383 | - * <tr valign="top"> |
|
| 1384 | - * <td>MYSQLI_STMT_ATTR_PREFETCH_ROWS</td> |
|
| 1385 | - * <td> |
|
| 1386 | - * Number of rows to fetch from server at a time when using a cursor. |
|
| 1387 | - * <i>mode</i> can be in the range from 1 to the maximum |
|
| 1388 | - * value of unsigned long. The default is 1. |
|
| 1389 | - * </td> |
|
| 1390 | - * </tr> |
|
| 1391 | - * </table> |
|
| 1392 | - * </p> |
|
| 1393 | - * <p> |
|
| 1394 | - * If you use the MYSQLI_STMT_ATTR_CURSOR_TYPE option with |
|
| 1395 | - * MYSQLI_CURSOR_TYPE_READ_ONLY, a cursor is opened for the |
|
| 1396 | - * statement when you invoke <b>mysqli_stmt_execute</b>. If there |
|
| 1397 | - * is already an open cursor from a previous <b>mysqli_stmt_execute</b> call, |
|
| 1398 | - * it closes the cursor before opening a new one. <b>mysqli_stmt_reset</b> |
|
| 1399 | - * also closes any open cursor before preparing the statement for re-execution. |
|
| 1400 | - * <b>mysqli_stmt_free_result</b> closes any open cursor. |
|
| 1401 | - * </p> |
|
| 1402 | - * <p> |
|
| 1403 | - * If you open a cursor for a prepared statement, <b>mysqli_stmt_store_result</b> |
|
| 1404 | - * is unnecessary. |
|
| 1405 | - * </p> |
|
| 1406 | - * @param int $value <p>The value to assign to the attribute.</p> |
|
| 1407 | - * @return bool |
|
| 1408 | - */ |
|
| 1409 | - #[TentativeType] |
|
| 1410 | - public function attr_set(int $attribute, int $value): bool {} |
|
| 1411 | - |
|
| 1412 | - /** |
|
| 1413 | - * Binds variables to a prepared statement as parameters |
|
| 1414 | - * @link https://php.net/manual/en/mysqli-stmt.bind-param.php |
|
| 1415 | - * @param string $types <p> |
|
| 1416 | - * A string that contains one or more characters which specify the types |
|
| 1417 | - * for the corresponding bind variables: |
|
| 1418 | - * <table> |
|
| 1419 | - * Type specification chars |
|
| 1420 | - * <tr valign="top"> |
|
| 1421 | - * <td>Character</td> |
|
| 1422 | - * <td>Description</td> |
|
| 1423 | - * </tr> |
|
| 1424 | - * <tr valign="top"> |
|
| 1425 | - * <td>i</td> |
|
| 1426 | - * <td>corresponding variable has type integer</td> |
|
| 1427 | - * </tr> |
|
| 1428 | - * <tr valign="top"> |
|
| 1429 | - * <td>d</td> |
|
| 1430 | - * <td>corresponding variable has type double</td> |
|
| 1431 | - * </tr> |
|
| 1432 | - * <tr valign="top"> |
|
| 1433 | - * <td>s</td> |
|
| 1434 | - * <td>corresponding variable has type string</td> |
|
| 1435 | - * </tr> |
|
| 1436 | - * <tr valign="top"> |
|
| 1437 | - * <td>b</td> |
|
| 1438 | - * <td>corresponding variable is a blob and will be sent in packets</td> |
|
| 1439 | - * </tr> |
|
| 1440 | - * </table> |
|
| 1441 | - * </p> |
|
| 1442 | - * @param mixed &$var1 <p> |
|
| 1443 | - * The number of variables and length of string |
|
| 1444 | - * types must match the parameters in the statement. |
|
| 1445 | - * </p> |
|
| 1446 | - * @param mixed &...$_ [optional] |
|
| 1447 | - * @return bool true on success or false on failure. |
|
| 1448 | - */ |
|
| 1449 | - public function bind_param($types, &$var1, &...$_) {} |
|
| 1450 | - |
|
| 1451 | - /** |
|
| 1452 | - * Binds variables to a prepared statement for result storage |
|
| 1453 | - * @link https://php.net/manual/en/mysqli-stmt.bind-result.php |
|
| 1454 | - * @param mixed &$var1 The variable to be bound. |
|
| 1455 | - * @param mixed &...$_ The variables to be bound. |
|
| 1456 | - * @return bool true on success or false on failure. |
|
| 1457 | - */ |
|
| 1458 | - public function bind_result(&$var1, &...$_) {} |
|
| 1459 | - |
|
| 1460 | - /** |
|
| 1461 | - * Closes a prepared statement |
|
| 1462 | - * @link https://php.net/manual/en/mysqli-stmt.close.php |
|
| 1463 | - * @return bool true on success or false on failure. |
|
| 1464 | - */ |
|
| 1465 | - public function close() {} |
|
| 1466 | - |
|
| 1467 | - /** |
|
| 1468 | - * Seeks to an arbitrary row in statement result set |
|
| 1469 | - * @link https://php.net/manual/en/mysqli-stmt.data-seek.php |
|
| 1470 | - * @param int $offset <p> |
|
| 1471 | - * Must be between zero and the total number of rows minus one (0.. |
|
| 1472 | - * <b>mysqli_stmt_num_rows</b> - 1). |
|
| 1473 | - * </p> |
|
| 1474 | - * @return void |
|
| 1475 | - */ |
|
| 1476 | - #[TentativeType] |
|
| 1477 | - public function data_seek(int $offset): void {} |
|
| 1478 | - |
|
| 1479 | - /** |
|
| 1480 | - * Executes a prepared Query |
|
| 1481 | - * @link https://php.net/manual/en/mysqli-stmt.execute.php |
|
| 1482 | - * @return bool true on success or false on failure. |
|
| 1483 | - */ |
|
| 1484 | - #[TentativeType] |
|
| 1485 | - public function execute(#[PhpStormStubsElementAvailable('8.1')] ?array $params = null): bool {} |
|
| 1486 | - |
|
| 1487 | - /** |
|
| 1488 | - * Fetch results from a prepared statement into the bound variables |
|
| 1489 | - * @link https://php.net/manual/en/mysqli-stmt.fetch.php |
|
| 1490 | - * @return bool|null |
|
| 1491 | - */ |
|
| 1492 | - #[TentativeType] |
|
| 1493 | - public function fetch(): ?bool {} |
|
| 1494 | - |
|
| 1495 | - /** |
|
| 1496 | - * Get result of SHOW WARNINGS |
|
| 1497 | - * @link https://php.net/manual/en/mysqli-stmt.get-warnings.php |
|
| 1498 | - * @return object|false |
|
| 1499 | - */ |
|
| 1500 | - #[TentativeType] |
|
| 1501 | - public function get_warnings(): mysqli_warning|false {} |
|
| 1502 | - |
|
| 1503 | - /** |
|
| 1504 | - * Returns result set metadata from a prepared statement |
|
| 1505 | - * @link https://php.net/manual/en/mysqli-stmt.result-metadata.php |
|
| 1506 | - * @return mysqli_result|false a result object or false if an error occurred. |
|
| 1507 | - */ |
|
| 1508 | - #[TentativeType] |
|
| 1509 | - public function result_metadata(): mysqli_result|false {} |
|
| 1510 | - |
|
| 1511 | - /** |
|
| 1512 | - * Check if there are more query results from a multiple query |
|
| 1513 | - * @link https://php.net/manual/en/mysqli-stmt.more-results.php |
|
| 1514 | - * @return bool |
|
| 1515 | - */ |
|
| 1516 | - #[TentativeType] |
|
| 1517 | - public function more_results(): bool {} |
|
| 1518 | - |
|
| 1519 | - /** |
|
| 1520 | - * Reads the next result from a multiple query |
|
| 1521 | - * @link https://php.net/manual/en/mysqli-stmt.next-result.php |
|
| 1522 | - * @return bool |
|
| 1523 | - */ |
|
| 1524 | - #[TentativeType] |
|
| 1525 | - public function next_result(): bool {} |
|
| 1526 | - |
|
| 1527 | - /** |
|
| 1528 | - * Return the number of rows in statements result set |
|
| 1529 | - * @link https://php.net/manual/en/mysqli-stmt.num-rows.php |
|
| 1530 | - * @return string|int An integer representing the number of rows in result set. |
|
| 1531 | - */ |
|
| 1532 | - #[TentativeType] |
|
| 1533 | - public function num_rows(): string|int {} |
|
| 1534 | - |
|
| 1535 | - /** |
|
| 1536 | - * Send data in blocks |
|
| 1537 | - * @link https://php.net/manual/en/mysqli-stmt.send-long-data.php |
|
| 1538 | - * @param int $param_num <p> |
|
| 1539 | - * Indicates which parameter to associate the data with. Parameters are |
|
| 1540 | - * numbered beginning with 0. |
|
| 1541 | - * </p> |
|
| 1542 | - * @param string $data <p> |
|
| 1543 | - * A string containing data to be sent. |
|
| 1544 | - * </p> |
|
| 1545 | - * @return bool true on success or false on failure. |
|
| 1546 | - */ |
|
| 1547 | - #[TentativeType] |
|
| 1548 | - public function send_long_data(int $param_num, string $data): bool {} |
|
| 1549 | - |
|
| 1550 | - /** |
|
| 1551 | - * No documentation available |
|
| 1552 | - * @removed 5.4 |
|
| 1553 | - */ |
|
| 1554 | - #[Deprecated(since: '5.3')] |
|
| 1555 | - public function stmt() {} |
|
| 1556 | - |
|
| 1557 | - /** |
|
| 1558 | - * Frees stored result memory for the given statement handle |
|
| 1559 | - * @link https://php.net/manual/en/mysqli-stmt.free-result.php |
|
| 1560 | - * @return void |
|
| 1561 | - */ |
|
| 1562 | - #[TentativeType] |
|
| 1563 | - public function free_result(): void {} |
|
| 1564 | - |
|
| 1565 | - /** |
|
| 1566 | - * Resets a prepared statement |
|
| 1567 | - * @link https://php.net/manual/en/mysqli-stmt.reset.php |
|
| 1568 | - * @return bool true on success or false on failure. |
|
| 1569 | - */ |
|
| 1570 | - #[TentativeType] |
|
| 1571 | - public function reset(): bool {} |
|
| 1572 | - |
|
| 1573 | - /** |
|
| 1574 | - * Prepare an SQL statement for execution |
|
| 1575 | - * @link https://php.net/manual/en/mysqli-stmt.prepare.php |
|
| 1576 | - * @param string $query <p> |
|
| 1577 | - * The query, as a string. It must consist of a single SQL statement. |
|
| 1578 | - * </p> |
|
| 1579 | - * <p> |
|
| 1580 | - * You can include one or more parameter markers in the SQL statement by |
|
| 1581 | - * embedding question mark (?) characters at the |
|
| 1582 | - * appropriate positions. |
|
| 1583 | - * </p> |
|
| 1584 | - * <p> |
|
| 1585 | - * You should not add a terminating semicolon or \g |
|
| 1586 | - * to the statement. |
|
| 1587 | - * </p> |
|
| 1588 | - * <p> |
|
| 1589 | - * The markers are legal only in certain places in SQL statements. |
|
| 1590 | - * For example, they are allowed in the VALUES() list of an INSERT statement |
|
| 1591 | - * (to specify column values for a row), or in a comparison with a column in |
|
| 1592 | - * a WHERE clause to specify a comparison value. |
|
| 1593 | - * </p> |
|
| 1594 | - * <p> |
|
| 1595 | - * However, they are not allowed for identifiers (such as table or column names), |
|
| 1596 | - * in the select list that names the columns to be returned by a SELECT statement), |
|
| 1597 | - * or to specify both operands of a binary operator such as the = |
|
| 1598 | - * equal sign. The latter restriction is necessary because it would be impossible |
|
| 1599 | - * to determine the parameter type. In general, parameters are legal only in Data |
|
| 1600 | - * Manipulation Language (DML) statements, and not in Data Definition Language |
|
| 1601 | - * (DDL) statements. |
|
| 1602 | - * </p> |
|
| 1603 | - * @return bool true on success or false on failure. |
|
| 1604 | - */ |
|
| 1605 | - #[TentativeType] |
|
| 1606 | - public function prepare(string $query): bool {} |
|
| 1607 | - |
|
| 1608 | - /** |
|
| 1609 | - * Transfers a result set from a prepared statement |
|
| 1610 | - * @link https://php.net/manual/en/mysqli-stmt.store-result.php |
|
| 1611 | - * @return bool true on success or false on failure. |
|
| 1612 | - */ |
|
| 1613 | - #[TentativeType] |
|
| 1614 | - public function store_result(): bool {} |
|
| 1615 | - |
|
| 1616 | - /** |
|
| 1617 | - * Gets a result set from a prepared statement |
|
| 1618 | - * @link https://php.net/manual/en/mysqli-stmt.get-result.php |
|
| 1619 | - * @return mysqli_result|false Returns a resultset or FALSE on failure |
|
| 1620 | - */ |
|
| 1621 | - #[TentativeType] |
|
| 1622 | - public function get_result(): mysqli_result|false {} |
|
| 1288 | + /** |
|
| 1289 | + * @var int |
|
| 1290 | + */ |
|
| 1291 | + #[LanguageLevelTypeAware(['8.1' => 'int|string'], default: '')] |
|
| 1292 | + public $affected_rows; |
|
| 1293 | + /** |
|
| 1294 | + * @var int |
|
| 1295 | + */ |
|
| 1296 | + #[LanguageLevelTypeAware(['8.1' => 'int|string'], default: '')] |
|
| 1297 | + public $insert_id; |
|
| 1298 | + /** |
|
| 1299 | + * @var int |
|
| 1300 | + */ |
|
| 1301 | + #[LanguageLevelTypeAware(['8.1' => 'int|string'], default: '')] |
|
| 1302 | + public $num_rows; |
|
| 1303 | + /** |
|
| 1304 | + * @var int |
|
| 1305 | + */ |
|
| 1306 | + #[LanguageLevelTypeAware(['8.1' => 'int'], default: '')] |
|
| 1307 | + public $param_count; |
|
| 1308 | + /** |
|
| 1309 | + * @var int |
|
| 1310 | + */ |
|
| 1311 | + #[LanguageLevelTypeAware(['8.1' => 'int'], default: '')] |
|
| 1312 | + public $field_count; |
|
| 1313 | + /** |
|
| 1314 | + * @var int |
|
| 1315 | + */ |
|
| 1316 | + #[LanguageLevelTypeAware(['8.1' => 'int'], default: '')] |
|
| 1317 | + public $errno; |
|
| 1318 | + /** |
|
| 1319 | + * @var string |
|
| 1320 | + */ |
|
| 1321 | + #[LanguageLevelTypeAware(['8.1' => 'string'], default: '')] |
|
| 1322 | + public $error; |
|
| 1323 | + /** |
|
| 1324 | + * @var array |
|
| 1325 | + */ |
|
| 1326 | + #[LanguageLevelTypeAware(['8.1' => 'array'], default: '')] |
|
| 1327 | + public $error_list; |
|
| 1328 | + /** |
|
| 1329 | + * @var string |
|
| 1330 | + */ |
|
| 1331 | + #[LanguageLevelTypeAware(['8.1' => 'string'], default: '')] |
|
| 1332 | + public $sqlstate; |
|
| 1333 | + /** |
|
| 1334 | + * @var string |
|
| 1335 | + */ |
|
| 1336 | + #[LanguageLevelTypeAware(['8.1' => 'int'], default: '')] |
|
| 1337 | + public $id; |
|
| 1338 | + |
|
| 1339 | + /** |
|
| 1340 | + * mysqli_stmt constructor |
|
| 1341 | + * @param mysqli $mysql |
|
| 1342 | + * @param string $query [optional] |
|
| 1343 | + */ |
|
| 1344 | + public function __construct($mysql, $query) {} |
|
| 1345 | + |
|
| 1346 | + /** |
|
| 1347 | + * Used to get the current value of a statement attribute |
|
| 1348 | + * @link https://php.net/manual/en/mysqli-stmt.attr-get.php |
|
| 1349 | + * @param int $attribute <p> |
|
| 1350 | + * The attribute that you want to get. |
|
| 1351 | + * </p> |
|
| 1352 | + * @return int|false false if the attribute is not found, otherwise returns the value of the attribute. |
|
| 1353 | + */ |
|
| 1354 | + #[TentativeType] |
|
| 1355 | + public function attr_get(int $attribute): int {} |
|
| 1356 | + |
|
| 1357 | + /** |
|
| 1358 | + * Used to modify the behavior of a prepared statement |
|
| 1359 | + * @link https://php.net/manual/en/mysqli-stmt.attr-set.php |
|
| 1360 | + * @param int $attribute <p> |
|
| 1361 | + * The attribute that you want to set. It can have one of the following values: |
|
| 1362 | + * <table> |
|
| 1363 | + * Attribute values |
|
| 1364 | + * <tr valign="top"> |
|
| 1365 | + * <td>Character</td> |
|
| 1366 | + * <td>Description</td> |
|
| 1367 | + * </tr> |
|
| 1368 | + * <tr valign="top"> |
|
| 1369 | + * <td>MYSQLI_STMT_ATTR_UPDATE_MAX_LENGTH</td> |
|
| 1370 | + * <td> |
|
| 1371 | + * If set to 1, causes <b>mysqli_stmt_store_result</b> to |
|
| 1372 | + * update the metadata MYSQL_FIELD->max_length value. |
|
| 1373 | + * </td> |
|
| 1374 | + * </tr> |
|
| 1375 | + * <tr valign="top"> |
|
| 1376 | + * <td>MYSQLI_STMT_ATTR_CURSOR_TYPE</td> |
|
| 1377 | + * <td> |
|
| 1378 | + * Type of cursor to open for statement when <b>mysqli_stmt_execute</b> |
|
| 1379 | + * is invoked. <i>mode</i> can be MYSQLI_CURSOR_TYPE_NO_CURSOR |
|
| 1380 | + * (the default) or MYSQLI_CURSOR_TYPE_READ_ONLY. |
|
| 1381 | + * </td> |
|
| 1382 | + * </tr> |
|
| 1383 | + * <tr valign="top"> |
|
| 1384 | + * <td>MYSQLI_STMT_ATTR_PREFETCH_ROWS</td> |
|
| 1385 | + * <td> |
|
| 1386 | + * Number of rows to fetch from server at a time when using a cursor. |
|
| 1387 | + * <i>mode</i> can be in the range from 1 to the maximum |
|
| 1388 | + * value of unsigned long. The default is 1. |
|
| 1389 | + * </td> |
|
| 1390 | + * </tr> |
|
| 1391 | + * </table> |
|
| 1392 | + * </p> |
|
| 1393 | + * <p> |
|
| 1394 | + * If you use the MYSQLI_STMT_ATTR_CURSOR_TYPE option with |
|
| 1395 | + * MYSQLI_CURSOR_TYPE_READ_ONLY, a cursor is opened for the |
|
| 1396 | + * statement when you invoke <b>mysqli_stmt_execute</b>. If there |
|
| 1397 | + * is already an open cursor from a previous <b>mysqli_stmt_execute</b> call, |
|
| 1398 | + * it closes the cursor before opening a new one. <b>mysqli_stmt_reset</b> |
|
| 1399 | + * also closes any open cursor before preparing the statement for re-execution. |
|
| 1400 | + * <b>mysqli_stmt_free_result</b> closes any open cursor. |
|
| 1401 | + * </p> |
|
| 1402 | + * <p> |
|
| 1403 | + * If you open a cursor for a prepared statement, <b>mysqli_stmt_store_result</b> |
|
| 1404 | + * is unnecessary. |
|
| 1405 | + * </p> |
|
| 1406 | + * @param int $value <p>The value to assign to the attribute.</p> |
|
| 1407 | + * @return bool |
|
| 1408 | + */ |
|
| 1409 | + #[TentativeType] |
|
| 1410 | + public function attr_set(int $attribute, int $value): bool {} |
|
| 1411 | + |
|
| 1412 | + /** |
|
| 1413 | + * Binds variables to a prepared statement as parameters |
|
| 1414 | + * @link https://php.net/manual/en/mysqli-stmt.bind-param.php |
|
| 1415 | + * @param string $types <p> |
|
| 1416 | + * A string that contains one or more characters which specify the types |
|
| 1417 | + * for the corresponding bind variables: |
|
| 1418 | + * <table> |
|
| 1419 | + * Type specification chars |
|
| 1420 | + * <tr valign="top"> |
|
| 1421 | + * <td>Character</td> |
|
| 1422 | + * <td>Description</td> |
|
| 1423 | + * </tr> |
|
| 1424 | + * <tr valign="top"> |
|
| 1425 | + * <td>i</td> |
|
| 1426 | + * <td>corresponding variable has type integer</td> |
|
| 1427 | + * </tr> |
|
| 1428 | + * <tr valign="top"> |
|
| 1429 | + * <td>d</td> |
|
| 1430 | + * <td>corresponding variable has type double</td> |
|
| 1431 | + * </tr> |
|
| 1432 | + * <tr valign="top"> |
|
| 1433 | + * <td>s</td> |
|
| 1434 | + * <td>corresponding variable has type string</td> |
|
| 1435 | + * </tr> |
|
| 1436 | + * <tr valign="top"> |
|
| 1437 | + * <td>b</td> |
|
| 1438 | + * <td>corresponding variable is a blob and will be sent in packets</td> |
|
| 1439 | + * </tr> |
|
| 1440 | + * </table> |
|
| 1441 | + * </p> |
|
| 1442 | + * @param mixed &$var1 <p> |
|
| 1443 | + * The number of variables and length of string |
|
| 1444 | + * types must match the parameters in the statement. |
|
| 1445 | + * </p> |
|
| 1446 | + * @param mixed &...$_ [optional] |
|
| 1447 | + * @return bool true on success or false on failure. |
|
| 1448 | + */ |
|
| 1449 | + public function bind_param($types, &$var1, &...$_) {} |
|
| 1450 | + |
|
| 1451 | + /** |
|
| 1452 | + * Binds variables to a prepared statement for result storage |
|
| 1453 | + * @link https://php.net/manual/en/mysqli-stmt.bind-result.php |
|
| 1454 | + * @param mixed &$var1 The variable to be bound. |
|
| 1455 | + * @param mixed &...$_ The variables to be bound. |
|
| 1456 | + * @return bool true on success or false on failure. |
|
| 1457 | + */ |
|
| 1458 | + public function bind_result(&$var1, &...$_) {} |
|
| 1459 | + |
|
| 1460 | + /** |
|
| 1461 | + * Closes a prepared statement |
|
| 1462 | + * @link https://php.net/manual/en/mysqli-stmt.close.php |
|
| 1463 | + * @return bool true on success or false on failure. |
|
| 1464 | + */ |
|
| 1465 | + public function close() {} |
|
| 1466 | + |
|
| 1467 | + /** |
|
| 1468 | + * Seeks to an arbitrary row in statement result set |
|
| 1469 | + * @link https://php.net/manual/en/mysqli-stmt.data-seek.php |
|
| 1470 | + * @param int $offset <p> |
|
| 1471 | + * Must be between zero and the total number of rows minus one (0.. |
|
| 1472 | + * <b>mysqli_stmt_num_rows</b> - 1). |
|
| 1473 | + * </p> |
|
| 1474 | + * @return void |
|
| 1475 | + */ |
|
| 1476 | + #[TentativeType] |
|
| 1477 | + public function data_seek(int $offset): void {} |
|
| 1478 | + |
|
| 1479 | + /** |
|
| 1480 | + * Executes a prepared Query |
|
| 1481 | + * @link https://php.net/manual/en/mysqli-stmt.execute.php |
|
| 1482 | + * @return bool true on success or false on failure. |
|
| 1483 | + */ |
|
| 1484 | + #[TentativeType] |
|
| 1485 | + public function execute(#[PhpStormStubsElementAvailable('8.1')] ?array $params = null): bool {} |
|
| 1486 | + |
|
| 1487 | + /** |
|
| 1488 | + * Fetch results from a prepared statement into the bound variables |
|
| 1489 | + * @link https://php.net/manual/en/mysqli-stmt.fetch.php |
|
| 1490 | + * @return bool|null |
|
| 1491 | + */ |
|
| 1492 | + #[TentativeType] |
|
| 1493 | + public function fetch(): ?bool {} |
|
| 1494 | + |
|
| 1495 | + /** |
|
| 1496 | + * Get result of SHOW WARNINGS |
|
| 1497 | + * @link https://php.net/manual/en/mysqli-stmt.get-warnings.php |
|
| 1498 | + * @return object|false |
|
| 1499 | + */ |
|
| 1500 | + #[TentativeType] |
|
| 1501 | + public function get_warnings(): mysqli_warning|false {} |
|
| 1502 | + |
|
| 1503 | + /** |
|
| 1504 | + * Returns result set metadata from a prepared statement |
|
| 1505 | + * @link https://php.net/manual/en/mysqli-stmt.result-metadata.php |
|
| 1506 | + * @return mysqli_result|false a result object or false if an error occurred. |
|
| 1507 | + */ |
|
| 1508 | + #[TentativeType] |
|
| 1509 | + public function result_metadata(): mysqli_result|false {} |
|
| 1510 | + |
|
| 1511 | + /** |
|
| 1512 | + * Check if there are more query results from a multiple query |
|
| 1513 | + * @link https://php.net/manual/en/mysqli-stmt.more-results.php |
|
| 1514 | + * @return bool |
|
| 1515 | + */ |
|
| 1516 | + #[TentativeType] |
|
| 1517 | + public function more_results(): bool {} |
|
| 1518 | + |
|
| 1519 | + /** |
|
| 1520 | + * Reads the next result from a multiple query |
|
| 1521 | + * @link https://php.net/manual/en/mysqli-stmt.next-result.php |
|
| 1522 | + * @return bool |
|
| 1523 | + */ |
|
| 1524 | + #[TentativeType] |
|
| 1525 | + public function next_result(): bool {} |
|
| 1526 | + |
|
| 1527 | + /** |
|
| 1528 | + * Return the number of rows in statements result set |
|
| 1529 | + * @link https://php.net/manual/en/mysqli-stmt.num-rows.php |
|
| 1530 | + * @return string|int An integer representing the number of rows in result set. |
|
| 1531 | + */ |
|
| 1532 | + #[TentativeType] |
|
| 1533 | + public function num_rows(): string|int {} |
|
| 1534 | + |
|
| 1535 | + /** |
|
| 1536 | + * Send data in blocks |
|
| 1537 | + * @link https://php.net/manual/en/mysqli-stmt.send-long-data.php |
|
| 1538 | + * @param int $param_num <p> |
|
| 1539 | + * Indicates which parameter to associate the data with. Parameters are |
|
| 1540 | + * numbered beginning with 0. |
|
| 1541 | + * </p> |
|
| 1542 | + * @param string $data <p> |
|
| 1543 | + * A string containing data to be sent. |
|
| 1544 | + * </p> |
|
| 1545 | + * @return bool true on success or false on failure. |
|
| 1546 | + */ |
|
| 1547 | + #[TentativeType] |
|
| 1548 | + public function send_long_data(int $param_num, string $data): bool {} |
|
| 1549 | + |
|
| 1550 | + /** |
|
| 1551 | + * No documentation available |
|
| 1552 | + * @removed 5.4 |
|
| 1553 | + */ |
|
| 1554 | + #[Deprecated(since: '5.3')] |
|
| 1555 | + public function stmt() {} |
|
| 1556 | + |
|
| 1557 | + /** |
|
| 1558 | + * Frees stored result memory for the given statement handle |
|
| 1559 | + * @link https://php.net/manual/en/mysqli-stmt.free-result.php |
|
| 1560 | + * @return void |
|
| 1561 | + */ |
|
| 1562 | + #[TentativeType] |
|
| 1563 | + public function free_result(): void {} |
|
| 1564 | + |
|
| 1565 | + /** |
|
| 1566 | + * Resets a prepared statement |
|
| 1567 | + * @link https://php.net/manual/en/mysqli-stmt.reset.php |
|
| 1568 | + * @return bool true on success or false on failure. |
|
| 1569 | + */ |
|
| 1570 | + #[TentativeType] |
|
| 1571 | + public function reset(): bool {} |
|
| 1572 | + |
|
| 1573 | + /** |
|
| 1574 | + * Prepare an SQL statement for execution |
|
| 1575 | + * @link https://php.net/manual/en/mysqli-stmt.prepare.php |
|
| 1576 | + * @param string $query <p> |
|
| 1577 | + * The query, as a string. It must consist of a single SQL statement. |
|
| 1578 | + * </p> |
|
| 1579 | + * <p> |
|
| 1580 | + * You can include one or more parameter markers in the SQL statement by |
|
| 1581 | + * embedding question mark (?) characters at the |
|
| 1582 | + * appropriate positions. |
|
| 1583 | + * </p> |
|
| 1584 | + * <p> |
|
| 1585 | + * You should not add a terminating semicolon or \g |
|
| 1586 | + * to the statement. |
|
| 1587 | + * </p> |
|
| 1588 | + * <p> |
|
| 1589 | + * The markers are legal only in certain places in SQL statements. |
|
| 1590 | + * For example, they are allowed in the VALUES() list of an INSERT statement |
|
| 1591 | + * (to specify column values for a row), or in a comparison with a column in |
|
| 1592 | + * a WHERE clause to specify a comparison value. |
|
| 1593 | + * </p> |
|
| 1594 | + * <p> |
|
| 1595 | + * However, they are not allowed for identifiers (such as table or column names), |
|
| 1596 | + * in the select list that names the columns to be returned by a SELECT statement), |
|
| 1597 | + * or to specify both operands of a binary operator such as the = |
|
| 1598 | + * equal sign. The latter restriction is necessary because it would be impossible |
|
| 1599 | + * to determine the parameter type. In general, parameters are legal only in Data |
|
| 1600 | + * Manipulation Language (DML) statements, and not in Data Definition Language |
|
| 1601 | + * (DDL) statements. |
|
| 1602 | + * </p> |
|
| 1603 | + * @return bool true on success or false on failure. |
|
| 1604 | + */ |
|
| 1605 | + #[TentativeType] |
|
| 1606 | + public function prepare(string $query): bool {} |
|
| 1607 | + |
|
| 1608 | + /** |
|
| 1609 | + * Transfers a result set from a prepared statement |
|
| 1610 | + * @link https://php.net/manual/en/mysqli-stmt.store-result.php |
|
| 1611 | + * @return bool true on success or false on failure. |
|
| 1612 | + */ |
|
| 1613 | + #[TentativeType] |
|
| 1614 | + public function store_result(): bool {} |
|
| 1615 | + |
|
| 1616 | + /** |
|
| 1617 | + * Gets a result set from a prepared statement |
|
| 1618 | + * @link https://php.net/manual/en/mysqli-stmt.get-result.php |
|
| 1619 | + * @return mysqli_result|false Returns a resultset or FALSE on failure |
|
| 1620 | + */ |
|
| 1621 | + #[TentativeType] |
|
| 1622 | + public function get_result(): mysqli_result|false {} |
|
| 1623 | 1623 | } |
| 1624 | 1624 | |
| 1625 | 1625 | /** |
@@ -1982,8 +1982,8 @@ discard block |
||
| 1982 | 1982 | */ |
| 1983 | 1983 | #[LanguageLevelTypeAware(['8.0' => 'string'], default: '?string')] |
| 1984 | 1984 | function mysqli_get_client_info( |
| 1985 | - #[PhpStormStubsElementAvailable(from: '5.3', to: '7.1')] mysqli $mysql, |
|
| 1986 | - #[PhpStormStubsElementAvailable(from: '8.0')] ?mysqli $mysql = null |
|
| 1985 | + #[PhpStormStubsElementAvailable(from: '5.3', to: '7.1')] mysqli $mysql, |
|
| 1986 | + #[PhpStormStubsElementAvailable(from: '8.0')] ?mysqli $mysql = null |
|
| 1987 | 1987 | ) {} |
| 1988 | 1988 | |
| 1989 | 1989 | /** |
@@ -2140,9 +2140,9 @@ discard block |
||
| 2140 | 2140 | * @return bool Returns FALSE if the first statement failed. To retrieve subsequent errors from other statements you have to call mysqli_next_result() first. |
| 2141 | 2141 | */ |
| 2142 | 2142 | function mysqli_multi_query( |
| 2143 | - mysqli $mysql, |
|
| 2144 | - #[PhpStormStubsElementAvailable(from: '5.3', to: '7.4')] string $query = null, |
|
| 2145 | - #[PhpStormStubsElementAvailable(from: '8.0')] string $query |
|
| 2143 | + mysqli $mysql, |
|
| 2144 | + #[PhpStormStubsElementAvailable(from: '5.3', to: '7.4')] string $query = null, |
|
| 2145 | + #[PhpStormStubsElementAvailable(from: '8.0')] string $query |
|
| 2146 | 2146 | ): bool {} |
| 2147 | 2147 | |
| 2148 | 2148 | /** |
@@ -2296,9 +2296,9 @@ discard block |
||
| 2296 | 2296 | * @return bool |
| 2297 | 2297 | */ |
| 2298 | 2298 | function mysqli_real_query( |
| 2299 | - mysqli $mysql, |
|
| 2300 | - #[PhpStormStubsElementAvailable(from: '5.3', to: '7.4')] string $query = null, |
|
| 2301 | - #[PhpStormStubsElementAvailable(from: '8.0')] string $query |
|
| 2299 | + mysqli $mysql, |
|
| 2300 | + #[PhpStormStubsElementAvailable(from: '5.3', to: '7.4')] string $query = null, |
|
| 2301 | + #[PhpStormStubsElementAvailable(from: '8.0')] string $query |
|
| 2302 | 2302 | ): bool {} |
| 2303 | 2303 | |
| 2304 | 2304 | /** |
@@ -2469,10 +2469,10 @@ discard block |
||
| 2469 | 2469 | * @return bool true on success or false on failure. |
| 2470 | 2470 | */ |
| 2471 | 2471 | function mysqli_stmt_bind_param( |
| 2472 | - mysqli_stmt $statement, |
|
| 2473 | - string $types, |
|
| 2474 | - #[PhpStormStubsElementAvailable(from: '5.3', to: '7.4')] mixed &$vars, |
|
| 2475 | - mixed &...$vars |
|
| 2472 | + mysqli_stmt $statement, |
|
| 2473 | + string $types, |
|
| 2474 | + #[PhpStormStubsElementAvailable(from: '5.3', to: '7.4')] mixed &$vars, |
|
| 2475 | + mixed &...$vars |
|
| 2476 | 2476 | ): bool {} |
| 2477 | 2477 | |
| 2478 | 2478 | /** |
@@ -2483,9 +2483,9 @@ discard block |
||
| 2483 | 2483 | * @return bool |
| 2484 | 2484 | */ |
| 2485 | 2485 | function mysqli_stmt_bind_result( |
| 2486 | - mysqli_stmt $statement, |
|
| 2487 | - #[PhpStormStubsElementAvailable(from: '5.3', to: '7.4')] mixed &$vars, |
|
| 2488 | - mixed &...$vars |
|
| 2486 | + mysqli_stmt $statement, |
|
| 2487 | + #[PhpStormStubsElementAvailable(from: '5.3', to: '7.4')] mixed &$vars, |
|
| 2488 | + mixed &...$vars |
|
| 2489 | 2489 | ): bool {} |
| 2490 | 2490 | |
| 2491 | 2491 | /** |
@@ -2572,12 +2572,12 @@ discard block |
||
| 2572 | 2572 | * @return bool This function always returns TRUE value. |
| 2573 | 2573 | */ |
| 2574 | 2574 | function mysqli_ssl_set( |
| 2575 | - mysqli $mysql, |
|
| 2576 | - #[LanguageLevelTypeAware(['8.0' => 'string|null'], default: 'string')] $key, |
|
| 2577 | - #[LanguageLevelTypeAware(['8.0' => 'string|null'], default: 'string')] $certificate, |
|
| 2578 | - #[LanguageLevelTypeAware(['8.0' => 'string|null'], default: 'string')] $ca_certificate, |
|
| 2579 | - #[LanguageLevelTypeAware(['8.0' => 'string|null'], default: 'string')] $ca_path, |
|
| 2580 | - #[LanguageLevelTypeAware(['8.0' => 'string|null'], default: 'string')] $cipher_algos |
|
| 2575 | + mysqli $mysql, |
|
| 2576 | + #[LanguageLevelTypeAware(['8.0' => 'string|null'], default: 'string')] $key, |
|
| 2577 | + #[LanguageLevelTypeAware(['8.0' => 'string|null'], default: 'string')] $certificate, |
|
| 2578 | + #[LanguageLevelTypeAware(['8.0' => 'string|null'], default: 'string')] $ca_certificate, |
|
| 2579 | + #[LanguageLevelTypeAware(['8.0' => 'string|null'], default: 'string')] $ca_path, |
|
| 2580 | + #[LanguageLevelTypeAware(['8.0' => 'string|null'], default: 'string')] $cipher_algos |
|
| 2581 | 2581 | ): bool {} |
| 2582 | 2582 | |
| 2583 | 2583 | /** |
@@ -2741,9 +2741,9 @@ discard block |
||
| 2741 | 2741 | * @return string |
| 2742 | 2742 | */ |
| 2743 | 2743 | function mysqli_escape_string( |
| 2744 | - mysqli $mysql, |
|
| 2745 | - string $string, |
|
| 2746 | - #[PhpStormStubsElementAvailable(from: '5.3', to: '7.4')] $resultmode = null |
|
| 2744 | + mysqli $mysql, |
|
| 2745 | + string $string, |
|
| 2746 | + #[PhpStormStubsElementAvailable(from: '5.3', to: '7.4')] $resultmode = null |
|
| 2747 | 2747 | ): string {} |
| 2748 | 2748 | |
| 2749 | 2749 | /** |
@@ -2797,9 +2797,9 @@ discard block |
||
| 2797 | 2797 | * @return bool |
| 2798 | 2798 | */ |
| 2799 | 2799 | function mysqli_set_opt( |
| 2800 | - #[PhpStormStubsElementAvailable(from: '8.0')] mysqli $mysql, |
|
| 2801 | - #[PhpStormStubsElementAvailable(from: '8.0')] int $option, |
|
| 2802 | - #[PhpStormStubsElementAvailable(from: '8.0')] $value |
|
| 2800 | + #[PhpStormStubsElementAvailable(from: '8.0')] mysqli $mysql, |
|
| 2801 | + #[PhpStormStubsElementAvailable(from: '8.0')] int $option, |
|
| 2802 | + #[PhpStormStubsElementAvailable(from: '8.0')] $value |
|
| 2803 | 2803 | ): bool {} |
| 2804 | 2804 | |
| 2805 | 2805 | /** |
@@ -208,8 +208,8 @@ discard block |
||
| 208 | 208 | */ |
| 209 | 209 | #[TentativeType] |
| 210 | 210 | public function begin_transaction( |
| 211 | - #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $flags = 0, |
|
| 212 | - #[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $name = null |
|
| 211 | + #[LanguageLevelTypeAware(['8.0' => 'int'], default : '')] $flags = 0, |
|
| 212 | + #[LanguageLevelTypeAware(['8.0' => 'string|null'], default : '')] $name = null |
|
| 213 | 213 | ): bool {} |
| 214 | 214 | |
| 215 | 215 | /** |
@@ -245,7 +245,7 @@ discard block |
||
| 245 | 245 | /** |
| 246 | 246 | * @removed 5.4 |
| 247 | 247 | */ |
| 248 | - #[Deprecated(since: '5.3')] |
|
| 248 | + #[Deprecated(since : '5.3')] |
|
| 249 | 249 | public function client_encoding() {} |
| 250 | 250 | |
| 251 | 251 | /** |
@@ -355,7 +355,7 @@ discard block |
||
| 355 | 355 | * @return mysqli_warning|false |
| 356 | 356 | */ |
| 357 | 357 | #[TentativeType] |
| 358 | - public function get_warnings(): mysqli_warning|false {} |
|
| 358 | + public function get_warnings(): mysqli_warning | false {} |
|
| 359 | 359 | |
| 360 | 360 | /** |
| 361 | 361 | * Initializes MySQLi and returns a resource for use with mysqli_real_connect() |
@@ -516,7 +516,7 @@ discard block |
||
| 516 | 516 | * @return mysqli_stmt|false <b>mysqli_prepare</b> returns a statement object or false if an error occurred. |
| 517 | 517 | */ |
| 518 | 518 | #[TentativeType] |
| 519 | - public function prepare(string $query): mysqli_stmt|false {} |
|
| 519 | + public function prepare(string $query): mysqli_stmt | false {} |
|
| 520 | 520 | |
| 521 | 521 | /** |
| 522 | 522 | * Performs a query on the database |
@@ -549,7 +549,7 @@ discard block |
||
| 549 | 549 | * return true and false on failure. |
| 550 | 550 | */ |
| 551 | 551 | #[TentativeType] |
| 552 | - public function query(string $query, int $result_mode = MYSQLI_STORE_RESULT): mysqli_result|bool {} |
|
| 552 | + public function query(string $query, int $result_mode = MYSQLI_STORE_RESULT): mysqli_result | bool {} |
|
| 553 | 553 | |
| 554 | 554 | /** |
| 555 | 555 | * Opens a connection to a mysql server |
@@ -671,7 +671,7 @@ discard block |
||
| 671 | 671 | * @return int|false number of ready connections in success, false otherwise. |
| 672 | 672 | */ |
| 673 | 673 | #[TentativeType] |
| 674 | - public static function poll(?array &$read, ?array &$error, array &$reject, int $seconds, int $microseconds = 0): int|false {} |
|
| 674 | + public static function poll(?array &$read, ?array &$error, array &$reject, int $seconds, int $microseconds = 0): int | false {} |
|
| 675 | 675 | |
| 676 | 676 | /** |
| 677 | 677 | * Get result from async query |
@@ -679,7 +679,7 @@ discard block |
||
| 679 | 679 | * @return mysqli_result|false mysqli_result in success, false otherwise. |
| 680 | 680 | */ |
| 681 | 681 | #[TentativeType] |
| 682 | - public function reap_async_query(): mysqli_result|bool {} |
|
| 682 | + public function reap_async_query(): mysqli_result | bool {} |
|
| 683 | 683 | |
| 684 | 684 | /** |
| 685 | 685 | * Escapes special characters in a string for use in an SQL statement, taking into account the current charset of the connection |
@@ -713,7 +713,7 @@ discard block |
||
| 713 | 713 | * @since 5.5 |
| 714 | 714 | */ |
| 715 | 715 | #[TentativeType] |
| 716 | - public function release_savepoint(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $name): bool {} |
|
| 716 | + public function release_savepoint(#[LanguageLevelTypeAware(['8.0' => 'string'], default : '')] $name): bool {} |
|
| 717 | 717 | |
| 718 | 718 | /** |
| 719 | 719 | * Rolls back current transaction |
@@ -725,8 +725,8 @@ discard block |
||
| 725 | 725 | */ |
| 726 | 726 | #[TentativeType] |
| 727 | 727 | public function rollback( |
| 728 | - #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $flags = 0, |
|
| 729 | - #[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $name = null |
|
| 728 | + #[LanguageLevelTypeAware(['8.0' => 'int'], default : '')] $flags = 0, |
|
| 729 | + #[LanguageLevelTypeAware(['8.0' => 'string|null'], default : '')] $name = null |
|
| 730 | 730 | ): bool {} |
| 731 | 731 | |
| 732 | 732 | /** |
@@ -737,7 +737,7 @@ discard block |
||
| 737 | 737 | * @since 5.5 |
| 738 | 738 | */ |
| 739 | 739 | #[TentativeType] |
| 740 | - public function savepoint(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $name): bool {} |
|
| 740 | + public function savepoint(#[LanguageLevelTypeAware(['8.0' => 'string'], default : '')] $name): bool {} |
|
| 741 | 741 | |
| 742 | 742 | /** |
| 743 | 743 | * Selects the default database for database queries |
@@ -797,7 +797,7 @@ discard block |
||
| 797 | 797 | * @return string|false A string describing the server status. false if an error occurred. |
| 798 | 798 | */ |
| 799 | 799 | #[TentativeType] |
| 800 | - public function stat(): string|false {} |
|
| 800 | + public function stat(): string | false {} |
|
| 801 | 801 | |
| 802 | 802 | /** |
| 803 | 803 | * Initializes a statement and returns an object for use with mysqli_stmt_prepare |
@@ -805,7 +805,7 @@ discard block |
||
| 805 | 805 | * @return mysqli_stmt an object. |
| 806 | 806 | */ |
| 807 | 807 | #[TentativeType] |
| 808 | - public function stmt_init(): mysqli_stmt|false {} |
|
| 808 | + public function stmt_init(): mysqli_stmt | false {} |
|
| 809 | 809 | |
| 810 | 810 | /** |
| 811 | 811 | * Transfers a result set from the last query |
@@ -828,7 +828,7 @@ discard block |
||
| 828 | 828 | * statement should have produced a non-empty result set. |
| 829 | 829 | */ |
| 830 | 830 | #[TentativeType] |
| 831 | - public function store_result(int $mode = null): mysqli_result|false {} |
|
| 831 | + public function store_result(int $mode = null): mysqli_result | false {} |
|
| 832 | 832 | |
| 833 | 833 | /** |
| 834 | 834 | * Returns whether thread safety is given or not |
@@ -844,7 +844,7 @@ discard block |
||
| 844 | 844 | * @return mysqli_result|false an unbuffered result object or false if an error occurred. |
| 845 | 845 | */ |
| 846 | 846 | #[TentativeType] |
| 847 | - public function use_result(): mysqli_result|false {} |
|
| 847 | + public function use_result(): mysqli_result | false {} |
|
| 848 | 848 | |
| 849 | 849 | /** |
| 850 | 850 | * @link https://php.net/manual/en/mysqli.refresh |
@@ -853,7 +853,7 @@ discard block |
||
| 853 | 853 | * @since 5.3 |
| 854 | 854 | */ |
| 855 | 855 | #[TentativeType] |
| 856 | - public function refresh(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $flags): bool {} |
|
| 856 | + public function refresh(#[LanguageLevelTypeAware(['8.0' => 'int'], default : '')] $flags): bool {} |
|
| 857 | 857 | } |
| 858 | 858 | |
| 859 | 859 | /** |
@@ -865,7 +865,7 @@ discard block |
||
| 865 | 865 | /** |
| 866 | 866 | * @var string |
| 867 | 867 | */ |
| 868 | - #[LanguageLevelTypeAware(['8.1' => 'string'], default: '')] |
|
| 868 | + #[LanguageLevelTypeAware(['8.1' => 'string'], default : '')] |
|
| 869 | 869 | public $message; |
| 870 | 870 | /** |
| 871 | 871 | * @var string |
@@ -1039,7 +1039,7 @@ discard block |
||
| 1039 | 1039 | * </table> |
| 1040 | 1040 | */ |
| 1041 | 1041 | #[TentativeType] |
| 1042 | - public function fetch_field(): object|false {} |
|
| 1042 | + public function fetch_field(): object | false {} |
|
| 1043 | 1043 | |
| 1044 | 1044 | /** |
| 1045 | 1045 | * Returns an array of objects representing the fields in a result set |
@@ -1168,7 +1168,7 @@ discard block |
||
| 1168 | 1168 | * </table> |
| 1169 | 1169 | */ |
| 1170 | 1170 | #[TentativeType] |
| 1171 | - public function fetch_field_direct(int $index): object|false {} |
|
| 1171 | + public function fetch_field_direct(int $index): object | false {} |
|
| 1172 | 1172 | |
| 1173 | 1173 | /** |
| 1174 | 1174 | * Fetches all result rows as an associative array, a numeric array, or both |
@@ -1205,7 +1205,7 @@ discard block |
||
| 1205 | 1205 | * are no more rows in resultset. |
| 1206 | 1206 | */ |
| 1207 | 1207 | #[TentativeType] |
| 1208 | - public function fetch_array(int $mode = MYSQLI_BOTH): array|false|null {} |
|
| 1208 | + public function fetch_array(int $mode = MYSQLI_BOTH): array | false | null {} |
|
| 1209 | 1209 | |
| 1210 | 1210 | /** |
| 1211 | 1211 | * Fetch a result row as an associative array |
@@ -1221,7 +1221,7 @@ discard block |
||
| 1221 | 1221 | * <b>mysqli_fetch_row</b> or add alias names. |
| 1222 | 1222 | */ |
| 1223 | 1223 | #[TentativeType] |
| 1224 | - public function fetch_assoc(): array|false|null {} |
|
| 1224 | + public function fetch_assoc(): array | false | null {} |
|
| 1225 | 1225 | |
| 1226 | 1226 | /** |
| 1227 | 1227 | * Returns the current row of a result set as an object |
@@ -1238,7 +1238,7 @@ discard block |
||
| 1238 | 1238 | * row or null if there are no more rows in resultset. |
| 1239 | 1239 | */ |
| 1240 | 1240 | #[TentativeType] |
| 1241 | - public function fetch_object(string $class = 'stdClass', array $constructor_args = null): object|false|null {} |
|
| 1241 | + public function fetch_object(string $class = 'stdClass', array $constructor_args = null): object | false | null {} |
|
| 1242 | 1242 | |
| 1243 | 1243 | /** |
| 1244 | 1244 | * Get a result row as an enumerated array |
@@ -1247,10 +1247,10 @@ discard block |
||
| 1247 | 1247 | * or null if there are no more rows in result set. |
| 1248 | 1248 | */ |
| 1249 | 1249 | #[TentativeType] |
| 1250 | - public function fetch_row(): array|false|null {} |
|
| 1250 | + public function fetch_row(): array | false | null {} |
|
| 1251 | 1251 | |
| 1252 | 1252 | #[PhpStormStubsElementAvailable('8.1')] |
| 1253 | - public function fetch_column(int $column = null): string|int|float|false|null {} |
|
| 1253 | + public function fetch_column(int $column = null): string | int | float | false | null {} |
|
| 1254 | 1254 | |
| 1255 | 1255 | /** |
| 1256 | 1256 | * Set result pointer to a specified field offset |
@@ -1482,7 +1482,7 @@ discard block |
||
| 1482 | 1482 | * @return bool true on success or false on failure. |
| 1483 | 1483 | */ |
| 1484 | 1484 | #[TentativeType] |
| 1485 | - public function execute(#[PhpStormStubsElementAvailable('8.1')] ?array $params = null): bool {} |
|
| 1485 | + public function execute(#[PhpStormStubsElementAvailable('8.1')] ? array $params = null): bool {} |
|
| 1486 | 1486 | |
| 1487 | 1487 | /** |
| 1488 | 1488 | * Fetch results from a prepared statement into the bound variables |
@@ -1498,7 +1498,7 @@ discard block |
||
| 1498 | 1498 | * @return object|false |
| 1499 | 1499 | */ |
| 1500 | 1500 | #[TentativeType] |
| 1501 | - public function get_warnings(): mysqli_warning|false {} |
|
| 1501 | + public function get_warnings(): mysqli_warning | false {} |
|
| 1502 | 1502 | |
| 1503 | 1503 | /** |
| 1504 | 1504 | * Returns result set metadata from a prepared statement |
@@ -1506,7 +1506,7 @@ discard block |
||
| 1506 | 1506 | * @return mysqli_result|false a result object or false if an error occurred. |
| 1507 | 1507 | */ |
| 1508 | 1508 | #[TentativeType] |
| 1509 | - public function result_metadata(): mysqli_result|false {} |
|
| 1509 | + public function result_metadata(): mysqli_result | false {} |
|
| 1510 | 1510 | |
| 1511 | 1511 | /** |
| 1512 | 1512 | * Check if there are more query results from a multiple query |
@@ -1530,7 +1530,7 @@ discard block |
||
| 1530 | 1530 | * @return string|int An integer representing the number of rows in result set. |
| 1531 | 1531 | */ |
| 1532 | 1532 | #[TentativeType] |
| 1533 | - public function num_rows(): string|int {} |
|
| 1533 | + public function num_rows(): string | int {} |
|
| 1534 | 1534 | |
| 1535 | 1535 | /** |
| 1536 | 1536 | * Send data in blocks |
@@ -1551,7 +1551,7 @@ discard block |
||
| 1551 | 1551 | * No documentation available |
| 1552 | 1552 | * @removed 5.4 |
| 1553 | 1553 | */ |
| 1554 | - #[Deprecated(since: '5.3')] |
|
| 1554 | + #[Deprecated(since : '5.3')] |
|
| 1555 | 1555 | public function stmt() {} |
| 1556 | 1556 | |
| 1557 | 1557 | /** |
@@ -1619,7 +1619,7 @@ discard block |
||
| 1619 | 1619 | * @return mysqli_result|false Returns a resultset or FALSE on failure |
| 1620 | 1620 | */ |
| 1621 | 1621 | #[TentativeType] |
| 1622 | - public function get_result(): mysqli_result|false {} |
|
| 1622 | + public function get_result(): mysqli_result | false {} |
|
| 1623 | 1623 | } |
| 1624 | 1624 | |
| 1625 | 1625 | /** |
@@ -1630,7 +1630,7 @@ discard block |
||
| 1630 | 1630 | * Zero indicates that no records where updated for an UPDATE statement, |
| 1631 | 1631 | * no rows matched the WHERE clause in the query or that no query has yet been executed. -1 indicates that the query returned an error. |
| 1632 | 1632 | */ |
| 1633 | -function mysqli_affected_rows(mysqli $mysql): string|int {} |
|
| 1633 | +function mysqli_affected_rows(mysqli $mysql): string | int {} |
|
| 1634 | 1634 | |
| 1635 | 1635 | /** |
| 1636 | 1636 | * Turns on or off auto-committing database modifications |
@@ -1701,7 +1701,7 @@ discard block |
||
| 1701 | 1701 | * @param string|null $socket Specifies the socket or named pipe that should be used. |
| 1702 | 1702 | * @return mysqli|false|null object which represents the connection to a MySQL Server or false if an error occurred. |
| 1703 | 1703 | */ |
| 1704 | -function mysqli_connect(?string $hostname = null, ?string $username = null, ?string $password = null, ?string $database = null, ?int $port = null, ?string $socket = null): mysqli|false {} |
|
| 1704 | +function mysqli_connect(?string $hostname = null, ?string $username = null, ?string $password = null, ?string $database = null, ?int $port = null, ?string $socket = null): mysqli | false {} |
|
| 1705 | 1705 | |
| 1706 | 1706 | /** |
| 1707 | 1707 | * Returns the error code from last connect call |
@@ -1783,7 +1783,7 @@ discard block |
||
| 1783 | 1783 | * @param mysqli_stmt $statement |
| 1784 | 1784 | * @return bool |
| 1785 | 1785 | */ |
| 1786 | -function mysqli_stmt_execute(mysqli_stmt $statement, #[PhpStormStubsElementAvailable('8.1')] ?array $params = null): bool {} |
|
| 1786 | +function mysqli_stmt_execute(mysqli_stmt $statement, #[PhpStormStubsElementAvailable('8.1')] ? array $params = null): bool {} |
|
| 1787 | 1787 | |
| 1788 | 1788 | /** |
| 1789 | 1789 | * Executes a prepared Query |
@@ -1792,8 +1792,8 @@ discard block |
||
| 1792 | 1792 | * @param mysqli_stmt $statement |
| 1793 | 1793 | * @return bool |
| 1794 | 1794 | */ |
| 1795 | -#[Deprecated(since: '5.3')] |
|
| 1796 | -function mysqli_execute(mysqli_stmt $statement, #[PhpStormStubsElementAvailable('8.1')] ?array $params = null): bool {} |
|
| 1795 | +#[Deprecated(since : '5.3')] |
|
| 1796 | +function mysqli_execute(mysqli_stmt $statement, #[PhpStormStubsElementAvailable('8.1')] ? array $params = null): bool {} |
|
| 1797 | 1797 | |
| 1798 | 1798 | /** |
| 1799 | 1799 | * Returns the next field in the result set |
@@ -1802,7 +1802,7 @@ discard block |
||
| 1802 | 1802 | * mysqli_store_result() or mysqli_use_result(). |
| 1803 | 1803 | * @return object|false Returns an object which contains field definition information or FALSE if no field information is available. |
| 1804 | 1804 | */ |
| 1805 | -function mysqli_fetch_field(mysqli_result $result): object|false {} |
|
| 1805 | +function mysqli_fetch_field(mysqli_result $result): object | false {} |
|
| 1806 | 1806 | |
| 1807 | 1807 | /** |
| 1808 | 1808 | * Returns an array of objects representing the fields in a result set |
@@ -1811,7 +1811,7 @@ discard block |
||
| 1811 | 1811 | * mysqli_store_result() or mysqli_use_result(). |
| 1812 | 1812 | * @return array|false Returns an array of objects which contains field definition information or FALSE if no field information is available. |
| 1813 | 1813 | */ |
| 1814 | -#[LanguageLevelTypeAware(["8.0" => "array"], default: "array|false")] |
|
| 1814 | +#[LanguageLevelTypeAware(["8.0" => "array"], default : "array|false")] |
|
| 1815 | 1815 | function mysqli_fetch_fields(mysqli_result $result) {} |
| 1816 | 1816 | |
| 1817 | 1817 | /** |
@@ -1822,7 +1822,7 @@ discard block |
||
| 1822 | 1822 | * @param int $index The field number. This value must be in the range from 0 to number of fields - 1. |
| 1823 | 1823 | * @return object|false Returns an object which contains field definition information or FALSE if no field information for specified fieldnr is available. |
| 1824 | 1824 | */ |
| 1825 | -function mysqli_fetch_field_direct(mysqli_result $result, int $index): object|false {} |
|
| 1825 | +function mysqli_fetch_field_direct(mysqli_result $result, int $index): object | false {} |
|
| 1826 | 1826 | |
| 1827 | 1827 | /** |
| 1828 | 1828 | * Returns the lengths of the columns of the current row in the result set |
@@ -1831,7 +1831,7 @@ discard block |
||
| 1831 | 1831 | * mysqli_store_result() or mysqli_use_result(). |
| 1832 | 1832 | * @return int[]|false An array of integers representing the size of each column (not including any terminating null characters). FALSE if an error occurred. |
| 1833 | 1833 | */ |
| 1834 | -function mysqli_fetch_lengths(mysqli_result $result): array|false {} |
|
| 1834 | +function mysqli_fetch_lengths(mysqli_result $result): array | false {} |
|
| 1835 | 1835 | |
| 1836 | 1836 | /** |
| 1837 | 1837 | * Fetches all result rows as an associative array, a numeric array, or both. |
@@ -1852,7 +1852,7 @@ discard block |
||
| 1852 | 1852 | * @param int $mode |
| 1853 | 1853 | * @return array|false|null |
| 1854 | 1854 | */ |
| 1855 | -function mysqli_fetch_array(mysqli_result $result, int $mode = MYSQLI_BOTH): array|false|null {} |
|
| 1855 | +function mysqli_fetch_array(mysqli_result $result, int $mode = MYSQLI_BOTH): array | false | null {} |
|
| 1856 | 1856 | |
| 1857 | 1857 | /** |
| 1858 | 1858 | * Fetch a result row as an associative array |
@@ -1865,7 +1865,7 @@ discard block |
||
| 1865 | 1865 | * To access the other column(s) of the same name, |
| 1866 | 1866 | * you either need to access the result with numeric indices by using mysqli_fetch_row() or add alias names. |
| 1867 | 1867 | */ |
| 1868 | -function mysqli_fetch_assoc(mysqli_result $result): array|null|false {} |
|
| 1868 | +function mysqli_fetch_assoc(mysqli_result $result): array | null | false {} |
|
| 1869 | 1869 | |
| 1870 | 1870 | /** |
| 1871 | 1871 | * Returns the current row of a result set as an object. |
@@ -1879,7 +1879,7 @@ discard block |
||
| 1879 | 1879 | * To access the other column(s) of the same name, |
| 1880 | 1880 | * you either need to access the result with numeric indices by using mysqli_fetch_row() or add alias names. |
| 1881 | 1881 | */ |
| 1882 | -function mysqli_fetch_object(mysqli_result $result, string $class = 'stdClass', array $constructor_args = []): object|null|false {} |
|
| 1882 | +function mysqli_fetch_object(mysqli_result $result, string $class = 'stdClass', array $constructor_args = []): object | null | false {} |
|
| 1883 | 1883 | |
| 1884 | 1884 | /** |
| 1885 | 1885 | * Get a result row as an enumerated array |
@@ -1890,7 +1890,7 @@ discard block |
||
| 1890 | 1890 | * or null if there are no more rows in result set. |
| 1891 | 1891 | * @link https://php.net/manual/en/mysqli-result.fetch-row.php |
| 1892 | 1892 | */ |
| 1893 | -function mysqli_fetch_row(mysqli_result $result): array|false|null {} |
|
| 1893 | +function mysqli_fetch_row(mysqli_result $result): array | false | null {} |
|
| 1894 | 1894 | |
| 1895 | 1895 | /** |
| 1896 | 1896 | * Get a result column as an enumerated array |
@@ -1901,7 +1901,7 @@ discard block |
||
| 1901 | 1901 | * or null if there are no more columns in result set. |
| 1902 | 1902 | */ |
| 1903 | 1903 | #[PhpStormStubsElementAvailable('8.1')] |
| 1904 | -function mysqli_fetch_column(mysqli_result $result, int $column = null): string|int|float|false|null {} |
|
| 1904 | +function mysqli_fetch_column(mysqli_result $result, int $column = null): string | int | float | false | null {} |
|
| 1905 | 1905 | |
| 1906 | 1906 | /** |
| 1907 | 1907 | * Returns the number of columns for the most recent query |
@@ -1955,7 +1955,7 @@ discard block |
||
| 1955 | 1955 | * @param mysqli $mysql A link identifier returned by mysqli_connect() or mysqli_init() |
| 1956 | 1956 | * @return array|false an array with connection stats if successful, FALSE otherwise. |
| 1957 | 1957 | */ |
| 1958 | -#[LanguageLevelTypeAware(["8.0" => "array"], default: "array|false")] |
|
| 1958 | +#[LanguageLevelTypeAware(["8.0" => "array"], default : "array|false")] |
|
| 1959 | 1959 | function mysqli_get_connection_stats(mysqli $mysql) {} |
| 1960 | 1960 | |
| 1961 | 1961 | /** |
@@ -1963,7 +1963,7 @@ discard block |
||
| 1963 | 1963 | * @link https://php.net/manual/en/function.mysqli-get-client-stats.php |
| 1964 | 1964 | * @return array|false an array with client stats if success, false otherwise. |
| 1965 | 1965 | */ |
| 1966 | -#[LanguageLevelTypeAware(["8.0" => "array"], default: "array|false")] |
|
| 1966 | +#[LanguageLevelTypeAware(["8.0" => "array"], default : "array|false")] |
|
| 1967 | 1967 | function mysqli_get_client_stats() {} |
| 1968 | 1968 | |
| 1969 | 1969 | /** |
@@ -1980,10 +1980,10 @@ discard block |
||
| 1980 | 1980 | * @param mysqli|null $mysql A link identifier returned by mysqli_connect() or mysqli_init() |
| 1981 | 1981 | * @return string|null A string that represents the MySQL client library version |
| 1982 | 1982 | */ |
| 1983 | -#[LanguageLevelTypeAware(['8.0' => 'string'], default: '?string')] |
|
| 1983 | +#[LanguageLevelTypeAware(['8.0' => 'string'], default : '?string')] |
|
| 1984 | 1984 | function mysqli_get_client_info( |
| 1985 | - #[PhpStormStubsElementAvailable(from: '5.3', to: '7.1')] mysqli $mysql, |
|
| 1986 | - #[PhpStormStubsElementAvailable(from: '8.0')] ?mysqli $mysql = null |
|
| 1985 | + #[PhpStormStubsElementAvailable(from : '5.3', to : '7.1')] mysqli $mysql, |
|
| 1986 | + #[PhpStormStubsElementAvailable(from : '8.0')] ?mysqli $mysql = null |
|
| 1987 | 1987 | ) {} |
| 1988 | 1988 | |
| 1989 | 1989 | /** |
@@ -1991,7 +1991,7 @@ discard block |
||
| 1991 | 1991 | * @link https://php.net/manual/en/mysqli.get-client-version.php |
| 1992 | 1992 | * @return int |
| 1993 | 1993 | */ |
| 1994 | -function mysqli_get_client_version(#[PhpStormStubsElementAvailable(from: '5.3', to: '7.3')] $link): int {} |
|
| 1994 | +function mysqli_get_client_version(#[PhpStormStubsElementAvailable(from : '5.3', to : '7.3')] $link): int {} |
|
| 1995 | 1995 | |
| 1996 | 1996 | /** |
| 1997 | 1997 | * Returns a string representing the type of connection used |
@@ -2069,7 +2069,7 @@ discard block |
||
| 2069 | 2069 | * @param mysqli $mysql A link identifier returned by mysqli_connect() or mysqli_init() |
| 2070 | 2070 | * @return mysqli_warning|false |
| 2071 | 2071 | */ |
| 2072 | -function mysqli_get_warnings(mysqli $mysql): mysqli_warning|false {} |
|
| 2072 | +function mysqli_get_warnings(mysqli $mysql): mysqli_warning | false {} |
|
| 2073 | 2073 | |
| 2074 | 2074 | /** |
| 2075 | 2075 | * Initializes MySQLi and returns a resource for use with mysqli_real_connect() |
@@ -2077,7 +2077,7 @@ discard block |
||
| 2077 | 2077 | * @return mysqli|false |
| 2078 | 2078 | * @see mysqli_real_connect() |
| 2079 | 2079 | */ |
| 2080 | -function mysqli_init(): mysqli|false {} |
|
| 2080 | +function mysqli_init(): mysqli | false {} |
|
| 2081 | 2081 | |
| 2082 | 2082 | /** |
| 2083 | 2083 | * Retrieves information about the most recently executed query |
@@ -2094,7 +2094,7 @@ discard block |
||
| 2094 | 2094 | * @return int|string The value of the AUTO_INCREMENT field that was updated by the previous query. Returns zero if there was no previous query on the connection or if the query did not update an AUTO_INCREMENT value. |
| 2095 | 2095 | * If the number is greater than maximal int value, mysqli_insert_id() will return a string. |
| 2096 | 2096 | */ |
| 2097 | -function mysqli_insert_id(mysqli $mysql): string|int {} |
|
| 2097 | +function mysqli_insert_id(mysqli $mysql): string | int {} |
|
| 2098 | 2098 | |
| 2099 | 2099 | /** |
| 2100 | 2100 | * Asks the server to kill a MySQL thread |
@@ -2141,8 +2141,8 @@ discard block |
||
| 2141 | 2141 | */ |
| 2142 | 2142 | function mysqli_multi_query( |
| 2143 | 2143 | mysqli $mysql, |
| 2144 | - #[PhpStormStubsElementAvailable(from: '5.3', to: '7.4')] string $query = null, |
|
| 2145 | - #[PhpStormStubsElementAvailable(from: '8.0')] string $query |
|
| 2144 | + #[PhpStormStubsElementAvailable(from : '5.3', to : '7.4')] string $query = null, |
|
| 2145 | + #[PhpStormStubsElementAvailable(from : '8.0')] string $query |
|
| 2146 | 2146 | ): bool {} |
| 2147 | 2147 | |
| 2148 | 2148 | /** |
@@ -2169,7 +2169,7 @@ discard block |
||
| 2169 | 2169 | * mysqli_store_result() or mysqli_use_result(). |
| 2170 | 2170 | * @return string|int Returns number of rows in the result set. |
| 2171 | 2171 | */ |
| 2172 | -function mysqli_num_rows(mysqli_result $result): string|int {} |
|
| 2172 | +function mysqli_num_rows(mysqli_result $result): string | int {} |
|
| 2173 | 2173 | |
| 2174 | 2174 | /** |
| 2175 | 2175 | * Set options |
@@ -2199,7 +2199,7 @@ discard block |
||
| 2199 | 2199 | * @param int $microseconds [optional] |
| 2200 | 2200 | * @return int|false number of ready connections upon success, FALSE otherwise. |
| 2201 | 2201 | */ |
| 2202 | -function mysqli_poll(?array &$read, ?array &$error, array &$reject, int $seconds, int $microseconds = 0): int|false {} |
|
| 2202 | +function mysqli_poll(?array &$read, ?array &$error, array &$reject, int $seconds, int $microseconds = 0): int | false {} |
|
| 2203 | 2203 | |
| 2204 | 2204 | /** |
| 2205 | 2205 | * Prepare an SQL statement for execution |
@@ -2208,7 +2208,7 @@ discard block |
||
| 2208 | 2208 | * @param string $query |
| 2209 | 2209 | * @return mysqli_stmt|false A statement object or FALSE if an error occurred. |
| 2210 | 2210 | */ |
| 2211 | -function mysqli_prepare(mysqli $mysql, string $query): mysqli_stmt|false {} |
|
| 2211 | +function mysqli_prepare(mysqli $mysql, string $query): mysqli_stmt | false {} |
|
| 2212 | 2212 | |
| 2213 | 2213 | /** |
| 2214 | 2214 | * Enables or disables internal report functions |
@@ -2260,7 +2260,7 @@ discard block |
||
| 2260 | 2260 | * For other successful queries mysqli_query() will return TRUE. |
| 2261 | 2261 | * Returns FALSE on failure. |
| 2262 | 2262 | */ |
| 2263 | -function mysqli_query(mysqli $mysql, string $query, int $result_mode = MYSQLI_STORE_RESULT): mysqli_result|bool {} |
|
| 2263 | +function mysqli_query(mysqli $mysql, string $query, int $result_mode = MYSQLI_STORE_RESULT): mysqli_result | bool {} |
|
| 2264 | 2264 | |
| 2265 | 2265 | /** |
| 2266 | 2266 | * Opens a connection to a mysql server |
@@ -2297,8 +2297,8 @@ discard block |
||
| 2297 | 2297 | */ |
| 2298 | 2298 | function mysqli_real_query( |
| 2299 | 2299 | mysqli $mysql, |
| 2300 | - #[PhpStormStubsElementAvailable(from: '5.3', to: '7.4')] string $query = null, |
|
| 2301 | - #[PhpStormStubsElementAvailable(from: '8.0')] string $query |
|
| 2300 | + #[PhpStormStubsElementAvailable(from : '5.3', to : '7.4')] string $query = null, |
|
| 2301 | + #[PhpStormStubsElementAvailable(from : '8.0')] string $query |
|
| 2302 | 2302 | ): bool {} |
| 2303 | 2303 | |
| 2304 | 2304 | /** |
@@ -2309,7 +2309,7 @@ discard block |
||
| 2309 | 2309 | * @param mysqli $mysql A link identifier returned by mysqli_connect() or mysqli_init() |
| 2310 | 2310 | * @return mysqli_result|bool mysqli_result in success, FALSE otherwise. |
| 2311 | 2311 | */ |
| 2312 | -function mysqli_reap_async_query(mysqli $mysql): mysqli_result|bool {} |
|
| 2312 | +function mysqli_reap_async_query(mysqli $mysql): mysqli_result | bool {} |
|
| 2313 | 2313 | |
| 2314 | 2314 | /** |
| 2315 | 2315 | * Removes the named savepoint from the set of savepoints of the current transaction |
@@ -2365,7 +2365,7 @@ discard block |
||
| 2365 | 2365 | * @param mysqli_stmt $statement |
| 2366 | 2366 | * @return int|string If the number of affected rows is greater than maximal PHP int value, the number of affected rows will be returned as a string value. |
| 2367 | 2367 | */ |
| 2368 | -function mysqli_stmt_affected_rows(mysqli_stmt $statement): string|int {} |
|
| 2368 | +function mysqli_stmt_affected_rows(mysqli_stmt $statement): string | int {} |
|
| 2369 | 2369 | |
| 2370 | 2370 | /** |
| 2371 | 2371 | * Used to get the current value of a statement attribute |
@@ -2374,8 +2374,8 @@ discard block |
||
| 2374 | 2374 | * @param int $attribute |
| 2375 | 2375 | * @return int|false Returns FALSE if the attribute is not found, otherwise returns the value of the attribute. |
| 2376 | 2376 | */ |
| 2377 | -#[LanguageLevelTypeAware(["8.0" => "int"], default: "int|false")] |
|
| 2378 | -function mysqli_stmt_attr_get(mysqli_stmt $statement, int $attribute): false|int {} |
|
| 2377 | +#[LanguageLevelTypeAware(["8.0" => "int"], default : "int|false")] |
|
| 2378 | +function mysqli_stmt_attr_get(mysqli_stmt $statement, int $attribute): false | int {} |
|
| 2379 | 2379 | |
| 2380 | 2380 | /** |
| 2381 | 2381 | * Used to modify the behavior of a prepared statement |
@@ -2401,7 +2401,7 @@ discard block |
||
| 2401 | 2401 | * @param mysqli $mysql A link identifier returned by mysqli_connect() or mysqli_init() |
| 2402 | 2402 | * @return mysqli_stmt|false |
| 2403 | 2403 | */ |
| 2404 | -function mysqli_stmt_init(mysqli $mysql): mysqli_stmt|false {} |
|
| 2404 | +function mysqli_stmt_init(mysqli $mysql): mysqli_stmt | false {} |
|
| 2405 | 2405 | |
| 2406 | 2406 | /** |
| 2407 | 2407 | * Prepare an SQL statement for execution |
@@ -2418,7 +2418,7 @@ discard block |
||
| 2418 | 2418 | * @param mysqli_stmt $statement |
| 2419 | 2419 | * @return mysqli_result|false Returns a result object or FALSE if an error occurred |
| 2420 | 2420 | */ |
| 2421 | -function mysqli_stmt_result_metadata(mysqli_stmt $statement): mysqli_result|false {} |
|
| 2421 | +function mysqli_stmt_result_metadata(mysqli_stmt $statement): mysqli_result | false {} |
|
| 2422 | 2422 | |
| 2423 | 2423 | /** |
| 2424 | 2424 | * Send data in blocks |
@@ -2471,7 +2471,7 @@ discard block |
||
| 2471 | 2471 | function mysqli_stmt_bind_param( |
| 2472 | 2472 | mysqli_stmt $statement, |
| 2473 | 2473 | string $types, |
| 2474 | - #[PhpStormStubsElementAvailable(from: '5.3', to: '7.4')] mixed &$vars, |
|
| 2474 | + #[PhpStormStubsElementAvailable(from : '5.3', to : '7.4')] mixed &$vars, |
|
| 2475 | 2475 | mixed &...$vars |
| 2476 | 2476 | ): bool {} |
| 2477 | 2477 | |
@@ -2484,7 +2484,7 @@ discard block |
||
| 2484 | 2484 | */ |
| 2485 | 2485 | function mysqli_stmt_bind_result( |
| 2486 | 2486 | mysqli_stmt $statement, |
| 2487 | - #[PhpStormStubsElementAvailable(from: '5.3', to: '7.4')] mixed &$vars, |
|
| 2487 | + #[PhpStormStubsElementAvailable(from : '5.3', to : '7.4')] mixed &$vars, |
|
| 2488 | 2488 | mixed &...$vars |
| 2489 | 2489 | ): bool {} |
| 2490 | 2490 | |
@@ -2510,7 +2510,7 @@ discard block |
||
| 2510 | 2510 | * @param mysqli_stmt $statement |
| 2511 | 2511 | * @return mysqli_result|false Returns a resultset or FALSE on failure. |
| 2512 | 2512 | */ |
| 2513 | -function mysqli_stmt_get_result(mysqli_stmt $statement): mysqli_result|false {} |
|
| 2513 | +function mysqli_stmt_get_result(mysqli_stmt $statement): mysqli_result | false {} |
|
| 2514 | 2514 | |
| 2515 | 2515 | /** |
| 2516 | 2516 | * Get result of SHOW WARNINGS |
@@ -2518,7 +2518,7 @@ discard block |
||
| 2518 | 2518 | * @param mysqli_stmt $statement |
| 2519 | 2519 | * @return mysqli_warning|false (not documented, but it's probably a mysqli_warning object) |
| 2520 | 2520 | */ |
| 2521 | -function mysqli_stmt_get_warnings(mysqli_stmt $statement): mysqli_warning|false {} |
|
| 2521 | +function mysqli_stmt_get_warnings(mysqli_stmt $statement): mysqli_warning | false {} |
|
| 2522 | 2522 | |
| 2523 | 2523 | /** |
| 2524 | 2524 | * Get the ID generated from the previous INSERT operation |
@@ -2526,7 +2526,7 @@ discard block |
||
| 2526 | 2526 | * @param mysqli_stmt $statement |
| 2527 | 2527 | * @return string|int |
| 2528 | 2528 | */ |
| 2529 | -function mysqli_stmt_insert_id(mysqli_stmt $statement): string|int {} |
|
| 2529 | +function mysqli_stmt_insert_id(mysqli_stmt $statement): string | int {} |
|
| 2530 | 2530 | |
| 2531 | 2531 | /** |
| 2532 | 2532 | * Resets a prepared statement |
@@ -2558,7 +2558,7 @@ discard block |
||
| 2558 | 2558 | * @param mysqli $mysql A link identifier returned by mysqli_connect() or mysqli_init() |
| 2559 | 2559 | * @return string|false A string describing the server status. FALSE if an error occurred. |
| 2560 | 2560 | */ |
| 2561 | -function mysqli_stat(mysqli $mysql): string|false {} |
|
| 2561 | +function mysqli_stat(mysqli $mysql): string | false {} |
|
| 2562 | 2562 | |
| 2563 | 2563 | /** |
| 2564 | 2564 | * Used for establishing secure connections using SSL |
@@ -2573,11 +2573,11 @@ discard block |
||
| 2573 | 2573 | */ |
| 2574 | 2574 | function mysqli_ssl_set( |
| 2575 | 2575 | mysqli $mysql, |
| 2576 | - #[LanguageLevelTypeAware(['8.0' => 'string|null'], default: 'string')] $key, |
|
| 2577 | - #[LanguageLevelTypeAware(['8.0' => 'string|null'], default: 'string')] $certificate, |
|
| 2578 | - #[LanguageLevelTypeAware(['8.0' => 'string|null'], default: 'string')] $ca_certificate, |
|
| 2579 | - #[LanguageLevelTypeAware(['8.0' => 'string|null'], default: 'string')] $ca_path, |
|
| 2580 | - #[LanguageLevelTypeAware(['8.0' => 'string|null'], default: 'string')] $cipher_algos |
|
| 2576 | + #[LanguageLevelTypeAware(['8.0' => 'string|null'], default : 'string')] $key, |
|
| 2577 | + #[LanguageLevelTypeAware(['8.0' => 'string|null'], default : 'string')] $certificate, |
|
| 2578 | + #[LanguageLevelTypeAware(['8.0' => 'string|null'], default : 'string')] $ca_certificate, |
|
| 2579 | + #[LanguageLevelTypeAware(['8.0' => 'string|null'], default : 'string')] $ca_path, |
|
| 2580 | + #[LanguageLevelTypeAware(['8.0' => 'string|null'], default : 'string')] $cipher_algos |
|
| 2581 | 2581 | ): bool {} |
| 2582 | 2582 | |
| 2583 | 2583 | /** |
@@ -2635,7 +2635,7 @@ discard block |
||
| 2635 | 2635 | * @param mysqli_stmt $statement |
| 2636 | 2636 | * @return string|int |
| 2637 | 2637 | */ |
| 2638 | -function mysqli_stmt_num_rows(mysqli_stmt $statement): string|int {} |
|
| 2638 | +function mysqli_stmt_num_rows(mysqli_stmt $statement): string | int {} |
|
| 2639 | 2639 | |
| 2640 | 2640 | /** |
| 2641 | 2641 | * Returns SQLSTATE error from previous statement operation |
@@ -2660,7 +2660,7 @@ discard block |
||
| 2660 | 2660 | * @param int $mode [optional] The option that you want to set |
| 2661 | 2661 | * @return mysqli_result|false |
| 2662 | 2662 | */ |
| 2663 | -function mysqli_store_result(mysqli $mysql, int $mode): mysqli_result|false {} |
|
| 2663 | +function mysqli_store_result(mysqli $mysql, int $mode): mysqli_result | false {} |
|
| 2664 | 2664 | |
| 2665 | 2665 | /** |
| 2666 | 2666 | * Returns the thread ID for the current connection |
@@ -2683,7 +2683,7 @@ discard block |
||
| 2683 | 2683 | * @param mysqli $mysql A link identifier returned by mysqli_connect() or mysqli_init() |
| 2684 | 2684 | * @return mysqli_result|false |
| 2685 | 2685 | */ |
| 2686 | -function mysqli_use_result(mysqli $mysql): mysqli_result|false {} |
|
| 2686 | +function mysqli_use_result(mysqli $mysql): mysqli_result | false {} |
|
| 2687 | 2687 | |
| 2688 | 2688 | /** |
| 2689 | 2689 | * Returns the number of warnings from the last query for the given link |
@@ -2709,7 +2709,7 @@ discard block |
||
| 2709 | 2709 | * @param string $types |
| 2710 | 2710 | * @removed 5.4 |
| 2711 | 2711 | */ |
| 2712 | -#[Deprecated(since: '5.3')] |
|
| 2712 | +#[Deprecated(since : '5.3')] |
|
| 2713 | 2713 | function mysqli_bind_param(mysqli_stmt $statement, string $types) {} |
| 2714 | 2714 | |
| 2715 | 2715 | /** |
@@ -2720,7 +2720,7 @@ discard block |
||
| 2720 | 2720 | * @param mixed &$var1 |
| 2721 | 2721 | * @removed 5.4 |
| 2722 | 2722 | */ |
| 2723 | -#[Deprecated(since: '5.3')] |
|
| 2723 | +#[Deprecated(since : '5.3')] |
|
| 2724 | 2724 | function mysqli_bind_result(mysqli_stmt $statement, string $types, mixed &$var1) {} |
| 2725 | 2725 | |
| 2726 | 2726 | /** |
@@ -2730,7 +2730,7 @@ discard block |
||
| 2730 | 2730 | * @return string |
| 2731 | 2731 | * @removed 5.4 |
| 2732 | 2732 | */ |
| 2733 | -#[Deprecated(since: '5.3')] |
|
| 2733 | +#[Deprecated(since : '5.3')] |
|
| 2734 | 2734 | function mysqli_client_encoding(mysqli $mysql): string {} |
| 2735 | 2735 | |
| 2736 | 2736 | /** |
@@ -2743,7 +2743,7 @@ discard block |
||
| 2743 | 2743 | function mysqli_escape_string( |
| 2744 | 2744 | mysqli $mysql, |
| 2745 | 2745 | string $string, |
| 2746 | - #[PhpStormStubsElementAvailable(from: '5.3', to: '7.4')] $resultmode = null |
|
| 2746 | + #[PhpStormStubsElementAvailable(from : '5.3', to : '7.4')] $resultmode = null |
|
| 2747 | 2747 | ): string {} |
| 2748 | 2748 | |
| 2749 | 2749 | /** |
@@ -2753,7 +2753,7 @@ discard block |
||
| 2753 | 2753 | * @return bool |
| 2754 | 2754 | * @removed 5.4 |
| 2755 | 2755 | */ |
| 2756 | -#[Deprecated(since: '5.3')] |
|
| 2756 | +#[Deprecated(since : '5.3')] |
|
| 2757 | 2757 | function mysqli_fetch(mysqli_stmt $statement): bool {} |
| 2758 | 2758 | |
| 2759 | 2759 | /** |
@@ -2763,7 +2763,7 @@ discard block |
||
| 2763 | 2763 | * @return int |
| 2764 | 2764 | * @removed 5.4 |
| 2765 | 2765 | */ |
| 2766 | -#[Deprecated(since: '5.3')] |
|
| 2766 | +#[Deprecated(since : '5.3')] |
|
| 2767 | 2767 | function mysqli_param_count(mysqli_stmt $statement): int {} |
| 2768 | 2768 | |
| 2769 | 2769 | /** |
@@ -2773,8 +2773,8 @@ discard block |
||
| 2773 | 2773 | * @return mysqli_result|false Returns a result object or FALSE if an error occurred |
| 2774 | 2774 | * @removed 5.4 |
| 2775 | 2775 | */ |
| 2776 | -#[Deprecated(since: '5.3')] |
|
| 2777 | -function mysqli_get_metadata(mysqli_stmt $statement): false|mysqli_result {} |
|
| 2776 | +#[Deprecated(since : '5.3')] |
|
| 2777 | +function mysqli_get_metadata(mysqli_stmt $statement): false | mysqli_result {} |
|
| 2778 | 2778 | |
| 2779 | 2779 | /** |
| 2780 | 2780 | * Alias for <b>mysqli_stmt_send_long_data</b> |
@@ -2785,7 +2785,7 @@ discard block |
||
| 2785 | 2785 | * @return bool |
| 2786 | 2786 | * @removed 5.4 |
| 2787 | 2787 | */ |
| 2788 | -#[Deprecated(since: '5.3')] |
|
| 2788 | +#[Deprecated(since : '5.3')] |
|
| 2789 | 2789 | function mysqli_send_long_data(mysqli_stmt $statement, int $param_num, string $data): bool {} |
| 2790 | 2790 | |
| 2791 | 2791 | /** |
@@ -2797,9 +2797,9 @@ discard block |
||
| 2797 | 2797 | * @return bool |
| 2798 | 2798 | */ |
| 2799 | 2799 | function mysqli_set_opt( |
| 2800 | - #[PhpStormStubsElementAvailable(from: '8.0')] mysqli $mysql, |
|
| 2801 | - #[PhpStormStubsElementAvailable(from: '8.0')] int $option, |
|
| 2802 | - #[PhpStormStubsElementAvailable(from: '8.0')] $value |
|
| 2800 | + #[PhpStormStubsElementAvailable(from : '8.0')] mysqli $mysql, |
|
| 2801 | + #[PhpStormStubsElementAvailable(from : '8.0')] int $option, |
|
| 2802 | + #[PhpStormStubsElementAvailable(from : '8.0')] $value |
|
| 2803 | 2803 | ): bool {} |
| 2804 | 2804 | |
| 2805 | 2805 | /** |
@@ -12,8 +12,7 @@ discard block |
||
| 12 | 12 | /** |
| 13 | 13 | * mysqli_sql_exception |
| 14 | 14 | */ |
| 15 | -final class mysqli_sql_exception extends RuntimeException |
|
| 16 | -{ |
|
| 15 | +final class mysqli_sql_exception extends RuntimeException { |
|
| 17 | 16 | /** |
| 18 | 17 | * The sql state with the error. |
| 19 | 18 | * |
@@ -34,8 +33,7 @@ discard block |
||
| 34 | 33 | * MySQLi Driver. |
| 35 | 34 | * @link https://php.net/manual/en/class.mysqli-driver.php |
| 36 | 35 | */ |
| 37 | -final class mysqli_driver |
|
| 38 | -{ |
|
| 36 | +final class mysqli_driver { |
|
| 39 | 37 | /** |
| 40 | 38 | * @var string |
| 41 | 39 | */ |
@@ -71,8 +69,7 @@ discard block |
||
| 71 | 69 | * Represents a connection between PHP and a MySQL database. |
| 72 | 70 | * @link https://php.net/manual/en/class.mysqli.php |
| 73 | 71 | */ |
| 74 | -class mysqli |
|
| 75 | -{ |
|
| 72 | +class mysqli { |
|
| 76 | 73 | /** |
| 77 | 74 | * @var int |
| 78 | 75 | */ |
@@ -860,8 +857,7 @@ discard block |
||
| 860 | 857 | * Represents one or more MySQL warnings. |
| 861 | 858 | * @link https://php.net/manual/en/class.mysqli-warning.php |
| 862 | 859 | */ |
| 863 | -final class mysqli_warning |
|
| 864 | -{ |
|
| 860 | +final class mysqli_warning { |
|
| 865 | 861 | /** |
| 866 | 862 | * @var string |
| 867 | 863 | */ |
@@ -905,8 +901,7 @@ discard block |
||
| 905 | 901 | * Implements Traversable since 5.4 |
| 906 | 902 | * @link https://php.net/manual/en/class.mysqli-result.php |
| 907 | 903 | */ |
| 908 | -class mysqli_result implements IteratorAggregate |
|
| 909 | -{ |
|
| 904 | +class mysqli_result implements IteratorAggregate { |
|
| 910 | 905 | /** |
| 911 | 906 | * @var int |
| 912 | 907 | */ |
@@ -1283,8 +1278,7 @@ discard block |
||
| 1283 | 1278 | * Represents a prepared statement. |
| 1284 | 1279 | * @link https://php.net/manual/en/class.mysqli-stmt.php |
| 1285 | 1280 | */ |
| 1286 | -class mysqli_stmt |
|
| 1287 | -{ |
|
| 1281 | +class mysqli_stmt { |
|
| 1288 | 1282 | /** |
| 1289 | 1283 | * @var int |
| 1290 | 1284 | */ |
@@ -460,8 +460,8 @@ |
||
| 460 | 460 | * @since 7.1 |
| 461 | 461 | */ |
| 462 | 462 | function pcntl_async_signals( |
| 463 | - #[PhpStormStubsElementAvailable(from: '5.3', to: '7.4')] ?bool $enable, |
|
| 464 | - #[PhpStormStubsElementAvailable(from: '8.0')] ?bool $enable = null |
|
| 463 | + #[PhpStormStubsElementAvailable(from: '5.3', to: '7.4')] ?bool $enable, |
|
| 464 | + #[PhpStormStubsElementAvailable(from: '8.0')] ?bool $enable = null |
|
| 465 | 465 | ): bool {} |
| 466 | 466 | |
| 467 | 467 | /** |
@@ -225,7 +225,7 @@ discard block |
||
| 225 | 225 | * @return int|false the return code, as an integer. |
| 226 | 226 | */ |
| 227 | 227 | #[Pure] |
| 228 | -function pcntl_wexitstatus(int $status): int|false {} |
|
| 228 | +function pcntl_wexitstatus(int $status): int | false {} |
|
| 229 | 229 | |
| 230 | 230 | /** |
| 231 | 231 | * @param int $status |
@@ -243,7 +243,7 @@ discard block |
||
| 243 | 243 | * @return int|false the signal number, as an integer. |
| 244 | 244 | */ |
| 245 | 245 | #[Pure] |
| 246 | -function pcntl_wtermsig(int $status): int|false {} |
|
| 246 | +function pcntl_wtermsig(int $status): int | false {} |
|
| 247 | 247 | |
| 248 | 248 | /** |
| 249 | 249 | * Returns the signal which caused the child to stop |
@@ -254,7 +254,7 @@ discard block |
||
| 254 | 254 | * @return int|false the signal number. |
| 255 | 255 | */ |
| 256 | 256 | #[Pure] |
| 257 | -function pcntl_wstopsig(int $status): int|false {} |
|
| 257 | +function pcntl_wstopsig(int $status): int | false {} |
|
| 258 | 258 | |
| 259 | 259 | /** |
| 260 | 260 | * Executes specified program in current process space |
@@ -320,7 +320,7 @@ discard block |
||
| 320 | 320 | */ |
| 321 | 321 | #[Pure] |
| 322 | 322 | #[LanguageLevelTypeAware(["8.0" => "string"], default: "string|false")] |
| 323 | -function pcntl_strerror(int $error_code): false|string {} |
|
| 323 | +function pcntl_strerror(int $error_code): false | string {} |
|
| 324 | 324 | |
| 325 | 325 | /** |
| 326 | 326 | * Get the priority of any process |
@@ -337,7 +337,7 @@ discard block |
||
| 337 | 337 | * scheduling. |
| 338 | 338 | */ |
| 339 | 339 | #[Pure] |
| 340 | -function pcntl_getpriority(?int $process_id, int $mode = PRIO_PROCESS): int|false {} |
|
| 340 | +function pcntl_getpriority(?int $process_id, int $mode = PRIO_PROCESS): int | false {} |
|
| 341 | 341 | |
| 342 | 342 | /** |
| 343 | 343 | * Change the priority of any process |
@@ -423,7 +423,7 @@ discard block |
||
| 423 | 423 | * </p> |
| 424 | 424 | * @return int|false On success, <b>pcntl_sigwaitinfo</b> returns a signal number. |
| 425 | 425 | */ |
| 426 | -function pcntl_sigwaitinfo(array $signals, &$info): int|false {} |
|
| 426 | +function pcntl_sigwaitinfo(array $signals, &$info): int | false {} |
|
| 427 | 427 | |
| 428 | 428 | /** |
| 429 | 429 | * Waits for signals, with a timeout |
@@ -444,7 +444,7 @@ discard block |
||
| 444 | 444 | * </p> |
| 445 | 445 | * @return int|false On success, <b>pcntl_sigtimedwait</b> returns a signal number. |
| 446 | 446 | */ |
| 447 | -function pcntl_sigtimedwait(array $signals, &$info, int $seconds = 0, int $nanoseconds = 0): int|false {} |
|
| 447 | +function pcntl_sigtimedwait(array $signals, &$info, int $seconds = 0, int $nanoseconds = 0): int | false {} |
|
| 448 | 448 | |
| 449 | 449 | /** |
| 450 | 450 | * Enable/disable asynchronous signal handling or return the old setting.<br> |
@@ -460,8 +460,8 @@ discard block |
||
| 460 | 460 | * @since 7.1 |
| 461 | 461 | */ |
| 462 | 462 | function pcntl_async_signals( |
| 463 | - #[PhpStormStubsElementAvailable(from: '5.3', to: '7.4')] ?bool $enable, |
|
| 464 | - #[PhpStormStubsElementAvailable(from: '8.0')] ?bool $enable = null |
|
| 463 | + #[PhpStormStubsElementAvailable(from : '5.3', to : '7.4')] ?bool $enable, |
|
| 464 | + #[PhpStormStubsElementAvailable(from : '8.0')] ?bool $enable = null |
|
| 465 | 465 | ): bool {} |
| 466 | 466 | |
| 467 | 467 | /** |
@@ -78,10 +78,10 @@ discard block |
||
| 78 | 78 | * @return string |
| 79 | 79 | */ |
| 80 | 80 | function crypto_aead_aes256gcm_decrypt( |
| 81 | - string $msg, |
|
| 82 | - string $nonce, |
|
| 83 | - string $key, |
|
| 84 | - string $ad = '' |
|
| 81 | + string $msg, |
|
| 82 | + string $nonce, |
|
| 83 | + string $key, |
|
| 84 | + string $ad = '' |
|
| 85 | 85 | ): string {} |
| 86 | 86 | |
| 87 | 87 | /** |
@@ -95,10 +95,10 @@ discard block |
||
| 95 | 95 | * @return string |
| 96 | 96 | */ |
| 97 | 97 | function crypto_aead_aes256gcm_encrypt( |
| 98 | - string $msg, |
|
| 99 | - string $nonce, |
|
| 100 | - string $key, |
|
| 101 | - string $ad = '' |
|
| 98 | + string $msg, |
|
| 99 | + string $nonce, |
|
| 100 | + string $key, |
|
| 101 | + string $ad = '' |
|
| 102 | 102 | ): string {} |
| 103 | 103 | |
| 104 | 104 | /** |
@@ -112,10 +112,10 @@ discard block |
||
| 112 | 112 | * @return string |
| 113 | 113 | */ |
| 114 | 114 | function crypto_aead_chacha20poly1305_decrypt( |
| 115 | - string $msg, |
|
| 116 | - string $nonce, |
|
| 117 | - string $key, |
|
| 118 | - string $ad = '' |
|
| 115 | + string $msg, |
|
| 116 | + string $nonce, |
|
| 117 | + string $key, |
|
| 118 | + string $ad = '' |
|
| 119 | 119 | ): string {} |
| 120 | 120 | |
| 121 | 121 | /** |
@@ -129,10 +129,10 @@ discard block |
||
| 129 | 129 | * @return string |
| 130 | 130 | */ |
| 131 | 131 | function crypto_aead_chacha20poly1305_encrypt( |
| 132 | - string $msg, |
|
| 133 | - string $nonce, |
|
| 134 | - string $key, |
|
| 135 | - string $ad = '' |
|
| 132 | + string $msg, |
|
| 133 | + string $nonce, |
|
| 134 | + string $key, |
|
| 135 | + string $ad = '' |
|
| 136 | 136 | ): string {} |
| 137 | 137 | |
| 138 | 138 | /** |
@@ -144,8 +144,8 @@ discard block |
||
| 144 | 144 | * @return string |
| 145 | 145 | */ |
| 146 | 146 | function crypto_auth( |
| 147 | - string $msg, |
|
| 148 | - string $key |
|
| 147 | + string $msg, |
|
| 148 | + string $key |
|
| 149 | 149 | ): string {} |
| 150 | 150 | |
| 151 | 151 | /** |
@@ -158,9 +158,9 @@ discard block |
||
| 158 | 158 | * @return bool |
| 159 | 159 | */ |
| 160 | 160 | function crypto_auth_verify( |
| 161 | - string $mac, |
|
| 162 | - string $msg, |
|
| 163 | - string $key |
|
| 161 | + string $mac, |
|
| 162 | + string $msg, |
|
| 163 | + string $key |
|
| 164 | 164 | ): bool {} |
| 165 | 165 | |
| 166 | 166 | /** |
@@ -173,9 +173,9 @@ discard block |
||
| 173 | 173 | * @return string |
| 174 | 174 | */ |
| 175 | 175 | function crypto_box( |
| 176 | - string $msg, |
|
| 177 | - string $nonce, |
|
| 178 | - string $keypair |
|
| 176 | + string $msg, |
|
| 177 | + string $nonce, |
|
| 178 | + string $keypair |
|
| 179 | 179 | ): string {} |
| 180 | 180 | |
| 181 | 181 | /** |
@@ -192,7 +192,7 @@ discard block |
||
| 192 | 192 | * @return string |
| 193 | 193 | */ |
| 194 | 194 | function crypto_box_seed_keypair( |
| 195 | - string $seed |
|
| 195 | + string $seed |
|
| 196 | 196 | ): string {} |
| 197 | 197 | |
| 198 | 198 | /** |
@@ -203,8 +203,8 @@ discard block |
||
| 203 | 203 | * @return string |
| 204 | 204 | */ |
| 205 | 205 | function crypto_box_keypair_from_secretkey_and_publickey( |
| 206 | - string $secretkey, |
|
| 207 | - string $publickey |
|
| 206 | + string $secretkey, |
|
| 207 | + string $publickey |
|
| 208 | 208 | ): string {} |
| 209 | 209 | |
| 210 | 210 | /** |
@@ -217,9 +217,9 @@ discard block |
||
| 217 | 217 | * @return string |
| 218 | 218 | */ |
| 219 | 219 | function crypto_box_open( |
| 220 | - string $msg, |
|
| 221 | - string $nonce, |
|
| 222 | - string $keypair |
|
| 220 | + string $msg, |
|
| 221 | + string $nonce, |
|
| 222 | + string $keypair |
|
| 223 | 223 | ): string {} |
| 224 | 224 | |
| 225 | 225 | /** |
@@ -229,7 +229,7 @@ discard block |
||
| 229 | 229 | * @return string |
| 230 | 230 | */ |
| 231 | 231 | function crypto_box_publickey( |
| 232 | - string $keypair |
|
| 232 | + string $keypair |
|
| 233 | 233 | ): string {} |
| 234 | 234 | |
| 235 | 235 | /** |
@@ -239,7 +239,7 @@ discard block |
||
| 239 | 239 | * @return string |
| 240 | 240 | */ |
| 241 | 241 | function crypto_box_publickey_from_secretkey( |
| 242 | - string $secretkey |
|
| 242 | + string $secretkey |
|
| 243 | 243 | ): string {} |
| 244 | 244 | |
| 245 | 245 | /** |
@@ -251,8 +251,8 @@ discard block |
||
| 251 | 251 | * @return string |
| 252 | 252 | */ |
| 253 | 253 | function crypto_box_seal( |
| 254 | - string $message, |
|
| 255 | - string $publickey |
|
| 254 | + string $message, |
|
| 255 | + string $publickey |
|
| 256 | 256 | ): string {} |
| 257 | 257 | |
| 258 | 258 | /** |
@@ -264,8 +264,8 @@ discard block |
||
| 264 | 264 | * @return string |
| 265 | 265 | */ |
| 266 | 266 | function crypto_box_seal_open( |
| 267 | - string $encrypted, |
|
| 268 | - string $keypair |
|
| 267 | + string $encrypted, |
|
| 268 | + string $keypair |
|
| 269 | 269 | ): string {} |
| 270 | 270 | |
| 271 | 271 | /** |
@@ -275,7 +275,7 @@ discard block |
||
| 275 | 275 | * @return string |
| 276 | 276 | */ |
| 277 | 277 | function crypto_box_secretkey( |
| 278 | - string $keypair |
|
| 278 | + string $keypair |
|
| 279 | 279 | ): string {} |
| 280 | 280 | |
| 281 | 281 | /** |
@@ -289,10 +289,10 @@ discard block |
||
| 289 | 289 | * @return string |
| 290 | 290 | */ |
| 291 | 291 | function crypto_kx( |
| 292 | - string $secretkey, |
|
| 293 | - string $publickey, |
|
| 294 | - string $client_publickey, |
|
| 295 | - string $server_publickey |
|
| 292 | + string $secretkey, |
|
| 293 | + string $publickey, |
|
| 294 | + string $client_publickey, |
|
| 295 | + string $server_publickey |
|
| 296 | 296 | ): string {} |
| 297 | 297 | |
| 298 | 298 | /** |
@@ -304,9 +304,9 @@ discard block |
||
| 304 | 304 | * @return string |
| 305 | 305 | */ |
| 306 | 306 | function crypto_generichash( |
| 307 | - string $input, |
|
| 308 | - string $key = '', |
|
| 309 | - int $length = 32 |
|
| 307 | + string $input, |
|
| 308 | + string $key = '', |
|
| 309 | + int $length = 32 |
|
| 310 | 310 | ): string {} |
| 311 | 311 | |
| 312 | 312 | /** |
@@ -318,8 +318,8 @@ discard block |
||
| 318 | 318 | * @return string |
| 319 | 319 | */ |
| 320 | 320 | function crypto_generichash_init( |
| 321 | - string $key = '', |
|
| 322 | - int $length = 32 |
|
| 321 | + string $key = '', |
|
| 322 | + int $length = 32 |
|
| 323 | 323 | ): string {} |
| 324 | 324 | |
| 325 | 325 | /** |
@@ -331,8 +331,8 @@ discard block |
||
| 331 | 331 | * @return bool |
| 332 | 332 | */ |
| 333 | 333 | function crypto_generichash_update( |
| 334 | - string &$hashState, |
|
| 335 | - string $append |
|
| 334 | + string &$hashState, |
|
| 335 | + string $append |
|
| 336 | 336 | ): bool {} |
| 337 | 337 | |
| 338 | 338 | /** |
@@ -344,8 +344,8 @@ discard block |
||
| 344 | 344 | * @return string |
| 345 | 345 | */ |
| 346 | 346 | function crypto_generichash_final( |
| 347 | - string $state, |
|
| 348 | - int $length = 32 |
|
| 347 | + string $state, |
|
| 348 | + int $length = 32 |
|
| 349 | 349 | ): string {} |
| 350 | 350 | |
| 351 | 351 | /** |
@@ -360,11 +360,11 @@ discard block |
||
| 360 | 360 | * @return string |
| 361 | 361 | */ |
| 362 | 362 | function crypto_pwhash( |
| 363 | - int $out_len, |
|
| 364 | - string $passwd, |
|
| 365 | - string $salt, |
|
| 366 | - int $opslimit, |
|
| 367 | - int $memlimit |
|
| 363 | + int $out_len, |
|
| 364 | + string $passwd, |
|
| 365 | + string $salt, |
|
| 366 | + int $opslimit, |
|
| 367 | + int $memlimit |
|
| 368 | 368 | ): string {} |
| 369 | 369 | |
| 370 | 370 | /** |
@@ -377,9 +377,9 @@ discard block |
||
| 377 | 377 | * @return string |
| 378 | 378 | */ |
| 379 | 379 | function crypto_pwhash_str( |
| 380 | - string $passwd, |
|
| 381 | - int $opslimit, |
|
| 382 | - int $memlimit |
|
| 380 | + string $passwd, |
|
| 381 | + int $opslimit, |
|
| 382 | + int $memlimit |
|
| 383 | 383 | ): string {} |
| 384 | 384 | |
| 385 | 385 | /** |
@@ -391,8 +391,8 @@ discard block |
||
| 391 | 391 | * @return bool |
| 392 | 392 | */ |
| 393 | 393 | function crypto_pwhash_str_verify( |
| 394 | - string $hash, |
|
| 395 | - string $passwd |
|
| 394 | + string $hash, |
|
| 395 | + string $passwd |
|
| 396 | 396 | ): bool {} |
| 397 | 397 | |
| 398 | 398 | /** |
@@ -407,11 +407,11 @@ discard block |
||
| 407 | 407 | * @return string |
| 408 | 408 | */ |
| 409 | 409 | function crypto_pwhash_scryptsalsa208sha256( |
| 410 | - int $out_len, |
|
| 411 | - string $passwd, |
|
| 412 | - string $salt, |
|
| 413 | - int $opslimit, |
|
| 414 | - int $memlimit |
|
| 410 | + int $out_len, |
|
| 411 | + string $passwd, |
|
| 412 | + string $salt, |
|
| 413 | + int $opslimit, |
|
| 414 | + int $memlimit |
|
| 415 | 415 | ): string {} |
| 416 | 416 | |
| 417 | 417 | /** |
@@ -424,9 +424,9 @@ discard block |
||
| 424 | 424 | * @return string |
| 425 | 425 | */ |
| 426 | 426 | function crypto_pwhash_scryptsalsa208sha256_str( |
| 427 | - string $passwd, |
|
| 428 | - int $opslimit, |
|
| 429 | - int $memlimit |
|
| 427 | + string $passwd, |
|
| 428 | + int $opslimit, |
|
| 429 | + int $memlimit |
|
| 430 | 430 | ): string {} |
| 431 | 431 | |
| 432 | 432 | /** |
@@ -438,8 +438,8 @@ discard block |
||
| 438 | 438 | * @return bool |
| 439 | 439 | */ |
| 440 | 440 | function crypto_pwhash_scryptsalsa208sha256_str_verify( |
| 441 | - string $hash, |
|
| 442 | - string $passwd |
|
| 441 | + string $hash, |
|
| 442 | + string $passwd |
|
| 443 | 443 | ): bool {} |
| 444 | 444 | |
| 445 | 445 | /** |
@@ -451,8 +451,8 @@ discard block |
||
| 451 | 451 | * @return string |
| 452 | 452 | */ |
| 453 | 453 | function crypto_scalarmult( |
| 454 | - string $ecdhA, |
|
| 455 | - string $ecdhB |
|
| 454 | + string $ecdhA, |
|
| 455 | + string $ecdhB |
|
| 456 | 456 | ): string {} |
| 457 | 457 | |
| 458 | 458 | /** |
@@ -465,9 +465,9 @@ discard block |
||
| 465 | 465 | * @return string |
| 466 | 466 | */ |
| 467 | 467 | function crypto_secretbox( |
| 468 | - string $plaintext, |
|
| 469 | - string $nonce, |
|
| 470 | - string $key |
|
| 468 | + string $plaintext, |
|
| 469 | + string $nonce, |
|
| 470 | + string $key |
|
| 471 | 471 | ): string {} |
| 472 | 472 | |
| 473 | 473 | /** |
@@ -480,9 +480,9 @@ discard block |
||
| 480 | 480 | * @return string |
| 481 | 481 | */ |
| 482 | 482 | function crypto_secretbox_open( |
| 483 | - string $ciphertext, |
|
| 484 | - string $nonce, |
|
| 485 | - string $key |
|
| 483 | + string $ciphertext, |
|
| 484 | + string $nonce, |
|
| 485 | + string $key |
|
| 486 | 486 | ): string {} |
| 487 | 487 | |
| 488 | 488 | /** |
@@ -494,8 +494,8 @@ discard block |
||
| 494 | 494 | * @return string |
| 495 | 495 | */ |
| 496 | 496 | function crypto_shorthash( |
| 497 | - string $message, |
|
| 498 | - string $key |
|
| 497 | + string $message, |
|
| 498 | + string $key |
|
| 499 | 499 | ): string {} |
| 500 | 500 | |
| 501 | 501 | /** |
@@ -507,8 +507,8 @@ discard block |
||
| 507 | 507 | * @return string |
| 508 | 508 | */ |
| 509 | 509 | function crypto_sign( |
| 510 | - string $message, |
|
| 511 | - string $secretkey |
|
| 510 | + string $message, |
|
| 511 | + string $secretkey |
|
| 512 | 512 | ): string {} |
| 513 | 513 | |
| 514 | 514 | /** |
@@ -520,8 +520,8 @@ discard block |
||
| 520 | 520 | * @return string |
| 521 | 521 | */ |
| 522 | 522 | function crypto_sign_detached( |
| 523 | - string $message, |
|
| 524 | - string $secretkey |
|
| 523 | + string $message, |
|
| 524 | + string $secretkey |
|
| 525 | 525 | ): string {} |
| 526 | 526 | |
| 527 | 527 | /** |
@@ -531,7 +531,7 @@ discard block |
||
| 531 | 531 | * @return string |
| 532 | 532 | */ |
| 533 | 533 | function crypto_sign_ed25519_pk_to_curve25519( |
| 534 | - string $sign_pk |
|
| 534 | + string $sign_pk |
|
| 535 | 535 | ): string {} |
| 536 | 536 | |
| 537 | 537 | /** |
@@ -541,7 +541,7 @@ discard block |
||
| 541 | 541 | * @return string |
| 542 | 542 | */ |
| 543 | 543 | function crypto_sign_ed25519_sk_to_curve25519( |
| 544 | - string $sign_sk |
|
| 544 | + string $sign_sk |
|
| 545 | 545 | ): string {} |
| 546 | 546 | |
| 547 | 547 | /** |
@@ -559,8 +559,8 @@ discard block |
||
| 559 | 559 | * @return string |
| 560 | 560 | */ |
| 561 | 561 | function crypto_sign_keypair_from_secretkey_and_publickey( |
| 562 | - string $secretkey, |
|
| 563 | - string $publickey |
|
| 562 | + string $secretkey, |
|
| 563 | + string $publickey |
|
| 564 | 564 | ): string {} |
| 565 | 565 | |
| 566 | 566 | /** |
@@ -571,8 +571,8 @@ discard block |
||
| 571 | 571 | * @return string |
| 572 | 572 | */ |
| 573 | 573 | function crypto_sign_open( |
| 574 | - string $signed_message, |
|
| 575 | - string $publickey |
|
| 574 | + string $signed_message, |
|
| 575 | + string $publickey |
|
| 576 | 576 | ): string {} |
| 577 | 577 | |
| 578 | 578 | /** |
@@ -582,7 +582,7 @@ discard block |
||
| 582 | 582 | * @return string |
| 583 | 583 | */ |
| 584 | 584 | function crypto_sign_publickey( |
| 585 | - string $keypair |
|
| 585 | + string $keypair |
|
| 586 | 586 | ): string {} |
| 587 | 587 | |
| 588 | 588 | /** |
@@ -592,7 +592,7 @@ discard block |
||
| 592 | 592 | * @return string |
| 593 | 593 | */ |
| 594 | 594 | function crypto_sign_secretkey( |
| 595 | - string $keypair |
|
| 595 | + string $keypair |
|
| 596 | 596 | ): string {} |
| 597 | 597 | |
| 598 | 598 | /** |
@@ -602,7 +602,7 @@ discard block |
||
| 602 | 602 | * @return string |
| 603 | 603 | */ |
| 604 | 604 | function crypto_sign_publickey_from_secretkey( |
| 605 | - string $secretkey |
|
| 605 | + string $secretkey |
|
| 606 | 606 | ): string {} |
| 607 | 607 | |
| 608 | 608 | /** |
@@ -612,7 +612,7 @@ discard block |
||
| 612 | 612 | * @return string |
| 613 | 613 | */ |
| 614 | 614 | function crypto_sign_seed_keypair( |
| 615 | - string $seed |
|
| 615 | + string $seed |
|
| 616 | 616 | ): string {} |
| 617 | 617 | |
| 618 | 618 | /** |
@@ -624,9 +624,9 @@ discard block |
||
| 624 | 624 | * @return bool |
| 625 | 625 | */ |
| 626 | 626 | function crypto_sign_verify_detached( |
| 627 | - string $signature, |
|
| 628 | - string $msg, |
|
| 629 | - string $publickey |
|
| 627 | + string $signature, |
|
| 628 | + string $msg, |
|
| 629 | + string $publickey |
|
| 630 | 630 | ): bool {} |
| 631 | 631 | |
| 632 | 632 | /** |
@@ -639,9 +639,9 @@ discard block |
||
| 639 | 639 | * @return string |
| 640 | 640 | */ |
| 641 | 641 | function crypto_stream( |
| 642 | - int $length, |
|
| 643 | - string $nonce, |
|
| 644 | - string $key |
|
| 642 | + int $length, |
|
| 643 | + string $nonce, |
|
| 644 | + string $key |
|
| 645 | 645 | ): string {} |
| 646 | 646 | |
| 647 | 647 | /** |
@@ -654,9 +654,9 @@ discard block |
||
| 654 | 654 | * @return string |
| 655 | 655 | */ |
| 656 | 656 | function crypto_stream_xor( |
| 657 | - string $plaintext, |
|
| 658 | - string $nonce, |
|
| 659 | - string $key |
|
| 657 | + string $plaintext, |
|
| 658 | + string $nonce, |
|
| 659 | + string $key |
|
| 660 | 660 | ): string {} |
| 661 | 661 | |
| 662 | 662 | /** |
@@ -667,7 +667,7 @@ discard block |
||
| 667 | 667 | * @return string|false |
| 668 | 668 | */ |
| 669 | 669 | function randombytes_buf( |
| 670 | - int $length |
|
| 670 | + int $length |
|
| 671 | 671 | ): string {} |
| 672 | 672 | |
| 673 | 673 | /** |
@@ -686,7 +686,7 @@ discard block |
||
| 686 | 686 | * @return int |
| 687 | 687 | */ |
| 688 | 688 | function randombytes_uniform( |
| 689 | - int $upperBoundNonInclusive |
|
| 689 | + int $upperBoundNonInclusive |
|
| 690 | 690 | ): int {} |
| 691 | 691 | |
| 692 | 692 | /** |
@@ -696,7 +696,7 @@ discard block |
||
| 696 | 696 | * @return string |
| 697 | 697 | */ |
| 698 | 698 | function bin2hex( |
| 699 | - string $binary |
|
| 699 | + string $binary |
|
| 700 | 700 | ): string {} |
| 701 | 701 | |
| 702 | 702 | /** |
@@ -707,8 +707,8 @@ discard block |
||
| 707 | 707 | * @return int |
| 708 | 708 | */ |
| 709 | 709 | function compare( |
| 710 | - string $left, |
|
| 711 | - string $right |
|
| 710 | + string $left, |
|
| 711 | + string $right |
|
| 712 | 712 | ): int {} |
| 713 | 713 | |
| 714 | 714 | /** |
@@ -718,7 +718,7 @@ discard block |
||
| 718 | 718 | * @return string |
| 719 | 719 | */ |
| 720 | 720 | function hex2bin( |
| 721 | - string $hex |
|
| 721 | + string $hex |
|
| 722 | 722 | ): string {} |
| 723 | 723 | |
| 724 | 724 | /** |
@@ -728,7 +728,7 @@ discard block |
||
| 728 | 728 | * @return string |
| 729 | 729 | */ |
| 730 | 730 | function increment( |
| 731 | - string &$nonce |
|
| 731 | + string &$nonce |
|
| 732 | 732 | ) {} |
| 733 | 733 | |
| 734 | 734 | /** |
@@ -738,8 +738,8 @@ discard block |
||
| 738 | 738 | * @param string $right |
| 739 | 739 | */ |
| 740 | 740 | function add( |
| 741 | - string &$left, |
|
| 742 | - string $right |
|
| 741 | + string &$left, |
|
| 742 | + string $right |
|
| 743 | 743 | ) {} |
| 744 | 744 | |
| 745 | 745 | /** |
@@ -762,8 +762,8 @@ discard block |
||
| 762 | 762 | * @return int |
| 763 | 763 | */ |
| 764 | 764 | function memcmp( |
| 765 | - string $left, |
|
| 766 | - string $right |
|
| 765 | + string $left, |
|
| 766 | + string $right |
|
| 767 | 767 | ): int {} |
| 768 | 768 | |
| 769 | 769 | /** |
@@ -264,11 +264,11 @@ |
||
| 264 | 264 | */ |
| 265 | 265 | final class SysvMessageQueue |
| 266 | 266 | { |
| 267 | - /** |
|
| 268 | - * Cannot directly construct SysvMessageQueue, use msg_get_queue() instead |
|
| 269 | - * @see msg_get_queue() |
|
| 270 | - */ |
|
| 271 | - private function __construct() {} |
|
| 267 | + /** |
|
| 268 | + * Cannot directly construct SysvMessageQueue, use msg_get_queue() instead |
|
| 269 | + * @see msg_get_queue() |
|
| 270 | + */ |
|
| 271 | + private function __construct() {} |
|
| 272 | 272 | } |
| 273 | 273 | |
| 274 | 274 | // End of sysvmsg v. |
@@ -227,7 +227,7 @@ |
||
| 227 | 227 | * </tr> |
| 228 | 228 | * </table> |
| 229 | 229 | */ |
| 230 | -function msg_stat_queue(#[LanguageLevelTypeAware(["8.0" => "SysvMessageQueue"], default: "resource")] $queue): array|false {} |
|
| 230 | +function msg_stat_queue(#[LanguageLevelTypeAware(["8.0" => "SysvMessageQueue"], default: "resource")] $queue): array | false {} |
|
| 231 | 231 | |
| 232 | 232 | /** |
| 233 | 233 | * Set information in the message queue data structure |
@@ -262,8 +262,7 @@ |
||
| 262 | 262 | /** |
| 263 | 263 | * @since 8.0 |
| 264 | 264 | */ |
| 265 | -final class SysvMessageQueue |
|
| 266 | -{ |
|
| 265 | +final class SysvMessageQueue { |
|
| 267 | 266 | /** |
| 268 | 267 | * Cannot directly construct SysvMessageQueue, use msg_get_queue() instead |
| 269 | 268 | * @see msg_get_queue() |
@@ -4,91 +4,91 @@ discard block |
||
| 4 | 4 | |
| 5 | 5 | class ZendAPI_Queue |
| 6 | 6 | { |
| 7 | - public $_jobqueue_url; |
|
| 8 | - |
|
| 9 | - /** |
|
| 10 | - * Constructor for a job queue connection |
|
| 11 | - * |
|
| 12 | - * @param string $queue_url Full address where the queue is in the form host:port |
|
| 13 | - * @return ZendAPI_Queue |
|
| 14 | - * |
|
| 15 | - * @removed 8.0 |
|
| 16 | - */ |
|
| 17 | - public function zendapi_queue($queue_url) {} |
|
| 18 | - |
|
| 19 | - /** |
|
| 20 | - * Open a connection to a job queue |
|
| 21 | - * |
|
| 22 | - * @param string $password For authentication, password must be specified to connect to a queue |
|
| 23 | - * @param int $application_id Optional, if set, all subsequent calls to job related methods will use this application id (unless explicitly specified otherwise). I.e. When adding new job, |
|
| 7 | + public $_jobqueue_url; |
|
| 8 | + |
|
| 9 | + /** |
|
| 10 | + * Constructor for a job queue connection |
|
| 11 | + * |
|
| 12 | + * @param string $queue_url Full address where the queue is in the form host:port |
|
| 13 | + * @return ZendAPI_Queue |
|
| 14 | + * |
|
| 15 | + * @removed 8.0 |
|
| 16 | + */ |
|
| 17 | + public function zendapi_queue($queue_url) {} |
|
| 18 | + |
|
| 19 | + /** |
|
| 20 | + * Open a connection to a job queue |
|
| 21 | + * |
|
| 22 | + * @param string $password For authentication, password must be specified to connect to a queue |
|
| 23 | + * @param int $application_id Optional, if set, all subsequent calls to job related methods will use this application id (unless explicitly specified otherwise). I.e. When adding new job, |
|
| 24 | 24 | unless this job already set an application id, the job will be assigned the queue application id |
| 25 | - * @return bool Success |
|
| 26 | - */ |
|
| 27 | - public function login($password, $application_id = null) {} |
|
| 25 | + * @return bool Success |
|
| 26 | + */ |
|
| 27 | + public function login($password, $application_id = null) {} |
|
| 28 | 28 | |
| 29 | - /** |
|
| 30 | - * Insert a new job to the queue, the Job is passed by reference because |
|
| 29 | + /** |
|
| 30 | + * Insert a new job to the queue, the Job is passed by reference because |
|
| 31 | 31 | its new job ID and status will be set in the Job object |
| 32 | - * If the returned job id is 0 it means the job could be added to the queue |
|
| 33 | - * |
|
| 34 | - * @param Job $job The Job we want to insert to the queue (by ref.) |
|
| 35 | - * @return int The inserted job id |
|
| 36 | - */ |
|
| 37 | - public function addJob($job) {} |
|
| 38 | - |
|
| 39 | - /** |
|
| 40 | - * Return a Job object that describing a job in the queue |
|
| 41 | - * |
|
| 42 | - * @param int $job_id The job id |
|
| 43 | - * @return Job Object describing a job in the queue |
|
| 44 | - */ |
|
| 45 | - public function getJob($job_id) {} |
|
| 46 | - |
|
| 47 | - /** |
|
| 48 | - * Update an existing job in the queue with it's new properties. If job doesn't exists, |
|
| 32 | + * If the returned job id is 0 it means the job could be added to the queue |
|
| 33 | + * |
|
| 34 | + * @param Job $job The Job we want to insert to the queue (by ref.) |
|
| 35 | + * @return int The inserted job id |
|
| 36 | + */ |
|
| 37 | + public function addJob($job) {} |
|
| 38 | + |
|
| 39 | + /** |
|
| 40 | + * Return a Job object that describing a job in the queue |
|
| 41 | + * |
|
| 42 | + * @param int $job_id The job id |
|
| 43 | + * @return Job Object describing a job in the queue |
|
| 44 | + */ |
|
| 45 | + public function getJob($job_id) {} |
|
| 46 | + |
|
| 47 | + /** |
|
| 48 | + * Update an existing job in the queue with it's new properties. If job doesn't exists, |
|
| 49 | 49 | a new job will be added. Job is passed by reference and it's updated from the queue. |
| 50 | - * |
|
| 51 | - * @param Job $job The Job object, the ID of the given job is the id of the job we try to update. |
|
| 50 | + * |
|
| 51 | + * @param Job $job The Job object, the ID of the given job is the id of the job we try to update. |
|
| 52 | 52 | If the given Job doesn't have an assigned ID, a new job will be added |
| 53 | - * @return int The id of the updated job |
|
| 54 | - */ |
|
| 55 | - public function updateJob($job) {} |
|
| 56 | - |
|
| 57 | - /** |
|
| 58 | - * Remove a job from the queue |
|
| 59 | - * |
|
| 60 | - * @param int|int[] $job_id The job id or array of job ids we want to remove from the queue |
|
| 61 | - * @return bool Success/Failure |
|
| 62 | - */ |
|
| 63 | - public function removeJob($job_id) {} |
|
| 64 | - |
|
| 65 | - /** |
|
| 66 | - * Suspend a job in the queue (without removing it) |
|
| 67 | - * |
|
| 68 | - * @param int|int[] $job_id The job id or array of job ids we want to suspend |
|
| 69 | - * @return bool Success/Failure |
|
| 70 | - */ |
|
| 71 | - public function suspendJob($job_id) {} |
|
| 72 | - |
|
| 73 | - /** |
|
| 74 | - * Resume a suspended job in the queue |
|
| 75 | - * |
|
| 76 | - * @param int|int[] $job_id The job id or array of job ids we want to resume |
|
| 77 | - * @return bool Success/Failure (if the job wasn't suspended, the function will return false) |
|
| 78 | - */ |
|
| 79 | - public function resumeJob($job_id) {} |
|
| 80 | - |
|
| 81 | - /** |
|
| 82 | - * Requeue failed job back to the queue. |
|
| 83 | - * |
|
| 84 | - * @param Job $job job object to re-query |
|
| 85 | - * @return bool - true or false. |
|
| 86 | - */ |
|
| 87 | - public function requeueJob($job) {} |
|
| 88 | - |
|
| 89 | - /** |
|
| 90 | - * returns job statistics |
|
| 91 | - * @return array with the following: |
|
| 53 | + * @return int The id of the updated job |
|
| 54 | + */ |
|
| 55 | + public function updateJob($job) {} |
|
| 56 | + |
|
| 57 | + /** |
|
| 58 | + * Remove a job from the queue |
|
| 59 | + * |
|
| 60 | + * @param int|int[] $job_id The job id or array of job ids we want to remove from the queue |
|
| 61 | + * @return bool Success/Failure |
|
| 62 | + */ |
|
| 63 | + public function removeJob($job_id) {} |
|
| 64 | + |
|
| 65 | + /** |
|
| 66 | + * Suspend a job in the queue (without removing it) |
|
| 67 | + * |
|
| 68 | + * @param int|int[] $job_id The job id or array of job ids we want to suspend |
|
| 69 | + * @return bool Success/Failure |
|
| 70 | + */ |
|
| 71 | + public function suspendJob($job_id) {} |
|
| 72 | + |
|
| 73 | + /** |
|
| 74 | + * Resume a suspended job in the queue |
|
| 75 | + * |
|
| 76 | + * @param int|int[] $job_id The job id or array of job ids we want to resume |
|
| 77 | + * @return bool Success/Failure (if the job wasn't suspended, the function will return false) |
|
| 78 | + */ |
|
| 79 | + public function resumeJob($job_id) {} |
|
| 80 | + |
|
| 81 | + /** |
|
| 82 | + * Requeue failed job back to the queue. |
|
| 83 | + * |
|
| 84 | + * @param Job $job job object to re-query |
|
| 85 | + * @return bool - true or false. |
|
| 86 | + */ |
|
| 87 | + public function requeueJob($job) {} |
|
| 88 | + |
|
| 89 | + /** |
|
| 90 | + * returns job statistics |
|
| 91 | + * @return array with the following: |
|
| 92 | 92 | "total_complete_jobs" |
| 93 | 93 | "total_incomplete_jobs" |
| 94 | 94 | "average_time_in_queue" [msec] |
@@ -96,96 +96,96 @@ discard block |
||
| 96 | 96 | "added_jobs_in_window" |
| 97 | 97 | "activated_jobs_in_window" |
| 98 | 98 | "completed_jobs_in_window" |
| 99 | - * moving window size can be set through ini file |
|
| 100 | - */ |
|
| 101 | - public function getStatistics() {} |
|
| 102 | - |
|
| 103 | - /** |
|
| 104 | - * Returns whether a script exists in the document root |
|
| 105 | - * @param string $path relative script path |
|
| 106 | - * @return bool - TRUE if script exists in the document root FALSE otherwise |
|
| 107 | - */ |
|
| 108 | - public function isScriptExists($path) {} |
|
| 109 | - |
|
| 110 | - /** |
|
| 111 | - * Returns whether the queue is suspended |
|
| 112 | - * @return bool - TRUE if job is suspended FALSE otherwise |
|
| 113 | - */ |
|
| 114 | - public function isSuspend() {} |
|
| 115 | - |
|
| 116 | - /** |
|
| 117 | - * Return a list of jobs in the queue according to the options given in the filter_options parameter, doesn't return jobs in "final states" (failed, complete) |
|
| 118 | - * If application id is set for this queue, only jobs with this application id will be returned |
|
| 119 | - * |
|
| 120 | - * @param array $filter_options Array of optional filter options to filter the jobs we want to get |
|
| 99 | + * moving window size can be set through ini file |
|
| 100 | + */ |
|
| 101 | + public function getStatistics() {} |
|
| 102 | + |
|
| 103 | + /** |
|
| 104 | + * Returns whether a script exists in the document root |
|
| 105 | + * @param string $path relative script path |
|
| 106 | + * @return bool - TRUE if script exists in the document root FALSE otherwise |
|
| 107 | + */ |
|
| 108 | + public function isScriptExists($path) {} |
|
| 109 | + |
|
| 110 | + /** |
|
| 111 | + * Returns whether the queue is suspended |
|
| 112 | + * @return bool - TRUE if job is suspended FALSE otherwise |
|
| 113 | + */ |
|
| 114 | + public function isSuspend() {} |
|
| 115 | + |
|
| 116 | + /** |
|
| 117 | + * Return a list of jobs in the queue according to the options given in the filter_options parameter, doesn't return jobs in "final states" (failed, complete) |
|
| 118 | + * If application id is set for this queue, only jobs with this application id will be returned |
|
| 119 | + * |
|
| 120 | + * @param array $filter_options Array of optional filter options to filter the jobs we want to get |
|
| 121 | 121 | from the queue. If not set, all jobs will be returned.<br> |
| 122 | - * Options can be: priority, application_id, name, status, recurring. |
|
| 123 | - * @param int $max_jobs Maximum jobs to retrieve. Default is -1, getting all jobs available. |
|
| 124 | - * @param bool $with_globals_and_output Whether gets the global variables dataand job output. |
|
| 125 | - * Default is false. |
|
| 126 | - * @return array Jobs that satisfies filter_options. |
|
| 127 | - */ |
|
| 128 | - public function getJobsInQueue($filter_options = null, $max_jobs = -1, $with_globals_and_output = false) {} |
|
| 129 | - |
|
| 130 | - /** |
|
| 131 | - * Return the number of jobs in the queue according to the options given in the filter_options parameter |
|
| 132 | - * @param array $filter_options Array of optional filter options to filter the jobs we want to get from the queue. If not set, all jobs will be counted.<br> |
|
| 133 | - * Options can be: priority, application_id, host, name, status, recurring. |
|
| 134 | - * @return int Number of jobs that satisfy filter_options. |
|
| 135 | - */ |
|
| 136 | - public function getNumOfJobsInQueue($filter_options = null) {} |
|
| 137 | - |
|
| 138 | - /** |
|
| 139 | - * Return all the hosts that jobs were submitted from. |
|
| 140 | - * @return array |
|
| 141 | - */ |
|
| 142 | - public function getAllhosts() {} |
|
| 143 | - |
|
| 144 | - /** |
|
| 145 | - * Return all the application ids exists in queue. |
|
| 146 | - * @return array |
|
| 147 | - */ |
|
| 148 | - public function getAllApplicationIDs() {} |
|
| 149 | - |
|
| 150 | - /** |
|
| 151 | - * Return finished jobs (either failed or successed) between time range allowing paging. |
|
| 152 | - * Jobs are sorted by job id descending. |
|
| 153 | - * |
|
| 154 | - * @param int $status Filter to jobs by status, 1-success, 0-failed either logical or execution. |
|
| 155 | - * @param int $start_time UNIX timestamp. Get only jobs finished after $start_time. |
|
| 156 | - * @param int $end_time UNIX timestamp. Get only jobs finished before $end_time. |
|
| 157 | - * @param int $index Get jobs starting from the $index-th place. |
|
| 158 | - * @param int $count Get only $count jobs. |
|
| 159 | - * @param int &$total Pass by reference. Return the total number of jobs statisifed the query criteria. |
|
| 160 | - * |
|
| 161 | - * @return array of jobs. |
|
| 162 | - */ |
|
| 163 | - public function getHistoricJobs($status, $start_time, $end_time, $index, $count, &$total) {} |
|
| 164 | - |
|
| 165 | - /** |
|
| 166 | - * Suspends queue operation |
|
| 167 | - * @return bool - TRUE if successful FALSE otherwise |
|
| 168 | - */ |
|
| 169 | - public function suspendQueue() {} |
|
| 170 | - |
|
| 171 | - /** |
|
| 172 | - * Resumes queue operation |
|
| 173 | - * @return bool - TRUE if successful FALSE otherwise |
|
| 174 | - */ |
|
| 175 | - public function resumeQueue() {} |
|
| 176 | - |
|
| 177 | - /** |
|
| 178 | - * Return description of the last error occurred in the queue object. After every |
|
| 179 | - * method invoked an error string describing the error is store in the queue object. |
|
| 180 | - * @return string |
|
| 181 | - */ |
|
| 182 | - public function getLastError() {} |
|
| 183 | - |
|
| 184 | - /** |
|
| 185 | - * Sets a new maximum time for keeping historic jobs |
|
| 186 | - * @return bool - TRUE if successful FALSE otherwise |
|
| 187 | - */ |
|
| 188 | - public function setMaxHistoryTime() {} |
|
| 122 | + * Options can be: priority, application_id, name, status, recurring. |
|
| 123 | + * @param int $max_jobs Maximum jobs to retrieve. Default is -1, getting all jobs available. |
|
| 124 | + * @param bool $with_globals_and_output Whether gets the global variables dataand job output. |
|
| 125 | + * Default is false. |
|
| 126 | + * @return array Jobs that satisfies filter_options. |
|
| 127 | + */ |
|
| 128 | + public function getJobsInQueue($filter_options = null, $max_jobs = -1, $with_globals_and_output = false) {} |
|
| 129 | + |
|
| 130 | + /** |
|
| 131 | + * Return the number of jobs in the queue according to the options given in the filter_options parameter |
|
| 132 | + * @param array $filter_options Array of optional filter options to filter the jobs we want to get from the queue. If not set, all jobs will be counted.<br> |
|
| 133 | + * Options can be: priority, application_id, host, name, status, recurring. |
|
| 134 | + * @return int Number of jobs that satisfy filter_options. |
|
| 135 | + */ |
|
| 136 | + public function getNumOfJobsInQueue($filter_options = null) {} |
|
| 137 | + |
|
| 138 | + /** |
|
| 139 | + * Return all the hosts that jobs were submitted from. |
|
| 140 | + * @return array |
|
| 141 | + */ |
|
| 142 | + public function getAllhosts() {} |
|
| 143 | + |
|
| 144 | + /** |
|
| 145 | + * Return all the application ids exists in queue. |
|
| 146 | + * @return array |
|
| 147 | + */ |
|
| 148 | + public function getAllApplicationIDs() {} |
|
| 149 | + |
|
| 150 | + /** |
|
| 151 | + * Return finished jobs (either failed or successed) between time range allowing paging. |
|
| 152 | + * Jobs are sorted by job id descending. |
|
| 153 | + * |
|
| 154 | + * @param int $status Filter to jobs by status, 1-success, 0-failed either logical or execution. |
|
| 155 | + * @param int $start_time UNIX timestamp. Get only jobs finished after $start_time. |
|
| 156 | + * @param int $end_time UNIX timestamp. Get only jobs finished before $end_time. |
|
| 157 | + * @param int $index Get jobs starting from the $index-th place. |
|
| 158 | + * @param int $count Get only $count jobs. |
|
| 159 | + * @param int &$total Pass by reference. Return the total number of jobs statisifed the query criteria. |
|
| 160 | + * |
|
| 161 | + * @return array of jobs. |
|
| 162 | + */ |
|
| 163 | + public function getHistoricJobs($status, $start_time, $end_time, $index, $count, &$total) {} |
|
| 164 | + |
|
| 165 | + /** |
|
| 166 | + * Suspends queue operation |
|
| 167 | + * @return bool - TRUE if successful FALSE otherwise |
|
| 168 | + */ |
|
| 169 | + public function suspendQueue() {} |
|
| 170 | + |
|
| 171 | + /** |
|
| 172 | + * Resumes queue operation |
|
| 173 | + * @return bool - TRUE if successful FALSE otherwise |
|
| 174 | + */ |
|
| 175 | + public function resumeQueue() {} |
|
| 176 | + |
|
| 177 | + /** |
|
| 178 | + * Return description of the last error occurred in the queue object. After every |
|
| 179 | + * method invoked an error string describing the error is store in the queue object. |
|
| 180 | + * @return string |
|
| 181 | + */ |
|
| 182 | + public function getLastError() {} |
|
| 183 | + |
|
| 184 | + /** |
|
| 185 | + * Sets a new maximum time for keeping historic jobs |
|
| 186 | + * @return bool - TRUE if successful FALSE otherwise |
|
| 187 | + */ |
|
| 188 | + public function setMaxHistoryTime() {} |
|
| 189 | 189 | } |
| 190 | 190 | |
| 191 | 191 | /** |
@@ -196,237 +196,237 @@ discard block |
||
| 196 | 196 | */ |
| 197 | 197 | class ZendAPI_Job |
| 198 | 198 | { |
| 199 | - /** |
|
| 200 | - * Unique id of the Job in the job queue |
|
| 201 | - * |
|
| 202 | - * @var int |
|
| 203 | - */ |
|
| 204 | - public $_id; |
|
| 205 | - |
|
| 206 | - /** |
|
| 207 | - * Full path of the script that this job calls when it's processed |
|
| 208 | - * |
|
| 209 | - * @var string |
|
| 210 | - */ |
|
| 211 | - public $_script; |
|
| 212 | - |
|
| 213 | - /** |
|
| 214 | - * The host that the job was submit from |
|
| 215 | - * |
|
| 216 | - * @var string |
|
| 217 | - */ |
|
| 218 | - public $_host; |
|
| 219 | - |
|
| 220 | - /** |
|
| 221 | - * A short string describing the job |
|
| 222 | - * |
|
| 223 | - * @var string |
|
| 224 | - */ |
|
| 225 | - public $_name; |
|
| 226 | - |
|
| 227 | - /** |
|
| 228 | - * The job output after executing |
|
| 229 | - * |
|
| 230 | - * @var string |
|
| 231 | - */ |
|
| 232 | - public $_output; |
|
| 233 | - |
|
| 234 | - /** |
|
| 235 | - * The status of the job |
|
| 236 | - * By default, the job status is waiting to being execute. |
|
| 237 | - * The status is determent by the queue and can not be modify by the user. |
|
| 238 | - * |
|
| 239 | - * @var int |
|
| 240 | - */ |
|
| 241 | - public $_status = JOB_QUEUE_STATUS_WAITING; |
|
| 242 | - |
|
| 243 | - /** |
|
| 244 | - * The application id of the job |
|
| 245 | - * If the application id is not set, this job may get an application id automatically from the queue |
|
| 246 | - * (if the queue was assigned one). By default it is null (which indicates no application id is assigned) |
|
| 247 | - * |
|
| 248 | - * @var string |
|
| 249 | - */ |
|
| 250 | - public $_application_id = null; |
|
| 251 | - |
|
| 252 | - /** |
|
| 253 | - * The priority of the job, options are the priority constants |
|
| 254 | - * By default the priority is set to normal (JOB_QUEUE_PRIORITY_NORMAL) |
|
| 255 | - * |
|
| 256 | - * @var int |
|
| 257 | - */ |
|
| 258 | - public $_priority = JOB_QUEUE_PRIORITY_NORMAL; |
|
| 259 | - |
|
| 260 | - /** |
|
| 261 | - * Array holding all the variables that the user wants the job's script to have when it's called |
|
| 262 | - * The structure is variable_name => variable_value |
|
| 199 | + /** |
|
| 200 | + * Unique id of the Job in the job queue |
|
| 201 | + * |
|
| 202 | + * @var int |
|
| 203 | + */ |
|
| 204 | + public $_id; |
|
| 205 | + |
|
| 206 | + /** |
|
| 207 | + * Full path of the script that this job calls when it's processed |
|
| 208 | + * |
|
| 209 | + * @var string |
|
| 210 | + */ |
|
| 211 | + public $_script; |
|
| 212 | + |
|
| 213 | + /** |
|
| 214 | + * The host that the job was submit from |
|
| 215 | + * |
|
| 216 | + * @var string |
|
| 217 | + */ |
|
| 218 | + public $_host; |
|
| 219 | + |
|
| 220 | + /** |
|
| 221 | + * A short string describing the job |
|
| 222 | + * |
|
| 223 | + * @var string |
|
| 224 | + */ |
|
| 225 | + public $_name; |
|
| 226 | + |
|
| 227 | + /** |
|
| 228 | + * The job output after executing |
|
| 229 | + * |
|
| 230 | + * @var string |
|
| 231 | + */ |
|
| 232 | + public $_output; |
|
| 233 | + |
|
| 234 | + /** |
|
| 235 | + * The status of the job |
|
| 236 | + * By default, the job status is waiting to being execute. |
|
| 237 | + * The status is determent by the queue and can not be modify by the user. |
|
| 238 | + * |
|
| 239 | + * @var int |
|
| 240 | + */ |
|
| 241 | + public $_status = JOB_QUEUE_STATUS_WAITING; |
|
| 242 | + |
|
| 243 | + /** |
|
| 244 | + * The application id of the job |
|
| 245 | + * If the application id is not set, this job may get an application id automatically from the queue |
|
| 246 | + * (if the queue was assigned one). By default it is null (which indicates no application id is assigned) |
|
| 247 | + * |
|
| 248 | + * @var string |
|
| 249 | + */ |
|
| 250 | + public $_application_id = null; |
|
| 251 | + |
|
| 252 | + /** |
|
| 253 | + * The priority of the job, options are the priority constants |
|
| 254 | + * By default the priority is set to normal (JOB_QUEUE_PRIORITY_NORMAL) |
|
| 255 | + * |
|
| 256 | + * @var int |
|
| 257 | + */ |
|
| 258 | + public $_priority = JOB_QUEUE_PRIORITY_NORMAL; |
|
| 259 | + |
|
| 260 | + /** |
|
| 261 | + * Array holding all the variables that the user wants the job's script to have when it's called |
|
| 262 | + * The structure is variable_name => variable_value |
|
| 263 | 263 | i.e. if the user_variables array is array('my_var' => 8), when the script is called, |
| 264 | 264 | a global variable called $my_var will have the int value of 8 |
| 265 | - * By default there are no variables that we want to add to the job's script |
|
| 266 | - * |
|
| 267 | - * @var array |
|
| 268 | - */ |
|
| 269 | - public $_user_variables = []; |
|
| 270 | - |
|
| 271 | - /** |
|
| 272 | - * Bit mask holding the global variables that the user want the job's script to have when it's called |
|
| 273 | - * Options are prefixed with "JOB_QUEUE_SAVE_" and may be: |
|
| 265 | + * By default there are no variables that we want to add to the job's script |
|
| 266 | + * |
|
| 267 | + * @var array |
|
| 268 | + */ |
|
| 269 | + public $_user_variables = []; |
|
| 270 | + |
|
| 271 | + /** |
|
| 272 | + * Bit mask holding the global variables that the user want the job's script to have when it's called |
|
| 273 | + * Options are prefixed with "JOB_QUEUE_SAVE_" and may be: |
|
| 274 | 274 | POST|GET|COOKIE|SESSION|RAW_POST|SERVER|FILES|ENV |
| 275 | - * By default there are no global variables we want to add to the job's script |
|
| 276 | - * i.e. In order to save the current GET and COOKIE global variables, |
|
| 275 | + * By default there are no global variables we want to add to the job's script |
|
| 276 | + * i.e. In order to save the current GET and COOKIE global variables, |
|
| 277 | 277 | this property should be JOB_QUEUE_SAVE_GET|JOB_QUEUE_SAVE_COOKIE (or the integer 6) |
| 278 | 278 | In that case (of GET and COOKIE), when the job is added, the current $_GET and |
| 279 | 279 | $_COOKIE variables should be saved, and when the job's script is called, |
| 280 | 280 | those global variables should be populated |
| 281 | - * |
|
| 282 | - * @var int |
|
| 283 | - */ |
|
| 284 | - public $_global_variables = 0; |
|
| 285 | - |
|
| 286 | - /** |
|
| 287 | - * The job may have a dependency (another job that must be performed before this job) |
|
| 288 | - * This property hold the id of the job that must be performed. if this variable is an array of integers, |
|
| 281 | + * |
|
| 282 | + * @var int |
|
| 283 | + */ |
|
| 284 | + public $_global_variables = 0; |
|
| 285 | + |
|
| 286 | + /** |
|
| 287 | + * The job may have a dependency (another job that must be performed before this job) |
|
| 288 | + * This property hold the id of the job that must be performed. if this variable is an array of integers, |
|
| 289 | 289 | it means that there are several jobs that must be performed before this job |
| 290 | - * By default there are no dependencies |
|
| 291 | - * |
|
| 292 | - * @var mixed (int|array) |
|
| 293 | - */ |
|
| 294 | - public $_predecessor = null; |
|
| 295 | - |
|
| 296 | - /** |
|
| 297 | - * The time that this job should be performed, this variables is the UNIX timestamp. |
|
| 298 | - * If set to 0, it means that the job should be performed now (or at least as soon as possible) |
|
| 299 | - * By default there is no scheduled time, which means we want to perform the job as soon as possible |
|
| 300 | - * |
|
| 301 | - * @var int |
|
| 302 | - */ |
|
| 303 | - public $_scheduled_time = 0; |
|
| 304 | - |
|
| 305 | - /** |
|
| 306 | - * The job running frequency in seconds. The job should run every _internal seconds |
|
| 307 | - * This property applys only to recurrent job. |
|
| 308 | - * By default, its value is 0 e.g. run it only once. |
|
| 309 | - * |
|
| 310 | - * @var int |
|
| 311 | - */ |
|
| 312 | - public $_interval = 0; |
|
| 313 | - |
|
| 314 | - /** |
|
| 315 | - * UNIX timestamp that it's the last time this job should occurs. If _interval was set, and _end_time |
|
| 316 | - * was not, then this job will run forever. |
|
| 317 | - * By default there is no end_time, so recurrent job will run forever. If the job is not recurrent |
|
| 318 | - * (occurs only once) then the job will run at most once. If end_time has reached and the job was not |
|
| 319 | - * execute yet, it will not run. |
|
| 320 | - * |
|
| 321 | - * @var int |
|
| 322 | - */ |
|
| 323 | - public $_end_time = null; |
|
| 324 | - |
|
| 325 | - /** |
|
| 326 | - * A bit that determine whether job can be deleted from history. When set, removeJob will not |
|
| 327 | - * delete the job from history. |
|
| 328 | - * |
|
| 329 | - * @var int |
|
| 330 | - */ |
|
| 331 | - public $_preserved = 0; |
|
| 332 | - |
|
| 333 | - /** |
|
| 334 | - * Instantiate a Job object, describe all the information and properties of a job |
|
| 335 | - * |
|
| 336 | - * @param string $script relative path (relative to document root supplied in ini file) of the script this job should call when it's executing |
|
| 337 | - * @return Job |
|
| 338 | - * |
|
| 339 | - * @removed 8.0 |
|
| 340 | - */ |
|
| 341 | - public function ZendAPI_Job($script) {} |
|
| 342 | - |
|
| 343 | - /** |
|
| 344 | - * Add the job the the specified queue (without instantiating a JobQueue object) |
|
| 345 | - * This function should be used for extreme simplicity of the user when adding a single job, |
|
| 290 | + * By default there are no dependencies |
|
| 291 | + * |
|
| 292 | + * @var mixed (int|array) |
|
| 293 | + */ |
|
| 294 | + public $_predecessor = null; |
|
| 295 | + |
|
| 296 | + /** |
|
| 297 | + * The time that this job should be performed, this variables is the UNIX timestamp. |
|
| 298 | + * If set to 0, it means that the job should be performed now (or at least as soon as possible) |
|
| 299 | + * By default there is no scheduled time, which means we want to perform the job as soon as possible |
|
| 300 | + * |
|
| 301 | + * @var int |
|
| 302 | + */ |
|
| 303 | + public $_scheduled_time = 0; |
|
| 304 | + |
|
| 305 | + /** |
|
| 306 | + * The job running frequency in seconds. The job should run every _internal seconds |
|
| 307 | + * This property applys only to recurrent job. |
|
| 308 | + * By default, its value is 0 e.g. run it only once. |
|
| 309 | + * |
|
| 310 | + * @var int |
|
| 311 | + */ |
|
| 312 | + public $_interval = 0; |
|
| 313 | + |
|
| 314 | + /** |
|
| 315 | + * UNIX timestamp that it's the last time this job should occurs. If _interval was set, and _end_time |
|
| 316 | + * was not, then this job will run forever. |
|
| 317 | + * By default there is no end_time, so recurrent job will run forever. If the job is not recurrent |
|
| 318 | + * (occurs only once) then the job will run at most once. If end_time has reached and the job was not |
|
| 319 | + * execute yet, it will not run. |
|
| 320 | + * |
|
| 321 | + * @var int |
|
| 322 | + */ |
|
| 323 | + public $_end_time = null; |
|
| 324 | + |
|
| 325 | + /** |
|
| 326 | + * A bit that determine whether job can be deleted from history. When set, removeJob will not |
|
| 327 | + * delete the job from history. |
|
| 328 | + * |
|
| 329 | + * @var int |
|
| 330 | + */ |
|
| 331 | + public $_preserved = 0; |
|
| 332 | + |
|
| 333 | + /** |
|
| 334 | + * Instantiate a Job object, describe all the information and properties of a job |
|
| 335 | + * |
|
| 336 | + * @param string $script relative path (relative to document root supplied in ini file) of the script this job should call when it's executing |
|
| 337 | + * @return Job |
|
| 338 | + * |
|
| 339 | + * @removed 8.0 |
|
| 340 | + */ |
|
| 341 | + public function ZendAPI_Job($script) {} |
|
| 342 | + |
|
| 343 | + /** |
|
| 344 | + * Add the job the the specified queue (without instantiating a JobQueue object) |
|
| 345 | + * This function should be used for extreme simplicity of the user when adding a single job, |
|
| 346 | 346 | when the user want to insert more than one job and/or manipulating other jobs (or job tasks) |
| 347 | 347 | he should create and use the JobQueue object |
| 348 | - * Actually what this function do is to create a new JobQueue, login to it (with the given parameters), |
|
| 348 | + * Actually what this function do is to create a new JobQueue, login to it (with the given parameters), |
|
| 349 | 349 | add this job to it and logout |
| 350 | - * |
|
| 351 | - * @param string $jobqueue_url Full address of the queue we want to connect to |
|
| 352 | - * @param string $password For authentication, the queue password |
|
| 353 | - * @return int|false The added job id or false on failure |
|
| 354 | - */ |
|
| 355 | - public function addJobToQueue($jobqueue_url, $password) {} |
|
| 356 | - |
|
| 357 | - /** |
|
| 358 | - * Set a new priority to the job |
|
| 359 | - * |
|
| 360 | - * @param int $priority Priority options are constants with the "JOB_QUEUE_PRIORITY_" prefix |
|
| 361 | - */ |
|
| 362 | - public function setJobPriority($priority) {} |
|
| 363 | - |
|
| 364 | - // All properties SET functions |
|
| 365 | - public function setJobName($name) {} |
|
| 366 | - public function setScript($script) {} |
|
| 367 | - public function setApplicationID($app_id) {} |
|
| 368 | - public function setUserVariables($vars) {} |
|
| 369 | - public function setGlobalVariables($vars) {} |
|
| 370 | - public function setJobDependency($job_id) {} |
|
| 371 | - public function setScheduledTime($timestamp) {} |
|
| 372 | - public function setRecurrenceData($interval, $end_time = null) {} |
|
| 373 | - public function setPreserved($preserved) {} |
|
| 374 | - |
|
| 375 | - /** |
|
| 376 | - * Get the job properties |
|
| 377 | - * |
|
| 378 | - * @return array The same format of job options array as in the Job constructor |
|
| 379 | - */ |
|
| 380 | - public function getProperties() {} |
|
| 381 | - |
|
| 382 | - /** |
|
| 383 | - * Get the job output |
|
| 384 | - * |
|
| 385 | - * @return mixed An HTML representing the job output |
|
| 386 | - */ |
|
| 387 | - public function getOutput() {} |
|
| 388 | - |
|
| 389 | - // All properties GET functions |
|
| 390 | - public function getID() {} |
|
| 391 | - public function getHost() {} |
|
| 392 | - public function getScript() {} |
|
| 393 | - public function getJobPriority() {} |
|
| 394 | - public function getJobName() {} |
|
| 395 | - public function getApplicationID() {} |
|
| 396 | - public function getUserVariables() {} |
|
| 397 | - public function getGlobalVariables() {} |
|
| 398 | - public function getJobDependency() {} |
|
| 399 | - public function getScheduledTime() {} |
|
| 400 | - public function getInterval() {} |
|
| 401 | - public function getEndTime() {} |
|
| 402 | - public function getPreserved() {} |
|
| 403 | - |
|
| 404 | - /** |
|
| 405 | - * Get the current status of the job |
|
| 406 | - * If this job was created and not returned from a queue (using the JobQueue::GetJob() function), |
|
| 407 | - * the function will return false |
|
| 408 | - * The status is one of the constants with the "JOB_QUEUE_STATUS_" prefix. |
|
| 409 | - * E.g. job was performed and failed, job is waiting etc. |
|
| 410 | - * |
|
| 411 | - * @return int|false |
|
| 412 | - */ |
|
| 413 | - public function getJobStatus() {} |
|
| 414 | - |
|
| 415 | - /** |
|
| 416 | - * Get how much seconds there are until the next time the job will run. |
|
| 417 | - * If the job is not recurrence or it past its end time, then return 0. |
|
| 418 | - * |
|
| 419 | - * @return int |
|
| 420 | - */ |
|
| 421 | - public function getTimeToNextRepeat() {} |
|
| 422 | - |
|
| 423 | - /** |
|
| 424 | - * For recurring job get the status of the last execution. For simple job, |
|
| 425 | - * getLastPerformedStatus is equivalent to getJobStatus. |
|
| 426 | - * jobs that haven't been executed yet will return STATUS_WAITING |
|
| 427 | - * @return int |
|
| 428 | - */ |
|
| 429 | - public function getLastPerformedStatus() {} |
|
| 350 | + * |
|
| 351 | + * @param string $jobqueue_url Full address of the queue we want to connect to |
|
| 352 | + * @param string $password For authentication, the queue password |
|
| 353 | + * @return int|false The added job id or false on failure |
|
| 354 | + */ |
|
| 355 | + public function addJobToQueue($jobqueue_url, $password) {} |
|
| 356 | + |
|
| 357 | + /** |
|
| 358 | + * Set a new priority to the job |
|
| 359 | + * |
|
| 360 | + * @param int $priority Priority options are constants with the "JOB_QUEUE_PRIORITY_" prefix |
|
| 361 | + */ |
|
| 362 | + public function setJobPriority($priority) {} |
|
| 363 | + |
|
| 364 | + // All properties SET functions |
|
| 365 | + public function setJobName($name) {} |
|
| 366 | + public function setScript($script) {} |
|
| 367 | + public function setApplicationID($app_id) {} |
|
| 368 | + public function setUserVariables($vars) {} |
|
| 369 | + public function setGlobalVariables($vars) {} |
|
| 370 | + public function setJobDependency($job_id) {} |
|
| 371 | + public function setScheduledTime($timestamp) {} |
|
| 372 | + public function setRecurrenceData($interval, $end_time = null) {} |
|
| 373 | + public function setPreserved($preserved) {} |
|
| 374 | + |
|
| 375 | + /** |
|
| 376 | + * Get the job properties |
|
| 377 | + * |
|
| 378 | + * @return array The same format of job options array as in the Job constructor |
|
| 379 | + */ |
|
| 380 | + public function getProperties() {} |
|
| 381 | + |
|
| 382 | + /** |
|
| 383 | + * Get the job output |
|
| 384 | + * |
|
| 385 | + * @return mixed An HTML representing the job output |
|
| 386 | + */ |
|
| 387 | + public function getOutput() {} |
|
| 388 | + |
|
| 389 | + // All properties GET functions |
|
| 390 | + public function getID() {} |
|
| 391 | + public function getHost() {} |
|
| 392 | + public function getScript() {} |
|
| 393 | + public function getJobPriority() {} |
|
| 394 | + public function getJobName() {} |
|
| 395 | + public function getApplicationID() {} |
|
| 396 | + public function getUserVariables() {} |
|
| 397 | + public function getGlobalVariables() {} |
|
| 398 | + public function getJobDependency() {} |
|
| 399 | + public function getScheduledTime() {} |
|
| 400 | + public function getInterval() {} |
|
| 401 | + public function getEndTime() {} |
|
| 402 | + public function getPreserved() {} |
|
| 403 | + |
|
| 404 | + /** |
|
| 405 | + * Get the current status of the job |
|
| 406 | + * If this job was created and not returned from a queue (using the JobQueue::GetJob() function), |
|
| 407 | + * the function will return false |
|
| 408 | + * The status is one of the constants with the "JOB_QUEUE_STATUS_" prefix. |
|
| 409 | + * E.g. job was performed and failed, job is waiting etc. |
|
| 410 | + * |
|
| 411 | + * @return int|false |
|
| 412 | + */ |
|
| 413 | + public function getJobStatus() {} |
|
| 414 | + |
|
| 415 | + /** |
|
| 416 | + * Get how much seconds there are until the next time the job will run. |
|
| 417 | + * If the job is not recurrence or it past its end time, then return 0. |
|
| 418 | + * |
|
| 419 | + * @return int |
|
| 420 | + */ |
|
| 421 | + public function getTimeToNextRepeat() {} |
|
| 422 | + |
|
| 423 | + /** |
|
| 424 | + * For recurring job get the status of the last execution. For simple job, |
|
| 425 | + * getLastPerformedStatus is equivalent to getJobStatus. |
|
| 426 | + * jobs that haven't been executed yet will return STATUS_WAITING |
|
| 427 | + * @return int |
|
| 428 | + */ |
|
| 429 | + public function getLastPerformedStatus() {} |
|
| 430 | 430 | } |
| 431 | 431 | |
| 432 | 432 | /** |
@@ -608,23 +608,23 @@ discard block |
||
| 608 | 608 | |
| 609 | 609 | class java |
| 610 | 610 | { |
| 611 | - /** |
|
| 612 | - * Create Java object |
|
| 613 | - * |
|
| 614 | - * @param string $classname |
|
| 615 | - * @return java |
|
| 616 | - * |
|
| 617 | - * @removed 8.0 |
|
| 618 | - */ |
|
| 619 | - public function java($classname) {} |
|
| 611 | + /** |
|
| 612 | + * Create Java object |
|
| 613 | + * |
|
| 614 | + * @param string $classname |
|
| 615 | + * @return java |
|
| 616 | + * |
|
| 617 | + * @removed 8.0 |
|
| 618 | + */ |
|
| 619 | + public function java($classname) {} |
|
| 620 | 620 | }; |
| 621 | 621 | |
| 622 | 622 | class JavaException |
| 623 | 623 | { |
| 624 | - /** |
|
| 625 | - * Get Java exception that led to this exception |
|
| 626 | - * |
|
| 627 | - * @return object |
|
| 628 | - */ |
|
| 629 | - public function getCause() {} |
|
| 624 | + /** |
|
| 625 | + * Get Java exception that led to this exception |
|
| 626 | + * |
|
| 627 | + * @return object |
|
| 628 | + */ |
|
| 629 | + public function getCause() {} |
|
| 630 | 630 | }; |
@@ -2,8 +2,7 @@ discard block |
||
| 2 | 2 | |
| 3 | 3 | // Start of Zend Extensions |
| 4 | 4 | |
| 5 | -class ZendAPI_Queue |
|
| 6 | -{ |
|
| 5 | +class ZendAPI_Queue { |
|
| 7 | 6 | public $_jobqueue_url; |
| 8 | 7 | |
| 9 | 8 | /** |
@@ -194,8 +193,7 @@ discard block |
||
| 194 | 193 | * |
| 195 | 194 | * For simplicity, a job can be added directly to a queue and without creating an instant of a Queue object |
| 196 | 195 | */ |
| 197 | -class ZendAPI_Job |
|
| 198 | -{ |
|
| 196 | +class ZendAPI_Job { |
|
| 199 | 197 | /** |
| 200 | 198 | * Unique id of the Job in the job queue |
| 201 | 199 | * |
@@ -606,8 +604,7 @@ discard block |
||
| 606 | 604 | */ |
| 607 | 605 | function zend_send_buffer($buffer, $mime_type, $custom_headers) {} |
| 608 | 606 | |
| 609 | -class java |
|
| 610 | -{ |
|
| 607 | +class java { |
|
| 611 | 608 | /** |
| 612 | 609 | * Create Java object |
| 613 | 610 | * |
@@ -619,8 +616,7 @@ discard block |
||
| 619 | 616 | public function java($classname) {} |
| 620 | 617 | }; |
| 621 | 618 | |
| 622 | -class JavaException |
|
| 623 | -{ |
|
| 619 | +class JavaException { |
|
| 624 | 620 | /** |
| 625 | 621 | * Get Java exception that led to this exception |
| 626 | 622 | * |
@@ -11,8 +11,8 @@ |
||
| 11 | 11 | define('JOB_QUEUE_STATUS_IN_PROCESS', 6); // Job is in process in Queue |
| 12 | 12 | define('JOB_QUEUE_STATUS_EXECUTION_FAILED', 7); // Job execution failed in the ZendEnabler |
| 13 | 13 | define('JOB_QUEUE_STATUS_LOGICALLY_FAILED', 8); // Job was processed and failed logically either |
| 14 | - // because of job_fail command or script parse or |
|
| 15 | - // fatal error |
|
| 14 | + // because of job_fail command or script parse or |
|
| 15 | + // fatal error |
|
| 16 | 16 | |
| 17 | 17 | // Constants for different priorities of jobs |
| 18 | 18 | define('JOB_QUEUE_PRIORITY_LOW', 0); |
@@ -3,14 +3,14 @@ |
||
| 3 | 3 | // Start of Zend Extensions |
| 4 | 4 | |
| 5 | 5 | // Constants for jobs status |
| 6 | -define('JOB_QUEUE_STATUS_SUCCESS', 1); // Job was processed and succeeded |
|
| 7 | -define('JOB_QUEUE_STATUS_WAITING', 2); // Job is waiting for being processed (was not scheduled) |
|
| 8 | -define('JOB_QUEUE_STATUS_SUSPENDED', 3); // Job was suspended |
|
| 9 | -define('JOB_QUEUE_STATUS_SCHEDULED', 4); // Job is scheduled and waiting in queue |
|
| 6 | +define('JOB_QUEUE_STATUS_SUCCESS', 1); // Job was processed and succeeded |
|
| 7 | +define('JOB_QUEUE_STATUS_WAITING', 2); // Job is waiting for being processed (was not scheduled) |
|
| 8 | +define('JOB_QUEUE_STATUS_SUSPENDED', 3); // Job was suspended |
|
| 9 | +define('JOB_QUEUE_STATUS_SCHEDULED', 4); // Job is scheduled and waiting in queue |
|
| 10 | 10 | define('JOB_QUEUE_STATUS_WAITING_PREDECESSOR', 5); // Job is waiting for it's predecessor to be completed |
| 11 | -define('JOB_QUEUE_STATUS_IN_PROCESS', 6); // Job is in process in Queue |
|
| 12 | -define('JOB_QUEUE_STATUS_EXECUTION_FAILED', 7); // Job execution failed in the ZendEnabler |
|
| 13 | -define('JOB_QUEUE_STATUS_LOGICALLY_FAILED', 8); // Job was processed and failed logically either |
|
| 11 | +define('JOB_QUEUE_STATUS_IN_PROCESS', 6); // Job is in process in Queue |
|
| 12 | +define('JOB_QUEUE_STATUS_EXECUTION_FAILED', 7); // Job execution failed in the ZendEnabler |
|
| 13 | +define('JOB_QUEUE_STATUS_LOGICALLY_FAILED', 8); // Job was processed and failed logically either |
|
| 14 | 14 | // because of job_fail command or script parse or |
| 15 | 15 | // fatal error |
| 16 | 16 | |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | * set of the current process. |
| 126 | 126 | */ |
| 127 | 127 | #[Pure] |
| 128 | -function posix_getgroups(): array|false {} |
|
| 128 | +function posix_getgroups(): array | false {} |
|
| 129 | 129 | |
| 130 | 130 | /** |
| 131 | 131 | * Return login name |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | * @return string|false the login name of the user, as a string. |
| 134 | 134 | */ |
| 135 | 135 | #[Pure] |
| 136 | -function posix_getlogin(): string|false {} |
|
| 136 | +function posix_getlogin(): string | false {} |
|
| 137 | 137 | |
| 138 | 138 | /** |
| 139 | 139 | * Return the current process group identifier |
@@ -172,7 +172,7 @@ discard block |
||
| 172 | 172 | * @return int|false the identifier, as an integer. |
| 173 | 173 | */ |
| 174 | 174 | #[Pure] |
| 175 | -function posix_getpgid(int $process_id): int|false {} |
|
| 175 | +function posix_getpgid(int $process_id): int | false {} |
|
| 176 | 176 | |
| 177 | 177 | /** |
| 178 | 178 | * Get the current sid of the process |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | * @return int|false the identifier, as an integer. |
| 187 | 187 | */ |
| 188 | 188 | #[Pure] |
| 189 | -function posix_getsid(int $process_id): int|false {} |
|
| 189 | +function posix_getsid(int $process_id): int | false {} |
|
| 190 | 190 | |
| 191 | 191 | /** |
| 192 | 192 | * Get system name |
@@ -207,7 +207,7 @@ discard block |
||
| 207 | 207 | * libc. |
| 208 | 208 | */ |
| 209 | 209 | #[Pure] |
| 210 | -function posix_uname(): array|false {} |
|
| 210 | +function posix_uname(): array | false {} |
|
| 211 | 211 | |
| 212 | 212 | /** |
| 213 | 213 | * Get process times |
@@ -222,7 +222,7 @@ discard block |
||
| 222 | 222 | * cstime - system time used by current process and children. |
| 223 | 223 | */ |
| 224 | 224 | #[Pure] |
| 225 | -function posix_times(): array|false {} |
|
| 225 | +function posix_times(): array | false {} |
|
| 226 | 226 | |
| 227 | 227 | /** |
| 228 | 228 | * Get path name of controlling terminal |
@@ -232,7 +232,7 @@ discard block |
||
| 232 | 232 | * is set, which can be checked with <b>posix_get_last_error</b>. |
| 233 | 233 | */ |
| 234 | 234 | #[Pure] |
| 235 | -function posix_ctermid(): string|false {} |
|
| 235 | +function posix_ctermid(): string | false {} |
|
| 236 | 236 | |
| 237 | 237 | /** |
| 238 | 238 | * Determine terminal device name |
@@ -244,7 +244,7 @@ discard block |
||
| 244 | 244 | * <i>fd</i>. On failure, returns <b>FALSE</b> |
| 245 | 245 | */ |
| 246 | 246 | #[Pure] |
| 247 | -function posix_ttyname($file_descriptor): string|false {} |
|
| 247 | +function posix_ttyname($file_descriptor): string | false {} |
|
| 248 | 248 | |
| 249 | 249 | /** |
| 250 | 250 | * Determine if a file descriptor is an interactive terminal |
@@ -269,7 +269,7 @@ discard block |
||
| 269 | 269 | * <b>posix_get_last_error</b>. |
| 270 | 270 | */ |
| 271 | 271 | #[Pure(true)] |
| 272 | -function posix_getcwd(): string|false {} |
|
| 272 | +function posix_getcwd(): string | false {} |
|
| 273 | 273 | |
| 274 | 274 | /** |
| 275 | 275 | * Create a fifo special file (a named pipe) |
@@ -379,7 +379,7 @@ discard block |
||
| 379 | 379 | * </table> |
| 380 | 380 | */ |
| 381 | 381 | #[Pure] |
| 382 | -function posix_getgrnam(string $name): array|false {} |
|
| 382 | +function posix_getgrnam(string $name): array | false {} |
|
| 383 | 383 | |
| 384 | 384 | /** |
| 385 | 385 | * Return info about a group by group id |
@@ -428,7 +428,7 @@ discard block |
||
| 428 | 428 | * </table> |
| 429 | 429 | */ |
| 430 | 430 | #[Pure] |
| 431 | -function posix_getgrgid(int $group_id): array|false {} |
|
| 431 | +function posix_getgrgid(int $group_id): array | false {} |
|
| 432 | 432 | |
| 433 | 433 | /** |
| 434 | 434 | * Return info about a user by username |
@@ -505,7 +505,7 @@ discard block |
||
| 505 | 505 | * </table> |
| 506 | 506 | */ |
| 507 | 507 | #[Pure] |
| 508 | -function posix_getpwnam(string $username): array|false {} |
|
| 508 | +function posix_getpwnam(string $username): array | false {} |
|
| 509 | 509 | |
| 510 | 510 | /** |
| 511 | 511 | * Return info about a user by user id |
@@ -581,7 +581,7 @@ discard block |
||
| 581 | 581 | * </table> |
| 582 | 582 | */ |
| 583 | 583 | #[Pure] |
| 584 | -function posix_getpwuid(int $user_id): array|false {} |
|
| 584 | +function posix_getpwuid(int $user_id): array | false {} |
|
| 585 | 585 | |
| 586 | 586 | /** |
| 587 | 587 | * Return info about system resource limits |
@@ -666,7 +666,7 @@ discard block |
||
| 666 | 666 | * </table> |
| 667 | 667 | */ |
| 668 | 668 | #[Pure] |
| 669 | -function posix_getrlimit(): array|false {} |
|
| 669 | +function posix_getrlimit(): array | false {} |
|
| 670 | 670 | |
| 671 | 671 | /** |
| 672 | 672 | * Retrieve the error number set by the last posix function that failed |
@@ -8,21 +8,21 @@ discard block |
||
| 8 | 8 | */ |
| 9 | 9 | class COM |
| 10 | 10 | { |
| 11 | - /** |
|
| 12 | - * (PHP 4 >= 4.1.0, PHP 5, PHP 7)<br/> |
|
| 13 | - * COM class constructor. |
|
| 14 | - * @param string $module_name |
|
| 15 | - * @param string $server_name [optional] |
|
| 16 | - * @param int $codepage [optional] |
|
| 17 | - * @param string $typelib [optional] |
|
| 18 | - */ |
|
| 19 | - public function __construct($module_name, $server_name = null, $codepage = CP_ACP, $typelib = null) {} |
|
| 11 | + /** |
|
| 12 | + * (PHP 4 >= 4.1.0, PHP 5, PHP 7)<br/> |
|
| 13 | + * COM class constructor. |
|
| 14 | + * @param string $module_name |
|
| 15 | + * @param string $server_name [optional] |
|
| 16 | + * @param int $codepage [optional] |
|
| 17 | + * @param string $typelib [optional] |
|
| 18 | + */ |
|
| 19 | + public function __construct($module_name, $server_name = null, $codepage = CP_ACP, $typelib = null) {} |
|
| 20 | 20 | |
| 21 | - public function __get($name) {} |
|
| 21 | + public function __get($name) {} |
|
| 22 | 22 | |
| 23 | - public function __set($name, $value) {} |
|
| 23 | + public function __set($name, $value) {} |
|
| 24 | 24 | |
| 25 | - public function __call($name, $args) {} |
|
| 25 | + public function __call($name, $args) {} |
|
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | /** |
@@ -31,20 +31,20 @@ discard block |
||
| 31 | 31 | */ |
| 32 | 32 | class DOTNET |
| 33 | 33 | { |
| 34 | - /** |
|
| 35 | - * (PHP 4 >= 4.1.0, PHP 5, PHP 7)<br/> |
|
| 36 | - * COM class constructor. |
|
| 37 | - * @param string $assembly_name |
|
| 38 | - * @param string $class_name |
|
| 39 | - * @param int $codepage [optional] |
|
| 40 | - */ |
|
| 41 | - public function __construct($assembly_name, string $class_name, $codepage = CP_ACP) {} |
|
| 34 | + /** |
|
| 35 | + * (PHP 4 >= 4.1.0, PHP 5, PHP 7)<br/> |
|
| 36 | + * COM class constructor. |
|
| 37 | + * @param string $assembly_name |
|
| 38 | + * @param string $class_name |
|
| 39 | + * @param int $codepage [optional] |
|
| 40 | + */ |
|
| 41 | + public function __construct($assembly_name, string $class_name, $codepage = CP_ACP) {} |
|
| 42 | 42 | |
| 43 | - public function __get($name) {} |
|
| 43 | + public function __get($name) {} |
|
| 44 | 44 | |
| 45 | - public function __set($name, $value) {} |
|
| 45 | + public function __set($name, $value) {} |
|
| 46 | 46 | |
| 47 | - public function __call($name, $args) {} |
|
| 47 | + public function __call($name, $args) {} |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | /** |
@@ -53,20 +53,20 @@ discard block |
||
| 53 | 53 | */ |
| 54 | 54 | class VARIANT |
| 55 | 55 | { |
| 56 | - /** |
|
| 57 | - * (PHP 4 >= 4.1.0, PHP 5, PHP 7)<br/> |
|
| 58 | - * COM class constructor. |
|
| 59 | - * @param mixed $value [optional] |
|
| 60 | - * @param int $type [optional] |
|
| 61 | - * @param int $codepage [optional] |
|
| 62 | - */ |
|
| 63 | - public function __construct($value = null, int $type = VT_EMPTY, $codepage = CP_ACP) {} |
|
| 56 | + /** |
|
| 57 | + * (PHP 4 >= 4.1.0, PHP 5, PHP 7)<br/> |
|
| 58 | + * COM class constructor. |
|
| 59 | + * @param mixed $value [optional] |
|
| 60 | + * @param int $type [optional] |
|
| 61 | + * @param int $codepage [optional] |
|
| 62 | + */ |
|
| 63 | + public function __construct($value = null, int $type = VT_EMPTY, $codepage = CP_ACP) {} |
|
| 64 | 64 | |
| 65 | - public function __get($name) {} |
|
| 65 | + public function __get($name) {} |
|
| 66 | 66 | |
| 67 | - public function __set($name, $value) {} |
|
| 67 | + public function __set($name, $value) {} |
|
| 68 | 68 | |
| 69 | - public function __call($name, $args) {} |
|
| 69 | + public function __call($name, $args) {} |
|
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | /** |
@@ -6,8 +6,7 @@ discard block |
||
| 6 | 6 | * The COM class allows you to instantiate an OLE compatible COM object and call its methods and access its properties. |
| 7 | 7 | * @link https://php.net/manual/en/class.com.php |
| 8 | 8 | */ |
| 9 | -class COM |
|
| 10 | -{ |
|
| 9 | +class COM { |
|
| 11 | 10 | /** |
| 12 | 11 | * (PHP 4 >= 4.1.0, PHP 5, PHP 7)<br/> |
| 13 | 12 | * COM class constructor. |
@@ -29,8 +28,7 @@ discard block |
||
| 29 | 28 | * The DOTNET class allows you to instantiate a class from a .Net assembly and call its methods and access its properties. |
| 30 | 29 | * @link https://php.net/manual/en/class.dotnet.php |
| 31 | 30 | */ |
| 32 | -class DOTNET |
|
| 33 | -{ |
|
| 31 | +class DOTNET { |
|
| 34 | 32 | /** |
| 35 | 33 | * (PHP 4 >= 4.1.0, PHP 5, PHP 7)<br/> |
| 36 | 34 | * COM class constructor. |
@@ -51,8 +49,7 @@ discard block |
||
| 51 | 49 | * The VARIANT is COM's equivalent of the PHP zval; it is a structure that can contain a value with a range of different possible types. The VARIANT class provided by the COM extension allows you to have more control over the way that PHP passes values to and from COM. |
| 52 | 50 | * @link https://php.net/manual/en/class.variant.php |
| 53 | 51 | */ |
| 54 | -class VARIANT |
|
| 55 | -{ |
|
| 52 | +class VARIANT { |
|
| 56 | 53 | /** |
| 57 | 54 | * (PHP 4 >= 4.1.0, PHP 5, PHP 7)<br/> |
| 58 | 55 | * COM class constructor. |