-
Notifications
You must be signed in to change notification settings - Fork 208
PHPC-1756: Remove oppressive terminology from source code #1221
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
5ef619e
Use latest version of libmongoc
alcaeus f9f9a0c
Remove deprecated terminology for primary
alcaeus 4942097
Remove deprecated terminology for secondary
alcaeus 9e194b6
Fix clang-format
alcaeus a720428
Remove check for legacy field
alcaeus 45948d9
Fix missing space in error expectation
alcaeus e685a85
Harden test expectation around primary checks
alcaeus File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1164,8 +1164,8 @@ php_phongo_server_description_type_t php_phongo_server_description_type(mongoc_s | |
|
||
bool php_phongo_server_to_zval(zval* retval, mongoc_server_description_t* sd) /* {{{ */ | ||
{ | ||
mongoc_host_list_t* host = mongoc_server_description_host(sd); | ||
const bson_t* is_master = mongoc_server_description_ismaster(sd); | ||
mongoc_host_list_t* host = mongoc_server_description_host(sd); | ||
const bson_t* hello_response = mongoc_server_description_hello_response(sd); | ||
bson_iter_t iter; | ||
|
||
array_init(retval); | ||
|
@@ -1176,10 +1176,10 @@ bool php_phongo_server_to_zval(zval* retval, mongoc_server_description_t* sd) /* | |
ADD_ASSOC_BOOL_EX(retval, "is_primary", !strcmp(mongoc_server_description_type(sd), php_phongo_server_description_type_map[PHONGO_SERVER_RS_PRIMARY].name)); | ||
ADD_ASSOC_BOOL_EX(retval, "is_secondary", !strcmp(mongoc_server_description_type(sd), php_phongo_server_description_type_map[PHONGO_SERVER_RS_SECONDARY].name)); | ||
ADD_ASSOC_BOOL_EX(retval, "is_arbiter", !strcmp(mongoc_server_description_type(sd), php_phongo_server_description_type_map[PHONGO_SERVER_RS_ARBITER].name)); | ||
ADD_ASSOC_BOOL_EX(retval, "is_hidden", bson_iter_init_find_case(&iter, is_master, "hidden") && bson_iter_as_bool(&iter)); | ||
ADD_ASSOC_BOOL_EX(retval, "is_passive", bson_iter_init_find_case(&iter, is_master, "passive") && bson_iter_as_bool(&iter)); | ||
ADD_ASSOC_BOOL_EX(retval, "is_hidden", bson_iter_init_find_case(&iter, hello_response, "hidden") && bson_iter_as_bool(&iter)); | ||
ADD_ASSOC_BOOL_EX(retval, "is_passive", bson_iter_init_find_case(&iter, hello_response, "passive") && bson_iter_as_bool(&iter)); | ||
|
||
if (bson_iter_init_find(&iter, is_master, "tags") && BSON_ITER_HOLDS_DOCUMENT(&iter)) { | ||
if (bson_iter_init_find(&iter, hello_response, "tags") && BSON_ITER_HOLDS_DOCUMENT(&iter)) { | ||
const uint8_t* bytes; | ||
uint32_t len; | ||
php_phongo_bson_state state; | ||
|
@@ -1199,12 +1199,12 @@ bool php_phongo_server_to_zval(zval* retval, mongoc_server_description_t* sd) /* | |
|
||
PHONGO_BSON_INIT_DEBUG_STATE(state); | ||
|
||
if (!php_phongo_bson_to_zval_ex(bson_get_data(is_master), is_master->len, &state)) { | ||
if (!php_phongo_bson_to_zval_ex(bson_get_data(hello_response), hello_response->len, &state)) { | ||
zval_ptr_dtor(&state.zchild); | ||
return false; | ||
} | ||
|
||
ADD_ASSOC_ZVAL_EX(retval, "last_is_master", &state.zchild); | ||
ADD_ASSOC_ZVAL_EX(retval, "last_hello_response", &state.zchild); | ||
} | ||
ADD_ASSOC_LONG_EX(retval, "round_trip_time", (zend_long) mongoc_server_description_round_trip_time(sd)); | ||
|
||
|
@@ -1553,7 +1553,6 @@ static bool php_phongo_apply_options_to_uri(mongoc_uri_t* uri, bson_t* options) | |
!strcasecmp(key, MONGOC_URI_READPREFERENCE) || | ||
!strcasecmp(key, MONGOC_URI_READPREFERENCETAGS) || | ||
!strcasecmp(key, MONGOC_URI_SAFE) || | ||
!strcasecmp(key, MONGOC_URI_SLAVEOK) || | ||
!strcasecmp(key, MONGOC_URI_W) || | ||
!strcasecmp(key, MONGOC_URI_WTIMEOUTMS)) { | ||
|
||
|
@@ -1793,7 +1792,6 @@ static bool php_phongo_apply_rp_options_to_uri(mongoc_uri_t* uri, bson_t* option | |
bson_iter_t iter; | ||
mongoc_read_prefs_t* new_rp; | ||
const mongoc_read_prefs_t* old_rp; | ||
bool ignore_slaveok = false; | ||
|
||
if (!(old_rp = mongoc_uri_get_read_prefs_t(uri))) { | ||
phongo_throw_exception(PHONGO_ERROR_MONGOC_FAILED, "mongoc_uri_t does not have a read preference"); | ||
|
@@ -1811,19 +1809,6 @@ static bool php_phongo_apply_rp_options_to_uri(mongoc_uri_t* uri, bson_t* option | |
while (bson_iter_next(&iter)) { | ||
const char* key = bson_iter_key(&iter); | ||
|
||
if (!ignore_slaveok && !strcasecmp(key, MONGOC_URI_SLAVEOK)) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See PHPC-1836 |
||
if (!BSON_ITER_HOLDS_BOOL(&iter)) { | ||
PHONGO_URI_INVALID_TYPE(iter, "boolean"); | ||
mongoc_read_prefs_destroy(new_rp); | ||
|
||
return false; | ||
} | ||
|
||
if (bson_iter_bool(&iter)) { | ||
mongoc_read_prefs_set_mode(new_rp, MONGOC_READ_SECONDARY_PREFERRED); | ||
} | ||
} | ||
|
||
if (!strcasecmp(key, MONGOC_URI_READPREFERENCE)) { | ||
const char* str; | ||
|
||
|
@@ -1852,8 +1837,6 @@ static bool php_phongo_apply_rp_options_to_uri(mongoc_uri_t* uri, bson_t* option | |
|
||
return false; | ||
} | ||
|
||
ignore_slaveok = true; | ||
} | ||
|
||
if (!strcasecmp(key, MONGOC_URI_READPREFERENCETAGS)) { | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
1.18.0-20210426+git724f1672f2 | ||
1.18.0-20210622+gitebe90917f2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we never documented the returned fields, I decided to drop the old field entirely. Let me know if you think we should keep it in for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just used for debug output, since Manager and Server are not serializable. No objections to changing this, since we don't document debug output at all.