aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/php
diff options
context:
space:
mode:
Diffstat (limited to 'src/php')
-rw-r--r--src/php/ext/grpc/byte_buffer.c12
-rw-r--r--src/php/ext/grpc/call.c15
-rw-r--r--src/php/ext/grpc/call.h10
-rw-r--r--src/php/ext/grpc/call_credentials.c16
-rw-r--r--src/php/ext/grpc/call_credentials.h10
-rw-r--r--src/php/ext/grpc/channel.c13
-rw-r--r--src/php/ext/grpc/channel.h9
-rw-r--r--src/php/ext/grpc/channel_credentials.c17
-rw-r--r--src/php/ext/grpc/channel_credentials.h10
-rw-r--r--src/php/ext/grpc/completion_queue.c2
-rw-r--r--src/php/ext/grpc/php_grpc.c11
-rw-r--r--src/php/ext/grpc/php_grpc.h18
-rw-r--r--src/php/ext/grpc/server.c16
-rw-r--r--src/php/ext/grpc/server.h9
-rw-r--r--src/php/ext/grpc/server_credentials.c13
-rw-r--r--src/php/ext/grpc/server_credentials.h2
-rw-r--r--src/php/ext/grpc/timeval.c14
-rw-r--r--src/php/ext/grpc/timeval.h10
18 files changed, 27 insertions, 180 deletions
diff --git a/src/php/ext/grpc/byte_buffer.c b/src/php/ext/grpc/byte_buffer.c
index 810cc81151..474b7a694b 100644
--- a/src/php/ext/grpc/byte_buffer.c
+++ b/src/php/ext/grpc/byte_buffer.c
@@ -16,23 +16,11 @@
*
*/
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
#include <php.h>
-#include <php_ini.h>
-#include <ext/standard/info.h>
-#include <ext/spl/spl_exceptions.h>
-#include "php_grpc.h"
-
-#include <string.h>
#include "byte_buffer.h"
-#include <grpc/grpc.h>
#include <grpc/byte_buffer_reader.h>
-#include <grpc/slice.h>
grpc_byte_buffer *string_to_byte_buffer(char *string, size_t length) {
grpc_slice slice = grpc_slice_from_copied_buffer(string, length);
diff --git a/src/php/ext/grpc/call.c b/src/php/ext/grpc/call.c
index 4a647ec7c2..9a1dcb640b 100644
--- a/src/php/ext/grpc/call.c
+++ b/src/php/ext/grpc/call.c
@@ -18,25 +18,12 @@
#include "call.h"
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <php.h>
-#include <php_ini.h>
-#include <ext/standard/info.h>
#include <ext/spl/spl_exceptions.h>
-#include "php_grpc.h"
-#include "call_credentials.h"
-
#include <zend_exceptions.h>
-#include <zend_hash.h>
-
-#include <stdbool.h>
#include <grpc/support/alloc.h>
-#include <grpc/grpc.h>
+#include "call_credentials.h"
#include "completion_queue.h"
#include "timeval.h"
#include "channel.h"
diff --git a/src/php/ext/grpc/call.h b/src/php/ext/grpc/call.h
index bb73354c42..c07fb9ba69 100644
--- a/src/php/ext/grpc/call.h
+++ b/src/php/ext/grpc/call.h
@@ -19,17 +19,9 @@
#ifndef NET_GRPC_PHP_GRPC_CALL_H_
#define NET_GRPC_PHP_GRPC_CALL_H_
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <php.h>
-#include <php_ini.h>
-#include <ext/standard/info.h>
#include "php_grpc.h"
-#include "channel.h"
-#include <grpc/grpc.h>
+#include "channel.h"
/* Class entry for the Call PHP class */
extern zend_class_entry *grpc_ce_call;
diff --git a/src/php/ext/grpc/call_credentials.c b/src/php/ext/grpc/call_credentials.c
index d96dc7f3b7..12dcd46b21 100644
--- a/src/php/ext/grpc/call_credentials.c
+++ b/src/php/ext/grpc/call_credentials.c
@@ -16,28 +16,16 @@
*
*/
-#include "channel_credentials.h"
#include "call_credentials.h"
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <php.h>
-#include <php_ini.h>
-#include <ext/standard/info.h>
#include <ext/spl/spl_exceptions.h>
-#include "php_grpc.h"
-#include "call.h"
-
#include <zend_exceptions.h>
-#include <zend_hash.h>
-#include <grpc/grpc.h>
-#include <grpc/grpc_security.h>
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
+#include "call.h"
+
zend_class_entry *grpc_ce_call_credentials;
#if PHP_MAJOR_VERSION >= 7
static zend_object_handlers call_credentials_ce_handlers;
diff --git a/src/php/ext/grpc/call_credentials.h b/src/php/ext/grpc/call_credentials.h
index 663cc6858d..1db90b96b2 100644
--- a/src/php/ext/grpc/call_credentials.h
+++ b/src/php/ext/grpc/call_credentials.h
@@ -19,17 +19,9 @@
#ifndef NET_GRPC_PHP_GRPC_CALL_CREDENTIALS_H_
#define NET_GRPC_PHP_GRPC_CALL_CREDENTIALS_H_
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include "php.h"
-#include "php_ini.h"
-#include "ext/standard/info.h"
#include "php_grpc.h"
-#include "grpc/grpc.h"
-#include "grpc/grpc_security.h"
+#include <grpc/grpc_security.h>
/* Class entry for the CallCredentials PHP class */
extern zend_class_entry *grpc_ce_call_credentials;
diff --git a/src/php/ext/grpc/channel.c b/src/php/ext/grpc/channel.c
index 6f3acc7afb..dc17e05310 100644
--- a/src/php/ext/grpc/channel.c
+++ b/src/php/ext/grpc/channel.c
@@ -18,13 +18,6 @@
#include "channel.h"
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <php.h>
-#include <php_ini.h>
-#include <ext/standard/info.h>
#include <ext/standard/php_var.h>
#include <ext/standard/sha1.h>
#if PHP_MAJOR_VERSION < 7
@@ -33,19 +26,13 @@
#include <zend_smart_str.h>
#endif
#include <ext/spl/spl_exceptions.h>
-#include "php_grpc.h"
-
#include <zend_exceptions.h>
-#include <stdbool.h>
-
-#include <grpc/grpc.h>
#include <grpc/grpc_security.h>
#include <grpc/support/alloc.h>
#include "completion_queue.h"
#include "channel_credentials.h"
-#include "server.h"
#include "timeval.h"
zend_class_entry *grpc_ce_channel;
diff --git a/src/php/ext/grpc/channel.h b/src/php/ext/grpc/channel.h
index 7aad59abe5..c0bd8c7daa 100644
--- a/src/php/ext/grpc/channel.h
+++ b/src/php/ext/grpc/channel.h
@@ -19,17 +19,8 @@
#ifndef NET_GRPC_PHP_GRPC_CHANNEL_H_
#define NET_GRPC_PHP_GRPC_CHANNEL_H_
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <php.h>
-#include <php_ini.h>
-#include <ext/standard/info.h>
#include "php_grpc.h"
-#include <grpc/grpc.h>
-
/* Class entry for the PHP Channel class */
extern zend_class_entry *grpc_ce_channel;
diff --git a/src/php/ext/grpc/channel_credentials.c b/src/php/ext/grpc/channel_credentials.c
index 624d7cc75c..8bda64cf41 100644
--- a/src/php/ext/grpc/channel_credentials.c
+++ b/src/php/ext/grpc/channel_credentials.c
@@ -17,27 +17,16 @@
*/
#include "channel_credentials.h"
-#include "call_credentials.h"
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-#include <php.h>
-#include <php_ini.h>
-#include <ext/standard/info.h>
#include <ext/standard/sha1.h>
#include <ext/spl/spl_exceptions.h>
-#include "channel.h"
-#include "php_grpc.h"
-
#include <zend_exceptions.h>
-#include <zend_hash.h>
#include <grpc/support/alloc.h>
#include <grpc/support/string_util.h>
-#include <grpc/grpc.h>
-#include <grpc/grpc_security.h>
+
+#include "call_credentials.h"
+#include "channel.h"
zend_class_entry *grpc_ce_channel_credentials;
#if PHP_MAJOR_VERSION >= 7
diff --git a/src/php/ext/grpc/channel_credentials.h b/src/php/ext/grpc/channel_credentials.h
index 357d732642..ef312be13f 100644
--- a/src/php/ext/grpc/channel_credentials.h
+++ b/src/php/ext/grpc/channel_credentials.h
@@ -19,17 +19,9 @@
#ifndef NET_GRPC_PHP_GRPC_CHANNEL_CREDENTIALS_H_
#define NET_GRPC_PHP_GRPC_CHANNEL_CREDENTIALS_H_
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include "php.h"
-#include "php_ini.h"
-#include "ext/standard/info.h"
#include "php_grpc.h"
-#include "grpc/grpc.h"
-#include "grpc/grpc_security.h"
+#include <grpc/grpc_security.h>
/* Class entry for the ChannelCredentials PHP class */
extern zend_class_entry *grpc_ce_channel_credentials;
diff --git a/src/php/ext/grpc/completion_queue.c b/src/php/ext/grpc/completion_queue.c
index f54089b3a0..e7a2fa6d2a 100644
--- a/src/php/ext/grpc/completion_queue.c
+++ b/src/php/ext/grpc/completion_queue.c
@@ -18,8 +18,6 @@
#include "completion_queue.h"
-#include <php.h>
-
grpc_completion_queue *completion_queue;
void grpc_php_init_completion_queue(TSRMLS_D) {
diff --git a/src/php/ext/grpc/php_grpc.c b/src/php/ext/grpc/php_grpc.c
index 1dd1f4fe50..fabd98975d 100644
--- a/src/php/ext/grpc/php_grpc.c
+++ b/src/php/ext/grpc/php_grpc.c
@@ -16,6 +16,8 @@
*
*/
+#include "php_grpc.h"
+
#include "call.h"
#include "channel.h"
#include "server.h"
@@ -25,15 +27,6 @@
#include "server_credentials.h"
#include "completion_queue.h"
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <php.h>
-#include <php_ini.h>
-#include <ext/standard/info.h>
-#include "php_grpc.h"
-
ZEND_DECLARE_MODULE_GLOBALS(grpc)
static PHP_GINIT_FUNCTION(grpc);
HashTable grpc_persistent_list;
diff --git a/src/php/ext/grpc/php_grpc.h b/src/php/ext/grpc/php_grpc.h
index e30f011c39..ecf5ebaa05 100644
--- a/src/php/ext/grpc/php_grpc.h
+++ b/src/php/ext/grpc/php_grpc.h
@@ -20,8 +20,21 @@
#ifndef PHP_GRPC_H
#define PHP_GRPC_H
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <stdbool.h>
+#include <php.h>
+#include <php_ini.h>
+#include <ext/standard/info.h>
+
+#include <grpc/grpc.h>
+
+#include "php7_wrapper.h"
+#include "version.h"
+
extern zend_module_entry grpc_module_entry;
#define phpext_grpc_ptr &grpc_module_entry
@@ -37,11 +50,6 @@ extern zend_module_entry grpc_module_entry;
#include "TSRM.h"
#endif
-#include "php.h"
-#include "php7_wrapper.h"
-#include "grpc/grpc.h"
-#include "version.h"
-
/* These are all function declarations */
/* Code that runs at module initialization */
PHP_MINIT_FUNCTION(grpc);
diff --git a/src/php/ext/grpc/server.c b/src/php/ext/grpc/server.c
index 292d512e37..ece7b0048a 100644
--- a/src/php/ext/grpc/server.c
+++ b/src/php/ext/grpc/server.c
@@ -16,29 +16,17 @@
*
*/
-#include "call.h"
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
+#include "server.h"
-#include <php.h>
-#include <php_ini.h>
-#include <ext/standard/info.h>
#include <ext/spl/spl_exceptions.h>
-#include "php_grpc.h"
-
#include <zend_exceptions.h>
-#include <stdbool.h>
-
-#include <grpc/grpc.h>
#include <grpc/grpc_security.h>
#include <grpc/slice.h>
#include <grpc/support/alloc.h>
+#include "call.h"
#include "completion_queue.h"
-#include "server.h"
#include "channel.h"
#include "server_credentials.h"
#include "timeval.h"
diff --git a/src/php/ext/grpc/server.h b/src/php/ext/grpc/server.h
index 366f5d05a4..ca70589cfa 100644
--- a/src/php/ext/grpc/server.h
+++ b/src/php/ext/grpc/server.h
@@ -19,17 +19,8 @@
#ifndef NET_GRPC_PHP_GRPC_SERVER_H_
#define NET_GRPC_PHP_GRPC_SERVER_H_
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <php.h>
-#include <php_ini.h>
-#include <ext/standard/info.h>
#include "php_grpc.h"
-#include <grpc/grpc.h>
-
/* Class entry for the Server PHP class */
extern zend_class_entry *grpc_ce_server;
diff --git a/src/php/ext/grpc/server_credentials.c b/src/php/ext/grpc/server_credentials.c
index 212486e2e1..d143217f04 100644
--- a/src/php/ext/grpc/server_credentials.c
+++ b/src/php/ext/grpc/server_credentials.c
@@ -18,21 +18,8 @@
#include "server_credentials.h"
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <php.h>
-#include <php_ini.h>
-#include <ext/standard/info.h>
#include <ext/spl/spl_exceptions.h>
-#include "php_grpc.h"
-
#include <zend_exceptions.h>
-#include <zend_hash.h>
-
-#include <grpc/grpc.h>
-#include <grpc/grpc_security.h>
zend_class_entry *grpc_ce_server_credentials;
#if PHP_MAJOR_VERSION >= 7
diff --git a/src/php/ext/grpc/server_credentials.h b/src/php/ext/grpc/server_credentials.h
index 310c28db76..68e505ca1e 100644
--- a/src/php/ext/grpc/server_credentials.h
+++ b/src/php/ext/grpc/server_credentials.h
@@ -26,9 +26,9 @@
#include <php.h>
#include <php_ini.h>
#include <ext/standard/info.h>
+
#include "php_grpc.h"
-#include <grpc/grpc.h>
#include <grpc/grpc_security.h>
/* Class entry for the Server_Credentials PHP class */
diff --git a/src/php/ext/grpc/timeval.c b/src/php/ext/grpc/timeval.c
index 7280dde30b..77a5ffa256 100644
--- a/src/php/ext/grpc/timeval.c
+++ b/src/php/ext/grpc/timeval.c
@@ -18,23 +18,9 @@
#include "timeval.h"
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <php.h>
-#include <php_ini.h>
-#include <ext/standard/info.h>
#include <ext/spl/spl_exceptions.h>
-#include "php_grpc.h"
-
#include <zend_exceptions.h>
-#include <stdbool.h>
-
-#include <grpc/grpc.h>
-#include <grpc/support/time.h>
-
zend_class_entry *grpc_ce_timeval;
#if PHP_MAJOR_VERSION >= 7
static zend_object_handlers timeval_ce_handlers;
diff --git a/src/php/ext/grpc/timeval.h b/src/php/ext/grpc/timeval.h
index f4d267f907..23f5c1e971 100644
--- a/src/php/ext/grpc/timeval.h
+++ b/src/php/ext/grpc/timeval.h
@@ -19,18 +19,8 @@
#ifndef NET_GRPC_PHP_GRPC_TIMEVAL_H_
#define NET_GRPC_PHP_GRPC_TIMEVAL_H_
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <php.h>
-#include <php_ini.h>
-#include <ext/standard/info.h>
#include "php_grpc.h"
-#include <grpc/grpc.h>
-#include <grpc/support/time.h>
-
/* Class entry for the Timeval PHP Class */
extern zend_class_entry *grpc_ce_timeval;