Skip to content

PHPC-716: Support new readConcern level 'linearizable' #379

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

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -241,13 +241,15 @@ if test "$MONGODB" != "no"; then
mongoc-cursor-cursorid.c \
mongoc-cursor-transform.c \
mongoc-database.c \
mongoc-linux-distro-scanner.c \
mongoc-find-and-modify.c \
mongoc-host-list.c \
mongoc-init.c \
mongoc-gridfs.c \
mongoc-gridfs-file.c \
mongoc-gridfs-file-page.c \
mongoc-gridfs-file-list.c \
mongoc-handshake.c \
mongoc-index.c \
mongoc-list.c \
mongoc-log.c \
Expand Down Expand Up @@ -414,6 +416,8 @@ PHP_ARG_WITH(libmongoc, whether to use system libmongoc,
AC_SUBST(MONGOC_ENABLE_SSL_SECURE_CHANNEL, 0)
AC_SUBST(MONGOC_ENABLE_CRYPTO_CNG, 0)

AC_SUBST(MONGOC_ENABLE_SSL_LIBRESSL, 0)

AC_SUBST(MONGOC_NO_AUTOMATIC_GLOBALS, 1)
AC_SUBST(MONGOC_EXPERIMENTAL_FEATURES, 0)
fi
Expand Down
14 changes: 9 additions & 5 deletions php_phongo.c
Original file line number Diff line number Diff line change
Expand Up @@ -1390,8 +1390,6 @@ static mongoc_client_t *php_phongo_make_mongo_client(const mongoc_uri_t *uri, zv
const char *mongoc_version, *bson_version;
mongoc_client_t *client;

ENTRY;

#if PHP_VERSION_ID >= 70000
if (driverOptions && (zdebug = zend_hash_str_find(Z_ARRVAL_P(driverOptions), "debug", sizeof("debug")-1)) != NULL) {
zend_string *key = zend_string_init(PHONGO_DEBUG_INI, sizeof(PHONGO_DEBUG_INI)-1, 0);
Expand Down Expand Up @@ -1432,17 +1430,17 @@ static mongoc_client_t *php_phongo_make_mongo_client(const mongoc_uri_t *uri, zv
client = mongoc_client_new_from_uri(uri);

if (!client) {
RETURN(NULL);
return NULL;
}

if (mongoc_uri_get_ssl(uri) && driverOptions) {
if (!php_phongo_apply_ssl_opts(client, driverOptions TSRMLS_CC)) {
mongoc_client_destroy(client);
RETURN(NULL);
return NULL;
}
}

RETURN(client);
return client;
} /* }}} */

bool phongo_manager_init(php_phongo_manager_t *manager, const char *uri_string, bson_t *bson_options, zval *driverOptions TSRMLS_DC) /* {{{ */
Expand Down Expand Up @@ -1880,11 +1878,17 @@ PHP_MINIT_FUNCTION(mongodb)
{
(void)type; /* We don't care if we are loaded via dl() or extension= */

char *php_version_string = malloc(4 + sizeof(MONGODB_VERSION_S) + 1);

REGISTER_INI_ENTRIES();

/* Initialize libmongoc */
mongoc_init();

/* Set handshake options */
snprintf(php_version_string, 4 + sizeof(MONGODB_VERSION_S) + 1, "PHP %s", PHP_VERSION);
mongoc_handshake_data_append("ext-mongodb:PHP", MONGODB_VERSION_S, php_version_string);

/* Initialize libbson */
bson_mem_set_vtable(&MONGODB_G(bsonMemVTable));

Expand Down
1 change: 1 addition & 0 deletions src/MongoDB/ReadConcern.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ PHP_MINIT_FUNCTION(ReadConcern)

zend_declare_class_constant_stringl(php_phongo_readconcern_ce, ZEND_STRL("LOCAL"), ZEND_STRL(MONGOC_READ_CONCERN_LEVEL_LOCAL) TSRMLS_CC);
zend_declare_class_constant_stringl(php_phongo_readconcern_ce, ZEND_STRL("MAJORITY"), ZEND_STRL(MONGOC_READ_CONCERN_LEVEL_MAJORITY) TSRMLS_CC);
zend_declare_class_constant_stringl(php_phongo_readconcern_ce, ZEND_STRL("LINEARIZABLE"), ZEND_STRL(MONGOC_READ_CONCERN_LEVEL_LINEARIZABLE) TSRMLS_CC);

return SUCCESS;
}
Expand Down
2 changes: 1 addition & 1 deletion src/libmongoc
Submodule libmongoc updated 250 files
2 changes: 0 additions & 2 deletions tests/bson/bug0544.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
PHPC-544: Consult SIZEOF_ZEND_LONG for 64-bit integer support
--SKIPIF--
<?php if (8 !== PHP_INT_SIZE) { die('skip Only for 64-bit platform'); } ?>
--INI--
mongodb.debug=stderr
--FILE--
<?php

Expand Down
2 changes: 0 additions & 2 deletions tests/bson/bug0623.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
PHPC-623: Numeric keys limited to unsigned 32-bit integer
--SKIPIF--
<?php if (8 !== PHP_INT_SIZE) { die('skip Only for 64-bit platform'); } ?>
--INI--
mongodb.debug=stderr
--FILE--
<?php

Expand Down
26 changes: 0 additions & 26 deletions tests/manager/manager-debug-003.phpt

This file was deleted.

3 changes: 2 additions & 1 deletion tests/manager/manager-var-dump-001.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ object(MongoDB\Driver\Manager)#%d (%d) {
["is_passive"]=>
bool(false)
["last_is_master"]=>
array(8) {
array(%d) {
["ismaster"]=>
bool(true)
["maxBsonObjectSize"]=>
Expand All @@ -68,6 +68,7 @@ object(MongoDB\Driver\Manager)#%d (%d) {
int(%d)
["minWireVersion"]=>
int(0)
%a
["ok"]=>
float(1)
}
Expand Down
3 changes: 2 additions & 1 deletion tests/server/server-debug.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ object(MongoDB\Driver\Server)#%d (%d) {
["is_passive"]=>
bool(false)
["last_is_master"]=>
array(8) {
array(%d) {
["ismaster"]=>
bool(true)
["maxBsonObjectSize"]=>
Expand All @@ -51,6 +51,7 @@ object(MongoDB\Driver\Server)#%d (%d) {
int(%d)
["minWireVersion"]=>
int(0)
%a
["ok"]=>
float(1)
}
Expand Down