[PHP-CVS-DAILY] cvs: ZendEngine2 / ChangeLog

2006-03-31 Thread changelog
changelog   Sat Apr  1 06:31:49 2006 UTC

  Modified files:  
/ZendEngine2ChangeLog 
  Log:
  ChangeLog update
  
http://cvs.php.net/viewcvs.cgi/ZendEngine2/ChangeLog?r1=1.891r2=1.892diff_format=u
Index: ZendEngine2/ChangeLog
diff -u ZendEngine2/ChangeLog:1.891 ZendEngine2/ChangeLog:1.892
--- ZendEngine2/ChangeLog:1.891 Fri Mar 31 06:31:50 2006
+++ ZendEngine2/ChangeLog   Sat Apr  1 06:31:49 2006
@@ -1,3 +1,15 @@
+2006-03-31  Sara Golemon  [EMAIL PROTECTED]
+
+* zend.c
+  zend_globals.h:
+  Add API hooks and unicode.filesystem_encoding for handling unicode
+  conversions of filename entries.
+  
+  Normal path conversions will simply use this converter,
+  Certain other protocols (such as http) which specify a
+  required character set (utf8), may override the conversion
+  by defining a path_encode() and/or path_decode() wrapper ops method.
+
 2006-03-30  Antony Dovgal  [EMAIL PROTECTED]
 
 * zend.c
@@ -12998,7 +13010,7 @@
 2003-06-10  Jani Taskinen  [EMAIL PROTECTED]
 
 * zend_multiply.h:
-  - Missing $Id: ChangeLog,v 1.891 2006/03/31 06:31:50 changelog Exp $ tag
+  - Missing $Id: ChangeLog,v 1.892 2006/04/01 06:31:49 changelog Exp $ tag
 
 2003-06-10  James Cox  [EMAIL PROTECTED]
 
@@ -14722,7 +14734,7 @@
   zend_types.h
   zend_variables.c
   zend_variables.h:
-  - Added some missing CVS $Id: ChangeLog,v 1.891 2006/03/31 06:31:50 
changelog Exp $ tags, headers and footers.
+  - Added some missing CVS $Id: ChangeLog,v 1.892 2006/04/01 06:31:49 
changelog Exp $ tags, headers and footers.
 
 2003-01-30  Ilia Alshanetsky  [EMAIL PROTECTED]
 


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

2006-03-31 Thread Antony Dovgal
tony2001Fri Mar 31 11:11:12 2006 UTC

  Modified files:  (Branch: PHP_5_1)
/php-src/ext/standard   info.c 
  Log:
  fix compile failure with old GCC (see bug #36931)
  
  
http://cvs.php.net/viewcvs.cgi/php-src/ext/standard/info.c?r1=1.249.2.9r2=1.249.2.10diff_format=u
Index: php-src/ext/standard/info.c
diff -u php-src/ext/standard/info.c:1.249.2.9 
php-src/ext/standard/info.c:1.249.2.10
--- php-src/ext/standard/info.c:1.249.2.9   Thu Mar 30 19:58:18 2006
+++ php-src/ext/standard/info.c Fri Mar 31 11:11:12 2006
@@ -18,7 +18,7 @@
+--+
 */
 
-/* $Id: info.c,v 1.249.2.9 2006/03/30 19:58:18 tony2001 Exp $ */
+/* $Id: info.c,v 1.249.2.10 2006/03/31 11:11:12 tony2001 Exp $ */
 
 #include php.h
 #include php_ini.h
@@ -61,10 +61,12 @@

 static int php_info_write_wrapper(const char *str, uint str_length)
 {
+   int new_len, written;
+   char *elem_esc;
+
TSRMLS_FETCH();
 
-   int new_len, written;
-   char *elem_esc = php_escape_html_entities((char *)str, str_length, 
new_len, 0, ENT_QUOTES, NULL TSRMLS_CC);
+   elem_esc = php_escape_html_entities((char *)str, str_length, new_len, 
0, ENT_QUOTES, NULL TSRMLS_CC);
 
written = php_body_write(elem_esc, new_len TSRMLS_CC);
 

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



[PHP-CVS] cvs: php-src /ext/standard file.c /main php_streams.h /main/streams streams.c ZendEngine2 zend.c zend_globals.h

2006-03-31 Thread Sara Golemon
pollita Fri Mar 31 22:51:37 2006 UTC

  Modified files:  
/ZendEngine2zend.c zend_globals.h 
/php-src/ext/standard   file.c 
/php-src/main   php_streams.h 
/php-src/main/streams   streams.c 
  Log:
  Add API hooks and unicode.filesystem_encoding for handling unicode
  conversions of filename entries.
  
  Normal path conversions will simply use this converter,
  Certain other protocols (such as http) which specify a
  required character set (utf8), may override the conversion
  by defining a path_encode() and/or path_decode() wrapper ops method.
  
  http://cvs.php.net/viewcvs.cgi/ZendEngine2/zend.c?r1=1.349r2=1.350diff_format=u
Index: ZendEngine2/zend.c
diff -u ZendEngine2/zend.c:1.349 ZendEngine2/zend.c:1.350
--- ZendEngine2/zend.c:1.349Thu Mar 30 21:39:15 2006
+++ ZendEngine2/zend.c  Fri Mar 31 22:51:37 2006
@@ -17,7 +17,7 @@
+--+
 */
 
-/* $Id: zend.c,v 1.349 2006/03/30 21:39:15 tony2001 Exp $ */
+/* $Id: zend.c,v 1.350 2006/03/31 22:51:37 pollita Exp $ */
 
 #include zend.h
 #include zend_extensions.h
@@ -179,6 +179,7 @@
STD_ZEND_INI_ENTRY(unicode.runtime_encoding,  NULL, ZEND_INI_ALL, 
OnUpdateEncoding,   runtime_encoding_conv, zend_unicode_globals, 
unicode_globals)
STD_ZEND_INI_ENTRY(unicode.script_encoding,  NULL, ZEND_INI_ALL, 
OnUpdateEncoding,   script_encoding_conv, zend_unicode_globals, unicode_globals)
STD_ZEND_INI_ENTRY(unicode.http_input_encoding,  NULL, ZEND_INI_ALL, 
OnUpdateEncoding,   http_input_encoding_conv, zend_unicode_globals, 
unicode_globals)
+   STD_ZEND_INI_ENTRY(unicode.filesystem_encoding,  NULL, ZEND_INI_ALL, 
OnUpdateEncoding,   filesystem_encoding_conv, zend_unicode_globals, 
unicode_globals)
 ZEND_INI_END()
 
 
http://cvs.php.net/viewcvs.cgi/ZendEngine2/zend_globals.h?r1=1.154r2=1.155diff_format=u
Index: ZendEngine2/zend_globals.h
diff -u ZendEngine2/zend_globals.h:1.154 ZendEngine2/zend_globals.h:1.155
--- ZendEngine2/zend_globals.h:1.154Sun Mar 26 06:19:24 2006
+++ ZendEngine2/zend_globals.h  Fri Mar 31 22:51:37 2006
@@ -17,7 +17,7 @@
+--+
 */
 
-/* $Id: zend_globals.h,v 1.154 2006/03/26 06:19:24 andrei Exp $ */
+/* $Id: zend_globals.h,v 1.155 2006/03/31 22:51:37 pollita Exp $ */
 
 #ifndef ZEND_GLOBALS_H
 #define ZEND_GLOBALS_H
@@ -299,6 +299,7 @@
UConverter *output_encoding_conv;/* output layer converter */
UConverter *script_encoding_conv;/* default script encoding 
converter */
UConverter *http_input_encoding_conv;/* http input encoding converter */
+   UConverter *filesystem_encoding_conv;/* default filesystem converter 
(entries, not contents) */ 
UConverter *utf8_conv;   /* all-purpose UTF-8 
converter */
 
uint16_t from_error_mode;
http://cvs.php.net/viewcvs.cgi/php-src/ext/standard/file.c?r1=1.433r2=1.434diff_format=u
Index: php-src/ext/standard/file.c
diff -u php-src/ext/standard/file.c:1.433 php-src/ext/standard/file.c:1.434
--- php-src/ext/standard/file.c:1.433   Thu Mar 30 00:22:51 2006
+++ php-src/ext/standard/file.c Fri Mar 31 22:51:37 2006
@@ -21,7 +21,7 @@
+--+
  */
 
-/* $Id: file.c,v 1.433 2006/03/30 00:22:51 pollita Exp $ */
+/* $Id: file.c,v 1.434 2006/03/31 22:51:37 pollita Exp $ */
 
 /* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */
 
@@ -866,25 +866,34 @@
 }
 /* }}} */
 
-/* {{{ proto resource fopen(string filename, string mode [, bool 
use_include_path [, resource context]])
+/* {{{ proto resource fopen(string filename, string mode [, bool 
use_include_path [, resource context]]) U
Open a file or a URL and return a file pointer */
 PHP_NAMED_FUNCTION(php_if_fopen)
 {
char *filename, *mode;
int filename_len, mode_len;
+   zend_uchar filename_type;
zend_bool use_include_path = 0;
zval *zcontext = NULL;
php_stream *stream;
php_stream_context *context = NULL;
 
-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, ss|br, 
filename, filename_len,
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, ts|br, 
filename, filename_len, filename_type,
mode, mode_len, use_include_path, zcontext) 
== FAILURE) {
RETURN_FALSE;
}
 
context = php_stream_context_from_zval(zcontext, 0);
-   
+
+   if (filename_type == IS_UNICODE) {
+   if (php_stream_path_encode(NULL, filename, filename_len, 
filename, filename_len, REPORT_ERRORS, context) == FAILURE) {
+   RETURN_FALSE;
+   }
+   }
stream = php_stream_open_wrapper_ex(filename, mode, (use_include_path ? 
USE_PATH : 0) | REPORT_ERRORS, NULL, context);
+   if (filename_type == IS_UNICODE) {
+   efree(filename);
+   

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

2006-03-31 Thread Pierre-Alain Joye
pajoye  Fri Mar 31 23:20:58 2006 UTC

  Modified files:  
/php-src/ext/xmlreader  php_xmlreader.c 
  Log:
  - move setSchema to the 2.6.20 block, this method is only available from
this version
  
  
http://cvs.php.net/viewcvs.cgi/php-src/ext/xmlreader/php_xmlreader.c?r1=1.31r2=1.32diff_format=u
Index: php-src/ext/xmlreader/php_xmlreader.c
diff -u php-src/ext/xmlreader/php_xmlreader.c:1.31 
php-src/ext/xmlreader/php_xmlreader.c:1.32
--- php-src/ext/xmlreader/php_xmlreader.c:1.31  Fri Mar 31 20:50:29 2006
+++ php-src/ext/xmlreader/php_xmlreader.c   Fri Mar 31 23:20:58 2006
@@ -16,7 +16,7 @@
   +--+
 */
 
-/* $Id: php_xmlreader.c,v 1.31 2006/03/31 20:50:29 helly Exp $ */
+/* $Id: php_xmlreader.c,v 1.32 2006/03/31 23:20:58 pajoye Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -944,6 +944,47 @@
php_xmlreader_no_arg_string(INTERNAL_FUNCTION_PARAM_PASSTHRU, 
xmlTextReaderReadString);
 }
 /* }}} */
+
+/* {{{ proto boolean XMLReader::setSchema(string filename)
+Use W3C XSD schema to validate the document as it is processed. Activation is 
only possible before the first Read(). */
+PHP_METHOD(xmlreader, setSchema)
+{
+#ifdef LIBXML_SCHEMAS_ENABLED
+   zval *id;
+   int source_len = 0, retval = -1;
+   xmlreader_object *intern;
+   char *source;
+
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, s!, source, 
source_len) == FAILURE) {
+   return;
+   }
+
+   if (source != NULL  !source_len) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, Schema data source 
is required);
+   RETURN_FALSE;
+   }
+
+   id = getThis();
+
+   intern = (xmlreader_object *)zend_object_store_get_object(id TSRMLS_CC);
+   if (intern  intern-ptr) {
+   retval = xmlTextReaderSchemaValidate(intern-ptr, source);
+
+   if (retval == 0) {
+   RETURN_TRUE;
+   }
+   }
+   
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, Unable to set schema. This 
must be set prior to reading or schema contains errors.);
+
+   RETURN_FALSE;
+#else
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, No Schema support built 
into libxml.);
+
+   RETURN_FALSE;
+#endif
+}
+/* }}} */
 #endif
 
 /* {{{ proto boolean XMLReader::setParserProperty(int property, boolean value)
@@ -992,46 +1033,6 @@
 }
 /* }}} */
 
-/* {{{ proto boolean XMLReader::setSchema(string filename)
-Use W3C XSD schema to validate the document as it is processed. Activation is 
only possible before the first Read(). */
-PHP_METHOD(xmlreader, setSchema)
-{
-#ifdef LIBXML_SCHEMAS_ENABLED
-   zval *id;
-   int source_len = 0, retval = -1;
-   xmlreader_object *intern;
-   char *source;
-
-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, s!, source, 
source_len) == FAILURE) {
-   return;
-   }
-
-   if (source != NULL  !source_len) {
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, Schema data source 
is required);
-   RETURN_FALSE;
-   }
-
-   id = getThis();
-
-   intern = (xmlreader_object *)zend_object_store_get_object(id TSRMLS_CC);
-   if (intern  intern-ptr) {
-   retval = xmlTextReaderSchemaValidate(intern-ptr, source);
-
-   if (retval == 0) {
-   RETURN_TRUE;
-   }
-   }
-   
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, Unable to set schema. This 
must be set prior to reading or schema contains errors.);
-
-   RETURN_FALSE;
-#else
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, No Schema support built 
into libxml.);
-
-   RETURN_FALSE;
-#endif
-}
-
 /* TODO
 XMLPUBFUN int XMLCALL  
xmlTextReaderSetSchema  (xmlTextReaderPtr reader,
@@ -1167,6 +1168,7 @@
PHP_ME(xmlreader, readInnerXml, NULL, ZEND_ACC_PUBLIC)
PHP_ME(xmlreader, readOuterXml, NULL, ZEND_ACC_PUBLIC)
PHP_ME(xmlreader, readString, NULL, ZEND_ACC_PUBLIC)
+   PHP_ME(xmlreader, setSchema, NULL, ZEND_ACC_PUBLIC)
 #endif
 /* Not Yet Implemented though defined in libxml as of 2.6.9dev
PHP_ME(xmlreader, resetState, NULL, ZEND_ACC_PUBLIC)
@@ -1174,7 +1176,6 @@
PHP_ME(xmlreader, setParserProperty, NULL, ZEND_ACC_PUBLIC)
PHP_ME(xmlreader, setRelaxNGSchema, NULL, ZEND_ACC_PUBLIC)
PHP_ME(xmlreader, setRelaxNGSchemaSource, NULL, ZEND_ACC_PUBLIC)
-   PHP_ME(xmlreader, setSchema, NULL, ZEND_ACC_PUBLIC)
PHP_ME(xmlreader, XML, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_ALLOW_STATIC)
PHP_ME(xmlreader, expand, NULL, ZEND_ACC_PUBLIC)
{NULL, NULL, NULL}

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



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

2006-03-31 Thread Sara Golemon
pollita Sat Apr  1 00:05:31 2006 UTC

  Modified files:  
/php-src/ext/standard   file.c 
  Log:
  Update filename handling and mark various functions for unicode safety
  http://cvs.php.net/viewcvs.cgi/php-src/ext/standard/file.c?r1=1.434r2=1.435diff_format=u
Index: php-src/ext/standard/file.c
diff -u php-src/ext/standard/file.c:1.434 php-src/ext/standard/file.c:1.435
--- php-src/ext/standard/file.c:1.434   Fri Mar 31 22:51:37 2006
+++ php-src/ext/standard/file.c Sat Apr  1 00:05:31 2006
@@ -21,7 +21,7 @@
+--+
  */
 
-/* $Id: file.c,v 1.434 2006/03/31 22:51:37 pollita Exp $ */
+/* $Id: file.c,v 1.435 2006/04/01 00:05:31 pollita Exp $ */
 
 /* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */
 
@@ -309,7 +309,7 @@
 
 
 
-/* {{{ proto bool flock(resource fp, int operation [, int wouldblock])
+/* {{{ proto bool flock(resource fp, int operation [, int wouldblock]) U
Portable file locking */
 
 static int flock_values[] = { LOCK_SH, LOCK_EX, LOCK_UN };
@@ -503,6 +503,7 @@
 {
char *filename;
int filename_len;
+   zend_uchar filename_type;
char *contents;
long flags = 0;
zend_bool use_include_path = 0;
@@ -514,16 +515,24 @@
php_stream_context *context = NULL;
 
/* Parse arguments */
-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, s|lr!ll,
- filename, filename_len, flags, zcontext, 
offset, maxlen) == FAILURE) {
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, t|lr!ll,
+ filename, filename_len, filename_type, 
flags, zcontext, offset, maxlen) == FAILURE) {
return;
}
 
context = php_stream_context_from_zval(zcontext, 0);
+   if (filename_type == IS_UNICODE) {
+   if (php_stream_path_encode(NULL, filename, filename_len, 
filename, filename_len, REPORT_ERRORS, context) == FAILURE) {
+   RETURN_FALSE;
+   }
+   }
 
stream = php_stream_open_wrapper_ex(filename, (flags  PHP_FILE_TEXT) ? 
rt : rb, 
((flags  PHP_FILE_USE_INCLUDE_PATH) ? USE_PATH 
: 0) | REPORT_ERRORS,
NULL, context);
+   if (filename_type == IS_UNICODE) {
+   efree(filename);
+   }
if (!stream) {
RETURN_FALSE;
}
@@ -565,6 +574,7 @@
php_stream *stream;
char *filename;
int filename_len;
+   zend_uchar filename_type;
zval *data;
int numchars = 0;
long flags = 0;
@@ -572,7 +582,7 @@
php_stream_context *context = NULL;
char mode[3] = { 'w', 0, 0 };

-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, sz/|lr!, 
filename, filename_len, 
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, tz/|lr!, 
filename, filename_len, filename_type,
data, flags, zcontext) == FAILURE) {
return;
}
@@ -587,8 +597,19 @@
} else if (flags  PHP_FILE_TEXT) {
mode[1] = 't';
}
+
+   if (filename_type == IS_UNICODE) {
+   if (php_stream_path_encode(NULL, filename, filename_len, 
filename, filename_len, REPORT_ERRORS, context) == FAILURE) {
+   RETURN_FALSE;
+   }
+   }
+
stream = php_stream_open_wrapper_ex(filename, mode, 
((flags  PHP_FILE_USE_INCLUDE_PATH) ? USE_PATH : 0) | 
REPORT_ERRORS, NULL, context);
+
+   if (filename_type == IS_UNICODE) {
+   efree(filename);
+   }
if (stream == NULL) {
RETURN_FALSE;
}
@@ -906,7 +927,7 @@
 }
 /* }}} */
 
-/* {{{ proto bool fclose(resource fp)
+/* {{{ proto bool fclose(resource fp) U
Close an open file pointer */
 PHPAPI PHP_FUNCTION(fclose)
 {
@@ -972,7 +993,7 @@
 }
 /* }}} */
 
-/* {{{ proto int pclose(resource fp)
+/* {{{ proto int pclose(resource fp) U
Close a file pointer opened by popen() */
 PHP_FUNCTION(pclose)
 {
@@ -990,7 +1011,7 @@
 }
 /* }}} */
 
-/* {{{ proto bool feof(resource fp)
+/* {{{ proto bool feof(resource fp) U
Test for end-of-file on a file pointer */
 PHPAPI PHP_FUNCTION(feof)
 {
@@ -1238,7 +1259,7 @@
 }
 /* }}} */
 
-/* {{{ proto bool fflush(resource fp)
+/* {{{ proto bool fflush(resource fp) U
Flushes output */
 PHPAPI PHP_FUNCTION(fflush)
 {
@@ -1260,7 +1281,7 @@
 }
 /* }}} */
 
-/* {{{ proto bool rewind(resource fp)
+/* {{{ proto bool rewind(resource fp) U
Rewind the position of a file pointer */
 PHPAPI PHP_FUNCTION(rewind)
 {
@@ -1280,7 +1301,7 @@
 }
 /* }}} */
 
-/* {{{ proto int ftell(resource fp)
+/* {{{ proto int ftell(resource fp) U
Get file pointer's read/write position */
 PHPAPI PHP_FUNCTION(ftell)
 {
@@ -1302,7 +1323,7 @@
 }
 /* }}} */
 
-/* {{{ proto int fseek(resource fp, int offset [, int whence])
+/* {{{