php_grpc.c
Go to the documentation of this file.
1 /*
2  *
3  * Copyright 2015 gRPC authors.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  */
18 
19 #include "php_grpc.h"
20 
21 #include "call.h"
22 #include "channel.h"
23 #include "server.h"
24 #include "timeval.h"
25 #include "version.h"
26 #include "channel_credentials.h"
27 #include "call_credentials.h"
28 #include "server_credentials.h"
29 #include "completion_queue.h"
30 #include <inttypes.h>
31 #include <grpc/grpc_security.h>
32 #include <grpc/support/alloc.h>
33 #include <grpc/support/log.h>
35 #include <grpc/support/time.h>
36 #include <ext/spl/spl_exceptions.h>
37 #include <zend_exceptions.h>
38 
39 #ifdef GRPC_POSIX_FORK_ALLOW_PTHREAD_ATFORK
40 #include <pthread.h>
41 #endif
42 
44 static PHP_GINIT_FUNCTION(grpc);
47 /* {{{ grpc_functions[]
48  *
49  * Every user visible function must have an entry in grpc_functions[].
50  */
51 const zend_function_entry grpc_functions[] = {
52  PHP_FE_END /* Must be the last line in grpc_functions[] */
53 };
54 /* }}} */
55 
57 
58 /* {{{ grpc_module_entry
59  */
60 zend_module_entry grpc_module_entry = {
61  STANDARD_MODULE_HEADER,
62  "grpc",
64  PHP_MINIT(grpc),
65  PHP_MSHUTDOWN(grpc),
66  PHP_RINIT(grpc),
67  NULL,
68  PHP_MINFO(grpc),
70  PHP_MODULE_GLOBALS(grpc),
71  PHP_GINIT(grpc),
72  NULL,
73  NULL,
74  STANDARD_MODULE_PROPERTIES_EX};
75 /* }}} */
76 
77 #ifdef COMPILE_DL_GRPC
78 ZEND_GET_MODULE(grpc)
79 #endif
80 
81 /* {{{ PHP_INI
82  */
83  PHP_INI_BEGIN()
84  STD_PHP_INI_ENTRY("grpc.enable_fork_support", "0", PHP_INI_SYSTEM, OnUpdateBool,
85  enable_fork_support, zend_grpc_globals, grpc_globals)
86  STD_PHP_INI_ENTRY("grpc.poll_strategy", NULL, PHP_INI_SYSTEM, OnUpdateString,
87  poll_strategy, zend_grpc_globals, grpc_globals)
88  STD_PHP_INI_ENTRY("grpc.grpc_verbosity", NULL, PHP_INI_SYSTEM, OnUpdateString,
89  grpc_verbosity, zend_grpc_globals, grpc_globals)
90  STD_PHP_INI_ENTRY("grpc.grpc_trace", NULL, PHP_INI_SYSTEM, OnUpdateString,
91  grpc_trace, zend_grpc_globals, grpc_globals)
92  STD_PHP_INI_ENTRY("grpc.log_filename", NULL, PHP_INI_SYSTEM, OnUpdateString,
93  log_filename, zend_grpc_globals, grpc_globals)
94  PHP_INI_END()
95 /* }}} */
96 
97 /* {{{ php_grpc_init_globals
98  */
99 /* Uncomment this function if you have INI entries
100  static void php_grpc_init_globals(zend_grpc_globals *grpc_globals)
101  {
102  grpc_globals->global_value = 0;
103  grpc_globals->global_string = NULL;
104  }
105 */
106 /* }}} */
107 
108 void create_new_channel(
109  wrapped_grpc_channel *channel,
110  char *target,
112  wrapped_grpc_channel_credentials *creds) {
113  if (creds == NULL) {
115  channel->wrapper->wrapped = grpc_channel_create(target, insecure_creds, &args);
116  grpc_channel_credentials_release(insecure_creds);
117  } else {
118  channel->wrapper->wrapped =
119  grpc_channel_create(target, creds->wrapped, &args);
120  }
121 }
122 
124  zval *data;
126  php_grpc_zend_resource *rsrc =
128  if (rsrc == NULL) {
129  break;
130  }
131  channel_persistent_le_t* le = rsrc->ptr;
132 
133  gpr_mu_lock(&le->channel->mu);
135 }
136 
138  zval *data;
140  php_grpc_zend_resource *rsrc =
142  if (rsrc == NULL) {
143  break;
144  }
145  channel_persistent_le_t* le = rsrc->ptr;
146 
147  gpr_mu_unlock(&le->channel->mu);
149 }
150 
152  zval *data;
154  php_grpc_zend_resource *rsrc =
156  if (rsrc == NULL) {
157  break;
158  }
159  channel_persistent_le_t* le = rsrc->ptr;
160 
161  wrapped_grpc_channel wrapped_channel;
162  wrapped_channel.wrapper = le->channel;
163  grpc_channel_wrapper *channel = wrapped_channel.wrapper;
164  grpc_channel_destroy(channel->wrapped);
165  channel->wrapped = NULL;
167 }
168 
169 void prefork() {
171 }
172 
173 // Clean all channels in the persistent list
174 // Called at post fork
176  zend_hash_clean(&grpc_persistent_list);
177  zend_hash_clean(&grpc_target_upper_bound_map);
178 }
179 
181  TSRMLS_FETCH();
182 
183  // loop through persistent list and destroy all underlying grpc_channel objs
185 
187 
188  // clean all channels in the persistent list
190 
191  // clear completion queue
193 
194  // clean-up grpc_core
195  grpc_shutdown();
196  if (grpc_is_initialized() > 0) {
197  zend_throw_exception(spl_ce_UnexpectedValueException,
198  "Oops, failed to shutdown gRPC Core after fork()",
199  1 TSRMLS_CC);
200  }
201 
202  // restart grpc_core
203  grpc_init();
205 }
206 
209 }
210 
212  if (getenv("GRPC_ENABLE_FORK_SUPPORT")) {
213 #ifdef GRPC_POSIX_FORK_ALLOW_PTHREAD_ATFORK
214  pthread_atfork(&prefork, &postfork_parent, &postfork_child);
215 #endif // GRPC_POSIX_FORK_ALLOW_PTHREAD_ATFORK
216  }
217 }
218 
219 void apply_ini_settings(TSRMLS_D) {
221  char *enable_str = malloc(sizeof("GRPC_ENABLE_FORK_SUPPORT=1"));
222  strcpy(enable_str, "GRPC_ENABLE_FORK_SUPPORT=1");
223  putenv(enable_str);
224  }
225 
226  if (GRPC_G(poll_strategy)) {
227  char *poll_str = malloc(sizeof("GRPC_POLL_STRATEGY=") +
228  strlen(GRPC_G(poll_strategy)));
229  strcpy(poll_str, "GRPC_POLL_STRATEGY=");
230  strcat(poll_str, GRPC_G(poll_strategy));
231  putenv(poll_str);
232  }
233 
234  if (GRPC_G(grpc_verbosity)) {
235  char *verbosity_str = malloc(sizeof("GRPC_VERBOSITY=") +
236  strlen(GRPC_G(grpc_verbosity)));
237  strcpy(verbosity_str, "GRPC_VERBOSITY=");
238  strcat(verbosity_str, GRPC_G(grpc_verbosity));
239  putenv(verbosity_str);
240  }
241 
242  if (GRPC_G(grpc_trace)) {
243  char *trace_str = malloc(sizeof("GRPC_TRACE=") +
244  strlen(GRPC_G(grpc_trace)));
245  strcpy(trace_str, "GRPC_TRACE=");
246  strcat(trace_str, GRPC_G(grpc_trace));
247  putenv(trace_str);
248  }
249 }
250 
252  TSRMLS_FETCH();
253 
254  const char* final_slash;
255  const char* display_file;
256  char* prefix;
257  char* final;
259 
260  final_slash = strrchr(args->file, '/');
261  if (final_slash) {
262  display_file = final_slash + 1;
263  } else {
264  display_file = args->file;
265  }
266 
267  FILE *fp = fopen(GRPC_G(log_filename), "ab");
268  if (!fp) {
269  return;
270  }
271 
272  gpr_asprintf(&prefix, "%s%" PRId64 ".%09" PRId32 " %s:%d]",
273  gpr_log_severity_string(args->severity), now.tv_sec,
274  now.tv_nsec, display_file, args->line);
275 
276  gpr_asprintf(&final, "%-60s %s\n", prefix, args->message);
277 
278  fprintf(fp, "%s", final);
279  fclose(fp);
280  gpr_free(prefix);
281  gpr_free(final);
282 }
283 
284 /* {{{ PHP_MINIT_FUNCTION
285  */
287  REGISTER_INI_ENTRIES();
288 
289  /* Register call error constants */
291  REGISTER_LONG_CONSTANT("Grpc\\CALL_OK", GRPC_CALL_OK,
292  CONST_CS | CONST_PERSISTENT);
294  REGISTER_LONG_CONSTANT("Grpc\\CALL_ERROR", GRPC_CALL_ERROR,
295  CONST_CS | CONST_PERSISTENT);
297  REGISTER_LONG_CONSTANT("Grpc\\CALL_ERROR_NOT_ON_SERVER",
299  CONST_CS | CONST_PERSISTENT);
301  REGISTER_LONG_CONSTANT("Grpc\\CALL_ERROR_NOT_ON_CLIENT",
303  CONST_CS | CONST_PERSISTENT);
305  REGISTER_LONG_CONSTANT("Grpc\\CALL_ERROR_ALREADY_INVOKED",
307  CONST_CS | CONST_PERSISTENT);
309  REGISTER_LONG_CONSTANT("Grpc\\CALL_ERROR_NOT_INVOKED",
311  CONST_CS | CONST_PERSISTENT);
314  REGISTER_LONG_CONSTANT("Grpc\\CALL_ERROR_ALREADY_FINISHED",
316  CONST_CS | CONST_PERSISTENT);
318  REGISTER_LONG_CONSTANT("Grpc\\CALL_ERROR_TOO_MANY_OPERATIONS",
320  CONST_CS | CONST_PERSISTENT);
322  REGISTER_LONG_CONSTANT("Grpc\\CALL_ERROR_INVALID_FLAGS",
324  CONST_CS | CONST_PERSISTENT);
325 
326  /* Register flag constants */
330  REGISTER_LONG_CONSTANT("Grpc\\WRITE_BUFFER_HINT", GRPC_WRITE_BUFFER_HINT,
331  CONST_CS | CONST_PERSISTENT);
334  REGISTER_LONG_CONSTANT("Grpc\\WRITE_NO_COMPRESS", GRPC_WRITE_NO_COMPRESS,
335  CONST_CS | CONST_PERSISTENT);
336 
337  /* Register status constants */
339  REGISTER_LONG_CONSTANT("Grpc\\STATUS_OK", GRPC_STATUS_OK,
340  CONST_CS | CONST_PERSISTENT);
342  REGISTER_LONG_CONSTANT("Grpc\\STATUS_CANCELLED", GRPC_STATUS_CANCELLED,
343  CONST_CS | CONST_PERSISTENT);
349  REGISTER_LONG_CONSTANT("Grpc\\STATUS_UNKNOWN", GRPC_STATUS_UNKNOWN,
350  CONST_CS | CONST_PERSISTENT);
355  REGISTER_LONG_CONSTANT("Grpc\\STATUS_INVALID_ARGUMENT",
357  CONST_CS | CONST_PERSISTENT);
363  REGISTER_LONG_CONSTANT("Grpc\\STATUS_DEADLINE_EXCEEDED",
365  CONST_CS | CONST_PERSISTENT);
367  REGISTER_LONG_CONSTANT("Grpc\\STATUS_NOT_FOUND", GRPC_STATUS_NOT_FOUND,
368  CONST_CS | CONST_PERSISTENT);
371  REGISTER_LONG_CONSTANT("Grpc\\STATUS_ALREADY_EXISTS",
373  CONST_CS | CONST_PERSISTENT);
380  REGISTER_LONG_CONSTANT("Grpc\\STATUS_PERMISSION_DENIED",
382  CONST_CS | CONST_PERSISTENT);
385  REGISTER_LONG_CONSTANT("Grpc\\STATUS_UNAUTHENTICATED",
387  CONST_CS | CONST_PERSISTENT);
390  REGISTER_LONG_CONSTANT("Grpc\\STATUS_RESOURCE_EXHAUSTED",
392  CONST_CS | CONST_PERSISTENT);
412  REGISTER_LONG_CONSTANT("Grpc\\STATUS_FAILED_PRECONDITION",
414  CONST_CS | CONST_PERSISTENT);
420  REGISTER_LONG_CONSTANT("Grpc\\STATUS_ABORTED", GRPC_STATUS_ABORTED,
421  CONST_CS | CONST_PERSISTENT);
437  REGISTER_LONG_CONSTANT("Grpc\\STATUS_OUT_OF_RANGE",
439  CONST_CS | CONST_PERSISTENT);
441  REGISTER_LONG_CONSTANT("Grpc\\STATUS_UNIMPLEMENTED",
443  CONST_CS | CONST_PERSISTENT);
447  REGISTER_LONG_CONSTANT("Grpc\\STATUS_INTERNAL", GRPC_STATUS_INTERNAL,
448  CONST_CS | CONST_PERSISTENT);
461  REGISTER_LONG_CONSTANT("Grpc\\STATUS_UNAVAILABLE", GRPC_STATUS_UNAVAILABLE,
462  CONST_CS | CONST_PERSISTENT);
464  REGISTER_LONG_CONSTANT("Grpc\\STATUS_DATA_LOSS", GRPC_STATUS_DATA_LOSS,
465  CONST_CS | CONST_PERSISTENT);
466 
467  /* Register op type constants */
472  REGISTER_LONG_CONSTANT("Grpc\\OP_SEND_INITIAL_METADATA",
474  CONST_CS | CONST_PERSISTENT);
478  REGISTER_LONG_CONSTANT("Grpc\\OP_SEND_MESSAGE",
480  CONST_CS | CONST_PERSISTENT);
485  REGISTER_LONG_CONSTANT("Grpc\\OP_SEND_CLOSE_FROM_CLIENT",
487  CONST_CS | CONST_PERSISTENT);
492  REGISTER_LONG_CONSTANT("Grpc\\OP_SEND_STATUS_FROM_SERVER",
494  CONST_CS | CONST_PERSISTENT);
499  REGISTER_LONG_CONSTANT("Grpc\\OP_RECV_INITIAL_METADATA",
501  CONST_CS | CONST_PERSISTENT);
505  REGISTER_LONG_CONSTANT("Grpc\\OP_RECV_MESSAGE",
507  CONST_CS | CONST_PERSISTENT);
513  REGISTER_LONG_CONSTANT("Grpc\\OP_RECV_STATUS_ON_CLIENT",
515  CONST_CS | CONST_PERSISTENT);
521  REGISTER_LONG_CONSTANT("Grpc\\OP_RECV_CLOSE_ON_SERVER",
523  CONST_CS | CONST_PERSISTENT);
524 
525  /* Register connectivity state constants */
527  REGISTER_LONG_CONSTANT("Grpc\\CHANNEL_IDLE",
529  CONST_CS | CONST_PERSISTENT);
531  REGISTER_LONG_CONSTANT("Grpc\\CHANNEL_CONNECTING",
533  CONST_CS | CONST_PERSISTENT);
535  REGISTER_LONG_CONSTANT("Grpc\\CHANNEL_READY",
537  CONST_CS | CONST_PERSISTENT);
539  REGISTER_LONG_CONSTANT("Grpc\\CHANNEL_TRANSIENT_FAILURE",
541  CONST_CS | CONST_PERSISTENT);
543  REGISTER_LONG_CONSTANT("Grpc\\CHANNEL_FATAL_FAILURE",
545  CONST_CS | CONST_PERSISTENT);
546 
548  REGISTER_STRING_CONSTANT("Grpc\\VERSION", PHP_GRPC_VERSION,
549  CONST_CS | CONST_PERSISTENT);
550 
551  grpc_init_call(TSRMLS_C);
553  grpc_init_server(TSRMLS_C);
554  grpc_init_timeval(TSRMLS_C);
556  grpc_init_call_credentials(TSRMLS_C);
558  return SUCCESS;
559 }
560 /* }}} */
561 
562 /* {{{ PHP_MSHUTDOWN_FUNCTION
563  */
565  UNREGISTER_INI_ENTRIES();
566  // WARNING: This function IS being called by PHP when the extension
567  // is unloaded but the logs were somehow suppressed.
568  if (GRPC_G(initialized)) {
569  zend_hash_clean(&grpc_persistent_list);
570  zend_hash_destroy(&grpc_persistent_list);
571  zend_hash_clean(&grpc_target_upper_bound_map);
572  zend_hash_destroy(&grpc_target_upper_bound_map);
573  grpc_shutdown_timeval(TSRMLS_C);
575  grpc_shutdown();
576  GRPC_G(initialized) = 0;
577  }
578  return SUCCESS;
579 }
580 /* }}} */
581 
582 /* {{{ PHP_MINFO_FUNCTION
583  */
585  php_info_print_table_start();
586  php_info_print_table_row(2, "grpc support", "enabled");
587  php_info_print_table_row(2, "grpc module version", PHP_GRPC_VERSION);
588  php_info_print_table_end();
589  DISPLAY_INI_ENTRIES();
590 }
591 /* }}} */
592 
593 /* {{{ PHP_RINIT_FUNCTION
594  */
596  if (!GRPC_G(initialized)) {
597  apply_ini_settings(TSRMLS_C);
598  if (GRPC_G(log_filename)) {
600  }
601  grpc_init();
604  GRPC_G(initialized) = 1;
605  }
606  return SUCCESS;
607 }
608 /* }}} */
609 
610 /* {{{ PHP_GINIT_FUNCTION
611  */
613  grpc_globals->initialized = 0;
614  grpc_globals->enable_fork_support = 0;
615  grpc_globals->poll_strategy = NULL;
616  grpc_globals->grpc_verbosity = NULL;
617  grpc_globals->grpc_trace = NULL;
618  grpc_globals->log_filename = NULL;
619 }
620 /* }}} */
621 
622 /* The previous line is meant for vim and emacs, so it can correctly fold and
623  unfold functions in source code. See the corresponding marks just before
624  function definition, where the functions purpose is also documented. Please
625  follow this convention for the convenience of others editing your code.
626 */
grpc_init_timeval
void grpc_init_timeval(TSRMLS_D)
Definition: timeval.c:304
GRPC_CHANNEL_READY
@ GRPC_CHANNEL_READY
Definition: include/grpc/impl/codegen/connectivity_state.h:36
gpr_mu_unlock
GPRAPI void gpr_mu_unlock(gpr_mu *mu)
now
static double now(void)
Definition: test/core/fling/client.cc:130
GRPC_CALL_ERROR_ALREADY_INVOKED
@ GRPC_CALL_ERROR_ALREADY_INVOKED
Definition: grpc_types.h:476
log.h
poll_strategy
char * poll_strategy
Definition: php_grpc.h:78
GRPC_STATUS_UNAVAILABLE
@ GRPC_STATUS_UNAVAILABLE
Definition: include/grpc/impl/codegen/status.h:143
GRPC_CALL_ERROR_TOO_MANY_OPERATIONS
@ GRPC_CALL_ERROR_TOO_MANY_OPERATIONS
Definition: grpc_types.h:483
postfork_child
void postfork_child()
Definition: php_grpc.c:180
PHP_GRPC_VERSION
#define PHP_GRPC_VERSION
Definition: src/php/ext/grpc/version.h:23
GRPC_STATUS_UNAUTHENTICATED
@ GRPC_STATUS_UNAUTHENTICATED
Definition: include/grpc/impl/codegen/status.h:72
grpc
Definition: grpcpp/alarm.h:33
GRPC_CALL_ERROR
@ GRPC_CALL_ERROR
Definition: grpc_types.h:468
channel_credentials.h
PHP_GRPC_HASH_FOREACH_VAL_START
#define PHP_GRPC_HASH_FOREACH_VAL_START(ht, data)
Definition: php7_wrapper.h:86
custom_logger
static void custom_logger(gpr_log_func_args *args)
Definition: php_grpc.c:251
release_persistent_locks
void release_persistent_locks()
Definition: php_grpc.c:137
channel.h
GRPC_CALL_ERROR_NOT_ON_CLIENT
@ GRPC_CALL_ERROR_NOT_ON_CLIENT
Definition: grpc_types.h:472
GRPC_STATUS_PERMISSION_DENIED
@ GRPC_STATUS_PERMISSION_DENIED
Definition: include/grpc/impl/codegen/status.h:68
acquire_persistent_locks
void acquire_persistent_locks()
Definition: php_grpc.c:123
gpr_free
GPRAPI void gpr_free(void *ptr)
Definition: alloc.cc:51
GRPC_STATUS_NOT_FOUND
@ GRPC_STATUS_NOT_FOUND
Definition: include/grpc/impl/codegen/status.h:56
GRPC_CHANNEL_TRANSIENT_FAILURE
@ GRPC_CHANNEL_TRANSIENT_FAILURE
Definition: include/grpc/impl/codegen/connectivity_state.h:38
grpc_init_server
void grpc_init_server(TSRMLS_D)
Definition: server.c:244
GRPC_CALL_OK
@ GRPC_CALL_OK
Definition: grpc_types.h:466
GRPC_STATUS_CANCELLED
@ GRPC_STATUS_CANCELLED
Definition: include/grpc/impl/codegen/status.h:33
server.h
GRPC_STATUS_DEADLINE_EXCEEDED
@ GRPC_STATUS_DEADLINE_EXCEEDED
Definition: include/grpc/impl/codegen/status.h:53
time.h
enable_fork_support
zend_bool enable_fork_support
Definition: php_grpc.h:77
grpc_security.h
GRPC_STATUS_INVALID_ARGUMENT
@ GRPC_STATUS_INVALID_ARGUMENT
Definition: include/grpc/impl/codegen/status.h:46
GRPC_STATUS_RESOURCE_EXHAUSTED
@ GRPC_STATUS_RESOURCE_EXHAUSTED
Definition: include/grpc/impl/codegen/status.h:76
GRPC_CALL_ERROR_NOT_ON_SERVER
@ GRPC_CALL_ERROR_NOT_ON_SERVER
Definition: grpc_types.h:470
gpr_log_severity_string
const GPRAPI char * gpr_log_severity_string(gpr_log_severity severity)
Definition: log.cc:55
GRPC_WRITE_NO_COMPRESS
#define GRPC_WRITE_NO_COMPRESS
Definition: grpc_types.h:513
grpc_channel_args
Definition: grpc_types.h:132
initialized
bool initialized
Definition: timer_generic.cc:223
PHP_GINIT_FUNCTION
static PHP_GINIT_FUNCTION(grpc)
Definition: php_grpc.c:612
gpr_log_func_args
Definition: include/grpc/impl/codegen/log.h:77
call.h
string_util.h
channel
wrapped_grpc_channel * channel
Definition: src/php/ext/grpc/call.h:33
asyncio_get_stats.args
args
Definition: asyncio_get_stats.py:40
GRPC_STATUS_OK
@ GRPC_STATUS_OK
Definition: include/grpc/impl/codegen/status.h:30
GRPC_OP_RECV_INITIAL_METADATA
@ GRPC_OP_RECV_INITIAL_METADATA
Definition: grpc_types.h:617
GRPC_CALL_ERROR_NOT_INVOKED
@ GRPC_CALL_ERROR_NOT_INVOKED
Definition: grpc_types.h:478
GRPC_OP_SEND_STATUS_FROM_SERVER
@ GRPC_OP_SEND_STATUS_FROM_SERVER
Definition: grpc_types.h:612
GRPC_CALL_ERROR_INVALID_FLAGS
@ GRPC_CALL_ERROR_INVALID_FLAGS
Definition: grpc_types.h:485
PHP_MSHUTDOWN_FUNCTION
PHP_MSHUTDOWN_FUNCTION(grpc)
Definition: php_grpc.c:564
register_fork_handlers
void register_fork_handlers()
Definition: php_grpc.c:211
completion_queue.h
apply_ini_settings
void apply_ini_settings(TSRMLS_D)
Definition: php_grpc.c:219
grpc_init_server_credentials
void grpc_init_server_credentials(TSRMLS_D)
Definition: server_credentials.c:108
grpc_init_channel_credentials
void grpc_init_channel_credentials(TSRMLS_D)
Definition: channel_credentials.c:326
GRPC_WRITE_BUFFER_HINT
#define GRPC_WRITE_BUFFER_HINT
Definition: grpc_types.h:510
grpc_insecure_credentials_create
GRPCAPI grpc_channel_credentials * grpc_insecure_credentials_create()
Definition: core/lib/security/credentials/insecure/insecure_credentials.cc:64
GRPC_OP_SEND_MESSAGE
@ GRPC_OP_SEND_MESSAGE
Definition: grpc_types.h:602
GRPC_CHANNEL_IDLE
@ GRPC_CHANNEL_IDLE
Definition: include/grpc/impl/codegen/connectivity_state.h:32
_channel_persistent_le
Definition: src/php/ext/grpc/channel.h:69
gpr_mu_lock
GPRAPI void gpr_mu_lock(gpr_mu *mu)
gpr_asprintf
GPRAPI int gpr_asprintf(char **strp, const char *format,...) GPR_PRINT_FORMAT_CHECK(2
data
char data[kBufferLength]
Definition: abseil-cpp/absl/strings/internal/str_format/float_conversion.cc:1006
grpc_persistent_list
HashTable grpc_persistent_list
Definition: php_grpc.c:45
grpc_module_entry
zend_module_entry grpc_module_entry
Definition: php_grpc.c:60
grpc_functions
const zend_function_entry grpc_functions[]
Definition: php_grpc.c:51
GRPC_STATUS_ALREADY_EXISTS
@ GRPC_STATUS_ALREADY_EXISTS
Definition: include/grpc/impl/codegen/status.h:60
PHP_MINFO_FUNCTION
PHP_MINFO_FUNCTION(grpc)
Definition: php_grpc.c:584
GRPC_STARTUP
#define GRPC_STARTUP(module)
Definition: php_grpc.h:103
PHP_MINIT_FUNCTION
PHP_MINIT_FUNCTION(grpc)
Definition: php_grpc.c:286
GRPC_STATUS_DATA_LOSS
@ GRPC_STATUS_DATA_LOSS
Definition: include/grpc/impl/codegen/status.h:146
timeval.h
gpr_now
GPRAPI gpr_timespec gpr_now(gpr_clock_type clock)
grpc_shutdown_timeval
void grpc_shutdown_timeval(TSRMLS_D)
Definition: timeval.c:312
GRPC_STATUS_OUT_OF_RANGE
@ GRPC_STATUS_OUT_OF_RANGE
Definition: include/grpc/impl/codegen/status.h:121
GRPC_CHANNEL_CONNECTING
@ GRPC_CHANNEL_CONNECTING
Definition: include/grpc/impl/codegen/connectivity_state.h:34
server_credentials.h
grpc::testing::SUCCESS
@ SUCCESS
Definition: h2_ssl_cert_test.cc:201
STD_PHP_INI_ENTRY
STD_PHP_INI_ENTRY("grpc.enable_fork_support", "0", PHP_INI_SYSTEM, OnUpdateBool, enable_fork_support, zend_grpc_globals, grpc_globals)
Definition: php_grpc.c:84
grpc_channel_credentials_release
GRPCAPI void grpc_channel_credentials_release(grpc_channel_credentials *creds)
Definition: credentials.cc:36
GRPC_OP_RECV_MESSAGE
@ GRPC_OP_RECV_MESSAGE
Definition: grpc_types.h:621
php_grpc.h
grpc_init_call_credentials
void grpc_init_call_credentials(TSRMLS_D)
Definition: call_credentials.c:245
grpc_channel_create
GRPCAPI grpc_channel * grpc_channel_create(const char *target, grpc_channel_credentials *creds, const grpc_channel_args *args)
Definition: chttp2_connector.cc:366
ZEND_DECLARE_MODULE_GLOBALS
ZEND_DECLARE_MODULE_GLOBALS(grpc)
grpc_is_initialized
GRPCAPI int grpc_is_initialized(void)
Definition: init.cc:247
benchmark.FILE
FILE
Definition: benchmark.py:21
grpc_php_shutdown_completion_queue
void grpc_php_shutdown_completion_queue(TSRMLS_D)
Definition: completion_queue.c:27
PHP_GRPC_HASH_FOREACH_END
#define PHP_GRPC_HASH_FOREACH_END()
Definition: php7_wrapper.h:105
postfork_parent
void postfork_parent()
Definition: php_grpc.c:207
GRPC_OP_SEND_INITIAL_METADATA
@ GRPC_OP_SEND_INITIAL_METADATA
Definition: grpc_types.h:598
grpc::fclose
fclose(creds_file)
prefork
void prefork()
Definition: php_grpc.c:169
GRPC_STATUS_ABORTED
@ GRPC_STATUS_ABORTED
Definition: include/grpc/impl/codegen/status.h:104
alloc.h
_grpc_channel_wrapper
Definition: src/php/ext/grpc/channel.h:34
destroy_grpc_channels
void destroy_grpc_channels()
Definition: php_grpc.c:151
prefix
static const char prefix[]
Definition: head_of_line_blocking.cc:28
PHP_RINIT_FUNCTION
PHP_RINIT_FUNCTION(grpc)
Definition: php_grpc.c:595
grpc_channel_destroy
GRPCAPI void grpc_channel_destroy(grpc_channel *channel)
Definition: channel.cc:437
call_credentials.h
GRPC_G
#define GRPC_G(v)
Definition: php_grpc.h:99
GRPC_OP_RECV_CLOSE_ON_SERVER
@ GRPC_OP_RECV_CLOSE_ON_SERVER
Definition: grpc_types.h:633
GRPC_STATUS_UNIMPLEMENTED
@ GRPC_STATUS_UNIMPLEMENTED
Definition: include/grpc/impl/codegen/status.h:124
php_grpc_zend_resource
#define php_grpc_zend_resource
Definition: php7_wrapper.h:121
PHP_GRPC_HASH_VALPTR_TO_VAL
#define PHP_GRPC_HASH_VALPTR_TO_VAL(data)
Definition: php7_wrapper.h:95
GRPC_STATUS_FAILED_PRECONDITION
@ GRPC_STATUS_FAILED_PRECONDITION
Definition: include/grpc/impl/codegen/status.h:97
GRPC_CALL_ERROR_ALREADY_FINISHED
@ GRPC_CALL_ERROR_ALREADY_FINISHED
Definition: grpc_types.h:481
grpc_target_upper_bound_map
HashTable grpc_target_upper_bound_map
Definition: php_grpc.c:46
GRPC_STATUS_INTERNAL
@ GRPC_STATUS_INTERNAL
Definition: include/grpc/impl/codegen/status.h:129
GRPC_CHANNEL_SHUTDOWN
@ GRPC_CHANNEL_SHUTDOWN
Definition: include/grpc/impl/codegen/connectivity_state.h:40
gpr_timespec
Definition: gpr_types.h:50
gpr_set_log_function
GPRAPI void gpr_set_log_function(gpr_log_func func)
Definition: log.cc:143
grpc_init
GRPCAPI void grpc_init(void)
Definition: init.cc:146
php_grpc_clean_persistent_list
void php_grpc_clean_persistent_list(TSRMLS_D)
Definition: php_grpc.c:175
GRPC_OP_RECV_STATUS_ON_CLIENT
@ GRPC_OP_RECV_STATUS_ON_CLIENT
Definition: grpc_types.h:627
GPR_CLOCK_REALTIME
@ GPR_CLOCK_REALTIME
Definition: gpr_types.h:39
getenv
#define getenv(ptr)
Definition: ares_private.h:106
grpc_init_call
void grpc_init_call(TSRMLS_D)
Definition: call.c:622
grpc_trace
char * grpc_trace
Definition: php_grpc.h:80
log_filename
char * log_filename
Definition: php_grpc.h:81
grpc_shutdown
GRPCAPI void grpc_shutdown(void)
Definition: init.cc:209
setup.target
target
Definition: third_party/bloaty/third_party/protobuf/python/setup.py:179
grpc_channel_credentials
Definition: src/core/lib/security/credentials/credentials.h:96
grpc_php_init_completion_queue
void grpc_php_init_completion_queue(TSRMLS_D)
Definition: completion_queue.c:23
GRPC_OP_SEND_CLOSE_FROM_CLIENT
@ GRPC_OP_SEND_CLOSE_FROM_CLIENT
Definition: grpc_types.h:607
grpc_verbosity
char * grpc_verbosity
Definition: php_grpc.h:79
GRPC_STATUS_UNKNOWN
@ GRPC_STATUS_UNKNOWN
Definition: include/grpc/impl/codegen/status.h:40
version.h


grpc
Author(s):
autogenerated on Thu Mar 13 2025 03:00:52