Context
PHPC-2728 added the stringOpts option to MongoDB\Driver\ClientEncryption::encrypt(). To use it, users must pass literal strings for algorithm and queryType, because no constants exist for the new values, unlike ALGORITHM_INDEXED, ALGORITHM_RANGE or QUERY_TYPE_RANGE.
Proposal
Add the following constants to MongoDB\Driver\ClientEncryption in [ClientEncryption.stub.php|https://github.com/mongodb/mongo-php-driver/blob/v2.x/src/MongoDB/ClientEncryption.stub.php], backed by the libmongoc macros when available:
| Constant | Value |
|---|---|
| ALGORITHM_STRING | "String" |
| QUERY_TYPE_PREFIX | "prefix" |
| QUERY_TYPE_SUFFIX | "suffix" |
| QUERY_TYPE_SUBSTRING | "substring" |
Also update the generated arginfo, the tests, and the PHP manual (encrypt() options and class constants).
- related to
-
PHPC-2728 Add support for stringOpts in ClientEncryption::encrypt()
-
- Closed
-