Skip to content

Commit b20a14e

Browse files
committed
Use 'a' instead of 'z' for new Execute*Command methods, and fix arg info
1 parent 91cd821 commit b20a14e

File tree

2 files changed

+23
-11
lines changed

2 files changed

+23
-11
lines changed

src/MongoDB/Manager.c

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ static PHP_METHOD(Manager, executeReadCommand)
316316
DECLARE_RETURN_VALUE_USED
317317
SUPPRESS_UNUSED_WARNING(return_value_ptr)
318318

319-
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sO|z!", &db, &db_len, &command, php_phongo_command_ce, &options) == FAILURE) {
319+
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sO|a!", &db, &db_len, &command, php_phongo_command_ce, &options) == FAILURE) {
320320
return;
321321
}
322322

@@ -337,7 +337,7 @@ static PHP_METHOD(Manager, executeWriteCommand)
337337
DECLARE_RETURN_VALUE_USED
338338
SUPPRESS_UNUSED_WARNING(return_value_ptr)
339339

340-
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sO|z!", &db, &db_len, &command, php_phongo_command_ce, &options) == FAILURE) {
340+
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sO|a!", &db, &db_len, &command, php_phongo_command_ce, &options) == FAILURE) {
341341
return;
342342
}
343343

@@ -358,7 +358,7 @@ static PHP_METHOD(Manager, executeReadWriteCommand)
358358
DECLARE_RETURN_VALUE_USED
359359
SUPPRESS_UNUSED_WARNING(return_value_ptr)
360360

361-
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sO|z!", &db, &db_len, &command, php_phongo_command_ce, &options) == FAILURE) {
361+
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sO|a!", &db, &db_len, &command, php_phongo_command_ce, &options) == FAILURE) {
362362
return;
363363
}
364364

@@ -551,6 +551,12 @@ ZEND_BEGIN_ARG_INFO_EX(ai_Manager_executeCommand, 0, 0, 2)
551551
ZEND_ARG_INFO(0, options)
552552
ZEND_END_ARG_INFO()
553553

554+
ZEND_BEGIN_ARG_INFO_EX(ai_Manager_executeRWCommand, 0, 0, 2)
555+
ZEND_ARG_INFO(0, db)
556+
ZEND_ARG_OBJ_INFO(0, command, MongoDB\\Driver\\Command, 0)
557+
ZEND_ARG_ARRAY_INFO(0, options, 0)
558+
ZEND_END_ARG_INFO()
559+
554560
ZEND_BEGIN_ARG_INFO_EX(ai_Manager_executeQuery, 0, 0, 2)
555561
ZEND_ARG_INFO(0, namespace)
556562
ZEND_ARG_OBJ_INFO(0, zquery, MongoDB\\Driver\\Query, 0)
@@ -573,8 +579,8 @@ ZEND_END_ARG_INFO()
573579
static zend_function_entry php_phongo_manager_me[] = {
574580
PHP_ME(Manager, __construct, ai_Manager___construct, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
575581
PHP_ME(Manager, executeCommand, ai_Manager_executeCommand, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
576-
PHP_ME(Manager, executeReadCommand, ai_Manager_executeCommand, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
577-
PHP_ME(Manager, executeWriteCommand, ai_Manager_executeCommand, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
582+
PHP_ME(Manager, executeReadCommand, ai_Manager_executeRWCommand, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
583+
PHP_ME(Manager, executeWriteCommand, ai_Manager_executeRWCommand, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
578584
PHP_ME(Manager, executeReadWriteCommand, ai_Manager_executeCommand, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
579585
PHP_ME(Manager, executeQuery, ai_Manager_executeQuery, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
580586
PHP_ME(Manager, executeBulkWrite, ai_Manager_executeBulkWrite, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)

src/MongoDB/Server.c

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ static PHP_METHOD(Server, executeReadCommand)
6464

6565
intern = Z_SERVER_OBJ_P(getThis());
6666

67-
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sO|z!", &db, &db_len, &command, php_phongo_command_ce, &options) == FAILURE) {
67+
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sO|a!", &db, &db_len, &command, php_phongo_command_ce, &options) == FAILURE) {
6868
return;
6969
}
7070

@@ -86,7 +86,7 @@ static PHP_METHOD(Server, executeWriteCommand)
8686

8787
intern = Z_SERVER_OBJ_P(getThis());
8888

89-
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sO|z!", &db, &db_len, &command, php_phongo_command_ce, &options) == FAILURE) {
89+
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sO|a!", &db, &db_len, &command, php_phongo_command_ce, &options) == FAILURE) {
9090
return;
9191
}
9292

@@ -108,7 +108,7 @@ static PHP_METHOD(Server, executeReadWriteCommand)
108108

109109
intern = Z_SERVER_OBJ_P(getThis());
110110

111-
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sO|z!", &db, &db_len, &command, php_phongo_command_ce, &options) == FAILURE) {
111+
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sO|a!", &db, &db_len, &command, php_phongo_command_ce, &options) == FAILURE) {
112112
return;
113113
}
114114

@@ -485,6 +485,12 @@ ZEND_BEGIN_ARG_INFO_EX(ai_Server_executeCommand, 0, 0, 2)
485485
ZEND_ARG_INFO(0, options)
486486
ZEND_END_ARG_INFO()
487487

488+
ZEND_BEGIN_ARG_INFO_EX(ai_Server_executeRWCommand, 0, 0, 2)
489+
ZEND_ARG_INFO(0, db)
490+
ZEND_ARG_OBJ_INFO(0, command, MongoDB\\Driver\\Command, 0)
491+
ZEND_ARG_ARRAY_INFO(0, options, 0)
492+
ZEND_END_ARG_INFO()
493+
488494
ZEND_BEGIN_ARG_INFO_EX(ai_Server_executeQuery, 0, 0, 2)
489495
ZEND_ARG_INFO(0, namespace)
490496
ZEND_ARG_OBJ_INFO(0, zquery, MongoDB\\Driver\\Query, 0)
@@ -502,9 +508,9 @@ ZEND_END_ARG_INFO()
502508

503509
static zend_function_entry php_phongo_server_me[] = {
504510
PHP_ME(Server, executeCommand, ai_Server_executeCommand, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
505-
PHP_ME(Server, executeReadCommand, ai_Server_executeCommand, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
506-
PHP_ME(Server, executeWriteCommand, ai_Server_executeCommand, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
507-
PHP_ME(Server, executeReadWriteCommand, ai_Server_executeCommand, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
511+
PHP_ME(Server, executeReadCommand, ai_Server_executeRWCommand, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
512+
PHP_ME(Server, executeWriteCommand, ai_Server_executeRWCommand, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
513+
PHP_ME(Server, executeReadWriteCommand, ai_Server_executeRWCommand, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
508514
PHP_ME(Server, executeQuery, ai_Server_executeQuery, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
509515
PHP_ME(Server, executeBulkWrite, ai_Server_executeBulkWrite, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
510516
PHP_ME(Server, getHost, ai_Server_void, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)

0 commit comments

Comments
 (0)