Re: [PHP-CVS] cvs: php-src /ext/standard ftp_fopen_wrapper.c php_string.h string.c

2003-12-12 Thread Moriyoshi Koizumi
Initially IsDBCSLeadByte() patch was introduced by Rui some time ago,
but this hasn't worked as expected so far. So I think the best way
to go at the time being is revert the patch, however it won't solve the
issue at all.
Indeed I can backport the patch in HEAD, but it might be so big
that it wouldn't appear applicable to the stable branch.
So I'm just trying to find a compromise. What do you think of this?

Moriyoshi

On 2003/12/12, at 8:16, Jani Taskinen wrote:

No MFH? Bug still open? What's the deal here?

--Jani

On Wed, 10 Dec 2003, Moriyoshi Koizumi wrote:

moriyoshi		Wed Dec 10 02:15:29 2003 EDT

 Modified files:
   /php-src/ext/standard	ftp_fopen_wrapper.c php_string.h string.c
 Log:
 Fix bug #26574 (basename() doesn't work properly with multibyte  
characters)

Index: php-src/ext/standard/ftp_fopen_wrapper.c
diff -u php-src/ext/standard/ftp_fopen_wrapper.c:1.66  
php-src/ext/standard/ftp_fopen_wrapper.c:1.67
--- php-src/ext/standard/ftp_fopen_wrapper.c:1.66	Sat Nov 29 15:01:00  
2003
+++ php-src/ext/standard/ftp_fopen_wrapper.c	Wed Dec 10 02:15:28 2003
@@ -18,7 +18,7 @@
   |  Sara Golemon [EMAIL PROTECTED]   
|

+- 
-+
 */
-/* $Id: ftp_fopen_wrapper.c,v 1.66 2003/11/29 20:01:00 pollita Exp $  
*/
+/* $Id: ftp_fopen_wrapper.c,v 1.67 2003/12/10 07:15:28 moriyoshi Exp  
$ */

#include php.h
#include php_globals.h
@@ -562,7 +562,7 @@
php_stream *innerstream = (php_stream *)stream-abstract;
size_t tmp_len;
char *basename;
-   int basename_len;
+   size_t basename_len;
if (count != sizeof(php_stream_dirent)) {
return 0;
@@ -586,8 +586,9 @@
return 0;
}
-	memcpy(ent-d_name, basename, MIN((int)sizeof(ent-d_name),  
basename_len)-1);
-	ent-d_name[sizeof(ent-d_name)-1] = '\0';
+	tmp_len = MIN(sizeof(ent-d_name), basename_len) - 1;
+	memcpy(ent-d_name, basename, tmp_len);
+	ent-d_name[tmp_len] = '\0';
	efree(basename);

	return sizeof(php_stream_dirent);
Index: php-src/ext/standard/php_string.h
diff -u php-src/ext/standard/php_string.h:1.81  
php-src/ext/standard/php_string.h:1.82
--- php-src/ext/standard/php_string.h:1.81	Wed Dec 10 01:08:39 2003
+++ php-src/ext/standard/php_string.h	Wed Dec 10 02:15:28 2003
@@ -17,7 +17,7 @@

+- 
-+
*/

-/* $Id: php_string.h,v 1.81 2003/12/10 06:08:39 moriyoshi Exp $ */
+/* $Id: php_string.h,v 1.82 2003/12/10 07:15:28 moriyoshi Exp $ */
/* Synced with php 3.0 revision 1.43 1999-06-16 [ssb] */

@@ -122,7 +122,7 @@
PHPAPI char *php_addcslashes(char *str, int length, int *new_length,  
int freeit, char *what, int wlength TSRMLS_DC);
PHPAPI void php_stripslashes(char *str, int *len TSRMLS_DC);
PHPAPI void php_stripcslashes(char *str, int *len);
-PHPAPI void php_basename(char *str, size_t  len , char *suffix,  
size_t sufflen, char **p_ret, int *p_len);
+PHPAPI void php_basename(char *str, size_t  len , char *suffix,  
size_t sufflen, char **p_ret, size_t *p_len);
PHPAPI size_t php_dirname(char *str, size_t len);
PHPAPI char *php_stristr(unsigned char *s, unsigned char *t, size_t  
s_len, size_t t_len);
PHPAPI char *php_str_to_str_ex(char *haystack, int length, char  
*needle,
Index: php-src/ext/standard/string.c
diff -u php-src/ext/standard/string.c:1.405  
php-src/ext/standard/string.c:1.406
--- php-src/ext/standard/string.c:1.405	Wed Dec 10 01:04:15 2003
+++ php-src/ext/standard/string.c	Wed Dec 10 02:15:28 2003
@@ -18,7 +18,7 @@

+- 
-+
 */

-/* $Id: string.c,v 1.405 2003/12/10 06:04:15 moriyoshi Exp $ */
+/* $Id: string.c,v 1.406 2003/12/10 07:15:28 moriyoshi Exp $ */
/* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */

@@ -1068,56 +1068,69 @@

/* {{{ php_basename
 */
-PHPAPI void php_basename(char *s, size_t len, char *suffix, size_t  
sufflen, char **p_ret, int *p_len)
+PHPAPI void php_basename(char *s, size_t len, char *suffix, size_t  
sufflen, char **p_ret, size_t *p_len)
{
-	char *ret=NULL, *c;
-	c = s + len - 1;	
-
-	/* strip trailing slashes */
-	while (*c == '/'
+	char *ret = NULL, *c, *comp, *cend;
+	size_t inc_len, cnt;
+	int state;
+
+	c = comp = cend = s;
+	cnt = len;
+	state = 0;
+	while (cnt  0) {
+		inc_len = (*c == '\0' ? 1: php_mblen(c, cnt));
+
+		switch (inc_len) {
+			case -2:
+			case -1:
+inc_len = 1;
+php_mblen(NULL, 0);
+break;
+			case 0:
+goto quit_loop;
+			case 1:
#ifdef PHP_WIN32
-		   || (*c == '\\'  !IsDBCSLeadByte(*(c-1)))
+if (*c == '/' || *c == '\\') {
+#else
+if (*c == '/') {
#endif
-	) {
-		c--;
-		len--;
+	if (state == 1) {
+		state = 0;
+		cend = c;
+	}
+} else {
+	if (state == 0) {
+		comp = c;
+		state = 1;
+	}
+}
+			default:
+break;
+		}
+		c += inc_len;
+		cnt -= inc_len;
	}

-   /* do suffix removal as the unix 

[PHP-CVS] cvs: php-src /main main.c

2003-12-12 Thread Marcus Boerger
helly   Fri Dec 12 02:59:47 2003 EDT

  Modified files:  
/php-src/main   main.c 
  Log:
  Add some comments here
  
Index: php-src/main/main.c
diff -u php-src/main/main.c:1.581 php-src/main/main.c:1.582
--- php-src/main/main.c:1.581   Mon Dec  1 05:47:08 2003
+++ php-src/main/main.c Fri Dec 12 02:59:46 2003
@@ -18,7 +18,7 @@
+--+
 */
 
-/* $Id: main.c,v 1.581 2003/12/01 10:47:08 sniper Exp $ */
+/* $Id: main.c,v 1.582 2003/12/12 07:59:46 helly Exp $ */
 
 /* {{{ includes
  */
@@ -467,7 +467,7 @@
  */
 PHPAPI void php_verror(const char *docref, const char *params, int type, const char 
*format, va_list args TSRMLS_DC)
 {
-   char *buffer = NULL, *docref_buf = NULL, *ref = NULL, *target = NULL;
+   char *buffer = NULL, *docref_buf = NULL, *target = NULL;
char *docref_target = , *docref_root = ;
char *p;
int buffer_len = 0;
@@ -514,6 +514,8 @@
docref_target = strchr(docref, '#');
docref = NULL;
}
+
+   /* no docref given but function is known (the default) */
if (!docref  is_function) {
spprintf(docref_buf, 0, function.%s, function);
while((p = strchr(docref_buf, '_')) != NULL) {
@@ -521,16 +523,25 @@
}
docref = docref_buf;
}
+
+   /* we have a docref for a function AND
+* - we show erroes in html mode OR
+* - the user wants to see the links anyway
+*/
if (docref  is_function  (PG(html_errors) || strlen(PG(docref_root {
if (strncmp(docref, http://;, 7)) {
+   /* We don't have 'http://' so we use docref_root */
+
+   char *ref;  /* temp copy for duplicated docref */
+
docref_root = PG(docref_root);
-   /* now check copy of extension */
+
ref = estrdup(docref);
if (docref_buf) {
efree(docref_buf);
}
docref_buf = ref;
-   docref = docref_buf;
+   /* strip of the target if any */
p = strrchr(ref, '#');
if (p) {
target = estrdup(p);
@@ -539,12 +550,14 @@
*p = '\0';
}
}
-   if ((!p || target)  PG(docref_ext)  
strlen(PG(docref_ext))) {
+   /* add the extension if it is set in ini */
+   if (PG(docref_ext)  strlen(PG(docref_ext))) {
spprintf(docref_buf, 0, %s%s, ref, PG(docref_ext));
efree(ref);
-   docref = docref_buf;
}
+   docref = docref_buf;
}
+   /* display html formatted or only show the additional links */
if (PG(html_errors)) {
spprintf(message, 0, %s [a href='%s%s%s'%s/a]: %s, 
origin, docref_root, docref, docref_target, docref, buffer);
} else {

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /main main.c

2003-12-12 Thread Marcus Boerger
helly   Fri Dec 12 03:25:23 2003 EDT

  Modified files:  
/php-src/main   main.c 
  Log:
  Do not use before they are initialized.
  
  
Index: php-src/main/main.c
diff -u php-src/main/main.c:1.582 php-src/main/main.c:1.583
--- php-src/main/main.c:1.582   Fri Dec 12 02:59:46 2003
+++ php-src/main/main.c Fri Dec 12 03:25:22 2003
@@ -18,7 +18,7 @@
+--+
 */
 
-/* $Id: main.c,v 1.582 2003/12/12 07:59:46 helly Exp $ */
+/* $Id: main.c,v 1.583 2003/12/12 08:25:22 helly Exp $ */
 
 /* {{{ includes
  */
@@ -576,7 +576,7 @@
php_error(type, %s, message);
efree(message);
 
-   if (PG(track_errors)  EG(active_symbol_table)) {
+   if (PG(track_errors)  module_initialized  EG(active_symbol_table)) {
zval *tmp;
ALLOC_INIT_ZVAL(tmp);
ZVAL_STRINGL(tmp, buffer, buffer_len, 1);
@@ -820,7 +820,7 @@
efree(buffer);
return;
}
-   if (PG(track_errors)  EG(active_symbol_table)) {
+   if (PG(track_errors)  module_initialized  EG(active_symbol_table)) {
pval *tmp;
 
ALLOC_ZVAL(tmp);

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/ming ming.c

2003-12-12 Thread Marcus Boerger
helly   Fri Dec 12 03:45:49 2003 EDT

  Modified files:  
/php-src/ext/ming   ming.c 
  Log:
  Actually register the class
  
Index: php-src/ext/ming/ming.c
diff -u php-src/ext/ming/ming.c:1.60 php-src/ext/ming/ming.c:1.61
--- php-src/ext/ming/ming.c:1.60Fri Nov 14 19:53:38 2003
+++ php-src/ext/ming/ming.c Fri Dec 12 03:45:49 2003
@@ -17,7 +17,7 @@
   +--+
 */
 
-/* $Id: ming.c,v 1.60 2003/11/15 00:53:38 fmk Exp $ */
+/* $Id: ming.c,v 1.61 2003/12/12 08:45:49 helly Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -3888,6 +3888,7 @@
action_class_entry_ptr = zend_register_internal_class(action_class_entry 
TSRMLS_CC);
morph_class_entry_ptr = zend_register_internal_class(morph_class_entry 
TSRMLS_CC);
sprite_class_entry_ptr = zend_register_internal_class(sprite_class_entry 
TSRMLS_CC);
+   sound_class_entry_ptr = zend_register_internal_class(sound_class_entry 
TSRMLS_CC);
 #ifdef HAVE_NEW_MING
fontchar_class_entry_ptr = zend_register_internal_class(fontchar_class_entry 
TSRMLS_CC);
soundinstance_class_entry_ptr = 
zend_register_internal_class(soundinstance_class_entry TSRMLS_CC);

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: CVSROOT / avail

2003-12-12 Thread Sascha Schumann
sas Fri Dec 12 04:18:22 2003 EDT

  Modified files:  
/CVSROOTavail 
  Log:
  php-src/sapi/opengroupware karma for jwk
  
  
Index: CVSROOT/avail
diff -u CVSROOT/avail:1.797 CVSROOT/avail:1.798
--- CVSROOT/avail:1.797 Thu Dec 11 14:49:06 2003
+++ CVSROOT/avail   Fri Dec 12 04:18:21 2003
@@ -197,6 +197,7 @@
 avail|ths|pear/HTML_QuickForm/Renderer
 avail|ecolinet|pecl/win32std
 avail|aleigh|php-src/sapi/continuity
+avail|jwk|php-src/sapi/opengroupware
 
 # Curl modules
 
avail|bagder,sterling,crisb,linus_nielsen|curl,curl-cpp,curl-java,curl-perl,curl-php,curl-www

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: CVSROOT / avail

2003-12-12 Thread Sascha Schumann
sas Fri Dec 12 04:26:50 2003 EDT

  Modified files:  
/CVSROOTavail 
  Log:
  pear/Validate karma for makler
  
  
Index: CVSROOT/avail
diff -u CVSROOT/avail:1.798 CVSROOT/avail:1.799
--- CVSROOT/avail:1.798 Fri Dec 12 04:18:21 2003
+++ CVSROOT/avail   Fri Dec 12 04:26:49 2003
@@ -198,6 +198,7 @@
 avail|ecolinet|pecl/win32std
 avail|aleigh|php-src/sapi/continuity
 avail|jwk|php-src/sapi/opengroupware
+avail|makler|pear/Validate
 
 # Curl modules
 
avail|bagder,sterling,crisb,linus_nielsen|curl,curl-cpp,curl-java,curl-perl,curl-php,curl-www

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/libxml libxml.c php_libxml.h

2003-12-12 Thread Rob Richards
rrichards   Fri Dec 12 08:54:07 2003 EDT

  Modified files:  
/php-src/ext/libxml php_libxml.h libxml.c 
  Log:
  consolidate error handling
  
Index: php-src/ext/libxml/php_libxml.h
diff -u php-src/ext/libxml/php_libxml.h:1.4 php-src/ext/libxml/php_libxml.h:1.5
--- php-src/ext/libxml/php_libxml.h:1.4 Tue Dec  9 16:55:02 2003
+++ php-src/ext/libxml/php_libxml.h Fri Dec 12 08:54:06 2003
@@ -17,7 +17,7 @@
+--+
 */
 
-/* $Id: php_libxml.h,v 1.4 2003/12/09 21:55:02 rrichards Exp $ */
+/* $Id: php_libxml.h,v 1.5 2003/12/12 13:54:06 rrichards Exp $ */
 
 #ifndef PHP_LIBXML_H
 #define PHP_LIBXML_H
@@ -73,6 +73,9 @@
 void php_libxml_node_free_resource(xmlNodePtr node TSRMLS_DC);
 /* When object dtor is called as node may still be referenced */
 void php_libxml_node_decrement_resource(php_libxml_node_object *object TSRMLS_DC);
+void php_libxml_error_handler(void *ctx, const char *msg, ...);
+void php_libxml_ctx_warning(void *ctx, const char *msg, ...);
+void php_libxml_ctx_error(void *ctx, const char *msg, ...);
 
 #endif /* HAVE_LIBXML */
 
Index: php-src/ext/libxml/libxml.c
diff -u php-src/ext/libxml/libxml.c:1.10 php-src/ext/libxml/libxml.c:1.11
--- php-src/ext/libxml/libxml.c:1.10Tue Dec  9 16:55:02 2003
+++ php-src/ext/libxml/libxml.c Fri Dec 12 08:54:06 2003
@@ -17,7 +17,7 @@
+--+
  */
 
-/* $Id: libxml.c,v 1.10 2003/12/09 21:55:02 rrichards Exp $ */
+/* $Id: libxml.c,v 1.11 2003/12/12 13:54:06 rrichards Exp $ */
 
 #define IS_EXT_MODULE
 
@@ -43,6 +43,10 @@
 
 #include php_libxml.h
 
+#define PHP_LIBXML_ERROR 0
+#define PHP_LIBXML_CTX_ERROR 1
+#define PHP_LIBXML_CTX_WARNING 2
+
 /* a true global for initialization */
 int _php_libxml_initialized = 0;
 
@@ -294,22 +298,33 @@
return php_stream_close((php_stream*)context);
 }
 
-static void php_libxml_error_handler(void *ctx, const char *msg, ...)
+static void php_libxml_ctx_error_level(int level, void *ctx, const char *msg 
TSRMLS_DC)
+{
+   xmlParserCtxtPtr parser;
+
+   parser = (xmlParserCtxtPtr) ctx;
+
+   if (parser != NULL  parser-input != NULL) {
+   if (parser-input-filename) {
+   php_error_docref(NULL TSRMLS_CC, level, %s in %s, line: %d, 
msg, parser-input-filename, parser-input-line);
+   } else {
+   php_error_docref(NULL TSRMLS_CC, level, %s in Entity, line: 
%d, msg, parser-input-line);
+   }
+   }
+}
+
+static void php_libxml_internal_error_handler(int error_type, void *ctx, const char 
**msg, va_list ap)
 {
-   va_list ap;
char *buf;
int len, len_iter, output = 0;
 
TSRMLS_FETCH();
 
-   va_start(ap, msg);
-   len = vspprintf(buf, 0, msg, ap);
-   va_end(ap);
-
+   len = vspprintf(buf, 0, *msg, ap);
len_iter = len;
 
/* remove any trailing \n */
-   while (len  buf[--len_iter] == '\n') {
+   while (len_iter  buf[--len_iter] == '\n') {
buf[len_iter] = '\0';
output = 1;
}
@@ -319,12 +334,46 @@
efree(buf);
 
if (output == 1) {
-   php_error(E_WARNING, %s, (char *) LIBXML(error_buffer));
+   switch (error_type) {
+   case PHP_LIBXML_CTX_ERROR:
+   php_libxml_ctx_error_level(E_WARNING, ctx, (char *) 
LIBXML(error_buffer) TSRMLS_CC);
+   break;
+   case PHP_LIBXML_CTX_WARNING:
+   php_libxml_ctx_error_level(E_NOTICE, ctx, (char *) 
LIBXML(error_buffer) TSRMLS_CC);
+   break;
+   default:
+   php_error(E_WARNING, %s, (char *) 
LIBXML(error_buffer));
+   }
smart_str_free(LIBXML(error_buffer));
LIBXML(error_buffer) = NULL;
}
 }
 
+void php_libxml_ctx_error(void *ctx, const char *msg, ...)
+{
+   va_list args;
+   va_start(args, msg);
+   php_libxml_internal_error_handler(PHP_LIBXML_CTX_ERROR, ctx, msg, args);
+   va_end(args);
+}
+
+void php_libxml_ctx_warning(void *ctx, const char *msg, ...)
+{
+   va_list args;
+   va_start(args, msg);
+   php_libxml_internal_error_handler(PHP_LIBXML_CTX_WARNING, ctx, msg, args);
+   va_end(args);
+}
+
+void php_libxml_error_handler(void *ctx, const char *msg, ...)
+{
+   va_list args;
+   va_start(args, msg);
+   php_libxml_internal_error_handler(PHP_LIBXML_ERROR, ctx, msg, args);
+   va_end(args);
+}
+
+
 PHP_LIBXML_API void php_libxml_initialize() {
if (!_php_libxml_initialized) {
/* we should be the only one's to ever init!! */

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/dom document.c

2003-12-12 Thread Rob Richards
rrichards   Fri Dec 12 08:54:53 2003 EDT

  Modified files:  
/php-src/ext/domdocument.c 
  Log:
  use error handling from libxml ext
  
Index: php-src/ext/dom/document.c
diff -u php-src/ext/dom/document.c:1.39 php-src/ext/dom/document.c:1.40
--- php-src/ext/dom/document.c:1.39 Mon Dec  1 03:18:35 2003
+++ php-src/ext/dom/document.c  Fri Dec 12 08:54:52 2003
@@ -17,7 +17,7 @@
+--+
 */
 
-/* $Id: document.c,v 1.39 2003/12/01 08:18:35 chregu Exp $ */
+/* $Id: document.c,v 1.40 2003/12/12 13:54:52 rrichards Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -97,85 +97,6 @@
{NULL, NULL, NULL}
 };
 
-static void php_dom_validate_error(void *ctx, const char *msg, ...)
-{
-   char *buf;
-   va_list ap;
-   int len;
-
-   va_start(ap, msg);
-   len = vspprintf(buf, 0, msg, ap);
-   va_end(ap);
-   
-   /* remove any trailing \n */
-   while (len  buf[--len] == '\n') {
-   buf[len] = '\0';
-   }
-
-   php_error(E_WARNING, %s, buf);
-   efree(buf);
-}
-
-/* {{{ static void php_dom_ctx_error_level(int level, void *ctx, const char *msg, 
...) */
-static void php_dom_ctx_error_level(int level, void *ctx, const char *msg)
-{
-   xmlParserCtxtPtr parser;
-   TSRMLS_FETCH();
-
-   parser = (xmlParserCtxtPtr) ctx;
-
-   if (parser != NULL  parser-input != NULL) {
-   if (parser-input-filename) {
-   php_error_docref(NULL TSRMLS_CC, level, %s in %s, line: %d, 
msg, parser-input-filename, parser-input-line);
-   } else {
-   php_error_docref(NULL TSRMLS_CC, level, %s in Entity, line: 
%d, msg, parser-input-line);
-   }
-   }
-}
-/* }}} end php_dom_ctx_error */
-
-/* {{{ static void php_dom_ctx_error(void *ctx, const char *msg, ...) */
-static void php_dom_ctx_error(void *ctx, const char *msg, ...)
-{
-   va_list ap;
-   char *buf;
-   int len;
-
-   va_start(ap, msg);
-   len = vspprintf(buf, 0, msg, ap);
-   va_end(ap);
-   
-   /* remove any trailing \n */
-   while (len  buf[--len] == '\n') {
-   buf[len] = '\0';
-   }
-
-   php_dom_ctx_error_level(E_WARNING, ctx, buf);
-   efree(buf);
-}
-/* }}} end php_dom_ctx_error */
-
-static void php_dom_ctx_warning(void *ctx, const char *msg, ...)
-{
-   va_list ap;
-   char *buf;
-   int len;
-
-   va_start(ap, msg);
-   len = vspprintf(buf, 0, msg, ap);
-   va_end(ap);
-   
-   /* remove any trailing \n */
-   while (len  buf[--len] == '\n') {
-   buf[len] = '\0';
-   }
-
-   php_dom_ctx_error_level(E_NOTICE, ctx, buf);
-   efree(buf);
-}
-/* }}} end php_dom_ctx_error */
-
-
 /* {{{ proto doctype   documenttype
 readonly=yes 
 URL: 
http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-B63ED1A31
@@ -1336,12 +1257,12 @@
 ctxt-loadsubset = (resolve_externals * XML_COMPLETE_ATTRS);
ctxt-replaceEntities = substitute_ent;
 
-   ctxt-vctxt.error = php_dom_ctx_error;
-   ctxt-vctxt.warning = php_dom_ctx_warning;
+   ctxt-vctxt.error = php_libxml_ctx_error;
+   ctxt-vctxt.warning = php_libxml_ctx_warning;
 
if (ctxt-sax != NULL) {
-   ctxt-sax-error = php_dom_ctx_error;
-   ctxt-sax-warning = php_dom_ctx_warning;
+   ctxt-sax-error = php_libxml_ctx_error;
+   ctxt-sax-warning = php_libxml_ctx_warning;
}
 
xmlParseDocument(ctxt);
@@ -1559,8 +1480,8 @@
}
 
cvp.userData = NULL;
-   cvp.error= (xmlValidityErrorFunc) php_dom_validate_error;
-   cvp.warning  = (xmlValidityErrorFunc) php_dom_validate_error;
+   cvp.error= (xmlValidityErrorFunc) php_libxml_error_handler;
+   cvp.warning  = (xmlValidityErrorFunc) php_libxml_error_handler;
 
if (xmlValidateDocument(cvp, docp)) {
RETVAL_TRUE;
@@ -1608,8 +1529,8 @@
}
 
xmlSchemaSetParserErrors(parser,
-   (xmlSchemaValidityErrorFunc) php_dom_validate_error,
-   (xmlSchemaValidityWarningFunc) php_dom_validate_error,
+   (xmlSchemaValidityErrorFunc) php_libxml_error_handler,
+   (xmlSchemaValidityWarningFunc) php_libxml_error_handler,
parser);
sptr = xmlSchemaParse(parser);
xmlSchemaFreeParserCtxt(parser);
@@ -1627,7 +1548,7 @@
RETURN_FALSE;
}
 
-   xmlSchemaSetValidErrors(vptr, php_dom_validate_error, php_dom_validate_error, 
vptr);
+   xmlSchemaSetValidErrors(vptr, php_libxml_error_handler, 
php_libxml_error_handler, vptr);
is_valid = xmlSchemaValidateDoc(vptr, docp);
xmlSchemaFree(sptr);
xmlSchemaFreeValidCtxt(vptr);
@@ -1691,8 +1612,8 @@
}
 
xmlRelaxNGSetParserErrors(parser,
-   

[PHP-CVS] cvs: php-src /sapi/continuity capi.c /sapi/nsapi nsapi.c

2003-12-12 Thread Uwe Schindler
thetaphiFri Dec 12 11:21:29 2003 EDT

  Modified files:  
/php-src/sapi/continuitycapi.c 
/php-src/sapi/nsapi nsapi.c 
  Log:
  remove revision tag from module version entry
  
Index: php-src/sapi/continuity/capi.c
diff -u php-src/sapi/continuity/capi.c:1.4 php-src/sapi/continuity/capi.c:1.5
--- php-src/sapi/continuity/capi.c:1.4  Tue Dec  9 11:24:03 2003
+++ php-src/sapi/continuity/capi.c  Fri Dec 12 11:21:27 2003
@@ -93,7 +93,7 @@
 NULL,
 NULL,
 PHP_MINFO(continuity),
-$Revision: 1.4 $,
+NO_VERSION_YET,
 STANDARD_MODULE_PROPERTIES
 };
 
@@ -110,7 +110,7 @@
 PHP_MINFO_FUNCTION(continuity)
 {
 php_info_print_table_start();
-php_info_print_table_row(2, Continuity Module Version, 
continuity_module_entry.version);
+php_info_print_table_row(2, Continuity Module Revision, $Revision: 1.5 $);
 php_info_print_table_row(2, Server Version, conFget_build());
 #ifdef CONTINUITY_CDPEXT
php_info_print_table_row(2,CDP Extensions, enabled);
Index: php-src/sapi/nsapi/nsapi.c
diff -u php-src/sapi/nsapi/nsapi.c:1.57 php-src/sapi/nsapi/nsapi.c:1.58
--- php-src/sapi/nsapi/nsapi.c:1.57 Fri Oct 31 12:31:46 2003
+++ php-src/sapi/nsapi/nsapi.c  Fri Dec 12 11:21:28 2003
@@ -17,7 +17,7 @@
+--+
 */
 
-/* $Id: nsapi.c,v 1.57 2003/10/31 17:31:46 thetaphi Exp $ */
+/* $Id: nsapi.c,v 1.58 2003/12/12 16:21:28 thetaphi Exp $ */
 
 /*
  * PHP includes
@@ -203,7 +203,7 @@
NULL,
NULL,
PHP_MINFO(nsapi),
-   $Revision: 1.57 $,
+   NO_VERSION_YET,
STANDARD_MODULE_PROPERTIES
 };
 /* }}} */
@@ -316,7 +316,7 @@
 PHP_MINFO_FUNCTION(nsapi)
 {
php_info_print_table_start();
-   php_info_print_table_row(2, NSAPI Module Version, 
nsapi_module_entry.version);
+   php_info_print_table_row(2, NSAPI Module Revision, $Revision: 1.58 $);
php_info_print_table_row(2, Server Software, system_version());
php_info_print_table_row(2, Sub-requests with nsapi_virtual(),
 (nsapi_servact_service)?((zend_ini_long(zlib.output_compression, 
sizeof(zlib.output_compression), 0))?not supported with 
zlib.output_compression:enabled):not supported on this platform );

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_4_3) /sapi/nsapi nsapi.c

2003-12-12 Thread Uwe Schindler
thetaphiFri Dec 12 11:21:45 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php-src/sapi/nsapi nsapi.c 
  Log:
  remove revision tag from module version entry
  
Index: php-src/sapi/nsapi/nsapi.c
diff -u php-src/sapi/nsapi/nsapi.c:1.28.2.24 php-src/sapi/nsapi/nsapi.c:1.28.2.25
--- php-src/sapi/nsapi/nsapi.c:1.28.2.24Sat Nov  1 18:56:58 2003
+++ php-src/sapi/nsapi/nsapi.c  Fri Dec 12 11:21:44 2003
@@ -17,7 +17,7 @@
+--+
 */
 
-/* $Id: nsapi.c,v 1.28.2.24 2003/11/01 23:56:58 thetaphi Exp $ */
+/* $Id: nsapi.c,v 1.28.2.25 2003/12/12 16:21:44 thetaphi Exp $ */
 
 /*
  * PHP includes
@@ -203,7 +203,7 @@
NULL,
NULL,
PHP_MINFO(nsapi),
-   $Revision: 1.28.2.24 $,
+   NO_VERSION_YET,
STANDARD_MODULE_PROPERTIES
 };
 /* }}} */
@@ -316,7 +316,7 @@
 PHP_MINFO_FUNCTION(nsapi)
 {
php_info_print_table_start();
-   php_info_print_table_row(2, NSAPI Module Version, 
nsapi_module_entry.version);
+   php_info_print_table_row(2, NSAPI Module Revision, $Revision: 1.28.2.25 $);
php_info_print_table_row(2, Server Software, system_version());
php_info_print_table_row(2, Sub-requests with nsapi_virtual(),
 (nsapi_servact_service)?((zend_ini_long(zlib.output_compression, 
sizeof(zlib.output_compression), 0))?not supported with 
zlib.output_compression:enabled):not supported on this platform );

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /sapi/apache2filter sapi_apache2.c /sapi/apache2handler sapi_apache2.c

2003-12-12 Thread Ilia Alshanetsky
iliaa   Fri Dec 12 12:19:11 2003 EDT

  Modified files:  
/php-src/sapi/apache2handlersapi_apache2.c 
/php-src/sapi/apache2filter sapi_apache2.c 
  Log:
  Fixed bug #26604 (Apache2 SAPIs implicitly disable Keep-Alive). (Ilia)
  
  
Index: php-src/sapi/apache2handler/sapi_apache2.c
diff -u php-src/sapi/apache2handler/sapi_apache2.c:1.29 
php-src/sapi/apache2handler/sapi_apache2.c:1.30
--- php-src/sapi/apache2handler/sapi_apache2.c:1.29 Tue Oct 21 07:48:31 2003
+++ php-src/sapi/apache2handler/sapi_apache2.c  Fri Dec 12 12:19:10 2003
@@ -18,7 +18,7 @@
+--+
  */
 
-/* $Id: sapi_apache2.c,v 1.29 2003/10/21 11:48:31 sniper Exp $ */
+/* $Id: sapi_apache2.c,v 1.30 2003/12/12 17:19:10 iliaa Exp $ */
 
 #include fcntl.h
 
@@ -427,7 +427,6 @@
apr_table_unset(r-headers_out, Last-Modified);
apr_table_unset(r-headers_out, Expires);
apr_table_unset(r-headers_out, ETag);
-   apr_table_unset(r-headers_in, Connection);
if (!PG(safe_mode) || (PG(safe_mode)  !ap_auth_type(r))) {
auth = apr_table_get(r-headers_in, Authorization);
php_handle_auth_data(auth TSRMLS_CC);
Index: php-src/sapi/apache2filter/sapi_apache2.c
diff -u php-src/sapi/apache2filter/sapi_apache2.c:1.119 
php-src/sapi/apache2filter/sapi_apache2.c:1.120
--- php-src/sapi/apache2filter/sapi_apache2.c:1.119 Sun Aug  3 15:31:56 2003
+++ php-src/sapi/apache2filter/sapi_apache2.c   Fri Dec 12 12:19:11 2003
@@ -18,7 +18,7 @@
+--+
  */
 
-/* $Id: sapi_apache2.c,v 1.119 2003/08/03 19:31:56 thetaphi Exp $ */
+/* $Id: sapi_apache2.c,v 1.120 2003/12/12 17:19:11 iliaa Exp $ */
 
 #include fcntl.h
 
@@ -398,7 +398,6 @@
apr_table_unset(f-r-headers_out, Last-Modified);
apr_table_unset(f-r-headers_out, Expires);
apr_table_unset(f-r-headers_out, ETag);
-   apr_table_unset(f-r-headers_in, Connection);
if (!PG(safe_mode) || (PG(safe_mode)  !ap_auth_type(f-r))) {
auth = apr_table_get(f-r-headers_in, Authorization);
php_handle_auth_data(auth TSRMLS_CC);

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_4_3) / NEWS /sapi/apache2filter sapi_apache2.c /sapi/apache2handler sapi_apache2.c

2003-12-12 Thread Ilia Alshanetsky
iliaa   Fri Dec 12 12:19:19 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php-srcNEWS 
/php-src/sapi/apache2handlersapi_apache2.c 
/php-src/sapi/apache2filter sapi_apache2.c 
  Log:
  MFH: Fixed bug #26604 (Apache2 SAPIs implicitly disable Keep-Alive). (Ilia)
  
  
Index: php-src/NEWS
diff -u php-src/NEWS:1.1247.2.499 php-src/NEWS:1.1247.2.500
--- php-src/NEWS:1.1247.2.499   Fri Dec 12 00:20:24 2003
+++ php-src/NEWSFri Dec 12 12:19:16 2003
@@ -7,6 +7,7 @@
   (Jani)
 - Fixed header handler in NSAPI SAPI module (header-replace was ignored,
   send_default_content_type now sends value from php.ini). (Uwe Schindler)
+- Fixed bug #26604 (Apache2 SAPIs implicitly disable Keep-Alive). (Ilia)
 - Fixed bug #26565 (strtotime(this month) resolving to the wrong month).
   (Jani)
 - Fixed bug #26564 (ncurses5 has headers in PREFIX/include/ncurses/). (Jani)
Index: php-src/sapi/apache2handler/sapi_apache2.c
diff -u php-src/sapi/apache2handler/sapi_apache2.c:1.1.2.23 
php-src/sapi/apache2handler/sapi_apache2.c:1.1.2.24
--- php-src/sapi/apache2handler/sapi_apache2.c:1.1.2.23 Wed Oct  1 23:24:43 2003
+++ php-src/sapi/apache2handler/sapi_apache2.c  Fri Dec 12 12:19:17 2003
@@ -18,7 +18,7 @@
+--+
  */
 
-/* $Id: sapi_apache2.c,v 1.1.2.23 2003/10/02 03:24:43 iliaa Exp $ */
+/* $Id: sapi_apache2.c,v 1.1.2.24 2003/12/12 17:19:17 iliaa Exp $ */
 
 #include fcntl.h
 
@@ -432,7 +432,6 @@
apr_table_unset(r-headers_out, Last-Modified);
apr_table_unset(r-headers_out, Expires);
apr_table_unset(r-headers_out, ETag);
-   apr_table_unset(r-headers_in, Connection);
if (!PG(safe_mode) || (PG(safe_mode)  !ap_auth_type(r))) {
auth = apr_table_get(r-headers_in, Authorization);
php_handle_auth_data(auth TSRMLS_CC);
Index: php-src/sapi/apache2filter/sapi_apache2.c
diff -u php-src/sapi/apache2filter/sapi_apache2.c:1.91.2.20 
php-src/sapi/apache2filter/sapi_apache2.c:1.91.2.21
--- php-src/sapi/apache2filter/sapi_apache2.c:1.91.2.20 Sun Aug  3 15:31:13 2003
+++ php-src/sapi/apache2filter/sapi_apache2.c   Fri Dec 12 12:19:18 2003
@@ -18,7 +18,7 @@
+--+
  */
 
-/* $Id: sapi_apache2.c,v 1.91.2.20 2003/08/03 19:31:13 thetaphi Exp $ */
+/* $Id: sapi_apache2.c,v 1.91.2.21 2003/12/12 17:19:18 iliaa Exp $ */
 
 #include fcntl.h
 
@@ -397,7 +397,6 @@
apr_table_unset(f-r-headers_out, Last-Modified);
apr_table_unset(f-r-headers_out, Expires);
apr_table_unset(f-r-headers_out, ETag);
-   apr_table_unset(f-r-headers_in, Connection);
if (!PG(safe_mode) || (PG(safe_mode)  !ap_auth_type(f-r))) {
auth = apr_table_get(f-r-headers_in, Authorization);
php_handle_auth_data(auth TSRMLS_CC);

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_4_3) /ext/standard file.c

2003-12-12 Thread Ilia Alshanetsky
iliaa   Fri Dec 12 14:25:34 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php-src/ext/standard   file.c 
  Log:
  For BC reasons we need to do ltrim() on csv entries.
  
  
Index: php-src/ext/standard/file.c
diff -u php-src/ext/standard/file.c:1.279.2.43 php-src/ext/standard/file.c:1.279.2.44
--- php-src/ext/standard/file.c:1.279.2.43  Sun Dec  7 16:55:16 2003
+++ php-src/ext/standard/file.c Fri Dec 12 14:25:33 2003
@@ -21,7 +21,7 @@
+--+
  */
 
-/* $Id: file.c,v 1.279.2.43 2003/12/07 21:55:16 moriyoshi Exp $ */
+/* $Id: file.c,v 1.279.2.44 2003/12/12 19:25:33 iliaa Exp $ */
 
 /* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */
 
@@ -2266,10 +2266,25 @@
 
array_init(return_value);
 
+#define CSV_ADD_ENTRY(s, es, st, copy) {   \
+   int len = es - st;  \
+   if (len) {  \
+   while (isspace((int)*(unsigned char *)s)) { \
+   s++;\
+   len--;  \
+   }   \
+   }   \
+   if (len) {  \
+   add_next_index_stringl(return_value, s, len, copy); \
+   } else {\
+   add_next_index_string(return_value, , 1); \
+   }   \
+}  \
+
if (!enclosure || !(p = _php_fgetcsv_find_enclosure(s, (e - s), enclosure))) {
 no_enclosure:
while ((p = memchr(s, delimiter, (e - s {
-   add_next_index_stringl(return_value, s, (p - s), 1);
+   CSV_ADD_ENTRY(s, p, s, 1);
s = p + 1;
}
} else {
@@ -2278,7 +2293,7 @@
 enclosure:
/* handle complete fields before the enclosure */
while (s  p  (p2 = memchr(s, delimiter, (p - s {
-   add_next_index_stringl(return_value, s, (p2 - s), 1);
+   CSV_ADD_ENTRY(s, p2, s, 1);
s = p2 + 1;
}
 
@@ -2322,7 +2337,7 @@
buf2_len += (p - p2);
}
buf2[buf2_len] = '\0';
-   add_next_index_stringl(return_value, buf2, buf2_len, 0);
+   CSV_ADD_ENTRY(buf2, buf2_len, 0, 0);
 
if (!(p = _php_fgetcsv_find_enclosure(s, (e - s), enclosure))) 
{
goto no_enclosure;
@@ -2342,12 +2357,12 @@
 enclosure_done:
s = e = NULL;
buf2[buf2_len] = '\0';
-   add_next_index_stringl(return_value, buf2, buf2_len, 0);
+   CSV_ADD_ENTRY(buf2, buf2_len, 0, 0);
}
}
 
if (s  e) {
-   add_next_index_stringl(return_value, s, (e - s), 1);
+   CSV_ADD_ENTRY(s, e, s, 1);
}
efree(buf);
 }

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src / README.PHP4-TO-PHP5-THIN-CHANGES

2003-12-12 Thread Andrey Hristov
andrey  Fri Dec 12 15:50:13 2003 EDT

  Modified files:  
/php-srcREADME.PHP4-TO-PHP5-THIN-CHANGES 
  Log:
  added entry about mysqli_fetch functions
  
  
Index: php-src/README.PHP4-TO-PHP5-THIN-CHANGES
diff -u php-src/README.PHP4-TO-PHP5-THIN-CHANGES:1.2 
php-src/README.PHP4-TO-PHP5-THIN-CHANGES:1.3
--- php-src/README.PHP4-TO-PHP5-THIN-CHANGES:1.2Sat Dec  6 11:49:13 2003
+++ php-src/README.PHP4-TO-PHP5-THIN-CHANGESFri Dec 12 15:50:12 2003
@@ -8,3 +8,5 @@
 2. Change illegal use of string offset from E_WARNING to E_ERROR
 3. array_merge() accepts only arrays. If non-array is passed a E_WARNING for every 
non-array
parameter will be throwed. Be careful because your code may start emitting 
E_WARNING out of the blue.
+4. Be careful when porting from ext/mysql to ext/mysqli. 
mysqli_fetch_row()/mysqli_fetch_array()/mysql_fetch_assoc()
+   retun NULL when there is no more data in the result set (ext/mysql's functions 
return FALSE).

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/bz2 bz2.c /ext/curl streams.c /ext/standard file.c ftp_fopen_wrapper.c http_fopen_wrapper.c php_fopen_wrapper.c /ext/zlib zlib_fopen_wrapper.c /main php_streams.h /main/streams plain_wrapper.c userspace.c

2003-12-12 Thread Sara Golemon
pollita Fri Dec 12 18:05:20 2003 EDT

  Modified files:  
/php-src/ext/standard   file.c ftp_fopen_wrapper.c 
http_fopen_wrapper.c php_fopen_wrapper.c 
/php-src/main   php_streams.h 
/php-src/main/streams   plain_wrapper.c userspace.c 
/php-src/ext/zlib   zlib_fopen_wrapper.c 
/php-src/ext/bz2bz2.c 
/php-src/ext/curl   streams.c 
  Log:
  Route rename() via wrapper ops.
  Move current rename() code to main/streams/plain_wrapper.c
  Implement ftp/rename()
  Implement userstreams/rename()
  
  Index: php-src/ext/standard/file.c
diff -u php-src/ext/standard/file.c:1.368 php-src/ext/standard/file.c:1.369
--- php-src/ext/standard/file.c:1.368   Wed Dec 10 01:08:39 2003
+++ php-src/ext/standard/file.c Fri Dec 12 18:05:15 2003
@@ -21,7 +21,7 @@
+--+
  */
 
-/* $Id: file.c,v 1.368 2003/12/10 06:08:39 moriyoshi Exp $ */
+/* $Id: file.c,v 1.369 2003/12/12 23:05:15 pollita Exp $ */
 
 /* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */
 
@@ -1437,48 +1437,40 @@
 }
 /* }}} */
 
-/* {{{ proto bool rename(string old_name, string new_name)
+/* {{{ proto bool rename(string old_name, string new_name[, resource context])
Rename a file */
 PHP_FUNCTION(rename)
 {
-   zval **old_arg, **new_arg;
char *old_name, *new_name;
-   int ret;
+   int old_name_len, new_name_len;
+   zval *zcontext = NULL;
+   php_stream_wrapper *wrapper;
+   php_stream_context *context;
 
-   if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, old_arg, new_arg) == 
FAILURE) {
-   WRONG_PARAM_COUNT;
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, ss|r, old_name, 
old_name_len, new_name, new_name_len, zcontext) == FAILURE) {
+   RETURN_FALSE;
}
 
-   convert_to_string_ex(old_arg);
-   convert_to_string_ex(new_arg);
-
-   old_name = Z_STRVAL_PP(old_arg);
-   new_name = Z_STRVAL_PP(new_arg);
+   wrapper = php_stream_locate_url_wrapper(old_name, NULL, 0 TSRMLS_CC);
 
-   if (PG(safe_mode) (!php_checkuid(old_name, NULL, 
CHECKUID_CHECK_FILE_AND_DIR))) {
+   if (!wrapper || !wrapper-wops) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, Unable to locate stream 
wrapper.);
RETURN_FALSE;
}
 
-   if (php_check_open_basedir(old_name TSRMLS_CC)) {
+   if (!wrapper-wops-rename) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, %s wrapper does not 
support renaming., wrapper-wops-label ? wrapper-wops-label : Source);
RETURN_FALSE;
}
 
-   ret = VCWD_RENAME(old_name, new_name);
-
-   if (ret == -1) {
-#ifdef EXDEV
-   if (errno == EXDEV) {
-   if (php_copy_file(old_name, new_name TSRMLS_CC) == SUCCESS) {
-   VCWD_UNLINK(old_name);
-   RETURN_TRUE;
-   }
-   }
-#endif 
-   php_error_docref2(NULL TSRMLS_CC, old_name, new_name, E_WARNING, %s, 
strerror(errno));
+   if (wrapper != php_stream_locate_url_wrapper(new_name, NULL, 0 TSRMLS_CC)) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, Cannot rename a file 
across wrapper types.);
RETURN_FALSE;
}
 
-   RETURN_TRUE;
+   context = php_stream_context_from_zval(zcontext, 0);
+
+   RETURN_BOOL(wrapper-wops-rename(wrapper, old_name, new_name, 0, context 
TSRMLS_CC));
 }
 /* }}} */
 
Index: php-src/ext/standard/ftp_fopen_wrapper.c
diff -u php-src/ext/standard/ftp_fopen_wrapper.c:1.68 
php-src/ext/standard/ftp_fopen_wrapper.c:1.69
--- php-src/ext/standard/ftp_fopen_wrapper.c:1.68   Wed Dec 10 16:23:34 2003
+++ php-src/ext/standard/ftp_fopen_wrapper.cFri Dec 12 18:05:15 2003
@@ -18,7 +18,7 @@
|  Sara Golemon [EMAIL PROTECTED]  |
+--+
  */
-/* $Id: ftp_fopen_wrapper.c,v 1.68 2003/12/10 21:23:34 iliaa Exp $ */
+/* $Id: ftp_fopen_wrapper.c,v 1.69 2003/12/12 23:05:15 pollita Exp $ */
 
 #include php.h
 #include php_globals.h
@@ -842,6 +842,89 @@
 }
 /* }}} */
 
+/* {{{ php_stream_ftp_rename
+ */
+static int php_stream_ftp_rename(php_stream_wrapper *wrapper, char *url_from, char 
*url_to, int options, php_stream_context *context TSRMLS_DC)
+{
+   php_stream *stream = NULL;
+   php_url *resource_from = NULL, *resource_to = NULL;
+   int result;
+   char tmp_line[512];
+
+   resource_from = php_url_parse(url_from);
+   resource_to = php_url_parse(url_to);
+   /* Must be same scheme (ftp/ftp or ftps/ftps), same host, and same port 
+   (or a 21/0 0/21 combination which is also same) 
+  Also require paths to/from */
+   if (!resource_from ||
+   !resource_to ||
+   !resource_from-scheme ||
+

[PHP-CVS] cvs: php-src / NEWS

2003-12-12 Thread Sara Golemon
pollita Fri Dec 12 18:06:43 2003 EDT

  Modified files:  
/php-srcNEWS 
  Log:
  Route rename() via wrapper ops.
  Move current rename() code to main/streams/plain_wrapper.c
  Implement ftp/rename()
  Implement userstreams/rename()
  
  
Index: php-src/NEWS
diff -u php-src/NEWS:1.1530 php-src/NEWS:1.1531
--- php-src/NEWS:1.1530 Fri Dec 12 01:34:06 2003
+++ php-src/NEWSFri Dec 12 18:06:42 2003
@@ -25,6 +25,9 @@
   . stream_socket_sendto() and stream_socket_recvfrom(). (Wez)
   . iconv_mime_decode_headers(). (Moriyoshi)
   . get_declared_interfaces(). (Andrey, Marcus)
+- Added rename() support to userstreams. (Sara)
+- Added rename() support to ftp:// wrapper. (Sara)
+- Changed rename() to be routed via streams API. (Sara)
 - Changed stat() and family to be routed via streams API. (Sara)
 - Fixed include_once() / require_once() on Windows to honor case-insensitivity
   of files. (Andi)

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/mysqli mysqli_profiler.c mysqli_profiler.h mysqli_profiler_com.c mysqli_profiler_com.h

2003-12-12 Thread Georg Richter
georg   Fri Dec 12 19:46:48 2003 EDT

  Removed files:   
/php-src/ext/mysqli mysqli_profiler.c mysqli_profiler.h 
mysqli_profiler_com.c mysqli_profiler_com.h 
  Log:
  removed profiler stuff
  
  

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src(PHP_4_3) /ext/standard file.c

2003-12-12 Thread Ilia Alshanetsky
iliaa   Fri Dec 12 20:44:25 2003 EDT

  Modified files:  (Branch: PHP_4_3)
/php-src/ext/standard   file.c 
  Log:
  More fgetcsv() fixes.
  
  
Index: php-src/ext/standard/file.c
diff -u php-src/ext/standard/file.c:1.279.2.44 php-src/ext/standard/file.c:1.279.2.45
--- php-src/ext/standard/file.c:1.279.2.44  Fri Dec 12 14:25:33 2003
+++ php-src/ext/standard/file.c Fri Dec 12 20:44:24 2003
@@ -21,7 +21,7 @@
+--+
  */
 
-/* $Id: file.c,v 1.279.2.44 2003/12/12 19:25:33 iliaa Exp $ */
+/* $Id: file.c,v 1.279.2.45 2003/12/13 01:44:24 iliaa Exp $ */
 
 /* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */
 
@@ -2266,7 +2266,7 @@
 
array_init(return_value);
 
-#define CSV_ADD_ENTRY(s, es, st, copy) {   \
+#define CSV_ADD_ENTRY(s, es, st)   {   \
int len = es - st;  \
if (len) {  \
while (isspace((int)*(unsigned char *)s)) { \
@@ -2275,7 +2275,7 @@
}   \
}   \
if (len) {  \
-   add_next_index_stringl(return_value, s, len, copy); \
+   add_next_index_stringl(return_value, s, len, 1);\
} else {\
add_next_index_string(return_value, , 1); \
}   \
@@ -2284,29 +2284,23 @@
if (!enclosure || !(p = _php_fgetcsv_find_enclosure(s, (e - s), enclosure))) {
 no_enclosure:
while ((p = memchr(s, delimiter, (e - s {
-   CSV_ADD_ENTRY(s, p, s, 1);
+   CSV_ADD_ENTRY(s, p, s);
s = p + 1;
}
} else {
-   char *p2=NULL, *buf2;
-   int buf2_len;
+   char *p2=NULL, *buf2=NULL;
+   int buf2_len=0;
 enclosure:
/* handle complete fields before the enclosure */
while (s  p  (p2 = memchr(s, delimiter, (p - s {
-   CSV_ADD_ENTRY(s, p2, s, 1);
+   CSV_ADD_ENTRY(s, p2, s);
s = p2 + 1;
}
 
-   if ((p - s)) {
-   buf2_len = p - s;
-   buf2 = emalloc(buf2_len + 1);
-   memcpy(buf2, s, buf2_len);
-   } else {
-   buf2 = NULL;
-   buf2_len = 0;
+   p++;
+   if (*s == enclosure) {
s++;
}
-   p++;
 
/* try to find end of enclosure */
while (!(p2 = _php_fgetcsv_find_enclosure(p, (e - p), enclosure))) {
@@ -2336,8 +2330,8 @@
memcpy(buf2 + buf2_len, p2, (p - p2));
buf2_len += (p - p2);
}
-   buf2[buf2_len] = '\0';
-   CSV_ADD_ENTRY(buf2, buf2_len, 0, 0);
+   CSV_ADD_ENTRY(buf2, buf2_len, 0);
+   buf2_len = 0;
 
if (!(p = _php_fgetcsv_find_enclosure(s, (e - s), enclosure))) 
{
goto no_enclosure;
@@ -2355,15 +2349,18 @@
buf2_len += (e - s);
}
 enclosure_done:
-   s = e = NULL;
-   buf2[buf2_len] = '\0';
-   CSV_ADD_ENTRY(buf2, buf2_len, 0, 0);
+   CSV_ADD_ENTRY(buf2, buf2_len, 0);
+   if (buf2) {
+   efree(buf2);
+   }
+   goto done;
}
}
 
if (s  e) {
-   CSV_ADD_ENTRY(s, e, s, 1);
+   CSV_ADD_ENTRY(s, e, s);
}
+done:
efree(buf);
 }
 /* }}} */

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src / NEWS /ext/bz2 bz2.c /ext/curl streams.c /ext/standard file.c ftp_fopen_wrapper.c http_fopen_wrapper.c php_fopen_wrapper.c /ext/zlib zlib_fopen_wrapper.c /main php_streams.h /main/streams plain_wrapper.c streams.c userspace.c

2003-12-12 Thread Sara Golemon
pollita Fri Dec 12 23:07:19 2003 EDT

  Modified files:  
/php-src/main   php_streams.h 
/php-src/main/streams   streams.c plain_wrapper.c userspace.c 
/php-src/ext/standard   file.c ftp_fopen_wrapper.c 
http_fopen_wrapper.c php_fopen_wrapper.c 
/php-src/ext/zlib   zlib_fopen_wrapper.c 
/php-src/ext/bz2bz2.c 
/php-src/ext/curl   streams.c 
/php-srcNEWS 
  Log:
  Route mkdir()/rmdir() via wrapper ops.
  Move current rmdir()/rmdir() code to plain_wrappers.c
  Implement mkdir()/rmdir() in ftp:// wrapper
  
  Index: php-src/main/php_streams.h
diff -u php-src/main/php_streams.h:1.88 php-src/main/php_streams.h:1.89
--- php-src/main/php_streams.h:1.88 Fri Dec 12 18:05:16 2003
+++ php-src/main/php_streams.h  Fri Dec 12 23:07:13 2003
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: php_streams.h,v 1.88 2003/12/12 23:05:16 pollita Exp $ */
+/* $Id: php_streams.h,v 1.89 2003/12/13 04:07:13 pollita Exp $ */
 
 #ifndef PHP_STREAMS_H
 #define PHP_STREAMS_H
@@ -151,6 +151,10 @@
 
/* rename a file */
int (*rename)(php_stream_wrapper *wrapper, char *url_from, char *url_to, int 
options, php_stream_context *context TSRMLS_DC);
+
+   /* Create/Remove directory */
+   int (*mkdir)(php_stream_wrapper *wrapper, char *url, int mode, int options, 
php_stream_context *context TSRMLS_DC);
+   int (*rmdir)(php_stream_wrapper *wrapper, char *url, int options, 
php_stream_context *context TSRMLS_DC);
 } php_stream_wrapper_ops;
 
 struct _php_stream_wrapper {
@@ -308,6 +312,12 @@
 #define php_stream_stat_path(path, ssb)_php_stream_stat_path((path), 0, 
(ssb), NULL TSRMLS_CC)
 #define php_stream_stat_path_ex(path, flags, ssb, context) 
_php_stream_stat_path((path), (flags), (ssb), (context) TSRMLS_CC)
 
+PHPAPI int _php_stream_mkdir(char *path, int mode, int options, php_stream_context 
*context TSRMLS_DC);
+#define php_stream_mkdir(path, mode, options, context) _php_stream_mkdir(path, mode, 
options, context TSRMLS_CC)
+
+PHPAPI int _php_stream_rmdir(char *path, int options, php_stream_context *context 
TSRMLS_DC);
+#define php_stream_rmdir(path, options, context)   _php_stream_rmdir(path, 
options, context TSRMLS_CC)
+
 PHPAPI php_stream *_php_stream_opendir(char *path, int options, php_stream_context 
*context STREAMS_DC TSRMLS_DC);
 #define php_stream_opendir(path, options, context) _php_stream_opendir((path), 
(options), (context) STREAMS_CC TSRMLS_CC)
 PHPAPI php_stream_dirent *_php_stream_readdir(php_stream *dirstream, 
php_stream_dirent *ent TSRMLS_DC);
@@ -320,6 +330,13 @@
 
 #define php_stream_set_chunk_size(stream, size) _php_stream_set_option((stream), 
PHP_STREAM_OPTION_SET_CHUNK_SIZE, (size), NULL TSRMLS_CC)
 
+/* Flags for mkdir method in wrapper ops */
+#define PHP_STREAM_MKDIR_RECURSIVE 1
+/* define REPORT ERRORS 8 (below) */
+
+/* Flags for rmdir method in wrapper ops */
+/* define REPORT_ERRORS 8 (below) */
+
 /* Flags for url_stat method in wrapper ops */
 #define PHP_STREAM_URL_STAT_LINK   1
 #define PHP_STREAM_URL_STAT_QUIET  2
Index: php-src/main/streams/streams.c
diff -u php-src/main/streams/streams.c:1.44 php-src/main/streams/streams.c:1.45
--- php-src/main/streams/streams.c:1.44 Fri Dec  5 08:41:02 2003
+++ php-src/main/streams/streams.c  Fri Dec 12 23:07:14 2003
@@ -19,7 +19,7 @@
+--+
  */
 
-/* $Id: streams.c,v 1.44 2003/12/05 13:41:02 wez Exp $ */
+/* $Id: streams.c,v 1.45 2003/12/13 04:07:14 pollita Exp $ */
 
 #define _GNU_SOURCE
 #include php.h
@@ -1457,6 +1457,36 @@
 }
 /* }}} */
 
+/* {{{ _php_stream_mkdir
+ */
+PHPAPI int _php_stream_mkdir(char *path, int mode, int options, php_stream_context 
*context TSRMLS_DC)
+{
+   php_stream_wrapper *wrapper = NULL;
+
+   wrapper = php_stream_locate_url_wrapper(path, NULL, ENFORCE_SAFE_MODE 
TSRMLS_CC);
+   if (!wrapper || !wrapper-wops || !wrapper-wops-mkdir) {
+   return 0;
+   }
+
+   return wrapper-wops-mkdir(wrapper, path, mode, options, context TSRMLS_CC);
+}
+/* }}} */
+
+/* {{{ _php_stream_rmdir
+ */
+PHPAPI int _php_stream_rmdir(char *path, int options, php_stream_context *context 
TSRMLS_DC)
+{
+   php_stream_wrapper *wrapper = NULL;
+
+   wrapper = php_stream_locate_url_wrapper(path, NULL, ENFORCE_SAFE_MODE 
TSRMLS_CC);
+   if (!wrapper || !wrapper-wops || !wrapper-wops-rmdir) {
+   return 0;
+   }
+
+   return wrapper-wops-rmdir(wrapper, path, options, context TSRMLS_CC);
+}
+/* }}} */
+
 /* {{{ _php_stream_stat_path */
 PHPAPI int _php_stream_stat_path(char *path, int flags, php_stream_statbuf *ssb, 
php_stream_context *context TSRMLS_DC)
 {
Index: php-src/main/streams/plain_wrapper.c
diff -u php-src/main/streams/plain_wrapper.c:1.31 
php-src/main/streams/plain_wrapper.c:1.32
---