]> git.pld-linux.org Git - packages/php.git/blob - pcre-shared.patch
- up to 7.3.12
[packages/php.git] / pcre-shared.patch
1 --- php-7.3.0RC5/ext/pcre/config0.m4~   2018-11-06 12:22:53.000000000 +0200
2 +++ php-7.3.0RC5/ext/pcre/config0.m4    2018-11-12 13:30:52.805036671 +0200
3 @@ -84,8 +84,9 @@
4        ])
5      fi
6  
7 -    PHP_NEW_EXTENSION(pcre, php_pcre.c, no,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
8 +    PHP_NEW_EXTENSION(pcre, php_pcre.c, $ext_shared,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
9      PHP_INSTALL_HEADERS([ext/pcre], [php_pcre.h])
10 +    EXTRA_LIBS="$EXTRA_LIBS -lpcre2-8"
11    else
12      AC_MSG_CHECKING([for PCRE library to use])
13      AC_MSG_RESULT([bundled])
14 --- php-7.3.0alpha3/ext/pcre/php_pcre.h~        2018-07-03 15:56:43.000000000 +0300
15 +++ php-7.3.0alpha3/ext/pcre/php_pcre.h 2018-07-10 11:11:55.739017013 +0300
16 @@ -33,7 +33,29 @@
17  #include <locale.h>
18  #endif
19  
20 +#if !defined(COMPILE_DL_PCRE_NOREDIRECT)
21 +#define pcre_get_compiled_regex (*pcre_get_compiled_regex_p)
22 +#define pcre_get_compiled_regex_cache (*pcre_get_compiled_regex_cache_p)
23 +#define php_pcre_replace_impl (*php_pcre_replace_impl_p)
24 +#define php_pcre_match_impl (*php_pcre_match_impl_p)
25 +#define php_pcre_split_impl (*php_pcre_split_impl_p)
26 +#if !defined(COMPILE_DL_PCRE_NOEXTERN)
27 +#      define PCRE_EXTERN extern
28 +#else
29 +#      define PCRE_EXTERN
30 +#endif
31 +#else
32 +// for pcre.c
33 +#define PCRE_EXTERN
34 +extern void *pcre_get_compiled_regex_p;
35 +extern void *pcre_get_compiled_regex_cache_p;
36 +extern void *php_pcre_replace_impl_p;
37 +extern void *php_pcre_match_impl_p;
38 +extern void *php_pcre_split_impl_p;
39 +#endif
40 +
41  PHPAPI zend_string *php_pcre_replace(zend_string *regex, zend_string *subject_str, char *subject, size_t subject_len, zend_string *replace_str, size_t limit, size_t *replace_count);
42 +PCRE_EXTERN
43  PHPAPI pcre2_code* pcre_get_compiled_regex(zend_string *regex, uint32_t *capture_count, uint32_t *options);
44  PHPAPI pcre2_code* pcre_get_compiled_regex_ex(zend_string *regex, uint32_t *capture_count, uint32_t *preg_options, uint32_t *coptions);
45  
46 @@ -71,18 +71,23 @@ extern zend_module_entry pcre_module_ent
47  
48  typedef struct _pcre_cache_entry pcre_cache_entry;
49  
50 +PCRE_EXTERN
51  PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(zend_string *regex);
52  PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache_ex(zend_string *regex, int locale_aware);
53  
54 +PCRE_EXTERN
55  PHPAPI void  php_pcre_match_impl(  pcre_cache_entry *pce, char *subject, size_t subject_len, zval *return_value,
56         zval *subpats, int global, int use_flags, zend_long flags, zend_off_t start_offset);
57  
58 +PCRE_EXTERN
59  PHPAPI zend_string *php_pcre_replace_impl(pcre_cache_entry *pce, zend_string *subject_str, char *subject, size_t subject_len, zend_string *replace_str,
60         size_t limit, size_t *replace_count);
61  
62 +PCRE_EXTERN
63  PHPAPI void  php_pcre_split_impl(  pcre_cache_entry *pce, zend_string *subject_str, zval *return_value,
64         zend_long limit_val, zend_long flags);
65  
66 +PCRE_EXTERN
67  PHPAPI void  php_pcre_grep_impl(   pcre_cache_entry *pce, zval *input, zval *return_value,
68         zend_long flags);
69  
70 --- php-7.3.0beta3/ext/pcre/php_pcre.c~ 2018-09-11 11:43:27.000000000 +0300
71 +++ php-7.3.0beta3/ext/pcre/php_pcre.c  2018-09-11 11:43:30.747506034 +0300
72 @@ -21,6 +21,9 @@
73  #include "php.h"
74  #include "php_ini.h"
75  #include "php_globals.h"
76 +#if COMPILE_DL_PCRE
77 +#define COMPILE_DL_PCRE_NOREDIRECT
78 +#endif
79  #include "php_pcre.h"
80  #include "ext/standard/info.h"
81  #include "ext/standard/basic_functions.h"
82 @@ -208,6 +211,17 @@
83         REGISTER_LONG_CONSTANT("PREG_JIT_STACKLIMIT_ERROR", PHP_PCRE_JIT_STACKLIMIT_ERROR, CONST_CS | CONST_PERSISTENT);
84         REGISTER_STRING_CONSTANT("PCRE_VERSION", (char *)pcre_version(), CONST_CS | CONST_PERSISTENT);
85  
86 +#if COMPILE_DL_PCRE
87 +       pcre_get_compiled_regex_p = pcre_get_compiled_regex;
88 +       pcre_get_compiled_regex_cache_p = pcre_get_compiled_regex_cache;
89 +       php_pcre_replace_impl_p = php_pcre_replace_impl;
90 +       php_pcre_match_impl_p = php_pcre_match_impl;
91 +       php_pcre_split_impl_p = php_pcre_split_impl;
92 +       php_pcre_create_match_data_p = php_pcre_create_match_data;
93 +       php_pcre_free_match_data_p = php_pcre_free_match_data;
94 +       php_pcre_mctx_p = php_pcre_mctx;
95 +#endif
96 +
97         return SUCCESS;
98  }
99  /* }}} */
100 --- php-7.2.0RC5/ext/standard/basic_functions.c 2017-10-28 21:08:47.383549141 +0300
101 +++ php-7.2.0RC5/ext/standard/basic_functions.c 2017-10-28 21:10:20.625051932 +0300
102 @@ -113,6 +113,18 @@
103  PHPAPI php_basic_globals basic_globals;
104  #endif
105  
106 +#if COMPILE_DL_PCRE
107 +// Declare the pointers in core library
108 +void *pcre_get_compiled_regex_p;
109 +void *pcre_get_compiled_regex_cache_p;
110 +void *php_pcre_replace_impl_p;
111 +void *php_pcre_match_impl_p;
112 +void *php_pcre_split_impl_p;
113 +void *php_pcre_create_match_data_p;
114 +void *php_pcre_free_match_data_p;
115 +void *php_pcre_mctx_p;
116 +#endif
117 +
118  #include "php_fopen_wrappers.h"
119  #include "streamsfuncs.h"
120  
121 --- php-5.3.2/sapi/cli/tests/018.phpt~  2008-03-17 16:05:39.000000000 +0200
122 +++ php-5.3.2/sapi/cli/tests/018.phpt   2010-03-16 20:41:11.341251246 +0200
123 @@ -20,8 +20,6 @@
124  --EXPECTF--     
125  [PHP Modules]
126  %a
127 -pcre
128 -%a
129  
130  [Zend Modules]
131  %aDone
132 --- php-7.0.0beta3/main/php_ini.c~      2015-08-26 18:50:15.000000000 +0300
133 +++ php-7.0.0beta3/main/php_ini.c       2015-08-26 22:33:59.126957396 +0300
134 @@ -765,8 +765,8 @@
135   */
136  void php_ini_register_extensions(void)
137  {
138 -       zend_llist_apply(&extension_lists.engine, php_load_zend_extension_cb);
139         zend_llist_apply(&extension_lists.functions, php_load_php_extension_cb);
140 +       zend_llist_apply(&extension_lists.engine, php_load_zend_extension_cb);
141  
142         zend_llist_destroy(&extension_lists.engine);
143         zend_llist_destroy(&extension_lists.functions);
144 --- php-5.3.1/ext/phar/Makefile.frag~   2009-07-23 15:48:04.000000000 +0000
145 +++ php-5.3.1/ext/phar/Makefile.frag    2009-11-30 16:10:29.687175948 +0000
146 @@ -10,7 +10,7 @@
147                 $(top_srcdir)/build/shtool echo -n -- "$(top_builddir)/$(SAPI_CLI_PATH) -n"; \
148                 if test "x$(PHP_MODULES)" != "x"; then \
149                 $(top_srcdir)/build/shtool echo -n -- " -d extension_dir=$(top_builddir)/modules"; \
150 -               for i in spl bz2 zlib phar; do \
151 +               for i in pcre spl bz2 zlib phar; do \
152                         if test -f "$(top_builddir)/modules/$$i.la"; then \
153                                 . $(top_builddir)/modules/$$i.la; $(top_srcdir)/build/shtool echo -n -- " -d extension=$$dlname"; \
154                         fi; \
155 --- php-7.3.0beta3/ext/pcre/php_pcre.h~ 2018-09-11 11:41:50.000000000 +0300
156 +++ php-7.3.0beta3/ext/pcre/php_pcre.h  2018-09-11 11:41:54.865778887 +0300
157 @@ -37,6 +37,9 @@
158  #define php_pcre_replace_impl (*php_pcre_replace_impl_p)
159  #define php_pcre_match_impl (*php_pcre_match_impl_p)
160  #define php_pcre_split_impl (*php_pcre_split_impl_p)
161 +#define php_pcre_create_match_data (*php_pcre_create_match_data_p)
162 +#define php_pcre_free_match_data (*php_pcre_free_match_data_p)
163 +#define php_pcre_mctx (*php_pcre_mctx_p)
164  #if !defined(COMPILE_DL_PCRE_NOEXTERN)
165  #      define PCRE_EXTERN extern
166  #else
167 @@ -50,6 +53,9 @@
168  extern void *php_pcre_replace_impl_p;
169  extern void *php_pcre_match_impl_p;
170  extern void *php_pcre_split_impl_p;
171 +extern void *php_pcre_create_match_data_p;
172 +extern void *php_pcre_free_match_data_p;
173 +extern void *php_pcre_mctx_p;
174  #endif
175  
176  PHPAPI zend_string *php_pcre_replace(zend_string *regex, zend_string *subject_str, char *subject, size_t subject_len, zend_string *replace_str, size_t limit, size_t *replace_count);
177 @@ -83,6 +89,7 @@
178  PHPAPI void  php_pcre_grep_impl(   pcre_cache_entry *pce, zval *input, zval *return_value,
179         zend_long flags);
180  
181 +PCRE_EXTERN
182  PHPAPI pcre2_match_context *php_pcre_mctx(void);
183  PHPAPI pcre2_general_context *php_pcre_gctx(void);
184  PHPAPI pcre2_compile_context *php_pcre_cctx(void);
185 @@ -90,7 +97,9 @@
186  PHPAPI void php_pcre_pce_decref(pcre_cache_entry *);
187  PHPAPI pcre2_code *php_pcre_pce_re(pcre_cache_entry *);
188  /* capture_count can be ignored, re is required. */
189 +PCRE_EXTERN
190  PHPAPI pcre2_match_data *php_pcre_create_match_data(uint32_t, pcre2_code *);
191 +PCRE_EXTERN
192  PHPAPI void php_pcre_free_match_data(pcre2_match_data *);
193  
194  ZEND_BEGIN_MODULE_GLOBALS(pcre)
This page took 0.074924 seconds and 3 git commands to generate.