diff --git a/src/php/bin/interop_client.sh b/src/php/bin/interop_client.sh index 2c61ea8aa09..22e4a493c4c 100755 --- a/src/php/bin/interop_client.sh +++ b/src/php/bin/interop_client.sh @@ -31,5 +31,8 @@ set +e cd $(dirname $0) -php -d extension_dir=../ext/grpc/modules/ -d extension=grpc.so \ + +module_dir=`php --version | grep -q 'PHP 5.6' && echo '../ext/grpc' || echo '../ext/grpc/modules'` + +php -d extension_dir=$module_dir -d extension=grpc.so \ ../tests/interop/interop_client.php $@ 1>&2 diff --git a/src/php/bin/run_tests.sh b/src/php/bin/run_tests.sh index c3358ed899f..1335672e9e1 100755 --- a/src/php/bin/run_tests.sh +++ b/src/php/bin/run_tests.sh @@ -34,13 +34,15 @@ set -e cd $(dirname $0) default_extension_dir=`php -i | grep extension_dir | sed 's/.*=> //g'` +module_dir=`php --version | grep -q 'PHP 5.6' && echo '../ext/grpc' || echo '../ext/grpc/modules'` + # sym-link in system supplied extensions for f in $default_extension_dir/*.so do - ln -s $f ../ext/grpc/modules/$(basename $f) &> /dev/null || true + ln -s $f $module_dir/$(basename $f) &> /dev/null || true done php \ - -d extension_dir=../ext/grpc/modules/ \ + -d extension_dir=$module_dir \ -d extension=grpc.so \ `which phpunit` -v --debug --strict ../tests/unit_tests diff --git a/src/php/ext/grpc/byte_buffer.c b/src/php/ext/grpc/byte_buffer.c index 9f122d6da67..4f3e6b67af1 100644 --- a/src/php/ext/grpc/byte_buffer.c +++ b/src/php/ext/grpc/byte_buffer.c @@ -35,18 +35,18 @@ #include "config.h" #endif -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "ext/spl/spl_exceptions.h" +#include +#include +#include +#include #include "php_grpc.h" #include #include "byte_buffer.h" -#include "grpc/grpc.h" -#include "grpc/support/slice.h" +#include +#include grpc_byte_buffer *string_to_byte_buffer(char *string, size_t length) { gpr_slice slice = gpr_slice_from_copied_buffer(string, length); diff --git a/src/php/ext/grpc/byte_buffer.h b/src/php/ext/grpc/byte_buffer.h index 7a40638591f..0e9d1e71450 100644 --- a/src/php/ext/grpc/byte_buffer.h +++ b/src/php/ext/grpc/byte_buffer.h @@ -34,7 +34,7 @@ #ifndef NET_GRPC_PHP_GRPC_BYTE_BUFFER_H_ #define NET_GRPC_PHP_GRPC_BYTE_BUFFER_H_ -#include "grpc/grpc.h" +#include grpc_byte_buffer *string_to_byte_buffer(char *string, size_t length); diff --git a/src/php/ext/grpc/call.c b/src/php/ext/grpc/call.c index ba1b2a407d3..6e83e79a4fd 100644 --- a/src/php/ext/grpc/call.c +++ b/src/php/ext/grpc/call.c @@ -37,20 +37,20 @@ #include "config.h" #endif -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "ext/spl/spl_exceptions.h" +#include +#include +#include +#include #include "php_grpc.h" -#include "zend_exceptions.h" -#include "zend_hash.h" +#include +#include #include -#include "grpc/support/log.h" -#include "grpc/support/alloc.h" -#include "grpc/grpc.h" +#include +#include +#include #include "timeval.h" #include "channel.h" diff --git a/src/php/ext/grpc/call.h b/src/php/ext/grpc/call.h index 743effe5a1b..e7eb9a75e2e 100644 --- a/src/php/ext/grpc/call.h +++ b/src/php/ext/grpc/call.h @@ -38,12 +38,12 @@ #include "config.h" #endif -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" +#include +#include +#include #include "php_grpc.h" -#include "grpc/grpc.h" +#include /* Class entry for the Call PHP class */ extern zend_class_entry *grpc_ce_call; diff --git a/src/php/ext/grpc/channel.c b/src/php/ext/grpc/channel.c index c96fb128a60..51a3eae0f4e 100644 --- a/src/php/ext/grpc/channel.c +++ b/src/php/ext/grpc/channel.c @@ -37,19 +37,19 @@ #include "config.h" #endif -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "ext/spl/spl_exceptions.h" +#include +#include +#include +#include #include "php_grpc.h" -#include "zend_exceptions.h" +#include #include -#include "grpc/grpc.h" -#include "grpc/support/log.h" -#include "grpc/grpc_security.h" +#include +#include +#include #include "server.h" #include "credentials.h" diff --git a/src/php/ext/grpc/channel.h b/src/php/ext/grpc/channel.h index 2c79668a4d8..c13fa4c6d7d 100755 --- a/src/php/ext/grpc/channel.h +++ b/src/php/ext/grpc/channel.h @@ -38,12 +38,12 @@ #include "config.h" #endif -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" +#include +#include +#include #include "php_grpc.h" -#include "grpc/grpc.h" +#include /* Class entry for the PHP Channel class */ extern zend_class_entry *grpc_ce_channel; diff --git a/src/php/ext/grpc/config.m4 b/src/php/ext/grpc/config.m4 index d1a8decb73a..11778e3bb64 100755 --- a/src/php/ext/grpc/config.m4 +++ b/src/php/ext/grpc/config.m4 @@ -66,5 +66,5 @@ if test "$PHP_GRPC" != "no"; then PHP_SUBST(GRPC_SHARED_LIBADD) - PHP_NEW_EXTENSION(grpc, byte_buffer.c call.c channel.c credentials.c timeval.c server.c server_credentials.c php_grpc.c, $ext_shared, , -Wall -Werror -pedantic -std=c99) + PHP_NEW_EXTENSION(grpc, byte_buffer.c call.c channel.c credentials.c timeval.c server.c server_credentials.c php_grpc.c, $ext_shared, , -Wall -Werror -std=c11) fi diff --git a/src/php/ext/grpc/credentials.c b/src/php/ext/grpc/credentials.c index a94b0eac2d3..a262b9981f5 100644 --- a/src/php/ext/grpc/credentials.c +++ b/src/php/ext/grpc/credentials.c @@ -37,17 +37,17 @@ #include "config.h" #endif -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "ext/spl/spl_exceptions.h" +#include +#include +#include +#include #include "php_grpc.h" -#include "zend_exceptions.h" -#include "zend_hash.h" +#include +#include -#include "grpc/grpc.h" -#include "grpc/grpc_security.h" +#include +#include zend_class_entry *grpc_ce_credentials; diff --git a/src/php/ext/grpc/php_grpc.c b/src/php/ext/grpc/php_grpc.c index 1f9edfe881a..3e669ecd174 100644 --- a/src/php/ext/grpc/php_grpc.c +++ b/src/php/ext/grpc/php_grpc.c @@ -42,9 +42,9 @@ #include "config.h" #endif -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" +#include +#include +#include #include "php_grpc.h" // ZEND_DECLARE_MODULE_GLOBALS(grpc) diff --git a/src/php/ext/grpc/server.c b/src/php/ext/grpc/server.c index 86b29958fbf..46fe745c5ad 100644 --- a/src/php/ext/grpc/server.c +++ b/src/php/ext/grpc/server.c @@ -37,19 +37,19 @@ #include "config.h" #endif -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "ext/spl/spl_exceptions.h" +#include +#include +#include +#include #include "php_grpc.h" -#include "zend_exceptions.h" +#include #include -#include "grpc/grpc.h" -#include "grpc/support/log.h" -#include "grpc/grpc_security.h" +#include +#include +#include #include "server.h" #include "channel.h" diff --git a/src/php/ext/grpc/server.h b/src/php/ext/grpc/server.h index ebb8d25ae1a..a2ee2ff5a92 100755 --- a/src/php/ext/grpc/server.h +++ b/src/php/ext/grpc/server.h @@ -38,12 +38,12 @@ #include "config.h" #endif -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" +#include +#include +#include #include "php_grpc.h" -#include "grpc/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 df64e659869..c4c1fabb1a5 100644 --- a/src/php/ext/grpc/server_credentials.c +++ b/src/php/ext/grpc/server_credentials.c @@ -37,17 +37,17 @@ #include "config.h" #endif -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "ext/spl/spl_exceptions.h" +#include +#include +#include +#include #include "php_grpc.h" -#include "zend_exceptions.h" -#include "zend_hash.h" +#include +#include -#include "grpc/grpc.h" -#include "grpc/grpc_security.h" +#include +#include zend_class_entry *grpc_ce_server_credentials; diff --git a/src/php/ext/grpc/server_credentials.h b/src/php/ext/grpc/server_credentials.h index 8ed36971506..7101d650008 100755 --- a/src/php/ext/grpc/server_credentials.h +++ b/src/php/ext/grpc/server_credentials.h @@ -38,13 +38,13 @@ #include "config.h" #endif -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" +#include +#include +#include #include "php_grpc.h" -#include "grpc/grpc.h" -#include "grpc/grpc_security.h" +#include +#include /* Class entry for the Server_Credentials PHP class */ extern zend_class_entry *grpc_ce_server_credentials; diff --git a/src/php/ext/grpc/timeval.c b/src/php/ext/grpc/timeval.c index f90f0062bab..1c9542dbfff 100644 --- a/src/php/ext/grpc/timeval.c +++ b/src/php/ext/grpc/timeval.c @@ -37,18 +37,18 @@ #include "config.h" #endif -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "ext/spl/spl_exceptions.h" +#include +#include +#include +#include #include "php_grpc.h" -#include "zend_exceptions.h" +#include #include -#include "grpc/grpc.h" -#include "grpc/support/time.h" +#include +#include zend_class_entry *grpc_ce_timeval; diff --git a/src/php/ext/grpc/timeval.h b/src/php/ext/grpc/timeval.h index e3183f691db..07cef037cb5 100755 --- a/src/php/ext/grpc/timeval.h +++ b/src/php/ext/grpc/timeval.h @@ -38,13 +38,13 @@ #include "config.h" #endif -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" +#include +#include +#include #include "php_grpc.h" -#include "grpc/grpc.h" -#include "grpc/support/time.h" +#include +#include /* Class entry for the Timeval PHP Class */ extern zend_class_entry *grpc_ce_timeval;