helly Wed Oct 30 09:15:16 2002 EDT
Modified files:
/php4/ext/xslt sablot.c xslt.c
Log:
php_error -> php_error_docref
Index: php4/ext/xslt/sablot.c
diff -u php4/ext/xslt/sablot.c:1.59 php4/ext/xslt/sablot.c:1.60
--- php4/ext/xslt/sablot.c:1.59 Fri Oct 25 15:23:13 2002
+++ php4/ext/xslt/sablot.c Wed Oct 30 09:15:15 2002
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: sablot.c,v 1.59 2002/10/25 19:23:13 msopacua Exp $ */
+/* $Id: sablot.c,v 1.60 2002/10/30 14:15:15 helly Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -38,7 +38,7 @@
#include <fcntl.h>
/* functions relating to handlers */
-static void register_sax_handler_pair(zval **, zval **, zval **);
+static void register_sax_handler_pair(zval **, zval **, zval ** TSRMLS_DC);
/* Free processor */
static void free_processor(zend_rsrc_list_entry *rsrc TSRMLS_DC);
@@ -248,7 +248,7 @@
/* Convert the sax_handlers_p zval ** to a hash table we can process */
sax_handlers = HASH_OF(*sax_handlers_p);
if (!sax_handlers) {
- php_error(E_WARNING, "Expecting an array as the second argument to
xslt_set_sax_handlers()");
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Expecting an array as the
+second argument");
return;
}
@@ -260,7 +260,7 @@
key_type = zend_hash_get_current_key(sax_handlers, &string_key,
&num_key, 0);
if (key_type == HASH_KEY_IS_LONG) {
convert_to_string_ex(handler);
- php_error(E_NOTICE, "Skipping numerical index %d (with value
%s) in xslt_set_sax_handlers()",
+ php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Skipping numerical
+index %d (with value %s)",
num_key, Z_STRVAL_PP(handler));
continue;
}
@@ -270,21 +270,21 @@
SEPARATE_ZVAL(handler);
register_sax_handler_pair(&XSLT_SAX(handle).doc_start,
&XSLT_SAX(handle).doc_end,
- handler);
+ handler TSRMLS_CC);
}
/* Element handlers, start of an element, and end of an element */
else if (strcasecmp(string_key, "element") == 0) {
SEPARATE_ZVAL(handler);
register_sax_handler_pair(&XSLT_SAX(handle).element_start,
&XSLT_SAX(handle).element_end,
- handler);
+ handler TSRMLS_CC);
}
/* Namespace handlers, start of a namespace, end of a namespace */
else if (strcasecmp(string_key, "namespace") == 0) {
SEPARATE_ZVAL(handler);
register_sax_handler_pair(&XSLT_SAX(handle).namespace_start,
&XSLT_SAX(handle).namespace_end,
- handler);
+ handler TSRMLS_CC);
}
/* Comment handlers, called when a comment is reached */
else if (strcasecmp(string_key, "comment") == 0) {
@@ -304,7 +304,7 @@
}
/* Invalid handler name, tsk, tsk, tsk :) */
else {
- php_error(E_WARNING, "Invalid option to
xslt_set_sax_handlers(): %s", string_key);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid option:
+%s", string_key);
}
}
}
@@ -332,7 +332,7 @@
scheme_handlers = HASH_OF(*scheme_handlers_p);
if (!scheme_handlers) {
- php_error(E_WARNING, "2nd argument to xslt_set_scheme_handlers() must
be an array");
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "2nd argument must be an
+array");
return;
}
@@ -344,7 +344,7 @@
key_type = zend_hash_get_current_key(scheme_handlers, &string_key,
&num_key, 0);
if (key_type == HASH_KEY_IS_LONG) {
- php_error(E_NOTICE, "Numerical key %d (with value %s) being
ignored in xslt_set_scheme_handlers()",
+ php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Numerical key %d
+(with value %s) being ignored",
num_key, Z_STRVAL_PP(handler));
continue;
}
@@ -371,7 +371,7 @@
}
/* Invalid handler name */
else {
- php_error(E_WARNING, "%s() invalid option '%s', skipping",
get_active_function_name(TSRMLS_C), string_key);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid option
+'%s', skipping", string_key);
continue;
}
@@ -795,7 +795,7 @@
/* {{{ register_sax_handler_pair()
Register a pair of sax handlers */
-static void register_sax_handler_pair(zval **handler1, zval **handler2, zval
**handler)
+static void register_sax_handler_pair(zval **handler1, zval **handler2, zval
+**handler TSRMLS_DC)
{
zval **current; /* The current handler we're grabbing */
@@ -805,7 +805,7 @@
zval_add_ref(handler1);
}
else {
- php_error(E_WARNING, "Wrong format of arguments to
xslt_set_sax_handlers()");
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Wrong format of
+arguments");
return;
}
@@ -815,7 +815,7 @@
zval_add_ref(handler2);
}
else {
- php_error(E_WARNING, "Wrong format of arguments to
xslt_set_sax_handlers()");
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Wrong format of
+arguments");
return;
}
}
@@ -1452,6 +1452,7 @@
char *msgbuf = NULL;
/* Message buffer */
char msgformat[] = "Sablotron Message on line %s, level %s: %s\n"; /*
Message format */
int error = 0;
/* Error container */
+ TSRMLS_FETCH();
if (!XSLT_LOG(handle).do_log)
return 0;
@@ -1495,7 +1496,7 @@
/* Haven't seen this yet, but turning it on during dev, to see
what we can encounter -- MRS
else {
- php_error(E_WARNING, "Got key %s with val %s", key,
val);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Got key
+%s with val %s", key, val);
}
*/
@@ -1548,7 +1549,7 @@
O_WRONLY|O_CREAT|O_APPEND,
S_IRUSR|S_IRGRP|S_IROTH|S_IWUSR);
if (XSLT_LOG(handle).fd == -1) {
- php_error(E_WARNING, "Cannot open log file, %s [%d]:
%s",
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot
+open log file, %s [%d]: %s",
XSLT_LOG(handle).path, errno,
strerror(errno));
XSLT_LOG(handle).fd = 0;
}
@@ -1563,7 +1564,7 @@
/* Write the error to the file */
error = write(XSLT_LOG(handle).fd, msgbuf, strlen(msgbuf));
if (error == -1) {
- php_error(E_WARNING, "Cannot write data to log file, %s, with fd, %d
[%d]: %s",
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot write data to log
+file, %s, with fd, %d [%d]: %s",
(XSLT_LOG(handle).path ? XSLT_LOG(handle).path : "stderr"),
XSLT_LOG(handle).fd,
errno,
Index: php4/ext/xslt/xslt.c
diff -u php4/ext/xslt/xslt.c:1.26 php4/ext/xslt/xslt.c:1.27
--- php4/ext/xslt/xslt.c:1.26 Sun Oct 6 12:32:23 2002
+++ php4/ext/xslt/xslt.c Wed Oct 30 09:15:15 2002
@@ -92,8 +92,7 @@
arr = HASH_OF(*zarr);
if (! arr) {
- php_error(E_WARNING, "Invalid argument or parameter array to %s",
- get_active_function_name(TSRMLS_C));
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid argument or
+parameter array");
return;
}
@@ -111,8 +110,7 @@
type = zend_hash_get_current_key(arr, &string_key, &num_key, 0);
if (type == HASH_KEY_IS_LONG) {
- php_error(E_WARNING, "Invalid key value for argument or
parameter array to %s",
- get_active_function_name(TSRMLS_C));
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid key value
+for argument or parameter array");
/* Make the next index NULL, so it signals the end of the array
this will protect against invalid arrays, like:
array('foo'=>'bar', 'foobarred', 'oops') */
@@ -252,7 +250,7 @@
}
if (error == FAILURE) {
- php_error(E_WARNING, "Cannot call the %s handler: %s",
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot call the %s
+handler: %s",
name, Z_STRVAL_P(function));
}
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php