From: Derick Rethans Date: Fri, 21 Jan 2005 10:34:46 +0000 (+0000) Subject: - MFH: php_error_docref() adoption. X-Git-Tag: php-4.3.11RC1~118 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3d37f4d2cd5c0bdf25006cc2a91899b17c69b1ed;p=php - MFH: php_error_docref() adoption. --- diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c index d907811908..7eba5a639d 100644 --- a/ext/pcre/php_pcre.c +++ b/ext/pcre/php_pcre.c @@ -169,7 +169,7 @@ PHPAPI pcre* pcre_get_compiled_regex(char *regex, pcre_extra **extra, int *preg_ get to the end without encountering a delimiter. */ while (isspace((int)*(unsigned char *)p)) p++; if (*p == 0) { - zend_error(E_WARNING, "Empty regular expression"); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty regular expression"); return NULL; } @@ -177,7 +177,7 @@ PHPAPI pcre* pcre_get_compiled_regex(char *regex, pcre_extra **extra, int *preg_ or a backslash. */ delimiter = *p++; if (isalnum((int)*(unsigned char *)&delimiter) || delimiter == '\\') { - zend_error(E_WARNING, "Delimiter must not be alphanumeric or backslash"); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Delimiter must not be alphanumeric or backslash"); return NULL; } @@ -198,7 +198,7 @@ PHPAPI pcre* pcre_get_compiled_regex(char *regex, pcre_extra **extra, int *preg_ pp++; } if (*pp == 0) { - zend_error(E_WARNING, "No ending delimiter '%c' found", delimiter); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "No ending delimiter '%c' found", delimiter); return NULL; } } else { @@ -218,7 +218,7 @@ PHPAPI pcre* pcre_get_compiled_regex(char *regex, pcre_extra **extra, int *preg_ pp++; } if (*pp == 0) { - zend_error(E_WARNING, "No ending matching delimiter '%c' found", end_delimiter); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "No ending matching delimiter '%c' found", end_delimiter); return NULL; } } @@ -258,7 +258,7 @@ PHPAPI pcre* pcre_get_compiled_regex(char *regex, pcre_extra **extra, int *preg_ break; default: - zend_error(E_WARNING, "Unknown modifier '%c'", pp[-1]); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown modifier '%c'", pp[-1]); efree(pattern); return NULL; } @@ -277,7 +277,7 @@ PHPAPI pcre* pcre_get_compiled_regex(char *regex, pcre_extra **extra, int *preg_ tables); if (re == NULL) { - zend_error(E_WARNING, "Compilation failed: %s at offset %d", error, erroffset); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Compilation failed: %s at offset %d", error, erroffset); efree(pattern); return NULL; } @@ -287,7 +287,7 @@ PHPAPI pcre* pcre_get_compiled_regex(char *regex, pcre_extra **extra, int *preg_ if (do_study) { *extra = pcre_study(re, soptions, &error); if (error != NULL) { - zend_error(E_WARNING, "Error while studying pattern"); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error while studying pattern"); } } @@ -394,7 +394,7 @@ static void php_pcre_match(INTERNAL_FUNCTION_PARAMETERS, int global) } if ((global && (subpats_order < PREG_PATTERN_ORDER || subpats_order > PREG_SET_ORDER)) || (!global && subpats_order != 0)) { - zend_error(E_WARNING, "Wrong value for parameter 4 in call to %s()", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Wrong value for parameter 4 in call to %s()", get_active_function_name(TSRMLS_C)); return; } } @@ -486,7 +486,7 @@ static void php_pcre_match(INTERNAL_FUNCTION_PARAMETERS, int global) /* Check for too many substrings condition. */ if (count == 0) { - zend_error(E_NOTICE, "Matched, but too many substrings"); + php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Matched, but too many substrings"); count = size_offsets/3; } @@ -502,7 +502,7 @@ static void php_pcre_match(INTERNAL_FUNCTION_PARAMETERS, int global) efree(subpat_names); efree(offsets); efree(re); - zend_error(E_WARNING, "Get subpatterns list failed"); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Get subpatterns list failed"); return; } @@ -773,8 +773,8 @@ static int preg_do_eval(char *eval_str, int eval_str_len, char *subject, /* Run the code */ if (zend_eval_string(code.c, &retval, compiled_string_description TSRMLS_CC) == FAILURE) { efree(compiled_string_description); - zend_error(E_ERROR, "Failed evaluating code:\n%s", code.c); - /* zend_error() does not return in this case */ + php_error_docref(NULL TSRMLS_CC, E_ERROR, "Failed evaluating code:\n%s", code.c); + /* php_error_docref(NULL TSRMLS_CC, ) does not return in this case */ } efree(compiled_string_description); convert_to_string(&retval); @@ -869,7 +869,7 @@ PHPAPI char *php_pcre_replace(char *regex, int regex_len, /* Check for too many substrings condition. */ if (count == 0) { - zend_error(E_NOTICE, "Matched, but too many substrings"); + php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Matched, but too many substrings"); count = size_offsets/3; } @@ -1273,7 +1273,7 @@ PHP_FUNCTION(preg_split) /* Check for too many substrings condition. */ if (count == 0) { - zend_error(E_NOTICE, "Matched, but too many substrings"); + php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Matched, but too many substrings"); count = size_offsets/3; } @@ -1473,7 +1473,7 @@ PHP_FUNCTION(preg_grep) } if (Z_TYPE_PP(input) != IS_ARRAY) { - zend_error(E_WARNING, "Second argument to preg_grep() should be an array"); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Second argument to preg_grep() should be an array"); return; } @@ -1518,7 +1518,7 @@ PHP_FUNCTION(preg_grep) /* Check for too many substrings condition. */ if (count == 0) { - zend_error(E_NOTICE, "Matched, but too many substrings"); + php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Matched, but too many substrings"); count = size_offsets/3; }