Skip to content

Commit efde19a

Browse files
remicolletjmikola
authored andcommitted
report runtime version in debug mode
1 parent 064c8a2 commit efde19a

File tree

4 files changed

+19
-4
lines changed

4 files changed

+19
-4
lines changed

php_phongo.c

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1883,7 +1883,22 @@ mongoc_client_t *php_phongo_make_mongo_client(const mongoc_uri_t *uri, zval *dri
18831883
php_phongo_populate_default_ssl_ctx(ctx, driverOptions);
18841884
}
18851885

1886-
MONGOC_DEBUG("Creating Manager, phongo-%s[%s] - mongoc-%s, libbson-%s", MONGODB_VERSION_S, MONGODB_STABILITY_S, MONGOC_VERSION_S, BSON_VERSION_S);
1886+
MONGOC_DEBUG("Creating Manager, phongo-%s[%s] - mongoc-%s(%s), libbson-%s(%s)",
1887+
MONGODB_VERSION_S,
1888+
MONGODB_STABILITY_S,
1889+
MONGOC_VERSION_S,
1890+
#ifdef HAVE_SYSTEM_LIBMONGOC
1891+
mongoc_get_version(),
1892+
#else
1893+
"bundled",
1894+
#endif
1895+
BSON_VERSION_S,
1896+
#ifdef HAVE_SYSTEM_LIBBSON
1897+
bson_get_version()
1898+
#else
1899+
"bundled"
1900+
#endif
1901+
);
18871902
client = mongoc_client_new_from_uri(uri);
18881903

18891904
if (!client) {

tests/manager/manager-debug-001.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ foreach($content as $line) {
3030
===DONE===
3131
<?php exit(0); ?>
3232
--EXPECTF--
33-
[%s] PHONGO: DEBUG > Creating Manager, phongo-1.%d.%d%S[%s] - mongoc-1.%s, libbson-1.%s
33+
[%s] PHONGO: DEBUG > Creating Manager, phongo-1.%d.%d%S[%s] - mongoc-1.%s(%s), libbson-1.%s(%s)
3434
[%s] mongoc: TRACE > ENTRY: mongoc_bulk_operation_execute():%d
3535
[%s] mongoc: TRACE > EXIT: mongoc_bulk_operation_execute():%d
3636
===DONE===

tests/manager/manager-debug-002.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ ini_set("mongodb.debug", "off");
2020
<?php exit(0); ?>
2121
--EXPECTF--
2222
%a
23-
[%s] PHONGO: DEBUG > Creating Manager, phongo-1.%d.%d%S[%s] - mongoc-1.%s, libbson-1.%s
23+
[%s] PHONGO: DEBUG > Creating Manager, phongo-1.%d.%d%S[%s] - mongoc-1.%s(%s), libbson-1.%s(%s)
2424
%a
2525
[%s] PHONGO: DEBUG > Connecting to '%s:%d[mongodb://%s:%d]'
2626
%a

tests/manager/manager-debug-003.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ ini_set("mongodb.debug", "off");
2121
--EXPECTF--
2222
%a
2323
[%s] PHONGO: TRACE > ENTRY: php_phongo_make_mongo_client():%d
24-
[%s] PHONGO: DEBUG > Creating Manager, phongo-1.%d.%d%S[%s] - mongoc-1.%s, libbson-1.%s
24+
[%s] PHONGO: DEBUG > Creating Manager, phongo-1.%d.%d%S[%s] - mongoc-1.%s(%s), libbson-1.%s(%s)
2525
%a
2626
===DONE===

0 commit comments

Comments
 (0)