summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--NEWS1
-rw-r--r--acinclude.m48
-rw-r--r--ext/ereg/ereg.c4
-rw-r--r--ext/standard/config.m427
-rw-r--r--ext/standard/reg.c4
5 files changed, 43 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index 33ef481358..8cb722d010 100644
--- a/NEWS
+++ b/NEWS
@@ -1,7 +1,6 @@
PHP 4 NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? 2002, Version 4.3.0
-- Made PHP always use the bundled regex functions. (Jani)
- Added "ignore_repeated_errors" and "ignore_repeated_source" php.ini options
which can be used to disable logging of repeated error messages. (Marcus)
- Made pg_last_notice() work correctly. (Yasuo)
diff --git a/acinclude.m4 b/acinclude.m4
index 20e18557e5..5efc878db5 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -1025,9 +1025,17 @@ AC_DEFUN(PHP_CHECK_CC_OPTION,[
])
AC_DEFUN(PHP_REGEX,[
+
+if test "$REGEX_TYPE" = "php"; then
AC_DEFINE(HSREGEX,1,[ ])
AC_DEFINE(REGEX,1,[ ])
PHP_ADD_SOURCES(regex, regcomp.c regexec.c regerror.c regfree.c)
+elif test "$REGEX_TYPE" = "system"; then
+ AC_DEFINE(REGEX,0,[ ])
+fi
+
+AC_MSG_CHECKING([which regex library to use])
+AC_MSG_RESULT([$REGEX_TYPE])
])
dnl
diff --git a/ext/ereg/ereg.c b/ext/ereg/ereg.c
index 0627589bbc..02e39e401f 100644
--- a/ext/ereg/ereg.c
+++ b/ext/ereg/ereg.c
@@ -98,7 +98,11 @@ PHP_MSHUTDOWN_FUNCTION(regex)
PHP_MINFO_FUNCTION(regex)
{
+#if HSREGEX
php_info_print_table_row(2, "Regex Library", "Bundled library enabled");
+#else
+ php_info_print_table_row(2, "Regex Library", "System library enabled");
+#endif
}
diff --git a/ext/standard/config.m4 b/ext/standard/config.m4
index 60db9df453..99a062483c 100644
--- a/ext/standard/config.m4
+++ b/ext/standard/config.m4
@@ -198,6 +198,33 @@ AC_FLUSH_IO
divert(5)dnl
+AC_ARG_WITH(regex,
+[ --with-regex=TYPE regex library type: system, apache, php. Default: php
+ WARNING: Do NOT use unless you know what you are doing!],
+[
+ case $withval in
+ system)
+ if test "$PHP_SAPI" = "apache" || test "$PHP_SAPI" = "apache2filter"; then
+ REGEX_TYPE=php
+ else
+ REGEX_TYPE=system
+ fi
+ ;;
+ apache)
+ REGEX_TYPE=apache
+ ;;
+ php)
+ REGEX_TYPE=php
+ ;;
+ *)
+ REGEX_TYPE=php
+ AC_MSG_WARN(Invalid regex library type. Using default value: php)
+ ;;
+ esac
+],[
+ REGEX_TYPE=php
+])
+
AC_CHECK_FUNCS(fnmatch glob)
if test "$PHP_SAPI" = "cgi"; then
diff --git a/ext/standard/reg.c b/ext/standard/reg.c
index 0627589bbc..02e39e401f 100644
--- a/ext/standard/reg.c
+++ b/ext/standard/reg.c
@@ -98,7 +98,11 @@ PHP_MSHUTDOWN_FUNCTION(regex)
PHP_MINFO_FUNCTION(regex)
{
+#if HSREGEX
php_info_print_table_row(2, "Regex Library", "Bundled library enabled");
+#else
+ php_info_print_table_row(2, "Regex Library", "System library enabled");
+#endif
}