helly Thu Dec 5 15:59:50 2002 EDT
Modified files:
/php4/ext/standard base64.c dl.c exec.c http_fopen_wrapper.c
incomplete_class.c levenshtein.c link.c math.c
pack.c reg.c scanf.c uniqid.c url.c var.c
Log:
-php_error -> php_error_docref
-removed some cases where emalloc result was tested
Index: php4/ext/standard/base64.c
diff -u php4/ext/standard/base64.c:1.34 php4/ext/standard/base64.c:1.35
--- php4/ext/standard/base64.c:1.34 Sat Nov 30 21:44:50 2002
+++ php4/ext/standard/base64.c Thu Dec 5 15:59:48 2002
@@ -15,7 +15,7 @@
| Author: Jim Winstead <[EMAIL PROTECTED]> |
+----------------------------------------------------------------------+
*/
-/* $Id: base64.c,v 1.34 2002/12/01 02:44:50 moriyoshi Exp $ */
+/* $Id: base64.c,v 1.35 2002/12/05 20:59:48 helly Exp $ */
#include <string.h>
@@ -119,7 +119,7 @@
ch += 16;
}
sprintf(sp, "};");
- php_error(E_NOTICE,"reverse_table:\n%s", s);
+ php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Reverse_table:\n%s", s);
efree(s);
}
*/
Index: php4/ext/standard/dl.c
diff -u php4/ext/standard/dl.c:1.79 php4/ext/standard/dl.c:1.80
--- php4/ext/standard/dl.c:1.79 Mon Nov 4 07:53:24 2002
+++ php4/ext/standard/dl.c Thu Dec 5 15:59:48 2002
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: dl.c,v 1.79 2002/11/04 12:53:24 moriyoshi Exp $ */
+/* $Id: dl.c,v 1.80 2002/12/05 20:59:48 helly Exp $ */
#include "php.h"
#include "dl.h"
@@ -220,7 +220,7 @@
zts = module_entry->zts;
}
- php_error(error_type,
+ php_error_docref(NULL TSRMLS_CC, error_type,
"%s: Unable to initialize module\n"
"Module compiled with module API=%d,
debug=%d, thread-safety=%d\n"
"PHP compiled with module API=%d,
debug=%d, thread-safety=%d\n"
Index: php4/ext/standard/exec.c
diff -u php4/ext/standard/exec.c:1.84 php4/ext/standard/exec.c:1.85
--- php4/ext/standard/exec.c:1.84 Mon Nov 4 12:38:30 2002
+++ php4/ext/standard/exec.c Thu Dec 5 15:59:49 2002
@@ -15,7 +15,7 @@
| Author: Rasmus Lerdorf |
+----------------------------------------------------------------------+
*/
-/* $Id: exec.c,v 1.84 2002/11/04 17:38:30 iliaa Exp $ */
+/* $Id: exec.c,v 1.85 2002/12/05 20:59:49 helly Exp $ */
#include <stdio.h>
#include "php.h"
@@ -72,7 +72,7 @@
larg0 = strlen(arg0);
if (strstr(arg0, "..")) {
- php_error(E_WARNING, "No '..' components allowed in path");
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "No '..' components
+allowed in path");
efree(arg0);
return FAILURE;
}
Index: php4/ext/standard/http_fopen_wrapper.c
diff -u php4/ext/standard/http_fopen_wrapper.c:1.53
php4/ext/standard/http_fopen_wrapper.c:1.54
--- php4/ext/standard/http_fopen_wrapper.c:1.53 Sat Oct 12 21:03:43 2002
+++ php4/ext/standard/http_fopen_wrapper.c Thu Dec 5 15:59:49 2002
@@ -18,7 +18,7 @@
| Wez Furlong <[EMAIL PROTECTED]> |
+----------------------------------------------------------------------+
*/
-/* $Id: http_fopen_wrapper.c,v 1.53 2002/10/13 01:03:43 wez Exp $ */
+/* $Id: http_fopen_wrapper.c,v 1.54 2002/12/05 20:59:49 helly Exp $ */
#include "php.h"
#include "php_globals.h"
@@ -221,7 +221,7 @@
ua[ua_len] = 0;
php_stream_write(stream, ua, ua_len);
} else {
- php_error(E_WARNING, "Cannot construct User-agent
header");
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot
+construct User-agent header");
}
if (ua) {
Index: php4/ext/standard/incomplete_class.c
diff -u php4/ext/standard/incomplete_class.c:1.14
php4/ext/standard/incomplete_class.c:1.15
--- php4/ext/standard/incomplete_class.c:1.14 Wed Jul 24 05:55:11 2002
+++ php4/ext/standard/incomplete_class.c Thu Dec 5 15:59:49 2002
@@ -17,7 +17,7 @@
*/
-/* $Id: incomplete_class.c,v 1.14 2002/07/24 09:55:11 yohgaki Exp $ */
+/* $Id: incomplete_class.c,v 1.15 2002/12/05 20:59:49 helly Exp $ */
#include "php.h"
#include "basic_functions.h"
@@ -37,17 +37,18 @@
{
char buf[1024];
char *class_name;
+ TSRMLS_FETCH();
class_name = php_lookup_class_name(ref->object, NULL, 0);
if (!class_name)
class_name = estrdup("unknown");
- snprintf(buf, 1023, INCOMPLETE_CLASS_MSG, class_name);
+ snprintf(buf, sizeof(buf)-1, INCOMPLETE_CLASS_MSG, class_name);
efree(class_name);
- php_error(error_type, "%s", buf);
+ php_error_docref(NULL TSRMLS_CC, error_type, "%s", buf);
}
/* }}} */
Index: php4/ext/standard/levenshtein.c
diff -u php4/ext/standard/levenshtein.c:1.26 php4/ext/standard/levenshtein.c:1.27
--- php4/ext/standard/levenshtein.c:1.26 Mon Nov 25 07:30:26 2002
+++ php4/ext/standard/levenshtein.c Thu Dec 5 15:59:49 2002
@@ -15,7 +15,7 @@
| Author: Hartmut Holzgraefe <[EMAIL PROTECTED]> |
+----------------------------------------------------------------------+
*/
-/* $Id: levenshtein.c,v 1.26 2002/11/25 12:30:26 hholzgra Exp $ */
+/* $Id: levenshtein.c,v 1.27 2002/12/05 20:59:49 helly Exp $ */
#include "php.h"
#include <stdlib.h>
@@ -77,10 +77,12 @@
*/
static int custom_levdist(char *str1, char *str2, char *callback_name)
{
- php_error(E_WARNING, "the general Levenshtein support is not there
yet");
- /* not there yet */
+ TSRMLS_FETCH();
- return -1;
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "The general Levenshtein support
+is not there yet");
+ /* not there yet */
+
+ return -1;
}
/* }}} */
Index: php4/ext/standard/link.c
diff -u php4/ext/standard/link.c:1.44 php4/ext/standard/link.c:1.45
--- php4/ext/standard/link.c:1.44 Fri Nov 15 11:34:16 2002
+++ php4/ext/standard/link.c Thu Dec 5 15:59:49 2002
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: link.c,v 1.44 2002/11/15 16:34:16 iliaa Exp $ */
+/* $Id: link.c,v 1.45 2002/12/05 20:59:49 helly Exp $ */
#include "php.h"
#include "php_filestat.h"
@@ -68,7 +68,7 @@
ret = readlink(Z_STRVAL_PP(filename), buff, MAXPATHLEN-1);
if (ret == -1) {
- php_error(E_WARNING, "readlink failed (%s)", strerror(errno));
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", strerror(errno));
RETURN_FALSE;
}
/* Append NULL to the end of the string */
@@ -97,7 +97,7 @@
ret = VCWD_LSTAT(Z_STRVAL_PP(filename), &sb);
if (ret == -1) {
- php_error(E_WARNING, "Linkinfo failed (%s)", strerror(errno));
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", strerror(errno));
RETURN_LONG(-1L);
}
@@ -126,7 +126,7 @@
if (php_stream_locate_url_wrapper(source_p, NULL, STREAM_LOCATE_WRAPPERS_ONLY
TSRMLS_CC) ||
php_stream_locate_url_wrapper(dest_p, NULL,
STREAM_LOCATE_WRAPPERS_ONLY TSRMLS_CC) )
{
- php_error(E_WARNING, "Unable to symlink to a URL");
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to symlink to a
+URL");
RETURN_FALSE;
}
@@ -152,7 +152,7 @@
ret = symlink(dest_p, source_p);
#endif
if (ret == -1) {
- php_error(E_WARNING, "Symlink failed (%s)", strerror(errno));
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", strerror(errno));
RETURN_FALSE;
}
@@ -181,7 +181,7 @@
if (php_stream_locate_url_wrapper(source_p, NULL, STREAM_LOCATE_WRAPPERS_ONLY
TSRMLS_CC) ||
php_stream_locate_url_wrapper(dest_p, NULL,
STREAM_LOCATE_WRAPPERS_ONLY TSRMLS_CC) )
{
- php_error(E_WARNING, "Unable to link to a URL");
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to link to a URL");
RETURN_FALSE;
}
@@ -207,7 +207,7 @@
ret = link(dest_p, source_p);
#endif
if (ret == -1) {
- php_error(E_WARNING, "Link failed (%s)", strerror(errno));
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", strerror(errno));
RETURN_FALSE;
}
Index: php4/ext/standard/math.c
diff -u php4/ext/standard/math.c:1.97 php4/ext/standard/math.c:1.98
--- php4/ext/standard/math.c:1.97 Tue Nov 12 06:46:21 2002
+++ php4/ext/standard/math.c Thu Dec 5 15:59:49 2002
@@ -19,7 +19,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: math.c,v 1.97 2002/11/12 11:46:21 helly Exp $ */
+/* $Id: math.c,v 1.98 2002/12/05 20:59:49 helly Exp $ */
#include "php.h"
#include "php_math.h"
@@ -675,8 +675,12 @@
if (num > onum)
continue;
- php_error(E_WARNING, "base_to_long: number '%s' is too big to fit in
long", s);
- return LONG_MAX;
+ {
+ TSRMLS_FETCH();
+
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Number '%s' is
+too big to fit in long", s);
+ return LONG_MAX;
+ }
}
return num;
@@ -956,11 +960,11 @@
convert_to_long_ex(frombase);
convert_to_long_ex(tobase);
if (Z_LVAL_PP(frombase) < 2 || Z_LVAL_PP(frombase) > 36) {
- php_error(E_WARNING, "base_convert: invalid `from base' (%d)",
Z_LVAL_PP(frombase));
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid `from base'
+(%d)", Z_LVAL_PP(frombase));
RETURN_FALSE;
}
if (Z_LVAL_PP(tobase) < 2 || Z_LVAL_PP(tobase) > 36) {
- php_error(E_WARNING, "base_convert: invalid `to base' (%d)",
Z_LVAL_PP(tobase));
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid `to base' (%d)",
+Z_LVAL_PP(tobase));
RETURN_FALSE;
}
Index: php4/ext/standard/pack.c
diff -u php4/ext/standard/pack.c:1.40 php4/ext/standard/pack.c:1.41
--- php4/ext/standard/pack.c:1.40 Fri Sep 6 03:44:30 2002
+++ php4/ext/standard/pack.c Thu Dec 5 15:59:49 2002
@@ -15,7 +15,7 @@
| Author: Chris Schneider <[EMAIL PROTECTED]> |
+----------------------------------------------------------------------+
*/
-/* $Id: pack.c,v 1.40 2002/09/06 07:44:30 hyanantha Exp $ */
+/* $Id: pack.c,v 1.41 2002/12/05 20:59:49 helly Exp $ */
#include "php.h"
@@ -167,7 +167,7 @@
case 'X':
case '@':
if (arg < 0) {
- php_error(E_WARNING, "pack type %c: '*'
ignored", code);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING,
+"Type %c: '*' ignored", code);
arg = 1;
}
break;
@@ -181,7 +181,7 @@
efree(argv);
efree(formatcodes);
efree(formatargs);
- php_error(E_WARNING, "pack type %c: not enough
arguments", code);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING,
+"Type %c: not enough arguments", code);
RETURN_FALSE;
}
@@ -217,7 +217,7 @@
efree(argv);
efree(formatcodes);
efree(formatargs);
- php_error(E_WARNING, "pack type %c: too few
arguments", code);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING,
+"Type %c: too few arguments", code);
RETURN_FALSE;
}
break;
@@ -226,7 +226,7 @@
efree(argv);
efree(formatcodes);
efree(formatargs);
- php_error(E_WARNING, "pack type %c: unknown format
code", code);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Type %c:
+unknown format code", code);
RETURN_FALSE;
}
@@ -235,7 +235,7 @@
}
if (currentarg < argc) {
- php_error(E_WARNING, "pack %d arguments unused", (argc - currentarg));
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d arguments unused",
+(argc - currentarg));
}
/* Calculate output length and upper bound while processing*/
@@ -288,7 +288,7 @@
outputpos -= arg;
if (outputpos < 0) {
- php_error(E_WARNING, "pack type %c: outside of
string", code);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING,
+"Type %c: outside of string", code);
outputpos = 0;
}
break;
@@ -335,7 +335,7 @@
v = Z_STRVAL_PP(val);
outputpos--;
if(arg > Z_STRLEN_PP(val)) {
- php_error(E_WARNING, "pack type %c: not enough
characters in string", code);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING,
+"Type %c: not enough characters in string", code);
arg = Z_STRLEN_PP(val);
}
@@ -349,7 +349,7 @@
} else if (n >= 'a' && n <= 'f') {
n -= ('a' - 10);
} else {
- php_error(E_WARNING, "pack type %c:
illegal hex digit %c", code, n);
+ php_error_docref(NULL TSRMLS_CC,
+E_WARNING, "Type %c: illegal hex digit %c", code, n);
n = 0;
}
@@ -804,7 +804,7 @@
i = arg - 1; /*
Break out of for loop */
if (arg >= 0) {
- php_error(E_WARNING,
"pack type %c: outside of string", type);
+ php_error_docref(NULL
+TSRMLS_CC, E_WARNING, "Type %c: outside of string", type);
}
}
break;
@@ -813,7 +813,7 @@
if (arg <= inputlen) {
inputpos = arg;
} else {
- php_error(E_WARNING, "pack
type %c: outside of string", type);
+ php_error_docref(NULL
+TSRMLS_CC, E_WARNING, "Type %c: outside of string", type);
}
i = arg - 1; /* Done, break out of
for loop */
@@ -825,7 +825,7 @@
/* Reached end of input for '*' repeater */
break;
} else {
- php_error(E_WARNING, "pack type %c: not enough input,
need %d, have %d", type, size, inputlen - inputpos);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Type %c:
+not enough input, need %d, have %d", type, size, inputlen - inputpos);
zval_dtor(return_value);
RETURN_FALSE;
}
Index: php4/ext/standard/reg.c
diff -u php4/ext/standard/reg.c:1.66 php4/ext/standard/reg.c:1.67
--- php4/ext/standard/reg.c:1.66 Wed Sep 25 10:02:34 2002
+++ php4/ext/standard/reg.c Thu Dec 5 15:59:49 2002
@@ -17,7 +17,7 @@
| Jaakko Hyv�tti <[EMAIL PROTECTED]> |
+----------------------------------------------------------------------+
*/
-/* $Id: reg.c,v 1.66 2002/09/25 14:02:34 andrei Exp $ */
+/* $Id: reg.c,v 1.67 2002/12/05 20:59:49 helly Exp $ */
#include <stdio.h>
#include <ctype.h>
@@ -128,6 +128,8 @@
#endif
len = regerror(err, re, NULL, 0);
if (len) {
+ TSRMLS_FETCH();
+
message = (char *)emalloc((buf_len + len + 2) * sizeof(char));
if (!message) {
return; /* fail silently */
@@ -139,7 +141,7 @@
/* drop the message into place */
regerror(err, re, message + buf_len, len);
- php_error(E_WARNING, "%s", message);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", message);
}
STR_FREE(buf);
@@ -198,10 +200,6 @@
/* allocate storage for (sub-)expression-matches */
subs = (regmatch_t *)ecalloc(sizeof(regmatch_t),re.re_nsub+1);
- if (!subs) {
- php_error(E_WARNING, "Unable to allocate memory in php_ereg");
- RETURN_FALSE;
- }
/* actually execute the regular expression */
err = regexec(&re, string, re.re_nsub+1, subs, 0);
@@ -218,12 +216,6 @@
string_len = Z_STRLEN_PP(findin) + 1;
buf = emalloc(string_len);
- if (!buf) {
- php_error(E_WARNING, "Unable to allocate memory in php_ereg");
- regfree(&re);
- efree(subs);
- RETURN_FALSE;
- }
zval_dtor(*array); /* start with clean array */
array_init(*array);
@@ -300,21 +292,11 @@
/* allocate storage for (sub-)expression-matches */
subs = (regmatch_t *)ecalloc(sizeof(regmatch_t),re.re_nsub+1);
- if (!subs) {
- php_error(E_WARNING, "Unable to allocate memory in php_ereg_replace");
- return ((char *) -1);
- }
/* start with a buffer that is twice the size of the stringo
we're doing replacements in */
buf_len = 2 * string_len + 1;
buf = emalloc(buf_len * sizeof(char));
- if (!buf) {
- php_error(E_WARNING, "Unable to allocate memory in php_ereg_replace");
- efree(subs);
- regfree(&re);
- return ((char *) -1);
- }
err = pos = 0;
buf[0] = '\0';
@@ -550,7 +532,7 @@
} else if (subs[0].rm_so == 0 && subs[0].rm_eo == 0) {
/* No more matches */
regfree(&re);
- php_error(E_WARNING, "Invalid Regular Expression to split()");
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid Regular
+Expression to split()");
zend_hash_destroy(Z_ARRVAL_P(return_value));
efree(Z_ARRVAL_P(return_value));
RETURN_FALSE;
Index: php4/ext/standard/scanf.c
diff -u php4/ext/standard/scanf.c:1.16 php4/ext/standard/scanf.c:1.17
--- php4/ext/standard/scanf.c:1.16 Fri Aug 23 21:19:28 2002
+++ php4/ext/standard/scanf.c Thu Dec 5 15:59:49 2002
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: scanf.c,v 1.16 2002/08/24 01:19:28 helly Exp $ */
+/* $Id: scanf.c,v 1.17 2002/12/05 20:59:49 helly Exp $ */
/*
scanf.c --
@@ -461,7 +461,7 @@
/* problem - cc */
/*
if (flags & SCAN_WIDTH) {
- php_error(E_WARNING, "field width may not be specified in %c
conversion");
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Field width may not
+be specified in %c conversion");
goto error;
}
*/
@@ -491,11 +491,11 @@
}
break;
badSet:
- php_error(E_WARNING, "unmatched [ in format string");
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unmatched [ in format
+string");
goto error;
default:
{
- php_error(E_WARNING, "bad scan conversion character \"%c\"", ch);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad scan conversion
+character \"%c\"", ch);
goto error;
}
}
@@ -545,14 +545,14 @@
}
for (i = 0; i < numVars; i++) {
if (nassign[i] > 1) {
- php_error(E_WARNING, "variable is assigned by multiple \"%n$\" conversion
specifiers");
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Variable is assigned by
+multiple \"%n$\" conversion specifiers");
goto error;
} else if (!xpgSize && (nassign[i] == 0)) {
/*
* If the space is empty, and xpgSize is 0 (means XPG wasn't
* used, and/or numVars != 0), then too many vars were given
*/
- php_error(E_WARNING, "variable is not assigned by any conversion
specifiers");
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Variable is not assigned by
+any conversion specifiers");
goto error;
}
}
@@ -564,9 +564,9 @@
badIndex:
if (gotXpg) {
- php_error(E_WARNING, "\"%n$\" argument index out of range");
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "\"%n$\" argument index out
+of range");
} else {
- php_error(E_WARNING, "different numbers of variable names and field
specifiers");
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Different numbers of
+variable names and field specifiers");
}
error:
Index: php4/ext/standard/uniqid.c
diff -u php4/ext/standard/uniqid.c:1.31 php4/ext/standard/uniqid.c:1.32
--- php4/ext/standard/uniqid.c:1.31 Thu Feb 28 03:26:49 2002
+++ php4/ext/standard/uniqid.c Thu Dec 5 15:59:49 2002
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: uniqid.c,v 1.31 2002/02/28 08:26:49 sebastian Exp $ */
+/* $Id: uniqid.c,v 1.32 2002/12/05 20:59:49 helly Exp $ */
#include "php.h"
@@ -57,7 +57,7 @@
/* Do some bounds checking since we are using a char array. */
if (prefix_len > 114) {
- php_error(E_WARNING, "The prefix to uniqid should not be more than 114
characters.");
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "The prefix to uniqid
+should not be more than 114 characters.");
return;
}
#if HAVE_USLEEP && !defined(PHP_WIN32)
Index: php4/ext/standard/url.c
diff -u php4/ext/standard/url.c:1.59 php4/ext/standard/url.c:1.60
--- php4/ext/standard/url.c:1.59 Thu Nov 14 08:40:14 2002
+++ php4/ext/standard/url.c Thu Dec 5 15:59:49 2002
@@ -15,7 +15,7 @@
| Author: Jim Winstead <[EMAIL PROTECTED]> |
+----------------------------------------------------------------------+
*/
-/* $Id: url.c,v 1.59 2002/11/14 13:40:14 iliaa Exp $ */
+/* $Id: url.c,v 1.60 2002/12/05 20:59:49 helly Exp $ */
#include <stdlib.h>
#include <string.h>
@@ -285,7 +285,7 @@
resource = php_url_parse(str);
if (resource == NULL) {
- php_error(E_WARNING, "unable to parse url (%s)", str);
+ php_error_docref1(NULL TSRMLS_CC, str, E_WARNING, "Unable to parse
+url");
RETURN_FALSE;
}
Index: php4/ext/standard/var.c
diff -u php4/ext/standard/var.c:1.150 php4/ext/standard/var.c:1.151
--- php4/ext/standard/var.c:1.150 Fri Oct 11 09:49:20 2002
+++ php4/ext/standard/var.c Thu Dec 5 15:59:49 2002
@@ -457,7 +457,7 @@
(void **) &name, &pos);
if (Z_TYPE_PP(name) != IS_STRING) {
- php_error(E_NOTICE, "__sleep should return an array
only "
+ php_error_docref(NULL TSRMLS_CC, E_NOTICE, "__sleep
+should return an array only "
"containing the names of
instance-variables to "
"serialize.");
/* we should still add element even if it's not OK,
@@ -539,7 +539,7 @@
php_var_serialize_class(buf,
struc, retval_ptr,
var_hash
TSRMLS_CC);
} else {
- php_error(E_NOTICE, "__sleep
should return an array only "
+ php_error_docref(NULL
+TSRMLS_CC, E_NOTICE, "__sleep should return an array only "
"containing the names of instance-variables to "
"serialize.");
}
@@ -667,12 +667,12 @@
if (!php_var_unserialize(&return_value, &p, p + Z_STRLEN_PP(buf),
&var_hash TSRMLS_CC)) {
PHP_VAR_UNSERIALIZE_DESTROY(var_hash);
zval_dtor(return_value);
- php_error(E_NOTICE, "unserialize() failed at offset %d of %d
bytes", p - Z_STRVAL_PP(buf), Z_STRLEN_PP(buf));
+ php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Error at offset %d
+of %d bytes", p - Z_STRVAL_PP(buf), Z_STRLEN_PP(buf));
RETURN_FALSE;
}
PHP_VAR_UNSERIALIZE_DESTROY(var_hash);
} else {
- php_error(E_NOTICE, "argument passed to unserialize() is not an
string");
+ php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Argument is not an
+string");
RETURN_FALSE;
}
}
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php