@@ -253,10 +253,9 @@ static void php_phongo_log(mongoc_log_level_t log_level, const char* log_domain,
253253{
254254 struct timeval tv ;
255255 time_t t ;
256- phongo_long tu ;
257- phongo_char * dt ;
256+ zend_long tu ;
257+ zend_string * dt ;
258258
259- PHONGO_TSRMLS_FETCH_FROM_CTX (user_data );
260259 (void ) user_data ;
261260
262261 gettimeofday (& tv , NULL );
@@ -663,7 +662,7 @@ static bool phongo_parse_write_concern(zval* options, bson_t* mongoc_opts, zval*
663662 return true;
664663}
665664
666- bool phongo_execute_bulk_write (mongoc_client_t * client , const char * namespace , php_phongo_bulkwrite_t * bulk_write , zval * options , uint32_t server_id , zval * return_value , int return_value_used TSRMLS_DC ) /* {{{ */
665+ bool phongo_execute_bulk_write (mongoc_client_t * client , const char * namespace , php_phongo_bulkwrite_t * bulk_write , zval * options , uint32_t server_id , zval * return_value TSRMLS_DC ) /* {{{ */
667666{
668667 bson_error_t error = { 0 };
669668 int success ;
@@ -721,12 +720,6 @@ bool phongo_execute_bulk_write(mongoc_client_t* client, const char* namespace, p
721720 success = mongoc_bulk_operation_execute (bulk , & reply , & error );
722721 bulk_write -> executed = true;
723722
724- /* Write succeeded and the user doesn't care for the results */
725- if (success && !return_value_used ) {
726- bson_destroy (& reply );
727- return true;
728- }
729-
730723 writeresult = phongo_writeresult_init (return_value , & reply , client , mongoc_bulk_operation_get_hint (bulk ) TSRMLS_CC );
731724 writeresult -> write_concern = mongoc_write_concern_copy (write_concern );
732725
@@ -794,7 +787,7 @@ bool phongo_cursor_advance_and_check_for_error(mongoc_cursor_t* cursor TSRMLS_DC
794787 return true;
795788} /* }}} */
796789
797- bool phongo_execute_query (mongoc_client_t * client , const char * namespace , zval * zquery , zval * options , uint32_t server_id , zval * return_value , int return_value_used TSRMLS_DC ) /* {{{ */
790+ bool phongo_execute_query (mongoc_client_t * client , const char * namespace , zval * zquery , zval * options , uint32_t server_id , zval * return_value TSRMLS_DC ) /* {{{ */
798791{
799792 const php_phongo_query_t * query ;
800793 bson_t opts = BSON_INITIALIZER ;
@@ -856,11 +849,6 @@ bool phongo_execute_query(mongoc_client_t* client, const char* namespace, zval*
856849 return false;
857850 }
858851
859- if (!return_value_used ) {
860- mongoc_cursor_destroy (cursor );
861- return true;
862- }
863-
864852 phongo_cursor_init_for_query (return_value , client , cursor , namespace , zquery , zreadPreference , zsession TSRMLS_CC );
865853
866854 return true;
@@ -897,7 +885,7 @@ static zval* phongo_create_implicit_session(mongoc_client_t* client TSRMLS_DC) /
897885 return zsession ;
898886} /* }}} */
899887
900- bool phongo_execute_command (mongoc_client_t * client , php_phongo_command_type_t type , const char * db , zval * zcommand , zval * options , uint32_t server_id , zval * return_value , int return_value_used TSRMLS_DC ) /* {{{ */
888+ bool phongo_execute_command (mongoc_client_t * client , php_phongo_command_type_t type , const char * db , zval * zcommand , zval * options , uint32_t server_id , zval * return_value TSRMLS_DC ) /* {{{ */
901889{
902890 const php_phongo_command_t * command ;
903891 bson_iter_t iter ;
@@ -1003,10 +991,6 @@ bool phongo_execute_command(mongoc_client_t* client, php_phongo_command_type_t t
1003991 goto cleanup ;
1004992 }
1005993
1006- if (!return_value_used ) {
1007- goto cleanup ;
1008- }
1009-
1010994 /* According to mongoc_cursor_new_from_command_reply_with_opts(), the reply
1011995 * bson_t is ultimately destroyed on both success and failure. */
1012996 if (bson_iter_init_find (& iter , & reply , "cursor" ) && BSON_ITER_HOLDS_DOCUMENT (& iter )) {
@@ -1165,7 +1149,7 @@ bool php_phongo_server_to_zval(zval* retval, mongoc_server_description_t* sd) /*
11651149
11661150 ADD_ASSOC_ZVAL_EX (retval , "last_is_master" , & state .zchild );
11671151 }
1168- ADD_ASSOC_LONG_EX (retval , "round_trip_time" , (phongo_long ) mongoc_server_description_round_trip_time (sd ));
1152+ ADD_ASSOC_LONG_EX (retval , "round_trip_time" , (zend_long ) mongoc_server_description_round_trip_time (sd ));
11691153
11701154 return true;
11711155} /* }}} */
@@ -3113,7 +3097,7 @@ void phongo_manager_init(php_phongo_manager_t* manager, const char* uri_string,
31133097#endif
31143098} /* }}} */
31153099
3116- bool php_phongo_parse_int64 (int64_t * retval , const char * data , phongo_zpp_char_len data_len ) /* {{{ */
3100+ bool php_phongo_parse_int64 (int64_t * retval , const char * data , size_t data_len ) /* {{{ */
31173101{
31183102 int64_t value ;
31193103 char * endptr = NULL ;
@@ -3200,7 +3184,7 @@ ZEND_INI_MH(OnUpdateDebug)
32003184 int fd = -1 ;
32013185 char * prefix ;
32023186 int len ;
3203- phongo_char * filename ;
3187+ zend_string * filename ;
32043188
32053189 time (& t );
32063190 len = spprintf (& prefix , 0 , "PHONGO-%ld" , t );
0 commit comments