jani Sun Jul 15 19:50:07 2007 UTC Added files: /php-src/ext/ereg config.w32 config0.m4
Removed files: /php-src/ext/standard reg.c reg.h /php-src/ext/standard/tests/reg .cvsignore 001.phpt 002.phpt 003.phpt 004.phpt 005.phpt 006.phpt 007.phpt 008.phpt 009.phpt 010.phpt 011.phpt 012.phpt 013.phpt 014.phpt 015.phpt 016.phpt /php-src/main php_regex.h /php-src/regex .cvsignore COPYRIGHT README WHATSNEW cclass.h cname.h debug.c debug.ih engine.c engine.ih main.c main.ih mkh regcomp.c regcomp.ih regerror.c regerror.ih regex.3 regex.7 regex.dsp regex.dsw regex.h regex.mak regex2.h regex_extra.h regexec.c regfree.c split.c tests utils.h Modified files: /php-src configure.in /php-src/ext/ereg ereg.c php_ereg.h php_regex.h /php-src/ext/pgsql pgsql.c /php-src/ext/standard basic_functions.c browscap.c config.m4 config.w32 html.c php_standard.h string.c /php-src/main internal_functions_nw.c internal_functions_win32.c php.h /php-src/sapi/apache php_apache_http.h /php-src/sapi/apache_hooks php_apache_http.h /php-src/win32/build config.w32 Log: - Moved the old regex functions to it's own extension: ereg
http://cvs.php.net/viewvc.cgi/php-src/configure.in?r1=1.636&r2=1.637&diff_format=u Index: php-src/configure.in diff -u php-src/configure.in:1.636 php-src/configure.in:1.637 --- php-src/configure.in:1.636 Thu Jul 12 14:18:01 2007 +++ php-src/configure.in Sun Jul 15 19:50:06 2007 @@ -1,4 +1,4 @@ -## $Id: configure.in,v 1.636 2007/07/12 14:18:01 jani Exp $ -*- autoconf -*- +## $Id: configure.in,v 1.637 2007/07/15 19:50:06 jani Exp $ -*- autoconf -*- dnl ## Process this file with autoconf to produce a configure script. divert(1) @@ -11,9 +11,9 @@ dnl ## libraries and so on. dnl ## In diversion 3 we check for compile-time options to the PHP -dnl ## core and how to deal with different system dependencies. This -dnl ## includes what regex library is used and whether debugging or short -dnl ## tags are enabled, and the default behaviour of php.ini options. +dnl ## core and how to deal with different system dependencies. +dnl ## This includes whether debugging or short tags are enabled +dnl ## and the default behaviour of php.ini options. dnl ## This is also where an SAPI interface is selected (choosing between dnl ## Apache module, CGI etc.) @@ -260,10 +260,9 @@ divert(3) dnl ## In diversion 3 we check for compile-time options to the PHP -dnl ## core and how to deal with different system dependencies. This -dnl ## includes what regex library is used and whether debugging or short -dnl ## tags are enabled, and the default behaviour of php.ini options. - +dnl ## core and how to deal with different system dependencies. +dnl ## This includes whether debugging or short tags are enabled +dnl ## and the default behaviour of php.ini options. dnl Starting system checks. dnl ------------------------------------------------------------------------- @@ -507,7 +506,6 @@ realpath \ random \ rand_r \ -regcomp \ res_search \ scandir \ setitimer \ @@ -1189,7 +1187,7 @@ PHP_SUBST(all_targets) PHP_SUBST(install_targets) -PHP_INSTALL_HEADERS([Zend/ TSRM/ include/ main/ main/streams/ regex/]) +PHP_INSTALL_HEADERS([Zend/ TSRM/ include/ main/ main/streams/]) PHP_ADD_SOURCES(TSRM, TSRM.c tsrm_strtok_r.c tsrm_virtual_cwd.c) @@ -1243,7 +1241,6 @@ PHP_ADD_SOURCES_X(Zend, zend_execute.c,,PHP_GLOBAL_OBJS,,$flag) PHP_ADD_BUILD_DIR(main main/streams) -PHP_ADD_BUILD_DIR(regex) PHP_ADD_BUILD_DIR(sapi/$PHP_SAPI sapi/cli) PHP_ADD_BUILD_DIR(TSRM) PHP_ADD_BUILD_DIR(Zend) http://cvs.php.net/viewvc.cgi/php-src/ext/ereg/ereg.c?r1=1.88&r2=1.89&diff_format=u Index: php-src/ext/ereg/ereg.c diff -u php-src/ext/ereg/ereg.c:1.88 php-src/ext/ereg/ereg.c:1.89 --- php-src/ext/ereg/ereg.c:1.88 Sat Jul 14 08:38:20 2007 +++ php-src/ext/ereg/ereg.c Sun Jul 15 19:50:06 2007 @@ -17,23 +17,101 @@ | Jaakko Hyvätti <[EMAIL PROTECTED]> | +----------------------------------------------------------------------+ */ -/* $Id: ereg.c,v 1.88 2007/07/14 08:38:20 tony2001 Exp $ */ +/* $Id: ereg.c,v 1.89 2007/07/15 19:50:06 jani Exp $ */ #include <stdio.h> #include <ctype.h> #include "php.h" -#include "php_string.h" -#include "reg.h" +#include "ext/standard/php_string.h" +#include "php_ereg.h" #include "ext/standard/info.h" -ZEND_DECLARE_MODULE_GLOBALS(reg) +/* {{{ arginfo */ +static +ZEND_BEGIN_ARG_INFO_EX(arginfo_ereg, 0, 0, 2) + ZEND_ARG_INFO(0, pattern) + ZEND_ARG_INFO(0, string) + ZEND_ARG_INFO(1, registers) /* ARRAY_INFO(1, registers, 1) */ +ZEND_END_ARG_INFO() + +static +ZEND_BEGIN_ARG_INFO_EX(arginfo_eregi, 0, 0, 2) + ZEND_ARG_INFO(0, pattern) + ZEND_ARG_INFO(0, string) + ZEND_ARG_INFO(1, registers) /* ARRAY_INFO(1, registers, 1) */ +ZEND_END_ARG_INFO() + +static +ZEND_BEGIN_ARG_INFO(arginfo_ereg_replace, 0) + ZEND_ARG_INFO(0, pattern) + ZEND_ARG_INFO(0, replacement) + ZEND_ARG_INFO(0, string) +ZEND_END_ARG_INFO() + +static +ZEND_BEGIN_ARG_INFO(arginfo_eregi_replace, 0) + ZEND_ARG_INFO(0, pattern) + ZEND_ARG_INFO(0, replacement) + ZEND_ARG_INFO(0, string) +ZEND_END_ARG_INFO() + +static +ZEND_BEGIN_ARG_INFO_EX(arginfo_split, 0, 0, 2) + ZEND_ARG_INFO(0, pattern) + ZEND_ARG_INFO(0, string) + ZEND_ARG_INFO(0, limit) +ZEND_END_ARG_INFO() + +static +ZEND_BEGIN_ARG_INFO_EX(arginfo_spliti, 0, 0, 2) + ZEND_ARG_INFO(0, pattern) + ZEND_ARG_INFO(0, string) + ZEND_ARG_INFO(0, limit) +ZEND_END_ARG_INFO() + +static +ZEND_BEGIN_ARG_INFO(arginfo_sql_regcase, 0) + ZEND_ARG_INFO(0, string) +ZEND_END_ARG_INFO() +/* }}} */ + +/* {{{ Function table */ +zend_function_entry ereg_functions[] = { + PHP_FE(ereg, arginfo_ereg) + PHP_FE(ereg_replace, arginfo_ereg_replace) + PHP_FE(eregi, arginfo_eregi) + PHP_FE(eregi_replace, arginfo_eregi_replace) + PHP_FE(split, arginfo_split) + PHP_FE(spliti, arginfo_spliti) + PHP_FE(sql_regcase, arginfo_sql_regcase) + {NULL, NULL, NULL} +}; +/* }}} */ +/* {{{ reg_cache */ typedef struct { regex_t preg; int cflags; } reg_cache; - static int reg_magic = 0; +/* }}} */ + +ZEND_DECLARE_MODULE_GLOBALS(ereg) + +/* {{{ Module entry */ +zend_module_entry ereg_module_entry = { + STANDARD_MODULE_HEADER, + "ereg", + ereg_functions, + PHP_MINIT(ereg), + PHP_MSHUTDOWN(ereg), + NULL, + NULL, + PHP_MINFO(ereg), + NO_VERSION_YET, + STANDARD_MODULE_PROPERTIES +}; +/* }}} */ /* {{{ _php_regcomp */ @@ -44,7 +122,7 @@ reg_cache *rc = NULL; TSRMLS_FETCH(); - if(zend_hash_find(®(ht_rc), (char *) pattern, patlen+1, (void **) &rc) == SUCCESS + if(zend_hash_find(&EREG(ht_rc), (char *) pattern, patlen+1, (void **) &rc) == SUCCESS && rc->cflags == cflags) { #ifdef HAVE_REGEX_T_RE_MAGIC /* @@ -52,7 +130,7 @@ * is, we flush it and compile the pattern from scratch. */ if (rc->preg.re_magic != reg_magic) { - zend_hash_clean(®(ht_rc)); + zend_hash_clean(&EREG(ht_rc)); } else { memcpy(preg, &rc->preg, sizeof(*preg)); return r; @@ -71,7 +149,7 @@ * it's good. */ if (!reg_magic) reg_magic = preg->re_magic; - zend_hash_update(®(ht_rc), (char *) pattern, patlen+1, + zend_hash_update(&EREG(ht_rc), (char *) pattern, patlen+1, (void *) &rcp, sizeof(rcp), NULL); } #else @@ -83,7 +161,7 @@ rcp.cflags = cflags; memcpy(&rcp.preg, preg, sizeof(*preg)); - zend_hash_update(®(ht_rc), (char *) pattern, patlen+1, + zend_hash_update(&EREG(ht_rc), (char *) pattern, patlen+1, (void *) &rcp, sizeof(rcp), NULL); } } @@ -92,60 +170,57 @@ } /* }}} */ -static void _free_reg_cache(reg_cache *rc) /* {{{ */ +static void _free_ereg_cache(reg_cache *rc) { regfree(&rc->preg); } -/* }}} */ #undef regfree #define regfree(a); #undef regcomp #define regcomp(a, b, c) _php_regcomp(a, b, c) -static void php_reg_init_globals(zend_reg_globals *reg_globals TSRMLS_DC) /* {{{ */ +static void php_ereg_init_globals(zend_ereg_globals *ereg_globals TSRMLS_DC) { - zend_hash_init(®_globals->ht_rc, 0, NULL, (void (*)(void *)) _free_reg_cache, 1); + zend_hash_init(&ereg_globals->ht_rc, 0, NULL, (void (*)(void *)) _free_ereg_cache, 1); } -/* }}} */ -static void php_reg_destroy_globals(zend_reg_globals *reg_globals TSRMLS_DC) /* {{{ */ +static void php_ereg_destroy_globals(zend_ereg_globals *ereg_globals TSRMLS_DC) { - zend_hash_destroy(®_globals->ht_rc); + zend_hash_destroy(&ereg_globals->ht_rc); } -/* }}} */ -PHP_MINIT_FUNCTION(regex) /* {{{ */ +PHP_MINIT_FUNCTION(ereg) { - ZEND_INIT_MODULE_GLOBALS(reg, php_reg_init_globals, php_reg_destroy_globals); + ZEND_INIT_MODULE_GLOBALS(ereg, php_ereg_init_globals, php_ereg_destroy_globals); return SUCCESS; } -/* }}} */ -PHP_MSHUTDOWN_FUNCTION(regex) /* {{{ */ +PHP_MSHUTDOWN_FUNCTION(ereg) { #ifndef ZTS - php_reg_destroy_globals(®_globals TSRMLS_CC); + php_ereg_destroy_globals(&ereg_globals TSRMLS_CC); #endif return SUCCESS; } -/* }}} */ -PHP_MINFO_FUNCTION(regex) /* {{{ */ +PHP_MINFO_FUNCTION(ereg) { + php_info_print_table_start(); #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 + php_info_print_table_end(); } -/* }}} */ -/* {{{ php_reg_eprint - * php_reg_eprint - convert error number to name + +/* {{{ php_ereg_eprint + * php_ereg_eprint - convert error number to name */ -static void php_reg_eprint(int err, regex_t *re) { +static void php_ereg_eprint(int err, regex_t *re) { char *buf = NULL, *message = NULL; size_t len; size_t buf_len; @@ -203,7 +278,7 @@ int argc = ZEND_NUM_ARGS(); if (argc < 2 || argc > 3 || - zend_get_parameters_ex(argc, ®ex, &findin, &array) == FAILURE) { + zend_get_parameters_ex(argc, ®ex, &findin, &array) == FAILURE) { WRONG_PARAM_COUNT; } @@ -226,7 +301,7 @@ } if (err) { - php_reg_eprint(err, &re); + php_ereg_eprint(err, &re); RETURN_FALSE; } @@ -240,7 +315,7 @@ /* actually execute the regular expression */ err = regexec(&re, string, re.re_nsub+1, subs, 0); if (err && err != REG_NOMATCH) { - php_reg_eprint(err, &re); + php_ereg_eprint(err, &re); regfree(&re); efree(subs); RETURN_FALSE; @@ -297,15 +372,15 @@ } /* }}} */ -/* {{{ php_reg_replace +/* {{{ php_ereg_replace * this is the meat and potatoes of regex replacement! */ -PHPAPI char *php_reg_replace(const char *pattern, const char *replace, const char *string, int icase, int extended) +PHPAPI char *php_ereg_replace(const char *pattern, const char *replace, const char *string, int icase, int extended) { regex_t re; regmatch_t *subs; char *buf, /* buf is where we build the replaced string */ - *nbuf, /* nbuf is used when we grow the buffer */ + *nbuf, /* nbuf is used when we grow the buffer */ *walkbuf; /* used to walk buf when replacing backrefs */ const char *walk; /* used to walk replacement string for backrefs */ int buf_len; @@ -323,7 +398,7 @@ err = regcomp(&re, pattern, copts); if (err) { - php_reg_eprint(err, &re); + php_ereg_eprint(err, &re); return ((char *) -1); } @@ -342,7 +417,7 @@ err = regexec(&re, &string[pos], re.re_nsub+1, subs, (pos ? REG_NOTBOL : 0)); if (err && err != REG_NOMATCH) { - php_reg_eprint(err, &re); + php_ereg_eprint(err, &re); efree(subs); efree(buf); regfree(&re); @@ -363,7 +438,7 @@ if ('\\' == *walk && isdigit((unsigned char)walk[1]) && ((unsigned char)walk[1]) - '0' <= (int)re.re_nsub) { if (subs[walk[1] - '0'].rm_so > -1 && subs[walk[1] - '0'].rm_eo > -1) { new_l += subs[walk[1] - '0'].rm_eo - subs[walk[1] - '0'].rm_so; - } + } walk += 2; } else { new_l++; @@ -443,9 +518,9 @@ } /* }}} */ -/* {{{ php_ereg_replace +/* {{{ php_do_ereg_replace */ -static void php_ereg_replace(INTERNAL_FUNCTION_PARAMETERS, int icase) +static void php_do_ereg_replace(INTERNAL_FUNCTION_PARAMETERS, int icase) { zval **arg_pattern, **arg_replace, @@ -456,7 +531,7 @@ char *ret; if (ZEND_NUM_ARGS() != 3 || - zend_get_parameters_ex(3, &arg_pattern, &arg_replace, &arg_string) == FAILURE) { + zend_get_parameters_ex(3, &arg_pattern, &arg_replace, &arg_string) == FAILURE) { WRONG_PARAM_COUNT; } @@ -491,7 +566,7 @@ string = STR_EMPTY_ALLOC(); /* do the actual work */ - ret = php_reg_replace(pattern, replace, string, icase, 1); + ret = php_ereg_replace(pattern, replace, string, icase, 1); if (ret == (char *) -1) { RETVAL_FALSE; } else { @@ -509,7 +584,7 @@ Replace regular expression */ PHP_FUNCTION(ereg_replace) { - php_ereg_replace(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); + php_do_ereg_replace(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); } /* }}} */ @@ -517,7 +592,7 @@ Case insensitive replace regular expression */ PHP_FUNCTION(eregi_replace) { - php_ereg_replace(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); + php_do_ereg_replace(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); } /* }}} */ @@ -533,27 +608,27 @@ int argc = ZEND_NUM_ARGS(); if (argc < 2 || argc > 3 || - zend_get_parameters_ex(argc, &spliton, &str, &arg_count) == FAILURE) { + zend_get_parameters_ex(argc, &spliton, &str, &arg_count) == FAILURE) { WRONG_PARAM_COUNT; } - + if (argc > 2) { convert_to_long_ex(arg_count); count = Z_LVAL_PP(arg_count); } - + if (icase) copts = REG_ICASE; - - convert_to_string_ex(spliton); - convert_to_string_ex(str); + + convert_to_string_ex(spliton); + convert_to_string_ex(str); strp = Z_STRVAL_PP(str); endp = strp + Z_STRLEN_PP(str); err = regcomp(&re, Z_STRVAL_PP(spliton), REG_EXTENDED | copts); if (err) { - php_reg_eprint(err, &re); + php_ereg_eprint(err, &re); RETURN_FALSE; } @@ -595,7 +670,7 @@ /* see if we encountered an error */ if (err && err != REG_NOMATCH) { - php_reg_eprint(err, &re); + php_ereg_eprint(err, &re); regfree(&re); zend_hash_destroy(Z_ARRVAL_P(return_value)); efree(Z_ARRVAL_P(return_value)); http://cvs.php.net/viewvc.cgi/php-src/ext/ereg/php_ereg.h?r1=1.23&r2=1.24&diff_format=u Index: php-src/ext/ereg/php_ereg.h diff -u php-src/ext/ereg/php_ereg.h:1.23 php-src/ext/ereg/php_ereg.h:1.24 --- php-src/ext/ereg/php_ereg.h:1.23 Mon Jan 1 09:29:32 2007 +++ php-src/ext/ereg/php_ereg.h Sun Jul 15 19:50:06 2007 @@ -17,12 +17,17 @@ */ -/* $Id: php_ereg.h,v 1.23 2007/01/01 09:29:32 sebastian Exp $ */ +/* $Id: php_ereg.h,v 1.24 2007/07/15 19:50:06 jani Exp $ */ -#ifndef REG_H -#define REG_H +#ifndef EREG_H +#define EREG_H -PHPAPI char *php_reg_replace(const char *pattern, const char *replace, const char *string, int icase, int extended); +#include "php_regex.h" + +extern zend_module_entry ereg_module_entry; +#define phpext_ereg_ptr &ereg_module_entry + +PHPAPI char *php_ereg_replace(const char *pattern, const char *replace, const char *string, int icase, int extended); PHP_FUNCTION(ereg); PHP_FUNCTION(eregi); @@ -32,19 +37,19 @@ PHP_FUNCTION(spliti); PHPAPI PHP_FUNCTION(sql_regcase); -ZEND_BEGIN_MODULE_GLOBALS(reg) +ZEND_BEGIN_MODULE_GLOBALS(ereg) HashTable ht_rc; -ZEND_END_MODULE_GLOBALS(reg) - -PHP_MINIT_FUNCTION(regex); -PHP_MSHUTDOWN_FUNCTION(regex); -PHP_MINFO_FUNCTION(regex); +ZEND_END_MODULE_GLOBALS(ereg) +/* Module functions */ +PHP_MINIT_FUNCTION(ereg); +PHP_MSHUTDOWN_FUNCTION(ereg); +PHP_MINFO_FUNCTION(ereg); #ifdef ZTS -#define REG(v) TSRMG(reg_globals_id, zend_reg_globals *, v) +#define EREG(v) TSRMG(ereg_globals_id, zend_ereg_globals *, v) #else -#define REG(v) (reg_globals.v) +#define EREG(v) (ereg_globals.v) #endif #endif /* REG_H */ http://cvs.php.net/viewvc.cgi/php-src/ext/ereg/php_regex.h?r1=1.18&r2=1.19&diff_format=u Index: php-src/ext/ereg/php_regex.h diff -u php-src/ext/ereg/php_regex.h:1.18 php-src/ext/ereg/php_regex.h:1.19 --- php-src/ext/ereg/php_regex.h:1.18 Mon Jan 1 09:29:35 2007 +++ php-src/ext/ereg/php_regex.h Sun Jul 15 19:50:06 2007 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_regex.h,v 1.18 2007/01/01 09:29:35 sebastian Exp $ */ +/* $Id: php_regex.h,v 1.19 2007/07/15 19:50:06 jani Exp $ */ #ifndef PHP_REGEX_H #define PHP_REGEX_H @@ -29,12 +29,12 @@ #if REGEX /* get aliases */ -#include "regex/regex_extra.h" -#include "regex/regex.h" +#include "ext/ereg/regex/regex_extra.h" +#include "ext/ereg/regex/regex.h" /* get rid of aliases */ #define PHP_NO_ALIASES -#include "regex/regex_extra.h" +#include "ext/ereg/regex/regex_extra.h" #undef PHP_NO_ALIASES #undef _PCREPOSIX_H @@ -63,3 +63,8 @@ #endif #endif /* PHP_REGEX_H */ + +/* No frame, regex_extra.h must be included always */ +#if (REGEX == 1 || REGEX == 0) && !defined(NO_REGEX_EXTRA_H) +#include "ext/ereg/regex/regex_extra.h" +#endif http://cvs.php.net/viewvc.cgi/php-src/ext/pgsql/pgsql.c?r1=1.367&r2=1.368&diff_format=u Index: php-src/ext/pgsql/pgsql.c diff -u php-src/ext/pgsql/pgsql.c:1.367 php-src/ext/pgsql/pgsql.c:1.368 --- php-src/ext/pgsql/pgsql.c:1.367 Tue May 29 21:06:04 2007 +++ php-src/ext/pgsql/pgsql.c Sun Jul 15 19:50:06 2007 @@ -20,7 +20,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: pgsql.c,v 1.367 2007/05/29 21:06:04 iliaa Exp $ */ +/* $Id: pgsql.c,v 1.368 2007/07/15 19:50:06 jani Exp $ */ #include <stdlib.h> @@ -36,6 +36,7 @@ #include "php_ini.h" #include "ext/standard/php_standard.h" #include "ext/standard/php_smart_str.h" +#include "ext/ereg/php_regex.h" #undef PACKAGE_BUGREPORT #undef PACKAGE_NAME http://cvs.php.net/viewvc.cgi/php-src/ext/standard/basic_functions.c?r1=1.866&r2=1.867&diff_format=u Index: php-src/ext/standard/basic_functions.c diff -u php-src/ext/standard/basic_functions.c:1.866 php-src/ext/standard/basic_functions.c:1.867 --- php-src/ext/standard/basic_functions.c:1.866 Fri Jul 13 08:50:53 2007 +++ php-src/ext/standard/basic_functions.c Sun Jul 15 19:50:06 2007 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: basic_functions.c,v 1.866 2007/07/13 08:50:53 tony2001 Exp $ */ +/* $Id: basic_functions.c,v 1.867 2007/07/15 19:50:06 jani Exp $ */ #include "php.h" #include "php_streams.h" @@ -2192,54 +2192,6 @@ ZEND_BEGIN_ARG_INFO(arginfo_mt_getrandmax, 0) ZEND_END_ARG_INFO() /* }}} */ -/* {{{ reg.c */ -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_ereg, 0, 0, 2) - ZEND_ARG_INFO(0, pattern) - ZEND_ARG_INFO(0, string) - ZEND_ARG_INFO(1, registers) /* ARRAY_INFO(1, registers, 1) */ -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_eregi, 0, 0, 2) - ZEND_ARG_INFO(0, pattern) - ZEND_ARG_INFO(0, string) - ZEND_ARG_INFO(1, registers) /* ARRAY_INFO(1, registers, 1) */ -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_ereg_replace, 0) - ZEND_ARG_INFO(0, pattern) - ZEND_ARG_INFO(0, replacement) - ZEND_ARG_INFO(0, string) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_eregi_replace, 0) - ZEND_ARG_INFO(0, pattern) - ZEND_ARG_INFO(0, replacement) - ZEND_ARG_INFO(0, string) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_split, 0, 0, 2) - ZEND_ARG_INFO(0, pattern) - ZEND_ARG_INFO(0, string) - ZEND_ARG_INFO(0, limit) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_spliti, 0, 0, 2) - ZEND_ARG_INFO(0, pattern) - ZEND_ARG_INFO(0, string) - ZEND_ARG_INFO(0, limit) -ZEND_END_ARG_INFO() - -static -ZEND_BEGIN_ARG_INFO(arginfo_sql_regcase, 0) - ZEND_ARG_INFO(0, string) -ZEND_END_ARG_INFO() -/* }}} */ /* {{{ sha1.c */ static ZEND_BEGIN_ARG_INFO_EX(arginfo_sha1, 0, 0, 1) @@ -3241,6 +3193,7 @@ PHP_FE(similar_text, arginfo_similar_text) PHP_FE(explode, arginfo_explode) PHP_FE(implode, arginfo_implode) + PHP_FALIAS(join, implode, arginfo_implode) PHP_FE(setlocale, arginfo_setlocale) PHP_FE(localeconv, arginfo_localeconv) @@ -3515,16 +3468,6 @@ PHP_FE(is_scalar, arginfo_is_scalar) PHP_FE(is_callable, arginfo_is_callable) - /* functions from reg.c */ - PHP_FE(ereg, arginfo_ereg) - PHP_FE(ereg_replace, arginfo_ereg_replace) - PHP_FE(eregi, arginfo_eregi) - PHP_FE(eregi_replace, arginfo_eregi_replace) - PHP_FE(split, arginfo_split) - PHP_FE(spliti, arginfo_spliti) - PHP_FALIAS(join, implode, arginfo_implode) - PHP_FE(sql_regcase, arginfo_sql_regcase) - /* functions from file.c */ PHP_FE(pclose, arginfo_pclose) PHP_FE(popen, arginfo_popen) @@ -4035,7 +3978,6 @@ register_html_constants(INIT_FUNC_ARGS_PASSTHRU); register_string_constants(INIT_FUNC_ARGS_PASSTHRU); - PHP_MINIT(regex)(INIT_FUNC_ARGS_PASSTHRU); PHP_MINIT(file)(INIT_FUNC_ARGS_PASSTHRU); PHP_MINIT(pack)(INIT_FUNC_ARGS_PASSTHRU); PHP_MINIT(browscap)(INIT_FUNC_ARGS_PASSTHRU); @@ -4114,7 +4056,6 @@ UNREGISTER_INI_ENTRIES(); - PHP_MSHUTDOWN(regex)(SHUTDOWN_FUNC_ARGS_PASSTHRU); PHP_MSHUTDOWN(browscap)(SHUTDOWN_FUNC_ARGS_PASSTHRU); PHP_MSHUTDOWN(array)(SHUTDOWN_FUNC_ARGS_PASSTHRU); PHP_MSHUTDOWN(assert)(SHUTDOWN_FUNC_ARGS_PASSTHRU); @@ -4228,7 +4169,6 @@ PHP_MINFO_FUNCTION(basic) /* {{{ */ { php_info_print_table_start(); - PHP_MINFO(regex)(ZEND_MODULE_INFO_FUNC_ARGS_PASSTHRU); PHP_MINFO(dl)(ZEND_MODULE_INFO_FUNC_ARGS_PASSTHRU); PHP_MINFO(mail)(ZEND_MODULE_INFO_FUNC_ARGS_PASSTHRU); php_info_print_table_end(); http://cvs.php.net/viewvc.cgi/php-src/ext/standard/browscap.c?r1=1.93&r2=1.94&diff_format=u Index: php-src/ext/standard/browscap.c diff -u php-src/ext/standard/browscap.c:1.93 php-src/ext/standard/browscap.c:1.94 --- php-src/ext/standard/browscap.c:1.93 Tue Jun 26 21:37:14 2007 +++ php-src/ext/standard/browscap.c Sun Jul 15 19:50:06 2007 @@ -16,13 +16,13 @@ +----------------------------------------------------------------------+ */ -/* $Id: browscap.c,v 1.93 2007/06/26 21:37:14 tony2001 Exp $ */ +/* $Id: browscap.c,v 1.94 2007/07/15 19:50:06 jani Exp $ */ #include "php.h" -#include "php_regex.h" #include "php_browscap.h" #include "php_ini.h" #include "php_string.h" +#include "ext/ereg/php_regex.h" #include "zend_globals.h" http://cvs.php.net/viewvc.cgi/php-src/ext/standard/config.m4?r1=1.86&r2=1.87&diff_format=u Index: php-src/ext/standard/config.m4 diff -u php-src/ext/standard/config.m4:1.86 php-src/ext/standard/config.m4:1.87 --- php-src/ext/standard/config.m4:1.86 Wed Jul 11 11:55:46 2007 +++ php-src/ext/standard/config.m4 Sun Jul 15 19:50:06 2007 @@ -1,4 +1,4 @@ -dnl $Id: config.m4,v 1.86 2007/07/11 11:55:46 jani Exp $ -*- autoconf -*- +dnl $Id: config.m4,v 1.87 2007/07/15 19:50:06 jani Exp $ -*- autoconf -*- divert(3)dnl @@ -208,52 +208,6 @@ divert(5)dnl dnl -dnl Check for regex library type -dnl -PHP_ARG_WITH(regex,, -[ --with-regex=TYPE regex library type: system, apache, php. [TYPE=php] - WARNING: Do NOT use unless you know what you are doing!], php, no) - -case $PHP_REGEX in - system) - if test "$PHP_SAPI" = "apache" || test "$PHP_SAPI" = "apache2filter" || test "$PHP_SAPI" = "apache2handler"; 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 selected. Using default value: php) - ;; -esac - -if test "$REGEX_TYPE" = "php"; then - AC_DEFINE(HAVE_REGEX_T_RE_MAGIC, 1, [ ]) - 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,[ ]) - dnl Check if field re_magic exists in struct regex_t - AC_CACHE_CHECK([whether field re_magic exists in struct regex_t], ac_cv_regex_t_re_magic, [ - AC_TRY_COMPILE([#include <sys/types.h> -#include <regex.h>], [regex_t rt; rt.re_magic;], - [ac_cv_regex_t_re_magic=yes], [ac_cv_regex_t_re_magic=no])]) - if test "$ac_cv_regex_t_re_magic" = "yes"; then - AC_DEFINE([HAVE_REGEX_T_RE_MAGIC], [ ], 1) - fi -fi -AC_MSG_CHECKING([which regex library to use]) -AC_MSG_RESULT([$REGEX_TYPE]) - -dnl dnl round fuzz dnl AC_MSG_CHECKING([whether rounding works as expected]) @@ -508,7 +462,7 @@ flock_compat.c formatted_print.c fsock.c head.c html.c image.c \ info.c iptc.c lcg.c link.c mail.c math.c md5.c metaphone.c \ microtime.c pack.c pageinfo.c quot_print.c rand.c \ - reg.c soundex.c string.c scanf.c syslog.c type.c uniqid.c url.c \ + soundex.c string.c scanf.c syslog.c type.c uniqid.c url.c \ url_scanner.c var.c versioning.c assert.c strnatcmp.c levenshtein.c \ incomplete_class.c url_scanner_ex.c ftp_fopen_wrapper.c \ http_fopen_wrapper.c php_fopen_wrapper.c credits.c css.c \ http://cvs.php.net/viewvc.cgi/php-src/ext/standard/config.w32?r1=1.7&r2=1.8&diff_format=u Index: php-src/ext/standard/config.w32 diff -u php-src/ext/standard/config.w32:1.7 php-src/ext/standard/config.w32:1.8 --- php-src/ext/standard/config.w32:1.7 Wed Apr 18 09:48:07 2007 +++ php-src/ext/standard/config.w32 Sun Jul 15 19:50:06 2007 @@ -1,5 +1,5 @@ // vim:ft=javascript -// $Id: config.w32,v 1.7 2007/04/18 09:48:07 rrichards Exp $ +// $Id: config.w32,v 1.8 2007/07/15 19:50:06 jani Exp $ ARG_WITH("config-file-scan-dir", "Dir to check for additional php ini files", ""); AC_DEFINE("PHP_CONFIG_FILE_SCAN_DIR", PHP_CONFIG_FILE_SCAN_DIR); @@ -10,7 +10,7 @@ crc32.c crypt.c cyr_convert.c datetime.c dir.c dl.c dns.c exec.c \ file.c filestat.c formatted_print.c fsock.c head.c html.c image.c \ info.c iptc.c lcg.c link.c mail.c math.c md5.c metaphone.c microtime.c \ - pack.c pageinfo.c quot_print.c rand.c reg.c soundex.c \ + pack.c pageinfo.c quot_print.c rand.c soundex.c \ string.c scanf.c syslog.c type.c uniqid.c url.c url_scanner.c var.c \ versioning.c assert.c strnatcmp.c levenshtein.c incomplete_class.c \ url_scanner_ex.c ftp_fopen_wrapper.c http_fopen_wrapper.c \ http://cvs.php.net/viewvc.cgi/php-src/ext/standard/html.c?r1=1.124&r2=1.125&diff_format=u Index: php-src/ext/standard/html.c diff -u php-src/ext/standard/html.c:1.124 php-src/ext/standard/html.c:1.125 --- php-src/ext/standard/html.c:1.124 Sat Jul 14 08:38:19 2007 +++ php-src/ext/standard/html.c Sun Jul 15 19:50:06 2007 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: html.c,v 1.124 2007/07/14 08:38:19 tony2001 Exp $ */ +/* $Id: html.c,v 1.125 2007/07/15 19:50:06 jani Exp $ */ /* * HTML entity resources: @@ -43,7 +43,6 @@ #else #include <php_config.h> #endif -#include "reg.h" #include "html.h" #include "php_string.h" #include "SAPI.h" http://cvs.php.net/viewvc.cgi/php-src/ext/standard/php_standard.h?r1=1.27&r2=1.28&diff_format=u Index: php-src/ext/standard/php_standard.h diff -u php-src/ext/standard/php_standard.h:1.27 php-src/ext/standard/php_standard.h:1.28 --- php-src/ext/standard/php_standard.h:1.27 Mon Jan 1 09:29:32 2007 +++ php-src/ext/standard/php_standard.h Sun Jul 15 19:50:06 2007 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_standard.h,v 1.27 2007/01/01 09:29:32 sebastian Exp $ */ +/* $Id: php_standard.h,v 1.28 2007/07/15 19:50:06 jani Exp $ */ #include "basic_functions.h" #include "php_math.h" @@ -24,7 +24,6 @@ #include "base64.h" #include "php_dir.h" #include "dns.h" -#include "reg.h" #include "php_mail.h" #include "md5.h" #include "sha1.h" http://cvs.php.net/viewvc.cgi/php-src/ext/standard/string.c?r1=1.647&r2=1.648&diff_format=u Index: php-src/ext/standard/string.c diff -u php-src/ext/standard/string.c:1.647 php-src/ext/standard/string.c:1.648 --- php-src/ext/standard/string.c:1.647 Tue Jul 10 14:16:40 2007 +++ php-src/ext/standard/string.c Sun Jul 15 19:50:06 2007 @@ -18,13 +18,12 @@ +----------------------------------------------------------------------+ */ -/* $Id: string.c,v 1.647 2007/07/10 14:16:40 dmitry Exp $ */ +/* $Id: string.c,v 1.648 2007/07/15 19:50:06 jani Exp $ */ /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */ #include <stdio.h> #include "php.h" -#include "reg.h" #include "php_rand.h" #include "php_string.h" #include "php_variables.h" http://cvs.php.net/viewvc.cgi/php-src/main/internal_functions_nw.c?r1=1.12&r2=1.13&diff_format=u Index: php-src/main/internal_functions_nw.c diff -u php-src/main/internal_functions_nw.c:1.12 php-src/main/internal_functions_nw.c:1.13 --- php-src/main/internal_functions_nw.c:1.12 Mon Jan 1 09:29:35 2007 +++ php-src/main/internal_functions_nw.c Sun Jul 15 19:50:06 2007 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: internal_functions_nw.c,v 1.12 2007/01/01 09:29:35 sebastian Exp $ */ +/* $Id: internal_functions_nw.c,v 1.13 2007/07/15 19:50:06 jani Exp $ */ /* {{{ includes */ @@ -51,7 +51,6 @@ /*#include "ext/com/php_COM.h" #include "ext/com/php_VARIANT.h"*/ #include "ext/ftp/php_ftp.h" -#include "ext/standard/reg.h" #include "ext/pcre/php_pcre.h" /*#include "ext/odbc/php_odbc.h"*/ /* Commented out for now */ #include "ext/session/php_session.h" http://cvs.php.net/viewvc.cgi/php-src/main/internal_functions_win32.c?r1=1.90&r2=1.91&diff_format=u Index: php-src/main/internal_functions_win32.c diff -u php-src/main/internal_functions_win32.c:1.90 php-src/main/internal_functions_win32.c:1.91 --- php-src/main/internal_functions_win32.c:1.90 Mon Jan 1 09:29:35 2007 +++ php-src/main/internal_functions_win32.c Sun Jul 15 19:50:06 2007 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: internal_functions_win32.c,v 1.90 2007/01/01 09:29:35 sebastian Exp $ */ +/* $Id: internal_functions_win32.c,v 1.91 2007/07/15 19:50:06 jani Exp $ */ /* {{{ includes */ @@ -60,7 +60,6 @@ #if HAVE_FTP #include "ext/ftp/php_ftp.h" #endif -#include "ext/standard/reg.h" #if HAVE_PCRE || HAVE_BUNDLED_PCRE #include "ext/pcre/php_pcre.h" #endif http://cvs.php.net/viewvc.cgi/php-src/main/php.h?r1=1.238&r2=1.239&diff_format=u Index: php-src/main/php.h diff -u php-src/main/php.h:1.238 php-src/main/php.h:1.239 --- php-src/main/php.h:1.238 Tue Jan 16 22:18:39 2007 +++ php-src/main/php.h Sun Jul 15 19:50:06 2007 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php.h,v 1.238 2007/01/16 22:18:39 andrei Exp $ */ +/* $Id: php.h,v 1.239 2007/07/15 19:50:06 jani Exp $ */ #ifndef PHP_H #define PHP_H @@ -71,8 +71,6 @@ #define PHP_OS PHP_UNAME #endif -#include "php_regex.h" - #if HAVE_ASSERT_H #if PHP_DEBUG #undef NDEBUG @@ -193,10 +191,6 @@ char *strerror(int); #endif -#if (REGEX == 1 || REGEX == 0) && !defined(NO_REGEX_EXTRA_H) -#include "regex/regex_extra.h" -#endif - #if HAVE_PWD_H # ifdef PHP_WIN32 #include "win32/param.h" http://cvs.php.net/viewvc.cgi/php-src/sapi/apache/php_apache_http.h?r1=1.16&r2=1.17&diff_format=u Index: php-src/sapi/apache/php_apache_http.h diff -u php-src/sapi/apache/php_apache_http.h:1.16 php-src/sapi/apache/php_apache_http.h:1.17 --- php-src/sapi/apache/php_apache_http.h:1.16 Wed Jan 10 23:46:09 2007 +++ php-src/sapi/apache/php_apache_http.h Sun Jul 15 19:50:07 2007 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_apache_http.h,v 1.16 2007/01/10 23:46:09 andrei Exp $ */ +/* $Id: php_apache_http.h,v 1.17 2007/07/15 19:50:07 jani Exp $ */ #define NO_REGEX_EXTRA_H @@ -31,7 +31,7 @@ #endif #include "zend.h" -#include "php_regex.h" +#include "ext/ereg/php_regex.h" #include "php_compat.h" #ifdef HAVE_OPENSSL_EXT http://cvs.php.net/viewvc.cgi/php-src/sapi/apache_hooks/php_apache_http.h?r1=1.3&r2=1.4&diff_format=u Index: php-src/sapi/apache_hooks/php_apache_http.h diff -u php-src/sapi/apache_hooks/php_apache_http.h:1.3 php-src/sapi/apache_hooks/php_apache_http.h:1.4 --- php-src/sapi/apache_hooks/php_apache_http.h:1.3 Sat Jan 17 13:00:09 2004 +++ php-src/sapi/apache_hooks/php_apache_http.h Sun Jul 15 19:50:07 2007 @@ -11,7 +11,7 @@ #include "zend.h" #include "zend_stack.h" -#include "php_regex.h" +#include "ext/ereg/php_regex.h" #include "httpd.h" #include "http_config.h" http://cvs.php.net/viewvc.cgi/php-src/win32/build/config.w32?r1=1.67&r2=1.68&diff_format=u Index: php-src/win32/build/config.w32 diff -u php-src/win32/build/config.w32:1.67 php-src/win32/build/config.w32:1.68 --- php-src/win32/build/config.w32:1.67 Tue May 29 19:44:24 2007 +++ php-src/win32/build/config.w32 Sun Jul 15 19:50:07 2007 @@ -1,5 +1,5 @@ // vim:ft=javascript -// $Id: config.w32,v 1.67 2007/05/29 19:44:24 stas Exp $ +// $Id: config.w32,v 1.68 2007/07/15 19:50:07 jani Exp $ // "Master" config file; think of it as a configure.in // equivalent. @@ -98,7 +98,7 @@ } DEFINE('PHP_PREFIX', PHP_PREFIX); -DEFINE("BASE_INCLUDES", "/I . /I main /I regex /I Zend /I TSRM /I ext "); +DEFINE("BASE_INCLUDES", "/I . /I main /I Zend /I TSRM /I ext "); // CFLAGS for building the PHP dll DEFINE("CFLAGS_PHP", "/D _USRDLL /D PHP5DLLTS_EXPORTS /D PHP_EXPORTS \ @@ -332,8 +332,6 @@ ADD_SOURCES("win32", "crypt_win32.c glob.c md5crypt.c readdir.c \ registry.c select.c sendmail.c time.c wfile.c winutil.c wsyslog.c globals.c"); -ADD_SOURCES("regex", "regcomp.c regerror.c regexec.c regfree.c"); - STDOUT.WriteBlankLines(1); /* Can we build with IPv6 support? */ http://cvs.php.net/viewvc.cgi/php-src/ext/ereg/config.w32?view=markup&rev=1.1 Index: php-src/ext/ereg/config.w32 +++ php-src/ext/ereg/config.w32 // $Id: config.w32,v 1.1 2007/07/15 19:50:06 jani Exp $ // vim:ft=javascript EXTENSION("ereg", "ereg.c", false /* never shared */, "-Iext/ereg/regex"); ADD_SOURCES("ext/ereg/regex", "regcomp.c regexec.c regerror.c regfree.c", "ereg"); AC_DEFINE('REGEX', 1, 'Bundled regex'); AC_DEFINE('HSREGEX', 1, 'Bundled regex'); http://cvs.php.net/viewvc.cgi/php-src/ext/ereg/config0.m4?view=markup&rev=1.1 Index: php-src/ext/ereg/config0.m4 +++ php-src/ext/ereg/config0.m4 dnl $Id: config0.m4,v 1.1 2007/07/15 19:50:06 jani Exp $ dnl config.m4 for extension ereg dnl dnl Check for regex library type dnl PHP_ARG_WITH(regex,, [ --with-regex=TYPE regex library type: system, apache, php. [TYPE=php] WARNING: Do NOT use unless you know what you are doing!], php, no) case $PHP_REGEX in system) if test "$PHP_SAPI" = "apache" || test "$PHP_SAPI" = "apache2filter" || test "$PHP_SAPI" = "apache2handler"; then REGEX_TYPE=php else REGEX_TYPE=system fi ;; apache) REGEX_TYPE=apache ;; yes | php) REGEX_TYPE=php ;; *) REGEX_TYPE=php AC_MSG_WARN([Invalid regex library type selected. Using default value: php]) ;; esac AC_MSG_CHECKING([which regex library to use]) AC_MSG_RESULT([$REGEX_TYPE]) if test "$REGEX_TYPE" = "php"; then ereg_regex_sources="regex/regcomp.c regex/regexec.c regex/regerror.c regex/regfree.c" ereg_regex_headers="regex/" fi PHP_NEW_EXTENSION(ereg, ereg.c $ereg_regex_sources, no) PHP_INSTALL_HEADERS([ext/ereg], [php_ereg.h php_regex.h $ereg_regex_headers]) if test "$REGEX_TYPE" = "php"; then AC_DEFINE(HAVE_REGEX_T_RE_MAGIC, 1, [ ]) AC_DEFINE(HSREGEX,1,[ ]) AC_DEFINE(REGEX,1,[ ]) PHP_ADD_BUILD_DIR([$ext_builddir/regex], 1) PHP_ADD_INCLUDE([$ext_srcdir/regex]) elif test "$REGEX_TYPE" = "system"; then AC_DEFINE(REGEX,0,[ ]) dnl Check if field re_magic exists in struct regex_t AC_CACHE_CHECK([whether field re_magic exists in struct regex_t], ac_cv_regex_t_re_magic, [ AC_TRY_COMPILE([#include <sys/types.h> #include <regex.h>], [regex_t rt; rt.re_magic;], [ac_cv_regex_t_re_magic=yes], [ac_cv_regex_t_re_magic=no])]) if test "$ac_cv_regex_t_re_magic" = "yes"; then AC_DEFINE([HAVE_REGEX_T_RE_MAGIC], [ ], 1) fi fi
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php