26 #include <ext/spl/spl_exceptions.h>
27 #include <zend_exceptions.h>
58 zend_object_std_init(&
intern->std, class_type TSRMLS_CC);
59 object_properties_init(&
intern->std, class_type);
68 wrapped_grpc_server *
server =
70 zval *args_array = NULL;
74 if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
"|a", &args_array) ==
76 zend_throw_exception(spl_ce_InvalidArgumentException,
77 "Server expects an array", 1 TSRMLS_CC);
80 if (args_array == NULL) {
105 wrapped_grpc_server *
server =
117 zend_throw_exception(spl_ce_LogicException,
"request_call failed",
118 (
long)error_code TSRMLS_CC);
125 zend_throw_exception(spl_ce_LogicException,
126 "Failed to request a call for some reason",
157 wrapped_grpc_server *
server =
161 if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
"s", &
addr, &addr_len)
163 zend_throw_exception(spl_ce_InvalidArgumentException,
164 "add_http2_port expects a string", 1 TSRMLS_CC);
183 wrapped_grpc_server *
server =
187 if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
"sO", &
addr, &addr_len,
190 zend_throw_exception(spl_ce_InvalidArgumentException,
191 "add_http2_port expects a string and a "
192 "ServerCredentials", 1 TSRMLS_CC);
195 wrapped_grpc_server_credentials *creds =
206 wrapped_grpc_server *
server =
211 ZEND_BEGIN_ARG_INFO_EX(arginfo_construct, 0, 0, 0)
212 ZEND_ARG_INFO(0,
args)
215 ZEND_BEGIN_ARG_INFO_EX(arginfo_requestCall, 0, 0, 0)
218 ZEND_BEGIN_ARG_INFO_EX(arginfo_addHttp2Port, 0, 0, 1)
219 ZEND_ARG_INFO(0,
addr)
222 ZEND_BEGIN_ARG_INFO_EX(arginfo_addSecureHttp2Port, 0, 0, 2)
223 ZEND_ARG_INFO(0,
addr)
224 ZEND_ARG_INFO(0, server_creds)
227 ZEND_BEGIN_ARG_INFO_EX(arginfo_start, 0, 0, 0)
231 PHP_ME(
Server, __construct, arginfo_construct,
232 ZEND_ACC_PUBLIC | ZEND_ACC_CTOR)
233 PHP_ME(
Server, requestCall, arginfo_requestCall,
235 PHP_ME(
Server, addHttp2Port, arginfo_addHttp2Port,
237 PHP_ME(
Server, addSecureHttp2Port, arginfo_addSecureHttp2Port,