[PHP-CVS] cvs: php-src(PHP_5_2) / NEWS /main/streams plain_wrapper.c

2006-08-22 Thread Dmitry Stogov
dmitry  Tue Aug 22 06:15:27 2006 UTC

  Modified files:  (Branch: PHP_5_2)
/php-srcNEWS 
/php-src/main/streams   plain_wrapper.c 
  Log:
  Fixed bug #38488 (Access to php://stdin and family crashes PHP on win32)
  
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.212r2=1.2027.2.547.2.213diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.212 php-src/NEWS:1.2027.2.547.2.213
--- php-src/NEWS:1.2027.2.547.2.212 Mon Aug 21 16:53:49 2006
+++ php-src/NEWSTue Aug 22 06:15:26 2006
@@ -5,6 +5,8 @@
   inside a failed query executed via query() method). (Ilia)
 - Fixed bug #38524 (strptime() does not initialize the internal date storage
   structure). (Ilia)
+- Fixed bug #38488 (Access to php://stdin and family crashes PHP on win32).
+  (Dmitry)
 - Fixed PECL bug #8112 (OCI8 persistent connections misbehave when Apache 
   process times out). (Tony)
 
http://cvs.php.net/viewvc.cgi/php-src/main/streams/plain_wrapper.c?r1=1.52.2.6.2.3r2=1.52.2.6.2.4diff_format=u
Index: php-src/main/streams/plain_wrapper.c
diff -u php-src/main/streams/plain_wrapper.c:1.52.2.6.2.3 
php-src/main/streams/plain_wrapper.c:1.52.2.6.2.4
--- php-src/main/streams/plain_wrapper.c:1.52.2.6.2.3   Mon Jun  5 22:39:50 2006
+++ php-src/main/streams/plain_wrapper.cTue Aug 22 06:15:26 2006
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: plain_wrapper.c,v 1.52.2.6.2.3 2006/06/05 22:39:50 tony2001 Exp $ */
+/* $Id: plain_wrapper.c,v 1.52.2.6.2.4 2006/08/22 06:15:26 dmitry Exp $ */
 
 #include php.h
 #include php_globals.h
@@ -194,10 +194,9 @@
 #elif defined(PHP_WIN32)
{
long handle = _get_osfhandle(self-fd);
-   DWORD in_buf_size, out_buf_size;
 
if (handle != 0x) {
-   self-is_pipe = GetNamedPipeInfo((HANDLE)handle, NULL, 
out_buf_size, in_buf_size, NULL);
+   self-is_pipe = GetFileType((HANDLE)handle) == 
FILE_TYPE_PIPE;
}
}
 #endif

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



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

2006-08-22 Thread Dmitry Stogov
dmitry  Tue Aug 22 06:15:45 2006 UTC

  Modified files:  
/php-src/main/streams   plain_wrapper.c 
  Log:
  Fixed bug #38488 (Access to php://stdin and family crashes PHP on win32)
  
  
http://cvs.php.net/viewvc.cgi/php-src/main/streams/plain_wrapper.c?r1=1.67r2=1.68diff_format=u
Index: php-src/main/streams/plain_wrapper.c
diff -u php-src/main/streams/plain_wrapper.c:1.67 
php-src/main/streams/plain_wrapper.c:1.68
--- php-src/main/streams/plain_wrapper.c:1.67   Mon Jun  5 22:39:10 2006
+++ php-src/main/streams/plain_wrapper.cTue Aug 22 06:15:45 2006
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: plain_wrapper.c,v 1.67 2006/06/05 22:39:10 tony2001 Exp $ */
+/* $Id: plain_wrapper.c,v 1.68 2006/08/22 06:15:45 dmitry Exp $ */
 
 #include php.h
 #include php_globals.h
@@ -194,10 +194,9 @@
 #elif defined(PHP_WIN32)
{
long handle = _get_osfhandle(self-fd);
-   DWORD in_buf_size, out_buf_size;
 
if (handle != 0x) {
-   self-is_pipe = GetNamedPipeInfo((HANDLE)handle, NULL, 
out_buf_size, in_buf_size, NULL);
+   self-is_pipe = GetFileType((HANDLE)handle) == 
FILE_TYPE_PIPE;
}
}
 #endif

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



[PHP-CVS] cvs: php-src(PHP_5_1) / NEWS /main/streams plain_wrapper.c

2006-08-22 Thread Dmitry Stogov
dmitry  Tue Aug 22 06:16:19 2006 UTC

  Modified files:  (Branch: PHP_5_1)
/php-srcNEWS 
/php-src/main/streams   plain_wrapper.c 
  Log:
  Fixed bug #38488 (Access to php://stdin and family crashes PHP on win32)
  
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.569r2=1.2027.2.570diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.569 php-src/NEWS:1.2027.2.570
--- php-src/NEWS:1.2027.2.569   Tue Aug 15 13:17:08 2006
+++ php-src/NEWSTue Aug 22 06:16:19 2006
@@ -1,6 +1,8 @@
 PHPNEWS
 |||
 ?? ??? 2006, PHP 5.1.6
+- Fixed bug #38488 (Access to php://stdin and family crashes PHP on win32).
+  (Dmitry)
 
 17 Aug 2006, PHP 5.1.5
 - Fixed memory_limit on 64bit systems. (Stefan E.)
http://cvs.php.net/viewvc.cgi/php-src/main/streams/plain_wrapper.c?r1=1.52.2.6r2=1.52.2.7diff_format=u
Index: php-src/main/streams/plain_wrapper.c
diff -u php-src/main/streams/plain_wrapper.c:1.52.2.6 
php-src/main/streams/plain_wrapper.c:1.52.2.7
--- php-src/main/streams/plain_wrapper.c:1.52.2.6   Tue Jan 17 02:32:09 2006
+++ php-src/main/streams/plain_wrapper.cTue Aug 22 06:16:19 2006
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: plain_wrapper.c,v 1.52.2.6 2006/01/17 02:32:09 iliaa Exp $ */
+/* $Id: plain_wrapper.c,v 1.52.2.7 2006/08/22 06:16:19 dmitry Exp $ */
 
 #include php.h
 #include php_globals.h
@@ -194,10 +194,9 @@
 #elif defined(PHP_WIN32)
{
long handle = _get_osfhandle(self-fd);
-   DWORD in_buf_size, out_buf_size;
 
if (handle != 0x) {
-   self-is_pipe = GetNamedPipeInfo((HANDLE)handle, NULL, 
out_buf_size, in_buf_size, NULL);
+   self-is_pipe = GetFileType((HANDLE)handle) == 
FILE_TYPE_PIPE;
}
}
 #endif

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



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

2006-08-22 Thread Michael Wallner
mikeTue Aug 22 07:53:58 2006 UTC

  Modified files:  
/php-src/main   output.c php_output.h 
  Log:
  - allocate handler stack on the heap and avoid segfaults on shutdown when 
startup fails
  - don't try to append empty buffer
  - fix some dbg format strings
  http://cvs.php.net/viewvc.cgi/php-src/main/output.c?r1=1.187r2=1.188diff_format=u
Index: php-src/main/output.c
diff -u php-src/main/output.c:1.187 php-src/main/output.c:1.188
--- php-src/main/output.c:1.187 Wed Aug  9 13:56:45 2006
+++ php-src/main/output.c   Tue Aug 22 07:53:58 2006
@@ -19,7 +19,7 @@
+--+
 */
 
-/* $Id: output.c,v 1.187 2006/08/09 13:56:45 mike Exp $ */
+/* $Id: output.c,v 1.188 2006/08/22 07:53:58 mike Exp $ */
 
 #ifndef PHP_OUTPUT_DEBUG
 #  define PHP_OUTPUT_DEBUG 0
@@ -112,7 +112,9 @@
 #else
memset(output_globals, 0, sizeof(zend_output_globals));
 #endif
-   if (SUCCESS != zend_stack_init(OG(handlers))) {
+   
+   OG(handlers) = emalloc(sizeof(zend_stack));
+   if (SUCCESS != zend_stack_init(OG(handlers))) {
return FAILURE;
}

@@ -133,15 +135,26 @@

OG(active) = NULL;
OG(running) = NULL;
+   
/* release all output handlers */
-   while (SUCCESS == zend_stack_top(OG(handlers), (void *) handler)) {
-   php_output_handler_free(handler TSRMLS_CC);
-   zend_stack_del_top(OG(handlers));
+   if (OG(handlers)) {
+   while (SUCCESS == zend_stack_top(OG(handlers), (void *) 
handler)) {
+   php_output_handler_free(handler TSRMLS_CC);
+   zend_stack_del_top(OG(handlers));
+   }
+   zend_stack_destroy(OG(handlers));
+   efree(OG(handlers));
+   OG(handlers) = NULL;
}
-   zend_stack_destroy(OG(handlers));

-   zval_ptr_dtor(OG(default_output_handler_name));
-   zval_ptr_dtor(OG(devnull_output_handler_name));
+   if (OG(default_output_handler_name)) {
+   zval_ptr_dtor(OG(default_output_handler_name));
+   OG(default_output_handler_name) = NULL;
+   }
+   if (OG(devnull_output_handler_name)) {
+   zval_ptr_dtor(OG(devnull_output_handler_name));
+   OG(devnull_output_handler_name) = NULL;
+   }
 }
 /* }}} */
 
@@ -277,9 +290,9 @@
php_output_context_init(context, PHP_OUTPUT_HANDLER_FLUSH 
TSRMLS_CC);
php_output_handler_op(OG(active), context);
if (context.out.data  context.out.used) {
-   zend_stack_del_top(OG(handlers));
+   zend_stack_del_top(OG(handlers));
php_output_write(context.out.data, context.out.used 
TSRMLS_CC);
-   zend_stack_push(OG(handlers), OG(active), 
sizeof(php_output_handler *));
+   zend_stack_push(OG(handlers), OG(active), 
sizeof(php_output_handler *));
}
php_output_context_dtor(context);
return SUCCESS;
@@ -323,7 +336,7 @@

if (OG(active)) {
php_output_context_init(context, PHP_OUTPUT_HANDLER_CLEAN 
TSRMLS_CC);
-   zend_stack_apply_with_argument(OG(handlers), 
ZEND_STACK_APPLY_TOPDOWN, php_output_stack_apply_clean, context);
+   zend_stack_apply_with_argument(OG(handlers), 
ZEND_STACK_APPLY_TOPDOWN, php_output_stack_apply_clean, context);
}
 }
 
@@ -371,7 +384,7 @@
Get output buffering level, ie. how many output handlers the stack 
contains */
 PHPAPI int php_output_get_level(TSRMLS_D)
 {
-   return OG(active) ? zend_stack_count(OG(handlers)) : 0;
+   return OG(active) ? zend_stack_count(OG(handlers)) : 0;
 }
 /* }}} */
 
@@ -549,7 +562,7 @@
}
}
/* zend_stack_push never returns SUCCESS but FAILURE or stack level */
-   if (FAILURE == (handler-level = zend_stack_push(OG(handlers), 
handler, sizeof(php_output_handler * {
+   if (FAILURE == (handler-level = zend_stack_push(OG(handlers), 
handler, sizeof(php_output_handler * {
return FAILURE;
}
OG(active) = handler;
@@ -565,7 +578,7 @@
int i, count = php_output_get_level(TSRMLS_C);

if (count) {
-   handlers = (php_output_handler **) 
zend_stack_base(OG(handlers));
+   handlers = (php_output_handler **) 
zend_stack_base(OG(handlers));

for (i = 0; i  count; ++i) {
if (!zend_binary_zval_strcmp(handlers[i]-name, name)) {
@@ -842,22 +855,24 @@
Appends input to the output handlers buffer and indicates whether the 
buffer does not have to be processed by the output handler */
 static inline int php_output_handler_append(php_output_handler *handler, const 
php_output_buffer *buf TSRMLS_DC)
 {
-

[PHP-CVS] cvs: php-src /main output.c /tests/output ob_014.phpt ob_015.phpt

2006-08-22 Thread Michael Wallner
mikeTue Aug 22 08:16:38 2006 UTC

  Modified files:  
/php-src/main   output.c 
/php-src/tests/output   ob_014.phpt ob_015.phpt 
  Log:
  - fix tests to comply with upgraded string.c
  - use add_next_index_zval() when listing handlers
  
  
http://cvs.php.net/viewvc.cgi/php-src/main/output.c?r1=1.188r2=1.189diff_format=u
Index: php-src/main/output.c
diff -u php-src/main/output.c:1.188 php-src/main/output.c:1.189
--- php-src/main/output.c:1.188 Tue Aug 22 07:53:58 2006
+++ php-src/main/output.c   Tue Aug 22 08:16:37 2006
@@ -19,7 +19,7 @@
+--+
 */
 
-/* $Id: output.c,v 1.188 2006/08/22 07:53:58 mike Exp $ */
+/* $Id: output.c,v 1.189 2006/08/22 08:16:37 mike Exp $ */
 
 #ifndef PHP_OUTPUT_DEBUG
 #  define PHP_OUTPUT_DEBUG 0
@@ -1131,11 +1131,8 @@
php_output_handler *handler = *(php_output_handler **) h;
zval *array = (zval *) z;

-   if (Z_TYPE_P(handler-name) == IS_UNICODE) {
-   add_next_index_unicodel(array, Z_USTRVAL_P(handler-name), 
Z_USTRLEN_P(handler-name), 1);
-   } else {
-   add_next_index_stringl(array, Z_STRVAL_P(handler-name), 
Z_STRLEN_P(handler-name), 1);
-   }
+   ZVAL_ADDREF(handler-name);
+   add_next_index_zval(array, handler-name);
return 0;
 }
 /* }}} */
http://cvs.php.net/viewvc.cgi/php-src/tests/output/ob_014.phpt?r1=1.1r2=1.2diff_format=u
Index: php-src/tests/output/ob_014.phpt
diff -u php-src/tests/output/ob_014.phpt:1.1 
php-src/tests/output/ob_014.phpt:1.2
--- php-src/tests/output/ob_014.phpt:1.1Fri Jun  2 19:51:43 2006
+++ php-src/tests/output/ob_014.phptTue Aug 22 08:16:37 2006
@@ -11,4 +11,4 @@
 --EXPECTF--
 foo
 
-Warning: Wrong parameter count for (null)() in %s on line %d
+Warning: (null)() expects exactly 1 parameter, 2 given in %s on line %d
http://cvs.php.net/viewvc.cgi/php-src/tests/output/ob_015.phpt?r1=1.1r2=1.2diff_format=u
Index: php-src/tests/output/ob_015.phpt
diff -u php-src/tests/output/ob_015.phpt:1.1 
php-src/tests/output/ob_015.phpt:1.2
--- php-src/tests/output/ob_015.phpt:1.1Fri Jun  2 19:51:43 2006
+++ php-src/tests/output/ob_015.phptTue Aug 22 08:16:37 2006
@@ -8,4 +8,4 @@
 --EXPECTF--
 foo
 
-Warning: Wrong parameter count for str_rot13() in %s on line %d
+Warning: str_rot13() expects exactly 1 parameter, 2 given in %s on line %d

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



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

2006-08-22 Thread Michael Wallner
mikeTue Aug 22 08:21:19 2006 UTC

  Modified files:  
/php-src/main   output.c 
  Log:
  - use the handler name zval directly when listing stati, too
  
http://cvs.php.net/viewvc.cgi/php-src/main/output.c?r1=1.189r2=1.190diff_format=u
Index: php-src/main/output.c
diff -u php-src/main/output.c:1.189 php-src/main/output.c:1.190
--- php-src/main/output.c:1.189 Tue Aug 22 08:16:37 2006
+++ php-src/main/output.c   Tue Aug 22 08:21:19 2006
@@ -19,7 +19,7 @@
+--+
 */
 
-/* $Id: output.c,v 1.189 2006/08/22 08:16:37 mike Exp $ */
+/* $Id: output.c,v 1.190 2006/08/22 08:21:19 mike Exp $ */
 
 #ifndef PHP_OUTPUT_DEBUG
 #  define PHP_OUTPUT_DEBUG 0
@@ -1159,11 +1159,8 @@
array_init(entry);
}

-   if (Z_TYPE_P(handler-name) == IS_UNICODE) {
-   add_assoc_unicodel(entry, name, Z_USTRVAL_P(handler-name), 
Z_USTRLEN_P(handler-name), 1);
-   } else {
-   add_assoc_stringl(entry, name, Z_STRVAL_P(handler-name), 
Z_STRLEN_P(handler-name), 1);
-   }
+   ZVAL_ADDREF(handler-name);
+   add_assoc_zval(entry, name, handler-name);
add_assoc_long(entry, type, (long) (handler-flags  0xf));
add_assoc_long(entry, flags, (long) handler-flags);
add_assoc_long(entry, level, (long) handler-level);

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



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

2006-08-22 Thread Michael Wallner
mikeTue Aug 22 09:56:24 2006 UTC

  Modified files:  
/php-src/main   output.c 
  Log:
  - fix php_output_handler_started()
  
http://cvs.php.net/viewvc.cgi/php-src/main/output.c?r1=1.190r2=1.191diff_format=u
Index: php-src/main/output.c
diff -u php-src/main/output.c:1.190 php-src/main/output.c:1.191
--- php-src/main/output.c:1.190 Tue Aug 22 08:21:19 2006
+++ php-src/main/output.c   Tue Aug 22 09:56:24 2006
@@ -19,7 +19,7 @@
+--+
 */
 
-/* $Id: output.c,v 1.190 2006/08/22 08:21:19 mike Exp $ */
+/* $Id: output.c,v 1.191 2006/08/22 09:56:24 mike Exp $ */
 
 #ifndef PHP_OUTPUT_DEBUG
 #  define PHP_OUTPUT_DEBUG 0
@@ -578,7 +578,7 @@
int i, count = php_output_get_level(TSRMLS_C);

if (count) {
-   handlers = (php_output_handler **) 
zend_stack_base(OG(handlers));
+   handlers = *(php_output_handler ***) 
zend_stack_base(OG(handlers));

for (i = 0; i  count; ++i) {
if (!zend_binary_zval_strcmp(handlers[i]-name, name)) {

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



[PHP-CVS] cvs: php-src /ext/oci8 oci8.c oci8_interface.c oci8_lob.c oci8_statement.c php_oci8_int.h /ext/oci8/tests statement_cache.phpt

2006-08-22 Thread Antony Dovgal
tony2001Tue Aug 22 11:08:28 2006 UTC

  Modified files:  
/php-src/ext/oci8   oci8.c oci8_interface.c oci8_lob.c 
oci8_statement.c php_oci8_int.h 
/php-src/ext/oci8/tests statement_cache.phpt 
  Log:
  minor improvements
  dropped unused parameters, changed long to int where it should be int
  
  http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/oci8.c?r1=1.317r2=1.318diff_format=u
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.317 php-src/ext/oci8/oci8.c:1.318
--- php-src/ext/oci8/oci8.c:1.317   Mon Aug 21 16:40:45 2006
+++ php-src/ext/oci8/oci8.c Tue Aug 22 11:08:28 2006
@@ -26,7 +26,7 @@
+--+
 */
 
-/* $Id: oci8.c,v 1.317 2006/08/21 16:40:45 tony2001 Exp $ */
+/* $Id: oci8.c,v 1.318 2006/08/22 11:08:28 tony2001 Exp $ */
 /* TODO
  *
  * file://localhost/www/docs/oci10/ociaahan.htm#423823 - implement lob_empty() 
with OCI_ATTR_LOBEMPTY
@@ -667,7 +667,7 @@
php_info_print_table_start();
php_info_print_table_row(2, OCI8 Support, enabled);
php_info_print_table_row(2, Version, 1.2.1);
-   php_info_print_table_row(2, Revision, $Revision: 1.317 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.318 $);
 
sprintf(buf, %ld, OCI_G(num_persistent));
php_info_print_table_row(2, Active Persistent Connections, buf);
@@ -912,12 +912,12 @@
if (error_code) {
int tmp_buf_len = strlen(tmp_buf);

-   if (tmp_buf[tmp_buf_len - 1] == '\n') {
+   if (tmp_buf_len  tmp_buf[tmp_buf_len - 1] == '\n') {
tmp_buf[tmp_buf_len - 1] = '\0';
}
-   if (error_buf) {
+   if (tmp_buf_len  error_buf) {
*error_buf = NULL;
-   *error_buf = estrndup(tmp_buf, tmp_buf_len + 1);
+   *error_buf = estrndup(tmp_buf, tmp_buf_len);
}
}
return error_code;
@@ -1157,7 +1157,7 @@

if (alloc_non_persistent) {
connection = (php_oci_connection *) ecalloc(1, 
sizeof(php_oci_connection));
-   connection-hash_key = estrndup(hashed_details.c, 
hashed_details.len+1);
+   connection-hash_key = estrndup(hashed_details.c, 
hashed_details.len);
connection-is_persistent = 0;
} else {
connection = (php_oci_connection *) calloc(1, 
sizeof(php_oci_connection));
@@ -1166,7 +1166,7 @@
}
} else {
connection = (php_oci_connection *) ecalloc(1, 
sizeof(php_oci_connection));
-   connection-hash_key = estrndup(hashed_details.c, 
hashed_details.len+1);
+   connection-hash_key = estrndup(hashed_details.c, 
hashed_details.len);
connection-is_persistent = 0;
}
 
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/oci8_interface.c?r1=1.17r2=1.18diff_format=u
Index: php-src/ext/oci8/oci8_interface.c
diff -u php-src/ext/oci8/oci8_interface.c:1.17 
php-src/ext/oci8/oci8_interface.c:1.18
--- php-src/ext/oci8/oci8_interface.c:1.17  Sun Jul 30 20:50:53 2006
+++ php-src/ext/oci8/oci8_interface.c   Tue Aug 22 11:08:28 2006
@@ -25,7 +25,7 @@
+--+
 */
 
-/* $Id: oci8_interface.c,v 1.17 2006/07/30 20:50:53 tony2001 Exp $ */
+/* $Id: oci8_interface.c,v 1.18 2006/08/22 11:08:28 tony2001 Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -1632,15 +1632,14 @@
php_oci_statement *statement;
char *query;
int query_len;
-   zend_bool cached = 0;
 
-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, rs|b, 
z_connection, query, query_len, cached) == FAILURE) {
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, rs, 
z_connection, query, query_len) == FAILURE) {
return;
}
 
PHP_OCI_ZVAL_TO_CONNECTION(z_connection, connection);
 
-   statement = php_oci_statement_create(connection, query, query_len, 
cached TSRMLS_CC);
+   statement = php_oci_statement_create(connection, query, query_len 
TSRMLS_CC);
 
if (statement) {
RETURN_RESOURCE(statement-id);
@@ -1738,7 +1737,7 @@
 
PHP_OCI_ZVAL_TO_CONNECTION(z_connection, connection);
 
-   statement = php_oci_statement_create(connection, NULL, 0, 0 TSRMLS_CC);
+   statement = php_oci_statement_create(connection, NULL, 0 TSRMLS_CC);

if (statement) {
RETURN_RESOURCE(statement-id);
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/oci8_lob.c?r1=1.17r2=1.18diff_format=u
Index: php-src/ext/oci8/oci8_lob.c
diff -u php-src/ext/oci8/oci8_lob.c:1.17 php-src/ext/oci8/oci8_lob.c:1.18
--- php-src/ext/oci8/oci8_lob.c:1.17Mon Aug 21 16:40:46 2006
+++ 

[PHP-CVS] cvs: php-src(PHP_5_2) /ext/oci8 oci8.c oci8_interface.c oci8_lob.c oci8_statement.c php_oci8_int.h /ext/oci8/tests statement_cache.phpt

2006-08-22 Thread Antony Dovgal
tony2001Tue Aug 22 11:09:13 2006 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/oci8   oci8.c oci8_interface.c oci8_lob.c 
oci8_statement.c php_oci8_int.h 
/php-src/ext/oci8/tests statement_cache.phpt 
  Log:
  minor improvements
  
  http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/oci8.c?r1=1.269.2.16.2.19r2=1.269.2.16.2.20diff_format=u
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.269.2.16.2.19 
php-src/ext/oci8/oci8.c:1.269.2.16.2.20
--- php-src/ext/oci8/oci8.c:1.269.2.16.2.19 Mon Aug 21 16:41:12 2006
+++ php-src/ext/oci8/oci8.c Tue Aug 22 11:09:12 2006
@@ -26,7 +26,7 @@
+--+
 */
 
-/* $Id: oci8.c,v 1.269.2.16.2.19 2006/08/21 16:41:12 tony2001 Exp $ */
+/* $Id: oci8.c,v 1.269.2.16.2.20 2006/08/22 11:09:12 tony2001 Exp $ */
 /* TODO
  *
  * file://localhost/www/docs/oci10/ociaahan.htm#423823 - implement lob_empty() 
with OCI_ATTR_LOBEMPTY
@@ -652,7 +652,7 @@
php_info_print_table_start();
php_info_print_table_row(2, OCI8 Support, enabled);
php_info_print_table_row(2, Version, 1.2.1);
-   php_info_print_table_row(2, Revision, $Revision: 1.269.2.16.2.19 $);
+   php_info_print_table_row(2, Revision, $Revision: 1.269.2.16.2.20 $);
 
sprintf(buf, %ld, OCI_G(num_persistent));
php_info_print_table_row(2, Active Persistent Connections, buf);
@@ -897,12 +897,12 @@
if (error_code) {
int tmp_buf_len = strlen(tmp_buf);

-   if (tmp_buf[tmp_buf_len - 1] == '\n') {
+   if (tmp_buf_len  tmp_buf[tmp_buf_len - 1] == '\n') {
tmp_buf[tmp_buf_len - 1] = '\0';
}
-   if (error_buf) {
+   if (tmp_buf_len  error_buf) {
*error_buf = NULL;
-   *error_buf = estrndup(tmp_buf, tmp_buf_len + 1);
+   *error_buf = estrndup(tmp_buf, tmp_buf_len);
}
}
return error_code;
@@ -1142,7 +1142,7 @@

if (alloc_non_persistent) {
connection = (php_oci_connection *) ecalloc(1, 
sizeof(php_oci_connection));
-   connection-hash_key = estrndup(hashed_details.c, 
hashed_details.len+1);
+   connection-hash_key = estrndup(hashed_details.c, 
hashed_details.len);
connection-is_persistent = 0;
} else {
connection = (php_oci_connection *) calloc(1, 
sizeof(php_oci_connection));
@@ -1151,7 +1151,7 @@
}
} else {
connection = (php_oci_connection *) ecalloc(1, 
sizeof(php_oci_connection));
-   connection-hash_key = estrndup(hashed_details.c, 
hashed_details.len+1);
+   connection-hash_key = estrndup(hashed_details.c, 
hashed_details.len);
connection-is_persistent = 0;
}
 
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/oci8_interface.c?r1=1.8.2.7.2.2r2=1.8.2.7.2.3diff_format=u
Index: php-src/ext/oci8/oci8_interface.c
diff -u php-src/ext/oci8/oci8_interface.c:1.8.2.7.2.2 
php-src/ext/oci8/oci8_interface.c:1.8.2.7.2.3
--- php-src/ext/oci8/oci8_interface.c:1.8.2.7.2.2   Sun Jul 30 20:51:24 2006
+++ php-src/ext/oci8/oci8_interface.c   Tue Aug 22 11:09:12 2006
@@ -25,7 +25,7 @@
+--+
 */
 
-/* $Id: oci8_interface.c,v 1.8.2.7.2.2 2006/07/30 20:51:24 tony2001 Exp $ */
+/* $Id: oci8_interface.c,v 1.8.2.7.2.3 2006/08/22 11:09:12 tony2001 Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -1636,15 +1636,14 @@
php_oci_statement *statement;
char *query;
int query_len;
-   zend_bool cached = 0;
 
-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, rs|b, 
z_connection, query, query_len, cached) == FAILURE) {
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, rs, 
z_connection, query, query_len) == FAILURE) {
return;
}
 
PHP_OCI_ZVAL_TO_CONNECTION(z_connection, connection);
 
-   statement = php_oci_statement_create(connection, query, query_len, 
cached TSRMLS_CC);
+   statement = php_oci_statement_create(connection, query, query_len 
TSRMLS_CC);
 
if (statement) {
RETURN_RESOURCE(statement-id);
@@ -1748,7 +1747,7 @@
 
PHP_OCI_ZVAL_TO_CONNECTION(z_connection, connection);
 
-   statement = php_oci_statement_create(connection, NULL, 0, 0 TSRMLS_CC);
+   statement = php_oci_statement_create(connection, NULL, 0 TSRMLS_CC);

if (statement) {
RETURN_RESOURCE(statement-id);
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/oci8_lob.c?r1=1.7.2.6.2.5r2=1.7.2.6.2.6diff_format=u
Index: php-src/ext/oci8/oci8_lob.c
diff -u php-src/ext/oci8/oci8_lob.c:1.7.2.6.2.5 

[PHP-CVS] cvs: php-src(PHP_5_2) / NEWS /sapi/cli php_cli.c

2006-08-22 Thread Dmitry Stogov
dmitry  Tue Aug 22 12:04:53 2006 UTC

  Modified files:  (Branch: PHP_5_2)
/php-srcNEWS 
/php-src/sapi/cli   php_cli.c 
  Log:
  Fixed bug #38543 (shutdown_executor() may segfault when memory_limit is too 
low).
  
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.213r2=1.2027.2.547.2.214diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.213 php-src/NEWS:1.2027.2.547.2.214
--- php-src/NEWS:1.2027.2.547.2.213 Tue Aug 22 06:15:26 2006
+++ php-src/NEWSTue Aug 22 12:04:53 2006
@@ -1,6 +1,8 @@
 PHPNEWS
 |||
 ?? Sep 2006, PHP 5.2.0
+- Fixed bug #38543 (shutdown_executor() may segfault when memory_limit is too
+  low). (Dmitry)
 - Fixed bug #38535 (memory corruption in pdo_pgsql driver on error retrieval
   inside a failed query executed via query() method). (Ilia)
 - Fixed bug #38524 (strptime() does not initialize the internal date storage
http://cvs.php.net/viewvc.cgi/php-src/sapi/cli/php_cli.c?r1=1.129.2.13.2.6r2=1.129.2.13.2.7diff_format=u
Index: php-src/sapi/cli/php_cli.c
diff -u php-src/sapi/cli/php_cli.c:1.129.2.13.2.6 
php-src/sapi/cli/php_cli.c:1.129.2.13.2.7
--- php-src/sapi/cli/php_cli.c:1.129.2.13.2.6   Tue Jun 27 08:27:10 2006
+++ php-src/sapi/cli/php_cli.c  Tue Aug 22 12:04:53 2006
@@ -20,7 +20,7 @@
+--+
 */
 
-/* $Id: php_cli.c,v 1.129.2.13.2.6 2006/06/27 08:27:10 tony2001 Exp $ */
+/* $Id: php_cli.c,v 1.129.2.13.2.7 2006/08/22 12:04:53 dmitry Exp $ */
 
 #include php.h
 #include php_globals.h
@@ -585,6 +585,7 @@
char *script_file=NULL;
int interactive=0;
int module_started = 0;
+   int request_started = 0;
int lineno = 0;
char *exec_direct=NULL, *exec_run=NULL, *exec_begin=NULL, 
*exec_end=NULL;
const char *param_error=NULL;
@@ -711,6 +712,7 @@
if (php_request_startup(TSRMLS_C)==FAILURE) {
goto err;
}
+   request_started = 1;
php_cli_usage(argv[0]);
php_end_ob_buffers(1 TSRMLS_CC);
exit_status=0;
@@ -720,6 +722,7 @@
if (php_request_startup(TSRMLS_C)==FAILURE) {
goto err;
}
+   request_started = 1;
php_print_info(0x TSRMLS_CC);
php_end_ob_buffers(1 TSRMLS_CC);
exit_status=0;
@@ -729,6 +732,7 @@
if (php_request_startup(TSRMLS_C)==FAILURE) {
goto err;
}
+   request_started = 1;
php_printf([PHP Modules]\n);
print_modules(TSRMLS_C);
php_printf(\n[Zend Modules]\n);
@@ -743,6 +747,7 @@
goto err;
}
 
+   request_started = 1;
php_printf(PHP %s (%s) (built: %s %s) 
%s\nCopyright (c) 1997-2006 The PHP Group\n%s,
PHP_VERSION, sapi_module.name, 
__DATE__, __TIME__,
 #if ZEND_DEBUG  defined(HAVE_GCOV)
@@ -993,10 +998,10 @@
if (php_request_startup(TSRMLS_C)==FAILURE) {
*arg_excp = arg_free;
fclose(file_handle.handle.fp);
-   php_request_shutdown((void *) 0);
PUTS(Could not startup.\n);
goto err;
}
+   request_started = 1;
CG(start_lineno) = lineno;
*arg_excp = arg_free; /* reconstuct argv */
 
@@ -1247,7 +1252,9 @@
} zend_end_try();
 
 out:
-   php_request_shutdown((void *) 0);
+   if (request_started) {
+   php_request_shutdown((void *) 0);
+   }
if (exit_status == 0) {
exit_status = EG(exit_status);
}

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



[PHP-CVS] cvs: php-src /sapi/cli php_cli.c

2006-08-22 Thread Dmitry Stogov
dmitry  Tue Aug 22 12:05:10 2006 UTC

  Modified files:  
/php-src/sapi/cli   php_cli.c 
  Log:
  Fixed bug #38543 (shutdown_executor() may segfault when memory_limit is too 
low).
  
  
http://cvs.php.net/viewvc.cgi/php-src/sapi/cli/php_cli.c?r1=1.160r2=1.161diff_format=u
Index: php-src/sapi/cli/php_cli.c
diff -u php-src/sapi/cli/php_cli.c:1.160 php-src/sapi/cli/php_cli.c:1.161
--- php-src/sapi/cli/php_cli.c:1.160Tue Jun 27 08:26:54 2006
+++ php-src/sapi/cli/php_cli.c  Tue Aug 22 12:05:10 2006
@@ -20,7 +20,7 @@
+--+
 */
 
-/* $Id: php_cli.c,v 1.160 2006/06/27 08:26:54 tony2001 Exp $ */
+/* $Id: php_cli.c,v 1.161 2006/08/22 12:05:10 dmitry Exp $ */
 
 #include php.h
 #include php_globals.h
@@ -577,6 +577,7 @@
char *script_file=NULL;
int interactive=0;
int module_started = 0;
+   int request_started = 0;
int lineno = 0;
char *exec_direct=NULL, *exec_run=NULL, *exec_begin=NULL, 
*exec_end=NULL;
const char *param_error=NULL;
@@ -713,6 +714,7 @@
if (php_request_startup(TSRMLS_C)==FAILURE) {
goto err;
}
+   request_started = 1;
php_cli_usage(argv[0]);
php_output_end_all(TSRMLS_C);
exit_status=0;
@@ -722,6 +724,7 @@
if (php_request_startup(TSRMLS_C)==FAILURE) {
goto err;
}
+   request_started = 1;
php_print_info(0x TSRMLS_CC);
php_output_end_all(TSRMLS_C);
exit_status=0;
@@ -731,6 +734,7 @@
if (php_request_startup(TSRMLS_C)==FAILURE) {
goto err;
}
+   request_started = 1;
php_printf([PHP Modules]\n);
print_modules(TSRMLS_C);
php_printf(\n[Zend Modules]\n);
@@ -745,6 +749,7 @@
goto err;
}
 
+   request_started = 1;
php_printf(PHP %s (%s) (built: %s %s) 
%s\nCopyright (c) 1997-2006 The PHP Group\n%s,
PHP_VERSION, sapi_module.name, 
__DATE__, __TIME__,
 #if ZEND_DEBUG  defined(HAVE_GCOV)
@@ -995,10 +1000,10 @@
if (php_request_startup(TSRMLS_C)==FAILURE) {
*arg_excp = arg_free;
fclose(file_handle.handle.fp);
-   php_request_shutdown((void *) 0);
PUTS(Could not startup.\n);
goto err;
}
+   request_started = 1;
CG(start_lineno) = lineno;
*arg_excp = arg_free; /* reconstuct argv */
 
@@ -1252,7 +1257,9 @@
} zend_end_try();
 
 out:
-   php_request_shutdown((void *) 0);
+   if (request_started) {
+   php_request_shutdown((void *) 0);
+   }
if (exit_status == 0) {
exit_status = EG(exit_status);
}

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



[PHP-CVS] cvs: php-src(PHP_5_2) / NEWS /ext/date php_date.c

2006-08-22 Thread Ilia Alshanetsky
iliaa   Tue Aug 22 16:47:23 2006 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/date   php_date.c 
/php-srcNEWS 
  Log:
  Fixed bug #38511, #38473, #38263 (Fixed session extension request shutdown  
  order to ensure it is shutdown before the extensions it may depend on).
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/date/php_date.c?r1=1.43.2.45.2.25r2=1.43.2.45.2.26diff_format=u
Index: php-src/ext/date/php_date.c
diff -u php-src/ext/date/php_date.c:1.43.2.45.2.25 
php-src/ext/date/php_date.c:1.43.2.45.2.26
--- php-src/ext/date/php_date.c:1.43.2.45.2.25  Tue Aug 15 06:53:21 2006
+++ php-src/ext/date/php_date.c Tue Aug 22 16:47:23 2006
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: php_date.c,v 1.43.2.45.2.25 2006/08/15 06:53:21 mike Exp $ */
+/* $Id: php_date.c,v 1.43.2.45.2.26 2006/08/22 16:47:23 iliaa Exp $ */
 
 #include php.h
 #include php_streams.h
@@ -299,9 +299,17 @@
 static zend_object_value date_object_clone_date(zval *this_ptr TSRMLS_DC);
 static zend_object_value date_object_clone_timezone(zval *this_ptr TSRMLS_DC);
 
+/* This is need to ensure that session extension request shutdown occurs 1st, 
because it uses the date extension */ 
+static zend_module_dep date_deps[] = {
+ZEND_MOD_OPTIONAL(session)
+{NULL, NULL, NULL}
+};
+
 /* {{{ Module struct */
 zend_module_entry date_module_entry = {
-   STANDARD_MODULE_HEADER,
+   STANDARD_MODULE_HEADER_EX,
+   NULL,
+   date_deps,
date, /* extension name */
date_functions, /* function list */
PHP_MINIT(date),/* process startup */
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.214r2=1.2027.2.547.2.215diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.214 php-src/NEWS:1.2027.2.547.2.215
--- php-src/NEWS:1.2027.2.547.2.214 Tue Aug 22 12:04:53 2006
+++ php-src/NEWSTue Aug 22 16:47:23 2006
@@ -7,6 +7,9 @@
   inside a failed query executed via query() method). (Ilia)
 - Fixed bug #38524 (strptime() does not initialize the internal date storage
   structure). (Ilia)
+- Fixed bug #38511, #38473, #38263 (Fixed session extension request shutdown
+  order to ensure it is shutdown before the extensions it may depend on).
+  (Ilia)
 - Fixed bug #38488 (Access to php://stdin and family crashes PHP on win32).
   (Dmitry)
 - Fixed PECL bug #8112 (OCI8 persistent connections misbehave when Apache 

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



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

2006-08-22 Thread Ilia Alshanetsky
iliaa   Tue Aug 22 16:47:43 2006 UTC

  Modified files:  
/php-src/ext/date   php_date.c 
  Log:
  MFB: Fixed bug #38511, #38473, #38263 (Fixed session extension request
  shutdown order to ensure it is shutdown before the extensions it may depend 
  on).
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/date/php_date.c?r1=1.112r2=1.113diff_format=u
Index: php-src/ext/date/php_date.c
diff -u php-src/ext/date/php_date.c:1.112 php-src/ext/date/php_date.c:1.113
--- php-src/ext/date/php_date.c:1.112   Tue Aug 15 06:53:02 2006
+++ php-src/ext/date/php_date.c Tue Aug 22 16:47:43 2006
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: php_date.c,v 1.112 2006/08/15 06:53:02 mike Exp $ */
+/* $Id: php_date.c,v 1.113 2006/08/22 16:47:43 iliaa Exp $ */
 
 #include php.h
 #include php_streams.h
@@ -302,9 +302,17 @@
 static zend_object_value date_object_clone_date(zval *this_ptr TSRMLS_DC);
 static zend_object_value date_object_clone_timezone(zval *this_ptr TSRMLS_DC);
 
+/* This is need to ensure that session extension request shutdown occurs 1st, 
because it uses the date extension */ 
+static zend_module_dep date_deps[] = {
+ZEND_MOD_OPTIONAL(session)
+{NULL, NULL, NULL}
+};
+
 /* {{{ Module struct */
 zend_module_entry date_module_entry = {
-   STANDARD_MODULE_HEADER,
+   STANDARD_MODULE_HEADER_EX,
+   NULL,
+   date_deps,
date, /* extension name */
date_functions, /* function list */
PHP_MINIT(date),/* process startup */

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



[PHP-CVS] cvs: php-src /ext/standard/tests/strings implode1.phpt

2006-08-22 Thread Antony Dovgal
tony2001Tue Aug 22 19:51:34 2006 UTC

  Added files: 
/php-src/ext/standard/tests/strings implode1.phpt 
  Log:
  add test
  
  

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/implode1.phpt?view=markuprev=1.1
Index: php-src/ext/standard/tests/strings/implode1.phpt
+++ php-src/ext/standard/tests/strings/implode1.phpt
--TEST--
implode() and various args 
--FILE--
?php

$a = array(
array(1,2),
array(1.1,2.2),
array(array(2),array(1)),
array(false,true),
);

foreach ($a as $val) {
var_dump(implode(', ', $val));
var_dump($val);
}

echo Done\n;
?
--EXPECTF-- 
string(4) 1, 2
array(2) {
  [0]=
  int(1)
  [1]=
  int(2)
}
string(8) 1.1, 2.2
array(2) {
  [0]=
  float(1.1)
  [1]=
  float(2.2)
}

Notice: Array to string conversion in %s on line %d

Notice: Array to string conversion in %s on line %d
string(12) Array, Array
array(2) {
  [0]=
  array(1) {
[0]=
int(2)
  }
  [1]=
  array(1) {
[0]=
int(1)
  }
}
string(3) , 1
array(2) {
  [0]=
  bool(false)
  [1]=
  bool(true)
}
Done
--UEXPECTF--
unicode(4) 1, 2
array(2) {
  [0]=
  int(1)
  [1]=
  int(2)
}
unicode(8) 1.1, 2.2
array(2) {
  [0]=
  float(1.1)
  [1]=
  float(2.2)
}

Notice: Array to string conversion in %s on line %d

Notice: Array to string conversion in %s on line %d
unicode(12) Array, Array
array(2) {
  [0]=
  array(1) {
[0]=
int(2)
  }
  [1]=
  array(1) {
[0]=
int(1)
  }
}
unicode(3) , 1
array(2) {
  [0]=
  bool(false)
  [1]=
  bool(true)
}
Done

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



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

2006-08-22 Thread Antony Dovgal
tony2001Tue Aug 22 19:55:56 2006 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/standard   string.c 
  Log:
  fix implode() function (see http://news.php.net/php.qa/26876)
  add test
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/string.c?r1=1.445.2.14.2.11r2=1.445.2.14.2.12diff_format=u
Index: php-src/ext/standard/string.c
diff -u php-src/ext/standard/string.c:1.445.2.14.2.11 
php-src/ext/standard/string.c:1.445.2.14.2.12
--- php-src/ext/standard/string.c:1.445.2.14.2.11   Thu Aug 10 14:40:12 2006
+++ php-src/ext/standard/string.c   Tue Aug 22 19:55:56 2006
@@ -18,7 +18,7 @@
+--+
  */
 
-/* $Id: string.c,v 1.445.2.14.2.11 2006/08/10 14:40:12 iliaa Exp $ */
+/* $Id: string.c,v 1.445.2.14.2.12 2006/08/22 19:55:56 tony2001 Exp $ */
 
 /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */
 
@@ -886,6 +886,10 @@
HashPosition   pos;
smart_str  implstr = {0};
intnumelems, i = 0;
+   zend_bool free_tmp_val;
+   zval tmp_val;
+   char *str;
+   int str_len;
 
numelems = zend_hash_num_elements(Z_ARRVAL_P(arr));
 
@@ -896,6 +900,7 @@
zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(arr), pos);
 
while (zend_hash_get_current_data_ex(Z_ARRVAL_P(arr), (void **) tmp, 
pos) == SUCCESS) {
+   free_tmp_val = 0;
if ((*tmp)-type != IS_STRING) {
if ((*tmp)-type == IS_OBJECT) {
int copy;
@@ -907,12 +912,23 @@
}
goto next;
} else {
-   SEPARATE_ZVAL(tmp);
-   convert_to_string(*tmp);
+   tmp_val = **tmp;
+   zval_copy_ctor(tmp_val);
+   convert_to_string(tmp_val);
+   str = Z_STRVAL(tmp_val);
+   str_len = Z_STRLEN(tmp_val);
+   free_tmp_val = 1;
}
-   } 
+   } else {
+   str = Z_STRVAL_PP(tmp);
+   str_len = Z_STRLEN_PP(tmp);
+   }

-   smart_str_appendl(implstr, Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp));
+   smart_str_appendl(implstr, str, str_len);
+
+   if (free_tmp_val) {
+   zval_dtor(tmp_val);
+   }
 next:
if (++i != numelems) {
smart_str_appendl(implstr, Z_STRVAL_P(delim), 
Z_STRLEN_P(delim));

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



[PHP-CVS] cvs: php-src(PHP_5_2) /ext/standard/tests/strings implode1.phpt

2006-08-22 Thread Antony Dovgal
tony2001Tue Aug 22 20:10:50 2006 UTC

  Added files: (Branch: PHP_5_2)
/php-src/ext/standard/tests/strings implode1.phpt 
  Log:
  add test for real
  
  

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/implode1.phpt?view=markuprev=1.1
Index: php-src/ext/standard/tests/strings/implode1.phpt
+++ php-src/ext/standard/tests/strings/implode1.phpt
--TEST--
implode() and various args 
--FILE--
?php

$a = array(
array(1,2),
array(1.1,2.2),
array(array(2),array(1)),
array(false,true),
);

foreach ($a as $val) {
var_dump(implode(', ', $val));
var_dump($val);
}

echo Done\n;
?
--EXPECTF-- 
string(4) 1, 2
array(2) {
  [0]=
  int(1)
  [1]=
  int(2)
}
string(8) 1.1, 2.2
array(2) {
  [0]=
  float(1.1)
  [1]=
  float(2.2)
}

Notice: Array to string conversion in %s on line %d

Notice: Array to string conversion in %s on line %d
string(12) Array, Array
array(2) {
  [0]=
  array(1) {
[0]=
int(2)
  }
  [1]=
  array(1) {
[0]=
int(1)
  }
}
string(3) , 1
array(2) {
  [0]=
  bool(false)
  [1]=
  bool(true)
}
Done
--UEXPECTF--
unicode(4) 1, 2
array(2) {
  [0]=
  int(1)
  [1]=
  int(2)
}
unicode(8) 1.1, 2.2
array(2) {
  [0]=
  float(1.1)
  [1]=
  float(2.2)
}

Notice: Array to string conversion in %s on line %d

Notice: Array to string conversion in %s on line %d
unicode(12) Array, Array
array(2) {
  [0]=
  array(1) {
[0]=
int(2)
  }
  [1]=
  array(1) {
[0]=
int(1)
  }
}
unicode(3) , 1
array(2) {
  [0]=
  bool(false)
  [1]=
  bool(true)
}
Done

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