Skip to content

Commit c286209

Browse files
committed
PHPC-241: Include lib versions and uri in the logs
1 parent bcf3d9b commit c286209

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

php_phongo.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1313,6 +1313,14 @@ mongoc_client_t *php_phongo_make_mongo_client(const char *uri, zval *driverOptio
13131313

13141314
ENTRY;
13151315

1316+
if (driverOptions && zend_hash_find(Z_ARRVAL_P(driverOptions), "debug", strlen("debug") + 1, (void**)&tmp) == SUCCESS) {
1317+
convert_to_string(*tmp);
1318+
1319+
zend_alter_ini_entry_ex((char *)PHONGO_DEBUG_INI, sizeof(PHONGO_DEBUG_INI), Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), PHP_INI_USER, PHP_INI_STAGE_RUNTIME, 0 TSRMLS_CC);
1320+
}
1321+
1322+
MONGOC_DEBUG("Creating Manager, phongo-%s[%s] - mongoc-%s, libbson-%s", MONGODB_VERSION_S, MONGODB_STABILITY_S, MONGOC_VERSION_S, BSON_VERSION_S);
1323+
MONGOC_DEBUG("Connecting to '%s'", uri);
13161324

13171325
if (!client) {
13181326
RETURN(false);
@@ -1387,12 +1395,6 @@ mongoc_client_t *php_phongo_make_mongo_client(const char *uri, zval *driverOptio
13871395
}
13881396
}
13891397

1390-
if (driverOptions && zend_hash_find(Z_ARRVAL_P(driverOptions), "debug", strlen("debug") + 1, (void**)&tmp) == SUCCESS) {
1391-
convert_to_string(*tmp);
1392-
1393-
zend_alter_ini_entry_ex((char *)PHONGO_DEBUG_INI, sizeof(PHONGO_DEBUG_INI), Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), PHP_INI_USER, PHP_INI_STAGE_RUNTIME, 0 TSRMLS_CC);
1394-
}
1395-
13961398
mongoc_client_set_stream_initiator(client, phongo_stream_initiator, ctx);
13971399

13981400
RETURN(client);

0 commit comments

Comments
 (0)