@@ -462,10 +462,10 @@ static const char *phongo_cluster_state_tostring(mongoc_cluster_state_t state)
462
462
463
463
static void add_next_index_node (zval * array , mongoc_cluster_node_t * node )
464
464
{
465
+ zval * data = NULL ;
465
466
php_phongo_bson_state state = PHONGO_BSON_STATE_INITIALIZER ;
466
467
467
468
MAKE_STD_ZVAL (state .zchild );
468
- zval * data = NULL ;
469
469
470
470
MAKE_STD_ZVAL (data );
471
471
array_init (data );
@@ -502,7 +502,6 @@ HashTable *php_phongo_manager_get_debug_info(zval *object, int *is_temp TSRMLS_D
502
502
503
503
MAKE_STD_ZVAL (retval );
504
504
array_init (retval );
505
- add_assoc_string_ex (retval , ZEND_STRS ("foobar" ), (char * )"some other cool stuff" , 0 );
506
505
507
506
add_assoc_long_ex (retval , ZEND_STRS ("request_id" ), intern -> client -> request_id );
508
507
add_assoc_string_ex (retval , ZEND_STRS ("uri" ), (char * )mongoc_uri_get_string (intern -> client -> uri ), 0 );
@@ -551,7 +550,11 @@ HashTable *php_phongo_manager_get_debug_info(zval *object, int *is_temp TSRMLS_D
551
550
}
552
551
add_assoc_zval_ex (cluster , ZEND_STRS ("peers" ), peers );
553
552
}
554
- add_assoc_string_ex (cluster , ZEND_STRS ("replSet" ), intern -> client -> cluster .replSet , 0 );
553
+ if (intern -> client -> cluster .replSet ) {
554
+ add_assoc_string_ex (cluster , ZEND_STRS ("replSet" ), intern -> client -> cluster .replSet , 0 );
555
+ } else {
556
+ add_assoc_null_ex (cluster , ZEND_STRS ("replSet" ));
557
+ }
555
558
556
559
add_assoc_zval_ex (retval , ZEND_STRS ("cluster" ), cluster );
557
560
}
0 commit comments