Unify error messages

This commit is contained in:
Derick Rethans 2002-06-28 10:52:11 +00:00
parent 32e08c7e52
commit b7ffa6033b
3 changed files with 157 additions and 157 deletions

View file

@ -637,7 +637,7 @@ PHP_RSHUTDOWN_FUNCTION(imap)
if (EG(error_reporting) & E_NOTICE) {
ecur = IMAPG(imap_errorstack);
while (ecur != NIL) {
php_error(E_NOTICE, "%s (errflg=%d)", ecur->LTEXT, ecur->errflg);
php_error(E_NOTICE, "%s(): %s (errflg=%d)", get_active_function_name(TSRMLS_C), ecur->LTEXT, ecur->errflg);
ecur = ecur->next;
}
}
@ -649,7 +649,7 @@ PHP_RSHUTDOWN_FUNCTION(imap)
if (EG(error_reporting) & E_NOTICE) {
acur = IMAPG(imap_alertstack);
while (acur != NIL) {
php_error(E_NOTICE, acur->LTEXT);
php_error(E_NOTICE, "%s(): %s", get_active_function_name(TSRMLS_C), acur->LTEXT);
acur = acur->next;
}
}
@ -862,7 +862,7 @@ static void php_imap_do_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
imap_stream = mail_open(NIL, Z_STRVAL_PP(mailbox), flags);
if (imap_stream == NIL) {
php_error(E_WARNING, "Couldn't open stream %s\n", Z_STRVAL_PP(mailbox));
php_error(E_WARNING, "%s(): Couldn't open stream %s", get_active_function_name(TSRMLS_C), Z_STRVAL_PP(mailbox));
efree(IMAPG(imap_user)); IMAPG(imap_user) = 0;
efree(IMAPG(imap_password)); IMAPG(imap_password) = 0;
RETURN_FALSE;
@ -901,7 +901,7 @@ PHP_FUNCTION(imap_popen)
php_imap_do_open(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1);
RETURN_TRUE;
#else
php_error(E_WARNING, "Persistent IMAP connections are not yet supported.\n");
php_error(E_WARNING, "%s(): Persistent IMAP connections are not yet supported.", get_active_function_name(TSRMLS_C));
RETURN_FALSE;
#endif
}
@ -937,7 +937,7 @@ PHP_FUNCTION(imap_reopen)
}
imap_stream = mail_open(imap_le_struct->imap_stream, Z_STRVAL_PP(mailbox), flags);
if (imap_stream == NIL) {
php_error(E_WARNING, "Couldn't re-open stream\n");
php_error(E_WARNING, "%s(): Couldn't re-open stream", get_active_function_name(TSRMLS_C));
RETURN_FALSE;
}
imap_le_struct->imap_stream = imap_stream;
@ -1047,12 +1047,12 @@ PHP_FUNCTION(imap_get_quota)
/* set the callback for the GET_QUOTA function */
mail_parameters(NIL, SET_QUOTA, (void *) mail_getquota);
if(!imap_getquota(imap_le_struct->imap_stream, Z_STRVAL_PP(qroot))) {
php_error(E_WARNING, "c-client imap_getquota failed");
php_error(E_WARNING, "%s(): c-client imap_getquota failed", get_active_function_name(TSRMLS_C));
RETURN_FALSE;
}
if (array_init(return_value) == FAILURE) {
php_error(E_WARNING, "Unable to allocate array memory");
php_error(E_WARNING, "%s(): Unable to allocate array memory", get_active_function_name(TSRMLS_C));
RETURN_FALSE;
}
@ -1241,7 +1241,7 @@ PHP_FUNCTION(imap_body)
msgindex = Z_LVAL_PP(msgno);
}
if ((msgindex < 1) || ((unsigned) msgindex > imap_le_struct->imap_stream->nmsgs)) {
php_error(E_WARNING, "Bad message number");
php_error(E_WARNING, "%s(): Bad message number", get_active_function_name(TSRMLS_C));
RETURN_FALSE;
}
@ -1614,7 +1614,7 @@ PHP_FUNCTION(imap_headerinfo)
}
if (!Z_LVAL_PP(msgno) || Z_LVAL_PP(msgno) < 1 || (unsigned) Z_LVAL_PP(msgno) > imap_le_struct->imap_stream->nmsgs) {
php_error(E_WARNING, "Bad message number");
php_error(E_WARNING, "%s(): Bad message number", get_active_function_name(TSRMLS_C));
RETURN_FALSE;
}
@ -1865,14 +1865,14 @@ PHP_FUNCTION(imap_fetchstructure)
msgindex = Z_LVAL_PP(msgno);
}
if ((msgindex < 1) || ((unsigned) msgindex > imap_le_struct->imap_stream->nmsgs)) {
php_error(E_WARNING, "Bad message number");
php_error(E_WARNING, "%s(): Bad message number", get_active_function_name(TSRMLS_C));
RETURN_FALSE;
}
mail_fetchstructure_full(imap_le_struct->imap_stream, Z_LVAL_PP(msgno), &body , myargc == 3 ? Z_LVAL_PP(flags) : NIL);
if (!body) {
php_error(E_WARNING, "No body information available");
php_error(E_WARNING, "%s(): No body information available", get_active_function_name(TSRMLS_C));
RETURN_FALSE;
}
@ -1905,7 +1905,7 @@ PHP_FUNCTION(imap_fetchbody)
body = mail_fetchbody_full(imap_le_struct->imap_stream, Z_LVAL_PP(msgno), Z_STRVAL_PP(sec), &len, myargc==4 ? Z_LVAL_PP(flags) : NIL);
if (!body) {
php_error(E_WARNING, "No body information available");
php_error(E_WARNING, "%s(): No body information available", get_active_function_name(TSRMLS_C));
RETURN_FALSE;
}
RETVAL_STRINGL(body, len, 1);
@ -2226,12 +2226,12 @@ PHP_FUNCTION(imap_utf7_decode)
if (state == ST_NORMAL) {
/* process printable character */
if (SPECIAL(*inp)) {
php_error(E_WARNING, "imap_utf7_decode: Invalid modified UTF-7 character: `%c'", *inp);
php_error(E_WARNING, "%s(): Invalid modified UTF-7 character: `%c'", get_active_function_name(TSRMLS_C), *inp);
RETURN_FALSE;
} else if (*inp != '&') {
outlen++;
} else if (inp + 1 == endp) {
php_error(E_WARNING, "imap_utf7_decode: Unexpected end of string");
php_error(E_WARNING, "%s(): Unexpected end of string", get_active_function_name(TSRMLS_C));
RETURN_FALSE;
} else if (inp[1] != '-') {
state = ST_DECODE0;
@ -2242,12 +2242,12 @@ PHP_FUNCTION(imap_utf7_decode)
} else if (*inp == '-') {
/* return to NORMAL mode */
if (state == ST_DECODE1) {
php_error(E_WARNING, "imap_utf7_decode: Stray modified base64 character: `%c'", *--inp);
php_error(E_WARNING, "%s(): Stray modified base64 character: `%c'", get_active_function_name(TSRMLS_C), *--inp);
RETURN_FALSE;
}
state = ST_NORMAL;
} else if (!B64CHAR(*inp)) {
php_error(E_WARNING, "imap_utf7_decode: Invalid modified base64 character: `%c'", *inp);
php_error(E_WARNING, "%s(): Invalid modified base64 character: `%c'", get_active_function_name(TSRMLS_C), *inp);
RETURN_FALSE;
} else {
switch (state) {
@ -2268,13 +2268,13 @@ PHP_FUNCTION(imap_utf7_decode)
/* enforce end state */
if (state != ST_NORMAL) {
php_error(E_WARNING, "imap_utf7_decode: Unexpected end of string");
php_error(E_WARNING, "%s(): Unexpected end of string", get_active_function_name(TSRMLS_C));
RETURN_FALSE;
}
/* allocate output buffer */
if ((out = emalloc(outlen + 1)) == NULL) {
php_error(E_WARNING, "imap_utf7_decode: Unable to allocate result string");
php_error(E_WARNING, "%s(): Unable to allocate result string", get_active_function_name(TSRMLS_C));
RETURN_FALSE;
}
@ -2326,7 +2326,7 @@ PHP_FUNCTION(imap_utf7_decode)
#if PHP_DEBUG
/* warn if we computed outlen incorrectly */
if (outp - out != outlen) {
php_error(E_WARNING, "imap_utf7_decode: outp - out [%d] != outlen [%d]", outp - out, outlen);
php_error(E_WARNING, "%s(): outp - out [%d] != outlen [%d]", get_active_function_name(TSRMLS_C), outp - out, outlen);
}
#endif
@ -2392,7 +2392,7 @@ PHP_FUNCTION(imap_utf7_encode)
/* allocate output buffer */
if ((out = emalloc(outlen + 1)) == NULL) {
php_error(E_WARNING, "imap_utf7_encode: Unable to allocate result string");
php_error(E_WARNING, "%s(): Unable to allocate result string", get_active_function_name(TSRMLS_C));
RETURN_FALSE;
}
@ -2444,7 +2444,7 @@ PHP_FUNCTION(imap_utf7_encode)
#if PHP_DEBUG
/* warn if we computed outlen incorrectly */
if (outp - out != outlen) {
php_error(E_WARNING, "imap_utf7_encode: outp - out [%d] != outlen [%d]", outp - out, outlen);
php_error(E_WARNING, "%s(): outp - out [%d] != outlen [%d]", get_active_function_name(TSRMLS_C), outp - out, outlen);
}
#endif
@ -2528,7 +2528,7 @@ PHP_FUNCTION(imap_sort)
convert_to_long_ex(rev);
convert_to_long_ex(pgm);
if (Z_LVAL_PP(pgm) > SORTSIZE) {
php_error(E_WARNING, "Unrecognized sort criteria");
php_error(E_WARNING, "%s(): Unrecognized sort criteria", get_active_function_name(TSRMLS_C));
RETURN_FALSE;
}
if (myargc >= 4) {
@ -2592,7 +2592,7 @@ PHP_FUNCTION(imap_fetchheader)
}
if ((msgindex < 1) || ((unsigned) msgindex > imap_le_struct->imap_stream->nmsgs)) {
php_error(E_WARNING, "Bad message number");
php_error(E_WARNING, "%s(): Bad message number", get_active_function_name(TSRMLS_C));
RETURN_FALSE;
}
@ -2618,7 +2618,7 @@ PHP_FUNCTION(imap_uid)
msgindex = Z_LVAL_PP(msgno);
if ((msgindex < 1) || ((unsigned) msgindex > imap_le_struct->imap_stream->nmsgs)) {
php_error(E_WARNING, "Bad message number");
php_error(E_WARNING, "%s(): Bad message number", get_active_function_name(TSRMLS_C));
RETURN_FALSE;
}
@ -2708,7 +2708,7 @@ PHP_FUNCTION(imap_bodystruct)
convert_to_string_ex(section);
if (!Z_LVAL_PP(msg) || Z_LVAL_PP(msg) < 1 || (unsigned) Z_LVAL_PP(msg) > imap_le_struct->imap_stream->nmsgs) {
php_error(E_WARNING, "Bad message number");
php_error(E_WARNING, "%s(): Bad message number", get_active_function_name(TSRMLS_C));
RETURN_FALSE;
}
@ -2906,12 +2906,12 @@ PHP_FUNCTION(imap_mail_compose)
}
if (Z_TYPE_PP(envelope) != IS_ARRAY) {
php_error(E_WARNING, "IMAP: Expected Array as envelope parameter");
php_error(E_WARNING, "%s(): Expected Array as envelope parameter", get_active_function_name(TSRMLS_C));
RETURN_FALSE;
}
if (Z_TYPE_PP(body) != IS_ARRAY) {
php_error(E_WARNING, "IMAP: Expected Array as body parameter");
php_error(E_WARNING, "%s(): Expected Array as body parameter", get_active_function_name(TSRMLS_C));
RETURN_FALSE;
}
@ -3252,7 +3252,7 @@ int _php_imap_mail(char *to, char *subject, char *message, char *headers, char *
#ifdef PHP_WIN32
if (imap_TSendMail(INI_STR("SMTP"), &tsm_err, headers, subject, to, message, cc, bcc, rpath) != SUCCESS) {
php_error(E_WARNING, "%s", GetSMErrorText(tsm_err));
php_error(E_WARNING, "%s(): %s", get_active_function_name(TSRMLS_C), GetSMErrorText(tsm_err));
return 0;
}
#else
@ -3277,7 +3277,7 @@ int _php_imap_mail(char *to, char *subject, char *message, char *headers, char *
return 1;
}
} else {
php_error(E_WARNING, "Could not execute mail delivery program");
php_error(E_WARNING, "%s(): Could not execute mail delivery program", get_active_function_name(TSRMLS_C));
return 0;
}
#endif
@ -3302,7 +3302,7 @@ PHP_FUNCTION(imap_mail)
if (Z_STRVAL_PP(argv[0])) {
to = Z_STRVAL_PP(argv[0]);
} else {
php_error(E_WARNING, "No to field in mail command");
php_error(E_WARNING, "%s(): No to field in mail command", get_active_function_name(TSRMLS_C));
RETURN_FALSE;
}
@ -3311,7 +3311,7 @@ PHP_FUNCTION(imap_mail)
if (Z_STRVAL_PP(argv[1])) {
subject = Z_STRVAL_PP(argv[1]);
} else {
php_error(E_WARNING, "No subject field in mail command");
php_error(E_WARNING, "%s(): No subject field in mail command", get_active_function_name(TSRMLS_C));
RETURN_FALSE;
}
@ -3321,7 +3321,7 @@ PHP_FUNCTION(imap_mail)
message = Z_STRVAL_PP(argv[2]);
} else {
/* this is not really an error, so it is allowed. */
php_error(E_WARNING, "No message string in mail command");
php_error(E_WARNING, "%s(): No message string in mail command", get_active_function_name(TSRMLS_C));
message = NULL;
}
@ -3576,7 +3576,7 @@ PHP_FUNCTION(imap_mime_header_decode)
}
efree(charset);
} else {
php_error(E_WARNING, "Unable to allocate temporary memory buffer for imap_mime_header_decode");
php_error(E_WARNING, "%s(): Unable to allocate temporary memory buffer", get_active_function_name(TSRMLS_C));
RETURN_FALSE;
}
}
@ -3936,7 +3936,7 @@ PHP_FUNCTION (imap_thread)
top = mail_thread(imap_le_struct->imap_stream, "REFERENCES", NIL, mail_criteria(criteria), flags);
if(top == NIL) {
php_error(E_WARNING, "imap_thread returned an empty tree");
php_error(E_WARNING, "%s(): Function returned an empty tree", get_active_function_name(TSRMLS_C));
RETURN_FALSE;
}