diff --git a/src/php/ext/grpc/byte_buffer.c b/src/php/ext/grpc/byte_buffer.c index 810cc81151d..474b7a694b2 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 -#include -#include -#include -#include "php_grpc.h" - -#include #include "byte_buffer.h" -#include #include -#include 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 4a647ec7c27..9a1dcb640b5 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 -#include -#include #include -#include "php_grpc.h" -#include "call_credentials.h" - #include -#include - -#include #include -#include +#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 bb73354c428..c07fb9ba69e 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 -#include -#include #include "php_grpc.h" -#include "channel.h" -#include +#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 d96dc7f3b7b..12dcd46b214 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 -#include -#include #include -#include "php_grpc.h" -#include "call.h" - #include -#include -#include -#include #include #include +#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 663cc6858de..1db90b96b23 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 /* 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 6f3acc7afb4..dc17e053102 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 -#include -#include #include #include #if PHP_MAJOR_VERSION < 7 @@ -33,19 +26,13 @@ #include #endif #include -#include "php_grpc.h" - #include -#include - -#include #include #include #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 7aad59abe52..c0bd8c7daad 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 -#include -#include #include "php_grpc.h" -#include - /* 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 624d7cc75cc..8bda64cf418 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 -#include -#include #include #include -#include "channel.h" -#include "php_grpc.h" - #include -#include #include #include -#include -#include + +#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 357d732642f..ef312be13ff 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 /* 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 f54089b3a07..e7a2fa6d2a2 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 - 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 1dd1f4fe505..fabd98975df 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 -#include -#include -#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 e30f011c395..ecf5ebaa05b 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 +#include +#include +#include + +#include + +#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 292d512e378..ece7b0048a9 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 -#include -#include #include -#include "php_grpc.h" - #include -#include - -#include #include #include #include +#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 366f5d05a46..ca70589cfa9 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 -#include -#include #include "php_grpc.h" -#include - /* 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 212486e2e19..d143217f045 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 -#include -#include #include -#include "php_grpc.h" - #include -#include - -#include -#include 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 310c28db76f..68e505ca1ea 100644 --- a/src/php/ext/grpc/server_credentials.h +++ b/src/php/ext/grpc/server_credentials.h @@ -26,9 +26,9 @@ #include #include #include + #include "php_grpc.h" -#include #include /* 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 7280dde30ba..77a5ffa2566 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 -#include -#include #include -#include "php_grpc.h" - #include -#include - -#include -#include - 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 f4d267f9079..23f5c1e971b 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 -#include -#include #include "php_grpc.h" -#include -#include - /* Class entry for the Timeval PHP Class */ extern zend_class_entry *grpc_ce_timeval;