mirror of
https://github.com/php/php-src.git
synced 2024-11-24 02:15:04 +08:00
zend_error -> php_error_docref.
This commit is contained in:
parent
95bfbfe1c1
commit
38ad0e9104
@ -69,11 +69,11 @@ long _crack_open_dict(char *dictpath TSRMLS_DC)
|
||||
long resource;
|
||||
|
||||
if (CRACKG(current_id) != -1) {
|
||||
zend_error(E_WARNING, "Can not use more than one open dictionary with this implementation of libcrack");
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can not use more than one open dictionary with this implementation of libcrack");
|
||||
return -1;
|
||||
}
|
||||
if (NULL == (pwdict = PWOpen(dictpath, "r"))) {
|
||||
zend_error(E_WARNING, "Unable to open a crack dictionary");
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to open a crack dictionary");
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -256,7 +256,7 @@ ZEND_FUNCTION(crack_getlastmessage)
|
||||
}
|
||||
|
||||
if (NULL == CRACKG(last_message)) {
|
||||
zend_error(E_WARNING, "No obscure checks in this session");
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "No obscure checks in this session");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
|
@ -178,7 +178,7 @@ ZEND_MODULE_INFO_D(gmp)
|
||||
if(Z_TYPE_PP(zval) == IS_RESOURCE) { \
|
||||
ZEND_FETCH_RESOURCE(gmpnumber, mpz_t *, zval, -1, GMP_RESOURCE_NAME, le_gmp);\
|
||||
} else {\
|
||||
if(convert_to_gmp(&gmpnumber, zval, 0) == FAILURE) {\
|
||||
if(convert_to_gmp(&gmpnumber, zval, 0 TSRMLS_CC) == FAILURE) {\
|
||||
RETURN_FALSE;\
|
||||
}\
|
||||
ZEND_REGISTER_RESOURCE(NULL, gmpnumber, le_gmp);\
|
||||
@ -190,7 +190,7 @@ if(Z_TYPE_PP(zval) == IS_RESOURCE) { \
|
||||
|
||||
/* {{{ convert_to_gmp
|
||||
* Convert zval to be gmp number */
|
||||
static int convert_to_gmp(mpz_t * *gmpnumber, zval **val, int base)
|
||||
static int convert_to_gmp(mpz_t * *gmpnumber, zval **val, int base TSRMLS_DC)
|
||||
{
|
||||
int ret = 0;
|
||||
int skip_lead = 0;
|
||||
@ -224,7 +224,7 @@ static int convert_to_gmp(mpz_t * *gmpnumber, zval **val, int base)
|
||||
}
|
||||
break;
|
||||
default:
|
||||
zend_error(E_WARNING,"Unable to convert variable to GMP - wrong type");
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING,"Unable to convert variable to GMP - wrong type");
|
||||
efree(*gmpnumber);
|
||||
return FAILURE;
|
||||
}
|
||||
@ -469,12 +469,12 @@ ZEND_FUNCTION(gmp_init)
|
||||
convert_to_long_ex(base_arg);
|
||||
base = Z_LVAL_PP(base_arg);
|
||||
if(base < 2 || base > 36) {
|
||||
zend_error(E_WARNING, "Bad base for conversion: %d (should be between 2 and 36)", base);
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad base for conversion: %d (should be between 2 and 36)", base);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
if(convert_to_gmp(&gmpnumber, number_arg, base) == FAILURE) {
|
||||
if(convert_to_gmp(&gmpnumber, number_arg, base TSRMLS_CC) == FAILURE) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
@ -531,7 +531,7 @@ ZEND_FUNCTION(gmp_strval)
|
||||
}
|
||||
|
||||
if(base < 2 || base > 36) {
|
||||
zend_error(E_WARNING, "Bad base for conversion: %d", base);
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad base for conversion: %d", base);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
@ -760,7 +760,7 @@ ZEND_FUNCTION(gmp_pow)
|
||||
convert_to_long_ex(exp_arg);
|
||||
|
||||
if(Z_LVAL_PP(exp_arg) < 0) {
|
||||
zend_error(E_WARNING,"Negative exponent not supported");
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING,"Negative exponent not supported");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
|
@ -2083,8 +2083,7 @@ PHPAPI int php_array_merge(HashTable *dest, HashTable *src, int recursive TSRMLS
|
||||
zend_hash_find(dest, string_key, string_key_len,
|
||||
(void **)&dest_entry) == SUCCESS) {
|
||||
if (*src_entry == *dest_entry) {
|
||||
zend_error(E_WARNING, "%s(): recursion detected",
|
||||
get_active_function_name(TSRMLS_C));
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "recursion detected");
|
||||
return 0;
|
||||
}
|
||||
SEPARATE_ZVAL(dest_entry);
|
||||
|
@ -157,8 +157,8 @@ PHP_FUNCTION(assert)
|
||||
compiled_string_description = zend_make_compiled_string_description("assert code" TSRMLS_CC);
|
||||
if (zend_eval_string(myeval, &retval, compiled_string_description TSRMLS_CC) == FAILURE) {
|
||||
efree(compiled_string_description);
|
||||
zend_error(E_ERROR, "Failure evaluating code:\n%s", myeval);
|
||||
/* zend_error() does not return in this case. */
|
||||
php_error_docref(NULL TSRMLS_CC, E_ERROR, "Failure evaluating code:\n%s", myeval);
|
||||
/* php_error_docref() does not return in this case. */
|
||||
}
|
||||
efree(compiled_string_description);
|
||||
|
||||
|
@ -228,7 +228,7 @@ PHP_FUNCTION(get_browser)
|
||||
case 0:
|
||||
if (!PG(http_globals)[TRACK_VARS_SERVER]
|
||||
|| zend_hash_find(PG(http_globals)[TRACK_VARS_SERVER]->value.ht, "HTTP_USER_AGENT", sizeof("HTTP_USER_AGENT"), (void **) &agent_name)==FAILURE) {
|
||||
zend_error(E_WARNING, "HTTP_USER_AGENT variable is not set, cannot determine user agent name");
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "HTTP_USER_AGENT variable is not set, cannot determine user agent name");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
break;
|
||||
|
@ -703,7 +703,7 @@ PHPAPI char *php_unescape_html_entities(unsigned char *old, int oldlen, int *new
|
||||
|
||||
/* When we have MBCS entities in the tables above, this will need to handle it */
|
||||
if (k > 0xff) {
|
||||
zend_error(E_WARNING, "cannot yet handle MBCS in html_entity_decode()!");
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot yet handle MBCS!");
|
||||
}
|
||||
replacement[0] = k;
|
||||
replacement[1] = '\0';
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Generated by re2c 0.5 on Mon Aug 19 22:01:10 2002 */
|
||||
#line 1 "var_unserializer.re"
|
||||
/* Generated by re2c 0.5 on Fri Jan 24 11:25:29 2003 */
|
||||
#line 1 "/home/rei/PHP_CVS/php5/ext/standard/var_unserializer.re"
|
||||
#include "php.h"
|
||||
#include "ext/standard/php_var.h"
|
||||
#include "php_incomplete_class.h"
|
||||
@ -357,7 +357,7 @@ yy14:
|
||||
#line 404
|
||||
{
|
||||
/* this is the case where we have less data than planned */
|
||||
zend_error(E_NOTICE, "Unexpected end of serialized data");
|
||||
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Unexpected end of serialized data");
|
||||
return 0; /* not sure if it should be 0 or 1 here? */
|
||||
}
|
||||
yy15: yych = *++YYCURSOR;
|
||||
@ -419,12 +419,12 @@ yy22:
|
||||
ZVAL_STRING(arg_func_name, class_name, 1);
|
||||
|
||||
if (call_user_function_ex(CG(function_table), NULL, user_func, &retval_ptr, 1, args, 0, NULL TSRMLS_CC) != SUCCESS) {
|
||||
zend_error(E_WARNING, "'unserialize_callback_func' defined (%s) but not found", user_func->value.str.val);
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "defined (%s) but not found", user_func->value.str.val);
|
||||
incomplete_class = 1;
|
||||
ce = PHP_IC_ENTRY;
|
||||
} else {
|
||||
if (zend_hash_find(CG(class_table), class_name, len2 + 1, (void **) &ce) != SUCCESS) {
|
||||
zend_error(E_WARNING, "'unserialize_callback_func' (%s) hasn't defined the class it was called for", user_func->value.str.val);
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "(%s) hasn't defined the class it was called for", user_func->value.str.val);
|
||||
incomplete_class = 1;
|
||||
ce = PHP_IC_ENTRY;
|
||||
} else {
|
||||
|
@ -367,12 +367,12 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
|
||||
ZVAL_STRING(arg_func_name, class_name, 1);
|
||||
|
||||
if (call_user_function_ex(CG(function_table), NULL, user_func, &retval_ptr, 1, args, 0, NULL TSRMLS_CC) != SUCCESS) {
|
||||
zend_error(E_WARNING, "'unserialize_callback_func' defined (%s) but not found", user_func->value.str.val);
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "defined (%s) but not found", user_func->value.str.val);
|
||||
incomplete_class = 1;
|
||||
ce = PHP_IC_ENTRY;
|
||||
} else {
|
||||
if (zend_hash_find(CG(class_table), class_name, len2 + 1, (void **) &ce) != SUCCESS) {
|
||||
zend_error(E_WARNING, "'unserialize_callback_func' (%s) hasn't defined the class it was called for", user_func->value.str.val);
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "(%s) hasn't defined the class it was called for", user_func->value.str.val);
|
||||
incomplete_class = 1;
|
||||
ce = PHP_IC_ENTRY;
|
||||
} else {
|
||||
@ -403,7 +403,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
|
||||
|
||||
"}" {
|
||||
/* this is the case where we have less data than planned */
|
||||
zend_error(E_NOTICE, "Unexpected end of serialized data");
|
||||
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Unexpected end of serialized data");
|
||||
return 0; /* not sure if it should be 0 or 1 here? */
|
||||
}
|
||||
|
||||
|
@ -223,8 +223,7 @@ PHP_FUNCTION(msg_get_queue)
|
||||
/* doesn't already exist; create it */
|
||||
mq->id = msgget(key, IPC_CREAT|IPC_EXCL|perms);
|
||||
if (mq->id < 0) {
|
||||
zend_error(E_WARNING, "%s: msgget() failed for key 0x%x: %s",
|
||||
get_active_function_name(TSRMLS_C), key, strerror(errno));
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed for key 0x%x: %s", key, strerror(errno));
|
||||
efree(mq);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
@ -381,8 +380,7 @@ PHP_FUNCTION(msg_send)
|
||||
efree(messagebuffer);
|
||||
|
||||
if (result == -1) {
|
||||
zend_error(E_WARNING, "%s(): msgsnd failed: %s",
|
||||
get_active_function_name(TSRMLS_C), strerror(errno));
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "msgsnd failed: %s", strerror(errno));
|
||||
if (zerror) {
|
||||
ZVAL_LONG(zerror, errno);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user