summaryrefslogtreecommitdiff
path: root/dev-php/pecl-uploadprogress
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /dev-php/pecl-uploadprogress
reinit the tree, so we can have metadata
Diffstat (limited to 'dev-php/pecl-uploadprogress')
-rw-r--r--dev-php/pecl-uploadprogress/Manifest6
-rw-r--r--dev-php/pecl-uploadprogress/files/1.0.3.1-php7.patch148
-rw-r--r--dev-php/pecl-uploadprogress/metadata.xml11
-rw-r--r--dev-php/pecl-uploadprogress/pecl-uploadprogress-1.0.3.1-r3.ebuild29
4 files changed, 194 insertions, 0 deletions
diff --git a/dev-php/pecl-uploadprogress/Manifest b/dev-php/pecl-uploadprogress/Manifest
new file mode 100644
index 000000000000..c08780d7c355
--- /dev/null
+++ b/dev-php/pecl-uploadprogress/Manifest
@@ -0,0 +1,6 @@
+AUX 1.0.3.1-php7.patch 4948 SHA256 f06eff42853edf543cee551e5d01d852dc15e90ee5b59710ec795c0ec364852b SHA512 5b913ac4c006cee917ddb7140dd2e34dee6da9fac11001e6ee9f41ac0b65e3caa493c81612b05ef8ff99fec9c9a4cd4a2c2c275fc6124223d04648d43cae4fe4 WHIRLPOOL ed6e61638fbff064bbab214c640bf89967b609e159018cf1bda98bd57308c5f365c72d10149861c52add2c20cb465ef8accf3669d7ac93cc54e7de880c627e84
+DIST uploadprogress-1.0.3.1.tgz 9040 SHA256 30588b4589543bcf6371532546b1a8cee9da1086c206aca9f96ea1bd486bbab2 SHA512 c317a30ed81430184b643e2755867cdccf9848312aa31a5527e4fe229ac19ee3099121de8e253207b55dd7e788c28720bd3c477663c4ca15100478647a6dc1bb WHIRLPOOL d9ddc7d67b092f620db09a14ff5ad34f300c4078ba489e7c59fd6d0121cc1441bc03ea9c960c6a9ff51899a6e9e8c472047c96f314c2f6863492efc2084abaa4
+EBUILD pecl-uploadprogress-1.0.3.1-r3.ebuild 633 SHA256 ed6b62d955d34a5d55988eb58fbf4e085b6130dc52d0eecb47956735386e75aa SHA512 63c98850ed0332dff846ff13f22e1f493890c7c8a5529d39e898c0336c23e795886158b559ef2f330b2b1799287fc6357e4c2174ddd1a9e7ac263aa4457d98c3 WHIRLPOOL e7ee2482dc38aeffcda93a394463955c625657290c6c3984465910e5deb9be373287f49daf05dba4365bcde46393999805a3709735f05765f48c81f55834a22d
+MISC ChangeLog 3595 SHA256 36756eaac331079079939d85ae807d66a5f5e06a8e209de6a31d8b5feb9cab0c SHA512 e74ce058010a74f2b1aeb2d83bd66135c21f56b64bf6e955862b7eb77951056aca424852f30e6ccd59b1c45578c7e29f01a97ad734cc67f7be72429f4f0e1010 WHIRLPOOL cc95440a5a7832964e06170b37c1670ebe90f43490a41c4dea8e9208f7c898f9b89be0b6c2c17e304645e335b106e99d98f43000b0cca2598600fcd9cbb4a816
+MISC ChangeLog-2015 1743 SHA256 00fbea7ee99b32f5742a04a8716ba228f1ecff4d411a798080cb518cdb15e779 SHA512 c81f3da7038715116c17f731be80814d1cfe3770545d0c68c8be1167034ab1160bc1a5f9d1b65a68a70a37b77effd48e3d7aa245da233363f0471afa43d8cdbe WHIRLPOOL 8f79c9cad9f5e064262d15dfb2ea73dfa0eac030d640061f947a620b8ec2a7354b5f66e143fa8fd617d8b441595be25fa4585945adc2096fae471e59d4e79083
+MISC metadata.xml 526 SHA256 692ec76ad8c0156a65ca2e4c61e5033d5ada1430accc86ecd1b4554540644397 SHA512 18d72c569825f9dfd79a69d4ad1bc824f99001f2b1545aaaf6777a67050d9812dd81737c9e74bc9520aa5b375db4d94c5219f359eeaa5c8d7ae0a6437c96ec56 WHIRLPOOL 32be201a52935790a05a8cff487ec83da514a30953fcbeaa44a1049073b81f3c01b9350ae1dd6d2578bd228e63c80478d480601cc6592f5535d8910da6238f0a
diff --git a/dev-php/pecl-uploadprogress/files/1.0.3.1-php7.patch b/dev-php/pecl-uploadprogress/files/1.0.3.1-php7.patch
new file mode 100644
index 000000000000..c90f4bd9539f
--- /dev/null
+++ b/dev-php/pecl-uploadprogress/files/1.0.3.1-php7.patch
@@ -0,0 +1,148 @@
+From 7a4d6b3ac3575caedf9429940f54688411cbf5e9 Mon Sep 17 00:00:00 2001
+From: Jan-E <github@ehrhardt.nl>
+Date: Sun, 19 Apr 2015 18:49:48 +0200
+Subject: [PATCH 1/2] PHP7 compatibility
+
+---
+ uploadprogress.c | 36 +++++++++++++++++++++++++++++++++---
+ 1 file changed, 33 insertions(+), 3 deletions(-)
+
+diff --git a/uploadprogress.c b/uploadprogress.c
+index 30f6758..7a52ba7 100644
+--- a/uploadprogress.c
++++ b/uploadprogress.c
+@@ -71,7 +71,7 @@ PHPAPI extern int (*php_rfc1867_callback)(unsigned int , void *, void ** TSRMLS_
+ */
+ static int uploadprogress_php_rfc1867_file(unsigned int event, void *event_data, void **data TSRMLS_DC)
+ {
+- zval handler;
++ //zval handler;
+ char *callable = NULL;
+ uploadprogress_data * progress;
+ int read_bytes;
+@@ -157,7 +157,11 @@ static int uploadprogress_php_rfc1867_file(unsigned int event, void *event_data
+
+ if (get_contents) {
+ php_stream *stream;
++#if defined(ZEND_ENGINE_3)
++ int options = 0;
++#else
+ int options = ENFORCE_SAFE_MODE;
++#endif
+
+ stream = php_stream_open_wrapper(progress->data_filename, "ab", options, NULL);
+ if (stream) {
+@@ -301,7 +305,7 @@ PHP_FUNCTION(uploadprogress_get_info)
+ {
+ char * id;
+ int id_lg;
+- char method;
++ //char method;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &id, &id_lg) == FAILURE) {
+ return;
+@@ -417,7 +421,11 @@ static void uploadprogress_file_php_get_info(char * id, zval * return_value)
+ v[index] = 0;
+ }
+ }
++#if defined(ZEND_ENGINE_3)
++ add_assoc_string( return_value, k, v );
++#else
+ add_assoc_string( return_value, k, v, 1 );
++#endif
+ }
+ fclose(F);
+ }
+@@ -432,10 +440,22 @@ static void uploadprogress_file_php_get_info(char * id, zval * return_value)
+ */
+ static void uploadprogress_file_php_get_contents(char *id, char *fieldname, long maxlen, zval *return_value)
+ {
++#if defined(ZEND_ENGINE_3)
++ char *filename, *template, *data_identifier;
++ zend_string *contents;
++#else
+ char *filename, *template, *contents, *data_identifier;
++#endif
+ php_stream *stream;
++#if defined(ZEND_ENGINE_3)
++ int options = 0;
++#else
+ int options = ENFORCE_SAFE_MODE;
+- int len, newlen;
++#endif
++ int len;
++#if PHP_API_VERSION < 20100412
++ int newlen;
++#endif
+ TSRMLS_FETCH();
+
+ template = INI_STR("uploadprogress.file.contents_template");
+@@ -455,7 +475,13 @@ static void uploadprogress_file_php_get_contents(char *id, char *fieldname, long
+ }
+
+ /* uses mmap if possible */
++#if defined(ZEND_ENGINE_3)
++ contents = php_stream_copy_to_mem(stream, maxlen, 0);
++ len = contents->len;
++ if (contents && len > 0) {
++#else
+ if ((len = php_stream_copy_to_mem(stream, &contents, maxlen, 0)) > 0) {
++#endif
+
+ #if PHP_API_VERSION < 20100412
+ if (PG(magic_quotes_runtime)) {
+@@ -463,7 +489,11 @@ static void uploadprogress_file_php_get_contents(char *id, char *fieldname, long
+ len = newlen;
+ }
+ #endif
++#if defined(ZEND_ENGINE_3)
++ RETVAL_STR(contents);
++#else
+ RETVAL_STRINGL(contents, len, 0);
++#endif
+ } else if (len == 0) {
+ RETVAL_EMPTY_STRING();
+ } else {
+--
+2.1.4
+
+
+From 95d8a0fd4554e10c215d3ab301e901bd8f99c5d9 Mon Sep 17 00:00:00 2001
+From: Jan-E <github@ehrhardt.nl>
+Date: Mon, 20 Apr 2015 22:20:40 +0200
+Subject: [PATCH 2/2] int id_lg should be size_t id_lg
+
+---
+ uploadprogress.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/uploadprogress.c b/uploadprogress.c
+index 7a52ba7..3d73d15 100644
+--- a/uploadprogress.c
++++ b/uploadprogress.c
+@@ -304,7 +304,11 @@ PHP_MINFO_FUNCTION(uploadprogress)
+ PHP_FUNCTION(uploadprogress_get_info)
+ {
+ char * id;
++#if defined(ZEND_ENGINE_3)
++ size_t id_lg;
++#else
+ int id_lg;
++#endif
+ //char method;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &id, &id_lg) == FAILURE) {
+--
+2.1.4
+
+--- a/uploadprogress.c 2011-08-15 09:21:10.000000000 -0400
++++ b/uploadprogress.c 2016-12-07 11:05:47.961377088 -0500
+@@ -213,7 +213,7 @@
+ FILE *F;
+ F = VCWD_FOPEN(progress->identifier_tmp, "wb");
+ if (F) {
+- fprintf(F, "upload_id=%s\nfieldname=%s\nfilename=%s\ntime_start=%d\ntime_last=%d\nspeed_average=%d\nspeed_last=%d\nbytes_uploaded=%d\nbytes_total=%d\nfiles_uploaded=%d\nest_sec=%d\n",
++ fprintf(F, "upload_id=%s\nfieldname=%s\nfilename=%s\ntime_start=%ld\ntime_last=%ld\nspeed_average=%d\nspeed_last=%d\nbytes_uploaded=%ld\nbytes_total=%ld\nfiles_uploaded=%d\nest_sec=%d\n",
+ progress->upload_id, progress->fieldname, progress->filename,
+ progress->time_start, progress->time_last,
+ progress->speed_average, progress->speed_last,
diff --git a/dev-php/pecl-uploadprogress/metadata.xml b/dev-php/pecl-uploadprogress/metadata.xml
new file mode 100644
index 000000000000..5f21917bcc4e
--- /dev/null
+++ b/dev-php/pecl-uploadprogress/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="project">
+ <email>php-bugs@gentoo.org</email>
+ <name>PHP</name>
+</maintainer>
+<longdescription lang="en">An extension to track progress of a file upload.
+See http://cvs.php.net/viewvc.cgi/pecl/uploadprogress/examples/ for a little example. It is only known to work on Apache with mod_php, other SAPI implementations unfortunately still have issues.
+</longdescription>
+</pkgmetadata>
diff --git a/dev-php/pecl-uploadprogress/pecl-uploadprogress-1.0.3.1-r3.ebuild b/dev-php/pecl-uploadprogress/pecl-uploadprogress-1.0.3.1-r3.ebuild
new file mode 100644
index 000000000000..e1542ba36df3
--- /dev/null
+++ b/dev-php/pecl-uploadprogress/pecl-uploadprogress-1.0.3.1-r3.ebuild
@@ -0,0 +1,29 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+USE_PHP="php5-6 php7-0"
+
+inherit php-ext-pecl-r3
+
+DESCRIPTION="An extension to track progress of a file upload"
+LICENSE="PHP-3.01"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+for target in ${USE_PHP}; do
+ slot=${target/php}
+ slot=${slot/-/.}
+ PHPUSEDEPEND="${PHPUSEDEPEND}
+ php_targets_${target}? ( dev-lang/php:${slot}[apache2] )"
+done
+
+RDEPEND="${PHPUSEDEPEND}"
+PATCHES=( "${FILESDIR}/1.0.3.1-php7.patch" )
+PHP_EXT_ECONF_ARGS=()
+
+pkg_postinst() {
+ elog "This extension is only known to work on Apache with mod_php."
+}