diff options
-rw-r--r-- | ext/db/db.c | 42 | ||||
-rw-r--r-- | ext/dba/dba.c | 15 | ||||
-rw-r--r-- | ext/domxml/php_domxml.c | 14 |
3 files changed, 36 insertions, 35 deletions
diff --git a/ext/db/db.c b/ext/db/db.c index f089504ad3..f9c0480480 100644 --- a/ext/db/db.c +++ b/ext/db/db.c @@ -295,7 +295,7 @@ dbm_info *php_dbm_open(char *filename, char *mode TSRMLS_DC) DBM_MODE_TYPE imode; if (filename == NULL) { - php_error(E_WARNING, "NULL filename passed to php_dbm_open()"); + php_error(E_WARNING, "%s(): NULL filename passed", get_active_function_name(TSRMLS_C)); return NULL; } @@ -341,7 +341,7 @@ dbm_info *php_dbm_open(char *filename, char *mode TSRMLS_DC) lockfd = open(lockfn, O_RDWR|O_CREAT, 0644); close(lockfd); } else { - php_error(E_WARNING, "File appears to be locked [%s]\n", lockfn); + php_error(E_WARNING, "%s(): File appears to be locked [%s]", get_active_function_name(TSRMLS_C), lockfn); return -1; } #else /* NFS_HACK */ @@ -352,7 +352,7 @@ dbm_info *php_dbm_open(char *filename, char *mode TSRMLS_DC) flock(lockfd, LOCK_EX); close(lockfd); } else { - php_error(E_WARNING, "Unable to establish lock: %s", filename); + php_error(E_WARNING, "%s(): Unable to establish lock: %s", get_active_function_name(TSRMLS_C), filename); } #endif /* else NFS_HACK */ @@ -369,7 +369,7 @@ dbm_info *php_dbm_open(char *filename, char *mode TSRMLS_DC) if (dbf) { info = (dbm_info *)emalloc(sizeof(dbm_info)); if (!info) { - php_error(E_ERROR, "problem allocating memory!"); + php_error(E_ERROR, "%s(): problem allocating memory!", get_active_function_name(TSRMLS_C)); return NULL; } @@ -381,7 +381,7 @@ dbm_info *php_dbm_open(char *filename, char *mode TSRMLS_DC) return info; } else { #if GDBM - php_error(E_WARNING, "dbmopen_gdbm(%s): %d [%s], %d [%s]", filename, gdbm_errno, gdbm_strerror(gdbm_errno), errno, strerror(errno)); + php_error(E_WARNING, "%s(%s): %d [%s], %d [%s]", get_active_function_name(TSRMLS_C), filename, gdbm_errno, gdbm_strerror(gdbm_errno), errno, strerror(errno)); if (gdbm_errno) ret = gdbm_errno; else if (errno) @@ -391,13 +391,13 @@ dbm_info *php_dbm_open(char *filename, char *mode TSRMLS_DC) #else #if NDBM #if PHP_DEBUG - php_error(E_WARNING, "dbmopen_ndbm(%s): errno = %d [%s]\n", filename, errno, strerror(errno)); + php_error(E_WARNING, "%s(%s): errno = %d [%s]\n", get_active_function_name(TSRMLS_C), filename, errno, strerror(errno)); #endif if (errno) ret=errno; else ret = -1; #else #if PHP_DEBUG - php_error(E_WARNING, "dbmopen_flatfile(%s): errno = %d [%s]\n", filename, errno, strerror(errno)); + php_error(E_WARNING, "%s(%s): errno = %d [%s]\n", get_active_function_name(TSRMLS_C), filename, errno, strerror(errno)); #endif if (errno) ret=errno; else ret = -1; @@ -487,7 +487,7 @@ PHP_FUNCTION(dbminsert) info = php_find_dbm(id TSRMLS_CC); if (!info) { - php_error(E_WARNING, "not a valid database identifier %d", Z_LVAL_P(id)); + php_error(E_WARNING, "%s(): not a valid database identifier %d", get_active_function_name(TSRMLS_C), Z_LVAL_P(id)); RETURN_FALSE; } @@ -518,7 +518,7 @@ int php_dbm_insert(dbm_info *info, char *key, char *value TSRMLS_DC) { dbf = info->dbf; if (!dbf) { - php_error(E_WARNING, "Unable to locate dbm file"); + php_error(E_WARNING, "%s(): Unable to locate dbm file", get_active_function_name(TSRMLS_C)); return 1; } @@ -547,7 +547,7 @@ PHP_FUNCTION(dbmreplace) info = php_find_dbm(id TSRMLS_CC); if (!info) { - php_error(E_WARNING, "not a valid database identifier %d", Z_LVAL_P(id)); + php_error(E_WARNING, "%s(): not a valid database identifier %d", get_active_function_name(TSRMLS_C), Z_LVAL_P(id)); RETURN_FALSE; } @@ -580,7 +580,7 @@ int php_dbm_replace(dbm_info *info, char *key, char *value TSRMLS_DC) dbf = info->dbf; if (!dbf) { - php_error(E_WARNING, "Unable to locate dbm file"); + php_error(E_WARNING, "%s(): Unable to locate dbm file", get_active_function_name(TSRMLS_C)); return 1; } @@ -608,7 +608,7 @@ PHP_FUNCTION(dbmfetch) info = php_find_dbm(id TSRMLS_CC); if (!info) { - php_error(E_WARNING, "not a valid database identifier %d", Z_LVAL_P(id)); + php_error(E_WARNING, "%s(): not a valid database identifier %d", get_active_function_name(TSRMLS_C), Z_LVAL_P(id)); RETURN_FALSE; } @@ -639,7 +639,7 @@ char *php_dbm_fetch(dbm_info *info, char *key TSRMLS_DC) dbf = info->dbf; if (!dbf) { - php_error(E_WARNING, "Unable to locate dbm file"); + php_error(E_WARNING, "%s(): Unable to locate dbm file", get_active_function_name(TSRMLS_C)); return(NULL); } @@ -684,7 +684,7 @@ PHP_FUNCTION(dbmexists) info = php_find_dbm(id TSRMLS_CC); if (!info) { - php_error(E_WARNING, "not a valid database identifier %d", Z_LVAL_P(id)); + php_error(E_WARNING, "%s(): not a valid database identifier %d", get_active_function_name(TSRMLS_C), Z_LVAL_P(id)); RETURN_FALSE; } @@ -708,7 +708,7 @@ int php_dbm_exists(dbm_info *info, char *key) { dbf = info->dbf; if (!dbf) { - php_error(E_WARNING, "Unable to locate dbm file"); + php_error(E_WARNING, "%s(): Unable to locate dbm file", get_active_function_name(TSRMLS_C)); return(0); } @@ -733,7 +733,7 @@ PHP_FUNCTION(dbmdelete) info = php_find_dbm(id TSRMLS_CC); if (!info) { - php_error(E_WARNING, "not a valid database identifier %d", Z_LVAL_P(id)); + php_error(E_WARNING, "%s(): not a valid database identifier %d", get_active_function_name(TSRMLS_C), Z_LVAL_P(id)); RETURN_FALSE; } @@ -757,7 +757,7 @@ int php_dbm_delete(dbm_info *info, char *key) { dbf = info->dbf; if (!dbf) { - php_error(E_WARNING, "Unable to locate dbm file"); + php_error(E_WARNING, "%s(): Unable to locate dbm file", get_active_function_name(TSRMLS_C)); return(0); } @@ -780,7 +780,7 @@ PHP_FUNCTION(dbmfirstkey) info = php_find_dbm(id TSRMLS_CC); if (!info) { - php_error(E_WARNING, "not a valid database identifier %d", Z_LVAL_P(id)); + php_error(E_WARNING, "%s(): not a valid database identifier %d", get_active_function_name(TSRMLS_C), Z_LVAL_P(id)); RETURN_FALSE; } @@ -802,7 +802,7 @@ char *php_dbm_first_key(dbm_info *info) { dbf = info->dbf; if (!dbf) { - php_error(E_WARNING, "Unable to locate dbm file"); + php_error(E_WARNING, "%s(): Unable to locate dbm file", get_active_function_name(TSRMLS_C)); return(NULL); } @@ -842,7 +842,7 @@ PHP_FUNCTION(dbmnextkey) info = php_find_dbm(id TSRMLS_CC); if (!info) { - php_error(E_WARNING, "not a valid database identifier %d", Z_LVAL_P(id)); + php_error(E_WARNING, "%s(): not a valid database identifier %d", get_active_function_name(TSRMLS_C), Z_LVAL_P(id)); RETURN_FALSE; } @@ -871,7 +871,7 @@ char *php_dbm_nextkey(dbm_info *info, char *key TSRMLS_DC) dbf = info->dbf; if (!dbf) { - php_error(E_WARNING, "Unable to locate dbm file"); + php_error(E_WARNING, "%s(): Unable to locate dbm file", get_active_function_name(TSRMLS_C)); return(NULL); } diff --git a/ext/dba/dba.c b/ext/dba/dba.c index 4b40983208..cb0d7088b6 100644 --- a/ext/dba/dba.c +++ b/ext/dba/dba.c @@ -117,9 +117,10 @@ typedef struct dba_handler { #define DBA_ID_GET \ convert_to_long_ex(id); \ - DBA_IF_NOT_CORRECT_TYPE(Z_LVAL_PP(id)) { \ - php_error(E_WARNING, "Unable to find DBA identifier %d", \ - Z_LVAL_PP(id)); \ + DBA_IF_NOT_CORRECT_TYPE(Z_LVAL_PP(id)) { \ + php_error(E_WARNING, "%s(): Unable to find DBA identifier %d", \ + get_active_function_name(TSRMLS_C), \ + Z_LVAL_PP(id)); \ RETURN_FALSE; \ } @@ -138,7 +139,7 @@ typedef struct dba_handler { /* check whether the user has write access */ #define DBA_WRITE_CHECK \ if(info->mode != DBA_WRITER && info->mode != DBA_TRUNC && info->mode != DBA_CREAT) { \ - php_error(E_WARNING, "you cannot perform a modification to a database without proper access"); \ + php_error(E_WARNING, "%s(): you cannot perform a modification to a database without proper access", get_active_function_name(TSRMLS_C)); \ RETURN_FALSE; \ } @@ -317,7 +318,7 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent) strcasecmp(hptr->name, Z_STRVAL_PP(args[2])); hptr++); if(!hptr->name) { - php_error(E_WARNING, "no such handler: %s", Z_STRVAL_PP(args[2])); + php_error(E_WARNING, "%s(): no such handler: %s", get_active_function_name(TSRMLS_C), Z_STRVAL_PP(args[2])); FREENOW; RETURN_FALSE; } @@ -336,7 +337,7 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent) modenr = DBA_TRUNC; break; default: - php_error(E_WARNING, "illegal DBA mode: %s", Z_STRVAL_PP(args[1])); + php_error(E_WARNING, "%s(): illegal DBA mode: %s", get_active_function_name(TSRMLS_C), Z_STRVAL_PP(args[1])); FREENOW; RETURN_FALSE; } @@ -351,7 +352,7 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent) if(hptr->open(info TSRMLS_CC) != SUCCESS) { dba_close(info); - php_error(E_WARNING, "driver initialization failed"); + php_error(E_WARNING, "%s(): driver initialization failed", get_active_function_name(TSRMLS_C)); FREENOW; RETURN_FALSE; } diff --git a/ext/domxml/php_domxml.c b/ext/domxml/php_domxml.c index 4ac4694823..c910c7dfac 100644 --- a/ext/domxml/php_domxml.c +++ b/ext/domxml/php_domxml.c @@ -68,12 +68,12 @@ DOMXML_GET_OBJ(ret, zval, le); #define DOMXML_NO_ARGS() if (ZEND_NUM_ARGS() != 0) { \ - php_error(E_WARNING, "%s() expects exactly 0 parameters, %d given", \ + php_error(E_WARNING, "%s(): expects exactly 0 parameters, %d given", \ get_active_function_name(TSRMLS_C), ZEND_NUM_ARGS()); \ return; \ } -#define DOMXML_NOT_IMPLEMENTED() php_error(E_WARNING, "%s() not yet implemented", \ +#define DOMXML_NOT_IMPLEMENTED() php_error(E_WARNING, "%s(): not yet implemented", \ get_active_function_name(TSRMLS_C)); \ return; @@ -728,7 +728,7 @@ void *php_xsltstylesheet_get_object(zval *wrapper, int rsrc_type1, int rsrc_type int type; if (NULL == wrapper) { - php_error(E_WARNING, "xsltstylesheet_get_object() invalid wrapper object passed"); + php_error(E_WARNING, "xsltstylesheet_get_object() invalid wrapper object passed", get_active_function_name(TSRMLS_C)); return NULL; } @@ -1049,7 +1049,7 @@ static char **php_xmlparser_make_params(zval *idvars TSRMLS_DC) zend_hash_move_forward(parht)) { if (zend_hash_get_current_key(parht, &string_key, &num_key, 1) != HASH_KEY_IS_STRING) { - php_error(E_WARNING, "Invalid argument or parameter array to %s", + php_error(E_WARNING, "%s(): Invalid argument or parameter array", get_active_function_name(TSRMLS_C)); return NULL; } @@ -4277,7 +4277,7 @@ PHP_FUNCTION(domxml_parser_end) DOMXML_PARAM_TWO(parserp, id, le_domxmlparserp,"|s", &chunk, &chunk_len); error = xmlParseChunk(parserp, chunk, chunk_len, 1); if (error != 0) { - php_error(E_ERROR,"error: %d",error); + php_error(E_ERROR, "%s(): error: %d", get_active_function_name(TSRMLS_C), error); RETURN_FALSE; } if (parserp->myDoc != NULL) { @@ -4870,7 +4870,7 @@ static char *php_domxslt_string_to_xpathexpr(const char *str TSRMLS_DC) if (xmlStrchr(string, '"')) { if (xmlStrchr(string, '\'')) { - php_error(E_WARNING, "Cannot create XPath expression (string contains both quote and double-quotes) in %s", + php_error(E_WARNING, "%s(): Cannot create XPath expression (string contains both quote and double-quotes)", get_active_function_name(TSRMLS_C)); return NULL; } @@ -4908,7 +4908,7 @@ static char **php_domxslt_make_params(zval *idvars, int xpath_params TSRMLS_DC) zend_hash_move_forward(parht)) { if (zend_hash_get_current_key(parht, &string_key, &num_key, 1) != HASH_KEY_IS_STRING) { - php_error(E_WARNING, "Invalid argument or parameter array to %s", + php_error(E_WARNING, "%s(): Invalid argument or parameter array", get_active_function_name(TSRMLS_C)); return NULL; } |