Skip to content

Commit f3b2c80

Browse files
committed
PHPC-663: Add SSL/SASL support to phpinfo() output
1 parent e9e8443 commit f3b2c80

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

config.m4

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,7 @@ PHP_ARG_WITH(libmongoc, whether to use system libmongoc,
367367
PHP_SETUP_OPENSSL(MONGODB_SHARED_LIBADD)
368368
MONGOC_ENABLE_SSL=1
369369
AC_SUBST(MONGOC_ENABLE_SSL)
370+
AC_DEFINE(HAVE_MONGOC_SSL, 1, "Whether SSL is enabled in the bundled libmongoc")
370371
fi
371372

372373

@@ -419,6 +420,7 @@ if test "$PHP_MONGODB_SASL" != "no"; then
419420
PHP_ADD_LIBRARY_WITH_PATH(sasl2, $MONGODB_SASL_DIR/$PHP_LIBDIR, MONGODB_SHARED_LIBADD)
420421
MONGOC_ENABLE_SASL=1
421422
AC_SUBST(MONGOC_ENABLE_SASL)
423+
AC_DEFINE(HAVE_MONGOC_SASL, 1, "Whether SASL is enabled in the bundled libmongoc")
422424
], [
423425
if test "$MONGODB_SASL" != "auto"; then
424426
AC_MSG_ERROR([MONGO SASL check failed. Please check config.log for more information.])

config.w32

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,11 @@ if (PHP_MONGODB != "no") {
2525

2626
if (!CHECK_LIB("libsasl.lib", "mongodb", PHP_MONGODB)) {
2727
WARNING("mongodb libsasl support not enabled, libs not found");
28+
} else {
29+
AC_DEFINE("HAVE_MONGOC_SASL", 1);
2830
}
2931
if (CHECK_LIB("ssleay32.lib", "mongodb", PHP_MONGODB) && CHECK_LIB("libeay32.lib", "mongodb", PHP_MONGODB) && CHECK_HEADER_ADD_INCLUDE("openssl/ssl.h", "CFLAGS_MONGOC")) {
32+
AC_DEFINE("HAVE_MONGOC_SSL", 1);
3033
}
3134

3235
FSO.CopyFile(configure_module_dirname + "/win32/bson-config.h", configure_module_dirname + "/src/libbson/src/bson/bson-config.h", true);

php_phongo.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2583,6 +2583,16 @@ PHP_MINFO_FUNCTION(mongodb)
25832583
#else
25842584
/* Bundled libraries, buildtime = runtime */
25852585
php_info_print_table_row(2, "libmongoc version", MONGOC_VERSION_S);
2586+
# if HAVE_MONGOC_SSL
2587+
php_info_print_table_row(2, "libmongoc SSL support", "yes");
2588+
# else
2589+
php_info_print_table_row(2, "libmongoc SSL support", "no");
2590+
# endif
2591+
# if HAVE_MONGOC_SASL
2592+
php_info_print_table_row(2, "libmongoc SASL support", "yes");
2593+
# else
2594+
php_info_print_table_row(2, "libmongoc SASL support", "no");
2595+
# endif
25862596
#endif
25872597
#ifdef HAVE_SYSTEM_LIBBSON
25882598
php_info_print_table_row(2, "libbson headers version", BSON_VERSION_S);

0 commit comments

Comments
 (0)