-
Notifications
You must be signed in to change notification settings - Fork 209
report libraries runtime versions #120
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1870,7 +1870,23 @@ mongoc_client_t *php_phongo_make_mongo_client(const mongoc_uri_t *uri, zval *dri | |
php_phongo_populate_default_ssl_ctx(ctx, driverOptions); | ||
} | ||
|
||
MONGOC_DEBUG("Creating Manager, phongo-%s[%s] - mongoc-%s, libbson-%s", MONGODB_VERSION_S, MONGODB_STABILITY_S, MONGOC_VERSION_S, BSON_VERSION_S); | ||
MONGOC_DEBUG("Creating Manager, phongo-%s[%s] - mongoc-%s(%s), libbson-%s(%s), php-%s", | ||
MONGODB_VERSION_S, | ||
MONGODB_STABILITY_S, | ||
MONGOC_VERSION_S, | ||
#ifdef HAVE_SYSTEM_LIBMONGOC | ||
mongoc_get_version(), | ||
#else | ||
"bundled", | ||
#endif | ||
BSON_VERSION_S, | ||
#ifdef HAVE_SYSTEM_LIBBSON | ||
bson_get_version(), | ||
#else | ||
"bundled", | ||
#endif | ||
PHP_VERSION | ||
); | ||
client = mongoc_client_new_from_uri(uri); | ||
|
||
if (!client) { | ||
|
@@ -2375,8 +2391,19 @@ PHP_MINFO_FUNCTION(mongodb) | |
php_info_print_table_header(2, "mongodb support", "enabled"); | ||
php_info_print_table_row(2, "mongodb version", MONGODB_VERSION_S); | ||
php_info_print_table_row(2, "mongodb stability", MONGODB_STABILITY_S); | ||
#ifdef HAVE_SYSTEM_LIBMONGOC | ||
php_info_print_table_row(2, "libmongoc headers version", MONGOC_VERSION_S); | ||
php_info_print_table_row(2, "libmongoc library version", mongoc_get_version()); | ||
#else | ||
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. I would prefer to keep this consistent. Lets just always print out both compile time and lib 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. Or "libbson bundled version" ? 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. Ah ok. Makes sense. Shall we make that the third line? mongoc: system/bundled ? 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. I think having 1 line for bundled library and 2 for system library is quite common and consistent with other ext : see GD, msgpack, libsodium ...)... ok.... all added by me ;) 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. Notice: I CANNOT change now, as bson_get_version is not yet defined in bundled lib... (need to wait for PR #119) 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. hehe. ok. This is such a minor detail that as long as the output isn't vastly different then it isn't worth spending to much time on this. One thing that just hit me though, maybe we should update the trace line that reports these versions: I am hoping the only question we will ever need to ask users for support cases is:
Or
So it would be nice to know there if it was bundled/system. |
||
/* Bundled libraries, buildtime = runtime */ | ||
php_info_print_table_row(2, "libmongoc version", MONGOC_VERSION_S); | ||
#endif | ||
#ifdef HAVE_SYSTEM_LIBBSON | ||
php_info_print_table_row(2, "libbson headers version", BSON_VERSION_S); | ||
php_info_print_table_row(2, "libbson library version", bson_get_version()); | ||
#else | ||
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. same as above, lets always use this |
||
php_info_print_table_row(2, "libbson version", BSON_VERSION_S); | ||
#endif | ||
php_info_print_table_end(); | ||
|
||
DISPLAY_INI_ENTRIES(); | ||
|
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 appears to trigger Compiler Error C2121 in VC11, because we're using a macro within the
MONGOC_DEBUG()
macro. I believe a quick solution would be to populateconst char *
variables beforehand and use those as-is in theMONGOC_DEBUG()
macro.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.
Sorry for this... :(
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.
No worries! I've missed more than my fair share of Windows errors :)
5917787 should fix it.