mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Changed php_error to php_error_docref.
Thanks to Marcus Börger for writing a script that significantly simplifies this process.
This commit is contained in:
parent
b2ecf47755
commit
aebb39b014
11 changed files with 181 additions and 283 deletions
|
@ -400,8 +400,7 @@ static size_t curl_write(char *data, size_t size, size_t nmemb, void *ctx)
|
|||
t->func,
|
||||
retval, 2, argv TSRMLS_CC);
|
||||
if (error == FAILURE) {
|
||||
php_error(E_WARNING, "%s(): Couldn't call the CURLOPT_WRITEFUNCTION",
|
||||
get_active_function_name(TSRMLS_C));
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't call the CURLOPT_WRITEFUNCTION");
|
||||
length = -1;
|
||||
}
|
||||
else {
|
||||
|
@ -455,8 +454,7 @@ static size_t curl_read(char *data, size_t size, size_t nmemb, void *ctx)
|
|||
t->func,
|
||||
retval, 3, argv TSRMLS_CC);
|
||||
if (error == FAILURE) {
|
||||
php_error(E_WARNING, "%s(): Cannot call the CURLOPT_READFUNCTION",
|
||||
get_active_function_name(TSRMLS_C));
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot call the CURLOPT_READFUNCTION");
|
||||
length = -1;
|
||||
}
|
||||
else {
|
||||
|
@ -515,8 +513,7 @@ static size_t curl_write_header(char *data, size_t size, size_t nmemb, void *ctx
|
|||
t->func,
|
||||
retval, 2, argv TSRMLS_CC);
|
||||
if (error == FAILURE) {
|
||||
php_error(E_WARNING, "%s(): Couldn't call the CURLOPT_HEADERFUNCTION",
|
||||
get_active_function_name(TSRMLS_C));
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't call the CURLOPT_HEADERFUNCTION");
|
||||
length = -1;
|
||||
}
|
||||
else {
|
||||
|
@ -560,13 +557,12 @@ static size_t curl_passwd(void *ctx, char *prompt, char *buf, int buflen)
|
|||
func,
|
||||
retval, 2, argv TSRMLS_CC);
|
||||
if (error == FAILURE) {
|
||||
php_error(E_WARNING, "%s(): Couldn't call the CURLOPT_PASSWDFUNCTION", get_active_function_name(TSRMLS_C));
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't call the CURLOPT_PASSWDFUNCTION");
|
||||
ret = -1;
|
||||
}
|
||||
else {
|
||||
if (Z_STRLEN_P(retval) > buflen) {
|
||||
php_error(E_WARNING, "%s(): Returned password is too long for libcurl to handle",
|
||||
get_active_function_name(TSRMLS_C));
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Returned password is too long for libcurl to handle");
|
||||
ret = -1;
|
||||
}
|
||||
else {
|
||||
|
@ -687,7 +683,7 @@ PHP_FUNCTION(curl_init)
|
|||
|
||||
ch->cp = curl_easy_init();
|
||||
if (! ch->cp) {
|
||||
php_error(E_WARNING, "%s(): Cannot initialize a new cURL handle", get_active_function_name(TSRMLS_C));
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot initialize a new cURL handle");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
|
@ -924,9 +920,7 @@ PHP_FUNCTION(curl_setopt)
|
|||
|
||||
postfields = HASH_OF(*zvalue);
|
||||
if (! postfields) {
|
||||
php_error(E_WARNING,
|
||||
"%s(): Couldn't get HashTable in CURLOPT_POSTFIELDS",
|
||||
get_active_function_name(TSRMLS_C));
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't get HashTable in CURLOPT_POSTFIELDS");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
|
@ -988,9 +982,7 @@ PHP_FUNCTION(curl_setopt)
|
|||
|
||||
ph = HASH_OF(*zvalue);
|
||||
if (!ph) {
|
||||
php_error(E_WARNING,
|
||||
"%s(): You must pass either an object or an array with the CURLOPT_HTTPHEADER, "
|
||||
"CURLOPT_QUOTE and CURLOPT_POSTQUOTE arguments", get_active_function_name(TSRMLS_C));
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "You must pass either an object or an array with the CURLOPT_HTTPHEADER, CURLOPT_QUOTE and CURLOPT_POSTQUOTE arguments");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
|
@ -1006,8 +998,7 @@ PHP_FUNCTION(curl_setopt)
|
|||
slist = curl_slist_append(slist, indiv);
|
||||
if (! slist) {
|
||||
efree(indiv);
|
||||
php_error(E_WARNING, "%s(): Couldn't build curl_slist",
|
||||
get_active_function_name(TSRMLS_C));
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't build curl_slist");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
zend_llist_add_element(&ch->to_free.str, &indiv);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue