@@ -374,7 +374,7 @@ php_phongo_writeresult_t *phongo_writeresult_init(zval *return_value, mongoc_wri
374
374
375
375
/* {{{ CRUD */
376
376
/* Splits a namespace name into the database and collection names, allocated with estrdup. */
377
- bool phongo_split_namespace (char * namespace , char * * dbname , char * * cname ) /* {{{ */
377
+ bool phongo_split_namespace (const char * namespace , char * * dbname , char * * cname ) /* {{{ */
378
378
{
379
379
char * dot = strchr (namespace , '.' );
380
380
@@ -416,7 +416,7 @@ void phongo_unwrap_exception(bool retval, zval *return_value TSRMLS_DC)
416
416
}
417
417
}
418
418
419
- int phongo_execute_single_insert (mongoc_client_t * client , char * namespace , bson_t * doc , mongoc_write_concern_t * write_concern , zval * return_value , int return_value_used TSRMLS_DC ) /* {{{ */
419
+ int phongo_execute_single_insert (mongoc_client_t * client , const char * namespace , const bson_t * doc , const mongoc_write_concern_t * write_concern , zval * return_value , int return_value_used TSRMLS_DC ) /* {{{ */
420
420
{
421
421
bool retval = false;
422
422
mongoc_bulk_operation_t * bulk ;
@@ -431,7 +431,7 @@ int phongo_execute_single_insert(mongoc_client_t *client, char *namespace, bson_
431
431
return retval ;
432
432
} /* }}} */
433
433
434
- int phongo_execute_single_update (mongoc_client_t * client , char * namespace , bson_t * query , bson_t * update , mongoc_write_concern_t * write_concern , mongoc_update_flags_t flags , zval * return_value , int return_value_used TSRMLS_DC ) /* {{{ */
434
+ int phongo_execute_single_update (mongoc_client_t * client , const char * namespace , const bson_t * query , const bson_t * update , const mongoc_write_concern_t * write_concern , mongoc_update_flags_t flags , zval * return_value , int return_value_used TSRMLS_DC ) /* {{{ */
435
435
{
436
436
bool retval = false;
437
437
mongoc_bulk_operation_t * bulk ;
@@ -449,7 +449,7 @@ int phongo_execute_single_update(mongoc_client_t *client, char *namespace, bson_
449
449
return retval ;
450
450
} /* }}} */
451
451
452
- int phongo_execute_single_delete (mongoc_client_t * client , char * namespace , bson_t * query , mongoc_write_concern_t * write_concern , mongoc_delete_flags_t flags , zval * return_value , int return_value_used TSRMLS_DC ) /* {{{ */
452
+ int phongo_execute_single_delete (mongoc_client_t * client , const char * namespace , const bson_t * query , const mongoc_write_concern_t * write_concern , mongoc_delete_flags_t flags , zval * return_value , int return_value_used TSRMLS_DC ) /* {{{ */
453
453
{
454
454
bool retval = false;
455
455
mongoc_bulk_operation_t * bulk ;
@@ -468,7 +468,7 @@ int phongo_execute_single_delete(mongoc_client_t *client, char *namespace, bson_
468
468
return retval ;
469
469
} /* }}} */
470
470
471
- bool phongo_execute_write (mongoc_client_t * client , char * namespace , mongoc_bulk_operation_t * bulk , mongoc_write_concern_t * write_concern , int server_hint , zval * return_value , int return_value_used TSRMLS_DC ) /* {{{ */
471
+ bool phongo_execute_write (mongoc_client_t * client , const char * namespace , mongoc_bulk_operation_t * bulk , const mongoc_write_concern_t * write_concern , int server_hint , zval * return_value , int return_value_used TSRMLS_DC ) /* {{{ */
472
472
{
473
473
bson_error_t error ;
474
474
char * dbname ;
@@ -535,7 +535,7 @@ bool phongo_execute_write(mongoc_client_t *client, char *namespace, mongoc_bulk_
535
535
return true;
536
536
} /* }}} */
537
537
538
- int phongo_execute_query (mongoc_client_t * client , char * namespace , php_phongo_query_t * query , mongoc_read_prefs_t * read_preference , zval * return_value , int return_value_used TSRMLS_DC ) /* {{{ */
538
+ int phongo_execute_query (mongoc_client_t * client , const char * namespace , const php_phongo_query_t * query , const mongoc_read_prefs_t * read_preference , zval * return_value , int return_value_used TSRMLS_DC ) /* {{{ */
539
539
{
540
540
const bson_t * doc = NULL ;
541
541
mongoc_cursor_t * cursor ;
@@ -581,7 +581,7 @@ int phongo_execute_query(mongoc_client_t *client, char *namespace, php_phongo_qu
581
581
return true;
582
582
} /* }}} */
583
583
584
- int phongo_execute_command (mongoc_client_t * client , char * db , bson_t * command , mongoc_read_prefs_t * read_preference , zval * return_value , int return_value_used TSRMLS_DC ) /* {{{ */
584
+ int phongo_execute_command (mongoc_client_t * client , const char * db , const bson_t * command , const mongoc_read_prefs_t * read_preference , zval * return_value , int return_value_used TSRMLS_DC ) /* {{{ */
585
585
{
586
586
mongoc_cursor_t * cursor ;
587
587
const bson_t * doc ;
@@ -897,7 +897,7 @@ mongoc_stream_t* phongo_stream_initiator(const mongoc_uri_t *uri, const mongoc_h
897
897
898
898
/* }}} */
899
899
900
- mongoc_write_concern_t * phongo_write_concern_from_zval (zval * zwrite_concern TSRMLS_DC ) /* {{{ */
900
+ const mongoc_write_concern_t * phongo_write_concern_from_zval (zval * zwrite_concern TSRMLS_DC ) /* {{{ */
901
901
{
902
902
if (zwrite_concern ) {
903
903
php_phongo_writeconcern_t * intern = (php_phongo_writeconcern_t * )zend_object_store_get_object (zwrite_concern TSRMLS_CC );
@@ -910,7 +910,7 @@ mongoc_write_concern_t* phongo_write_concern_from_zval(zval *zwrite_concern TSRM
910
910
return NULL ;
911
911
} /* }}} */
912
912
913
- mongoc_read_prefs_t * phongo_read_preference_from_zval (zval * zread_preference TSRMLS_DC ) /* {{{ */
913
+ const mongoc_read_prefs_t * phongo_read_preference_from_zval (zval * zread_preference TSRMLS_DC ) /* {{{ */
914
914
{
915
915
if (zread_preference ) {
916
916
php_phongo_readpreference_t * intern = (php_phongo_readpreference_t * )zend_object_store_get_object (zread_preference TSRMLS_CC );
@@ -923,7 +923,7 @@ mongoc_read_prefs_t* phongo_read_preference_from_zval(zval *zread_preference TSR
923
923
return NULL ;
924
924
} /* }}} */
925
925
926
- php_phongo_query_t * phongo_query_from_zval (zval * zquery TSRMLS_DC ) /* {{{ */
926
+ const php_phongo_query_t * phongo_query_from_zval (zval * zquery TSRMLS_DC ) /* {{{ */
927
927
{
928
928
php_phongo_query_t * intern = (php_phongo_query_t * )zend_object_store_get_object (zquery TSRMLS_CC );
929
929
@@ -1041,7 +1041,7 @@ void php_phongo_objectid_new_from_oid(zval *object, const bson_oid_t *oid TSRMLS
1041
1041
} /* }}} */
1042
1042
1043
1043
1044
- void php_phongo_read_preference_to_zval (zval * retval , mongoc_read_prefs_t * read_prefs ) /* {{{ */
1044
+ void php_phongo_read_preference_to_zval (zval * retval , const mongoc_read_prefs_t * read_prefs ) /* {{{ */
1045
1045
{
1046
1046
1047
1047
array_init_size (retval , 2 );
@@ -1058,17 +1058,17 @@ void php_phongo_read_preference_to_zval(zval *retval, mongoc_read_prefs_t *read_
1058
1058
}
1059
1059
} /* }}} */
1060
1060
1061
- void php_phongo_write_concern_to_zval (zval * retval , mongoc_write_concern_t * write_concern ) /* {{{ */
1061
+ void php_phongo_write_concern_to_zval (zval * retval , const mongoc_write_concern_t * write_concern ) /* {{{ */
1062
1062
{
1063
1063
const char * wtag = mongoc_write_concern_get_wtag (write_concern );
1064
1064
const int32_t w = mongoc_write_concern_get_w (write_concern );
1065
1065
1066
1066
array_init_size (retval , 5 );
1067
1067
1068
1068
if (wtag ) {
1069
- add_assoc_string_ex (retval , ZEND_STRS ("w" ), wtag , 1 );
1069
+ add_assoc_string_ex (retval , ZEND_STRS ("w" ), ( char * ) wtag , 1 );
1070
1070
} else if (mongoc_write_concern_get_wmajority (write_concern )) {
1071
- add_assoc_string_ex (retval , ZEND_STRS ("w" ), "majority" , 1 );
1071
+ add_assoc_string_ex (retval , ZEND_STRS ("w" ), ( char * ) "majority" , 1 );
1072
1072
} else if (w != MONGOC_WRITE_CONCERN_W_DEFAULT ) {
1073
1073
add_assoc_long_ex (retval , ZEND_STRS ("w" ), w );
1074
1074
}
@@ -1559,7 +1559,7 @@ void _phongo_debug_bson(bson_t *bson)
1559
1559
1560
1560
/* {{{ INI entries */
1561
1561
PHP_INI_BEGIN ()
1562
- STD_PHP_INI_ENTRY ("phongo.debug_log" , (char * )"" , PHP_INI_ALL , OnUpdateString , debug_log , zend_phongo_globals , phongo_globals )
1562
+ STD_PHP_INI_ENTRY (( char * ) "phongo.debug_log" , (char * )"" , PHP_INI_ALL , OnUpdateString , debug_log , zend_phongo_globals , phongo_globals )
1563
1563
PHP_INI_END ()
1564
1564
/* }}} */
1565
1565
0 commit comments