aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPawel Pekala <pawel@FreeBSD.org>2016-08-16 17:34:58 +0000
committerPawel Pekala <pawel@FreeBSD.org>2016-08-16 17:34:58 +0000
commite390c52d77146811421864cc152a879cd531baa7 (patch)
treeb84d310357c5a08c1b7f5865f53941b8d85bc6af
parent760b72d262bacfedba6a6aa644256c5d1142d371 (diff)
downloadports-e390c52d77146811421864cc152a879cd531baa7.tar.gz
ports-e390c52d77146811421864cc152a879cd531baa7.zip
- Fix build with PHP 5.6
- Take maintainership PR: 211822 Submitted by: Gasol Wu
Notes
Notes: svn path=/head/; revision=420295
-rw-r--r--www/pecl-http1/Makefile4
-rw-r--r--www/pecl-http1/files/patch-http__api.c46
2 files changed, 48 insertions, 2 deletions
diff --git a/www/pecl-http1/Makefile b/www/pecl-http1/Makefile
index ef0ebd757420..6f9975925ac0 100644
--- a/www/pecl-http1/Makefile
+++ b/www/pecl-http1/Makefile
@@ -10,7 +10,7 @@ PKGNAMEPREFIX= pecl-
PKGNAMESUFFIX= 1
DISTNAME= pecl_http-${PORTVERSION}
-MAINTAINER= ports@FreeBSD.org
+MAINTAINER= gasol.wu@gmail.com
COMMENT= Extended HTTP Support
LICENSE= BSD2CLAUSE
@@ -19,7 +19,7 @@ LICENSE_FILE= ${WRKSRC}/LICENSE
LIB_DEPENDS= libcurl.so:ftp/curl
USES= php:ext tar:tgz
-IGNORE_WITH_PHP= 56 70
+IGNORE_WITH_PHP= 70
CONFLICTS= pecl-http-*
CONFIGURE_ARGS+= --with-http-curl-requests \
diff --git a/www/pecl-http1/files/patch-http__api.c b/www/pecl-http1/files/patch-http__api.c
new file mode 100644
index 000000000000..ee752ed24a46
--- /dev/null
+++ b/www/pecl-http1/files/patch-http__api.c
@@ -0,0 +1,46 @@
+--- http_api.c.orig 2016-07-19 07:12:32 UTC
++++ http_api.c
+@@ -349,6 +349,7 @@ PHP_HTTP_API STATUS _http_get_request_bo
+ *length = 0;
+ *body = NULL;
+
++#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION < 6)
+ if (SG(request_info).raw_post_data) {
+ *length = SG(request_info).raw_post_data_length;
+ *body = SG(request_info).raw_post_data;
+@@ -357,7 +358,9 @@ PHP_HTTP_API STATUS _http_get_request_bo
+ *body = estrndup(*body, *length);
+ }
+ return SUCCESS;
+- } else if (sapi_module.read_post && !HTTP_G->read_post_data) {
++ }
++#endif
++ if (sapi_module.read_post && !HTTP_G->read_post_data) {
+ char *buf = emalloc(4096);
+ int len;
+
+@@ -382,8 +385,10 @@ PHP_HTTP_API STATUS _http_get_request_bo
+ return FAILURE;
+ }
+
++#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION < 6)
+ SG(request_info).raw_post_data = *body;
+ SG(request_info).raw_post_data_length = *length;
++#endif
+
+ if (dup) {
+ *body = estrndup(*body, *length);
+@@ -400,9 +405,13 @@ PHP_HTTP_API php_stream *_http_get_reque
+ {
+ php_stream *s = NULL;
+
++#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION < 6)
+ if (SG(request_info).raw_post_data) {
+ s = php_stream_open_wrapper("php://input", "rb", 0, NULL);
+ } else if (sapi_module.read_post && !HTTP_G->read_post_data) {
++#else
++ if (sapi_module.read_post && !HTTP_G->read_post_data) {
++#endif
+ HTTP_G->read_post_data = 1;
+
+ if ((s = php_stream_temp_new())) {