diff options
Diffstat (limited to 'ext')
-rw-r--r-- | ext/standard/aggregation.c | 4 | ||||
-rw-r--r-- | ext/standard/array.c | 138 | ||||
-rw-r--r-- | ext/standard/assert.c | 6 | ||||
-rw-r--r-- | ext/standard/basic_functions.c | 56 | ||||
-rw-r--r-- | ext/standard/browscap.c | 2 | ||||
-rw-r--r-- | ext/standard/cyr_convert.c | 4 | ||||
-rw-r--r-- | ext/standard/datetime.c | 13 | ||||
-rw-r--r-- | ext/standard/dir.c | 11 | ||||
-rw-r--r-- | ext/standard/dl.c | 18 | ||||
-rw-r--r-- | ext/standard/dns.c | 6 | ||||
-rw-r--r-- | ext/standard/exec.c | 53 | ||||
-rw-r--r-- | ext/standard/file.c | 39 | ||||
-rw-r--r-- | ext/standard/filestat.c | 26 | ||||
-rw-r--r-- | ext/standard/formatted_print.c | 8 | ||||
-rw-r--r-- | ext/standard/fsock.c | 7 | ||||
-rw-r--r-- | ext/standard/ftok.c | 4 | ||||
-rw-r--r-- | ext/standard/head.c | 3 | ||||
-rw-r--r-- | ext/standard/image.c | 6 | ||||
-rw-r--r-- | ext/standard/info.c | 14 | ||||
-rw-r--r-- | ext/standard/iptc.c | 6 | ||||
-rw-r--r-- | ext/standard/levenshtein.c | 2 | ||||
-rw-r--r-- | ext/standard/mail.c | 12 | ||||
-rw-r--r-- | ext/standard/math.c | 3 | ||||
-rw-r--r-- | ext/standard/md5.c | 2 | ||||
-rw-r--r-- | ext/standard/scanf.c | 6 | ||||
-rw-r--r-- | ext/standard/sha1.c | 2 | ||||
-rw-r--r-- | ext/standard/string.c | 21 | ||||
-rw-r--r-- | ext/standard/syslog.c | 6 | ||||
-rw-r--r-- | ext/standard/type.c | 6 |
29 files changed, 226 insertions, 258 deletions
diff --git a/ext/standard/aggregation.c b/ext/standard/aggregation.c index 556ed8f25b..63f4063015 100644 --- a/ext/standard/aggregation.c +++ b/ext/standard/aggregation.c @@ -339,7 +339,7 @@ static void aggregate(INTERNAL_FUNCTION_PARAMETERS, int aggr_what, int aggr_type zend_str_tolower(class_name_lc, class_name_len); if (zend_hash_find(EG(class_table), class_name_lc, class_name_len+1, (void **)&ce) == FAILURE) { - php_error(E_WARNING, "%s(): Expects the second parameter to be a valid class name, '%s' given", get_active_function_name(TSRMLS_C), class_name); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Expects the second parameter to be a valid class name, '%s' given", class_name); efree(class_name_lc); return; } @@ -614,7 +614,7 @@ PHP_FUNCTION(deaggregate) if (zend_hash_find(EG(class_table), Z_OBJCE_P(obj)->name, Z_OBJCE_P(obj)->name_length+1, (void **)&orig_ce) == FAILURE) { - php_error(E_WARNING, "%s(): Internal deaggregation error", get_active_function_name (TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Internal deaggregation error"); return; } diff --git a/ext/standard/array.c b/ext/standard/array.c index 66fe142383..15b43643b8 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -387,8 +387,7 @@ static void php_natsort(INTERNAL_FUNCTION_PARAMETERS, int fold_case) target_hash = HASH_OF(*array); if (!target_hash) { - php_error(E_WARNING, "%s(): The argument should be an array", - get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "The argument should be an array"); return; } @@ -553,7 +552,7 @@ PHP_FUNCTION(usort) } target_hash = HASH_OF(*array); if (!target_hash) { - php_error(E_WARNING, "%s(): The argument should be an array", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "The argument should be an array"); BG(user_compare_func_name) = old_compare_func; RETURN_FALSE; } @@ -581,7 +580,7 @@ PHP_FUNCTION(uasort) } target_hash = HASH_OF(*array); if (!target_hash) { - php_error(E_WARNING, "%s(): The argument should be an array", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "The argument should be an array"); BG(user_compare_func_name) = old_compare_func; RETURN_FALSE; } @@ -656,7 +655,7 @@ PHP_FUNCTION(uksort) } target_hash = HASH_OF(*array); if (!target_hash) { - php_error(E_WARNING, "%s(): The argument should be an array", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "The argument should be an array"); BG(user_compare_func_name) = old_compare_func; RETURN_FALSE; } @@ -681,7 +680,7 @@ PHP_FUNCTION(end) } target_hash = HASH_OF(*array); if (!target_hash) { - php_error(E_WARNING, "%s(): Passed variable is not an array or object", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Passed variable is not an array or object"); RETURN_FALSE; } zend_hash_internal_pointer_end(target_hash); @@ -709,7 +708,7 @@ PHP_FUNCTION(prev) } target_hash = HASH_OF(*array); if (!target_hash) { - php_error(E_WARNING, "%s(): Passed variable is not an array or object", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Passed variable is not an array or object"); RETURN_FALSE; } zend_hash_move_backwards(target_hash); @@ -737,7 +736,7 @@ PHP_FUNCTION(next) } target_hash = HASH_OF(*array); if (!target_hash) { - php_error(E_WARNING, "%s(): Passed variable is not an array or object", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Passed variable is not an array or object"); RETURN_FALSE; } zend_hash_move_forward(target_hash); @@ -765,7 +764,7 @@ PHP_FUNCTION(reset) } target_hash = HASH_OF(*array); if (!target_hash) { - php_error(E_WARNING, "%s(): Passed variable is not an array or object", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Passed variable is not an array or object"); RETURN_FALSE; } zend_hash_internal_pointer_reset(target_hash); @@ -793,7 +792,7 @@ PHP_FUNCTION(current) } target_hash = HASH_OF(*array); if (!target_hash) { - php_error(E_WARNING, "%s(): Passed variable is not an array or object", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Passed variable is not an array or object"); RETURN_FALSE; } if (zend_hash_get_current_data(target_hash, (void **) &entry) == FAILURE) { @@ -819,7 +818,7 @@ PHP_FUNCTION(key) } target_hash = HASH_OF(*array); if (!target_hash) { - php_error(E_WARNING, "%s(): Passed variable is not an array or object", get_active_function_name (TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Passed variable is not an array or object"); RETURN_FALSE; } switch (zend_hash_get_current_key_ex(target_hash, &string_key, &string_length, &num_key, 0, NULL)) { @@ -843,7 +842,7 @@ PHP_FUNCTION(min) pval **result; if (argc<=0) { - php_error(E_WARNING, "%s(): Atleast one value should be passed", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Atleast one value should be passed"); RETURN_NULL(); } set_compare_func(SORT_REGULAR TSRMLS_CC); @@ -857,7 +856,7 @@ PHP_FUNCTION(min) *return_value = **result; zval_copy_ctor(return_value); } else { - php_error(E_WARNING, "%s(): Array must contain atleast one element", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Array must contain atleast one element"); RETURN_FALSE; } } else { @@ -895,7 +894,7 @@ PHP_FUNCTION(max) pval **result; if (argc<=0) { - php_error(E_WARNING, "%s(): Atleast one value should be passed", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Atleast one value should be passed"); RETURN_NULL(); } set_compare_func(SORT_REGULAR TSRMLS_CC); @@ -909,7 +908,7 @@ PHP_FUNCTION(max) *return_value = **result; zval_copy_ctor(return_value); } else { - php_error(E_WARNING, "%s(): Array must contain atleast one element", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Array must contain atleast one element"); RETURN_FALSE; } } else { @@ -976,8 +975,7 @@ static int php_array_walk(HashTable *target_hash, zval **userdata TSRMLS_DC) zval_ptr_dtor(&retval_ptr); } else - php_error(E_WARNING, "%s(): Unable to call %s() - function does not exist", - get_active_function_name(TSRMLS_C), + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to call %s() - function does not exist", (*BG(array_walk_func_name))->value.str.val); zend_hash_move_forward_ex(target_hash, &pos); @@ -1006,15 +1004,13 @@ PHP_FUNCTION(array_walk) } target_hash = HASH_OF(*array); if (!target_hash) { - php_error(E_WARNING, "%s(): The argument should be an array", - get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "The argument should be an array"); BG(array_walk_func_name) = old_walk_func_name; RETURN_FALSE; } if (Z_TYPE_PP(BG(array_walk_func_name)) != IS_ARRAY && Z_TYPE_PP(BG(array_walk_func_name)) != IS_STRING) { - php_error(E_WARNING, "%s(): Wrong syntax for function name", - get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Wrong syntax for function name"); BG(array_walk_func_name) = old_walk_func_name; RETURN_FALSE; } @@ -1048,12 +1044,12 @@ static void php_search_array(INTERNAL_FUNCTION_PARAMETERS, int behavior) } if (Z_TYPE_PP(value) == IS_OBJECT) { - php_error(E_WARNING, "%s(): Wrong datatype for first argument", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Wrong datatype for first argument"); RETURN_FALSE; } if (Z_TYPE_PP(array) != IS_ARRAY) { - php_error(E_WARNING, "%s(): Wrong datatype for second argument", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Wrong datatype for second argument"); RETURN_FALSE; } @@ -1160,8 +1156,7 @@ PHP_FUNCTION(extract) convert_to_long_ex(z_extract_type); extract_type = Z_LVAL_PP(z_extract_type); if (extract_type > EXTR_SKIP && extract_type <= EXTR_PREFIX_IF_EXISTS) { - php_error(E_WARNING, "%s(): Prefix expected to be specified", - get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Prefix expected to be specified"); return; } break; @@ -1181,14 +1176,12 @@ PHP_FUNCTION(extract) } if (extract_type < EXTR_OVERWRITE || extract_type > EXTR_IF_EXISTS) { - php_error(E_WARNING, "%s(): Unknown extract type", - get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown extract type"); return; } if (Z_TYPE_PP(var_array) != IS_ARRAY) { - php_error(E_WARNING, "%s(): First argument should be an array", - get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "First argument should be an array"); return; } @@ -1363,7 +1356,7 @@ PHP_FUNCTION(array_fill) zend_hash_index_update(Z_ARRVAL_P(return_value), Z_LVAL_PP(start_key), val, sizeof(val), NULL); break; default: - php_error(E_WARNING, "%s(): Wrong data type for start key", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Wrong data type for start key"); RETURN_FALSE; break; } @@ -1371,7 +1364,7 @@ PHP_FUNCTION(array_fill) convert_to_long_ex(num); i = Z_LVAL_PP(num) - 1; if(i<0) { - php_error(E_WARNING, "%s(): Number of elements must be positive", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Number of elements must be positive"); RETURN_FALSE; } newval = *val; @@ -1635,7 +1628,7 @@ PHP_FUNCTION(array_push) /* Get first argument and check that it's an array */ stack = *args[0]; if (Z_TYPE_P(stack) != IS_ARRAY) { - php_error(E_WARNING, "%s(): First argument should be an array", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "First argument should be an array"); efree(args); RETURN_FALSE; } @@ -1671,7 +1664,7 @@ static void _phpi_pop(INTERNAL_FUNCTION_PARAMETERS, int off_the_end) } if (Z_TYPE_PP(stack) != IS_ARRAY) { - php_error(E_WARNING, "%s(): The argument should be an array", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "The argument should be an array"); return; } @@ -1754,7 +1747,7 @@ PHP_FUNCTION(array_unshift) /* Get first argument and check that it's an array */ stack = *args[0]; if (Z_TYPE_P(stack) != IS_ARRAY) { - php_error(E_WARNING, "%s(): The first argument should be an array", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "The first argument should be an array"); efree(args); RETURN_FALSE; } @@ -1804,7 +1797,7 @@ PHP_FUNCTION(array_splice) /* Get first argument and check that it's an array */ array = *args[0]; if (Z_TYPE_P(array) != IS_ARRAY) { - php_error(E_WARNING, "%s(): The first argument should be an array", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "The first argument should be an array"); efree(args); return; } @@ -1879,7 +1872,7 @@ PHP_FUNCTION(array_slice) } if (Z_TYPE_PP(input) != IS_ARRAY) { - php_error(E_WARNING, "%s(): The first argument should be an array", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "The first argument should be an array"); return; } @@ -2059,7 +2052,7 @@ PHP_FUNCTION(array_keys) } if (Z_TYPE_PP(input) != IS_ARRAY) { - php_error(E_WARNING, "%s(): The first argument should be an array", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "The first argument should be an array"); return; } @@ -2116,7 +2109,7 @@ PHP_FUNCTION(array_values) } if (Z_TYPE_PP(input) != IS_ARRAY) { - php_error(E_WARNING, "%s(): The argument should be an array", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "The argument should be an array"); return; } @@ -2153,7 +2146,7 @@ PHP_FUNCTION(array_count_values) } if (Z_TYPE_PP(input) != IS_ARRAY) { - php_error(E_WARNING, "%s(): The argument should be an array", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "The argument should be an array"); return; } @@ -2190,7 +2183,7 @@ PHP_FUNCTION(array_count_values) Z_LVAL_PP(tmp)++; } } else { - php_error(E_WARNING, "%s(): Can only count STRING and INTEGER values!", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can only count STRING and INTEGER values!"); } zend_hash_move_forward_ex(myht, &pos); @@ -2219,7 +2212,7 @@ PHP_FUNCTION(array_reverse) } if (Z_TYPE_PP(input) != IS_ARRAY) { - php_error(E_WARNING, "%s(): The argument should be an array", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "The argument should be an array"); return; } @@ -2279,8 +2272,7 @@ PHP_FUNCTION(array_pad) /* Make sure arguments are of the proper type */ if (Z_TYPE_PP(input) != IS_ARRAY) { - php_error(E_WARNING, "%s(): The argument should be an array", - get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "The argument should be an array"); return; } convert_to_long_ex(pad_size); @@ -2338,7 +2330,7 @@ PHP_FUNCTION(array_flip) target_hash = HASH_OF(*array); if (!target_hash) { - php_error(E_WARNING, "%s(): The argument should be an array", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "The argument should be an array"); RETURN_FALSE; } @@ -2365,7 +2357,7 @@ PHP_FUNCTION(array_flip) zend_hash_update(Z_ARRVAL_P(return_value), Z_STRVAL_PP(entry), Z_STRLEN_PP(entry) + 1, &data, sizeof(data), NULL); } else { zval_ptr_dtor(&data); /* will free also zval structure */ - php_error(E_WARNING, "%s(): Can only flip STRING and INTEGER values!", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can only flip STRING and INTEGER values!"); } zend_hash_move_forward_ex(target_hash, &pos); @@ -2397,7 +2389,7 @@ PHP_FUNCTION(array_change_key_case) } if (Z_TYPE_PP(array) != IS_ARRAY) { - php_error(E_WARNING, "%s(): The argument should be an array", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "The argument should be an array"); RETURN_FALSE; } @@ -2446,7 +2438,7 @@ PHP_FUNCTION(array_unique) } target_hash = HASH_OF(*array); if (!target_hash) { - php_error(E_WARNING, "%s(): The argument should be an array", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "The argument should be an array"); RETURN_FALSE; } @@ -2517,7 +2509,7 @@ PHP_FUNCTION(array_intersect) set_compare_func(SORT_STRING TSRMLS_CC); for (i=0; i<argc; i++) { if (Z_TYPE_PP(args[i]) != IS_ARRAY) { - php_error(E_WARNING, "%s(): Argument #%d is not an array", get_active_function_name(TSRMLS_C), i+1); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Argument #%d is not an array", i+1); argc = i; /* only free up to i-1 */ goto out; } @@ -2622,7 +2614,7 @@ PHP_FUNCTION(array_diff) set_compare_func(SORT_STRING TSRMLS_CC); for (i=0; i<argc; i++) { if (Z_TYPE_PP(args[i]) != IS_ARRAY) { - php_error(E_WARNING, "%s(): Argument #%d is not an array", get_active_function_name(TSRMLS_C), i+1); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Argument #%d is not an array", i+1); argc = i; /* only free up to i-1 */ goto out; } @@ -2792,7 +2784,7 @@ PHP_FUNCTION(array_multisort) sort_order = Z_LVAL_PP(args[i]) == SORT_DESC ? -1 : 1; parse_state[MULTISORT_ORDER] = 0; } else { - php_error(E_WARNING, "%s(): Argument #%d is expected to be an array or sorting flag that has not already been specified", get_active_function_name(TSRMLS_C), i+1); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Argument #%d is expected to be an array or sorting flag that has not already been specified", i+1); MULTISORT_ABORT; } break; @@ -2806,19 +2798,19 @@ PHP_FUNCTION(array_multisort) sort_type = Z_LVAL_PP(args[i]); parse_state[MULTISORT_TYPE] = 0; } else { - php_error(E_WARNING, "%s(): Argument #%d is expected to be an array or sorting flag that has not already been specified", get_active_function_name(TSRMLS_C), i + 1); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Argument #%d is expected to be an array or sorting flag that has not already been specified", i + 1); MULTISORT_ABORT; } break; default: - php_error(E_WARNING, "%s(): Argument #%d is an unknown sort flag", get_active_function_name(TSRMLS_C), i + 1); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Argument #%d is an unknown sort flag", i + 1); MULTISORT_ABORT; break; } } else { - php_error(E_WARNING, "%s(): Argument #%d is expected to be an array or a sort flag", get_active_function_name(TSRMLS_C), i + 1); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Argument #%d is expected to be an array or a sort flag", i + 1); MULTISORT_ABORT; } } @@ -2830,7 +2822,7 @@ PHP_FUNCTION(array_multisort) array_size = zend_hash_num_elements(Z_ARRVAL_PP(arrays[0])); for (i = 0; i < num_arrays; i++) { if (zend_hash_num_elements(Z_ARRVAL_PP(arrays[i])) != array_size) { - php_error(E_WARNING, "%s(): Array sizes are inconsistent", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Array sizes are inconsistent"); MULTISORT_ABORT; } } @@ -2927,8 +2919,7 @@ PHP_FUNCTION(array_rand) } if (Z_TYPE_PP(input) != IS_ARRAY) { - zend_error(E_WARNING, "Argument to %s() has to be an array", - get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "First argument has to be an array"); return; } @@ -2938,7 +2929,7 @@ PHP_FUNCTION(array_rand) convert_to_long_ex(num_req); num_req_val = Z_LVAL_PP(num_req); if (num_req_val <= 0 || num_req_val > num_avail) { - zend_error(E_WARNING, "Second argument to %s() has to be between 1 and the number of elements in the array", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Second argument has to be between 1 and the number of elements in the array"); return; } } else @@ -2999,8 +2990,7 @@ PHP_FUNCTION(array_sum) } if (Z_TYPE_PP(input) != IS_ARRAY) { - php_error(E_WARNING, "%s(): The argument should be an array", - get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "The argument should be an array"); return; } @@ -3050,14 +3040,12 @@ PHP_FUNCTION(array_reduce) } if (Z_TYPE_PP(input) != IS_ARRAY) { - php_error(E_WARNING, "%s(): The first argument should be an array", - get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "The first argument should be an array"); return; } if (!zend_is_callable(*callback, 0, &callback_name)) { - php_error(E_WARNING, "%s(): The second argument, '%s', should be a valid callback", - get_active_function_name(TSRMLS_C), callback_name); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "The second argument, '%s', should be a valid callback", callback_name); efree(callback_name); return; } @@ -3085,7 +3073,7 @@ PHP_FUNCTION(array_reduce) zval_ptr_dtor(&result); result = retval; } else { - php_error(E_WARNING, "%s(): An error occurred while invoking the reduction callback", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "An error occurred while invoking the reduction callback"); return; } } else { @@ -3123,15 +3111,13 @@ PHP_FUNCTION(array_filter) } if (Z_TYPE_PP(input) != IS_ARRAY) { - php_error(E_WARNING, "%s(): The first argument shouldbe an array", - get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "The first argument shouldbe an array"); return; } if (ZEND_NUM_ARGS() > 1) { if (!zend_is_callable(*callback, 0, &callback_name)) { - php_error(E_WARNING, "%s(): The second argument, '%s', should be a valid callback", - get_active_function_name(TSRMLS_C), callback_name); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "The second argument, '%s', should be a valid callback", callback_name); efree(callback_name); return; } @@ -3155,7 +3141,7 @@ PHP_FUNCTION(array_filter) } else zval_ptr_dtor(&retval); } else { - php_error(E_WARNING, "%s(): An error occurred while invoking the filter callback", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "An error occurred while invoking the filter callback"); return; } } else if (!zend_is_true(*operand)) @@ -3204,7 +3190,7 @@ PHP_FUNCTION(array_map) callback = *args[0]; if (Z_TYPE_P(callback) != IS_NULL) { if (!zend_is_callable(callback, 0, &callback_name)) { - php_error(E_WARNING, "%s(): The first argument, '%s', should be either NULL or a valid callback", get_active_function_name(TSRMLS_C), callback_name); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "The first argument, '%s', should be either NULL or a valid callback", callback_name); efree(callback_name); efree(args); return; @@ -3219,8 +3205,7 @@ PHP_FUNCTION(array_map) /* Check that arrays are indeed arrays and calculate maximum size. */ for (i = 0; i < ZEND_NUM_ARGS()-1; i++) { if (Z_TYPE_PP(args[i+1]) != IS_ARRAY) { - php_error(E_WARNING, "%s(): Argument #%d should be an array", - get_active_function_name(TSRMLS_C), i + 2); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Argument #%d should be an array", i + 2); efree(array_len); efree(args); return; @@ -3291,7 +3276,7 @@ PHP_FUNCTION(array_map) if (Z_TYPE_P(callback) != IS_NULL) { if (!call_user_function_ex(EG(function_table), NULL, callback, &result, ZEND_NUM_ARGS()-1, params, 0, NULL TSRMLS_CC) == SUCCESS && result) { - php_error(E_WARNING, "%s(): An error occurred while invoking the map callback", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "An error occurred while invoking the map callback"); efree(array_len); efree(args); efree(array_pos); @@ -3332,7 +3317,7 @@ PHP_FUNCTION(array_key_exists) } if (Z_TYPE_PP(array) != IS_ARRAY && Z_TYPE_PP(array) != IS_OBJECT) { - php_error(E_WARNING, "%s(): The second argument should be either an array or an object", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "The second argument should be either an array or an object"); RETURN_FALSE; } @@ -3350,7 +3335,7 @@ PHP_FUNCTION(array_key_exists) RETURN_FALSE; default: - php_error(E_WARNING, "%s(): The first argument should be either a string or an integer", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "The first argument should be either a string or an integer"); RETURN_FALSE; } @@ -3379,8 +3364,7 @@ PHP_FUNCTION(array_chunk) /* Do bounds checking for size parameter. */ if (size < 1) { - php_error(E_WARNING, "%s(): Size parameter expected to be greater than 0", - get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Size parameter expected to be greater than 0"); return; } diff --git a/ext/standard/assert.c b/ext/standard/assert.c index ca85730041..c9612a5161 100644 --- a/ext/standard/assert.c +++ b/ext/standard/assert.c @@ -206,9 +206,9 @@ PHP_FUNCTION(assert) if (ASSERTG(warning)) { if (myeval) { - php_error(E_WARNING, "%s(): Assertion \"%s\" failed", get_active_function_name (TSRMLS_C), myeval); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Assertion \"%s\" failed", myeval); } else { - php_error(E_WARNING, "%s(): Assertion failed", get_active_function_name (TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Assertion failed"); } } @@ -282,7 +282,7 @@ PHP_FUNCTION(assert_options) break; default: - php_error(E_WARNING, "%s(): Unknown value %d", get_active_function_name (TSRMLS_C), Z_LVAL_PP(what)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown value %d", Z_LVAL_PP(what)); break; } diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index 01f5e75ab5..1c66aee6d0 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -1166,7 +1166,7 @@ PHP_FUNCTION(constant) convert_to_string_ex(const_name); if (!zend_get_constant(Z_STRVAL_PP(const_name), Z_STRLEN_PP(const_name), return_value TSRMLS_CC)) { - php_error(E_WARNING, "%s(): Couldn't find constant %s", get_active_function_name (TSRMLS_C), Z_STRVAL_PP(const_name)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't find constant %s", Z_STRVAL_PP(const_name)); RETURN_NULL(); } } @@ -1260,7 +1260,7 @@ PHP_FUNCTION(putenv) if (PG(safe_mode)) { /* Check the protected list */ if (zend_hash_exists(&BG(sm_protected_env_vars), pe.key, pe.key_len)) { - php_error(E_WARNING, "%s(): Safe Mode warning: Cannot override protected environment variable '%s'", get_active_function_name (TSRMLS_C), pe.key); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Safe Mode warning: Cannot override protected environment variable '%s'", pe.key); efree(pe.putenv_string); efree(pe.key); RETURN_FALSE; @@ -1281,7 +1281,7 @@ PHP_FUNCTION(putenv) } efree(allowed_env_vars); if (!allowed) { - php_error(E_WARNING, "%s(): Safe Mode warning: Cannot set environment variable '%s' - it's not in the allowed list", get_active_function_name (TSRMLS_C), pe.key); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Safe Mode warning: Cannot set environment variable '%s' - it's not in the allowed list", pe.key); efree(pe.putenv_string); efree(pe.key); RETURN_FALSE; @@ -1446,14 +1446,14 @@ PHP_FUNCTION(error_log) switch (ZEND_NUM_ARGS()) { case 1: if (zend_get_parameters_ex(1, &string) == FAILURE) { - php_error(E_WARNING, "%s(): Argument 1 invalid", get_active_function_name (TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Argument 1 invalid"); RETURN_FALSE; } break; case 2: if (zend_get_parameters_ex(2, &string, &erropt) == FAILURE) { - php_error(E_WARNING, "%s(): Invalid arguments", get_active_function_name (TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid arguments"); RETURN_FALSE; } convert_to_long_ex(erropt); @@ -1462,7 +1462,7 @@ PHP_FUNCTION(error_log) case 3: if (zend_get_parameters_ex(3, &string, &erropt, &option) == FAILURE) { - php_error(E_WARNING, "%s(): Invalid arguments", get_active_function_name (TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid arguments"); RETURN_FALSE; } convert_to_long_ex(erropt); @@ -1473,7 +1473,7 @@ PHP_FUNCTION(error_log) case 4: if (zend_get_parameters_ex (4, &string, &erropt, &option, &emailhead) == FAILURE) { - php_error(E_WARNING, "%s(): Invalid arguments in", get_active_function_name (TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid arguments in"); RETURN_FALSE; } break; @@ -1522,14 +1522,14 @@ PHPAPI int _php_error_log(int opt_err, char *message, char *opt, char *headers T return FAILURE; } #else - php_error(E_WARNING, "%s(): Mail option not available!", get_active_function_name (TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Mail option not available!"); return FAILURE; #endif } break; case 2: /*send to an address */ - php_error(E_WARNING, "%s(): TCP/IP option not available!", get_active_function_name (TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "TCP/IP option not available!"); return FAILURE; break; @@ -1574,7 +1574,7 @@ PHP_FUNCTION(call_user_func) } if (!zend_is_callable(*params[0], 0, &name)) { - php_error(E_WARNING, "%s(): First argumented is expected to be a valid callback, '%s' was given", get_active_function_name(TSRMLS_C), name); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "First argumented is expected to be a valid callback, '%s' was given", name); efree(name); efree(params); RETURN_NULL(); @@ -1583,7 +1583,7 @@ PHP_FUNCTION(call_user_func) if (call_user_function_ex(EG(function_table), NULL, *params[0], &retval_ptr, argc-1, params+1, 0, NULL TSRMLS_CC) == SUCCESS && retval_ptr) { COPY_PZVAL_TO_ZVAL(*return_value, retval_ptr); } else { - php_error(E_WARNING, "%s(): Unable to call %s()", get_active_function_name (TSRMLS_C), name); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to call %s()", name); } efree(name); @@ -1615,7 +1615,7 @@ PHP_FUNCTION(call_user_func_array) } if (!zend_is_callable(*func, 0, &name)) { - php_error(E_WARNING, "%s(): First argumented is expected to be a valid callback, '%s' was given", get_active_function_name(TSRMLS_C), name); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "First argumented is expected to be a valid callback, '%s' was given", name); efree(name); RETURN_NULL(); } @@ -1635,7 +1635,7 @@ PHP_FUNCTION(call_user_func_array) if (call_user_function_ex(EG(function_table), NULL, *func, &retval_ptr, count, func_params, 0, NULL TSRMLS_CC) == SUCCESS && retval_ptr) { COPY_PZVAL_TO_ZVAL(*return_value, retval_ptr); } else { - php_error(E_WARNING, "%s(): Unable to call %s()", get_active_function_name(TSRMLS_C), name); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to call %s()", name); } efree(name); @@ -1643,7 +1643,7 @@ PHP_FUNCTION(call_user_func_array) } /* }}} */ -#define _CUM_DEPREC "%s(): This function is deprecated, use the call_user_func variety with the array(&$obj, \"method\") syntax instead" +#define _CUM_DEPREC "This function is deprecated, use the call_user_func variety with the array(&$obj, \"method\") syntax instead" /* {{{ proto mixed call_user_method(string method_name, mixed object [, mixed parameter] [, mixed ...]) Call a user method on a specific object or class */ @@ -1653,7 +1653,7 @@ PHP_FUNCTION(call_user_method) zval *retval_ptr; int arg_count = ZEND_NUM_ARGS(); - php_error(E_NOTICE, _CUM_DEPREC, get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_NOTICE, _CUM_DEPREC); if (arg_count < 2) { WRONG_PARAM_COUNT; @@ -1665,7 +1665,7 @@ PHP_FUNCTION(call_user_method) RETURN_FALSE; } if (Z_TYPE_PP(params[1]) != IS_OBJECT && Z_TYPE_PP(params[1]) != IS_STRING) { - php_error(E_WARNING, "%s(): Second argument is not an object or class name", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Second argument is not an object or class name"); efree(params); RETURN_FALSE; } @@ -1676,7 +1676,7 @@ PHP_FUNCTION(call_user_method) if (call_user_function_ex(EG(function_table), params[1], *params[0], &retval_ptr, arg_count-2, params+2, 0, NULL TSRMLS_CC) == SUCCESS && retval_ptr) { COPY_PZVAL_TO_ZVAL(*return_value, retval_ptr); } else { - php_error(E_WARNING, "%s(): Unable to call %s()", get_active_function_name(TSRMLS_C), Z_STRVAL_PP(params[0])); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to call %s()", Z_STRVAL_PP(params[0])); } efree(params); } @@ -1690,14 +1690,14 @@ PHP_FUNCTION(call_user_method_array) HashTable *params_ar; int num_elems, element = 0; - php_error(E_NOTICE, _CUM_DEPREC, get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_NOTICE, _CUM_DEPREC); if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &method_name, &obj, ¶ms) == FAILURE) { WRONG_PARAM_COUNT; } if (Z_TYPE_PP(obj) != IS_OBJECT && Z_TYPE_PP(obj) != IS_STRING) { - php_error(E_WARNING, "%s(): Second argument is not an object or class name", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Second argument is not an object or class name"); RETURN_FALSE; } @@ -1720,7 +1720,7 @@ PHP_FUNCTION(call_user_method_array) if (call_user_function_ex(EG(function_table), obj, *method_name, &retval_ptr, num_elems, method_args, 0, NULL TSRMLS_CC) == SUCCESS && retval_ptr) { COPY_PZVAL_TO_ZVAL(*return_value, retval_ptr); } else { - php_error(E_WARNING, "%s(): Unable to call %s()", get_active_function_name(TSRMLS_C), Z_STRVAL_PP(method_name)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to call %s()", Z_STRVAL_PP(method_name)); } efree(method_args); @@ -1761,7 +1761,7 @@ static int user_shutdown_function_call(php_shutdown_function_entry *shutdown_fun zval_dtor(&retval); } else { - php_error(E_WARNING, "%s(): Unable to call %s() - function does not exist", get_active_function_name(TSRMLS_C), Z_STRVAL_P(shutdown_function_entry->arguments[0])); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to call %s() - function does not exist", Z_STRVAL_P(shutdown_function_entry->arguments[0])); } return 0; } @@ -1787,15 +1787,15 @@ static void user_tick_function_call(user_tick_function_entry *tick_fe TSRMLS_DC) zval **obj, **method; if (Z_TYPE_P(function) == IS_STRING) { - php_error(E_WARNING, "%s(): Unable to call %s() - function does not exist", get_active_function_name(TSRMLS_C), Z_STRVAL_P(function)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to call %s() - function does not exist", Z_STRVAL_P(function)); } else if ( Z_TYPE_P(function) == IS_ARRAY && zend_hash_index_find(Z_ARRVAL_P(function), 0, (void **) &obj) == SUCCESS && zend_hash_index_find(Z_ARRVAL_P(function), 1, (void **) &method) == SUCCESS && Z_TYPE_PP(obj) == IS_OBJECT && Z_TYPE_PP(method) == IS_STRING ) { - php_error(E_WARNING, "%s(): Unable to call %s::%s() - function does not exist", get_active_function_name(TSRMLS_C), Z_OBJCE_PP(obj)->name, Z_STRVAL_PP(method)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to call %s::%s() - function does not exist", Z_OBJCE_PP(obj)->name, Z_STRVAL_PP(method)); } else { - php_error(E_WARNING, "%s(): Unable to call tick function", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to call tick function"); } } @@ -2034,7 +2034,7 @@ PHP_FUNCTION(ini_get_all) if(extname) { if (zend_hash_find(&module_registry, extname, extname_len+1, (void **) &module) == FAILURE) { - php_error(E_WARNING, "%s(): Unable to find extension '%s'", get_active_function_name(TSRMLS_C), extname); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find extension '%s'", extname); RETURN_FALSE; } extnumber = module->module_number; @@ -2427,7 +2427,7 @@ PHP_FUNCTION(move_uploaded_file) if (successful) { zend_hash_del(SG(rfc1867_uploaded_files), Z_STRVAL_PP(path), Z_STRLEN_PP(path)+1); } else { - php_error(E_WARNING, "%s(): Unable to move '%s' to '%s'", get_active_function_name(TSRMLS_C), Z_STRVAL_PP(path), Z_STRVAL_PP(new_path)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to move '%s' to '%s'", Z_STRVAL_PP(path), Z_STRVAL_PP(new_path)); } RETURN_BOOL(successful); } @@ -2552,7 +2552,7 @@ PHP_FUNCTION(parse_ini_file) fh.handle.fp = VCWD_FOPEN(Z_STRVAL_PP(filename), "r"); if (!fh.handle.fp) { - php_error(E_WARNING, "%s(): Cannot open '%s' for reading", get_active_function_name(TSRMLS_C), Z_STRVAL_PP(filename)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot open '%s' for reading", Z_STRVAL_PP(filename)); return; } Z_TYPE(fh) = ZEND_HANDLE_FP; @@ -2622,7 +2622,7 @@ PHP_FUNCTION(import_request_variables) } if (prefix_len == 0) { - zend_error(E_NOTICE, "No prefix specified in %s() - possible security hazard", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_NOTICE, "No prefix specified - possible security hazard"); } convert_to_string_ex(z_types); diff --git a/ext/standard/browscap.c b/ext/standard/browscap.c index f1e9ca40c2..2cdce52d25 100644 --- a/ext/standard/browscap.c +++ b/ext/standard/browscap.c @@ -149,7 +149,7 @@ PHP_MINIT_FUNCTION(browscap) fh.handle.fp = VCWD_FOPEN(browscap, "r"); if (!fh.handle.fp) { - php_error(E_CORE_WARNING, "%s(): Cannot open '%s' for reading", get_active_function_name(TSRMLS_C), browscap); + php_error_docref(NULL TSRMLS_CC, E_CORE_WARNING, "Cannot open '%s' for reading", browscap); return FAILURE; } fh.filename = browscap; diff --git a/ext/standard/cyr_convert.c b/ext/standard/cyr_convert.c index 51857c598a..243dd22ec3 100644 --- a/ext/standard/cyr_convert.c +++ b/ext/standard/cyr_convert.c @@ -228,7 +228,7 @@ static char * php_convert_cyr_string(unsigned char *str, int length, char from, case 'K': break; default: - php_error(E_WARNING, "%s(): Unknown source charset: %c", get_active_function_name(TSRMLS_C), from); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown source charset: %c", from); break; } @@ -250,7 +250,7 @@ static char * php_convert_cyr_string(unsigned char *str, int length, char from, case 'K': break; default: - php_error(E_WARNING, "%s(): Unknown destination charset: %c", get_active_function_name(TSRMLS_C), to); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown destination charset: %c", to); break; } diff --git a/ext/standard/datetime.c b/ext/standard/datetime.c index 758666a13a..b3673707c2 100644 --- a/ext/standard/datetime.c +++ b/ext/standard/datetime.c @@ -301,7 +301,7 @@ php_date(INTERNAL_FUNCTION_PARAMETERS, int gm) } if (!ta) { /* that really shouldn't happen... */ - php_error(E_WARNING, "%s(): Unexpected error", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unexpected error"); RETURN_FALSE; } for (i = 0; i < Z_STRLEN_PP(format); i++) { @@ -642,12 +642,11 @@ PHP_FUNCTION(localtime) break; } if (NULL == (ta = php_localtime_r(×tamp, &tmbuf))) { - php_error(E_WARNING, "%s(): Invalid local time", - get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid local time"); RETURN_FALSE; } if (array_init(return_value) == FAILURE) { - php_error(E_ERROR, "%s(): Cannot prepare return array from localtime", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_ERROR, "Cannot prepare return array from localtime"); RETURN_FALSE; } @@ -694,11 +693,11 @@ PHP_FUNCTION(getdate) ta = php_localtime_r(×tamp, &tmbuf); if (!ta) { - php_error(E_WARNING, "%s(): Cannot perform date calculation", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot perform date calculation"); return; } if (array_init(return_value) == FAILURE) { - php_error(E_ERROR, "%s(): Unable to initialize array", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_ERROR, "Unable to initialize array"); return; } add_assoc_long(return_value, "seconds", ta->tm_sec); @@ -879,7 +878,7 @@ PHP_FUNCTION(strtotime) convert_to_string_ex(z_time); if (Z_STRLEN_PP(z_time) == 0) - php_error (E_NOTICE, "%s(): Called with empty time parameter", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Called with empty time parameter"); if (argc == 2) { convert_to_long_ex(z_now); now = Z_LVAL_PP(z_now); diff --git a/ext/standard/dir.c b/ext/standard/dir.c index af7be9aab9..b8fcf1cdf2 100644 --- a/ext/standard/dir.c +++ b/ext/standard/dir.c @@ -75,7 +75,7 @@ static zend_class_entry *dir_class_entry_ptr; myself = getThis(); \ if (myself) { \ if (zend_hash_find(Z_OBJPROP_P(myself), "handle", sizeof("handle"), (void **)&tmp) == FAILURE) { \ - php_error(E_WARNING, "%s(): Unable to find my handle property", get_active_function_name(TSRMLS_C)); \ + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find my handle property"); \ RETURN_FALSE; \ } \ ZEND_FETCH_RESOURCE(dirp, php_stream *, tmp, -1, "Directory", php_file_le_stream()); \ @@ -217,14 +217,14 @@ PHP_FUNCTION(chroot) ret = chroot(str); if (ret != 0) { - php_error(E_WARNING, "%s(): %s (errno %d)", get_active_function_name(TSRMLS_C), strerror(errno), errno); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s (errno %d)", strerror(errno), errno); RETURN_FALSE; } ret = chdir("/"); if (ret != 0) { - php_error(E_WARNING, "%s(): %s (errno %d)", get_active_function_name(TSRMLS_C), strerror(errno), errno); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s (errno %d)", strerror(errno), errno); RETURN_FALSE; } @@ -252,7 +252,7 @@ PHP_FUNCTION(chdir) ret = VCWD_CHDIR(str); if (ret != 0) { - php_error(E_WARNING, "%s(): %s (errno %d)", get_active_function_name(TSRMLS_C), strerror(errno), errno); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s (errno %d)", strerror(errno), errno); RETURN_FALSE; } @@ -336,8 +336,7 @@ PHP_FUNCTION(glob) int n, ret; if (PG(safe_mode)) { - php_error(E_WARNING, "%s(): Safe Mode restriction in effect, function is disabled", - get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Safe Mode restriction in effect, function is disabled"); RETURN_FALSE; } diff --git a/ext/standard/dl.c b/ext/standard/dl.c index e17ccc4758..07613a1ad2 100644 --- a/ext/standard/dl.c +++ b/ext/standard/dl.c @@ -59,7 +59,7 @@ PHP_FUNCTION(dl) #ifdef ZTS if ((strcmp(sapi_module.name, "cgi")!=0) && (strcmp(sapi_module.name, "cli")!=0)) { - php_error(E_ERROR, "%s(): Not supported in multithreaded Web servers - use extension statements in your php.ini", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_ERROR, "Not supported in multithreaded Web servers - use extension statements in your php.ini"); } #endif @@ -71,9 +71,9 @@ PHP_FUNCTION(dl) convert_to_string_ex(file); if (!PG(enable_dl)) { - php_error(E_ERROR, "%s(): Dynamically loaded extentions aren't enabled", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_ERROR, "Dynamically loaded extentions aren't enabled"); } else if (PG(safe_mode)) { - php_error(E_ERROR, "%s(): Dynamically loaded extensions aren't allowed when running in Safe Mode", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_ERROR, "Dynamically loaded extensions aren't allowed when running in Safe Mode"); } else { php_dl(*file, MODULE_TEMPORARY, return_value TSRMLS_CC); EG(full_tables_cleanup) = 1; @@ -134,7 +134,7 @@ void php_dl(pval *file, int type, pval *return_value TSRMLS_DC) /* load dynamic symbol */ handle = DL_LOAD(libpath); if (!handle) { - php_error(error_type, "%s(): Unable to load dynamic library '%s' - %s", get_active_function_name(TSRMLS_C), libpath, GET_DL_ERROR()); + php_error_docref(NULL TSRMLS_CC, error_type, "Unable to load dynamic library '%s' - %s", libpath, GET_DL_ERROR()); efree(libpath); RETURN_FALSE; } @@ -155,7 +155,7 @@ void php_dl(pval *file, int type, pval *return_value TSRMLS_DC) if (!get_module) { DL_UNLOAD(handle); - php_error(error_type, "%s(): Invalid library (maybe not a PHP library) '%s' ", get_active_function_name(TSRMLS_C), Z_STRVAL_P(file)); + php_error_docref(NULL TSRMLS_CC, error_type, "Invalid library (maybe not a PHP library) '%s' ", Z_STRVAL_P(file)); RETURN_FALSE; } module_entry = get_module(); @@ -213,7 +213,7 @@ void php_dl(pval *file, int type, pval *return_value TSRMLS_DC) module_entry->module_number = zend_next_free_module(); if (module_entry->module_startup_func) { if (module_entry->module_startup_func(type, module_entry->module_number TSRMLS_CC)==FAILURE) { - php_error(error_type, "%s(): Unable to initialize module '%s'", get_active_function_name(TSRMLS_C), module_entry->name); + php_error_docref(NULL TSRMLS_CC, error_type, "Unable to initialize module '%s'", module_entry->name); DL_UNLOAD(handle); RETURN_FALSE; } @@ -222,7 +222,7 @@ void php_dl(pval *file, int type, pval *return_value TSRMLS_DC) if ((type == MODULE_TEMPORARY) && module_entry->request_startup_func) { if (module_entry->request_startup_func(type, module_entry->module_number TSRMLS_CC)) { - php_error(error_type, "%s(): Unable to initialize module '%s'", get_active_function_name(TSRMLS_C), module_entry->name); + php_error_docref(NULL TSRMLS_CC, error_type, "Unable to initialize module '%s'", module_entry->name); DL_UNLOAD(handle); RETURN_FALSE; } @@ -230,7 +230,7 @@ void php_dl(pval *file, int type, pval *return_value TSRMLS_DC) /* update the .request_started property... */ if (zend_hash_find(&module_registry, module_entry->name, strlen(module_entry->name)+1, (void **) &tmp)==FAILURE) { - php_error(error_type, "%s(): Loaded module '%s' got lost", get_active_function_name(TSRMLS_C), module_entry->name); + php_error_docref(NULL TSRMLS_CC, error_type, "Loaded module '%s' got lost", module_entry->name); RETURN_FALSE; } tmp->handle = handle; @@ -248,7 +248,7 @@ PHP_MINFO_FUNCTION(dl) void php_dl(pval *file, int type, pval *return_value TSRMLS_DC) { - php_error(E_WARNING, "%s(): Cannot dynamically load %s - dynamic modules are not supported", get_active_function_name(TSRMLS_C), Z_STRVAL_P(file)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot dynamically load %s - dynamic modules are not supported", Z_STRVAL_P(file)); RETURN_FALSE; } diff --git a/ext/standard/dns.c b/ext/standard/dns.c index b56ab392a3..5d65f12554 100644 --- a/ext/standard/dns.c +++ b/ext/standard/dns.c @@ -85,9 +85,9 @@ PHP_FUNCTION(gethostbyaddr) #if HAVE_IPV6 && !defined(__MacOSX__) /* MacOSX at this time has support for IPv6, but not inet_pton() * so disabling IPv6 until further notice. MacOSX 10.1.2 (kalowsky) */ - php_error(E_WARNING, "%s(): Address is not a valid IPv4 or IPv6 address", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Address is not a valid IPv4 or IPv6 address"); #else - php_error(E_WARNING, "%s(): Address is not in a.b.c.d form", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Address is not in a.b.c.d form"); #endif RETVAL_FALSE; } else { @@ -236,7 +236,7 @@ PHP_FUNCTION(checkdnsrr) else if ( !strcasecmp("SOA", Z_STRVAL_PP(arg2)) ) type = T_SOA; else if ( !strcasecmp("CNAME", Z_STRVAL_PP(arg2)) ) type = T_CNAME; else { - php_error(E_WARNING, "%s(): Type '%s' not supported", get_active_function_name(TSRMLS_C), Z_STRVAL_PP(arg2)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Type '%s' not supported", Z_STRVAL_PP(arg2)); RETURN_FALSE; } break; diff --git a/ext/standard/exec.c b/ext/standard/exec.c index 78a7359d12..a061266092 100644 --- a/ext/standard/exec.c +++ b/ext/standard/exec.c @@ -72,7 +72,7 @@ static int php_make_safe_mode_command(char *cmd, char **safecmd TSRMLS_DC) larg0 = strlen(arg0); if (strstr(arg0, "..")) { - zend_error(E_WARNING, "No '..' components allowed in path"); + php_error(E_WARNING, "No '..' components allowed in path"); efree(arg0); return FAILURE; } @@ -124,7 +124,7 @@ int php_Exec(int type, char *cmd, pval *array, pval *return_value TSRMLS_DC) buf = (char *) emalloc(EXEC_INPUT_BUF); if (!buf) { - php_error(E_WARNING, "%s(): Unable to emalloc %d bytes for exec buffer", get_active_function_name(TSRMLS_C), EXEC_INPUT_BUF); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to emalloc %d bytes for exec buffer", EXEC_INPUT_BUF); return -1; } buflen = EXEC_INPUT_BUF; @@ -137,7 +137,7 @@ int php_Exec(int type, char *cmd, pval *array, pval *return_value TSRMLS_DC) c = strchr(cmd, ' '); if (c) *c = '\0'; if (strstr(cmd, "..")) { - php_error(E_WARNING, "%s(): No '..' components allowed in path", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "No '..' components allowed in path"); efree(buf); return -1; } @@ -169,7 +169,7 @@ int php_Exec(int type, char *cmd, pval *array, pval *return_value TSRMLS_DC) fp = VCWD_POPEN(d, "r"); #endif if (!fp) { - php_error(E_WARNING, "%s(): Unable to fork [%s]", get_active_function_name(TSRMLS_C), d); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to fork [%s]", d); efree(d); efree(buf); #if PHP_SIGCHILD @@ -188,7 +188,7 @@ int php_Exec(int type, char *cmd, pval *array, pval *return_value TSRMLS_DC) fp = VCWD_POPEN(cmd, "r"); #endif if (!fp) { - php_error(E_WARNING, "%s(): Unable to fork [%s]", get_active_function_name(TSRMLS_C), cmd); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to fork [%s]", cmd); efree(buf); #if PHP_SIGCHILD signal (SIGCHLD, sig_handler); @@ -219,7 +219,7 @@ int php_Exec(int type, char *cmd, pval *array, pval *return_value TSRMLS_DC) if ( buflen <= (l+1) ) { buf = erealloc(buf, buflen + EXEC_INPUT_BUF); if ( buf == NULL ) { - php_error(E_WARNING, "%s(): Unable to erealloc %d bytes for exec buffer", get_active_function_name(TSRMLS_C), + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to erealloc %d bytes for exec buffer", buflen + EXEC_INPUT_BUF); #if PHP_SIGCHILD signal (SIGCHLD, sig_handler); @@ -514,7 +514,7 @@ PHP_FUNCTION(shell_exec) } if (PG(safe_mode)) { - php_error(E_WARNING, "%s(): Cannot execute using backquotes in Safe Mode", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot execute using backquotes in Safe Mode"); RETURN_FALSE; } @@ -524,7 +524,7 @@ PHP_FUNCTION(shell_exec) #else if ((in=VCWD_POPEN(Z_STRVAL_PP(cmd), "r"))==NULL) { #endif - php_error(E_WARNING, "%s(): Unable to execute '%s'", get_active_function_name(TSRMLS_C), Z_STRVAL_PP(cmd)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to execute '%s'", Z_STRVAL_PP(cmd)); RETURN_FALSE; } allocated_space = EXEC_INPUT_BUF; @@ -706,8 +706,7 @@ PHP_FUNCTION(proc_open) zend_hash_get_current_key_ex(Z_ARRVAL_P(descriptorspec), &str_index, NULL, &nindex, 0, &pos); if (str_index) { - zend_error(E_WARNING, "%s(): descriptor spec must be an integer indexed array", - get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "descriptor spec must be an integer indexed array"); goto exit_fail; } @@ -727,31 +726,27 @@ PHP_FUNCTION(proc_open) #ifdef PHP_WIN32 descriptors[ndesc].childend = dup_fd_as_handle(fd); if (descriptors[ndesc].childend == NULL) { - zend_error(E_WARNING, "%s(): unable to dup File-Handle for descriptor %d", - get_active_function_name(TSRMLS_C), nindex); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to dup File-Handle for descriptor %d", nindex); goto exit_fail; } #else descriptors[ndesc].childend = dup(fd); if (descriptors[ndesc].childend < 0) { - zend_error(E_WARNING, "%s(): unable to dup File-Handle for descriptor %d - %s", - get_active_function_name(TSRMLS_C), nindex, strerror(errno)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to dup File-Handle for descriptor %d - %s", nindex, strerror(errno)); goto exit_fail; } #endif descriptors[ndesc].mode = DESC_FILE; } else if (Z_TYPE_PP(descitem) != IS_ARRAY) { - php_error(E_WARNING, "%s(): Descriptor item must be either an array or a File-Handle", - get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Descriptor item must be either an array or a File-Handle"); goto exit_fail; } else { if (zend_hash_index_find(Z_ARRVAL_PP(descitem), 0, (void **)&ztype) == SUCCESS) { convert_to_string_ex(ztype); } else { - php_error (E_WARNING, "%s(): Missing handle qualifier in array", - get_active_function_name(TSRMLS_C), Z_STRVAL_PP(ztype)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Missing handle qualifier in array", Z_STRVAL_PP(ztype)); goto exit_fail; } @@ -762,16 +757,14 @@ PHP_FUNCTION(proc_open) if (zend_hash_index_find(Z_ARRVAL_PP(descitem), 1, (void **)&zmode) == SUCCESS) { convert_to_string_ex(zmode); } else { - php_error (E_WARNING, "%s(): Missing mode parameter for 'pipe'", - get_active_function_name(TSRMLS_C), Z_STRVAL_PP(ztype)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Missing mode parameter for 'pipe'", Z_STRVAL_PP(ztype)); goto exit_fail; } descriptors[ndesc].mode = DESC_PIPE; if (0 != pipe(newpipe)) { - zend_error(E_WARNING, "%s(): unable to create pipe %s", - get_active_function_name(TSRMLS_C), strerror(errno)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to create pipe %s", strerror(errno)); goto exit_fail; } @@ -806,16 +799,14 @@ PHP_FUNCTION(proc_open) if (zend_hash_index_find(Z_ARRVAL_PP(descitem), 1, (void **)&zfile) == SUCCESS) { convert_to_string_ex(zfile); } else { - php_error (E_WARNING, "%s(): Missing file name parameter for 'file'", - get_active_function_name(TSRMLS_C), Z_STRVAL_PP(ztype)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Missing file name parameter for 'file'", Z_STRVAL_PP(ztype)); goto exit_fail; } if (zend_hash_index_find(Z_ARRVAL_PP(descitem), 2, (void **)&zmode) == SUCCESS) { convert_to_string_ex(zmode); } else { - php_error (E_WARNING, "%s(): Missing mode parameter for 'file'", - get_active_function_name(TSRMLS_C), Z_STRVAL_PP(ztype)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Missing mode parameter for 'file'", Z_STRVAL_PP(ztype)); goto exit_fail; } @@ -840,8 +831,7 @@ PHP_FUNCTION(proc_open) #endif } else { - zend_error(E_WARNING, "%s(): %s is not a valid descriptor spec/mode", - get_active_function_name(TSRMLS_C), Z_STRVAL_PP(ztype)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s is not a valid descriptor spec/mode", Z_STRVAL_PP(ztype)); goto exit_fail; } } @@ -884,7 +874,7 @@ PHP_FUNCTION(proc_open) efree(command_with_cmd); if (FALSE == newprocok) { - zend_error(E_WARNING, "%s(): CreateProcess failed", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "CreateProcess failed"); goto exit_fail; } @@ -926,10 +916,7 @@ PHP_FUNCTION(proc_open) close(descriptors[i].parentend); } - zend_error(E_WARNING, "%s(): fork failed - %s", - get_active_function_name(TSRMLS_C), - strerror(errno) - ); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "fork failed - %s", strerror(errno)); goto exit_fail; diff --git a/ext/standard/file.c b/ext/standard/file.c index bd0202f018..aac3f396e5 100644 --- a/ext/standard/file.c +++ b/ext/standard/file.c @@ -218,7 +218,7 @@ PHP_FUNCTION(flock) act = Z_LVAL_PP(arg2) & 3; if (act < 1 || act > 3) { - php_error(E_WARNING, "%s(): Illegal operation argument", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Illegal operation argument"); RETURN_FALSE; } @@ -616,7 +616,7 @@ static void user_space_stream_notifier(php_stream_context *context, int notifyco ZVAL_LONG(ps[5], bytes_max); if (FAILURE == call_user_function_ex(EG(function_table), NULL, callback, &retval, 6, ptps, 0, NULL TSRMLS_CC)) { - zend_error(E_WARNING, "failed to call user notifier"); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed to call user notifier"); } if (retval) zval_ptr_dtor(&retval); @@ -731,8 +731,7 @@ PHP_FUNCTION(stream_context_set_option) &optionname, &optionlen, &zvalue) == FAILURE) { if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "ra", &zcontext, &options) == FAILURE) { - zend_error(E_WARNING, "%s() called with wrong number or type of parameters; please RTM", - get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "called with wrong number or type of parameters; please RTM"); RETURN_FALSE; } } @@ -931,13 +930,13 @@ PHP_FUNCTION(popen) efree(tmp); if (!fp) { - php_error(E_WARNING, "%s(\"%s\", \"%s\") - %s", get_active_function_name(TSRMLS_C), buf, p, strerror(errno)); + php_error_docref2(NULL TSRMLS_CC, buf, p, E_WARNING, "%s", strerror(errno)); RETURN_FALSE; } } else { fp = VCWD_POPEN(Z_STRVAL_PP(arg1), p); if (!fp) { - php_error(E_WARNING, "%s(\"%s\", \"%s\") - %s", get_active_function_name(TSRMLS_C), Z_STRVAL_PP(arg1), p, strerror(errno)); + php_error_docref2(NULL TSRMLS_CC, Z_STRVAL_PP(arg1), p, E_WARNING, "%s", strerror(errno)); efree(p); RETURN_FALSE; } @@ -945,7 +944,7 @@ PHP_FUNCTION(popen) stream = php_stream_fopen_from_pipe(fp, p); if (stream == NULL) { - zend_error(E_WARNING, "popen(\"%s\", \"%s\"): %s", Z_STRVAL_PP(arg1), p, strerror(errno)); + php_error_docref2(NULL TSRMLS_CC, Z_STRVAL_PP(arg1), p, E_WARNING, "%s", strerror(errno)); RETVAL_FALSE; } else { php_stream_to_zval(stream, return_value); @@ -1028,7 +1027,7 @@ PHP_FUNCTION(socket_set_blocking) Set blocking/non-blocking mode on a socket */ PHP_FUNCTION(set_socket_blocking) { - php_error(E_NOTICE, "%s(): This function is deprecated, use socket_set_blocking() instead", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_NOTICE, "This function is deprecated, use socket_set_blocking() instead"); PHP_FN(socket_set_blocking)(INTERNAL_FUNCTION_PARAM_PASSTHRU); } /* }}} */ @@ -1131,7 +1130,7 @@ PHPAPI PHP_FUNCTION(fgets) } if (len < 0) { - php_error(E_WARNING, "%s(): Length parameter may not be negative", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length parameter may not be negative"); RETURN_FALSE; } @@ -1230,7 +1229,7 @@ PHPAPI PHP_FUNCTION(fgetss) convert_to_long_ex(bytes); len = Z_LVAL_PP(bytes); if (len < 0) { - php_error(E_WARNING, "%s(): Length parameter may not be negative", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length parameter may not be negative"); RETURN_FALSE; } @@ -1513,7 +1512,7 @@ PHP_FUNCTION(mkdir) ret = VCWD_MKDIR(dir, (mode_t)mode); if (ret < 0) { - php_error(E_WARNING, "%s(): %s", get_active_function_name(TSRMLS_C), strerror(errno)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", strerror(errno)); RETURN_FALSE; } RETURN_TRUE; @@ -1543,7 +1542,7 @@ PHP_FUNCTION(rmdir) ret = VCWD_RMDIR(Z_STRVAL_PP(arg1)); if (ret < 0) { - php_error(E_WARNING, "%s(): %s", get_active_function_name(TSRMLS_C), strerror(errno)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", strerror(errno)); RETURN_FALSE; } @@ -1670,7 +1669,7 @@ PHP_FUNCTION(rename) ret = VCWD_RENAME(old_name, new_name); if (ret == -1) { - php_error(E_WARNING, "%s(): %s", get_active_function_name(TSRMLS_C), strerror(errno)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", strerror(errno)); RETURN_FALSE; } @@ -1700,7 +1699,7 @@ PHP_FUNCTION(unlink) ret = VCWD_UNLINK(Z_STRVAL_PP(filename)); if (ret == -1) { - php_error(E_WARNING, "%s(): %s", get_active_function_name(TSRMLS_C), strerror(errno)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", strerror(errno)); RETURN_FALSE; } /* Clear stat cache */ @@ -1729,7 +1728,7 @@ PHP_NAMED_FUNCTION(php_if_ftruncate) convert_to_long_ex(size); if (php_stream_is((php_stream*)what, PHP_STREAM_IS_SOCKET)) { - php_error(E_WARNING, "%s(): Can't truncate sockets!", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can't truncate sockets!"); RETURN_FALSE; } if (SUCCESS == php_stream_cast((php_stream*)what, PHP_STREAM_AS_FD, (void*)&fd, 1)) { @@ -1898,7 +1897,7 @@ PHPAPI PHP_FUNCTION(fread) convert_to_long_ex(arg2); len = Z_LVAL_PP(arg2); if (len < 0) { - php_error(E_WARNING, "%s(): Length parameter may not be negative", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length parameter may not be negative"); RETURN_FALSE; } @@ -1945,8 +1944,7 @@ PHP_FUNCTION(fgetcsv) convert_to_string_ex(p_delim); /* Make sure that there is at least one character in string */ if (Z_STRLEN_PP(p_delim) < 1) { - php_error(E_WARNING, "%s(): Third parameter must be a character", - get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Third parameter must be a character"); return; } /* use first character from string */ @@ -1960,8 +1958,7 @@ PHP_FUNCTION(fgetcsv) convert_to_string_ex(p_delim); /* Make sure that there is at least one character in string */ if (Z_STRLEN_PP(p_delim) < 1) { - php_error(E_WARNING, "%s(): Third parameter must be a character", - get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Third parameter must be a character"); return; } /* use first character from string */ @@ -1985,7 +1982,7 @@ PHP_FUNCTION(fgetcsv) convert_to_long_ex(bytes); len = Z_LVAL_PP(bytes); if (len < 0) { - php_error(E_WARNING, "%s(): Length parameter may not be negative", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length parameter may not be negative"); RETURN_FALSE; } diff --git a/ext/standard/filestat.c b/ext/standard/filestat.c index 07684d5320..119773553f 100644 --- a/ext/standard/filestat.c +++ b/ext/standard/filestat.c @@ -198,7 +198,7 @@ PHP_FUNCTION(disk_total_space) } } else { - php_error(E_WARNING, "%s(): Unable to load kernel32.dll", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to load kernel32.dll"); RETURN_FALSE; } @@ -301,7 +301,7 @@ PHP_FUNCTION(disk_free_space) } } else { - php_error(E_WARNING, "%s(): Unable to load kernel32.dll", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to load kernel32.dll"); RETURN_FALSE; } @@ -348,7 +348,7 @@ PHP_FUNCTION(chgrp) if (Z_TYPE_PP(group) == IS_STRING) { gr = getgrnam(Z_STRVAL_PP(group)); if (!gr) { - php_error(E_WARNING, "%s(): Unable to find gid for %s", get_active_function_name(TSRMLS_C), + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find gid for %s", Z_STRVAL_PP(group)); RETURN_FALSE; } @@ -369,7 +369,7 @@ PHP_FUNCTION(chgrp) ret = VCWD_CHOWN(Z_STRVAL_PP(filename), -1, gid); if (ret == -1) { - php_error(E_WARNING, "%s(): %s", get_active_function_name(TSRMLS_C), strerror(errno)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", strerror(errno)); RETURN_FALSE; } RETURN_TRUE; @@ -396,7 +396,7 @@ PHP_FUNCTION(chown) if (Z_TYPE_PP(user) == IS_STRING) { pw = getpwnam(Z_STRVAL_PP(user)); if (!pw) { - php_error(E_WARNING, "%s(): Unable to find uid for %s", get_active_function_name(TSRMLS_C), + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find uid for %s", Z_STRVAL_PP(user)); RETURN_FALSE; } @@ -417,7 +417,7 @@ PHP_FUNCTION(chown) ret = VCWD_CHOWN(Z_STRVAL_PP(filename), uid, -1); if (ret == -1) { - php_error(E_WARNING, "%s(): %s", get_active_function_name(TSRMLS_C), strerror(errno)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", strerror(errno)); RETURN_FALSE; } #endif @@ -458,7 +458,7 @@ PHP_FUNCTION(chmod) ret = VCWD_CHMOD(Z_STRVAL_PP(filename), imode); if (ret == -1) { - php_error(E_WARNING, "%s(): %s", get_active_function_name(TSRMLS_C), strerror(errno)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", strerror(errno)); RETURN_FALSE; } RETURN_TRUE; @@ -510,7 +510,7 @@ PHP_FUNCTION(touch) if (ret == -1) { file = VCWD_FOPEN(Z_STRVAL_PP(filename), "w"); if (file == NULL) { - php_error(E_WARNING, "%s(): Unable to create file %s because %s", get_active_function_name(TSRMLS_C), Z_STRVAL_PP(filename), strerror(errno)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to create file %s because %s", Z_STRVAL_PP(filename), strerror(errno)); RETURN_FALSE; } fclose(file); @@ -518,7 +518,7 @@ PHP_FUNCTION(touch) ret = VCWD_UTIME(Z_STRVAL_PP(filename), newtime); if (ret == -1) { - php_error(E_WARNING, "%s(): Utime failed: %s", get_active_function_name(TSRMLS_C), strerror(errno)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Utime failed: %s", strerror(errno)); RETURN_FALSE; } RETURN_TRUE; @@ -589,7 +589,7 @@ static void php_stat(const char *filename, php_stat_len filename_length, int typ #endif if (VCWD_STAT(BG(CurrentStatFile), &BG(sb)) == -1) { if (!IS_LINK_OPERATION(type) && (!IS_EXISTS_CHECK(type) || errno != ENOENT)) { /* fileexists() test must print no error */ - php_error(E_WARNING, "%s(): Stat failed for %s (errno=%d - %s)", get_active_function_name(TSRMLS_C), BG(CurrentStatFile), errno, strerror(errno)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Stat failed for %s (errno=%d - %s)", BG(CurrentStatFile), errno, strerror(errno)); } efree(BG(CurrentStatFile)); BG(CurrentStatFile) = NULL; @@ -604,7 +604,7 @@ static void php_stat(const char *filename, php_stat_len filename_length, int typ /* do lstat if the buffer is empty */ if (VCWD_LSTAT(filename, &BG(lsb)) == -1) { if (!IS_EXISTS_CHECK(type) || errno != ENOENT) { /* fileexists() test must print no error */ - php_error(E_WARNING, "%s(): Lstat failed for %s (errno=%d - %s)", get_active_function_name(TSRMLS_C), BG(CurrentStatFile), errno, strerror(errno)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Lstat failed for %s (errno=%d - %s)", BG(CurrentStatFile), errno, strerror(errno)); } RETURN_FALSE; } @@ -675,7 +675,7 @@ static void php_stat(const char *filename, php_stat_len filename_length, int typ case S_IFSOCK: RETURN_STRING("socket", 1); #endif } - php_error(E_WARNING, "%s(): Unknown file type (%d)", get_active_function_name(TSRMLS_C), BG(sb).st_mode&S_IFMT); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown file type (%d)", BG(sb).st_mode&S_IFMT); RETURN_STRING("unknown", 1); case FS_IS_W: if (getuid()==0) { @@ -772,7 +772,7 @@ static void php_stat(const char *filename, php_stat_len filename_length, int typ return; } - php_error(E_WARNING, "%s(): Didn't understand stat call", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Didn't understand stat call"); RETURN_FALSE; } /* }}} */ diff --git a/ext/standard/formatted_print.c b/ext/standard/formatted_print.c index 4657ce86e1..2bc7dbf87b 100644 --- a/ext/standard/formatted_print.c +++ b/ext/standard/formatted_print.c @@ -144,7 +144,7 @@ php_sprintf_appendchar(char **buffer, int *pos, int *size, char add TSRMLS_DC) { if ((*pos + 1) >= *size) { *size <<= 1; - PRINTF_DEBUG(("%s: ereallocing buffer to %d bytes\n", get_active_function_name(TSRMLS_C), *size)); + PRINTF_DEBUG(("%s(): ereallocing buffer to %d bytes\n", get_active_function_name(TSRMLS_C), *size)); *buffer = erealloc(*buffer, *size); } PRINTF_DEBUG(("sprintf: appending '%c', pos=\n", add, *pos)); @@ -475,7 +475,7 @@ php_formatted_print(int ht, int *len, int use_array TSRMLS_DC) if (currarg >= argc && format[inpos + 1] != '%') { efree(result); efree(args); - php_error(E_WARNING, "%s(): Too few arguments", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Too few arguments"); return NULL; } /* starting a new format specifier, reset variables */ @@ -496,7 +496,7 @@ php_formatted_print(int ht, int *len, int use_array TSRMLS_DC) if (argnum == 0) { efree(result); efree(args); - php_error(E_WARNING, "%s(): Zero is not a valid argument number", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Zero is not a valid argument number"); return NULL; } @@ -507,7 +507,7 @@ php_formatted_print(int ht, int *len, int use_array TSRMLS_DC) if (argnum >= argc) { efree(result); efree(args); - php_error(E_WARNING, "%s(): Too few arguments", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Too few arguments"); return NULL; } diff --git a/ext/standard/fsock.c b/ext/standard/fsock.c index e1fb23e30c..b12a533ec3 100644 --- a/ext/standard/fsock.c +++ b/ext/standard/fsock.c @@ -190,7 +190,7 @@ static void php_fsockopen_stream(INTERNAL_FUNCTION_PARAMETERS, int persistent) } #if !HAVE_OPENSSL_EXT if (ssl_flags != php_ssl_none) { - zend_error(E_WARNING, "%s(): no SSL support in this build", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "no SSL support in this build"); } else #endif @@ -202,8 +202,7 @@ static void php_fsockopen_stream(INTERNAL_FUNCTION_PARAMETERS, int persistent) #endif if (stream == NULL) { - zend_error(E_WARNING, "%s(): unable to connect to %s:%d", - get_active_function_name(TSRMLS_C), host, port); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to connect to %s:%d", host, port); } #if HAVE_OPENSSL_EXT @@ -221,7 +220,7 @@ static void php_fsockopen_stream(INTERNAL_FUNCTION_PARAMETERS, int persistent) break; } if (ssl_ret == FAILURE) - zend_error(E_WARNING, "%s(): failed to activate SSL mode %d", get_active_function_name(TSRMLS_C), ssl_flags); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed to activate SSL mode %d", ssl_flags); } #endif diff --git a/ext/standard/ftok.c b/ext/standard/ftok.c index a472bc3248..67a257a87a 100644 --- a/ext/standard/ftok.c +++ b/ext/standard/ftok.c @@ -41,12 +41,12 @@ PHP_FUNCTION(ftok) convert_to_string_ex(proj); if (Z_STRLEN_PP(pathname)==0){ - php_error(E_WARNING, "%s(): First argument invalid", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "First argument invalid"); RETURN_LONG(-1); } if (Z_STRLEN_PP(proj)!=1){ - php_error(E_WARNING, "%s(): Second argument invalid", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Second argument invalid"); RETURN_LONG(-1); } diff --git a/ext/standard/head.c b/ext/standard/head.c index 10d33728f4..8845d8c86f 100644 --- a/ext/standard/head.c +++ b/ext/standard/head.c @@ -161,8 +161,7 @@ PHP_FUNCTION(setcookie) PHP_FUNCTION(headers_sent) { if (ZEND_NUM_ARGS() != 0) { - php_error(E_WARNING, "%s(): No parameters expected, %d given", - get_active_function_name(TSRMLS_C), ZEND_NUM_ARGS()); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "No parameters expected, %d given", ZEND_NUM_ARGS()); return; } diff --git a/ext/standard/image.c b/ext/standard/image.c index 80815e79d0..352c4e69f5 100644 --- a/ext/standard/image.c +++ b/ext/standard/image.c @@ -805,7 +805,7 @@ PHPAPI int php_getimagetype(php_stream * stream, char *filetype TSRMLS_DC) if ( !filetype) filetype = tmp; if((php_stream_read(stream, filetype, 3)) <= 0) { - php_error(E_WARNING, "%s(): Read error!", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Read error!"); return IMAGE_FILETYPE_UNKNOWN; } @@ -818,7 +818,7 @@ PHPAPI int php_getimagetype(php_stream * stream, char *filetype TSRMLS_DC) if (!memcmp(filetype, php_sig_png, 8)) { return IMAGE_FILETYPE_PNG; } else { - php_error(E_WARNING, "%s(): PNG file corrupted by ASCII conversion", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "PNG file corrupted by ASCII conversion"); return IMAGE_FILETYPE_UNKNOWN; } } else if (!memcmp(filetype, php_sig_swf, 3)) { @@ -939,7 +939,7 @@ PHP_FUNCTION(getimagesize) if (result) { if (array_init(return_value) == FAILURE) { - php_error(E_ERROR, "%s(): Unable to initialize array", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_ERROR, "Unable to initialize array"); efree(result); return; } diff --git a/ext/standard/info.c b/ext/standard/info.c index 814e8893f7..b9134861e6 100644 --- a/ext/standard/info.c +++ b/ext/standard/info.c @@ -38,6 +38,11 @@ #include <sys/utsname.h> #endif +#if HAVE_MBSTRING +#include "ext/mbstring/mbstring.h" +ZEND_EXTERN_MODULE_GLOBALS(mbstring) +#endif + #if HAVE_ICONV #include "ext/iconv/php_iconv.h" ZEND_EXTERN_MODULE_GLOBALS(iconv) @@ -225,6 +230,15 @@ PHPAPI void php_print_info(int flag TSRMLS_DC) if (SG(default_charset)) { charset = SG(default_charset); } +#if HAVE_MBSTRING + if (php_ob_handler_used("mb_output_handler" TSRMLS_CC)) { + if (MBSTRG(current_http_output_encoding) == mbfl_no_encoding_pass) { + charset = "US-ASCII"; + } else { + charset = mbfl_no2preferred_mime_name(MBSTRG(current_http_output_encoding)); + } + } +#endif #if HAVE_ICONV if (php_ob_handler_used("ob_iconv_handler" TSRMLS_CC)) { charset = ICONVG(output_encoding); diff --git a/ext/standard/iptc.c b/ext/standard/iptc.c index a29573be72..d42bcd489e 100644 --- a/ext/standard/iptc.c +++ b/ext/standard/iptc.c @@ -213,7 +213,7 @@ PHP_FUNCTION(iptcembed) } if ((fp = VCWD_FOPEN(Z_STRVAL_PP(jpeg_file), "rb")) == 0) { - php_error(E_WARNING, "%s(): Unable to open %s", get_active_function_name(TSRMLS_C), Z_STRVAL_PP(jpeg_file)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to open %s", Z_STRVAL_PP(jpeg_file)); RETURN_FALSE; } @@ -354,7 +354,7 @@ PHP_FUNCTION(iptcparse) if (tagsfound == 0) { /* found the 1st tag - initialize the return array */ if (array_init(return_value) == FAILURE) { - php_error(E_ERROR, "%s(): Unable to initialize array", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_ERROR, "Unable to initialize array"); RETURN_FALSE; } } @@ -363,7 +363,7 @@ PHP_FUNCTION(iptcparse) ALLOC_ZVAL(values); INIT_PZVAL(values); if (array_init(values) == FAILURE) { - php_error(E_ERROR, "%s(): Unable to initialize array", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_ERROR, "Unable to initialize array"); RETURN_FALSE; } diff --git a/ext/standard/levenshtein.c b/ext/standard/levenshtein.c index eeedd4359a..fbf2814036 100644 --- a/ext/standard/levenshtein.c +++ b/ext/standard/levenshtein.c @@ -138,7 +138,7 @@ PHP_FUNCTION(levenshtein) } if(distance<0) { - php_error(E_WARNING, "%s(): Argument string(s) too long", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Argument string(s) too long"); } RETURN_LONG(distance); diff --git a/ext/standard/mail.c b/ext/standard/mail.c index 1fcad1c3e0..6da774523d 100644 --- a/ext/standard/mail.c +++ b/ext/standard/mail.c @@ -73,7 +73,7 @@ PHP_FUNCTION(mail) int to_len,message_len,headers_len,subject_len,extra_cmd_len,i; if (PG(safe_mode) && (ZEND_NUM_ARGS() == 5)) { - php_error(E_WARNING, "%s(): SAFE MODE Restriction in effect. The fifth parameter is disabled in SAFE MODE.", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "SAFE MODE Restriction in effect. The fifth parameter is disabled in SAFE MODE."); RETURN_FALSE; } @@ -136,10 +136,10 @@ PHPAPI int php_mail(char *to, char *subject, char *message, char *headers, char /* handle old style win smtp sending */ if (TSendMail(INI_STR("SMTP"), &tsm_err, &tsm_errmsg, headers, subject, to, message, NULL, NULL, NULL) == FAILURE) { if (tsm_errmsg) { - php_error(E_WARNING, "%s(): %s", get_active_function_name(TSRMLS_C), tsm_errmsg); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", tsm_errmsg); efree(tsm_errmsg); } else { - php_error(E_WARNING, "%s(): %s", get_active_function_name(TSRMLS_C), GetSMErrorText(tsm_err)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", GetSMErrorText(tsm_err)); } return 0; } @@ -172,8 +172,7 @@ PHPAPI int php_mail(char *to, char *subject, char *message, char *headers, char if (sendmail) { #ifndef PHP_WIN32 if (EACCES == errno) { - php_error(E_WARNING, "%s(): Permission denied; unable to execute shell to run mail delivery binary", - get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Permission denied; unable to execute shell to run mail delivery binary"); pclose(sendmail); return 0; } @@ -200,8 +199,7 @@ PHPAPI int php_mail(char *to, char *subject, char *message, char *headers, char return 1; } } else { - php_error(E_WARNING, "%s(): Could not execute mail delivery program", - get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not execute mail delivery program"); return 0; } diff --git a/ext/standard/math.c b/ext/standard/math.c index f6bf528dab..5b6c10962f 100644 --- a/ext/standard/math.c +++ b/ext/standard/math.c @@ -772,8 +772,7 @@ _php_math_zvaltobase(zval *arg, int base TSRMLS_DC) /* Don't try to convert +/- infinity */ if (fvalue == HUGE_VAL || fvalue == -HUGE_VAL) { - php_error(E_WARNING, "Number too large in %s() call", - get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Number too large"); return empty_string; } diff --git a/ext/standard/md5.c b/ext/standard/md5.c index 775daf3f27..7e7d3442c7 100644 --- a/ext/standard/md5.c +++ b/ext/standard/md5.c @@ -90,7 +90,7 @@ PHP_NAMED_FUNCTION(php_if_md5_file) } if ((fp = VCWD_FOPEN(Z_STRVAL_PP(arg), "rb")) == NULL) { - php_error(E_WARNING, "%s(): Unable to open file", get_active_function_name (TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to open file"); RETURN_FALSE; } diff --git a/ext/standard/scanf.c b/ext/standard/scanf.c index 3f5a11bc2b..137a16ce14 100644 --- a/ext/standard/scanf.c +++ b/ext/standard/scanf.c @@ -408,8 +408,7 @@ PHPAPI int ValidateFormat(char *format, int numVars, int *totalSubs) gotSequential = 1; if (gotXpg) { mixedXPG: - php_error(E_WARNING, - "cannot mix \"%\" and \"%n$\" conversion specifiers in %s", get_active_function_name(TSRMLS_C) ); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot mix \"%\" and \"%n$\" conversion specifiers"); goto error; } @@ -642,8 +641,7 @@ PHPAPI int php_sscanf_internal( char *string, char *format, if (numVars) { for (i = varStart;i < argCount;i++){ if ( ! PZVAL_IS_REF( *args[ i ] ) ) { - php_error(E_WARNING, "Parameter %d to %s() must be passed by reference", - i, get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Parameter %d must be passed by reference", i); scan_set_error_return(numVars, return_value); return SCAN_ERROR_VAR_PASSED_BYVAL; } diff --git a/ext/standard/sha1.c b/ext/standard/sha1.c index 6ae6ef40f5..fdf3e5c737 100644 --- a/ext/standard/sha1.c +++ b/ext/standard/sha1.c @@ -88,7 +88,7 @@ PHP_FUNCTION(sha1_file) } if ((fp = VCWD_FOPEN(Z_STRVAL_PP(arg), "rb")) == NULL) { - php_error(E_WARNING, "%s(): Unable to open file", get_active_function_name (TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to open file"); RETURN_FALSE; } diff --git a/ext/standard/string.c b/ext/standard/string.c index 7da32a9ec3..624706e6e3 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -466,22 +466,22 @@ static inline int php_charmask(unsigned char *input, int len, char *mask TSRMLS_ /* Error, try to be as helpful as possible: (a range ending/starting with '.' won't be captured here) */ if (end-len>=input) { /* there was no 'left' char */ - php_error(E_WARNING, "Invalid '..'-range passed to %s(), no character to the left of '..'", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid '..'-range, no character to the left of '..'"); result = FAILURE; continue; } if (input+2>=end) { /* there is no 'right' char */ - php_error(E_WARNING, "Invalid '..'-range passed to %s(), no character to the right of '..'", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid '..'-range, no character to the right of '..'"); result = FAILURE; continue; } if (input[-1] > input[2]) { /* wrong order */ - php_error(E_WARNING, "Invalid '..'-range passed to %s(), '..'-range needs to be incrementing", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid '..'-range, '..'-range needs to be incrementing"); result = FAILURE; continue; } /* FIXME: better error (a..b..c is the only left possibility?) */ - php_error(E_WARNING, "Invalid '..'-range passed to %s()", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid '..'-range"); result = FAILURE; continue; } else { @@ -607,7 +607,7 @@ PHP_FUNCTION(wordwrap) RETURN_FALSE; if (linelength == 0 && docut) { - php_error(E_WARNING, "%s() can't force cut when width is zero",get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "can't force cut when width is zero"); RETURN_FALSE; } @@ -843,8 +843,7 @@ PHP_FUNCTION(implode) convert_to_string_ex(arg1); delim = *arg1; } else { - php_error(E_WARNING, "Bad arguments to %s()", - get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad arguments"); return; } @@ -3480,8 +3479,7 @@ PHP_FUNCTION(str_repeat) convert_to_long_ex(mult); if (Z_LVAL_PP(mult) < 0) { - php_error(E_WARNING, "Second argument to %s() has to be greater than or equal to 0", - get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Second argument has to be greater than or equal to 0"); return; } @@ -3798,8 +3796,7 @@ PHP_FUNCTION(str_pad) if (ZEND_NUM_ARGS() > 2) { convert_to_string_ex(pad_string); if (Z_STRLEN_PP(pad_string) == 0) { - php_error(E_WARNING, "Padding string cannot be empty in %s()", - get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Padding string cannot be empty"); return; } pad_str_val = Z_STRVAL_PP(pad_string); @@ -3809,7 +3806,7 @@ PHP_FUNCTION(str_pad) convert_to_long_ex(pad_type); pad_type_val = Z_LVAL_PP(pad_type); if (pad_type_val < STR_PAD_LEFT || pad_type_val > STR_PAD_BOTH) { - php_error(E_WARNING, "Padding type has to be STR_PAD_LEFT, STR_PAD_RIGHT, or STR_PAD_BOTH in %s()", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Padding type has to be STR_PAD_LEFT, STR_PAD_RIGHT, or STR_PAD_BOTH"); return; } } diff --git a/ext/standard/syslog.c b/ext/standard/syslog.c index c62f65c631..256a5565af 100644 --- a/ext/standard/syslog.c +++ b/ext/standard/syslog.c @@ -192,8 +192,7 @@ static void start_syslog(TSRMLS_D) PHP_FUNCTION(define_syslog_variables) { if (ZEND_NUM_ARGS() != 0) { - php_error(E_WARNING, "%s() expects no parameters, %d given", - get_active_function_name(TSRMLS_C), ZEND_NUM_ARGS()); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "expects no parameters, %d given", ZEND_NUM_ARGS()); return; } @@ -234,8 +233,7 @@ PHP_FUNCTION(openlog) PHP_FUNCTION(closelog) { if (ZEND_NUM_ARGS() != 0) { - php_error(E_WARNING, "%s() expects no parameters, %d given", - get_active_function_name(TSRMLS_C), ZEND_NUM_ARGS()); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "expects no parameters, %d given", ZEND_NUM_ARGS()); return; } diff --git a/ext/standard/type.c b/ext/standard/type.c index f42c46ade9..5114bb3751 100644 --- a/ext/standard/type.c +++ b/ext/standard/type.c @@ -116,10 +116,10 @@ PHP_FUNCTION(settype) } else if (!strcasecmp(new_type, "null")) { convert_to_null(*var); } else if (!strcasecmp(new_type, "resource")) { - php_error(E_WARNING, "%s(): Cannot convert to resource type", get_active_function_name (TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot convert to resource type"); RETURN_FALSE; } else { - php_error(E_WARNING, "%s(): Invalid type", get_active_function_name (TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid type"); RETURN_FALSE; } RETVAL_TRUE; @@ -196,7 +196,7 @@ static void php_is_type(INTERNAL_FUNCTION_PARAMETERS, int type) pval **arg; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg) == FAILURE) { - php_error(E_WARNING, "%s(): Only one argument expected", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Only one argument expected"); RETURN_FALSE; } |