Skip to content

Commit d9a4678

Browse files
committed
PHPC-2401: Support QEv2 range protocol
Existing RANGE_PREVIEW constants are deprecated in favor of new RANGE constants introduced in libmongoc 1.28.0
1 parent 439e6f9 commit d9a4678

File tree

5 files changed

+39
-7
lines changed

5 files changed

+39
-7
lines changed

src/MongoDB/ClientEncryption.stub.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,13 @@ final class ClientEncryption
3434
public const ALGORITHM_UNINDEXED = UNKNOWN;
3535

3636
/**
37+
* @var string
38+
* @cvalue MONGOC_ENCRYPT_ALGORITHM_RANGE
39+
*/
40+
public const ALGORITHM_RANGE = UNKNOWN;
41+
42+
/**
43+
* @deprecated
3744
* @var string
3845
* @cvalue MONGOC_ENCRYPT_ALGORITHM_RANGEPREVIEW
3946
*/
@@ -46,6 +53,13 @@ final class ClientEncryption
4653
public const QUERY_TYPE_EQUALITY = UNKNOWN;
4754

4855
/**
56+
* @var string
57+
* @cvalue MONGOC_ENCRYPT_QUERY_TYPE_RANGE
58+
*/
59+
public const QUERY_TYPE_RANGE = UNKNOWN;
60+
61+
/**
62+
* @deprecated
4963
* @var string
5064
* @cvalue MONGOC_ENCRYPT_QUERY_TYPE_RANGEPREVIEW
5165
*/

src/MongoDB/ClientEncryption_arginfo.h

Lines changed: 17 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/clientEncryption/clientEncryption-constants.phpt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@ var_dump(MongoDB\Driver\ClientEncryption::AEAD_AES_256_CBC_HMAC_SHA_512_DETERMIN
77
var_dump(MongoDB\Driver\ClientEncryption::AEAD_AES_256_CBC_HMAC_SHA_512_RANDOM);
88
var_dump(MongoDB\Driver\ClientEncryption::ALGORITHM_INDEXED);
99
var_dump(MongoDB\Driver\ClientEncryption::ALGORITHM_UNINDEXED);
10+
var_dump(MongoDB\Driver\ClientEncryption::ALGORITHM_RANGE);
1011
var_dump(MongoDB\Driver\ClientEncryption::ALGORITHM_RANGE_PREVIEW);
1112
var_dump(MongoDB\Driver\ClientEncryption::QUERY_TYPE_EQUALITY);
13+
var_dump(MongoDB\Driver\ClientEncryption::QUERY_TYPE_RANGE);
1214
var_dump(MongoDB\Driver\ClientEncryption::QUERY_TYPE_RANGE_PREVIEW);
1315

1416
?>
@@ -19,7 +21,9 @@ string(43) "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic"
1921
string(36) "AEAD_AES_256_CBC_HMAC_SHA_512-Random"
2022
string(7) "Indexed"
2123
string(9) "Unindexed"
24+
string(5) "Range"
2225
string(12) "RangePreview"
2326
string(8) "equality"
27+
string(5) "range"
2428
string(12) "rangePreview"
2529
===DONE===

tests/clientEncryption/clientEncryption-encryptExpression-001.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ $keyId = $clientEncryption->createDataKey('local');
2222

2323
$encryptOpts = [
2424
'keyId' => $keyId,
25-
'algorithm' => MongoDB\Driver\ClientEncryption::ALGORITHM_RANGE_PREVIEW,
26-
'queryType' => MongoDB\Driver\ClientEncryption::QUERY_TYPE_RANGE_PREVIEW,
25+
'algorithm' => MongoDB\Driver\ClientEncryption::ALGORITHM_RANGE,
26+
'queryType' => MongoDB\Driver\ClientEncryption::QUERY_TYPE_RANGE,
2727
'contentionFactor' => 0,
2828
'rangeOpts' => ['min' => 0, 'max' => 200, 'sparsity' => 1],
2929
];

tests/clientEncryption/clientEncryption-encryptExpression_error-002.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ $keyId = $clientEncryption->createDataKey('local');
2222

2323
$encryptOpts = [
2424
'keyId' => $keyId,
25-
'algorithm' => MongoDB\Driver\ClientEncryption::ALGORITHM_RANGE_PREVIEW,
26-
'queryType' => MongoDB\Driver\ClientEncryption::QUERY_TYPE_RANGE_PREVIEW,
25+
'algorithm' => MongoDB\Driver\ClientEncryption::ALGORITHM_RANGE,
26+
'queryType' => MongoDB\Driver\ClientEncryption::QUERY_TYPE_RANGE,
2727
'contentionFactor' => 0,
2828
'rangeOpts' => ['min' => 0, 'max' => 200, 'sparsity' => 1],
2929
];

0 commit comments

Comments
 (0)