You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (!php_phongo_read_preference_tags_are_valid(tags)) {
66
-
phongo_throw_exception(PHONGO_ERROR_INVALID_ARGUMENTTSRMLS_CC, "%s initialization requires \"tags\" array field to have zero or more documents", ZSTR_VAL(php_phongo_writeconcern_ce->name));
66
+
phongo_throw_exception(PHONGO_ERROR_INVALID_ARGUMENTTSRMLS_CC, "%s initialization requires \"tags\" array field to have zero or more documents", ZSTR_VAL(php_phongo_readpreference_ce->name));
67
67
bson_destroy(tags);
68
68
goto failure;
69
69
}
70
70
71
71
if (!bson_empty(tags) && (mongoc_read_prefs_get_mode(intern->read_preference) ==MONGOC_READ_PRIMARY)) {
72
-
phongo_throw_exception(PHONGO_ERROR_INVALID_ARGUMENTTSRMLS_CC, "%s initialization requires \"tags\" array field to not be present with \"primary\" mode", ZSTR_VAL(php_phongo_writeconcern_ce->name));
72
+
phongo_throw_exception(PHONGO_ERROR_INVALID_ARGUMENTTSRMLS_CC, "%s initialization requires \"tags\" array field to not be present with \"primary\" mode", ZSTR_VAL(php_phongo_readpreference_ce->name));
phongo_throw_exception(PHONGO_ERROR_INVALID_ARGUMENTTSRMLS_CC, "%s initialization requires \"tags\" field to be array", ZSTR_VAL(php_phongo_writeconcern_ce->name));
80
+
phongo_throw_exception(PHONGO_ERROR_INVALID_ARGUMENTTSRMLS_CC, "%s initialization requires \"tags\" field to be array", ZSTR_VAL(php_phongo_readpreference_ce->name));
81
81
goto failure;
82
82
}
83
83
}
84
84
85
85
if ((maxStalenessSeconds=zend_hash_str_find(props, "maxStalenessSeconds", sizeof("maxStalenessSeconds") -1))) {
86
86
if (Z_TYPE_P(maxStalenessSeconds) ==IS_LONG) {
87
87
if (Z_LVAL_P(maxStalenessSeconds) <MONGOC_SMALLEST_MAX_STALENESS_SECONDS) {
88
-
phongo_throw_exception(PHONGO_ERROR_INVALID_ARGUMENTTSRMLS_CC, "%s initialization requires \"maxStalenessSeconds\" integer field to be >= %d", ZSTR_VAL(php_phongo_writeconcern_ce->name), MONGOC_SMALLEST_MAX_STALENESS_SECONDS);
88
+
phongo_throw_exception(PHONGO_ERROR_INVALID_ARGUMENTTSRMLS_CC, "%s initialization requires \"maxStalenessSeconds\" integer field to be >= %d", ZSTR_VAL(php_phongo_readpreference_ce->name), MONGOC_SMALLEST_MAX_STALENESS_SECONDS);
89
89
goto failure;
90
90
}
91
91
if (Z_LVAL_P(maxStalenessSeconds) >INT32_MAX) {
92
-
phongo_throw_exception(PHONGO_ERROR_INVALID_ARGUMENTTSRMLS_CC, "%s initialization requires \"maxStalenessSeconds\" integer field to be <= %"PRId32, ZSTR_VAL(php_phongo_writeconcern_ce->name), INT32_MAX);
92
+
phongo_throw_exception(PHONGO_ERROR_INVALID_ARGUMENTTSRMLS_CC, "%s initialization requires \"maxStalenessSeconds\" integer field to be <= %"PRId32, ZSTR_VAL(php_phongo_readpreference_ce->name), INT32_MAX);
93
93
goto failure;
94
94
}
95
95
if (mongoc_read_prefs_get_mode(intern->read_preference) ==MONGOC_READ_PRIMARY) {
96
-
phongo_throw_exception(PHONGO_ERROR_INVALID_ARGUMENTTSRMLS_CC, "%s initialization requires \"maxStalenessSeconds\" array field to not be present with \"primary\" mode", ZSTR_VAL(php_phongo_writeconcern_ce->name));
96
+
phongo_throw_exception(PHONGO_ERROR_INVALID_ARGUMENTTSRMLS_CC, "%s initialization requires \"maxStalenessSeconds\" array field to not be present with \"primary\" mode", ZSTR_VAL(php_phongo_readpreference_ce->name));
phongo_throw_exception(PHONGO_ERROR_INVALID_ARGUMENTTSRMLS_CC, "%s initialization requires \"maxStalenessSeconds\" field to be integer", ZSTR_VAL(php_phongo_writeconcern_ce->name));
102
+
phongo_throw_exception(PHONGO_ERROR_INVALID_ARGUMENTTSRMLS_CC, "%s initialization requires \"maxStalenessSeconds\" field to be integer", ZSTR_VAL(php_phongo_readpreference_ce->name));
if (!php_phongo_read_preference_tags_are_valid(tags)) {
137
-
phongo_throw_exception(PHONGO_ERROR_INVALID_ARGUMENTTSRMLS_CC, "%s initialization requires \"tags\" array field to have zero or more documents", ZSTR_VAL(php_phongo_writeconcern_ce->name));
137
+
phongo_throw_exception(PHONGO_ERROR_INVALID_ARGUMENTTSRMLS_CC, "%s initialization requires \"tags\" array field to have zero or more documents", ZSTR_VAL(php_phongo_readpreference_ce->name));
138
138
bson_destroy(tags);
139
139
goto failure;
140
140
}
141
141
142
142
if (!bson_empty(tags) && (mongoc_read_prefs_get_mode(intern->read_preference) ==MONGOC_READ_PRIMARY)) {
143
-
phongo_throw_exception(PHONGO_ERROR_INVALID_ARGUMENTTSRMLS_CC, "%s initialization requires \"tags\" array field to not be present with \"primary\" mode", ZSTR_VAL(php_phongo_writeconcern_ce->name));
143
+
phongo_throw_exception(PHONGO_ERROR_INVALID_ARGUMENTTSRMLS_CC, "%s initialization requires \"tags\" array field to not be present with \"primary\" mode", ZSTR_VAL(php_phongo_readpreference_ce->name));
phongo_throw_exception(PHONGO_ERROR_INVALID_ARGUMENTTSRMLS_CC, "%s initialization requires \"tags\" field to be array", ZSTR_VAL(php_phongo_writeconcern_ce->name));
151
+
phongo_throw_exception(PHONGO_ERROR_INVALID_ARGUMENTTSRMLS_CC, "%s initialization requires \"tags\" field to be array", ZSTR_VAL(php_phongo_readpreference_ce->name));
152
152
goto failure;
153
153
}
154
154
}
155
155
156
156
if (zend_hash_find(props, "maxStalenessSeconds", sizeof("maxStalenessSeconds"), (void**) &maxStalenessSeconds) ==SUCCESS) {
157
157
if (Z_TYPE_PP(maxStalenessSeconds) ==IS_LONG) {
158
158
if (Z_LVAL_PP(maxStalenessSeconds) <MONGOC_SMALLEST_MAX_STALENESS_SECONDS) {
159
-
phongo_throw_exception(PHONGO_ERROR_INVALID_ARGUMENTTSRMLS_CC, "%s initialization requires \"maxStalenessSeconds\" integer field to be >= %d", ZSTR_VAL(php_phongo_writeconcern_ce->name), MONGOC_SMALLEST_MAX_STALENESS_SECONDS);
159
+
phongo_throw_exception(PHONGO_ERROR_INVALID_ARGUMENTTSRMLS_CC, "%s initialization requires \"maxStalenessSeconds\" integer field to be >= %d", ZSTR_VAL(php_phongo_readpreference_ce->name), MONGOC_SMALLEST_MAX_STALENESS_SECONDS);
160
160
goto failure;
161
161
}
162
162
if (Z_LVAL_PP(maxStalenessSeconds) >INT32_MAX) {
163
-
phongo_throw_exception(PHONGO_ERROR_INVALID_ARGUMENTTSRMLS_CC, "%s initialization requires \"maxStalenessSeconds\" integer field to be <= %"PRId32, ZSTR_VAL(php_phongo_writeconcern_ce->name), INT32_MAX);
163
+
phongo_throw_exception(PHONGO_ERROR_INVALID_ARGUMENTTSRMLS_CC, "%s initialization requires \"maxStalenessSeconds\" integer field to be <= %"PRId32, ZSTR_VAL(php_phongo_readpreference_ce->name), INT32_MAX);
164
164
goto failure;
165
165
}
166
166
if (mongoc_read_prefs_get_mode(intern->read_preference) ==MONGOC_READ_PRIMARY) {
167
-
phongo_throw_exception(PHONGO_ERROR_INVALID_ARGUMENTTSRMLS_CC, "%s initialization requires \"maxStalenessSeconds\" array field to not be present with \"primary\" mode", ZSTR_VAL(php_phongo_writeconcern_ce->name));
167
+
phongo_throw_exception(PHONGO_ERROR_INVALID_ARGUMENTTSRMLS_CC, "%s initialization requires \"maxStalenessSeconds\" array field to not be present with \"primary\" mode", ZSTR_VAL(php_phongo_readpreference_ce->name));
phongo_throw_exception(PHONGO_ERROR_INVALID_ARGUMENTTSRMLS_CC, "%s initialization requires \"maxStalenessSeconds\" field to be integer", ZSTR_VAL(php_phongo_writeconcern_ce->name));
173
+
phongo_throw_exception(PHONGO_ERROR_INVALID_ARGUMENTTSRMLS_CC, "%s initialization requires \"maxStalenessSeconds\" field to be integer", ZSTR_VAL(php_phongo_readpreference_ce->name));
0 commit comments