]> git.pld-linux.org Git - packages/php.git/blobdiff - pcre-shared.patch
fix without pdo builds
[packages/php.git] / pcre-shared.patch
index 515a993b6849fb04aabdda0d310ddb3f8667857a..b57e59eafd77f5e794886932f1617e39f78a4f66 100644 (file)
@@ -1,50 +1,18 @@
---- php-7.0/ext/pcre/config0.m4~       2015-05-24 14:39:04.000000000 +0300
-+++ php-7.0/ext/pcre/config0.m4        2015-05-24 14:53:49.980250297 +0300
-@@ -11,7 +11,7 @@
-   if test "$PHP_PCRE_REGEX" != "yes" && test "$PHP_PCRE_REGEX" != "no"; then
-     AC_MSG_CHECKING([for PCRE headers location])
--    for i in $PHP_PCRE_REGEX $PHP_PCRE_REGEX/include $PHP_PCRE_REGEX/include/pcre $PHP_PCRE_REGEX/local/include; do
-+    for i in $PHP_PCRE_REGEX $PHP_PCRE_REGEX/include $PHP_PCRE_REGEX/include/pcre $PHP_PCRE_REGEX/local/include /usr/include; do
-       test -f $i/pcre.h && PCRE_INCDIR=$i
-     done
-@@ -21,7 +21,7 @@
-     AC_MSG_RESULT([$PCRE_INCDIR])
-     AC_MSG_CHECKING([for PCRE library location])
--    for j in $PHP_PCRE_REGEX $PHP_PCRE_REGEX/$PHP_LIBDIR; do
-+    for j in $PHP_PCRE_REGEX $PHP_PCRE_REGEX/$PHP_LIBDIR /usr/$PHP_LIBDIR; do
-       test -f $j/libpcre.a || test -f $j/libpcre.$SHLIB_SUFFIX_NAME && PCRE_LIBDIR=$j
-     done
-     
-@@ -43,12 +43,13 @@
-       AC_MSG_ERROR([The PCRE extension requires PCRE library version >= 6.6])
-     fi
--    PHP_ADD_LIBRARY_WITH_PATH(pcre, $PCRE_LIBDIR)
-+    PHP_ADD_LIBRARY_WITH_PATH(pcre, $PCRE_LIBDIR, PCRE_SHARED_LIBADD)
-     
-     AC_DEFINE(HAVE_PCRE, 1, [ ])
-     PHP_ADD_INCLUDE($PCRE_INCDIR)
--    PHP_NEW_EXTENSION(pcre, php_pcre.c, no,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
-+    PHP_NEW_EXTENSION(pcre, php_pcre.c, $ext_shared,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
-     PHP_INSTALL_HEADERS([ext/pcre], [php_pcre.h])
-+    EXTRA_LIBS="$EXTRA_LIBS -lpcre"
-   else
-     AC_MSG_CHECKING([for PCRE library to use])
-     AC_MSG_RESULT([bundled])
-@@ -61,7 +62,7 @@
-                                pcrelib/pcre_version.c pcrelib/pcre_xclass.c \
-                                pcrelib/pcre_jit_compile.c"
-     PHP_PCRE_CFLAGS="-DHAVE_CONFIG_H -I@ext_srcdir@/pcrelib -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1"
--    PHP_NEW_EXTENSION(pcre, $pcrelib_sources php_pcre.c, no,,$PHP_PCRE_CFLAGS)
-+    PHP_NEW_EXTENSION(pcre, $pcrelib_sources php_pcre.c, $ext_shared,,$PHP_PCRE_CFLAGS)
-     PHP_ADD_BUILD_DIR($ext_builddir/pcrelib)
-     PHP_INSTALL_HEADERS([ext/pcre], [php_pcre.h pcrelib/])
-     AC_DEFINE(HAVE_BUNDLED_PCRE, 1, [ ])
---- php-7.2.0beta1/ext/pcre/php_pcre.h 2017-07-22 12:35:11.071146616 +0300
-+++ php-7.2.0beta1/ext/pcre/php_pcre.h 2017-07-22 12:41:01.858859537 +0300
+--- php-src-PHP-7.4/ext/pcre/config0.m4~       2019-05-04 15:24:15.000000000 +0300
++++ php-src-PHP-7.4/ext/pcre/config0.m4        2019-05-05 18:48:35.524688151 +0300
+@@ -58,8 +58,9 @@
+       fi
+   fi
+-  PHP_NEW_EXTENSION(pcre, php_pcre.c, no,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
++  PHP_NEW_EXTENSION(pcre, php_pcre.c, $ext_shared,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
+   PHP_INSTALL_HEADERS([ext/pcre], [php_pcre.h])
++  EXTRA_LIBS="$EXTRA_LIBS -lpcre2-8"
+ else
+   AC_MSG_CHECKING([for PCRE library to use])
+   AC_MSG_RESULT([bundled])
+--- php-7.3.0beta3/ext/pcre/php_pcre.h~        2018-09-11 11:41:50.000000000 +0300
++++ php-7.3.0beta3/ext/pcre/php_pcre.h 2018-09-11 11:41:54.865778887 +0300
 @@ -33,7 +33,29 @@
  #include <locale.h>
  #endif
 +extern void *php_pcre_split_impl_p;
 +#endif
 +
- PHPAPI zend_string *php_pcre_replace(zend_string *regex, zend_string *subject_str, char *subject, int subject_len, zend_string *replace_str, int limit, int *replace_count);
+ 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);
 +PCRE_EXTERN
- PHPAPI pcre* pcre_get_compiled_regex(zend_string *regex, pcre_extra **extra, int *options);
- PHPAPI pcre* pcre_get_compiled_regex_ex(zend_string *regex, pcre_extra **extra, int *preg_options, int *coptions);
+ PHPAPI pcre2_code* pcre_get_compiled_regex(zend_string *regex, uint32_t *capture_count, uint32_t *options);
+ PHPAPI pcre2_code* pcre_get_compiled_regex_ex(zend_string *regex, uint32_t *capture_count, uint32_t *preg_options, uint32_t *coptions);
  
-@@ -56,14 +78,18 @@
-       int refcount;
} pcre_cache_entry;
+@@ -45,14 +67,18 @@
typedef struct _pcre_cache_entry pcre_cache_entry;
  
 +PCRE_EXTERN
  PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(zend_string *regex);
  
 +PCRE_EXTERN
- PHPAPI void  php_pcre_match_impl(  pcre_cache_entry *pce, char *subject, int subject_len, zval *return_value,
-       zval *subpats, int global, int use_flags, zend_long flags, zend_long start_offset);
+ PHPAPI void  php_pcre_match_impl(  pcre_cache_entry *pce, char *subject, size_t subject_len, zval *return_value,
+       zval *subpats, int global, int use_flags, zend_long flags, zend_off_t start_offset);
  
 +PCRE_EXTERN
- PHPAPI zend_string *php_pcre_replace_impl(pcre_cache_entry *pce, zend_string *subject_str, char *subject, int subject_len, zend_string *replace_str,
-       int limit, int *replace_count);
+ 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,
+       size_t limit, size_t *replace_count);
  
 +PCRE_EXTERN
  PHPAPI void  php_pcre_split_impl(  pcre_cache_entry *pce, zend_string *subject_str, zval *return_value,
        zend_long limit_val, zend_long flags);
  
---- php-5.3.1.pcre/ext/pcre/php_pcre.c 2009-11-30 21:38:01.759684456 +0000
-+++ php-7.2.0beta1/ext/pcre/php_pcre.c 2017-07-22 12:42:57.878062137 +0300
+--- php-7.3.0beta3/ext/pcre/php_pcre.c~        2018-09-11 11:43:27.000000000 +0300
++++ php-7.3.0beta3/ext/pcre/php_pcre.c 2018-09-11 11:43:30.747506034 +0300
 @@ -21,6 +21,9 @@
  #include "php.h"
  #include "php_ini.h"
  #include "php_pcre.h"
  #include "ext/standard/info.h"
  #include "ext/standard/basic_functions.h"
-@@ -28,6 +31,15 @@
- #if HAVE_PCRE || HAVE_BUNDLED_PCRE
-+#if COMPILE_DL_PCRE
-+//extern void *pcre_get_compiled_regex_p;
-+//extern void *pcre_get_compiled_regex_cache_p;
-+//extern void *php_pcre_replace_impl_p;
-+//extern void *php_pcre_match_impl_p;
-+//extern void *php_pcre_split_impl_p;
-+#endif
-+
-+
- #include "ext/standard/php_string.h"
- #define PREG_PATTERN_ORDER                    1
-@@ -208,6 +220,14 @@
+@@ -208,6 +211,17 @@
        REGISTER_LONG_CONSTANT("PREG_JIT_STACKLIMIT_ERROR", PHP_PCRE_JIT_STACKLIMIT_ERROR, CONST_CS | CONST_PERSISTENT);
        REGISTER_STRING_CONSTANT("PCRE_VERSION", (char *)pcre_version(), CONST_CS | CONST_PERSISTENT);
  
 +      php_pcre_replace_impl_p = php_pcre_replace_impl;
 +      php_pcre_match_impl_p = php_pcre_match_impl;
 +      php_pcre_split_impl_p = php_pcre_split_impl;
++      php_pcre_create_match_data_p = php_pcre_create_match_data;
++      php_pcre_free_match_data_p = php_pcre_free_match_data;
++      php_pcre_mctx_p = php_pcre_mctx;
 +#endif
 +
        return SUCCESS;
  }
  /* }}} */
---- php-5.3.1/ext/standard/browscap.c  2009-06-06 02:40:49.000000000 +0000
-+++ php-5.3.1.pcre/ext/standard/browscap.c     2009-11-30 21:33:00.775241138 +0000
-@@ -31,6 +31,11 @@
static zval *current_section;
- static char *current_section_name;
+--- php-7.2.0RC5/ext/standard/basic_functions.c        2017-10-28 21:08:47.383549141 +0300
++++ php-7.2.0RC5/ext/standard/basic_functions.c        2017-10-28 21:10:20.625051932 +0300
+@@ -113,6 +113,18 @@
PHPAPI php_basic_globals basic_globals;
+ #endif
  
 +#if COMPILE_DL_PCRE
-+// will be visible in here
-+PHPAPI pcre* (*pcre_get_compiled_regex_p)(zend_string *regex, pcre_extra **extra, int *options);
++// Declare the pointers in core library
++void *pcre_get_compiled_regex_p;
++void *pcre_get_compiled_regex_cache_p;
++void *php_pcre_replace_impl_p;
++void *php_pcre_match_impl_p;
++void *php_pcre_split_impl_p;
++void *php_pcre_create_match_data_p;
++void *php_pcre_free_match_data_p;
++void *php_pcre_mctx_p;
 +#endif
 +
- #define DEFAULT_SECTION_NAME "Default Browser Capability Settings"
+ #include "php_fopen_wrappers.h"
+ #include "streamsfuncs.h"
  
- /* OBJECTS_FIXME: This whole extension needs going through. The use of objects looks pretty broken here */
 --- php-5.3.2/sapi/cli/tests/018.phpt~ 2008-03-17 16:05:39.000000000 +0200
 +++ php-5.3.2/sapi/cli/tests/018.phpt  2010-03-16 20:41:11.341251246 +0200
 @@ -20,8 +20,6 @@
                        if test -f "$(top_builddir)/modules/$$i.la"; then \
                                . $(top_builddir)/modules/$$i.la; $(top_srcdir)/build/shtool echo -n -- " -d extension=$$dlname"; \
                        fi; \
---- php-7.2.0beta1/ext/spl/spl_iterators.h     2017-07-18 18:58:54.000000000 +0300
-+++ php-7.2.0beta1-pcre-shared/ext/spl/spl_iterators.h 2017-07-24 22:55:20.641679202 +0300
-@@ -24,9 +24,15 @@
- #include "php.h"
- #include "php_spl.h"
- #if HAVE_PCRE || HAVE_BUNDLED_PCRE
-+
-+#if COMPILE_DL_PCRE
-+// make pcre symbols will be declared here
-+#define COMPILE_DL_PCRE_NOEXTERN
- #include "ext/pcre/php_pcre.h"
+--- php-7.3.0beta3/ext/pcre/php_pcre.h~        2018-09-11 11:41:50.000000000 +0300
++++ php-7.3.0beta3/ext/pcre/php_pcre.h 2018-09-11 11:41:54.865778887 +0300
+@@ -37,6 +37,9 @@
+ #define php_pcre_replace_impl (*php_pcre_replace_impl_p)
+ #define php_pcre_match_impl (*php_pcre_match_impl_p)
+ #define php_pcre_split_impl (*php_pcre_split_impl_p)
++#define php_pcre_create_match_data (*php_pcre_create_match_data_p)
++#define php_pcre_free_match_data (*php_pcre_free_match_data_p)
++#define php_pcre_mctx (*php_pcre_mctx_p)
+ #if !defined(COMPILE_DL_PCRE_NOEXTERN)
+ #     define PCRE_EXTERN extern
+ #else
+@@ -50,6 +53,9 @@
+ extern void *php_pcre_replace_impl_p;
+ extern void *php_pcre_match_impl_p;
+ extern void *php_pcre_split_impl_p;
++extern void *php_pcre_create_match_data_p;
++extern void *php_pcre_free_match_data_p;
++extern void *php_pcre_mctx_p;
  #endif
  
-+#endif
-+
- #define spl_ce_Traversable   zend_ce_traversable
- #define spl_ce_Iterator      zend_ce_iterator
- #define spl_ce_Aggregate     zend_ce_aggregate
+ 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);
+@@ -83,6 +89,7 @@
+ PHPAPI void  php_pcre_grep_impl(   pcre_cache_entry *pce, zval *input, zval *return_value,
+       zend_long flags);
++PCRE_EXTERN
+ PHPAPI pcre2_match_context *php_pcre_mctx(void);
+ PHPAPI pcre2_general_context *php_pcre_gctx(void);
+ PHPAPI pcre2_compile_context *php_pcre_cctx(void);
+@@ -90,7 +97,9 @@
+ PHPAPI void php_pcre_pce_decref(pcre_cache_entry *);
+ PHPAPI pcre2_code *php_pcre_pce_re(pcre_cache_entry *);
+ /* capture_count can be ignored, re is required. */
++PCRE_EXTERN
+ PHPAPI pcre2_match_data *php_pcre_create_match_data(uint32_t, pcre2_code *);
++PCRE_EXTERN
+ PHPAPI void php_pcre_free_match_data(pcre2_match_data *);
+ ZEND_BEGIN_MODULE_GLOBALS(pcre)
This page took 0.031736 seconds and 4 git commands to generate.