Skip to content

Commit 4942097

Browse files
committed
Remove deprecated terminology for secondary
1 parent f9f9a0c commit 4942097

File tree

5 files changed

+3
-157
lines changed

5 files changed

+3
-157
lines changed

php_phongo.c

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1553,7 +1553,7 @@ static bool php_phongo_apply_options_to_uri(mongoc_uri_t* uri, bson_t* options)
15531553
!strcasecmp(key, MONGOC_URI_READPREFERENCE) ||
15541554
!strcasecmp(key, MONGOC_URI_READPREFERENCETAGS) ||
15551555
!strcasecmp(key, MONGOC_URI_SAFE) ||
1556-
!strcasecmp(key, MONGOC_URI_SLAVEOK) ||
1556+
!strcasecmp(key, MONGOC_URI_SECONDARYOK) ||
15571557
!strcasecmp(key, MONGOC_URI_W) ||
15581558
!strcasecmp(key, MONGOC_URI_WTIMEOUTMS)) {
15591559

@@ -1793,7 +1793,6 @@ static bool php_phongo_apply_rp_options_to_uri(mongoc_uri_t* uri, bson_t* option
17931793
bson_iter_t iter;
17941794
mongoc_read_prefs_t* new_rp;
17951795
const mongoc_read_prefs_t* old_rp;
1796-
bool ignore_slaveok = false;
17971796

17981797
if (!(old_rp = mongoc_uri_get_read_prefs_t(uri))) {
17991798
phongo_throw_exception(PHONGO_ERROR_MONGOC_FAILED, "mongoc_uri_t does not have a read preference");
@@ -1811,19 +1810,6 @@ static bool php_phongo_apply_rp_options_to_uri(mongoc_uri_t* uri, bson_t* option
18111810
while (bson_iter_next(&iter)) {
18121811
const char* key = bson_iter_key(&iter);
18131812

1814-
if (!ignore_slaveok && !strcasecmp(key, MONGOC_URI_SLAVEOK)) {
1815-
if (!BSON_ITER_HOLDS_BOOL(&iter)) {
1816-
PHONGO_URI_INVALID_TYPE(iter, "boolean");
1817-
mongoc_read_prefs_destroy(new_rp);
1818-
1819-
return false;
1820-
}
1821-
1822-
if (bson_iter_bool(&iter)) {
1823-
mongoc_read_prefs_set_mode(new_rp, MONGOC_READ_SECONDARY_PREFERRED);
1824-
}
1825-
}
1826-
18271813
if (!strcasecmp(key, MONGOC_URI_READPREFERENCE)) {
18281814
const char* str;
18291815

@@ -1852,8 +1838,6 @@ static bool php_phongo_apply_rp_options_to_uri(mongoc_uri_t* uri, bson_t* option
18521838

18531839
return false;
18541840
}
1855-
1856-
ignore_slaveok = true;
18571841
}
18581842

18591843
if (!strcasecmp(key, MONGOC_URI_READPREFERENCETAGS)) {

tests/manager/manager-ctor-read_preference-004.phpt

Lines changed: 0 additions & 114 deletions
This file was deleted.

tests/manager/manager-ctor-read_preference-error-003.phpt

Lines changed: 0 additions & 24 deletions
This file was deleted.

tests/server/server-executeCommand-003.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ $secondaryRp = new MongoDB\Driver\ReadPreference(MongoDB\Driver\ReadPreference::
1414
$secondary = $manager->selectServer($secondaryRp);
1515

1616
/* Note: this is testing that the read preference (even a conflicting one) has
17-
* no effect when directly querying a server, since the slaveOk flag is always
17+
* no effect when directly querying a server, since the secondaryOk flag is always
1818
* set for hinted commands. */
1919
$primaryRp = new MongoDB\Driver\ReadPreference(MongoDB\Driver\ReadPreference::RP_PRIMARY);
2020
$cursor = $secondary->executeCommand(DATABASE_NAME, new MongoDB\Driver\Command(array('ping' => 1)), $primaryRp);

tests/server/server-executeQuery-008.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ $secondaryRp = new MongoDB\Driver\ReadPreference(MongoDB\Driver\ReadPreference::
2323
$secondary = $manager->selectServer($secondaryRp);
2424

2525
/* Note: this is testing that the read preference (even a conflicting one) has
26-
* no effect when directly querying a server, since the slaveOk flag is always
26+
* no effect when directly querying a server, since the secondaryOk flag is always
2727
* set for hinted queries. */
2828
$cursor = $secondary->executeQuery(NS, new MongoDB\Driver\Query(['x' => 1]), $primaryRp);
2929

0 commit comments

Comments
 (0)