summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--5.patch576
-rw-r--r--PHPINFO6
-rw-r--r--REFLECTION136
-rw-r--r--php-pecl-xdiff.spec29
4 files changed, 119 insertions, 628 deletions
diff --git a/5.patch b/5.patch
deleted file mode 100644
index c7c84ea..0000000
--- a/5.patch
+++ /dev/null
@@ -1,576 +0,0 @@
-From b9aec331034f90998e31c60166b5caf758896584 Mon Sep 17 00:00:00 2001
-From: Remi Collet <remi@remirepo.net>
-Date: Wed, 30 Sep 2020 16:45:14 +0200
-Subject: [PATCH] fix compatibility with PHP 8.0.0RC1 - add arginfo to all
- functions - clean TSRMLS-* macros usage
-
----
- xdiff.c | 239 ++++++++++++++++++++++++++++++++++++--------------------
- 1 file changed, 153 insertions(+), 86 deletions(-)
-
-diff --git a/xdiff.c b/xdiff.c
-index 0756c5a..357db09 100644
---- a/xdiff.c
-+++ b/xdiff.c
-@@ -37,32 +37,101 @@ struct string_buffer {
- unsigned long size;
- };
-
-- ZEND_BEGIN_ARG_INFO(xdiff_arg_force_ref, 0)
-- ZEND_ARG_PASS_INFO(0)
-- ZEND_ARG_PASS_INFO(0)
-- ZEND_ARG_PASS_INFO(0)
-- ZEND_ARG_PASS_INFO(1)
-- ZEND_END_ARG_INFO()
--
--static int load_mm_file(const char *filepath, mmfile_t *dest TSRMLS_DC);
-+ZEND_BEGIN_ARG_INFO_EX(arginfo_xdiff_string_diff, 0, 0, 2)
-+ ZEND_ARG_INFO(0, str1)
-+ ZEND_ARG_INFO(0, str2)
-+ ZEND_ARG_INFO(0, context)
-+ ZEND_ARG_INFO(0, minimal)
-+ZEND_END_ARG_INFO()
-+
-+ZEND_BEGIN_ARG_INFO_EX(arginfo_xdiff_file_diff, 0, 0, 3)
-+ ZEND_ARG_INFO(0, file1)
-+ ZEND_ARG_INFO(0, file2)
-+ ZEND_ARG_INFO(0, dest)
-+ ZEND_ARG_INFO(0, context)
-+ ZEND_ARG_INFO(0, minimal)
-+ZEND_END_ARG_INFO()
-+
-+ZEND_BEGIN_ARG_INFO_EX(arginfo_xdiff_string_bdiff, 0, 0, 2)
-+ ZEND_ARG_INFO(0, str1)
-+ ZEND_ARG_INFO(0, str2)
-+ZEND_END_ARG_INFO()
-+
-+#define arginfo_xdiff_string_rabdiff arginfo_xdiff_string_bdiff
-+
-+ZEND_BEGIN_ARG_INFO_EX(arginfo_xdiff_file_bdiff, 0, 0, 3)
-+ ZEND_ARG_INFO(0, file1)
-+ ZEND_ARG_INFO(0, file2)
-+ ZEND_ARG_INFO(0, dest)
-+ZEND_END_ARG_INFO()
-+
-+#define arginfo_xdiff_file_rabdiff arginfo_xdiff_file_bdiff
-+
-+ZEND_BEGIN_ARG_INFO_EX(arginfo_xdiff_file_bdiff_size, 0, 0, 1)
-+ ZEND_ARG_INFO(0, filepath)
-+ZEND_END_ARG_INFO()
-+
-+ZEND_BEGIN_ARG_INFO_EX(arginfo_xdiff_string_bdiff_size, 0, 0, 1)
-+ ZEND_ARG_INFO(0, patch)
-+ZEND_END_ARG_INFO()
-+
-+ZEND_BEGIN_ARG_INFO_EX(arginfo_xdiff_file_patch, 0, 0, 3)
-+ ZEND_ARG_INFO(0, file)
-+ ZEND_ARG_INFO(0, patch)
-+ ZEND_ARG_INFO(0, dest)
-+ ZEND_ARG_INFO(0, flags)
-+ZEND_END_ARG_INFO()
-+
-+ZEND_BEGIN_ARG_INFO_EX(arginfo_xdiff_string_patch, 0, 0, 2)
-+ ZEND_ARG_INFO(0, src)
-+ ZEND_ARG_INFO(0, patch)
-+ ZEND_ARG_INFO(0, flags)
-+ ZEND_ARG_INFO(1, error)
-+ZEND_END_ARG_INFO()
-+
-+ZEND_BEGIN_ARG_INFO_EX(arginfo_xdiff_file_bpatch, 0, 0, 3)
-+ ZEND_ARG_INFO(0, file)
-+ ZEND_ARG_INFO(0, patch)
-+ ZEND_ARG_INFO(0, dest)
-+ZEND_END_ARG_INFO()
-+
-+ZEND_BEGIN_ARG_INFO_EX(arginfo_xdiff_string_bpatch, 0, 0, 2)
-+ ZEND_ARG_INFO(0, src)
-+ ZEND_ARG_INFO(0, patch)
-+ZEND_END_ARG_INFO()
-+
-+ZEND_BEGIN_ARG_INFO_EX(arginfo_diff_file_merge3, 0, 0, 4)
-+ ZEND_ARG_INFO(0, file1)
-+ ZEND_ARG_INFO(0, file2)
-+ ZEND_ARG_INFO(0, file3)
-+ ZEND_ARG_INFO(0, dest)
-+ZEND_END_ARG_INFO()
-+
-+ZEND_BEGIN_ARG_INFO_EX(arginfo_xdiff_string_merge3, 0, 0, 3)
-+ ZEND_ARG_INFO(0, str1)
-+ ZEND_ARG_INFO(0, str2)
-+ ZEND_ARG_INFO(0, str3)
-+ ZEND_ARG_INFO(1, error)
-+ZEND_END_ARG_INFO()
-+
-+static int load_mm_file(const char *filepath, mmfile_t *dest);
- static int load_into_mm_file(const char *buffer, unsigned long size, mmfile_t *dest);
- static int append_string(void *ptr, mmbuffer_t *buffer, int array_size);
- static int append_stream(void *ptr, mmbuffer_t *buffer, int array_size);
- static int init_string(struct string_buffer *string);
- static void free_string(struct string_buffer *string);
--static void invalidate_string(struct string_buffer *string);
-
--static int make_diff(char *filepath1, char *filepath2, xdemitcb_t *output, int context, int minimal TSRMLS_DC);
-+static int make_diff(char *filepath1, char *filepath2, xdemitcb_t *output, int context, int minimal);
- static int make_diff_str(char *str1, int size1, char *str2, int size2, xdemitcb_t *output, int context, int minimal);
--static int make_bdiff(char *filepath1, char *filepath2, xdemitcb_t *output TSRMLS_DC);
-+static int make_bdiff(char *filepath1, char *filepath2, xdemitcb_t *output);
- static int make_bdiff_str(char *str1, int size1, char *str2, int size2, xdemitcb_t *output);
--static int make_patch(char *file_path, char *patch_path, xdemitcb_t *output, xdemitcb_t *error, int flags TSRMLS_DC);
-+static int make_patch(char *file_path, char *patch_path, xdemitcb_t *output, xdemitcb_t *error, int flags);
- static int make_patch_str(char *file, int size1, char *patch, int size2, xdemitcb_t *output, xdemitcb_t *error, int flags);
--static int make_bpatch(char *file_path, char *patch_path, xdemitcb_t *output TSRMLS_DC);
-+static int make_bpatch(char *file_path, char *patch_path, xdemitcb_t *output);
- static int make_bpatch_str(char *file, int size1, char *patch, int size2, xdemitcb_t *output);
--static int make_merge3(char *filepath1, char *filepath2, char *filepath3, xdemitcb_t *output, xdemitcb_t *error TSRMLS_DC);
-+static int make_merge3(char *filepath1, char *filepath2, char *filepath3, xdemitcb_t *output, xdemitcb_t *error);
- static int make_merge3_str(char *content1, int size1, char *content2, int size2, char *content3, int size3, xdemitcb_t *output, xdemitcb_t *error);
--static int make_rabdiff(char *filepath1, char *filepath2, xdemitcb_t *output TSRMLS_DC);
-+static int make_rabdiff(char *filepath1, char *filepath2, xdemitcb_t *output);
- static int make_rabdiff_str(char *str1, int size1, char *str2, int size2, xdemitcb_t *output);
-
- static void *xdiff_malloc(void *foo, unsigned int size)
-@@ -89,25 +158,29 @@ static memallocator_t allocator = { NULL, xdiff_malloc, xdiff_free, xdiff_reallo
- * Every user visible function must have an entry in xdiff_functions[].
- */
- zend_function_entry xdiff_functions[] = {
-- PHP_FE(xdiff_file_diff, NULL)
-- PHP_FE(xdiff_file_bdiff, NULL)
-- PHP_FE(xdiff_file_patch, NULL)
-- PHP_FE(xdiff_file_bpatch, NULL)
-- PHP_FE(xdiff_file_merge3, NULL)
-- PHP_FE(xdiff_file_rabdiff, NULL)
-- PHP_FE(xdiff_file_bdiff_size, NULL)
-- PHP_FE(xdiff_string_diff, NULL)
-- PHP_FE(xdiff_string_bdiff, NULL)
-- PHP_FE(xdiff_string_patch, xdiff_arg_force_ref)
-- PHP_FE(xdiff_string_bpatch, NULL)
-- PHP_FE(xdiff_string_merge3, xdiff_arg_force_ref)
-- PHP_FE(xdiff_string_rabdiff, NULL)
-- PHP_FE(xdiff_string_bdiff_size, NULL)
-- PHP_FALIAS(xdiff_file_diff_binary, xdiff_file_bdiff, NULL)
-- PHP_FALIAS(xdiff_file_patch_binary, xdiff_file_bpatch, NULL)
-- PHP_FALIAS(xdiff_string_diff_binary, xdiff_string_bdiff, NULL)
-- PHP_FALIAS(xdiff_string_patch_binary, xdiff_string_bpatch, NULL)
-+ PHP_FE(xdiff_file_diff, arginfo_xdiff_file_diff)
-+ PHP_FE(xdiff_file_bdiff, arginfo_xdiff_file_bdiff)
-+ PHP_FE(xdiff_file_patch, arginfo_xdiff_file_patch)
-+ PHP_FE(xdiff_file_bpatch, arginfo_xdiff_file_bpatch)
-+ PHP_FE(xdiff_file_merge3, arginfo_diff_file_merge3)
-+ PHP_FE(xdiff_file_rabdiff, arginfo_xdiff_file_rabdiff)
-+ PHP_FE(xdiff_file_bdiff_size, arginfo_xdiff_file_bdiff_size)
-+ PHP_FE(xdiff_string_diff, arginfo_xdiff_string_diff)
-+ PHP_FE(xdiff_string_bdiff, arginfo_xdiff_string_bdiff)
-+ PHP_FE(xdiff_string_patch, arginfo_xdiff_string_patch)
-+ PHP_FE(xdiff_string_bpatch, arginfo_xdiff_string_bpatch)
-+ PHP_FE(xdiff_string_merge3, arginfo_xdiff_string_merge3)
-+ PHP_FE(xdiff_string_rabdiff, arginfo_xdiff_string_rabdiff)
-+ PHP_FE(xdiff_string_bdiff_size, arginfo_xdiff_string_bdiff_size)
-+ PHP_FALIAS(xdiff_file_diff_binary, xdiff_file_bdiff, arginfo_xdiff_file_bdiff)
-+ PHP_FALIAS(xdiff_file_patch_binary, xdiff_file_bpatch, arginfo_xdiff_file_bpatch)
-+ PHP_FALIAS(xdiff_string_diff_binary, xdiff_string_bdiff, arginfo_xdiff_string_bdiff)
-+ PHP_FALIAS(xdiff_string_patch_binary, xdiff_string_bpatch, arginfo_xdiff_string_bpatch)
-+#ifdef PHP_FE_END
-+ PHP_FE_END
-+#else
- {NULL, NULL, NULL}
-+#endif
- };
- /* }}} */
-
-@@ -172,7 +245,7 @@ PHP_FUNCTION(xdiff_string_diff)
- xdemitcb_t output;
- struct string_buffer string;
-
-- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SS|lb", &str1, &str2, &context, &minimal) == FAILURE) {
-+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "SS|lb", &str1, &str2, &context, &minimal) == FAILURE) {
- RETURN_FALSE;
- }
-
-@@ -204,7 +277,7 @@ PHP_FUNCTION(xdiff_file_diff)
- xdemitcb_t output;
- php_stream *output_stream;
-
-- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SSS|lb", &filepath1, &filepath2, &dest, &context, &minimal) == FAILURE) {
-+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "SSS|lb", &filepath1, &filepath2, &dest, &context, &minimal) == FAILURE) {
- RETURN_FALSE;
- }
-
-@@ -217,7 +290,7 @@ PHP_FUNCTION(xdiff_file_diff)
- output.priv = output_stream;
- output.outf = append_stream;
-
-- retval = make_diff(filepath1->val, filepath2->val, &output, context, minimal TSRMLS_CC);
-+ retval = make_diff(filepath1->val, filepath2->val, &output, context, minimal);
- if (!retval)
- goto out_stream_close;
-
-@@ -230,7 +303,7 @@ PHP_FUNCTION(xdiff_file_diff)
- }
- /* }}} */
-
--/* {{{ proto mixed xdiff_string_diff_binary(string str1, string str2)
-+/* {{{ proto mixed xdiff_string_bdiff(string str1, string str2)
- */
- PHP_FUNCTION(xdiff_string_bdiff)
- {
-@@ -239,7 +312,7 @@ PHP_FUNCTION(xdiff_string_bdiff)
- xdemitcb_t output;
- struct string_buffer string;
-
-- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SS", &str1, &str2) == FAILURE) {
-+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "SS", &str1, &str2) == FAILURE) {
- RETURN_FALSE;
- }
-
-@@ -261,7 +334,7 @@ PHP_FUNCTION(xdiff_string_bdiff)
- }
- /* }}} */
-
--/* {{{ proto bool xdiff_file_diff_binary(string file1, string file2, string dest)
-+/* {{{ proto bool xdiff_file_bdiff(string file1, string file2, string dest)
- */
- PHP_FUNCTION(xdiff_file_bdiff)
- {
-@@ -270,7 +343,7 @@ PHP_FUNCTION(xdiff_file_bdiff)
- xdemitcb_t output;
- php_stream *output_stream;
-
-- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SSS", &filepath1, &filepath2, &result) == FAILURE) {
-+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "SSS", &filepath1, &filepath2, &result) == FAILURE) {
- RETURN_FALSE;
- }
-
-@@ -283,7 +356,7 @@ PHP_FUNCTION(xdiff_file_bdiff)
- output.priv = output_stream;
- output.outf = append_stream;
-
-- retval = make_bdiff(filepath1->val, filepath2->val, &output TSRMLS_CC);
-+ retval = make_bdiff(filepath1->val, filepath2->val, &output);
- if (!retval)
- goto out_stream_close;
-
-@@ -305,7 +378,7 @@ PHP_FUNCTION(xdiff_string_rabdiff)
- xdemitcb_t output;
- struct string_buffer string;
-
-- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SS", &str1, &str2) == FAILURE) {
-+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "SS", &str1, &str2) == FAILURE) {
- RETURN_FALSE;
- }
-
-@@ -336,7 +409,7 @@ PHP_FUNCTION(xdiff_file_rabdiff)
- xdemitcb_t output;
- php_stream *output_stream;
-
-- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SSS", &filepath1, &filepath2, &result) == FAILURE) {
-+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "SSS", &filepath1, &filepath2, &result) == FAILURE) {
- RETURN_FALSE;
- }
-
-@@ -349,7 +422,7 @@ PHP_FUNCTION(xdiff_file_rabdiff)
- output.priv = output_stream;
- output.outf = append_stream;
-
-- retval = make_rabdiff(filepath1->val, filepath2->val, &output TSRMLS_CC);
-+ retval = make_rabdiff(filepath1->val, filepath2->val, &output);
- if (!retval)
- goto out_stream_close;
-
-@@ -362,7 +435,7 @@ PHP_FUNCTION(xdiff_file_rabdiff)
- }
- /* }}} */
-
--/* {{{ proto bool xdiff_file_bdiff_size(string file1, string file2, string dest)
-+/* {{{ proto bool xdiff_file_bdiff_size(string filepath)
- */
- PHP_FUNCTION(xdiff_file_bdiff_size)
- {
-@@ -371,13 +444,13 @@ PHP_FUNCTION(xdiff_file_bdiff_size)
- long result;
- mmfile_t file;
-
-- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &filepath) == FAILURE) {
-+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &filepath) == FAILURE) {
- RETURN_FALSE;
- }
-
- RETVAL_FALSE;
-
-- retval = load_mm_file(filepath->val, &file TSRMLS_CC);
-+ retval = load_mm_file(filepath->val, &file);
- if (!retval)
- goto out;
-
-@@ -394,7 +467,7 @@ PHP_FUNCTION(xdiff_file_bdiff_size)
- }
- /* }}} */
-
--/* {{{ proto bool xdiff_string_bdiff_size(string file1, string file2, string dest)
-+/* {{{ proto bool xdiff_string_bdiff_size(string patch)
- */
- PHP_FUNCTION(xdiff_string_bdiff_size)
- {
-@@ -403,7 +476,7 @@ PHP_FUNCTION(xdiff_string_bdiff_size)
- long result;
- mmfile_t file;
-
-- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &patch) == FAILURE) {
-+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &patch) == FAILURE) {
- RETURN_FALSE;
- }
-
-@@ -437,7 +510,7 @@ PHP_FUNCTION(xdiff_file_patch)
- xdemitcb_t output, error_output;
- struct string_buffer error_string;
-
-- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SSS|l", &src_path, &patch_path, &dest_path, &flags) == FAILURE) {
-+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "SSS|l", &src_path, &patch_path, &dest_path, &flags) == FAILURE) {
- RETURN_FALSE;
- }
-
-@@ -457,7 +530,7 @@ PHP_FUNCTION(xdiff_file_patch)
- error_output.priv= &error_string;
- error_output.outf = append_string;
-
-- retval = make_patch(src_path->val, patch_path->val, &output, &error_output, flags TSRMLS_CC);
-+ retval = make_patch(src_path->val, patch_path->val, &output, &error_output, flags);
- if (retval < 0)
- goto out_free_string;
-
-@@ -487,7 +560,7 @@ PHP_FUNCTION(xdiff_string_patch)
- xdemitcb_t output, error_output;
- struct string_buffer output_string, error_string;
-
-- if (zend_parse_parameters_ex(0, ZEND_NUM_ARGS() TSRMLS_CC, "SS|lz", &src, &patch, &flags, &error_ref) == FAILURE) {
-+ if (zend_parse_parameters_ex(0, ZEND_NUM_ARGS(), "SS|lz", &src, &patch, &flags, &error_ref) == FAILURE) {
- RETURN_FALSE;
- }
-
-@@ -530,7 +603,7 @@ PHP_FUNCTION(xdiff_string_patch)
- }
- /* }}} */
-
--/* {{{ proto bool xdiff_file_patch_binary(string file, string patch, string dest)
-+/* {{{ proto bool xdiff_file_bpatch(string file, string patch, string dest)
- */
- PHP_FUNCTION(xdiff_file_bpatch)
- {
-@@ -539,7 +612,7 @@ PHP_FUNCTION(xdiff_file_bpatch)
- int retval;
- xdemitcb_t output;
-
-- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SSS", &src_path, &patch_path, &dest_path) == FAILURE) {
-+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "SSS", &src_path, &patch_path, &dest_path) == FAILURE) {
- RETURN_FALSE;
- }
-
-@@ -552,7 +625,7 @@ PHP_FUNCTION(xdiff_file_bpatch)
- output.outf = append_stream;
- output.priv = output_stream;
-
-- retval = make_bpatch(src_path->val, patch_path->val, &output TSRMLS_CC);
-+ retval = make_bpatch(src_path->val, patch_path->val, &output);
- php_stream_close(output_stream);
-
- if (retval == 0)
-@@ -563,7 +636,7 @@ PHP_FUNCTION(xdiff_file_bpatch)
- }
- /* }}} */
-
--/* {{{ proto string xdiff_string_patch_binary(string str, string patch)
-+/* {{{ proto string xdiff_string_bpatch(string str, string patch)
- */
- PHP_FUNCTION(xdiff_string_bpatch)
- {
-@@ -572,7 +645,7 @@ PHP_FUNCTION(xdiff_string_bpatch)
- xdemitcb_t output;
- struct string_buffer output_string;
-
-- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SS", &src, &patch) == FAILURE) {
-+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "SS", &src, &patch) == FAILURE) {
- RETURN_FALSE;
- }
-
-@@ -608,7 +681,7 @@ PHP_FUNCTION(xdiff_file_merge3)
- xdemitcb_t output, error_output;
- int retval;
-
-- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SSSS", &file1, &file2, &file3, &dest) == FAILURE) {
-+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "SSSS", &file1, &file2, &file3, &dest) == FAILURE) {
- RETURN_FALSE;
- }
-
-@@ -628,7 +701,7 @@ PHP_FUNCTION(xdiff_file_merge3)
- error_output.priv = &string;
- error_output.outf = append_string;
-
-- retval = make_merge3(file1->val, file2->val, file3->val, &output, &error_output TSRMLS_CC);
-+ retval = make_merge3(file1->val, file2->val, file3->val, &output, &error_output);
- if (!retval)
- goto out_free_string;
-
-@@ -657,7 +730,7 @@ PHP_FUNCTION(xdiff_string_merge3)
- xdemitcb_t output, error_output;
- int retval;
-
-- if (zend_parse_parameters_ex(0, ZEND_NUM_ARGS() TSRMLS_CC, "SSS|z", &file1, &file2, &file3, &error_ref) == FAILURE) {
-+ if (zend_parse_parameters_ex(0, ZEND_NUM_ARGS(), "SSS|z", &file1, &file2, &file3, &error_ref) == FAILURE) {
- RETURN_FALSE;
- }
-
-@@ -700,7 +773,7 @@ PHP_FUNCTION(xdiff_string_merge3)
- }
- /* }}} */
-
--static int load_mm_file(const char *filepath, mmfile_t *dest TSRMLS_DC)
-+static int load_mm_file(const char *filepath, mmfile_t *dest)
- {
- int retval;
- off_t filesize;
-@@ -789,7 +862,6 @@ static int append_stream(void *ptr, mmbuffer_t *buffer, int array_size)
- {
- php_stream *stream = ptr;
- unsigned int i;
-- TSRMLS_FETCH();
-
- for (i = 0; i < array_size; i++) {
- php_stream_write(stream, buffer[i].ptr, buffer[i].size);
-@@ -810,29 +882,24 @@ static int init_string(struct string_buffer *string)
- return 1;
- }
-
--static void invalidate_string(struct string_buffer *string)
--{
-- string->ptr = NULL;
--}
--
- static void free_string(struct string_buffer *string)
- {
- if (string->ptr)
- efree(string->ptr);
- }
-
--static int make_diff(char *filepath1, char *filepath2, xdemitcb_t *output, int context, int minimal TSRMLS_DC)
-+static int make_diff(char *filepath1, char *filepath2, xdemitcb_t *output, int context, int minimal)
- {
- mmfile_t file1, file2;
- xpparam_t params;
- xdemitconf_t conf;
- int retval, result = 0;
-
-- retval = load_mm_file(filepath1, &file1 TSRMLS_CC);
-+ retval = load_mm_file(filepath1, &file1);
- if (!retval)
- goto out;
-
-- retval = load_mm_file(filepath2, &file2 TSRMLS_CC);
-+ retval = load_mm_file(filepath2, &file2);
- if (!retval)
- goto out_free_mmfile;
-
-@@ -885,17 +952,17 @@ static int make_diff_str(char *str1, int size1, char *str2, int size2, xdemitcb_
- return result;
- }
-
--static int make_bdiff(char *filepath1, char *filepath2, xdemitcb_t *output TSRMLS_DC)
-+static int make_bdiff(char *filepath1, char *filepath2, xdemitcb_t *output)
- {
- mmfile_t file1, file2;
- bdiffparam_t params;
- int retval, result = 0;
-
-- retval = load_mm_file(filepath1, &file1 TSRMLS_CC);
-+ retval = load_mm_file(filepath1, &file1);
- if (!retval)
- goto out;
-
-- retval = load_mm_file(filepath2, &file2 TSRMLS_CC);
-+ retval = load_mm_file(filepath2, &file2);
- if (!retval)
- goto out_free_mmfile;
-
-@@ -945,16 +1012,16 @@ static int make_bdiff_str(char *str1, int size1, char *str2, int size2, xdemitcb
- return result;
- }
-
--static int make_rabdiff(char *filepath1, char *filepath2, xdemitcb_t *output TSRMLS_DC)
-+static int make_rabdiff(char *filepath1, char *filepath2, xdemitcb_t *output)
- {
- mmfile_t file1, file2;
- int retval, result = 0;
-
-- retval = load_mm_file(filepath1, &file1 TSRMLS_CC);
-+ retval = load_mm_file(filepath1, &file1);
- if (!retval)
- goto out;
-
-- retval = load_mm_file(filepath2, &file2 TSRMLS_CC);
-+ retval = load_mm_file(filepath2, &file2);
- if (!retval)
- goto out_free_mmfile;
-
-@@ -999,16 +1066,16 @@ static int make_rabdiff_str(char *str1, int size1, char *str2, int size2, xdemit
- return result;
- }
-
--static int make_patch(char *file_path, char *patch_path, xdemitcb_t *output, xdemitcb_t *error, int flags TSRMLS_DC)
-+static int make_patch(char *file_path, char *patch_path, xdemitcb_t *output, xdemitcb_t *error, int flags)
- {
- mmfile_t file, patch;
- int retval, result = 0;
-
-- retval = load_mm_file(file_path, &file TSRMLS_CC);
-+ retval = load_mm_file(file_path, &file);
- if (!retval)
- goto out;
-
-- retval = load_mm_file(patch_path, &patch TSRMLS_CC);
-+ retval = load_mm_file(patch_path, &patch);
- if (!retval)
- goto out_free_mmfile;
-
-@@ -1053,16 +1120,16 @@ static int make_patch_str(char *file, int size1, char *patch, int size2, xdemitc
- return result;
- }
-
--static int make_bpatch(char *file_path, char *patch_path, xdemitcb_t *output TSRMLS_DC)
-+static int make_bpatch(char *file_path, char *patch_path, xdemitcb_t *output)
- {
- mmfile_t file_mm, patch_mm;
- int retval, result = 0;
-
-- retval = load_mm_file(file_path, &file_mm TSRMLS_CC);
-+ retval = load_mm_file(file_path, &file_mm);
- if (!retval)
- goto out;
-
-- retval = load_mm_file(patch_path, &patch_mm TSRMLS_CC);
-+ retval = load_mm_file(patch_path, &patch_mm);
- if (!retval)
- goto out_free_mmfile;
-
-@@ -1107,20 +1174,20 @@ static int make_bpatch_str(char *file, int size1, char *patch, int size2, xdemit
- return result;
- }
-
--static int make_merge3(char *filepath1, char *filepath2, char *filepath3, xdemitcb_t *output, xdemitcb_t *error TSRMLS_DC)
-+static int make_merge3(char *filepath1, char *filepath2, char *filepath3, xdemitcb_t *output, xdemitcb_t *error)
- {
- mmfile_t file1, file2, file3;
- int retval, result = 0;
-
-- retval = load_mm_file(filepath1, &file1 TSRMLS_CC);
-+ retval = load_mm_file(filepath1, &file1);
- if (!retval)
- goto out;
-
-- retval = load_mm_file(filepath2, &file2 TSRMLS_CC);
-+ retval = load_mm_file(filepath2, &file2);
- if (!retval)
- goto out_free_mmfile;
-
-- retval = load_mm_file(filepath3, &file3 TSRMLS_CC);
-+ retval = load_mm_file(filepath3, &file3);
- if (!retval)
- goto out_free_mmfile2;
-
diff --git a/PHPINFO b/PHPINFO
new file mode 100644
index 0000000..82b78bd
--- /dev/null
+++ b/PHPINFO
@@ -0,0 +1,6 @@
+
+xdiff
+
+xdiff support => enabled
+extension version => 2.1.0
+libxdiff version => LibXDiff v0.23 by Davide Libenzi <davide@xmailserver.org>
diff --git a/REFLECTION b/REFLECTION
index c015236..9806053 100644
--- a/REFLECTION
+++ b/REFLECTION
@@ -1,61 +1,133 @@
-Extension [ <persistent> extension #133 xdiff version 2.0.1 ] {
+Extension [ <persistent> extension #118 xdiff version 2.1.0 ] {
- Constants [3] {
- Constant [ integer XDIFF_PATCH_NORMAL ] { 45 }
- Constant [ integer XDIFF_PATCH_REVERSE ] { 43 }
- Constant [ integer XDIFF_PATCH_IGNORESPACE ] { 256 }
+ Constant [ int XDIFF_PATCH_NORMAL ] { 45 }
+ Constant [ int XDIFF_PATCH_REVERSE ] { 43 }
+ Constant [ int XDIFF_PATCH_IGNORESPACE ] { 256 }
}
- Functions {
- Function [ <internal:xdiff> function xdiff_file_diff ] {
+ Function [ <internal:xdiff> function xdiff_string_diff ] {
+
+ - Parameters [4] {
+ Parameter #0 [ <required> string $str1 ]
+ Parameter #1 [ <required> string $str2 ]
+ Parameter #2 [ <optional> int $context ]
+ Parameter #3 [ <optional> bool $minimal ]
+ }
}
- Function [ <internal:xdiff> function xdiff_file_bdiff ] {
+ Function [ <internal:xdiff> function xdiff_file_diff ] {
+
+ - Parameters [5] {
+ Parameter #0 [ <required> string $file1 ]
+ Parameter #1 [ <required> string $file2 ]
+ Parameter #2 [ <required> string $dest ]
+ Parameter #3 [ <optional> int $context ]
+ Parameter #4 [ <optional> bool $minimal ]
+ }
+ - Return [ bool ]
}
- Function [ <internal:xdiff> function xdiff_file_patch ] {
+ Function [ <internal:xdiff> function xdiff_string_diff_binary ] {
+
+ - Parameters [2] {
+ Parameter #0 [ <required> string $str1 ]
+ Parameter #1 [ <required> string $str2 ]
+ }
}
- Function [ <internal:xdiff> function xdiff_file_bpatch ] {
+ Function [ <internal:xdiff> function xdiff_file_diff_binary ] {
+
+ - Parameters [3] {
+ Parameter #0 [ <required> string $file1 ]
+ Parameter #1 [ <required> string $file2 ]
+ Parameter #2 [ <required> string $dest ]
+ }
+ - Return [ bool ]
}
- Function [ <internal:xdiff> function xdiff_file_merge3 ] {
+ Function [ <internal:xdiff> function xdiff_string_rabdiff ] {
+
+ - Parameters [2] {
+ Parameter #0 [ <required> string $str1 ]
+ Parameter #1 [ <required> string $str2 ]
+ }
}
Function [ <internal:xdiff> function xdiff_file_rabdiff ] {
+
+ - Parameters [3] {
+ Parameter #0 [ <required> string $file1 ]
+ Parameter #1 [ <required> string $file2 ]
+ Parameter #2 [ <required> string $dest ]
+ }
+ - Return [ bool ]
}
Function [ <internal:xdiff> function xdiff_file_bdiff_size ] {
+
+ - Parameters [3] {
+ Parameter #0 [ <required> string $file1 ]
+ Parameter #1 [ <required> string $file2 ]
+ Parameter #2 [ <required> string $dest ]
+ }
+ - Return [ bool ]
}
- Function [ <internal:xdiff> function xdiff_string_diff ] {
- }
- Function [ <internal:xdiff> function xdiff_string_bdiff ] {
+ Function [ <internal:xdiff> function xdiff_string_bdiff_size ] {
+
+ - Parameters [3] {
+ Parameter #0 [ <required> string $file1 ]
+ Parameter #1 [ <required> string $file2 ]
+ Parameter #2 [ <required> string $dest ]
+ }
+ - Return [ bool ]
}
- Function [ <internal:xdiff> function xdiff_string_patch ] {
+ Function [ <internal:xdiff> function xdiff_file_patch ] {
- Parameters [4] {
- Parameter #0 [ <required> $param0 ]
- Parameter #1 [ <required> $param1 ]
- Parameter #2 [ <required> $param2 ]
- Parameter #3 [ <required> &$param3 ]
+ Parameter #0 [ <required> string $file ]
+ Parameter #1 [ <required> string $patch ]
+ Parameter #2 [ <required> string $dest ]
+ Parameter #3 [ <optional> int $flags ]
}
}
- Function [ <internal:xdiff> function xdiff_string_bpatch ] {
- }
- Function [ <internal:xdiff> function xdiff_string_merge3 ] {
+ Function [ <internal:xdiff> function xdiff_string_patch ] {
- Parameters [4] {
- Parameter #0 [ <required> $param0 ]
- Parameter #1 [ <required> $param1 ]
- Parameter #2 [ <required> $param2 ]
- Parameter #3 [ <required> &$param3 ]
+ Parameter #0 [ <required> string $file ]
+ Parameter #1 [ <required> string $patch ]
+ Parameter #2 [ <optional> int $flags ]
+ Parameter #3 [ <optional> string &$error ]
}
}
- Function [ <internal:xdiff> function xdiff_string_rabdiff ] {
- }
- Function [ <internal:xdiff> function xdiff_string_bdiff_size ] {
- }
- Function [ <internal:xdiff> function xdiff_file_diff_binary ] {
- }
Function [ <internal:xdiff> function xdiff_file_patch_binary ] {
- }
- Function [ <internal:xdiff> function xdiff_string_diff_binary ] {
+
+ - Parameters [3] {
+ Parameter #0 [ <required> string $file ]
+ Parameter #1 [ <required> string $patch ]
+ Parameter #2 [ <required> string $dest ]
+ }
+ - Return [ bool ]
}
Function [ <internal:xdiff> function xdiff_string_patch_binary ] {
+
+ - Parameters [2] {
+ Parameter #0 [ <required> string $str ]
+ Parameter #1 [ <required> string $patch ]
+ }
+ }
+ Function [ <internal:xdiff> function xdiff_file_merge3 ] {
+
+ - Parameters [4] {
+ Parameter #0 [ <required> string $file1 ]
+ Parameter #1 [ <required> string $file2 ]
+ Parameter #2 [ <required> string $file3 ]
+ Parameter #3 [ <required> string $dest ]
+ }
+ }
+ Function [ <internal:xdiff> function xdiff_string_merge3 ] {
+
+ - Parameters [4] {
+ Parameter #0 [ <required> string $str1 ]
+ Parameter #1 [ <required> string $str2 ]
+ Parameter #2 [ <required> string $str3 ]
+ Parameter #3 [ <optional> string &$error ]
+ }
}
}
}
diff --git a/php-pecl-xdiff.spec b/php-pecl-xdiff.spec
index 92e9d3d..253a881 100644
--- a/php-pecl-xdiff.spec
+++ b/php-pecl-xdiff.spec
@@ -1,6 +1,6 @@
# remirepo spec file for php-pecl-xdiff
#
-# Copyright (c) 2016-2020 Remi Collet
+# Copyright (c) 2016-2021 Remi Collet
# License: CC-BY-SA
# http://creativecommons.org/licenses/by-sa/4.0/
#
@@ -11,7 +11,6 @@
%undefine _strict_symbol_defs_build
%if 0%{?scl:1}
-%global sub_prefix %{scl_prefix}
%scl_package php-pecl-xdiff
%endif
@@ -20,9 +19,9 @@
%global ini_name 40-%{pecl_name}.ini
%global libxdiff_version 0.23
-Name: %{?sub_prefix}php-pecl-%{pecl_name}
-Version: 2.0.1
-Release: 8%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
+Name: %{?scl_prefix}php-pecl-%{pecl_name}
+Version: 2.1.0
+Release: 1%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
Summary: File differences/patches
# libxdiff is LGPLv2+, xdiff extension is PHP
License: PHP and LGPLv2+
@@ -32,8 +31,7 @@ Source0: https://pecl.php.net/get/%{pecl_name}-%{version}.tgz
Source1: http://www.xmailserver.org/libxdiff-%{libxdiff_version}.tar.gz
Source2: config.m4
-Patch0: https://patch-diff.githubusercontent.com/raw/php/pecl-text-xdiff/pull/5.patch
-
+BuildRequires: make
BuildRequires: %{?dtsprefix}gcc
BuildRequires: %{?scl_prefix}php-devel >= 7
BuildRequires: %{?scl_prefix}php-pear
@@ -47,10 +45,6 @@ Provides: %{?scl_prefix}php-%{pecl_name} = %{version}
Provides: %{?scl_prefix}php-%{pecl_name}%{?_isa} = %{version}
Provides: %{?scl_prefix}php-pecl(%{pecl_name}) = %{version}
Provides: %{?scl_prefix}php-pecl(%{pecl_name})%{?_isa} = %{version}
-%if "%{?scl_prefix}" != "%{?sub_prefix}"
-Provides: %{?scl_prefix}php-pecl-%{pecl_name} = %{version}-%{release}
-Provides: %{?scl_prefix}php-pecl-%{pecl_name}%{?_isa} = %{version}-%{release}
-%endif
%if "%{?packager}" == "Remi Collet" && 0%{!?scl:1} && 0%{?rhel}
# Other third party repo stuff
@@ -65,12 +59,6 @@ Obsoletes: php80-pecl-%{pecl_name} <= %{version}
%endif
%endif
-%if 0%{?fedora} < 20 && 0%{?rhel} < 7
-# Filter shared private
-%{?filter_provides_in: %filter_provides_in %{_libdir}/.*\.so$}
-%{?filter_setup}
-%endif
-
%description
This extension creates and applies patches to both text and binary files.
@@ -96,8 +84,6 @@ sed -e 's/role="test"/role="src"/' \
-i package.xml
cd NTS
-%patch0 -p1 -b .pr
-
# Sanity check, really often broken
extver=$(sed -n '/#define PHP_XDIFF_VERSION/{s/.* "//;s/".*$//;p}' php_xdiff.h)
if test "x${extver}" != "x%{version}"; then
@@ -200,7 +186,7 @@ REPORT_EXIT_STATUS=1 \
: Upstream test suite for ZTS extension
cd ../NTS
-TEST_PHP_EXECUTABLE=%{_bindir}/php \
+TEST_PHP_EXECUTABLE=%{__ztsphp} \
TEST_PHP_ARGS="-n -d extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so" \
NO_INTERACTION=1 \
REPORT_EXIT_STATUS=1 \
@@ -225,6 +211,9 @@ REPORT_EXIT_STATUS=1 \
%changelog
+* Tue May 18 2021 Remi Collet <remi@remirepo.net> - 2.1.0-1
+- update to 2.1.0
+
* Wed Sep 30 2020 Remi Collet <remi@remirepo.net> - 2.0.1-8
- add patch for PHP 8 from
https://github.com/php/pecl-text-xdiff/pull/5