@@ -94,7 +94,7 @@ zend_class_entry* phongo_exception_from_phongo_domain(php_phongo_error_domain_t
94
94
return php_phongo_connectionexception_ce ;
95
95
}
96
96
97
- mongoc_log ( MONGOC_LOG_LEVEL_ERROR , MONGOC_LOG_DOMAIN , "Resolving unknown exception domain!!!" );
97
+ MONGOC_ERROR ( "Resolving unknown exception domain!!!" );
98
98
return spl_ce_RuntimeException ;
99
99
}
100
100
zend_class_entry * phongo_exception_from_mongoc_domain (uint32_t /* mongoc_error_domain_t */ domain , uint32_t /* mongoc_error_code_t */ code )
@@ -743,7 +743,7 @@ void phongo_stream_destroy(mongoc_stream_t *stream_wrap) /* {{{ */
743
743
{
744
744
php_phongo_stream_socket * base_stream = (php_phongo_stream_socket * )stream_wrap ;
745
745
746
- mongoc_log ( MONGOC_LOG_LEVEL_DEBUG , MONGOC_LOG_DOMAIN , "Not destroying RSRC#%d" , base_stream -> stream -> rsrc_id );
746
+ MONGOC_DEBUG ( "Not destroying RSRC#%d" , base_stream -> stream -> rsrc_id );
747
747
/*
748
748
* DON'T DO ANYTHING TO THE INTERNAL base_stream->stream
749
749
* The stream should not be closed during normal dtor -- as we want it to
@@ -760,7 +760,7 @@ void phongo_stream_failed(mongoc_stream_t *stream_wrap) /* {{{ */
760
760
if (base_stream -> stream ) {
761
761
TSRMLS_FETCH_FROM_CTX (base_stream -> tsrm_ls );
762
762
763
- mongoc_log ( MONGOC_LOG_LEVEL_DEBUG , MONGOC_LOG_DOMAIN , "Destroying RSRC#%d" , base_stream -> stream -> rsrc_id );
763
+ MONGOC_DEBUG ( "Destroying RSRC#%d" , base_stream -> stream -> rsrc_id );
764
764
php_stream_free (base_stream -> stream , PHP_STREAM_FREE_CLOSE_PERSISTENT | PHP_STREAM_FREE_RSRC_DTOR );
765
765
base_stream -> stream = NULL ;
766
766
}
@@ -772,7 +772,7 @@ int phongo_stream_close(mongoc_stream_t *stream_wrap) /* {{{ */
772
772
{
773
773
php_phongo_stream_socket * base_stream = (php_phongo_stream_socket * )stream_wrap ;
774
774
775
- mongoc_log ( MONGOC_LOG_LEVEL_DEBUG , MONGOC_LOG_DOMAIN , "Closing RSRC#%d" , base_stream -> stream -> rsrc_id );
775
+ MONGOC_DEBUG ( "Closing RSRC#%d" , base_stream -> stream -> rsrc_id );
776
776
phongo_stream_destroy (stream_wrap );
777
777
return 0 ;
778
778
} /* }}} */
@@ -788,7 +788,7 @@ void php_phongo_set_timeout(php_phongo_stream_socket *base_stream, int32_t timeo
788
788
}
789
789
790
790
php_stream_set_option (base_stream -> stream , PHP_STREAM_OPTION_READ_TIMEOUT , 0 , & rtimeout );
791
- mongoc_log ( MONGOC_LOG_LEVEL_DEBUG , MONGOC_LOG_DOMAIN , "Setting timeout to: %d" , timeout_msec );
791
+ MONGOC_DEBUG ( "Setting timeout to: %d" , timeout_msec );
792
792
} /* }}} */
793
793
794
794
ssize_t phongo_stream_writev (mongoc_stream_t * stream , mongoc_iovec_t * iov , size_t iovcnt , int32_t timeout_msec ) /* {{{ */
@@ -818,7 +818,7 @@ ssize_t phongo_stream_readv(mongoc_stream_t *stream, mongoc_iovec_t *iov, size_t
818
818
819
819
do {
820
820
read = php_stream_read (base_stream -> stream , iov [cur ].iov_base , iov [cur ].iov_len );
821
- mongoc_log ( MONGOC_LOG_LEVEL_DEBUG , MONGOC_LOG_DOMAIN , "Reading got: %zd wanted: %zd" , read , min_bytes );
821
+ MONGOC_DEBUG ( "Reading got: %zd wanted: %zd" , read , min_bytes );
822
822
823
823
if (read <= 0 ) {
824
824
if (ret >= (ssize_t )min_bytes ) {
@@ -1042,7 +1042,7 @@ mongoc_stream_t* phongo_stream_initiator(const mongoc_uri_t *uri, const mongoc_h
1042
1042
1043
1043
spprintf (& uniqid , 0 , "%s:%d[%s]" , host -> host , host -> port , mongoc_uri_get_string (uri ));
1044
1044
1045
- mongoc_log ( MONGOC_LOG_LEVEL_DEBUG , MONGOC_LOG_DOMAIN , "Connecting to '%s'" , uniqid );
1045
+ MONGOC_DEBUG ( "Connecting to '%s'" , uniqid );
1046
1046
stream = php_stream_xport_create (dsn , dsn_len , 0 , STREAM_XPORT_CLIENT | STREAM_XPORT_CONNECT | STREAM_XPORT_CONNECT_ASYNC , uniqid , timeoutp , (php_stream_context * )user_data , & errmsg , & errcode );
1047
1047
1048
1048
if (!stream ) {
@@ -1056,15 +1056,15 @@ mongoc_stream_t* phongo_stream_initiator(const mongoc_uri_t *uri, const mongoc_h
1056
1056
}
1057
1057
php_stream_auto_cleanup (stream );
1058
1058
1059
- mongoc_log ( MONGOC_LOG_LEVEL_DEBUG , MONGOC_LOG_DOMAIN , "Created: RSRC#%d as '%s'" , stream -> rsrc_id , uniqid );
1059
+ MONGOC_DEBUG ( "Created: RSRC#%d as '%s'" , stream -> rsrc_id , uniqid );
1060
1060
efree (uniqid );
1061
1061
1062
1062
if (mongoc_uri_get_ssl (uri )) {
1063
1063
zend_error_handling error_handling ;
1064
1064
1065
1065
zend_replace_error_handling (EH_THROW , php_phongo_sslconnectionexception_ce , & error_handling TSRMLS_CC );
1066
1066
1067
- mongoc_log ( MONGOC_LOG_LEVEL_DEBUG , MONGOC_LOG_DOMAIN , "Enabling SSL" );
1067
+ MONGOC_DEBUG ( "Enabling SSL" );
1068
1068
1069
1069
/* Capture the server certificate so we can do further verification */
1070
1070
if (stream -> context ) {
@@ -1126,7 +1126,7 @@ mongoc_stream_t* phongo_stream_initiator(const mongoc_uri_t *uri, const mongoc_h
1126
1126
int flag = 1 ;
1127
1127
1128
1128
if (phongo_stream_setsockopt ((mongoc_stream_t * )base_stream , IPPROTO_TCP , TCP_NODELAY , (char * )& flag , sizeof (int ))) {
1129
- mongoc_log ( MONGOC_LOG_LEVEL_WARNING , MONGOC_LOG_DOMAIN , "setsockopt TCP_NODELAY failed" );
1129
+ MONGOC_WARNING ( "setsockopt TCP_NODELAY failed" );
1130
1130
}
1131
1131
}
1132
1132
@@ -1308,11 +1308,14 @@ mongoc_client_t *php_phongo_make_mongo_client(const char *uri, zval *driverOptio
1308
1308
php_stream_context * ctx ;
1309
1309
const char * mech ;
1310
1310
const mongoc_uri_t * muri ;
1311
- mongoc_client_t * client = mongoc_client_new (uri );
1311
+ mongoc_client_t * client = mongoc_client_new (uri );
1312
+
1313
+
1314
+ ENTRY ;
1312
1315
1313
1316
1314
1317
if (!client ) {
1315
- return false;
1318
+ RETURN ( false) ;
1316
1319
}
1317
1320
1318
1321
if (driverOptions && zend_hash_find (Z_ARRVAL_P (driverOptions ), "context" , strlen ("context" ) + 1 , (void * * )& tmp ) == SUCCESS ) {
@@ -1392,7 +1395,7 @@ mongoc_client_t *php_phongo_make_mongo_client(const char *uri, zval *driverOptio
1392
1395
1393
1396
mongoc_client_set_stream_initiator (client , phongo_stream_initiator , ctx );
1394
1397
1395
- return client ;
1398
+ RETURN ( client ) ;
1396
1399
} /* }}} */
1397
1400
1398
1401
void php_phongo_new_utcdatetime_from_epoch (zval * object , int64_t msec_since_epoch TSRMLS_DC ) /* {{{ */
0 commit comments