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

2007-07-12 Thread changelog
changelog   Fri Jul 13 01:31:25 2007 UTC

  Modified files:  
/ZendEngine2ChangeLog 
  Log:
  ChangeLog update
  
http://cvs.php.net/viewvc.cgi/ZendEngine2/ChangeLog?r1=1.1139r2=1.1140diff_format=u
Index: ZendEngine2/ChangeLog
diff -u ZendEngine2/ChangeLog:1.1139 ZendEngine2/ChangeLog:1.1140
--- ZendEngine2/ChangeLog:1.1139Thu Jul 12 01:31:33 2007
+++ ZendEngine2/ChangeLog   Fri Jul 13 01:31:24 2007
@@ -1,3 +1,74 @@
+2007-07-12  Ilia Alshanetsky  [EMAIL PROTECTED]
+
+* (PHP_5_2)
+  tests/bug41919.phpt:
+  
+  revise test to reflect recent code
+
+* (PHP_5_2)
+  zend_execute.c:
+  Commit previously missing patch for bug #41919
+
+2007-07-12  Dmitry Stogov  [EMAIL PROTECTED]
+
+* zend_object_handlers.c
+  zend_object_handlers.c
+  tests/bug41961.phpt:
+  Fixed bug #41961 (Ensure search for hidden private methods does not stray
+  from class hierarchy). (robin_fernandes at uk dot ibm dot com)
+
+* tests/bug41961.phpt
+  tests/bug41961.phpt:
+  
+  file bug41961.phpt was initially added on branch PHP_5_2.
+
+2007-07-12  Antony Dovgal  [EMAIL PROTECTED]
+
+* tests/020.phpt:
+  add new test
+
+* tests/020.phpt
+  tests/020.phpt:
+  
+  file 020.phpt was initially added on branch PHP_5_2.
+
+2007-07-12  Dmitry Stogov  [EMAIL PROTECTED]
+
+* zend_API.c
+  zend_compile.c
+  zend_compile.h
+  zend_execute_API.c
+  zend_globals.h
+  zend_language_parser.y
+  zend_language_scanner.l
+  zend_vm_def.h
+  zend_vm_execute.h
+  tests/ns_001.phpt
+  tests/ns_002.phpt
+  tests/ns_003.phpt
+  tests/ns_004.phpt
+  tests/ns_005.phpt
+  tests/ns_006.phpt
+  tests/ns_007.phpt
+  tests/ns_008.phpt
+  tests/ns_009.phpt
+  tests/ns_011.phpt
+  tests/ns_012.phpt
+  tests/ns_013.phpt
+  tests/ns_014.phpt
+  tests/ns_015.phpt
+  tests/ns_016.phpt
+  tests/ns_017.phpt
+  tests/ns_018.phpt
+  tests/ns_019.phpt
+  tests/ns_021.phpt
+  tests/ns_022.phpt
+  tests/ns_023.phpt
+  tests/ns_024.phpt
+  tests/ns_031.phpt
+  tests/ns_032.phpt:
+  Namespaces
+
 2007-07-11  Dmitry Stogov  [EMAIL PROTECTED]
 
 * zend_API.h:
@@ -18291,7 +18362,7 @@
 2003-06-10  Jani Taskinen  [EMAIL PROTECTED]
 
 * zend_multiply.h:
-  - Missing $Id: ChangeLog,v 1.1139 2007/07/12 01:31:33 changelog Exp $ tag
+  - Missing $Id: ChangeLog,v 1.1140 2007/07/13 01:31:24 changelog Exp $ tag
 
 2003-06-10  James Cox  [EMAIL PROTECTED]
 
@@ -20015,7 +20086,7 @@
   zend_types.h
   zend_variables.c
   zend_variables.h:
-  - Added some missing CVS $Id: ChangeLog,v 1.1139 2007/07/12 01:31:33 
changelog Exp $ tags, headers and footers.
+  - Added some missing CVS $Id: ChangeLog,v 1.1140 2007/07/13 01:31:24 
changelog Exp $ tags, headers and footers.
 
 2003-01-30  Ilia Alshanetsky  [EMAIL PROTECTED]
 


Re: [PHP-CVS] cvs: php-src(PHP_5_2) / configure.in /ext/odbc config.m4 /sapi/aolserver config.m4 /sapi/apache config.m4 /sapi/apache2filter config.m4 /sapi/apache2handler config.m4 /sapi/apache_

2007-07-12 Thread Derick Rethans
On Wed, 11 Jul 2007, Jani Taskinen wrote:

 jani  Wed Jul 11 23:20:37 2007 UTC
 

   MFH: - Enabled PHP_CHECK_CONFIGURE_OPTIONS (checks for unknown configure
   MFH:   options)

Add this to the NEWS file? I am pretty sure people want to know about 
this as it's quite useful.

Derick

-- 
Derick Rethans
http://derickrethans.nl | http://ez.no | http://xdebug.org

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



[PHP-CVS] cvs: php-src /ext/standard basic_functions.c /ext/standard/tests/general_functions bug41970.phpt

2007-07-12 Thread Antony Dovgal
tony2001Thu Jul 12 09:19:04 2007 UTC

  Added files: 
/php-src/ext/standard/tests/general_functions   bug41970.phpt 

  Modified files:  
/php-src/ext/standard   basic_functions.c 
  Log:
  fix #41970 (call_user_func_*() leaks on failure)
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/basic_functions.c?r1=1.864r2=1.865diff_format=u
Index: php-src/ext/standard/basic_functions.c
diff -u php-src/ext/standard/basic_functions.c:1.864 
php-src/ext/standard/basic_functions.c:1.865
--- php-src/ext/standard/basic_functions.c:1.864Wed Jul 11 17:39:04 2007
+++ php-src/ext/standard/basic_functions.c  Thu Jul 12 09:19:04 2007
@@ -17,7 +17,7 @@
+--+
  */
 
-/* $Id: basic_functions.c,v 1.864 2007/07/11 17:39:04 johannes Exp $ */
+/* $Id: basic_functions.c,v 1.865 2007/07/12 09:19:04 tony2001 Exp $ */
 
 #include php.h
 #include php_streams.h
@@ -5032,7 +5032,7 @@
Call a user function which is the first parameter */
 PHP_FUNCTION(call_user_func)
 {
-   zval *retval_ptr = return_value;
+   zval *retval_ptr = NULL;
zend_fcall_info fci;
zend_fcall_info_cache fci_cache;
 
@@ -5040,13 +5040,12 @@
return;
}
 
-   fci.retval_ptr_ptr = return_value_ptr;
+   fci.retval_ptr_ptr = retval_ptr;
 
if (zend_call_function(fci, fci_cache TSRMLS_CC) == SUCCESS) {
-   zval_ptr_dtor(retval_ptr);
-   }
-   if (!*return_value_ptr) {
-   ALLOC_INIT_ZVAL(*return_value_ptr);
+   *return_value = **fci.retval_ptr_ptr;
+   zval_copy_ctor(return_value);
+   zval_ptr_dtor(fci.retval_ptr_ptr);
}
 
if (fci.params) {
@@ -5059,7 +5058,7 @@
Call a user function which is the first parameter with the arguments 
contained in array */
 PHP_FUNCTION(call_user_func_array)
 {
-   zval *params, *retval_ptr = return_value;
+   zval *params, *retval_ptr = NULL;
zend_fcall_info fci;
zend_fcall_info_cache fci_cache;
 
@@ -5067,15 +5066,13 @@
return;
}
 
-   fci.retval_ptr_ptr = return_value_ptr;
-
zend_fcall_info_args(fci, params TSRMLS_CC);
+   fci.retval_ptr_ptr = retval_ptr;
 
if (zend_call_function(fci, fci_cache TSRMLS_CC) == SUCCESS) {
-   zval_ptr_dtor(retval_ptr);
-   }
-   if (!*return_value_ptr) {
-   ALLOC_INIT_ZVAL(*return_value_ptr);
+   *return_value = **fci.retval_ptr_ptr;
+   zval_copy_ctor(return_value);
+   zval_ptr_dtor(fci.retval_ptr_ptr);
}
 
zend_fcall_info_args_clear(fci, 1);

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/general_functions/bug41970.phpt?view=markuprev=1.1
Index: php-src/ext/standard/tests/general_functions/bug41970.phpt
+++ php-src/ext/standard/tests/general_functions/bug41970.phpt
--TEST--
Bug #41970 (call_user_func_*() leaks on failure)
--FILE--
?php

$a = array(4,3,2);

var_dump(call_user_func_array(sort, array($a)));
var_dump(call_user_func_array(strlen, array($a)));
var_dump(call_user_func(sort, $a));
var_dump(call_user_func(strlen, $a));

echo Done\n;
?
--EXPECTF-- 
NULL

Notice: Array to string conversion in %s on line %d
int(5)
NULL

Notice: Array to string conversion in %s on line %d
int(5)
Done


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



Re: [PHP-CVS] cvs: php-src(PHP_5_2) / configure.in /ext/odbc config.m4 /sapi/aolserver config.m4 /sapi/apache config.m4 /sapi/apache2filter config.m4 /sapi/apache2handler config.m4 /sapi/apache_

2007-07-12 Thread Jani Taskinen
On Thu, 2007-07-12 at 08:51 +0200, Derick Rethans wrote:
 On Wed, 11 Jul 2007, Jani Taskinen wrote:
 
  janiWed Jul 11 23:20:37 2007 UTC
  
 
MFH: - Enabled PHP_CHECK_CONFIGURE_OPTIONS (checks for unknown configure
MFH:   options)
 
 Add this to the NEWS file? I am pretty sure people want to know about 
 this as it's quite useful.

Okay..once I fix some issues with it I'll add NEWS entry. It's not
completed yet. Either I get some input from Marcus or he does it himself
so that ext/dba/config.m4 is also using the proper macros.. :D

--Jani

-- 
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/general_functions is_callable.phpt

2007-07-12 Thread Antony Dovgal
tony2001Thu Jul 12 09:26:29 2007 UTC

  Modified files:  
/php-src/ext/standard/tests/general_functions   is_callable.phpt 
  Log:
  fix test
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/general_functions/is_callable.phpt?r1=1.2r2=1.3diff_format=u
Index: php-src/ext/standard/tests/general_functions/is_callable.phpt
diff -u php-src/ext/standard/tests/general_functions/is_callable.phpt:1.2 
php-src/ext/standard/tests/general_functions/is_callable.phpt:1.3
--- php-src/ext/standard/tests/general_functions/is_callable.phpt:1.2   Tue Jun 
 5 09:21:54 2007
+++ php-src/ext/standard/tests/general_functions/is_callable.phpt   Thu Jul 
12 09:26:28 2007
@@ -1,5 +1,7 @@
 --TEST--
 Test is_callable() function
+--INI--
+precision=14
 --FILE--
 ?php
 /* Prototype: bool is_callable ( mixed $var [, bool $syntax_only [, string 
$callable_name]] );

-- 
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/general_functions is_callable.phpt

2007-07-12 Thread Antony Dovgal
tony2001Thu Jul 12 09:26:42 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/standard/tests/general_functions   is_callable.phpt 
  Log:
  fix test
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/general_functions/is_callable.phpt?r1=1.1.2.1r2=1.1.2.2diff_format=u
Index: php-src/ext/standard/tests/general_functions/is_callable.phpt
diff -u php-src/ext/standard/tests/general_functions/is_callable.phpt:1.1.2.1 
php-src/ext/standard/tests/general_functions/is_callable.phpt:1.1.2.2
--- php-src/ext/standard/tests/general_functions/is_callable.phpt:1.1.2.1   
Tue Jun  5 09:12:34 2007
+++ php-src/ext/standard/tests/general_functions/is_callable.phpt   Thu Jul 
12 09:26:42 2007
@@ -1,5 +1,7 @@
 --TEST--
 Test is_callable() function
+--INI--
+precision=14
 --FILE--
 ?php
 /* Prototype: bool is_callable ( mixed $var [, bool $syntax_only [, string 
$callable_name]] );

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



[PHP-CVS] cvs: php-src /ext/json JSON_parser.c utf8_decode.c utf8_to_utf16.c

2007-07-12 Thread Antony Dovgal
tony2001Thu Jul 12 09:55:41 2007 UTC

  Modified files:  
/php-src/ext/json   JSON_parser.c utf8_decode.c utf8_to_utf16.c 
  Log:
  fix WS, CS and other S
  
  http://cvs.php.net/viewvc.cgi/php-src/ext/json/JSON_parser.c?r1=1.15r2=1.16diff_format=u
Index: php-src/ext/json/JSON_parser.c
diff -u php-src/ext/json/JSON_parser.c:1.15 php-src/ext/json/JSON_parser.c:1.16
--- php-src/ext/json/JSON_parser.c:1.15 Wed Jun 13 17:57:10 2007
+++ php-src/ext/json/JSON_parser.c  Thu Jul 12 09:55:41 2007
@@ -38,6 +38,8 @@
 significant reductions in the size of the state transition table.
 */
 
+/* {{{ constants */
+
 /* error */
 #define S_ERR -1
 
@@ -134,7 +136,9 @@
 /* everything else */
 #define S_ETC 30
 
+/* }}} */
 
+/* {{{ tables */
 /*
 This table maps the 128 ASCII characters into the 32 character classes.
 The remaining Unicode characters should be mapped to S_ETC.
@@ -161,7 +165,6 @@
 S_ETC, S_ETC, S_ETC, S_LBE, S_ETC, S_RBE, S_ETC, S_ETC
 };
 
-
 /*
 The state transition table takes the current state and the current symbol,
 and returns either a new state or an action. A new state is a number 
between
@@ -201,8 +204,9 @@
 /*29*/ {29,29,-1,-1,-1,-1,-1,-1, 
3,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}
 };
 
-#define JSON_PARSER_MAX_DEPTH 128
+/* }}} */
 
+#define JSON_PARSER_MAX_DEPTH 128
 
 /*
A stack maintains the states of nested structures.
@@ -215,7 +219,6 @@
 int the_top;
 } json_parser;
 
-
 /*
 These modes can be pushed on the PDA stack.
 */
@@ -227,154 +230,125 @@
 /*
 Push a mode onto the stack. Return false if there is overflow.
 */
-static int
-push(json_parser *json, zval *z, int mode)
+static int push(json_parser *json, zval *z, int mode) /* {{{ */
 {
-json-the_top += 1;
-if (json-the_top = JSON_PARSER_MAX_DEPTH) {
-return false;
-}
+   json-the_top += 1;
+   if (json-the_top = JSON_PARSER_MAX_DEPTH) {
+   return false;
+   }
 
-json-the_stack[json-the_top] = mode;
-return true;
+   json-the_stack[json-the_top] = mode;
+   return true;
 }
-
+/* }}} */
 
 /*
 Pop the stack, assuring that the current mode matches the expectation.
 Return false if there is underflow or if the modes mismatch.
 */
-static int
-pop(json_parser *json, zval *z, int mode)
+static int pop(json_parser *json, zval *z, int mode) /* {{{ */
 {
-if (json-the_top  0 || json-the_stack[json-the_top] != mode) {
-return false;
-}
-json-the_stack[json-the_top] = 0;
-json-the_top -= 1;
+   if (json-the_top  0 || json-the_stack[json-the_top] != mode) {
+   return false;
+   }
+   json-the_stack[json-the_top] = 0;
+   json-the_top -= 1;
 
-return true;
+   return true;
 }
+/* }}} */
 
-
-static int dehexchar(char c)
+static int dehexchar(char c) /* {{{ */
 {
-if (c = '0'  c = '9')
-{
+if (c = '0'  c = '9') {
 return c - '0';
-}
-else if (c = 'A'  c = 'F')
-{
+} else if (c = 'A'  c = 'F') {
 return c - ('A' - 10);
-}
-else if (c = 'a'  c = 'f')
-{
+} else if (c = 'a'  c = 'f') {
 return c - ('a' - 10);
-}
-else
-{
+} else {
 return -1;
 }
 }
+/* }}} */
 
-
-static void json_create_zval(zval **z, smart_str *buf, int type TSRMLS_DC)
+static void json_create_zval(zval **z, smart_str *buf, int type TSRMLS_DC) /* 
{{{ */
 {
-ALLOC_INIT_ZVAL(*z);
+   ALLOC_INIT_ZVAL(*z);
 
-if (type == IS_LONG)
-{
-   double d = zend_strtod(buf-c, NULL);
-   if (d  LONG_MAX || d  -LONG_MAX) {
-   ZVAL_DOUBLE(*z, d);
-   } else {
-   ZVAL_LONG(*z, (long)d);
+   if (type == IS_LONG) {
+   double d = zend_strtod(buf-c, NULL);
+   if (d  LONG_MAX || d  -LONG_MAX) {
+   ZVAL_DOUBLE(*z, d);
+   } else {
+   ZVAL_LONG(*z, (long)d);
+   }
+   } else if (type == IS_DOUBLE) {
+   ZVAL_DOUBLE(*z, zend_strtod(buf-c, NULL));
+   } else if (type == IS_STRING) {
+   ZVAL_UTF8_STRINGL(*z, buf-c, buf-len, ZSTR_DUPLICATE);
+   } else if (type == IS_BOOL) {
+   ZVAL_BOOL(*z, (*(buf-c) == 't'));
+   } else { /* type == IS_NULL) || type unknown */ 
+   ZVAL_NULL(*z);
}
-}
-else if (type == IS_DOUBLE)
-{
-ZVAL_DOUBLE(*z, zend_strtod(buf-c, NULL));
-}
-else if (type == IS_STRING)
-{
-ZVAL_UTF8_STRINGL(*z, buf-c, buf-len, ZSTR_DUPLICATE);
-}
-else if (type == IS_BOOL)
-{
-ZVAL_BOOL(*z, (*(buf-c) == 't'));
-}
-else /* type == IS_NULL) || type unknown */
-{
-ZVAL_NULL(*z);
-}
 }
+/* }}} */
 
-
-static void utf16_to_utf8(smart_str *buf, unsigned short utf16)
+static void utf16_to_utf8(smart_str *buf, unsigned short utf16) /* {{{ */
 {
-if (utf16  0x80)
-{
-

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

2007-07-12 Thread Antony Dovgal
tony2001Thu Jul 12 10:04:42 2007 UTC

  Modified files:  
/php-src/ext/xmlrpc xmlrpc-epi-php.c 
  Log:
  fix ws, cs and folding
  
  http://cvs.php.net/viewvc.cgi/php-src/ext/xmlrpc/xmlrpc-epi-php.c?r1=1.49r2=1.50diff_format=u
Index: php-src/ext/xmlrpc/xmlrpc-epi-php.c
diff -u php-src/ext/xmlrpc/xmlrpc-epi-php.c:1.49 
php-src/ext/xmlrpc/xmlrpc-epi-php.c:1.50
--- php-src/ext/xmlrpc/xmlrpc-epi-php.c:1.49Fri Jan 12 12:31:31 2007
+++ php-src/ext/xmlrpc/xmlrpc-epi-php.c Thu Jul 12 10:04:42 2007
@@ -51,7 +51,7 @@
+--+
  */
 
-/* $Id: xmlrpc-epi-php.c,v 1.49 2007/01/12 12:31:31 tony2001 Exp $ */
+/* $Id: xmlrpc-epi-php.c,v 1.50 2007/07/12 10:04:42 tony2001 Exp $ */
 
 /**
 * BUGS:   *
@@ -199,7 +199,7 @@
 * startup / shutdown *
 */
 
-static void destroy_server_data(xmlrpc_server_data *server)
+static void destroy_server_data(xmlrpc_server_data *server) /* {{{ */
 {
if (server) {
XMLRPC_ServerDestroy(server-server_ptr);
@@ -213,26 +213,28 @@
efree(server);
}
 }
+/* }}} */
 
 /* called when server is being destructed. either when xmlrpc_server_destroy
  * is called, or when request ends.  */
-static void xmlrpc_server_destructor(zend_rsrc_list_entry *rsrc TSRMLS_DC)
+static void xmlrpc_server_destructor(zend_rsrc_list_entry *rsrc TSRMLS_DC) /* 
{{{ */
 {
if (rsrc  rsrc-ptr) {
destroy_server_data((xmlrpc_server_data*) rsrc-ptr);
}
 }
+/* }}} */
 
 /* module init */
-PHP_MINIT_FUNCTION(xmlrpc)
+PHP_MINIT_FUNCTION(xmlrpc) /* {{{ */
 {
le_xmlrpc_server = 
zend_register_list_destructors_ex(xmlrpc_server_destructor, NULL, xmlrpc 
server, module_number);
-
return SUCCESS;
 }
+/* }}} */
 
 /* display info in phpinfo() */
-PHP_MINFO_FUNCTION(xmlrpc)
+PHP_MINFO_FUNCTION(xmlrpc) /* {{{ */
 {
php_info_print_table_start();
php_info_print_table_row(2, core library version, 
XMLRPC_GetVersionString());
@@ -242,10 +244,11 @@
php_info_print_table_row(2, open sourced by, Epinions.com);
php_info_print_table_end();
 }
+/* }}} */
 
 /***
-* random utilities *
-***/
+ * random utilities *
+ ***/
 
 /* Utility functions for adding data types to arrays, with or without key 
(assoc, non-assoc).
  * Could easily be further generalized to work with objects.
@@ -273,7 +276,7 @@
 
 #endif
 
-static int add_zval(zval* list, const char* id, zval** val)
+static int add_zval(zval* list, const char* id, zval** val) /* {{{ */
 {
if (list  val) {
if (id) {
@@ -291,17 +294,18 @@
/* what is the correct return on error? */
return 0;
 }
+/* }}} */
 
 #define my_zend_hash_get_current_key(ht, my_key, num_index) 
zend_hash_get_current_key(ht, my_key, num_index, 0)
 
 
 /*
-* input / output options *
-*/
+ * input / output options *
+ */
 
 /* parse an array (user input) into output options suitable for use by xmlrpc 
engine
  * and determine whether to return data as xml or php vars */
-static void set_output_options(php_output_options* options, zval* output_opts)
+static void set_output_options(php_output_options* options, zval* output_opts) 
/* {{{ */
 {
if (options) {
 
@@ -349,280 +353,270 @@
} else if (!strcmp(Z_STRVAL_PP(val), 
VERSION_VALUE_SIMPLE)) {
options-xmlrpc_out.version = 
xmlrpc_version_simple;
} else if 
(!strcmp((*val)-value.str.val, VERSION_VALUE_SOAP11)) {
-   
options-xmlrpc_out.version = xmlrpc_version_soap_1_1;
-   } else { /* 
if(!strcmp((*val)-value.str.val, VERSION_VALUE_AUTO)) { */
-   options-b_auto_version 
= 1;
+   options-xmlrpc_out.version = 
xmlrpc_version_soap_1_1;
+   } else { /* 
if(!strcmp((*val)-value.str.val, VERSION_VALUE_AUTO)) */
+   options-b_auto_version = 1;
}
}
}
 
- /* encoding code set */
- if(zend_hash_find(Z_ARRVAL_P(output_opts), 
-   ENCODING_KEY, ENCODING_KEY_LEN + 1, 
-   (void**)val) == SUCCESS) {
-if(Z_TYPE_PP(val) == IS_STRING) {
-   options-xmlrpc_out.xml_elem_opts.encoding = 
estrdup(Z_STRVAL_PP(val));
-}
- }

[PHP-CVS] cvs: php-src /ext/mysql/tests mysql_num_rows.phpt

2007-07-12 Thread Ulf Wendel
uw  Thu Jul 12 10:18:14 2007 UTC

  Modified files:  
/php-src/ext/mysql/testsmysql_num_rows.phpt 
  Log:
  Whitespace/CS only
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/mysql/tests/mysql_num_rows.phpt?r1=1.1r2=1.2diff_format=u
Index: php-src/ext/mysql/tests/mysql_num_rows.phpt
diff -u php-src/ext/mysql/tests/mysql_num_rows.phpt:1.1 
php-src/ext/mysql/tests/mysql_num_rows.phpt:1.2
--- php-src/ext/mysql/tests/mysql_num_rows.phpt:1.1 Sun Nov 19 12:14:44 2006
+++ php-src/ext/mysql/tests/mysql_num_rows.phpt Thu Jul 12 10:18:14 2007
@@ -2,59 +2,57 @@
 mysql_num_rows()
 --SKIPIF--
 ?php require_once('skipif.inc'); ?
-?php require_once('skipifemb.inc'); ?
 --FILE--
 ?php
-include connect.inc;
-
-$tmp= NULL;   
-$link   = NULL;
-
-if (!is_null($tmp = @mysql_num_rows()))
-printf([001] Expecting NULL, got %s/%s\n, gettype($tmp), $tmp);
-
-if (false !== ($tmp = @mysql_num_rows($link)))
-printf([002] Expecting boolean/false, got %s/%s\n, gettype($tmp), 
$tmp);
-
-require('table.inc');
-
-function func_test_mysql_num_rows($link, $query, $expected, $offset, 
$test_free = false) {
-
-if (!$res = mysql_query($query, $link)) {
-printf([%03d] [%d] %s\n, $offset, mysql_errno($link), 
mysql_error($link));
-return;
-}
-
-if ($expected !== ($tmp = mysql_num_rows($res)))
-printf([%03d] Expecting %s/%d, got %s/%d\n, $offset + 1, 
-gettype($expected), $expected,
-gettype($tmp), $tmp);
-
-mysql_free_result($res);
-
-if ($test_free  (false !== ($tmp = mysql_num_rows($res
-printf([%03d] Expecting boolean/false, got %s/%s\n, $offset + 2, 
gettype($tmp), $tmp);
-
-}   
-
-func_test_mysql_num_rows($link, SELECT 1 AS a, 1, 5);
-func_test_mysql_num_rows($link, SHOW VARIABLES LIKE '%nixnutz%', 0, 10);
-func_test_mysql_num_rows($link, INSERT INTO test(id, label) VALUES (100, 
'z'), false, 15);
-func_test_mysql_num_rows($link, SELECT id FROM test LIMIT 2, 2, 20, 
true);
-
-if ($res = mysql_query('SELECT COUNT(id) AS num FROM test', $link)) {
-
-$row = mysql_fetch_assoc($res);
-mysql_free_result($res);
-
-func_test_mysql_num_rows($link, SELECT id, label FROM test, 
(int)$row['num'], 25);
-
-} else {
-   printf([030] [%d] %s\n, mysql_errno($link), mysql_error($link));  
  
-}
-
-mysql_close($link);
-print done!;
+include connect.inc;
+
+$tmp= NULL;
+$link   = NULL;
+
+if (!is_null($tmp = @mysql_num_rows()))
+printf([001] Expecting NULL, got %s/%s\n, gettype($tmp), $tmp);
+
+if (false !== ($tmp = @mysql_num_rows($link)))
+printf([002] Expecting boolean/false, got %s/%s\n, gettype($tmp), $tmp);
+
+require('table.inc');
+
+function func_test_mysql_num_rows($link, $query, $expected, $offset, 
$test_free = false) {
+
+   if (!$res = mysql_query($query, $link)) {
+   printf([%03d] [%d] %s\n, $offset, mysql_errno($link), 
mysql_error($link));
+   return;
+   }
+
+   if ($expected !== ($tmp = mysql_num_rows($res)))
+   printf([%03d] Expecting %s/%d, got %s/%d\n, $offset + 1,
+   gettype($expected), $expected,
+   gettype($tmp), $tmp);
+
+   mysql_free_result($res);
+
+   if ($test_free  (false !== ($tmp = mysql_num_rows($res
+   printf([%03d] Expecting boolean/false, got %s/%s\n, $offset + 
2, gettype($tmp), $tmp);
+}
+
+func_test_mysql_num_rows($link, SELECT 1 AS a, 1, 5);
+func_test_mysql_num_rows($link, SHOW VARIABLES LIKE '%nixnutz%', 0, 10);
+func_test_mysql_num_rows($link, INSERT INTO test(id, label) VALUES (100, 
'z'), false, 15);
+func_test_mysql_num_rows($link, SELECT id FROM test LIMIT 2, 2, 20, true);
+
+if ($res = mysql_query('SELECT COUNT(id) AS num FROM test', $link)) {
+
+   $row = mysql_fetch_assoc($res);
+   mysql_free_result($res);
+
+   func_test_mysql_num_rows($link, SELECT id, label FROM test, 
(int)$row['num'], 25);
+
+} else {
+   printf([030] [%d] %s\n, mysql_errno($link), mysql_error($link));
+}
+
+mysql_close($link);
+print done!;
 ?
 --EXPECTF--
 Warning: mysql_num_rows(): supplied argument is not a valid MySQL result 
resource 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 /ext/mysql/tests mysql_pconnect.phpt

2007-07-12 Thread Ulf Wendel
uw  Thu Jul 12 10:25:40 2007 UTC

  Modified files:  
/php-src/ext/mysql/testsmysql_pconnect.phpt 
  Log:
  1) Whitespace/CS
  2) Test mysql.default_socket only if we're using a socket to connect
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/mysql/tests/mysql_pconnect.phpt?r1=1.1r2=1.2diff_format=u
Index: php-src/ext/mysql/tests/mysql_pconnect.phpt
diff -u php-src/ext/mysql/tests/mysql_pconnect.phpt:1.1 
php-src/ext/mysql/tests/mysql_pconnect.phpt:1.2
--- php-src/ext/mysql/tests/mysql_pconnect.phpt:1.1 Sun Nov 19 12:14:44 2006
+++ php-src/ext/mysql/tests/mysql_pconnect.phpt Thu Jul 12 10:25:40 2007
@@ -2,72 +2,77 @@
 mysql_pconnect()
 --SKIPIF--
 ?php require_once('skipif.inc'); ?
-?php require_once('skipifemb.inc'); ?
 --FILE--
 ?php
-include connect.inc;
+include connect.inc;
 
-$tmp= NULL;   
-$link   = NULL;
-
-// mysql_pconnect ( [string server [, string username [, string password 
[, bool new_link [, int client_flags] )
-if (NULL !== ($tmp = @mysql_pconnect($link, $link, $link, $link, $link, 
$link)))
-printf([001] Expecting NULL, got %s/%s\n, gettype($tmp), $tmp);
-
-$myhost = (is_null($socket)) ? ((is_null($port)) ? $host : $host . ':' . 
$port) : $host . ':' . $socket;
-if (!$link = mysql_pconnect($myhost, $user, $passwd, true))
-printf([002] Cannot connect to the server using host=%s/%s, user=%s, 
passwd=***, dbname=%s, port=%s, socket=%s\n,
-$host, $myhost, $user, $db, $port, $socket);   
-   
-mysql_close($link);
-
-if ($link = mysql_pconnect($myhost, $user . 'unknown_really', $passwd . 
'non_empty', true))
-printf([003] Can connect to the server using host=%s/%s, user=%s, 
passwd=***non_empty, dbname=%s, port=%s, socket=%s\n,
-$host, $myhost, $user . 'unknown_really', $db, $port, $socket);
-
-if (false !== $link)
-printf([004] Expecting boolean/false, got %s/%s\n, gettype($link), 
$link);
-
-// Run the following tests without an anoynmous MySQL user and use a 
password for the test user!   
-ini_set('mysql.default_socket', $socket); 
-if (!is_resource($link = mysql_pconnect($host, $user, $passwd, true))) {
-printf([005] Usage of mysql.default_socket failed\n) ;
-} else {
-mysql_close($link);
-}
-
-if (!ini_get('sql.safe_mode')) {
-
-ini_set('mysql.default_port', $port);
-if (!is_resource($link = mysql_pconnect($host, $user, $passwd, true))) 
{
-printf([006] Usage of mysql.default_port failed\n) ;
-} else {
-mysql_close($link);
-}
-
-ini_set('mysql.default_password', $passwd);
-if (!is_resource($link = mysql_pconnect($myhost, $user))) {
-printf([007] Usage of mysql.default_password failed\n) ;
-} else {
-mysql_close($link);
-}
-
-ini_set('mysql.default_user', $user);
-if (!is_resource($link = mysql_pconnect($myhost))) {
-printf([008] Usage of mysql.default_user failed\n);
-} else {
-mysql_close($link);
-}
-
-ini_set('mysql.default_host', $myhost);
-if (!is_resource($link = mysql_pconnect())) {
-printf([009] Usage of mysql.default_host failed\n) ;
-} else {
-mysql_close($link); 
-}
-}
+$tmp= NULL;
+$link   = NULL;
 
-print done!;   
+// mysql_pconnect ( [string server [, string username [, string password [, 
bool new_link [, int client_flags] )
+if (NULL !== ($tmp = @mysql_pconnect($link, $link, $link, $link, $link, 
$link)))
+   printf([001] Expecting NULL, got %s/%s\n, gettype($tmp), $tmp);
+
+$myhost = (is_null($socket)) ? ((is_null($port)) ? $host : $host . ':' . 
$port) : $host . ':' . $socket;
+if (!$link = mysql_pconnect($myhost, $user, $passwd, true))
+   printf([002] Cannot connect to the server using host=%s/%s, user=%s, 
passwd=***, dbname=%s, port=%s, socket=%s\n,
+   $host, $myhost, $user, $db, $port, $socket);
+
+mysql_close($link);
+
+if ($link = mysql_pconnect($myhost, $user . 'unknown_really', $passwd . 
'non_empty', true))
+   printf([003] Can connect to the server using host=%s/%s, user=%s, 
passwd=***non_empty, dbname=%s, port=%s, socket=%s\n,
+   $host, $myhost, $user . 'unknown_really', $db, $port, $socket);
+
+if (false !== $link)
+   printf([004] Expecting boolean/false, got %s/%s\n, gettype($link), 
$link);
+
+// Run the following tests without an anoynmous MySQL user and use a password 
for the test user!
+
+
+if (!ini_get('sql.safe_mode')) {
+
+   if ($socket) {
+   ini_set('mysql.default_socket', $socket);
+   if (!is_resource($link = mysql_pconnect($host, $user, $passwd, 
true))) {
+   printf([005] Usage of 

[PHP-CVS] cvs: php-src /ext/mysql/tests mysql_ping.phpt

2007-07-12 Thread Ulf Wendel
uw  Thu Jul 12 10:30:03 2007 UTC

  Modified files:  
/php-src/ext/mysql/testsmysql_ping.phpt 
  Log:
  1) Whitespace/CS
  2) One line added to test default connection
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/mysql/tests/mysql_ping.phpt?r1=1.1r2=1.2diff_format=u
Index: php-src/ext/mysql/tests/mysql_ping.phpt
diff -u php-src/ext/mysql/tests/mysql_ping.phpt:1.1 
php-src/ext/mysql/tests/mysql_ping.phpt:1.2
--- php-src/ext/mysql/tests/mysql_ping.phpt:1.1 Sun Nov 19 12:14:44 2006
+++ php-src/ext/mysql/tests/mysql_ping.phpt Thu Jul 12 10:30:03 2007
@@ -4,37 +4,40 @@
 ?php require_once('skipif.inc'); ?
 --FILE--
 ?php
-include_once connect.inc;
-
-$tmp= NULL;   
-$link   = NULL;
-
-require('table.inc');
-
-if (!is_null($tmp = @mysql_ping($link, $link)))
-printf([001] Expecting NULL, got %s/%s\n, gettype($tmp), $tmp);
-
-var_dump(mysql_ping($link));
-
-// provoke an error to check if mysql_ping resets it
-$res = mysql_query('SELECT * FROM unknown_table', $link);
-if (!($errno = mysql_errno($link)))
-printf([002] Statement should have caused an error\n);
-
-var_dump(mysql_ping($link));
-if ($errno === mysql_errno($link))
-printf([003] Error codes should have been reset\n);
-   
-mysql_close($link);
-
-if (false !== ($tmp = mysql_ping($link)))
-printf([004] Expecting boolean/false, got %s/%s\n, gettype($tmp), 
$tmp);
-
-print done!;
+include_once connect.inc;
+
+$tmp= NULL;
+$link   = NULL;
+
+require('table.inc');
+
+if (!is_null($tmp = @mysql_ping($link, $link)))
+   printf([001] Expecting NULL, got %s/%s\n, gettype($tmp), $tmp);
+
+var_dump(mysql_ping($link));
+
+// provoke an error to check if mysql_ping resets it
+$res = mysql_query('SELECT * FROM unknown_table', $link);
+if (!($errno = mysql_errno($link)))
+   printf([002] Statement should have caused an error\n);
+
+var_dump(mysql_ping($link));
+
+if ($errno === mysql_errno($link))
+   printf([003] Error codes should have been reset\n);
+
+var_dump(mysql_ping());
+mysql_close($link);
+
+if (false !== ($tmp = mysql_ping($link)))
+   printf([004] Expecting boolean/false, got %s/%s\n, gettype($tmp), 
$tmp);
+
+print done!;
 ?
 --EXPECTF--
 bool(true)
 bool(true)
+bool(true)
 
 Warning: mysql_ping(): %d is not a valid MySQL-Link resource in %s on line %d
 done!

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



[PHP-CVS] cvs: php-src /ext/mysql/tests mysql_query.phpt

2007-07-12 Thread Ulf Wendel
uw  Thu Jul 12 10:47:00 2007 UTC

  Modified files:  
/php-src/ext/mysql/testsmysql_query.phpt 
  Log:
  1) Whitespace/CS
  2) Portability: don't expect any values and have them in the [U]EXPECTF, 
  if they will be available only with certain MySQL Server versions.
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/mysql/tests/mysql_query.phpt?r1=1.1r2=1.2diff_format=u
Index: php-src/ext/mysql/tests/mysql_query.phpt
diff -u php-src/ext/mysql/tests/mysql_query.phpt:1.1 
php-src/ext/mysql/tests/mysql_query.phpt:1.2
--- php-src/ext/mysql/tests/mysql_query.phpt:1.1Sun Nov 19 12:14:44 2006
+++ php-src/ext/mysql/tests/mysql_query.phptThu Jul 12 10:47:00 2007
@@ -2,100 +2,99 @@
 mysql_query()
 --SKIPIF--
 ?php require_once('skipif.inc'); ?
-?php require_once('skipifemb.inc'); ?
 --FILE--
 ?php
-include connect.inc;
-
-$tmp= NULL;   
-$link   = NULL;
-
-if (!is_null($tmp = @mysql_query()))
-printf([001] Expecting NULL, got %s/%s\n, gettype($tmp), $tmp);
-
-if (false !== ($tmp = @mysql_query($link)))
-printf([002] Expecting boolean/false, got %s/%s\n, gettype($tmp), 
$tmp);
-
-require('table.inc');
-
-if (NULL !== ($tmp = @mysql_query(SELECT 1 AS a, $link, foo)))
-printf([003] Expecting NULL, got %s/%s\n, gettype($tmp), $tmp);
-
-if (false !== ($tmp = mysql_query('THIS IS NOT SQL', $link)))
-printf([004] Expecting boolean/false, got %s/%s\n, gettype($tmp), 
$tmp);
-
-if (false !== ($tmp = mysql_query('SELECT this is sql but with backslash 
g\g', $link)))
-printf([005] Expecting boolean/false, got %s/%s\n, gettype($tmp), 
$tmp);
-
-if ((0 === mysql_errno($link)) || ('' == mysql_error($link)))
-printf([006] mysql_errno()/mysql_error should return some error\n);
-
-if (!$res = mysql_query('SELECT this is sql but with semicolon AS valid 
; ', $link))
-printf([007] [%d] %s\n, mysql_errno($link), mysql_error($link));
-
-var_dump(mysql_fetch_assoc($res));
-mysql_free_result($res);
-
-if (false !== ($res = mysql_query('SELECT this is sql but with semicolon 
AS valid ; SHOW VARIABLES', $link)))
-printf([008] [%d] %s\n, mysql_errno($link), mysql_error($link));
-
-if (mysql_query('DROP PROCEDURE IF EXISTS p', $link)) {
-// let's try to play with stored procedures
-if (mysql_query('CREATE PROCEDURE p(OUT ver_param VARCHAR(25)) BEGIN 
SELECT VERSION() INTO ver_param; END;', $link)) {
-$res = mysql_query('CALL p(@version)', $link);
-$res = mysql_query('SELECT @version AS p_version', $link);
-var_dump(mysql_fetch_assoc($res));
-mysql_free_result($res);
-} else {
-printf([009] [%d] %s\n, mysql_errno($link), mysql_error($link));
-}
-
-mysql_query('DROP FUNCTION IF EXISTS f', $link);
-if (mysql_query('CREATE FUNCTION f( ver_param VARCHAR(25)) RETURNS 
VARCHAR(25) DETERMINISTIC RETURN ver_param;', $link)) {
-$res = mysql_query('SELECT f(VERSION()) AS f_version', $link);
-var_dump(mysql_fetch_assoc($res));
-mysql_free_result($res);
-} else {
-printf([010] [%d] %s\n, mysql_errno($link), mysql_error($link));
-}
-}
-
-mysql_close($link);
-
-if (false !== ($tmp = mysql_query(SELECT id FROM test, $link)))
-printf([011] Expecting boolean/false, got %s/%s\n, gettype($tmp), 
$tmp);
-
-print done!;
+include_once(connect.inc);
+
+$tmp= NULL;
+$link   = NULL;
+
+if (!is_null($tmp = @mysql_query()))
+   printf([001] Expecting NULL, got %s/%s\n, gettype($tmp), $tmp);
+
+if (false !== ($tmp = @mysql_query($link)))
+   printf([002] Expecting boolean/false, got %s/%s\n, gettype($tmp), 
$tmp);
+
+require('table.inc');
+
+if (NULL !== ($tmp = @mysql_query(SELECT 1 AS a, $link, foo)))
+   printf([003] Expecting NULL, got %s/%s\n, gettype($tmp), $tmp);
+
+if (false !== ($tmp = mysql_query('THIS IS NOT SQL', $link)))
+   printf([004] Expecting boolean/false, got %s/%s\n, gettype($tmp), 
$tmp);
+
+if (false !== ($tmp = mysql_query('SELECT this is sql but with backslash 
g\g', $link)))
+   printf([005] Expecting boolean/false, got %s/%s\n, gettype($tmp), 
$tmp);
+
+if ((0 === mysql_errno($link)) || ('' == mysql_error($link)))
+   printf([006] mysql_errno()/mysql_error should return some error\n);
+
+if (!$res = mysql_query('SELECT this is sql but with semicolon AS valid ; ', 
$link))
+   printf([007] [%d] %s\n, mysql_errno($link), mysql_error($link));
+
+var_dump(mysql_fetch_assoc($res));
+mysql_free_result($res);
+
+if (false !== ($res = mysql_query('SELECT this is sql but with semicolon AS 
valid ; SHOW VARIABLES', $link)))
+   printf([008] [%d] %s\n, mysql_errno($link), mysql_error($link));
+
+if (mysql_query('DROP PROCEDURE 

[PHP-CVS] cvs: php-src /ext/mysql/tests mysql_real_escape_string.phpt

2007-07-12 Thread Ulf Wendel
uw  Thu Jul 12 10:52:23 2007 UTC

  Modified files:  
/php-src/ext/mysql/testsmysql_real_escape_string.phpt 
  Log:
  1) Whitespace/CS
  2) Tiny check for default link added
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/mysql/tests/mysql_real_escape_string.phpt?r1=1.1r2=1.2diff_format=u
Index: php-src/ext/mysql/tests/mysql_real_escape_string.phpt
diff -u php-src/ext/mysql/tests/mysql_real_escape_string.phpt:1.1 
php-src/ext/mysql/tests/mysql_real_escape_string.phpt:1.2
--- php-src/ext/mysql/tests/mysql_real_escape_string.phpt:1.1   Sun Nov 19 
12:14:44 2006
+++ php-src/ext/mysql/tests/mysql_real_escape_string.phpt   Thu Jul 12 
10:52:23 2007
@@ -2,28 +2,32 @@
 mysql_real_escape_string()
 --SKIPIF--
 ?php require_once('skipif.inc'); ?
-?php require_once('skipifemb.inc'); ?
 --FILE--
 ?php
-include connect.inc;
+include connect.inc;
 
-$tmp= NULL;   
-$link   = NULL;
-
-if (NULL !== ($tmp = @mysql_real_escape_string()))
-printf([001] Expecting NULL, got %s/%s\n, gettype($tmp), $tmp);   
-
-require('table.inc');
-
-var_dump(mysql_real_escape_string(Am I a unicode string in PHP 6?, 
$link));
-var_dump(mysql_real_escape_string('\\', $link));
-var_dump(mysql_real_escape_string('', $link));
-var_dump(mysql_real_escape_string(', $link));
-var_dump(mysql_real_escape_string(\n, $link));
-var_dump(mysql_real_escape_string(\r, $link));
-var_dump(mysql_real_escape_string(foo . chr(0) . bar, $link));
-
-print done!;
+$tmp= NULL;
+$link   = NULL;
+
+if (NULL !== ($tmp = @mysql_real_escape_string()))
+   printf([001] Expecting NULL, got %s/%s\n, gettype($tmp), $tmp);
+
+require('table.inc');
+
+if (NULL !== ($tmp = @mysql_real_escape_string('foo', $link, $link)))
+   printf([002] Expecting NULL, got %s/%s\n, gettype($tmp), $tmp);
+
+var_dump(mysql_real_escape_string(Am I a unicode string in PHP 6?, $link));
+var_dump(mysql_real_escape_string('\\', $link));
+var_dump(mysql_real_escape_string('', $link));
+var_dump(mysql_real_escape_string(', $link));
+var_dump(mysql_real_escape_string(\n, $link));
+var_dump(mysql_real_escape_string(\r, $link));
+var_dump($tmp = mysql_real_escape_string(foo . chr(0) . bar, $link));
+
+assert($tmp === mysql_real_escape_string(foo . chr(0) . bar));
+
+print done!;
 ?
 --EXPECTF--
 string(31) Am I a unicode string in PHP 6?

-- 
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/standard/tests/file bug41815.phpt /main/streams plain_wrapper.c

2007-07-12 Thread Jani Taskinen
janiThu Jul 12 11:03:46 2007 UTC

  Added files: (Branch: PHP_5_2)
/php-src/ext/standard/tests/filebug41815.phpt 

  Modified files:  
/php-srcNEWS 
/php-src/main/streams   plain_wrapper.c 
  Log:
  MFH: - Fixed bug #41815 (Concurrent read/write fails when EOF is reached)
  
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.830r2=1.2027.2.547.2.831diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.830 php-src/NEWS:1.2027.2.547.2.831
--- php-src/NEWS:1.2027.2.547.2.830 Thu Jul 12 10:32:09 2007
+++ php-src/NEWSThu Jul 12 11:03:45 2007
@@ -18,6 +18,7 @@
   (Dmitry, Andrei Nigmatulin)
 - Changed mail() function to be always available. (Johannes)
 
+- Added check for unknown options passed to configure. (Jani)
 - Added persistent connection status checker to pdo_pgsql.
   (Elvis Pranskevichus, Ilia)
 - Added support for ATTR_TIMEOUT inside pdo_pgsql driver. (Ilia)
@@ -74,6 +75,7 @@
   a node's siblings). (Rob)
 - Fixed bug #41845 (pgsql extension does not compile with PostgreSQL 7.4).
   (Ilia)
+- Fixed bug #41815 (Concurrent read/write fails when EOF is reached). (Sascha)
 - Fixed bug #41813 (segmentation fault when using string offset as an object).
   (judas dot iscariote at gmail dot com, Tony)
 - Fixed bug #41795 (checkdnsrr does not support DNS_TXT type). 
http://cvs.php.net/viewvc.cgi/php-src/main/streams/plain_wrapper.c?r1=1.52.2.6.2.21r2=1.52.2.6.2.22diff_format=u
Index: php-src/main/streams/plain_wrapper.c
diff -u php-src/main/streams/plain_wrapper.c:1.52.2.6.2.21 
php-src/main/streams/plain_wrapper.c:1.52.2.6.2.22
--- php-src/main/streams/plain_wrapper.c:1.52.2.6.2.21  Wed Apr 18 14:23:06 2007
+++ php-src/main/streams/plain_wrapper.cThu Jul 12 11:03:46 2007
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: plain_wrapper.c,v 1.52.2.6.2.21 2007/04/18 14:23:06 dmitry Exp $ */
+/* $Id: plain_wrapper.c,v 1.52.2.6.2.22 2007/07/12 11:03:46 jani Exp $ */
 
 #include php.h
 #include php_globals.h
@@ -329,9 +329,6 @@
assert(data != NULL);
 
if (data-fd = 0) {
-   if (stream-eof  !data-is_pipe) {
-   return 0;
-   }
ret = read(data-fd, buf, count);
 
if (ret == (size_t)-1  errno == EINTR) {

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/file/bug41815.phpt?view=markuprev=1.1
Index: php-src/ext/standard/tests/file/bug41815.phpt
+++ php-src/ext/standard/tests/file/bug41815.phpt

-- 
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/file bug41815.phpt

2007-07-12 Thread Jani Taskinen
janiThu Jul 12 11:07:29 2007 UTC

  Modified files:  
/php-src/ext/standard/tests/filebug41815.phpt 
  Log:
  - Added test for bug #41815
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/file/bug41815.phpt?r1=1.1r2=1.2diff_format=u
Index: php-src/ext/standard/tests/file/bug41815.phpt
diff -u /dev/null php-src/ext/standard/tests/file/bug41815.phpt:1.2
--- /dev/null   Thu Jul 12 11:07:29 2007
+++ php-src/ext/standard/tests/file/bug41815.phpt   Thu Jul 12 11:07:29 2007
@@ -0,0 +1,27 @@
+--TEST--
+Bug #41815 (Concurrent read/write fails when EOF is reached)
+--FILE--
+?php
+
+$filename = dirname(__FILE__)./concur_rw.txt;
+
[EMAIL PROTECTED]($filename);
+$writer = fopen($filename, w);
+$reader = fopen($filename, r);
+fread($reader, 1);
+fwrite($writer, foo);
+
+if (strlen(fread($reader, 10))  0) {
+   echo OK\n;
+}
+
+fclose($writer);
+fclose($reader);
+
[EMAIL PROTECTED]($filename);
+
+echo Done\n;
+?
+--EXPECTF--
+OK
+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/tests/file bug41815.phpt

2007-07-12 Thread Jani Taskinen
janiThu Jul 12 11:14:22 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/standard/tests/filebug41815.phpt 
  Log:
  MFH: close file handles
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/file/bug41815.phpt?r1=1.1.2.1r2=1.1.2.2diff_format=u
Index: php-src/ext/standard/tests/file/bug41815.phpt
diff -u php-src/ext/standard/tests/file/bug41815.phpt:1.1.2.1 
php-src/ext/standard/tests/file/bug41815.phpt:1.1.2.2
--- php-src/ext/standard/tests/file/bug41815.phpt:1.1.2.1   Thu Jul 12 
11:03:46 2007
+++ php-src/ext/standard/tests/file/bug41815.phpt   Thu Jul 12 11:14:22 2007
@@ -15,6 +15,9 @@
echo OK\n;
 }
 
+fclose($writer);
+fclose($reader);
+
 @unlink($filename);
 
 echo Done\n;

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



[PHP-CVS] cvs: php-src / configure.in

2007-07-12 Thread Jani Taskinen
janiThu Jul 12 11:33:18 2007 UTC

  Modified files:  
/php-srcconfigure.in 
  Log:
  - Fix invalid logic (plus made it possible to pass only integers to this)
  
http://cvs.php.net/viewvc.cgi/php-src/configure.in?r1=1.634r2=1.635diff_format=u
Index: php-src/configure.in
diff -u php-src/configure.in:1.634 php-src/configure.in:1.635
--- php-src/configure.in:1.634  Wed Jul 11 23:13:19 2007
+++ php-src/configure.inThu Jul 12 11:33:18 2007
@@ -1,4 +1,4 @@
-## $Id: configure.in,v 1.634 2007/07/11 23:13:19 jani Exp $ -*- autoconf -*-
+## $Id: configure.in,v 1.635 2007/07/12 11:33:18 jani Exp $ -*- autoconf -*-
 dnl ## Process this file with autoconf to produce a configure script.
 
 divert(1)
@@ -800,9 +800,13 @@
 PHP_ARG_ENABLE(fd-setsize,,
 [  --enable-fd-setsize Set size of descriptor sets], no, no)
 
-if test $PHP_FD_SETSIZE != yes; then
-  CPPFLAGS=$CPPFLAGS -DFD_SETSIZE=$PHP_FD_SETSIZE
-  AC_MSG_RESULT([using $PHP_FD_SETSIZE])
+if test $PHP_FD_SETSIZE != no; then
+  if test 0$PHP_FD_SETSIZE -gt 0 2/dev/null; then
+CPPFLAGS=$CPPFLAGS -DFD_SETSIZE=$PHP_FD_SETSIZE
+AC_MSG_RESULT([using $PHP_FD_SETSIZE])
+  else
+AC_MSG_ERROR([Invalid value passed to --enable-fd-setsize!])
+  fi
 else
   AC_MSG_RESULT([using system default])
 fi

-- 
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) / configure.in

2007-07-12 Thread Jani Taskinen
janiThu Jul 12 11:33:38 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-srcconfigure.in 
  Log:
  MFH: fix invalid logic + prevent non-integers to be passed
  
http://cvs.php.net/viewvc.cgi/php-src/configure.in?r1=1.579.2.52.2.64r2=1.579.2.52.2.65diff_format=u
Index: php-src/configure.in
diff -u php-src/configure.in:1.579.2.52.2.64 
php-src/configure.in:1.579.2.52.2.65
--- php-src/configure.in:1.579.2.52.2.64Wed Jul 11 23:20:36 2007
+++ php-src/configure.inThu Jul 12 11:33:37 2007
@@ -1,4 +1,4 @@
-## $Id: configure.in,v 1.579.2.52.2.64 2007/07/11 23:20:36 jani Exp $ -*- 
autoconf -*-
+## $Id: configure.in,v 1.579.2.52.2.65 2007/07/12 11:33:37 jani Exp $ -*- 
autoconf -*-
 dnl ## Process this file with autoconf to produce a configure script.
 
 divert(1)
@@ -832,9 +832,13 @@
 PHP_ARG_ENABLE(fd-setsize,,
 [  --enable-fd-setsize Set size of descriptor sets], no, no)
 
-if test $PHP_FD_SETSIZE != yes; then
-  CPPFLAGS=$CPPFLAGS -DFD_SETSIZE=$PHP_FD_SETSIZE
-  AC_MSG_RESULT([using $PHP_FD_SETSIZE])
+if test $PHP_FD_SETSIZE != no; then
+  if test 0$PHP_FD_SETSIZE -gt 0 2/dev/null; then
+CPPFLAGS=$CPPFLAGS -DFD_SETSIZE=$PHP_FD_SETSIZE
+AC_MSG_RESULT([using $PHP_FD_SETSIZE])
+  else
+AC_MSG_ERROR([Invalid value passed to --enable-fd-setsize!])
+  fi
 else
   AC_MSG_RESULT([using system default])
 fi

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



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

2007-07-12 Thread Jani Taskinen
janiThu Jul 12 12:12:31 2007 UTC

  Modified files:  
/php-src/ext/standard   reg.c 
  Log:
  MFB: fix warning
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/reg.c?r1=1.86r2=1.87diff_format=u
Index: php-src/ext/standard/reg.c
diff -u php-src/ext/standard/reg.c:1.86 php-src/ext/standard/reg.c:1.87
--- php-src/ext/standard/reg.c:1.86 Mon Jan  1 09:29:32 2007
+++ php-src/ext/standard/reg.c  Thu Jul 12 12:12:30 2007
@@ -17,7 +17,7 @@
|  Jaakko Hyvätti [EMAIL PROTECTED]  | 
+--+
  */
-/* $Id: reg.c,v 1.86 2007/01/01 09:29:32 sebastian Exp $ */
+/* $Id: reg.c,v 1.87 2007/07/12 12:12:30 jani Exp $ */
 
 #include stdio.h
 #include ctype.h
@@ -355,7 +355,7 @@
new_l = strlen(buf) + subs[0].rm_so; /* part before the 
match */
walk = replace;
while (*walk) {
-   if ('\\' == *walk  isdigit((unsigned 
char)walk[1])  ((unsigned char)walk[1]) - '0' = re.re_nsub) {
+   if ('\\' == *walk  isdigit((unsigned 
char)walk[1])  ((unsigned char)walk[1]) - '0' = (int)re.re_nsub) {
if (subs[walk[1] - '0'].rm_so  -1  
subs[walk[1] - '0'].rm_eo  -1) {
new_l += subs[walk[1] - 
'0'].rm_eo - subs[walk[1] - '0'].rm_so;
}

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



[PHP-CVS] cvs: php-src /ext/mysql/tests mysql_select_db.phpt

2007-07-12 Thread Ulf Wendel
uw  Thu Jul 12 13:27:26 2007 UTC

  Modified files:  
/php-src/ext/mysql/testsmysql_select_db.phpt 
  Log:
  1) Whitespace/CS
  2) Fixing [U]EXPECTF to accept whatever db/schema name gets used for the
  test run
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/mysql/tests/mysql_select_db.phpt?r1=1.1r2=1.2diff_format=u
Index: php-src/ext/mysql/tests/mysql_select_db.phpt
diff -u php-src/ext/mysql/tests/mysql_select_db.phpt:1.1 
php-src/ext/mysql/tests/mysql_select_db.phpt:1.2
--- php-src/ext/mysql/tests/mysql_select_db.phpt:1.1Sun Nov 19 12:14:44 2006
+++ php-src/ext/mysql/tests/mysql_select_db.phptThu Jul 12 13:27:26 2007
@@ -4,72 +4,72 @@
 ?php require_once('skipif.inc'); ?
 --FILE--
 ?php
-include_once connect.inc;
+include_once connect.inc;
 
-$tmp= NULL;   
-$link   = NULL;
-
-if (false !== ($tmp = @mysql_select_db($link)))
-printf([001] Expecting boolean/false, got %s/%s\n, gettype($tmp), 
$tmp);
-   
-if (!$link = my_mysql_connect($host, $user, $passwd, $db, $port, $socket))
-printf([002] Cannot connect to the server using host=%s, user=%s, 
passwd=***, dbname=%s, port=%s, socket=%s\n,
-$host, $user, $db, $port, $socket);
-
-if (!is_null($tmp = @mysql_select_db($db, $link, foo)))
-printf([003] Expecting NULL, got %s/%s\n, gettype($tmp), $tmp);
-
-/* does not make too much sense, unless we have access to at least one 
more database than $db */
-if (!mysql_select_db($db, $link))
-printf([004] Cannot select DB %s, [%d] %s\n, $db, 
mysql_errno($link), mysql_error($link));
-
-if (!$res = mysql_query(SELECT DATABASE() AS dbname, $link))
-printf([005] [%d] %s\n, mysql_errno($link), mysql_error($link));
-
-if (!$row = mysql_fetch_assoc($res))
-printf([006] [%d] %s\n, mysql_errno($link), mysql_error($link));
-
-if ($row['dbname'] !== (string)$db)
-printf([007] Expecting database '%s', found '%s'\n, $db, 
$row['dbname']);
-
-var_dump($row['dbname']);
-
-mysql_free_result($res);
-
-if (mysql_select_db('mysql', $link)) {
-// Yippie, a second database to play with - that's great because 
mysql_select_db
-// ($db) was done by mysql__connect() already and the previous test 
-// was quite useless
-if (!$res = mysql_query(SELECT DATABASE() AS dbname, $link))
-printf([008] [%d] %s\n, mysql_errno($link), mysql_error($link));
-
-if (!$row = mysql_fetch_assoc($res))
-printf([009] [%d] %s\n, mysql_errno($link), mysql_error($link));
-
-if (strtolower($row['dbname']) !== 'mysql')
-printf([010] Expecting database 'mysql', found '%s'\n, 
$row['dbname']);
-
-mysql_free_result($res);
-}
-
-
-var_dump(mysql_select_db('I can not imagine that this database exists', 
$link));
-
-mysql_close($link);
-
-if (false !== ($tmp = mysql_select_db($db, $link)))
-printf([012] Expecting boolean/false, got %s/%s\n, gettype($tmp), 
$tmp);
-
-print done!\n;  
+$tmp= NULL;
+$link   = NULL;
+
+if (false !== ($tmp = @mysql_select_db($link)))
+   printf([001] Expecting boolean/false, got %s/%s\n, gettype($tmp), 
$tmp);
+
+if (!$link = my_mysql_connect($host, $user, $passwd, $db, $port, $socket))
+   printf([002] Cannot connect to the server using host=%s, user=%s, 
passwd=***, dbname=%s, port=%s, socket=%s\n,
+   $host, $user, $db, $port, $socket);
+
+if (!is_null($tmp = @mysql_select_db($db, $link, foo)))
+   printf([003] Expecting NULL, got %s/%s\n, gettype($tmp), $tmp);
+
+/* does not make too much sense, unless we have access to at least one more 
database than $db */
+if (!mysql_select_db($db, $link))
+   printf([004] Cannot select DB %s, [%d] %s\n, $db, mysql_errno($link), 
mysql_error($link));
+
+if (!$res = mysql_query(SELECT DATABASE() AS dbname, $link))
+   printf([005] [%d] %s\n, mysql_errno($link), mysql_error($link));
+
+if (!$row = mysql_fetch_assoc($res))
+   printf([006] [%d] %s\n, mysql_errno($link), mysql_error($link));
+
+if ($row['dbname'] !== (string)$db)
+   printf([007] Expecting database '%s', found '%s'\n, $db, 
$row['dbname']);
+
+var_dump($row['dbname']);
+
+mysql_free_result($res);
+
+if (mysql_select_db('mysql', $link)) {
+   // Yippie, a second database to play with - that's great because 
mysql_select_db
+   // ($db) was done by mysql__connect() already and the previous test
+   // was quite useless
+   if (!$res = mysql_query(SELECT DATABASE() AS dbname, $link))
+   printf([008] [%d] %s\n, mysql_errno($link), 
mysql_error($link));
+
+   if (!$row = mysql_fetch_assoc($res))
+   printf([009] [%d] %s\n, mysql_errno($link), 
mysql_error($link));
+
+   if (strtolower($row['dbname']) !== 'mysql')
+   

[PHP-CVS] cvs: php-src /ext/mysql/tests mysql_tablename.phpt

2007-07-12 Thread Ulf Wendel
uw  Thu Jul 12 13:35:16 2007 UTC

  Modified files:  
/php-src/ext/mysql/testsmysql_tablename.phpt 
  Log:
  1) Whitespace/CS
  2) Added: skip test with mysqlnd, mysqlnd does not support this function
  currently
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/mysql/tests/mysql_tablename.phpt?r1=1.1r2=1.2diff_format=u
Index: php-src/ext/mysql/tests/mysql_tablename.phpt
diff -u php-src/ext/mysql/tests/mysql_tablename.phpt:1.1 
php-src/ext/mysql/tests/mysql_tablename.phpt:1.2
--- php-src/ext/mysql/tests/mysql_tablename.phpt:1.1Sun Nov 19 12:14:44 2006
+++ php-src/ext/mysql/tests/mysql_tablename.phptThu Jul 12 13:35:16 2007
@@ -1,43 +1,47 @@
 --TEST--
 mysql_tablename()
 --SKIPIF--
-?php require_once('skipif.inc'); ?
-?php require_once('skipifemb.inc'); ?
+?php
+require_once('skipif.inc');
+require_once('connect.inc');
+if ($IS_MYSQLND  !function_exists('mysql_tablename'))
+die(skip - deprecated function not implemented in mysqlnd);
+?
 --FILE--
 ?php
-include connect.inc;
+include connect.inc;
+
+$tmp= NULL;
+$link   = NULL;
+
+if (!is_null($tmp = @mysql_tablename()))
+   printf([001] Expecting NULL, got %s/%s\n, gettype($tmp), $tmp);
+
+if (null !== ($tmp = @mysql_tablename($link)))
+   printf([002] Expecting NULL, got %s/%s\n, gettype($tmp), $tmp);
+
+require('table.inc');
+if (!$res = mysql_query(SELECT id, label FROM test ORDER BY id LIMIT 2, 
$link)) {
+   printf([003] [%d] %s\n, mysql_errno($link), mysql_error($link));
+}
+
+if (NULL !== ($tmp = mysql_tablename($res)))
+   printf([004] Expecting NULL, got %s/%s\n, gettype($tmp), $tmp);
+
+if (false !== ($tmp = mysql_tablename($res, -1)))
+   printf([005] Expecting boolean/false, got %s/%s\n, gettype($tmp), 
$tmp);
+
+var_dump(mysql_tablename($res, 0));
+
+if (false !== ($tmp = mysql_tablename($res, 2)))
+   printf([00%d] Expecting boolean/false, got %s/%s\n, gettype($tmp), 
$tmp);
+
+mysql_free_result($res);
+
+var_dump(mysql_tablename($res, 0));
 
-$tmp= NULL;   
-$link   = NULL;
-
-if (!is_null($tmp = @mysql_tablename()))
-printf([001] Expecting NULL, got %s/%s\n, gettype($tmp), $tmp);
-
-if (null !== ($tmp = @mysql_tablename($link)))
-printf([002] Expecting NULL, got %s/%s\n, gettype($tmp), $tmp);
-
-require('table.inc');
-if (!$res = mysql_query(SELECT id, label FROM test ORDER BY id LIMIT 2, 
$link)) {
-printf([003] [%d] %s\n, mysql_errno($link), mysql_error($link));
-}
-
-if (NULL !== ($tmp = mysql_tablename($res)))
-printf([004] Expecting NULL, got %s/%s\n, gettype($tmp), $tmp);
-
-if (false !== ($tmp = mysql_tablename($res, -1)))
-printf([005] Expecting boolean/false, got %s/%s\n, gettype($tmp), 
$tmp);
-
-var_dump(mysql_tablename($res, 0));
-
-if (false !== ($tmp = mysql_tablename($res, 2)))
-printf([00%d] Expecting boolean/false, got %s/%s\n, gettype($tmp), 
$tmp);   
-
-mysql_free_result($res);
-
-var_dump(mysql_tablename($res, 0));
-
-mysql_close($link);
-print done!;
+mysql_close($link);
+print done!;
 ?
 --EXPECTF--
 Warning: Wrong parameter count for mysql_tablename() 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 /ext/mysql/tests mysql_thread_id.phpt

2007-07-12 Thread Ulf Wendel
uw  Thu Jul 12 13:44:00 2007 UTC

  Modified files:  
/php-src/ext/mysql/testsmysql_thread_id.phpt 
  Log:
  1) Whitespace/CS
  2) Added test for default link
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/mysql/tests/mysql_thread_id.phpt?r1=1.1r2=1.2diff_format=u
Index: php-src/ext/mysql/tests/mysql_thread_id.phpt
diff -u php-src/ext/mysql/tests/mysql_thread_id.phpt:1.1 
php-src/ext/mysql/tests/mysql_thread_id.phpt:1.2
--- php-src/ext/mysql/tests/mysql_thread_id.phpt:1.1Sun Nov 19 12:14:44 2006
+++ php-src/ext/mysql/tests/mysql_thread_id.phptThu Jul 12 13:44:00 2007
@@ -4,27 +4,33 @@
 ?php require_once('skipif.inc'); ?
 --FILE--
 ?php
-include_once connect.inc;
-
-$tmp= NULL;   
-$link   = NULL;
-
-if (!is_null($tmp = @mysql_thread_id($link)))
-printf([001] Expecting NULL, got %s/%s\n, gettype($tmp), $tmp);  
 
-
-require('table.inc');
-
-if (!is_int($tmp = mysql_thread_id($link)) || (0 === $tmp))
-printf([002] Expecting int/any but zero, got %s/%s. [%d] %s\n,
-gettype($tmp), $tmp, mysql_errno($link), mysql_error($link));  
-
-mysql_close($link);
-
-if (false !== ($tmp = mysql_thread_id($link)))
-printf([003] Expecting boolean/false, got %s/%s\n, gettype($tmp), 
$tmp);
-
-print done!;
+include_once connect.inc;
+
+$tmp= NULL;
+$link   = NULL;
+
+if (!is_null($tmp = @mysql_thread_id($link)))
+   printf([001] Expecting NULL, got %s/%s\n, gettype($tmp), $tmp);
+
+require('table.inc');
+
+if (!is_int($id = mysql_thread_id($link)) || (0 === $id))
+   printf([002] Expecting int/any but zero, got %s/%s. [%d] %s\n,
+   gettype($id), $id, mysql_errno($link), mysql_error($link));
+
+if (!is_int($id_def = mysql_thread_id()) || (0 === $id_def))
+   printf([003] Expecting int/any but zero, got %s/%s. [%d] %s\n,
+   gettype($id_def), $id_def, mysql_errno(), mysql_error());
+
+assert($id === $id_def);
+
+mysql_close($link);
+
+if (false !== ($tmp = mysql_thread_id($link)))
+   printf([003] Expecting boolean/false, got %s/%s\n, gettype($tmp), 
$tmp);
+
+print done!;
 ?
 --EXPECTF--
 Warning: mysql_thread_id(): %d is not a valid MySQL-Link resource in %s on 
line %d
-done!
+done!
\ No newline at end of file

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



[PHP-CVS] cvs: php-src /ext/mysql/tests mysql_unbuffered_query.phpt

2007-07-12 Thread Ulf Wendel
uw  Thu Jul 12 13:50:51 2007 UTC

  Modified files:  
/php-src/ext/mysql/testsmysql_unbuffered_query.phpt 
  Log:
  1) Whitespace/CS
  2) Fixing [U]EXPECTF to be portable among different MySQL Server versions
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/mysql/tests/mysql_unbuffered_query.phpt?r1=1.1r2=1.2diff_format=u
Index: php-src/ext/mysql/tests/mysql_unbuffered_query.phpt
diff -u php-src/ext/mysql/tests/mysql_unbuffered_query.phpt:1.1 
php-src/ext/mysql/tests/mysql_unbuffered_query.phpt:1.2
--- php-src/ext/mysql/tests/mysql_unbuffered_query.phpt:1.1 Sun Nov 19 
12:14:44 2006
+++ php-src/ext/mysql/tests/mysql_unbuffered_query.phpt Thu Jul 12 13:50:51 2007
@@ -2,85 +2,92 @@
 mysql_unbuffered_query()
 --SKIPIF--
 ?php require_once('skipif.inc'); ?
-?php require_once('skipifemb.inc'); ?
 --FILE--
 ?php
-include connect.inc;
-
-$tmp= NULL;   
-$link   = NULL;
-
-if (false !== ($tmp = @mysql_unbuffered_query($link)))
-printf([001] Expecting boolean/false, got %s/%s\n, gettype($tmp), 
$tmp);
-
-require('table.inc');
-
-if (NULL !== ($tmp = @mysql_unbuffered_query(SELECT 1 AS a, $link, 
foo)))
-printf([002] Expecting NULL, got %s/%s\n, gettype($tmp), $tmp);
-
-if (false !== ($tmp = mysql_unbuffered_query('THIS IS NOT SQL', $link)))
-printf([003] Expecting boolean/false, got %s/%s\n, gettype($tmp), 
$tmp);
-
-if (false !== ($tmp = mysql_unbuffered_query('SELECT this is sql but with 
backslash g\g', $link)))
-printf([004] Expecting boolean/false, got %s/%s\n, gettype($tmp), 
$tmp);
-
-if ((0 === mysql_errno($link)) || ('' == mysql_error($link)))
-printf([005] mysql_errno()/mysql_error should return some error\n);
-
-if (!$res = mysql_unbuffered_query('SELECT this is sql but with 
semicolon AS valid ; ', $link))
-printf([006] [%d] %s\n, mysql_errno($link), mysql_error($link));
-
-var_dump(mysql_fetch_assoc($res));
-mysql_free_result($res);
-
-if (false !== ($res = mysql_unbuffered_query('SELECT this is sql but with 
semicolon AS valid ; SHOW VARIABLES', $link)))
-printf([007] [%d] %s\n, mysql_errno($link), mysql_error($link));
-
-if (mysql_unbuffered_query('DROP PROCEDURE IF EXISTS p', $link)) {
-// let's try to play with stored procedures
-if (mysql_unbuffered_query('CREATE PROCEDURE p(OUT ver_param 
VARCHAR(25)) BEGIN SELECT VERSION() INTO ver_param; END;', $link)) {
-$res = mysql_unbuffered_query('CALL p(@version)', $link);
-$res = mysql_unbuffered_query('SELECT @version AS p_version', 
$link);
-var_dump(mysql_fetch_assoc($res));
-mysql_free_result($res);
-} else {
-printf([008] [%d] %s\n, mysql_errno($link), mysql_error($link));
-}
-
-mysql_unbuffered_query('DROP FUNCTION IF EXISTS f', $link);
-if (mysql_unbuffered_query('CREATE FUNCTION f( ver_param VARCHAR(25)) 
RETURNS VARCHAR(25) DETERMINISTIC RETURN ver_param;', $link)) {
-$res = mysql_unbuffered_query('SELECT f(VERSION()) AS f_version', 
$link);
-var_dump(mysql_fetch_assoc($res));
-mysql_free_result($res);
-} else {
-printf([009] [%d] %s\n, mysql_errno($link), mysql_error($link));
-}
-}
-
-var_dump(mysql_unbuffered_query('INSERT INTO test(id) VALUES (100)', 
$link));
-var_dump($res = mysql_unbuffered_query('SELECT id FROM test', $link));
-var_dump(mysql_num_rows($res));   
-
-mysql_close($link);
-
-if (false !== ($tmp = mysql_unbuffered_query(SELECT id FROM test, 
$link)))
-printf([010] Expecting boolean/false, got %s/%s\n, gettype($tmp), 
$tmp);
-
-print done!;
+include_once(connect.inc);
+
+$tmp= NULL;
+$link   = NULL;
+
+if (false !== ($tmp = @mysql_unbuffered_query($link)))
+   printf([001] Expecting boolean/false, got %s/%s\n, gettype($tmp), 
$tmp);
+
+require('table.inc');
+
+if (NULL !== ($tmp = @mysql_unbuffered_query(SELECT 1 AS a, $link, foo)))
+   printf([002] Expecting NULL, got %s/%s\n, gettype($tmp), $tmp);
+
+if (false !== ($tmp = mysql_unbuffered_query('THIS IS NOT SQL', $link)))
+   printf([003] Expecting boolean/false, got %s/%s\n, gettype($tmp), 
$tmp);
+
+if (false !== ($tmp = mysql_unbuffered_query('SELECT this is sql but with 
backslash g\g', $link)))
+   printf([004] Expecting boolean/false, got %s/%s\n, gettype($tmp), 
$tmp);
+
+if ((0 === mysql_errno($link)) || ('' == mysql_error($link)))
+   printf([005] mysql_errno()/mysql_error should return some error\n);
+
+if (!$res = mysql_unbuffered_query('SELECT this is sql but with semicolon AS 
valid ; ', $link))
+   printf([006] [%d] %s\n, mysql_errno($link), mysql_error($link));
+
+var_dump(mysql_fetch_assoc($res));
+mysql_free_result($res);
+
+if (false !== ($res = 

[PHP-CVS] cvs: php-src /ext/mysql/tests mysql_errno.phpt

2007-07-12 Thread Ulf Wendel
uw  Thu Jul 12 13:57:36 2007 UTC

  Modified files:  
/php-src/ext/mysql/testsmysql_errno.phpt 
  Log:
  A bit more verbose message in case of problems. It's been helpful to
  debug a cross-server version issue.
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/mysql/tests/mysql_errno.phpt?r1=1.2r2=1.3diff_format=u
Index: php-src/ext/mysql/tests/mysql_errno.phpt
diff -u php-src/ext/mysql/tests/mysql_errno.phpt:1.2 
php-src/ext/mysql/tests/mysql_errno.phpt:1.3
--- php-src/ext/mysql/tests/mysql_errno.phpt:1.2Wed Jul 11 12:57:57 2007
+++ php-src/ext/mysql/tests/mysql_errno.phptThu Jul 12 13:57:36 2007
@@ -38,8 +38,12 @@
 if ($link = @mysql_connect($host . '_unknown', $user . '_unknown', $passwd, 
true)) {
printf([005] Can connect to the server using host=%s, user=%s, 
passwd=***, dbname=%s, port=%s, socket=%s\n,
$host . '_unknown', $user . '_unknown', $db, $port, $socket);
+} else {
+   $errno = mysql_errno();
+   if (!is_int($errno))
+   printf([006] Expecting int/any (e.g 1046, 2005) got %s/%s\n, 
gettype($errno), $errno);
+
 }
-var_dump(mysql_errno());
 
 print done!;
 ?
@@ -49,5 +53,4 @@
 
 Warning: mysql_errno(): %d is not a valid MySQL-Link resource in %s on line %d
 bool(false)
-int(%d)
 done!
\ No newline at end of file

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



[PHP-CVS] cvs: php-src / configure.in

2007-07-12 Thread Jani Taskinen
janiThu Jul 12 14:18:02 2007 UTC

  Modified files:  
/php-srcconfigure.in 
  Log:
  - missing comma
  
http://cvs.php.net/viewvc.cgi/php-src/configure.in?r1=1.635r2=1.636diff_format=u
Index: php-src/configure.in
diff -u php-src/configure.in:1.635 php-src/configure.in:1.636
--- php-src/configure.in:1.635  Thu Jul 12 11:33:18 2007
+++ php-src/configure.inThu Jul 12 14:18:01 2007
@@ -1,4 +1,4 @@
-## $Id: configure.in,v 1.635 2007/07/12 11:33:18 jani Exp $ -*- autoconf -*-
+## $Id: configure.in,v 1.636 2007/07/12 14:18:01 jani Exp $ -*- autoconf -*-
 dnl ## Process this file with autoconf to produce a configure script.
 
 divert(1)
@@ -732,7 +732,7 @@
 fi
 
 AC_MSG_CHECKING([where to scan for configuration files])
-PHP_ARG_WITH(config-file-scan-dir,
+PHP_ARG_WITH(config-file-scan-dir,,
 [  --with-config-file-scan-dir=PATH
   Set the path where to scan for configuration files], 
DEFAULT, no) 
 if test $PHP_CONFIG_FILE_SCAN_DIR = DEFAULT; then

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



[PHP-CVS] cvs: php-src /ext/mysql/tests mysql_list_tables.phpt

2007-07-12 Thread Ulf Wendel
uw  Thu Jul 12 14:22:15 2007 UTC

  Added files: 
/php-src/ext/mysql/testsmysql_list_tables.phpt 
  Log:
  Adding test for mysql_list_tables()
  
  

http://cvs.php.net/viewvc.cgi/php-src/ext/mysql/tests/mysql_list_tables.phpt?view=markuprev=1.1
Index: php-src/ext/mysql/tests/mysql_list_tables.phpt
+++ php-src/ext/mysql/tests/mysql_list_tables.phpt
--TEST--
mysql_list_tables()
--SKIPIF--
?php
require_once('skipif.inc');
?
--FILE--
?php
include_once connect.inc;

$tmp= NULL;
$link   = NULL;

if (NULL !== ($tmp = @mysql_list_tables()))
printf([001] Expecting NULL got %s/%s\n, gettype($tmp), $tmp);

if (NULL !== ($tmp = @mysql_list_tables('too', 'many', 'arguments')))
printf([002] Expecting NULL got %s/%s\n, gettype($tmp), $tmp);

if (false !== ($tmp = @mysql_list_tables(NULL)))
printf([003] Expecting boolean/false got %s/%s\n, gettype($tmp), 
$tmp);

if (false !== ($tmp = @mysql_list_tables($db, NULL)))
printf([004] Expecting boolean/false got %s/%s\n, gettype($tmp), 
$tmp);

require_once('table.inc');

if (!$res_def = @mysql_list_tables($db))
printf([005] [%d] %s\n, mysql_errno(), mysql_error());

if (!$res = @mysql_list_tables($db, $link))
printf([006] [%d] %s\n, mysql_errno($link), mysql_error($link));

if (!$res_query = mysql_query(SHOW TABLES, $link))
printf([007] [%d] %s\n, mysql_errno($link), mysql_error($link));

$tables_def = $tables = $tables_query = array();

while ($row = mysql_fetch_assoc($res_def))
$tables_def[] = $row;
mysql_free_result($res_def);

while ($row = mysql_fetch_assoc($res))
$tables[] = $row;
mysql_free_result($res);

while ($row = mysql_fetch_assoc($res_query))
$tables_query[] = $row;
mysql_free_result($res_query);

if ($tables_def !== $tables) {
printf([008] Got different table lists for default link and specified 
link\n);
var_dump($tables_def);
var_dump($tables);
}

$list1 = $list2 = array();
foreach ($tables as $k = $tlist)
foreach ($tlist as $k = $table)
$list1[] = $table;

foreach ($tables_query as $k = $tlist)
foreach ($tlist as $k = $table)
$list2[] = $table;

if ($list1 !== $list2) {
printf([009] Got different results for mysql_list_tables() and SHOW 
TABLES\n);
var_dump($list1);
var_dump($list2);
}

if (!in_array('test', $list1))
printf([010] Table lists seem to be wrong. Check manually.\n);

mysql_close($link);

print done!\n;
?
--EXPECTF--
done!

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



[PHP-CVS] cvs: php-src /ext/mysql/tests mysql_phpinfo.phpt

2007-07-12 Thread Ulf Wendel
uw  Thu Jul 12 14:22:47 2007 UTC

  Added files: 
/php-src/ext/mysql/testsmysql_phpinfo.phpt 
  Log:
  Checking the phpinfo() entries of ext/mysql
  
  

http://cvs.php.net/viewvc.cgi/php-src/ext/mysql/tests/mysql_phpinfo.phpt?view=markuprev=1.1
Index: php-src/ext/mysql/tests/mysql_phpinfo.phpt
+++ php-src/ext/mysql/tests/mysql_phpinfo.phpt
--TEST--
phpinfo() mysql section
--SKIPIF--
?php require_once('skipif.inc'); ?
--FILE--
?php
include_once(connect.inc);

@ob_clean();
ob_start();
phpinfo();
$phpinfo = ob_get_contents();
ob_end_clean();

/* all versions should at least dump this minimum information */
if (!stristr($phpinfo, mysql support))
printf([001] ext/mysql should have exposed itself.\n);

if (!stristr($phpinfo, client api library version))
printf([002] ext/mysql should have exposed the library version.\n);

if (!stristr($phpinfo, mysql.default_host))
printf([003] php.ini setting mysql.default_host not shown.\n);

if (!stristr($phpinfo, mysql.default_port))
printf([004] php.ini setting mysql.default_port not shown.\n);

if (!stristr($phpinfo, mysql.default_password))
printf([005] php.ini setting mysql.default_password not shown.\n);

if (!stristr($phpinfo, mysql.default_socket))
printf([006] php.ini setting mysql.default_socket not shown.\n);

if (!stristr($phpinfo, mysql.default_user))
printf([007] php.ini setting mysql.default_user not shown.\n);

if (!stristr($phpinfo, mysql.max_links))
printf([008] php.ini setting mysql.max_links not shown.\n);

if (!stristr($phpinfo, mysql.max_persistent))
printf([009] php.ini setting mysql.max_persistent not shown.\n);

if (!stristr($phpinfo, mysql.connect_timeout))
printf([010] php.ini setting mysql.connect_timeout not shown.\n);

if (!stristr($phpinfo, mysql.allow_persistent))
printf([011] php.ini setting mysql.allow_persistent not shown.\n);

if ($IS_MYSQLND) {
$expected = array(
'client statistics',
'bytes_sent', 'bytes_received', 'packets_sent', 
'packets_received',
'protocol_overhead_in', 'protocol_overhead_out', 
'result_set_queries',
'non_result_set_queries', 'no_index_used', 'bad_index_used',
'buffered_sets', 'unbuffered_sets', 'ps_buffered_sets', 
'ps_unbuffered_sets',
'flushed_normal_sets', 'flushed_ps_sets', 
'rows_fetched_from_server',
'rows_fetched_from_client', 'rows_skipped', 
'copy_on_write_saved',
'copy_on_write_performed', 'command_buffer_too_small', 
'connect_success',
'connect_failure', 'connection_reused', 'explicit_close', 
'implicit_close',
'disconnect_close', 'in_middle_of_command_close', 
'explicit_free_result',
'implicit_free_result', 'explicit_stmt_close', 
'implicit_stmt_close',
'put_hits', 'put_misses', 'get_hits', 'get_misses',
'size', 'free_items', 'references', 'mysql.cache_size',
);
foreach ($expected as $k = $entry)
if (!stristr($phpinfo, $entry))
printf([012] Could not find entry for '%s'\n, $entry);
}

print done!;
?
--EXPECTF--
done!

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



[PHP-CVS] cvs: php-src /ext/mysql/tests mysql_set_charset.phpt

2007-07-12 Thread Ulf Wendel
uw  Thu Jul 12 14:23:56 2007 UTC

  Added files: 
/php-src/ext/mysql/testsmysql_set_charset.phpt 
  Log:
  Whoever has hacked this function into ext/mysql,  here's a test for it.
  
  

http://cvs.php.net/viewvc.cgi/php-src/ext/mysql/tests/mysql_set_charset.phpt?view=markuprev=1.1
Index: php-src/ext/mysql/tests/mysql_set_charset.phpt
+++ php-src/ext/mysql/tests/mysql_set_charset.phpt
--TEST--
mysql_set_charset() - STUB, function usage not recommended
--SKIPIF--
?php
require_once('skipif.inc');
if (!function_exists('mysql_set_charset'))
die(skip Function not available);
?
--FILE--
?php
include_once connect.inc;

$tmp= NULL;
$link   = NULL;

if (!is_null($tmp = @mysql_set_charset()))
printf([001] Expecting NULL got %s/%s\n, $tmp, gettype($tmp));

if (false !== ($tmp = @mysql_set_charset($link)))
printf([002] Expecting boolean/false got %s/%s\n, $tmp, 
gettype($tmp));

if (false !== ($tmp = @mysql_set_charset(-1)))
printf([003] Expecting boolean/false got %s/%s\n, $tmp, 
gettype($tmp));

if (!is_null($tmp = @mysql_set_charset('somecharset', $link)))
printf([004] Expecting NULL got %s/%s\n, $tmp, gettype($tmp));

if (!$link = my_mysql_connect($host, $user, $passwd, $db, $port, $socket))
printf([005] Cannot connect to the server using host=%s, user=%s, 
passwd=***, dbname=%s, port=%s, socket=%s\n,
$host, $user, $db, $port, $socket);

/* unicode mode should throw a warning */
$tmp = mysql_set_charset('uFt8', $link);

if (ini_get('unicode.semantics'))
$expect = false;
else
$expect = true;

$charsets = array('latin1', 'latin2');
foreach ($charsets as $k = $charset) {
if (!($res = mysql_query(sprintf('SHOW CHARACTER SET LIKE %s', 
$charset), $link)))
continue;
mysql_free_result($res);
if ($expect !== ($tmp = @mysql_set_charset($charset, $link)))
printf([006] Expecting %s/%s got %s/%s\n,
gettype($expect), $expect,
gettype($tmp), $tmp);
}

mysql_close($link);
print done!;
?
--EXPECTF--
done!
--UEXPECTF--
Warning: mysql_set_charset(): Character set %s is not supported when running 
PHP with unicode.semantics=On. in %s on line %d
done!

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



[PHP-CVS] cvs: php-src /ext/mysql/tests mysql_constants.phpt

2007-07-12 Thread Ulf Wendel
uw  Thu Jul 12 14:24:53 2007 UTC

  Modified files:  
/php-src/ext/mysql/testsmysql_constants.phpt 
  Log:
  Blame me for not checking in a version that's been cleaned up with 
  regards to Whitespace/CS...
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/mysql/tests/mysql_constants.phpt?r1=1.1r2=1.2diff_format=u
Index: php-src/ext/mysql/tests/mysql_constants.phpt
diff -u php-src/ext/mysql/tests/mysql_constants.phpt:1.1 
php-src/ext/mysql/tests/mysql_constants.phpt:1.2
--- php-src/ext/mysql/tests/mysql_constants.phpt:1.1Thu Jul 12 14:01:12 2007
+++ php-src/ext/mysql/tests/mysql_constants.phptThu Jul 12 14:24:53 2007
@@ -3,60 +3,60 @@
 --SKIPIF--
 ?php require_once('skipif.inc'); ?
 --FILE--
-?php  
-require(connect.inc); 
-require(table.inc); 
-
-$constants = get_defined_constants(true);
-sort($constants);
-
-$expected_constants = array(
-'MYSQL_ASSOC'   = true,
-'MYSQL_NUM' = true,
-'MYSQL_BOTH'= true,
-'MYSQL_CLIENT_COMPRESS' = true,
-'MYSQL_CLIENT_INTERACTIVE'  = true,
-'MYSQL_CLIENT_IGNORE_SPACE' = true,
-);
-
-$version = mysql_get_server_info($link);
-if (!preg_match('@(\d+)\.(\d+)\.(\d+)@ism', $version, $matches))
-printf([001] Cannot get server version\n);
-$version = ($matches[1] * 100) + ($matches[2] * 10) + $matches[3];
-
-if ($version  400) {
-$expected_constants = array_merge($expected_constants, array(
-MYSQL_CLIENT_SSL= true,
-));
-}
-   
-
-$unexpected_constants = array();
-
-foreach ($constants as $group = $consts) {
-foreach ($consts as $name = $value) {
-if (stristr($name, 'mysql')  !stristr($name, 'mysqli')) {

-$name = strtoupper($name);
-if (isset($expected_constants[$name])) {
-unset($expected_constants[$name]);
-} else {
-$unexpected_constants[$name] = $name;
-}
-}
-}
-}   
-
-if (!empty($unexpected_constants)) {
-printf(Dumping list of unexpected constants\n);
-var_dump($unexpected_constants);
-}
-
-if (!empty($expected_constants)) {
-printf(Dumping list of missing constants\n);
-var_dump($expected_constants);
-}
+?php
+require(connect.inc);
+require(table.inc);
 
-print done!;
+$constants = get_defined_constants(true);
+sort($constants);
+
+$expected_constants = array(
+   'MYSQL_ASSOC'   = true,
+   'MYSQL_NUM' = true,
+   'MYSQL_BOTH'= true,
+   'MYSQL_CLIENT_COMPRESS' = true,
+   'MYSQL_CLIENT_INTERACTIVE'  = true,
+   'MYSQL_CLIENT_IGNORE_SPACE' = true,
+);
+
+$version = mysql_get_server_info($link);
+if (!preg_match('@(\d+)\.(\d+)\.(\d+)@ism', $version, $matches))
+   printf([001] Cannot get server version\n);
+$version = ($matches[1] * 100) + ($matches[2] * 10) + $matches[3];
+
+if ($version  400) {
+   $expected_constants = array_merge($expected_constants, array(
+   MYSQL_CLIENT_SSL= 
true,
+   ));
+}
+
+
+$unexpected_constants = array();
+
+foreach ($constants as $group = $consts) {
+   foreach ($consts as $name = $value) {
+   if (stristr($name, 'mysql')  !stristr($name, 'mysqli')) {
+   $name = strtoupper($name);
+   if (isset($expected_constants[$name])) {
+   unset($expected_constants[$name]);
+   } else {
+   $unexpected_constants[$name] = $name;
+   }
+   }
+   }
+}
+
+if (!empty($unexpected_constants)) {
+   printf(Dumping list of unexpected constants\n);
+   var_dump($unexpected_constants);
+}
+
+if (!empty($expected_constants)) {
+   printf(Dumping list of missing constants\n);
+   var_dump($expected_constants);
+}
+
+print done!;
 ?
 --EXPECTF--
 done!
\ No newline at end of file

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



[PHP-CVS] cvs: php-src /ext/mysql/tests mysql_tablename.phpt

2007-07-12 Thread Ulf Wendel
uw  Thu Jul 12 13:58:41 2007 UTC

  Modified files:  
/php-src/ext/mysql/testsmysql_tablename.phpt 
  Log:
  No skipping needed anymore, function is there even with mysqlnd.
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/mysql/tests/mysql_tablename.phpt?r1=1.2r2=1.3diff_format=u
Index: php-src/ext/mysql/tests/mysql_tablename.phpt
diff -u php-src/ext/mysql/tests/mysql_tablename.phpt:1.2 
php-src/ext/mysql/tests/mysql_tablename.phpt:1.3
--- php-src/ext/mysql/tests/mysql_tablename.phpt:1.2Thu Jul 12 13:35:16 2007
+++ php-src/ext/mysql/tests/mysql_tablename.phptThu Jul 12 13:58:41 2007
@@ -1,12 +1,7 @@
 --TEST--
 mysql_tablename()
 --SKIPIF--
-?php
-require_once('skipif.inc');
-require_once('connect.inc');
-if ($IS_MYSQLND  !function_exists('mysql_tablename'))
-die(skip - deprecated function not implemented in mysqlnd);
-?
+?php require_once('skipif.inc'); ?
 --FILE--
 ?php
 include connect.inc;

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



[PHP-CVS] cvs: php-src /ext/mysql/tests mysql_constants.phpt

2007-07-12 Thread Ulf Wendel
uw  Thu Jul 12 14:01:12 2007 UTC

  Added files: 
/php-src/ext/mysql/testsmysql_constants.phpt 
  Log:
  Checks if ext/mysql exposes all constants it should expose.
  
  

http://cvs.php.net/viewvc.cgi/php-src/ext/mysql/tests/mysql_constants.phpt?view=markuprev=1.1
Index: php-src/ext/mysql/tests/mysql_constants.phpt
+++ php-src/ext/mysql/tests/mysql_constants.phpt
--TEST--
Constants exported by ext/mysql
--SKIPIF--
?php require_once('skipif.inc'); ?
--FILE--
?php  
require(connect.inc); 
require(table.inc); 

$constants = get_defined_constants(true);
sort($constants);

$expected_constants = array(
'MYSQL_ASSOC'   = true,
'MYSQL_NUM' = true,
'MYSQL_BOTH'= true,
'MYSQL_CLIENT_COMPRESS' = true,
'MYSQL_CLIENT_INTERACTIVE'  = true,
'MYSQL_CLIENT_IGNORE_SPACE' = true,
);

$version = mysql_get_server_info($link);
if (!preg_match('@(\d+)\.(\d+)\.(\d+)@ism', $version, $matches))
printf([001] Cannot get server version\n);
$version = ($matches[1] * 100) + ($matches[2] * 10) + $matches[3];

if ($version  400) {
$expected_constants = array_merge($expected_constants, array(
MYSQL_CLIENT_SSL= true,
));
}
   

$unexpected_constants = array();

foreach ($constants as $group = $consts) {
foreach ($consts as $name = $value) {
if (stristr($name, 'mysql')  !stristr($name, 'mysqli')) { 
   
$name = strtoupper($name);
if (isset($expected_constants[$name])) {
unset($expected_constants[$name]);
} else {
$unexpected_constants[$name] = $name;
}
}
}
}   

if (!empty($unexpected_constants)) {
printf(Dumping list of unexpected constants\n);
var_dump($unexpected_constants);
}

if (!empty($expected_constants)) {
printf(Dumping list of missing constants\n);
var_dump($expected_constants);
}

print done!;
?
--EXPECTF--
done!

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



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

2007-07-12 Thread Seiji Masugata
masugataThu Jul 12 15:28:37 2007 UTC

  Modified files:  
/php-src/ext/mbstring   mbstring.c 
  Log:
  Synced mail function in mb_send_mail function(Escape 
mail.force_extra_parameters value).
  
http://cvs.php.net/viewvc.cgi/php-src/ext/mbstring/mbstring.c?r1=1.269r2=1.270diff_format=u
Index: php-src/ext/mbstring/mbstring.c
diff -u php-src/ext/mbstring/mbstring.c:1.269 
php-src/ext/mbstring/mbstring.c:1.270
--- php-src/ext/mbstring/mbstring.c:1.269   Wed Jul 11 17:39:04 2007
+++ php-src/ext/mbstring/mbstring.c Thu Jul 12 15:28:37 2007
@@ -17,7 +17,7 @@
+--+
  */
 
-/* $Id: mbstring.c,v 1.269 2007/07/11 17:39:04 johannes Exp $ */
+/* $Id: mbstring.c,v 1.270 2007/07/12 15:28:37 masugata Exp $ */
 
 /*
  * PHP 4 Multibyte String module mbstring
@@ -3785,7 +3785,7 @@
headers = (char *)device.buffer;
 
if (force_extra_parameters) {
-   extra_cmd = estrdup(force_extra_parameters);
+   extra_cmd = php_escape_shell_cmd(force_extra_parameters);
} else if (extra_cmd) {
extra_cmd = php_escape_shell_cmd(extra_cmd);
} 

-- 
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/mbstring mbstring.c

2007-07-12 Thread Seiji Masugata
masugataThu Jul 12 15:31:54 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/mbstring   mbstring.c 
  Log:
  Synced mail function in mb_send_mail function(Escape 
mail.force_extra_parameters value).
  
http://cvs.php.net/viewvc.cgi/php-src/ext/mbstring/mbstring.c?r1=1.224.2.22.2.23r2=1.224.2.22.2.24diff_format=u
Index: php-src/ext/mbstring/mbstring.c
diff -u php-src/ext/mbstring/mbstring.c:1.224.2.22.2.23 
php-src/ext/mbstring/mbstring.c:1.224.2.22.2.24
--- php-src/ext/mbstring/mbstring.c:1.224.2.22.2.23 Wed Jul 11 17:36:55 2007
+++ php-src/ext/mbstring/mbstring.c Thu Jul 12 15:31:54 2007
@@ -17,7 +17,7 @@
+--+
  */
 
-/* $Id: mbstring.c,v 1.224.2.22.2.23 2007/07/11 17:36:55 johannes Exp $ */
+/* $Id: mbstring.c,v 1.224.2.22.2.24 2007/07/12 15:31:54 masugata Exp $ */
 
 /*
  * PHP 4 Multibyte String module mbstring
@@ -3770,7 +3770,7 @@
headers = (char *)device.buffer;
 
if (force_extra_parameters) {
-   extra_cmd = estrdup(force_extra_parameters);
+   extra_cmd = php_escape_shell_cmd(force_extra_parameters);
} else if (extra_cmd) {
extra_cmd = php_escape_shell_cmd(extra_cmd);
} 

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



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

2007-07-12 Thread Antony Dovgal
tony2001Thu Jul 12 15:07:33 2007 UTC

  Modified files:  
/php-src/ext/unicodeunicode.c 
  Log:
  fix MINFO handler
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/unicode/unicode.c?r1=1.43r2=1.44diff_format=u
Index: php-src/ext/unicode/unicode.c
diff -u php-src/ext/unicode/unicode.c:1.43 php-src/ext/unicode/unicode.c:1.44
--- php-src/ext/unicode/unicode.c:1.43  Mon Jan  1 09:29:33 2007
+++ php-src/ext/unicode/unicode.c   Thu Jul 12 15:07:32 2007
@@ -15,7 +15,7 @@
   +--+
 */
 
-/* $Id: unicode.c,v 1.43 2007/01/01 09:29:33 sebastian Exp $ */ 
+/* $Id: unicode.c,v 1.44 2007/07/12 15:07:32 tony2001 Exp $ */ 
 
 #include php_unicode.h
 #include zend_unicode.h
@@ -433,12 +433,10 @@
 PHP_MINFO_FUNCTION(unicode)
 {
php_info_print_box_start(0);
-   php_printf(ICU API extension\n);
-   php_printf(Based on ICU library %s\n, U_COPYRIGHT_STRING);
-   php_printf(ICU Version %s\n, U_ICU_VERSION);
+   php_info_print_table_row(2, ICU API extension, enabled);
+   php_info_print_table_row(2, Based on ICU library, U_COPYRIGHT_STRING);
+   php_info_print_table_row(2, ICU Version, U_ICU_VERSION);
php_info_print_box_end();
-   /* add your stuff here */
-
 }
 /* }}} */
 

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



[PHP-CVS] cvs: php-src /ext/mysql/tests mysql_query.phpt

2007-07-12 Thread Ulf Wendel
uw  Thu Jul 12 16:03:10 2007 UTC

  Modified files:  
/php-src/ext/mysql/testsmysql_query.phpt 
  Log:
  Testing SELECT a AS . This is nice to test strcmp() and similar...
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/mysql/tests/mysql_query.phpt?r1=1.2r2=1.3diff_format=u
Index: php-src/ext/mysql/tests/mysql_query.phpt
diff -u php-src/ext/mysql/tests/mysql_query.phpt:1.2 
php-src/ext/mysql/tests/mysql_query.phpt:1.3
--- php-src/ext/mysql/tests/mysql_query.phpt:1.2Thu Jul 12 10:47:00 2007
+++ php-src/ext/mysql/tests/mysql_query.phptThu Jul 12 16:03:10 2007
@@ -35,6 +35,13 @@
 var_dump(mysql_fetch_assoc($res));
 mysql_free_result($res);
 
+if (!$res = mysql_query('SELECT a AS ', $link))
+   printf([007a] [%d] %s\n, mysql_errno($link), mysql_error($link));
+
+var_dump($tmp = mysql_fetch_assoc($res));
+var_dump($tmp[]);
+mysql_free_result($res);
+
 if (false !== ($res = mysql_query('SELECT this is sql but with semicolon AS 
valid ; SHOW VARIABLES', $link)))
printf([008] [%d] %s\n, mysql_errno($link), mysql_error($link));
 
@@ -87,6 +94,11 @@
   [valid]=
   string(30) this is sql but with semicolon
 }
+array(1) {
+  []=
+  string(1) a
+}
+string(1) a
 
 Warning: mysql_query(): %d is not a valid MySQL-Link resource in %s on line %d
 done!
@@ -95,6 +107,11 @@
   [uvalid]=
   unicode(30) this is sql but with semicolon
 }
+array(1) {
+  [u]=
+  unicode(1) a
+}
+unicode(1) a
 
 Warning: mysql_query(): %d is not a valid MySQL-Link resource in %s on line %d
-done!
\ No newline at end of file
+done!

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



[PHP-CVS] cvs: php-src /ext/mysql/tests mysql_result.phpt

2007-07-12 Thread Ulf Wendel
uw  Thu Jul 12 16:04:15 2007 UTC

  Modified files:  
/php-src/ext/mysql/testsmysql_result.phpt 
  Log:
  1) Whitespace/CS
  2) Playing with column aliases
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/mysql/tests/mysql_result.phpt?r1=1.1r2=1.2diff_format=u
Index: php-src/ext/mysql/tests/mysql_result.phpt
diff -u php-src/ext/mysql/tests/mysql_result.phpt:1.1 
php-src/ext/mysql/tests/mysql_result.phpt:1.2
--- php-src/ext/mysql/tests/mysql_result.phpt:1.1   Sun Nov 19 12:14:44 2006
+++ php-src/ext/mysql/tests/mysql_result.phpt   Thu Jul 12 16:04:15 2007
@@ -2,41 +2,58 @@
 mysql_result()
 --SKIPIF--
 ?php require_once('skipif.inc'); ?
-?php require_once('skipifemb.inc'); ?
 --FILE--
 ?php
-include connect.inc;
-
-$tmp= NULL;   
-$link   = NULL;
-
-// string mysql_result ( resource result, int row [, mixed field] )
-
-if (!is_null($tmp = @mysql_result()))
-printf([001] Expecting NULL, got %s/%s\n, gettype($tmp), $tmp);
-
-if (!is_null($tmp = @mysql_result($link)))
-printf([002] Expecting NULL, got %s/%s\n, gettype($tmp), $tmp);
-
-require('table.inc');
-if (!$res = mysql_query(SELECT id, label FROM test ORDER BY id LIMIT 1, 
$link)) {
-printf([003] [%d] %s\n, mysql_errno($link), mysql_error($link)); 
   
-}
-
-var_dump(mysql_result($res, -1));
-var_dump(mysql_result($res, 2));
-var_dump(mysql_result($res, 0, -1));
-var_dump(mysql_result($res, 0, 2));
-  
-var_dump(mysql_result($res, 0));
-var_dump(mysql_result($res, 0, 1));
-
-mysql_free_result($res);
-
-var_dump(mysql_result($res, 0));
-
-mysql_close($link);   
-print done!;
+include connect.inc;
+
+$tmp= NULL;
+$link   = NULL;
+
+// string mysql_result ( resource result, int row [, mixed field] )
+
+if (!is_null($tmp = @mysql_result()))
+   printf([001] Expecting NULL, got %s/%s\n, gettype($tmp), $tmp);
+
+if (!is_null($tmp = @mysql_result($link)))
+   printf([002] Expecting NULL, got %s/%s\n, gettype($tmp), $tmp);
+
+require('table.inc');
+if (!$res = mysql_query(SELECT id, label, id AS _id, CONCAT(label, 'a') 
_label, NULL as _foo FROM test _test ORDER BY id LIMIT 1, $link)) {
+   printf([003] [%d] %s\n, mysql_errno($link), mysql_error($link));
+}
+
+var_dump(mysql_result($res, -1));
+var_dump(mysql_result($res, 2));
+
+var_dump(mysql_result($res, 0, -1));
+var_dump(mysql_result($res, 0, 500));
+
+print valid fields\n;
+var_dump(mysql_result($res, 0));
+var_dump(mysql_result($res, 0, 1));
+
+var_dump(mysql_result($res, 0, 'id'));
+var_dump(mysql_result($res, 0, '_test.id'));
+var_dump(mysql_result($res, 0, 'label'));
+var_dump(mysql_result($res, 0, '_test.label'));
+print some invalid fields\n;
+var_dump(mysql_result($res, 0, 'unknown'));
+var_dump(mysql_result($res, 0, '_test.'));
+var_dump(mysql_result($res, 0, chr(0)));
+var_dump(mysql_result($res, 0, '_test.' . chr(0)));
+print _id\n;
+var_dump(mysql_result($res, 0, '_id'));
+print _label\n;
+var_dump(mysql_result($res, 0, '_label'));
+print _foo\n;
+var_dump(mysql_result($res, 0, '_foo'));
+
+mysql_free_result($res);
+
+var_dump(mysql_result($res, 0));
+
+mysql_close($link);
+print done!;
 ?
 --EXPECTF--
 Warning: mysql_result(): Unable to jump to row -1 on MySQL result index %d in 
%s on line %d
@@ -50,8 +67,32 @@
 
 Warning: mysql_result(): Bad column offset specified in %s on line %d
 bool(false)
+valid fields
+string(1) 1
+string(1) a
 string(1) 1
+string(1) 1
+string(1) a
 string(1) a
+some invalid fields
+
+Warning: mysql_result(): unknown not found in MySQL result index %d in %s on 
line %d
+bool(false)
+
+Warning: mysql_result(): _test. not found in MySQL result index %d in %s on 
line %d
+bool(false)
+
+Warning: mysql_result():  not found in MySQL result index %d in %s on line %d
+bool(false)
+
+Warning: mysql_result(): _test. not found in MySQL result index %d in %s on 
line %d
+bool(false)
+_id
+string(1) 1
+_label
+string(2) aa
+_foo
+NULL
 
 Warning: mysql_result(): %d is not a valid MySQL result resource in %s on line 
%d
 bool(false)
@@ -68,8 +109,32 @@
 
 Warning: mysql_result(): Bad column offset specified in %s on line %d
 bool(false)
+valid fields
+unicode(1) 1
+unicode(1) a
+unicode(1) 1
 unicode(1) 1
 unicode(1) a
+unicode(1) a
+some invalid fields
+
+Warning: mysql_result(): unknown not found in MySQL result index %d in %s on 
line %d
+bool(false)
+
+Warning: mysql_result(): _test. not found in MySQL result index %d in %s on 
line %d
+bool(false)
+
+Warning: mysql_result():  not found in MySQL result index %d in %s on line %d
+bool(false)
+
+Warning: mysql_result(): _test. not found in MySQL result index %d in %s on 
line %d
+bool(false)
+_id
+unicode(1) 1
+_label
+unicode(2) aa
+_foo
+NULL
 
 Warning: mysql_result(): %d is not a valid MySQL result resource in %s on line 
%d
 bool(false)

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

[PHP-CVS] cvs: php-src /ext/unicode config.m4 config.w32 unicode.dsp

2007-07-12 Thread Jani Taskinen
janiThu Jul 12 16:08:26 2007 UTC

  Modified files:  
/php-src/ext/unicodeconfig.m4 config.w32 unicode.dsp 
  Log:
  - Removed unnecessary stuff
  
http://cvs.php.net/viewvc.cgi/php-src/ext/unicode/config.m4?r1=1.10r2=1.11diff_format=u
Index: php-src/ext/unicode/config.m4
diff -u php-src/ext/unicode/config.m4:1.10 php-src/ext/unicode/config.m4:1.11
--- php-src/ext/unicode/config.m4:1.10  Tue Jun 13 23:46:04 2006
+++ php-src/ext/unicode/config.m4   Thu Jul 12 16:08:26 2007
@@ -1,7 +1,5 @@
 dnl
-dnl $Id: config.m4,v 1.10 2006/06/13 23:46:04 andrei Exp $
+dnl $Id: config.m4,v 1.11 2007/07/12 16:08:26 jani Exp $
 dnl
 
-PHP_SUBST(UNICODE_SHARED_LIBADD)
-AC_DEFINE(HAVE_UNICODE, 1, [ ])
-PHP_NEW_EXTENSION(unicode, unicode.c locale.c unicode_iterators.c collator.c 
property.c constants.c transform.c, $ext_shared)
+PHP_NEW_EXTENSION(unicode, unicode.c locale.c unicode_iterators.c collator.c 
property.c constants.c transform.c, no)
http://cvs.php.net/viewvc.cgi/php-src/ext/unicode/config.w32?r1=1.11r2=1.12diff_format=u
Index: php-src/ext/unicode/config.w32
diff -u php-src/ext/unicode/config.w32:1.11 php-src/ext/unicode/config.w32:1.12
--- php-src/ext/unicode/config.w32:1.11 Tue Jun 13 23:46:04 2006
+++ php-src/ext/unicode/config.w32  Thu Jul 12 16:08:26 2007
@@ -1,5 +1,4 @@
-// $Id: config.w32,v 1.11 2006/06/13 23:46:04 andrei Exp $
+// $Id: config.w32,v 1.12 2007/07/12 16:08:26 jani Exp $
 // vim:ft=javascript
 
 EXTENSION(unicode, unicode.c unicode_iterators.c collator.c locale.c 
property.c constants.c transform.c, false);
-AC_DEFINE('HAVE_UNICODE', 1, 'ICU API extension');
http://cvs.php.net/viewvc.cgi/php-src/ext/unicode/unicode.dsp?r1=1.1r2=1.2diff_format=u
Index: php-src/ext/unicode/unicode.dsp
diff -u php-src/ext/unicode/unicode.dsp:1.1 php-src/ext/unicode/unicode.dsp:1.2
--- php-src/ext/unicode/unicode.dsp:1.1 Thu Aug 11 23:36:01 2005
+++ php-src/ext/unicode/unicode.dsp Thu Jul 12 16:08:26 2007
@@ -43,7 +43,7 @@
 # PROP Ignore_Export_Lib 0
 # PROP Target_Dir 
 # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D WIN32 /D NDEBUG /D _WINDOWS /D 
_MBCS /D _USRDLL /D UNICODE_EXPORTS /YX /FD /c
-# ADD CPP /nologo /MT /W3 /GX /O2 /I ..\.. /I ..\..\Zend /I ..\..\TSRM 
/I ..\..\main /D WIN32 /D PHP_EXPORTS /D COMPILE_DL_UNICODE /D ZTS=1 /D 
HAVE_UNICODE=1 /D ZEND_DEBUG=0 /D NDEBUG /D _WINDOWS /D ZEND_WIN32 /D 
PHP_WIN32 /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /I ..\.. /I ..\..\Zend /I ..\..\TSRM 
/I ..\..\main /D WIN32 /D PHP_EXPORTS /D COMPILE_DL_UNICODE /D ZTS=1 /D 
ZEND_DEBUG=0 /D NDEBUG /D _WINDOWS /D ZEND_WIN32 /D PHP_WIN32 /YX /FD /c
 # ADD BASE MTL /nologo /D NDEBUG /mktyplib203 /win32
 # ADD MTL /nologo /D NDEBUG /mktyplib203 /win32
 # ADD BASE RSC /l 0x407 /d NDEBUG
@@ -69,7 +69,7 @@
 # PROP Ignore_Export_Lib 0
 # PROP Target_Dir 
 # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D WIN32 /D _DEBUG /D 
_WINDOWS /D _MBCS /D _USRDLL /D UNICODE_EXPORTS /YX /FD /GZ  /c
-# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I ..\.. /I ..\..\Zend /I 
..\..\TSRM /I ..\..\main /D ZEND_DEBUG=1 /D WIN32 /D _DEBUG /D 
_WINDOWS /D PHP_EXPORTS /D COMPILE_DL_UNICODE /D ZTS=1 /D ZEND_WIN32 /D 
PHP_WIN32 /D HAVE_UNICODE=1 /YX /FD /GZ  /c
+# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I ..\.. /I ..\..\Zend /I 
..\..\TSRM /I ..\..\main /D ZEND_DEBUG=1 /D WIN32 /D _DEBUG /D 
_WINDOWS /D PHP_EXPORTS /D COMPILE_DL_UNICODE /D ZTS=1 /D ZEND_WIN32 /D 
PHP_WIN32 /YX /FD /GZ  /c
 # ADD BASE MTL /nologo /D _DEBUG /mktyplib203 /win32
 # ADD MTL /nologo /D _DEBUG /mktyplib203 /win32
 # ADD BASE RSC /l 0x407 /d _DEBUG

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



[PHP-CVS] cvs: CVSROOT / avail

2007-07-12 Thread Pierre-Alain Joye
pajoye  Thu Jul 12 15:32:04 2007 UTC

  Modified files:  
/CVSROOTavail 
  Log:
  - msaraujo pecl/lua karma
  
  
http://cvs.php.net/viewvc.cgi/CVSROOT/avail?r1=1.1285r2=1.1286diff_format=u
Index: CVSROOT/avail
diff -u CVSROOT/avail:1.1285 CVSROOT/avail:1.1286
--- CVSROOT/avail:1.1285Fri Jul  6 03:36:52 2007
+++ CVSROOT/avail   Thu Jul 12 15:32:03 2007
@@ -279,6 +279,7 @@
 avail|janisto|pear/Validate,peardoc
 avail|tias|pear/PEAR_Frontend_Web,peardoc
 avail|va|pecl/yami
+avail|msaraujo|pecl/lua
 
 # php windows installer
 avail|jmertic|php-src/win32/installer

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



Re: [PHP-CVS] cvs: php-src /ext/bcmath/libbcmath/src div.c init.c num2str.c

2007-07-12 Thread Nuno Lopes

if you are using safe_emalloc() you can remove all those ' == NULL' tests.
Nuno

On 7/10/07, Antony Dovgal [EMAIL PROTECTED] wrote:

tony2001Tue Jul 10 11:07:56 2007 UTC

 Modified files:
   /php-src/ext/bcmath/libbcmath/src   div.c init.c num2str.c
 Log:
 use safe_emalloc()


http://cvs.php.net/viewvc.cgi/php-src/ext/bcmath/libbcmath/src/div.c?r1=1.3r2=1.4diff_format=u
Index: php-src/ext/bcmath/libbcmath/src/div.c
diff -u php-src/ext/bcmath/libbcmath/src/div.c:1.3 
php-src/ext/bcmath/libbcmath/src/div.c:1.4
--- php-src/ext/bcmath/libbcmath/src/div.c:1.3  Fri Nov 22 09:25:29 2002
+++ php-src/ext/bcmath/libbcmath/src/div.c  Tue Jul 10 11:07:56 2007
@@ -127,13 +127,13 @@
extra = scale - scale1;
  else
extra = 0;
-  num1 = (unsigned char *) emalloc (n1-n_len+n1-n_scale+extra+2);
+  num1 = (unsigned char *) safe_emalloc (1, n1-n_len+n1-n_scale, extra+2);
  if (num1 == NULL) bc_out_of_memory();
  memset (num1, 0, n1-n_len+n1-n_scale+extra+2);
  memcpy (num1+1, n1-n_value, n1-n_len+n1-n_scale);

  len2 = n2-n_len + scale2;
-  num2 = (unsigned char *) emalloc (len2+1);
+  num2 = (unsigned char *) safe_emalloc (1, len2, 1);
  if (num2 == NULL) bc_out_of_memory();
  memcpy (num2, n2-n_value, len2);
  *(num2+len2) = 0;
@@ -164,7 +164,7 @@
  memset (qval-n_value, 0, qdigits);

  /* Allocate storage for the temporary storage mval. */
-  mval = (unsigned char *) emalloc (len2+1);
+  mval = (unsigned char *) safe_emalloc (1, len2, 1);
  if (mval == NULL) bc_out_of_memory ();

  /* Now for the full divide algorithm. */
http://cvs.php.net/viewvc.cgi/php-src/ext/bcmath/libbcmath/src/init.c?r1=1.6r2=1.7diff_format=u
Index: php-src/ext/bcmath/libbcmath/src/init.c
diff -u php-src/ext/bcmath/libbcmath/src/init.c:1.6 
php-src/ext/bcmath/libbcmath/src/init.c:1.7
--- php-src/ext/bcmath/libbcmath/src/init.c:1.6 Tue Dec  9 23:59:33 2003
+++ php-src/ext/bcmath/libbcmath/src/init.c Tue Jul 10 11:07:56 2007
@@ -51,7 +51,7 @@
  bc_num temp;

  /* PHP Change:  malloc() - pemalloc(), removed free_list code */
-  temp = (bc_num) pemalloc (sizeof(bc_struct)+length+scale, persistent);
+  temp = (bc_num) safe_pemalloc (1, sizeof(bc_struct)+length, scale, 
persistent);
 #if 0
  if (_bc_Free_list != NULL) {
temp = _bc_Free_list;
@@ -66,7 +66,7 @@
  temp-n_scale = scale;
  temp-n_refs = 1;
  /* PHP Change:  malloc() - pemalloc() */
-  temp-n_ptr = (char *) pemalloc (length+scale, persistent);
+  temp-n_ptr = (char *) safe_pemalloc (1, length, scale, persistent);
  if (temp-n_ptr == NULL) bc_out_of_memory();
  temp-n_value = temp-n_ptr;
  memset (temp-n_ptr, 0, length+scale);
http://cvs.php.net/viewvc.cgi/php-src/ext/bcmath/libbcmath/src/num2str.c?r1=1.2r2=1.3diff_format=u
Index: php-src/ext/bcmath/libbcmath/src/num2str.c
diff -u php-src/ext/bcmath/libbcmath/src/num2str.c:1.2 
php-src/ext/bcmath/libbcmath/src/num2str.c:1.3
--- php-src/ext/bcmath/libbcmath/src/num2str.c:1.2  Sun Nov 26 09:34:01 2000
+++ php-src/ext/bcmath/libbcmath/src/num2str.c  Tue Jul 10 11:07:56 2007
@@ -51,9 +51,9 @@
  /* Allocate the string memory. */
  signch = ( num-n_sign == PLUS ? 0 : 1 );  /* Number of sign chars. */
  if (num-n_scale  0)
-str = (char *) emalloc (num-n_len + num-n_scale + 2 + signch);
+str = (char *) safe_emalloc (1, num-n_len + num-n_scale, 2 + signch);
  else
-str = (char *) emalloc (num-n_len + 1 + signch);
+str = (char *) safe_emalloc (1, num-n_len, 1 + signch);
  if (str == NULL) bc_out_of_memory();

  /* The negative sign if needed. */

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


--
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 fprintf.phpt

2007-07-12 Thread Jani Taskinen
janiThu Jul 12 17:43:34 2007 UTC

  Modified files:  
/php-src/ext/standard/tests/strings fprintf.phpt 
  Log:
  fix test
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/fprintf.phpt?r1=1.2r2=1.3diff_format=u
Index: php-src/ext/standard/tests/strings/fprintf.phpt
diff -u php-src/ext/standard/tests/strings/fprintf.phpt:1.2 
php-src/ext/standard/tests/strings/fprintf.phpt:1.3
--- php-src/ext/standard/tests/strings/fprintf.phpt:1.2 Fri Apr 20 21:17:37 2007
+++ php-src/ext/standard/tests/strings/fprintf.phpt Thu Jul 12 17:43:34 2007
@@ -3,10 +3,9 @@
 --SKIPIF--
 ?php
 
-$path = dirname(__FILE__);
-$data_file = $path/dump.xt;
+$data_file = dirname(__FILE__) . '/dump.txt';
 if !($fp = fopen($data_file, 'w')) {
-  echo File dump.txt could not be created, hence exiting from testcase due to 
pre-requisite failure\n;
+  die('skip File dump.txt could not be created');
 }
   
 ?
@@ -29,7 +28,8 @@
 $strings = array( NULL, abc, 'aaa' );
 
 /* creating dumping file */
-if (!($fp = fopen('dump.txt', 'wt')))
+$data_file = dirname(__FILE__) . '/dump.txt';
+if (!($fp = fopen($data_file, 'wt')))
return;
 
 /* Testing Error Conditions */
@@ -123,10 +123,12 @@
   $counter++;
 }
 
-print_r( file_get_contents(dump.txt) );
+fclose($fp);
+
+print_r(file_get_contents($data_file));
 echo \nDone;
 
-fclose($fp);
+unlink($data_file);
 
 ?
 --EXPECTF--

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



[PHP-CVS] cvs: php-src / acinclude.m4

2007-07-12 Thread Jani Taskinen
janiThu Jul 12 17:46:14 2007 UTC

  Modified files:  
/php-srcacinclude.m4 
  Log:
  fix the configure output
  
http://cvs.php.net/viewvc.cgi/php-src/acinclude.m4?r1=1.375r2=1.376diff_format=u
Index: php-src/acinclude.m4
diff -u php-src/acinclude.m4:1.375 php-src/acinclude.m4:1.376
--- php-src/acinclude.m4:1.375  Wed Jul 11 21:47:04 2007
+++ php-src/acinclude.m4Thu Jul 12 17:46:14 2007
@@ -1,5 +1,5 @@
 dnl
-dnl $Id: acinclude.m4,v 1.375 2007/07/11 21:47:04 jani Exp $
+dnl $Id: acinclude.m4,v 1.376 2007/07/12 17:46:14 jani Exp $
 dnl
 dnl This file contains local autoconf functions.
 dnl
@@ -2119,7 +2119,7 @@
 dnl Common setup macro for ICU
 dnl
 AC_DEFUN([PHP_SETUP_ICU],[
-  PHP_ARG_WITH(icu-dir, for location of ICU headers and libraries,
+  PHP_ARG_WITH(icu-dir,,
   [  --with-icu-dir=DIR  Specify where ICU libraries and headers can be 
found], DEFAULT, no)
 
   if test $PHP_ICU_DIR = no; then
@@ -2133,13 +2133,15 @@
 ICU_CONFIG=$PHP_ICU_DIR/bin/icu-config
   fi
 
+  AC_MSG_CHECKING([for location of ICU headers and libraries])
+
   dnl Trust icu-config to know better what the install prefix is..
   icu_install_prefix=`$ICU_CONFIG --prefix 2 /dev/null`
   if test $? != 0 || test -z $icu_install_prefix; then
 AC_MSG_RESULT([not found])
 AC_MSG_ERROR([Unable to detect ICU prefix or $ICU_CONFIG failed. Please 
verify ICU install prefix and make sure icu-config works.])
   else
-AC_MSG_RESULT([found in $icu_install_prefix])
+AC_MSG_RESULT([$icu_install_prefix])
 
 dnl Check ICU version
 AC_MSG_CHECKING([for ICU 3.4 or greater])

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



[PHP-CVS] cvs: php-src /ext/date/lib parse_date.re timelib.c unixtime2tm.c /ext/date/tests bug35499.phpt bug41523.phpt bug41709.phpt bug41842.phpt bug41844.phpt bug41964.phpt

2007-07-12 Thread Derick Rethans
derick  Thu Jul 12 18:56:42 2007 UTC

  Added files: 
/php-src/ext/date/tests bug41523.phpt bug41709.phpt bug41842.phpt 
bug41844.phpt bug41964.phpt 

  Modified files:  
/php-src/ext/date/lib   parse_date.re timelib.c unixtime2tm.c 
/php-src/ext/date/tests bug35499.phpt 
  Log:
  - Fixed bug #41964 (strtotime returns a timestamp for non-time string of
pattern '(A|a) .+').
  - Fixed bug #41844 (Format returns incorrect number of digits for negative
years -0001 to -0999).
  - Fixed bug #41842 (Cannot create years  0100  negative years with
date_create or new DateTime).
  - Fixed bug #41709 (strtotime() does not handle 00.00.).
  - Fixed bug #41523 (strtotime('-00-00 00:00:00') is parsed as 1999-11-30).
  
  http://cvs.php.net/viewvc.cgi/php-src/ext/date/lib/parse_date.re?r1=1.64r2=1.65diff_format=u
Index: php-src/ext/date/lib/parse_date.re
diff -u php-src/ext/date/lib/parse_date.re:1.64 
php-src/ext/date/lib/parse_date.re:1.65
--- php-src/ext/date/lib/parse_date.re:1.64 Fri Apr 13 08:11:35 2007
+++ php-src/ext/date/lib/parse_date.re  Thu Jul 12 18:56:41 2007
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: parse_date.re,v 1.64 2007/04/13 08:11:35 derick Exp $ */
+/* $Id: parse_date.re,v 1.65 2007/07/12 18:56:41 derick Exp $ */
 
 #include timelib.h
 
@@ -42,6 +42,8 @@
 # endif
 #endif
 
+#define TIMELIB_UNSET   -9
+
 #define TIMELIB_SECOND  1
 #define TIMELIB_MINUTE  2
 #define TIMELIB_HOUR3
@@ -112,7 +114,7 @@
 #define TIMELIB_ADJUST_RELATIVE_WEEKDAY() if (in-time.have_weekday_relative 
 (in.rel.d  0)) { in.rel.d -= 7; }
 
 #define TIMELIB_PROCESS_YEAR(x) { \
-   if ((x) == -1) { \
+   if ((x) == TIMELIB_UNSET) { \
/*  (x) = 0; */  \
} else if ((x)  100) {  \
if ((x)  70) {  \
@@ -381,12 +383,12 @@
 static timelib_sll timelib_get_nr(char **ptr, int max_length)
 {
char *begin, *end, *str;
-   timelib_sll tmp_nr = -1;
+   timelib_sll tmp_nr = TIMELIB_UNSET;
int len = 0;
 
while ((**ptr  '0') || (**ptr  '9')) {
if (**ptr == '\0') {
-   return -1;
+   return TIMELIB_UNSET;
}
++*ptr;
}
@@ -416,12 +418,12 @@
 static double timelib_get_frac_nr(char **ptr, int max_length)
 {
char *begin, *end, *str;
-   double tmp_nr = -1;
+   double tmp_nr = TIMELIB_UNSET;
int len = 0;
 
while ((**ptr != '.')  ((**ptr  '0') || (**ptr  '9'))) {
if (**ptr == '\0') {
-   return -1;
+   return TIMELIB_UNSET;
}
++*ptr;
}
@@ -444,7 +446,7 @@
 
while (((**ptr  '0') || (**ptr  '9'))  (**ptr != '+')  (**ptr != 
'-')) {
if (**ptr == '\0') {
-   return -1;
+   return TIMELIB_UNSET;
}
++*ptr;
}
@@ -794,12 +796,13 @@
 year  = [0-9]{1,4};
 year2 = [0-9]{2};
 year4 = [0-9]{4};
+year4withsign = [+-]? [0-9]{4};
 
 dayofyear = 00[1-9] | 0[1-9][0-9] | [1-2][0-9][0-9] | 3[0-5][0-9] | 
36[0-6];
 weekofyear = 0[1-9] | [1-4][0-9] | 5[0-3];
 
-monthlz = 0 [1-9] | 1 [0-2];
-daylz   = 0 [1-9] | [1-2][0-9] | 3 [01];
+monthlz = 0 [0-9] | 1 [0-2];
+daylz   = 0 [0-9] | [1-2][0-9] | 3 [01];
 
 dayfull = 'sunday' | 'monday' | 'tuesday' | 'wednesday' | 'thursday' | 
'friday' | 'saturday';
 dayabbr = 'sun' | 'mon' | 'tue' | 'wed' | 'thu' | 'fri' | 'sat' | 'sun';
@@ -834,10 +837,12 @@
 american = month / day / year;
 iso8601dateslash = year4 / monthlz / daylz /?;
 dateslash= year4 / month / day;
+iso8601date4 = year4withsign - monthlz - daylz;
+iso8601date2 = year2 - monthlz - daylz;
 gnudateshorter   = year4 - month;
 gnudateshort = year - month - day;
-iso8601date  = year4 - monthlz - daylz;
-pointeddate  = day [.\t-] month [.-] year;
+pointeddate4 = day [.\t-] month [.-] year4;
+pointeddate2 = day [.\t-] month [.-] year2;
 datefull = day ([ \t.-])* monthtext ([ \t.-])* year;
 datenoday= monthtext ([ .\t-])* year4;
 datenodayrev = year4 ([ .\t-])* monthtext;
@@ -1088,14 +1093,27 @@
return TIMELIB_AMERICAN;
}
 
-   iso8601date | iso8601dateslash | dateslash
+   iso8601date4 | iso8601dateslash | dateslash
+   {
+   DEBUG_OUTPUT(iso8601date4 | iso8601date2 | iso8601dateslash | 
dateslash);
+   TIMELIB_INIT;
+   TIMELIB_HAVE_DATE();
+   s-time-y = timelib_get_unsigned_nr((char **) ptr, 4);
+   s-time-m = timelib_get_nr((char **) ptr, 2);
+   s-time-d = timelib_get_nr((char **) ptr, 2);
+   TIMELIB_DEINIT;
+   return TIMELIB_ISO_DATE;
+   }
+
+   iso8601date2
 

[PHP-CVS] cvs: php-src(PHP_5_2) / NEWS /ext/date/lib parse_date.re timelib.c unixtime2tm.c /ext/date/tests bug35499.phpt bug41523.phpt bug41709.phpt bug41842.phpt bug41844.phpt bug41964.phpt

2007-07-12 Thread Derick Rethans
derick  Thu Jul 12 18:58:00 2007 UTC

  Added files: (Branch: PHP_5_2)
/php-src/ext/date/tests bug41523.phpt bug41709.phpt bug41842.phpt 
bug41844.phpt bug41964.phpt 

  Modified files:  
/php-src/ext/date/lib   parse_date.re timelib.c unixtime2tm.c 
/php-srcNEWS 
/php-src/ext/date/tests bug35499.phpt 
  Log:
  - MFH: Fixed bug #41964 (strtotime returns a timestamp for non-time string of
pattern '(A|a) .+'). 
  - MFH: Fixed bug #41844 (Format returns incorrect number of digits for 
negative
years -0001 to -0999). 
  - MFH: Fixed bug #41842 (Cannot create years  0100  negative years with
date_create or new DateTime). 
  - MFH: Fixed bug #41709 (strtotime() does not handle 00.00.). 
  - MFH: Fixed bug #41523 (strtotime('-00-00 00:00:00') is parsed as
1999-11-30).
  
  http://cvs.php.net/viewvc.cgi/php-src/ext/date/lib/parse_date.re?r1=1.26.2.27.2.11r2=1.26.2.27.2.12diff_format=u
Index: php-src/ext/date/lib/parse_date.re
diff -u php-src/ext/date/lib/parse_date.re:1.26.2.27.2.11 
php-src/ext/date/lib/parse_date.re:1.26.2.27.2.12
--- php-src/ext/date/lib/parse_date.re:1.26.2.27.2.11   Fri Apr 13 08:11:07 2007
+++ php-src/ext/date/lib/parse_date.re  Thu Jul 12 18:58:00 2007
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: parse_date.re,v 1.26.2.27.2.11 2007/04/13 08:11:07 derick Exp $ */
+/* $Id: parse_date.re,v 1.26.2.27.2.12 2007/07/12 18:58:00 derick Exp $ */
 
 #include timelib.h
 
@@ -42,6 +42,8 @@
 # endif
 #endif
 
+#define TIMELIB_UNSET   -9
+
 #define TIMELIB_SECOND  1
 #define TIMELIB_MINUTE  2
 #define TIMELIB_HOUR3
@@ -112,7 +114,7 @@
 #define TIMELIB_ADJUST_RELATIVE_WEEKDAY() if (in-time.have_weekday_relative 
 (in.rel.d  0)) { in.rel.d -= 7; }
 
 #define TIMELIB_PROCESS_YEAR(x) { \
-   if ((x) == -1) { \
+   if ((x) == TIMELIB_UNSET) { \
/*  (x) = 0; */  \
} else if ((x)  100) {  \
if ((x)  70) {  \
@@ -381,12 +383,12 @@
 static timelib_sll timelib_get_nr(char **ptr, int max_length)
 {
char *begin, *end, *str;
-   timelib_sll tmp_nr = -1;
+   timelib_sll tmp_nr = TIMELIB_UNSET;
int len = 0;
 
while ((**ptr  '0') || (**ptr  '9')) {
if (**ptr == '\0') {
-   return -1;
+   return TIMELIB_UNSET;
}
++*ptr;
}
@@ -416,12 +418,12 @@
 static double timelib_get_frac_nr(char **ptr, int max_length)
 {
char *begin, *end, *str;
-   double tmp_nr = -1;
+   double tmp_nr = TIMELIB_UNSET;
int len = 0;
 
while ((**ptr != '.')  ((**ptr  '0') || (**ptr  '9'))) {
if (**ptr == '\0') {
-   return -1;
+   return TIMELIB_UNSET;
}
++*ptr;
}
@@ -444,7 +446,7 @@
 
while (((**ptr  '0') || (**ptr  '9'))  (**ptr != '+')  (**ptr != 
'-')) {
if (**ptr == '\0') {
-   return -1;
+   return TIMELIB_UNSET;
}
++*ptr;
}
@@ -794,12 +796,13 @@
 year  = [0-9]{1,4};
 year2 = [0-9]{2};
 year4 = [0-9]{4};
+year4withsign = [+-]? [0-9]{4};
 
 dayofyear = 00[1-9] | 0[1-9][0-9] | [1-2][0-9][0-9] | 3[0-5][0-9] | 
36[0-6];
 weekofyear = 0[1-9] | [1-4][0-9] | 5[0-3];
 
-monthlz = 0 [1-9] | 1 [0-2];
-daylz   = 0 [1-9] | [1-2][0-9] | 3 [01];
+monthlz = 0 [0-9] | 1 [0-2];
+daylz   = 0 [0-9] | [1-2][0-9] | 3 [01];
 
 dayfull = 'sunday' | 'monday' | 'tuesday' | 'wednesday' | 'thursday' | 
'friday' | 'saturday';
 dayabbr = 'sun' | 'mon' | 'tue' | 'wed' | 'thu' | 'fri' | 'sat' | 'sun';
@@ -834,10 +837,12 @@
 american = month / day / year;
 iso8601dateslash = year4 / monthlz / daylz /?;
 dateslash= year4 / month / day;
+iso8601date4 = year4withsign - monthlz - daylz;
+iso8601date2 = year2 - monthlz - daylz;
 gnudateshorter   = year4 - month;
 gnudateshort = year - month - day;
-iso8601date  = year4 - monthlz - daylz;
-pointeddate  = day [.\t-] month [.-] year;
+pointeddate4 = day [.\t-] month [.-] year4;
+pointeddate2 = day [.\t-] month [.-] year2;
 datefull = day ([ \t.-])* monthtext ([ \t.-])* year;
 datenoday= monthtext ([ .\t-])* year4;
 datenodayrev = year4 ([ .\t-])* monthtext;
@@ -1088,14 +1093,27 @@
return TIMELIB_AMERICAN;
}
 
-   iso8601date | iso8601dateslash | dateslash
+   iso8601date4 | iso8601dateslash | dateslash
+   {
+   DEBUG_OUTPUT(iso8601date4 | iso8601date2 | iso8601dateslash | 
dateslash);
+   TIMELIB_INIT;
+   TIMELIB_HAVE_DATE();
+   s-time-y = timelib_get_unsigned_nr((char **) ptr, 4);
+   s-time-m = timelib_get_nr((char **) ptr, 2);
+   s-time-d = 

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

2007-07-12 Thread Derick Rethans
derick  Thu Jul 12 18:58:48 2007 UTC

  Modified files:  
/php-src/ext/date   php_date.c 
  Log:
  - Missing file in commit.
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/date/php_date.c?r1=1.141r2=1.142diff_format=u
Index: php-src/ext/date/php_date.c
diff -u php-src/ext/date/php_date.c:1.141 php-src/ext/date/php_date.c:1.142
--- php-src/ext/date/php_date.c:1.141   Thu Jun  7 23:16:41 2007
+++ php-src/ext/date/php_date.c Thu Jul 12 18:58:48 2007
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: php_date.c,v 1.141 2007/06/07 23:16:41 iliaa Exp $ */
+/* $Id: php_date.c,v 1.142 2007/07/12 18:58:48 derick Exp $ */
 
 #include php.h
 #include php_streams.h
@@ -883,7 +883,7 @@
/* year */
case 'L': length = date_spprintf(buffer, 32 TSRMLS_CC, 
%d, timelib_is_leap((int) t-y)); break;
case 'y': length = date_spprintf(buffer, 32 TSRMLS_CC, 
%02d, (int) t-y % 100); break;
-   case 'Y': length = date_spprintf(buffer, 32 TSRMLS_CC, 
%04d, (int) t-y); break;
+   case 'Y': length = date_spprintf(buffer, 32 TSRMLS_CC, 
%s%04d, t-y  0 ? - : , abs((int) t-y)); break;
 
/* time */
case 'a': length = date_spprintf(buffer, 32 TSRMLS_CC, 
%R, localized ? IS_UNICODE : IS_STRING, am_pm_lower_full(t-h = 12 ? 1 : 0, 
localized)); break;
@@ -1869,7 +1869,7 @@
parsed_time = timelib_strtotime(date, date_len, error, 
DATE_TIMEZONEDB);
array_init(return_value);
 #define PHP_DATE_PARSE_DATE_SET_TIME_ELEMENT(name, elem) \
-   if (parsed_time-elem == -1) {   \
+   if (parsed_time-elem == -9) {   \
add_ascii_assoc_bool(return_value, #name, 0); \
} else {   \
add_ascii_assoc_long(return_value, #name, parsed_time-elem); \
@@ -1881,7 +1881,7 @@
PHP_DATE_PARSE_DATE_SET_TIME_ELEMENT(minute,i);
PHP_DATE_PARSE_DATE_SET_TIME_ELEMENT(second,s);

-   if (parsed_time-f == -1) {
+   if (parsed_time-f == -9) {
add_ascii_assoc_bool(return_value, fraction, 0);
} else {
add_ascii_assoc_double(return_value, fraction, 
parsed_time-f);

-- 
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/date php_date.c

2007-07-12 Thread Derick Rethans
derick  Thu Jul 12 18:59:05 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/date   php_date.c 
  Log:
  - MFH: Missing file in previous commit.
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/date/php_date.c?r1=1.43.2.45.2.50r2=1.43.2.45.2.51diff_format=u
Index: php-src/ext/date/php_date.c
diff -u php-src/ext/date/php_date.c:1.43.2.45.2.50 
php-src/ext/date/php_date.c:1.43.2.45.2.51
--- php-src/ext/date/php_date.c:1.43.2.45.2.50  Thu Jun  7 23:16:04 2007
+++ php-src/ext/date/php_date.c Thu Jul 12 18:59:05 2007
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: php_date.c,v 1.43.2.45.2.50 2007/06/07 23:16:04 iliaa Exp $ */
+/* $Id: php_date.c,v 1.43.2.45.2.51 2007/07/12 18:59:05 derick Exp $ */
 
 #include php.h
 #include php_streams.h
@@ -775,7 +775,7 @@
/* year */
case 'L': length = slprintf(buffer, 32, %d, 
timelib_is_leap((int) t-y)); break;
case 'y': length = slprintf(buffer, 32, %02d, (int) 
t-y % 100); break;
-   case 'Y': length = slprintf(buffer, 32, %04d, (int) 
t-y); break;
+   case 'Y': length = slprintf(buffer, 32, %s%04d, t-y 
 0 ? - : , abs((int) t-y)); break;
 
/* time */
case 'a': length = slprintf(buffer, 32, %s, t-h = 
12 ? pm : am); break;
@@ -1740,7 +1740,7 @@
parsed_time = timelib_strtotime(date, date_len, error, 
DATE_TIMEZONEDB);
array_init(return_value);
 #define PHP_DATE_PARSE_DATE_SET_TIME_ELEMENT(name, elem) \
-   if (parsed_time-elem == -1) {   \
+   if (parsed_time-elem == -9) {   \
add_assoc_bool(return_value, #name, 0); \
} else {   \
add_assoc_long(return_value, #name, parsed_time-elem); \
@@ -1752,7 +1752,7 @@
PHP_DATE_PARSE_DATE_SET_TIME_ELEMENT(minute,i);
PHP_DATE_PARSE_DATE_SET_TIME_ELEMENT(second,s);

-   if (parsed_time-f == -1) {
+   if (parsed_time-f == -9) {
add_assoc_bool(return_value, fraction, 0);
} else {
add_assoc_double(return_value, fraction, parsed_time-f);

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



Re: [PHP-CVS] cvs: php-src /ext/bcmath/libbcmath/src div.c init.c num2str.c

2007-07-12 Thread Antony Dovgal

On 12.07.2007 20:54, Nuno Lopes wrote:

if you are using safe_emalloc() you can remove all those ' == NULL' tests.


Actually emalloc() is supposed to bail out on failure, so NULL was not possible 
there either.
But I just didn't want to touch that part of the code..


Nuno

On 7/10/07, Antony Dovgal [EMAIL PROTECTED] wrote:

tony2001Tue Jul 10 11:07:56 2007 UTC

 Modified files:
   /php-src/ext/bcmath/libbcmath/src   div.c init.c num2str.c
 Log:
 use safe_emalloc()


http://cvs.php.net/viewvc.cgi/php-src/ext/bcmath/libbcmath/src/div.c?r1=1.3r2=1.4diff_format=u
Index: php-src/ext/bcmath/libbcmath/src/div.c
diff -u php-src/ext/bcmath/libbcmath/src/div.c:1.3 
php-src/ext/bcmath/libbcmath/src/div.c:1.4
--- php-src/ext/bcmath/libbcmath/src/div.c:1.3  Fri Nov 22 09:25:29 2002
+++ php-src/ext/bcmath/libbcmath/src/div.c  Tue Jul 10 11:07:56 2007
@@ -127,13 +127,13 @@
extra = scale - scale1;
  else
extra = 0;
-  num1 = (unsigned char *) emalloc (n1-n_len+n1-n_scale+extra+2);
+  num1 = (unsigned char *) safe_emalloc (1, n1-n_len+n1-n_scale, extra+2);
  if (num1 == NULL) bc_out_of_memory();
  memset (num1, 0, n1-n_len+n1-n_scale+extra+2);
  memcpy (num1+1, n1-n_value, n1-n_len+n1-n_scale);

  len2 = n2-n_len + scale2;
-  num2 = (unsigned char *) emalloc (len2+1);
+  num2 = (unsigned char *) safe_emalloc (1, len2, 1);
  if (num2 == NULL) bc_out_of_memory();
  memcpy (num2, n2-n_value, len2);
  *(num2+len2) = 0;
@@ -164,7 +164,7 @@
  memset (qval-n_value, 0, qdigits);

  /* Allocate storage for the temporary storage mval. */
-  mval = (unsigned char *) emalloc (len2+1);
+  mval = (unsigned char *) safe_emalloc (1, len2, 1);
  if (mval == NULL) bc_out_of_memory ();

  /* Now for the full divide algorithm. */
http://cvs.php.net/viewvc.cgi/php-src/ext/bcmath/libbcmath/src/init.c?r1=1.6r2=1.7diff_format=u
Index: php-src/ext/bcmath/libbcmath/src/init.c
diff -u php-src/ext/bcmath/libbcmath/src/init.c:1.6 
php-src/ext/bcmath/libbcmath/src/init.c:1.7
--- php-src/ext/bcmath/libbcmath/src/init.c:1.6 Tue Dec  9 23:59:33 2003
+++ php-src/ext/bcmath/libbcmath/src/init.c Tue Jul 10 11:07:56 2007
@@ -51,7 +51,7 @@
  bc_num temp;

  /* PHP Change:  malloc() - pemalloc(), removed free_list code */
-  temp = (bc_num) pemalloc (sizeof(bc_struct)+length+scale, persistent);
+  temp = (bc_num) safe_pemalloc (1, sizeof(bc_struct)+length, scale, 
persistent);
 #if 0
  if (_bc_Free_list != NULL) {
temp = _bc_Free_list;
@@ -66,7 +66,7 @@
  temp-n_scale = scale;
  temp-n_refs = 1;
  /* PHP Change:  malloc() - pemalloc() */
-  temp-n_ptr = (char *) pemalloc (length+scale, persistent);
+  temp-n_ptr = (char *) safe_pemalloc (1, length, scale, persistent);
  if (temp-n_ptr == NULL) bc_out_of_memory();
  temp-n_value = temp-n_ptr;
  memset (temp-n_ptr, 0, length+scale);
http://cvs.php.net/viewvc.cgi/php-src/ext/bcmath/libbcmath/src/num2str.c?r1=1.2r2=1.3diff_format=u
Index: php-src/ext/bcmath/libbcmath/src/num2str.c
diff -u php-src/ext/bcmath/libbcmath/src/num2str.c:1.2 
php-src/ext/bcmath/libbcmath/src/num2str.c:1.3
--- php-src/ext/bcmath/libbcmath/src/num2str.c:1.2  Sun Nov 26 09:34:01 2000
+++ php-src/ext/bcmath/libbcmath/src/num2str.c  Tue Jul 10 11:07:56 2007
@@ -51,9 +51,9 @@
  /* Allocate the string memory. */
  signch = ( num-n_sign == PLUS ? 0 : 1 );  /* Number of sign chars. */
  if (num-n_scale  0)
-str = (char *) emalloc (num-n_len + num-n_scale + 2 + signch);
+str = (char *) safe_emalloc (1, num-n_len + num-n_scale, 2 + signch);
  else
-str = (char *) emalloc (num-n_len + 1 + signch);
+str = (char *) safe_emalloc (1, num-n_len, 1 + signch);
  if (str == NULL) bc_out_of_memory();

  /* The negative sign if needed. */

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





--
Wbr, 
Antony Dovgal


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



[PHP-CVS] cvs: php-src /ext/mysqli/tests connect.inc

2007-07-12 Thread Ulf Wendel
uw  Thu Jul 12 20:04:18 2007 UTC

  Modified files:  
/php-src/ext/mysqli/tests   connect.inc 
  Log:
  Starting to merge the latest set of ext/mysqli tests from the mysqlnd
  SVN repro into HEAD. Again, it might happen that I crash the set of tests
  and don't mention one or the other change while merging. Blame me...
  
  1) Note the new environment variables to control the test run
  2) Variables $IS_MYSQLND and $MYSQLND_VERSION are for writing portable tests
  3) sys_get_temp_dir function is for PHP5/PHP6 portability
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/connect.inc?r1=1.8r2=1.9diff_format=u
Index: php-src/ext/mysqli/tests/connect.inc
diff -u php-src/ext/mysqli/tests/connect.inc:1.8 
php-src/ext/mysqli/tests/connect.inc:1.9
--- php-src/ext/mysqli/tests/connect.inc:1.8Tue Sep 26 13:06:13 2006
+++ php-src/ext/mysqli/tests/connect.incThu Jul 12 20:04:17 2007
@@ -1,14 +1,54 @@
 ?php
+/* 
+Default values are localhost, root, 
+database phptest and empty password. 
+Change the MYSQL_TEST environment values 
+if you want to use another configuration   
+*/
+ 
+   $driver= new mysqli_driver;
 
-  /* default values are localhost, root and empty password 
- Change the MYSQL_TEST environment values if you want to 
- use another configuration   */
-   $driver = new mysqli_driver;
+   $host  = getenv(MYSQL_TEST_HOST) ? getenv(MYSQL_TEST_HOST) 
: localhost;
+   $port  = getenv(MYSQL_TEST_PORT) ? getenv(MYSQL_TEST_PORT) 
: 3306;
+   $user  = getenv(MYSQL_TEST_USER) ? getenv(MYSQL_TEST_USER) 
: root;
+   $passwd= getenv(MYSQL_TEST_PASSWD)   ? 
getenv(MYSQL_TEST_PASSWD) : ;
+   $db= getenv(MYSQL_TEST_DB)   ? getenv(MYSQL_TEST_DB) : 
phptest;
+   $engine= getenv(MYSQL_TEST_ENGINE)   ? 
getenv(MYSQL_TEST_ENGINE) : MyISAM;
+   $socket= getenv(MYSQL_TEST_SOCKET)   ? 
getenv(MYSQL_TEST_SOCKET) : null;
+   
+   /* Development setting: test experimal features and/or feature requests 
that never worked before? */
+   $TEST_EXPERIMENTAL = (in_array(getenv(MYSQL_TEST_EXPERIMENTAL), 
array(0, 1))) ? 
+((1 == getenv(MYSQL_TEST_EXPERIMENTAL)) ? true : 
false) : 
+ false;
 
-   $host = getenv(MYSQL_TEST_HOST) ? getenv(MYSQL_TEST_HOST) : 
localhost;
-   $port = getenv(MYSQL_TEST_PORT) ? getenv(MYSQL_TEST_PORT) : 3306;
-   $user = getenv(MYSQL_TEST_USER) ? getenv(MYSQL_TEST_USER) : root;
-   $passwd = getenv(MYSQL_TEST_PASSWD) ? getenv(MYSQL_TEST_PASSWD) : 
;
-   $db = getenv(MYSQL_TEST_DB) ? getenv(MYSQL_TEST_DB) : phptest;
-   $engine = getenv(MYSQL_TEST_ENGINE) ? getenv(MYSQL_TEST_ENGINE) : 
MyISAM;
-?
+   $IS_MYSQLND = stristr(mysqli_get_client_info(), mysqlnd);
+   if (!$IS_MYSQLND) {
+   $MYSQLND_VERSION = NULL;
+   } else {
+   if (preg_match('@Revision:\s+(\d+)[EMAIL PROTECTED]', 
mysqli_get_client_info(), $matches)) {
+   $MYSQLND_VERSION = (int)$matches[1];
+   } else {
+   $MYSQLND_VERSION = -1;
+   }
+   }
+
+   if (!function_exists('sys_get_temp_dir')) {
+function sys_get_temp_dir() {
+
+if (!empty($_ENV['TMP']))
+return realpath( $_ENV['TMP'] );
+if (!empty($_ENV['TMPDIR']))
+return realpath( $_ENV['TMPDIR'] );
+if (!empty($_ENV['TEMP']))
+return realpath( $_ENV['TEMP'] );
+
+$temp_file = tempnam(md5(uniqid(rand(), TRUE)), '');
+if ($temp_file) {
+$temp_dir = realpath(dirname($temp_file));
+unlink($temp_file);
+return $temp_dir;
+}
+return FALSE;
+}
+}
+?
\ No newline at end of file

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



[PHP-CVS] cvs: php-src /ext/mysqli/tests skipif.inc

2007-07-12 Thread Ulf Wendel
uw  Thu Jul 12 20:07:05 2007 UTC

  Modified files:  
/php-src/ext/mysqli/tests   skipif.inc 
  Log:
  Some tests intentionally fail connecting to the DB. Not being able to 
  connect is no reason to skip the test. Also, no test should have hard-wired
  connection parameter in it. Connection parameters come from connect.inc
  (see environment variables in connect.inc).
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/skipif.inc?r1=1.6r2=1.7diff_format=u
Index: php-src/ext/mysqli/tests/skipif.inc
diff -u php-src/ext/mysqli/tests/skipif.inc:1.6 
php-src/ext/mysqli/tests/skipif.inc:1.7
--- php-src/ext/mysqli/tests/skipif.inc:1.6 Tue Sep 26 13:06:13 2006
+++ php-src/ext/mysqli/tests/skipif.inc Thu Jul 12 20:07:05 2007
@@ -2,8 +2,4 @@
 if (!extension_loaded('mysqli')){
die('skip mysqli extension not available');
 }
-include connect.inc;
-if ([EMAIL PROTECTED]($host, $user, $passwd, , 3306)) {
-   die('skip could not connect to MySQL');
-}
 ?

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



[PHP-CVS] cvs: php-src /ext/mysqli/tests table.inc

2007-07-12 Thread Ulf Wendel
uw  Thu Jul 12 20:10:24 2007 UTC

  Added files: 
/php-src/ext/mysqli/tests   table.inc 
  Log:
  Some of the upcoming new tests will use this little helper to create a
  very simple MySQL table with some data in it to play with.
  
  

http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/table.inc?view=markuprev=1.1
Index: php-src/ext/mysqli/tests/table.inc
+++ php-src/ext/mysqli/tests/table.inc
?PHP
require_once('connect.inc');

if (!$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket)) {
printf(Cannot connect to the server using host=%s, user=%s, passwd=***, 
dbname=%s, port=%s, socket=%s\n,
$host, $user, $db, $port, $socket);
exit(1);
}   

if (!mysqli_query($link, 'DROP TABLE IF EXISTS test')) {
printf(Failed to drop old test table: [%d] %s\n, mysqli_errno($link), 
mysqli_error($link));
exit(1);
}

if (!mysqli_query($link, 'CREATE TABLE test(id INT, label CHAR(1), PRIMARY 
KEY(id)) ENGINE=' . $engine)) {
printf(Failed to create test table: [%d] %s\n, mysqli_errno($link), 
mysqli_error($link));
exit(1);
}

if (!mysqli_query($link, 'INSERT INTO test(id, label) VALUES (1, a), (2, 
b), (3, c), (4, d), (5, e), (6, f)')) {
printf([%d] %s\n,  mysqli_errno($link), mysqli_error($link));
}
?

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



[PHP-CVS] cvs: php-src /ext/mysqli/tests mysqli_affected_rows.phpt mysqli_affected_rows_oo.phpt mysqli_autocommit.phpt mysqli_autocommit_oo.phpt

2007-07-12 Thread Ulf Wendel
uw  Thu Jul 12 20:20:57 2007 UTC

  Added files: 
/php-src/ext/mysqli/tests   mysqli_affected_rows.phpt 
mysqli_affected_rows_oo.phpt 
mysqli_autocommit.phpt 
mysqli_autocommit_oo.phpt 
  Log:
  Adding tests for mysqli_affected_rows() and mysqli_autocommit()
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/mysqli_affected_rows.phpt?view=markuprev=1.1
Index: php-src/ext/mysqli/tests/mysqli_affected_rows.phpt
+++ php-src/ext/mysqli/tests/mysqli_affected_rows.phpt
--TEST--
mysqli_affected_rows()
--SKIPIF--
?php require_once('skipif.inc'); ?
?php require_once('skipifemb.inc'); ?
--FILE--
?php
include connect.inc;

$tmp= NULL;
$link   = NULL;

if (!is_null($tmp = @mysqli_affected_rows()))
printf([001] Expecting NULL, got %s/%s\n, gettype($tmp), 
$tmp);

if (!is_null($tmp = @mysqli_affected_rows($link)))
printf([002] Expecting NULL, got %s/%s\n, gettype($tmp), 
$tmp);

if (!is_null($tmp = @mysqli_affected_rows($link, $link)))
printf([003] Expecting NULL, got %s/%s\n, gettype($tmp), 
$tmp);

if (!$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket))
printf([004] Cannot connect to the server using host=%s, 
user=%s, passwd=***, dbname=%s, port=%s, socket=%s\n,
$host, $user, $db, $port, $socket);

if (0 !== ($tmp = mysqli_affected_rows($link)))
printf([005] Expecting int/0, got %s/%s. [%d] %s\n,
gettype($tmp), $tmp, mysqli_errno($link), 
mysqli_error($link));

if (!mysqli_query($link, 'DROP TABLE IF EXISTS test'))
printf([006] [%d] %s\n, mysqli_errno($link), 
mysqli_error($link));

if (!mysqli_query($link, 'CREATE TABLE test(id INT, label CHAR(1), 
PRIMARY KEY(id)) ENGINE = ' . $engine))
printf([007] [%d] %s\n, mysqli_errno($link), 
mysqli_error($link));

if (!mysqli_query($link, 'INSERT INTO test(id, label) VALUES (1, a)'))
printf([008] [%d] %s\n,  mysqli_errno($link), 
mysqli_error($link));

if (1 !== ($tmp = mysqli_affected_rows($link)))
printf([010] Expecting int/1, got %s/%s\n, gettype($tmp), 
$tmp);

// ignore INSERT error, NOTE: command line returns 0, affected_rows 
returns -1 as documented
mysqli_query($link, 'INSERT INTO test(id, label) VALUES (1, a)');
if (-1 !== ($tmp = mysqli_affected_rows($link)))
printf([011] Expecting int/-1, got %s/%s\n, gettype($tmp), 
$tmp);

if (!mysqli_query($link, 'INSERT INTO test(id, label) VALUES (1, a) 
ON DUPLICATE KEY UPDATE id = 4'))
printf([012] [%d] %s\n,  mysqli_errno($link), 
mysqli_error($link));

if (2 !== ($tmp = mysqli_affected_rows($link)))
printf([013] Expecting int/2, got %s/%s\n, gettype($tmp), 
$tmp);

if (!mysqli_query($link, INSERT INTO test(id, label) VALUES (2, 'b'), 
(3, 'c')))
printf([014] [%d] %s\n,  mysqli_errno($link), 
mysqli_error($link));

if (2 !== ($tmp = mysqli_affected_rows($link)))
printf([015] Expecting int/2, got %s/%s\n, gettype($tmp), 
$tmp);

if (!mysqli_query($link, INSERT IGNORE INTO test(id, label) VALUES (1, 
'a'))) {
printf([016] [%d] %s\n,  mysqli_errno($link), 
mysqli_error($link));
}

if (1 !== ($tmp = mysqli_affected_rows($link)))
printf([017] Expecting int/1, got %s/%s\n, gettype($tmp), 
$tmp);

if (!mysqli_query($link, INSERT INTO test(id, label) SELECT id + 10, 
label FROM test))
printf([018] [%d] %s\n,  mysqli_errno($link), 
mysqli_error($link));

if (4 !== ($tmp = mysqli_affected_rows($link)))
printf([019] Expecting int/4, got %s/%s\n, gettype($tmp), 
$tmp);

if (!mysqli_query($link, REPLACE INTO test(id, label) values (4, 
'd')))
printf([020] [%d] %s\n,  mysqli_errno($link), 
mysqli_error($link));

if (2 !== ($tmp = mysqli_affected_rows($link)))
printf([021] Expecting int/2, got %s/%s\n, gettype($tmp), 
$tmp);

if (!mysqli_query($link, REPLACE INTO test(id, label) values (5, 
'e')))
printf([022] [%d] %s\n,  mysqli_errno($link), 
mysqli_error($link));

if (1 !== ($tmp = mysqli_affected_rows($link)))
printf([023] Expecting int/1, got %s/%s\n, gettype($tmp), 
$tmp);

if (!mysqli_query($link, UPDATE test SET label = 'a' WHERE id = 2))
printf([024] [%d] %s\n,  mysqli_errno($link), 
mysqli_error($link));

if (1 !== ($tmp = mysqli_affected_rows($link)))
printf([025] Expecting int/1, got %s/%s\n, gettype($tmp), 
$tmp);

$charsets = array('utf8');
foreach ($charsets as $k = $charset) {
  

[PHP-CVS] cvs: php-src /ext/mysqli/tests 001.phpt

2007-07-12 Thread Ulf Wendel
uw  Thu Jul 12 20:28:25 2007 UTC

  Modified files:  
/php-src/ext/mysqli/tests   001.phpt 
  Log:
  All the upcoming changes in the 0*.phpt files are pretty much the same. I'll
  describe them only once in with a bit of detail.
  
  1) Correct Whitespace (space vs. tab) if need be
  2) Recall: you get the connection parameter from connect.inc, no DB name, no
 port no other connection parameter in any of the tests!
  3) At the end of each test you find a print 'done!' or similar. This is
 most helpful to detect crashing/segfaulting tests with all run-tests.php
 versions.
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/001.phpt?r1=1.7r2=1.8diff_format=u
Index: php-src/ext/mysqli/tests/001.phpt
diff -u php-src/ext/mysqli/tests/001.phpt:1.7 
php-src/ext/mysqli/tests/001.phpt:1.8
--- php-src/ext/mysqli/tests/001.phpt:1.7   Tue Sep 26 13:06:13 2006
+++ php-src/ext/mysqli/tests/001.phpt   Thu Jul 12 20:28:25 2007
@@ -7,41 +7,54 @@
 ?php
include connect.inc;
 
-   $dbname = test;
$test = ;
 
/*** test mysqli_connect localhost:port ***/
-   $link = mysqli_connect($host, $user, $passwd, , 3306);
+   $link = mysqli_connect($host, $user, $passwd, , $port, $socket);
$test .= ($link) ? 1 : 0;
mysqli_close($link);
 
/*** test mysqli_real_connect ***/
-   $link = mysqli_init();  
-   $test.= (mysqli_real_connect($link, $host, $user, $passwd)) 
+   $link = mysqli_init();
+   $test.= (mysqli_real_connect($link, $host, $user, $passwd, , $port, 
$socket) )
? 1 : 0;
mysqli_close($link);
 
/*** test mysqli_real_connect with db ***/
-   $link = mysqli_init();  
-   $test .= (mysqli_real_connect($link, $host, $user, $passwd, $dbname)) 
+   $link = mysqli_init();
+   $test .= (mysqli_real_connect($link, $host, $user, $passwd, $db, $port, 
$socket))
? 1 : 0;
mysqli_close($link);
 
/*** test mysqli_real_connect with port ***/
-   $link = mysqli_init();  
-   $test .= (mysqli_real_connect($link, $host, $user, $passwd, $dbname, 
3306))
+   $link = mysqli_init();
+   $test .= (mysqli_real_connect($link, $host, $user, $passwd, $db, $port, 
$socket))
? 1:0;
mysqli_close($link);
 
+   /* temporary addition for Kent's setup, Win32 box */
+   for ($i = 0; $i  10; $i++) {
+   if (!$link = mysqli_init())
+  printf([001 + %d] mysqli_init() failed, [%d] %s\n, $i, 
mysqli_connect_errno(), mysqli_connect_error());
+
+   if (!mysqli_real_connect($link, $host, $user, $passwd, $db, $port, 
$socket))
+  printf([002 + %d] mysqli_real_connect() failed, [%d] %s\n, $i, 
mysqli_connect_errno(), mysqli_connect_error());
+
+   mysqli_close($link);
+   }
+
/*** test mysqli_real_connect compressed ***/
-   $link = mysqli_init();  
-   $test .= (mysqli_real_connect($link, $host, $user, $passwd, $dbname, 0, 
NULL, MYSQLI_CLIENT_COMPRESS)) 
+   /*
+   $link = mysqli_init();
+   $test .= (mysqli_real_connect($link, $host, $user, $passwd, $db, $port, 
$socket, MYSQLI_CLIENT_COMPRESS))
? 1 : 0;
mysqli_close($link);
-
+  */
/* todo ssl connections */
 
var_dump($test);
+   print done!;
 ?
 --EXPECTF--
-%s(5) 1
+%s(4) 
+done!
\ No newline at end of file

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



[PHP-CVS] cvs: php-src /ext/mysqli/tests 003.phpt 004.phpt

2007-07-12 Thread Ulf Wendel
uw  Thu Jul 12 20:34:50 2007 UTC

  Modified files:  
/php-src/ext/mysqli/tests   003.phpt 004.phpt 
  Log:
  Pretty much the same cosmetics and tweaking as before (proper UEXPECTF, 
  done! at the end to detect crashes, connection parameter tweaking, ...) -
  plus: check return codes even if failures are unlikely.
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/003.phpt?r1=1.7r2=1.8diff_format=u
Index: php-src/ext/mysqli/tests/003.phpt
diff -u php-src/ext/mysqli/tests/003.phpt:1.7 
php-src/ext/mysqli/tests/003.phpt:1.8
--- php-src/ext/mysqli/tests/003.phpt:1.7   Tue Sep 26 13:06:13 2006
+++ php-src/ext/mysqli/tests/003.phpt   Thu Jul 12 20:34:50 2007
@@ -7,29 +7,35 @@
include connect.inc;

/*** test mysqli_connect 127.0.0.1 ***/
-   $link = mysqli_connect($host, $user, $passwd, test);
+   $link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
 
mysqli_query($link, SET sql_mode='');

-   mysqli_query($link,DROP TABLE IF EXISTS test_bind_result);
-   mysqli_query($link,CREATE TABLE test_bind_result(c1 date, c2 time, 
-c3 timestamp(14), 
-c4 year, 
-c5 datetime, 
-c6 timestamp(4), 
-c7 timestamp(6)));
-
-   mysqli_query($link,INSERT INTO test_bind_result VALUES('2002-01-02',
-  '12:49:00',
-  '2002-01-02 
17:46:59', 
-  2010,
-  '2010-07-10', 
-  
'2020','1999-12-29'));
+   if (!mysqli_query($link,DROP TABLE IF EXISTS test_bind_result))
+   printf([001] [%d] %s\n, mysqli_errno($link), 
mysqli_error($link));
 
+   $rc = mysqli_query($link,CREATE TABLE test_bind_result(c1 date, c2 
time, 
+   
c3 timestamp(14), 
+   
c4 year, 
+   
c5 datetime, 
+   
c6 timestamp(4), 
+   
c7 timestamp(6)) ENGINE= . $engine);
+
+   if (!$rc)
+   printf([002] [%d] %s\n, mysqli_errno($link), 
mysqli_error($link));
+
+   $rc = mysqli_query($link, INSERT INTO test_bind_result 
VALUES('2002-01-02',
+   
'12:49:00',
+   
'2002-01-02 17:46:59', 
+   
2010,
+   
'2010-07-10', 
+   
'2020','1999-12-29'));
+   if (!$rc)
+   printf([003] [%d] %s\n, mysqli_errno($link), 
mysqli_error($link));
 
$stmt = mysqli_prepare($link, SELECT * FROM test_bind_result);
-   mysqli_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7);
-   mysqli_execute($stmt);
+   mysqli_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7);
+   mysqli_execute($stmt);
mysqli_fetch($stmt);
 
$test = array($c1,$c2,$c3,$c4,$c5,$c6,$c7);
@@ -38,21 +44,41 @@
 
mysqli_stmt_close($stmt);
mysqli_close($link);
+   print done!;
 ?
 --EXPECTF--
 array(7) {
   [0]=
-  %s(10) 2002-01-02
+  string(10) 2002-01-02
   [1]=
-  %s(8) 12:49:00
+  string(8) 12:49:00
   [2]=
-  %s(19) 2002-01-02 17:46:59
+  string(19) 2002-01-02 17:46:59
   [3]=
   int(2010)
   [4]=
-  %s(19) 2010-07-10 00:00:00
+  string(19) 2010-07-10 00:00:00
   [5]=
-  %s(19) -00-00 00:00:00
+  string(19) -00-00 00:00:00
   [6]=
-  %s(19) 1999-12-29 00:00:00
+  string(19) 1999-12-29 00:00:00
 }
+done!
+--UEXPECTF--
+array(7) {
+  [0]=
+  unicode(10) 2002-01-02
+  [1]=
+  unicode(8) 12:49:00
+  [2]=
+  unicode(19) 2002-01-02 17:46:59
+  [3]=
+  int(2010)
+  [4]=
+  unicode(19) 2010-07-10 00:00:00
+  [5]=
+  

[PHP-CVS] cvs: php-src /ext/mysqli/tests 005.phpt 006.phpt 007.phpt 008.phpt 009.phpt

2007-07-12 Thread Ulf Wendel
uw  Thu Jul 12 20:38:26 2007 UTC

  Modified files:  
/php-src/ext/mysqli/tests   005.phpt 006.phpt 007.phpt 008.phpt 
009.phpt 
  Log:
  The usual tweaking:
  
   - take connection parameter from connect.inc
   - use proper UEXPECTF
   - have 'print done!' or similar at the end to detect crashes
   - whitespace changes where needed
   - take care of portability: PHP 5 vs. PHP 5, MySQL 4.1 - 6.0
  
  
  http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/005.phpt?r1=1.5r2=1.6diff_format=u
Index: php-src/ext/mysqli/tests/005.phpt
diff -u php-src/ext/mysqli/tests/005.phpt:1.5 
php-src/ext/mysqli/tests/005.phpt:1.6
--- php-src/ext/mysqli/tests/005.phpt:1.5   Tue Sep 26 13:06:13 2006
+++ php-src/ext/mysqli/tests/005.phpt   Thu Jul 12 20:38:26 2007
@@ -7,12 +7,13 @@
include connect.inc;

/*** test mysqli_connect 127.0.0.1 ***/
-   $link = mysqli_connect($host, $user, $passwd);
+   $link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
 
-   mysqli_select_db($link, test);
-
-   mysqli_query($link,DROP TABLE IF EXISTS test_bind_fetch);
-   mysqli_query($link,CREATE TABLE test_bind_fetch(c1 char(10), c2 
text));
+   if (!mysqli_query($link, DROP TABLE IF EXISTS test_bind_fetch))
+   printf([001] [%d] %s\n, mysqli_errno($link), 
mysqli_error($link));
+   
+   if (!mysqli_query($link, CREATE TABLE test_bind_fetch(c1 char(10), c2 
text) ENGINE= . $engine))
+   printf([002] [%d] %s\n, mysqli_errno($link), 
mysqli_error($link));
 
$a = str_repeat(A1, 32000);
 
@@ -30,11 +31,21 @@
 
mysqli_stmt_close($stmt);
mysqli_close($link);
+   print done!;
 ?
 --EXPECTF--
 array(2) {
   [0]=
-  %s(10) 1234567890
+  string(10) 1234567890
+  [1]=
+  string(13) 32K String ok
+}
+done!
+--UEXPECTF--
+array(2) {
+  [0]=
+  unicode(10) 1234567890
   [1]=
-  %s(13) 32K String ok
+  unicode(13) 32K String ok
 }
+done!
\ No newline at end of file
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/006.phpt?r1=1.5r2=1.6diff_format=u
Index: php-src/ext/mysqli/tests/006.phpt
diff -u php-src/ext/mysqli/tests/006.phpt:1.5 
php-src/ext/mysqli/tests/006.phpt:1.6
--- php-src/ext/mysqli/tests/006.phpt:1.5   Wed Jan  4 23:04:06 2006
+++ php-src/ext/mysqli/tests/006.phpt   Thu Jul 12 20:38:26 2007
@@ -5,23 +5,28 @@
 --FILE--
 ?php
include connect.inc;
-   
+
/*** test mysqli_connect 127.0.0.1 ***/
-   $link = mysqli_connect($host, $user, $passwd);
+   $link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
+
+   if (!mysqli_query($link, SET sql_mode=''))
+   printf([001] [%d] %s\n, mysqli_errno($link), 
mysqli_error($link));
 
-   mysqli_select_db($link, test);
-   mysqli_query($link, SET sql_mode='');
+   if (!mysqli_query($link,DROP TABLE IF EXISTS test_bind_fetch))
+   printf([002] [%d] %s\n, mysqli_errno($link), 
mysqli_error($link));
 
-   mysqli_query($link,DROP TABLE IF EXISTS test_bind_fetch);
-   mysqli_query($link,CREATE TABLE test_bind_fetch(c1 int unsigned,
- c2 int unsigned,
- c3 int,
- c4 int,
- c5 int,
- c6 int unsigned,
- c7 int));
+   $rc = mysqli_query($link,CREATE TABLE test_bind_fetch(c1 int unsigned,
+   
c2 int unsigned,
+   
c3 int,
+   
c4 int,
+   
c5 int,
+   
c6 int unsigned,
+   
c7 int) ENGINE= . $engine);
+   if (!$rc)
+   printf([003] [%d] %s\n, mysqli_errno($link), 
mysqli_error($link));
 
-   mysqli_query($link, INSERT INTO test_bind_fetch VALUES 
(-23,35999,NULL,-500,-999,-0,0));
+   if (!mysqli_query($link, INSERT INTO test_bind_fetch VALUES 
(-23,35999,NULL,-500,-999,-0,0)))
+   printf([004] [%d] %s\n, mysqli_errno($link), 
mysqli_error($link));
 
$stmt = mysqli_prepare($link, SELECT * FROM test_bind_fetch);
mysqli_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7);
@@ -34,6 +39,7 @@
 
mysqli_stmt_close($stmt);
mysqli_close($link);
+   print done!;
 

[PHP-CVS] cvs: php-src /ext/mysqli/tests 010.phpt 011.phpt 012.phpt 013.phpt 014.phpt 015.phpt 016.phpt 017.phpt 018.phpt 019.phpt

2007-07-12 Thread Ulf Wendel
uw  Thu Jul 12 20:42:48 2007 UTC

  Modified files:  
/php-src/ext/mysqli/tests   010.phpt 011.phpt 012.phpt 013.phpt 
014.phpt 015.phpt 016.phpt 017.phpt 
018.phpt 019.phpt 
  Log:
  Next 10 in row to be tweaked:
  
 - take connection parameter from connect.inc
 - use proper UEXPECTF
 - have 'print done!' or similar at the end to detect crashes
 - whitespace changes where needed
 - take care of portability: PHP 5 vs. PHP 5, MySQL 4.1 - 6.0
 - understand return value checking as sometime that makes you type
   more when you write but makes you happy when you debug
  
  
  http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/010.phpt?r1=1.6r2=1.7diff_format=u
Index: php-src/ext/mysqli/tests/010.phpt
diff -u php-src/ext/mysqli/tests/010.phpt:1.6 
php-src/ext/mysqli/tests/010.phpt:1.7
--- php-src/ext/mysqli/tests/010.phpt:1.6   Wed Jan  4 23:04:06 2006
+++ php-src/ext/mysqli/tests/010.phpt   Thu Jul 12 20:42:48 2007
@@ -9,20 +9,23 @@
include connect.inc;

/*** test mysqli_connect 127.0.0.1 ***/
-   $link = mysqli_connect($host, $user, $passwd);
+   $link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
 
-   mysqli_select_db($link, test);
-   mysqli_query($link, SET sql_mode='');
+   if (!mysqli_query($link, SET sql_mode=''))
+   printf([001] [%d] %s\n, mysqli_errno($link), 
mysqli_error($link));
 
-   mysqli_query($link,DROP TABLE IF EXISTS test_bind_fetch);
-
-   mysqli_query($link,CREATE TABLE test_bind_fetch(c1 float(3),
- c2 float,
- c3 float unsigned,
- c4 float,
- c5 float,
- c6 float,
- c7 float(10) unsigned));
+   if (!mysqli_query($link, DROP TABLE IF EXISTS test_bind_fetch))
+   printf([002] [%d] %s\n, mysqli_errno($link), 
mysqli_error($link));
+   
+   $rc = mysqli_query($link, CREATE TABLE test_bind_fetch(c1 float(3),
+   
 c2 float,
+   
 c3 float unsigned,
+   
 c4 float,
+   
 c5 float,
+   
 c6 float,  
+   
 c7 float(10) unsigned) ENGINE= . $engine);
+   if (!$rc)
+   printf([003] [%d] %s\n, mysqli_errno($link), 
mysqli_error($link));
 
 
mysqli_query($link, INSERT INTO test_bind_fetch (c1,c2,c3,c4,c5,c6,c7) 
VALUES (3.1415926535,-0.01, -5, ,
@@ -39,6 +42,7 @@
 
mysqli_stmt_close($stmt);
mysqli_close($link);
+   print done!;
 ?
 --EXPECT--
 array(7) {
@@ -57,3 +61,4 @@
   [6]=
   float(88914608000)
 }
+done!
\ No newline at end of file
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/011.phpt?r1=1.6r2=1.7diff_format=u
Index: php-src/ext/mysqli/tests/011.phpt
diff -u php-src/ext/mysqli/tests/011.phpt:1.6 
php-src/ext/mysqli/tests/011.phpt:1.7
--- php-src/ext/mysqli/tests/011.phpt:1.6   Tue Sep 26 13:06:13 2006
+++ php-src/ext/mysqli/tests/011.phpt   Thu Jul 12 20:42:48 2007
@@ -9,21 +9,25 @@
include connect.inc;

/*** test mysqli_connect 127.0.0.1 ***/
-   $link = mysqli_connect($host, $user, $passwd);
+   $link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
 
-   mysqli_select_db($link, test);
+   if (!mysqli_query($link, DROP TABLE IF EXISTS test_bind_result))
+   printf([001] [%d] %s\n, mysqli_errno($link), 
mysqli_error($link));
 
-   mysqli_query($link,DROP TABLE IF EXISTS test_bind_result);
-
-   mysqli_query($link,CREATE TABLE test_bind_result(c1 tinyint, c2 
smallint, 
-c3 int, c4 bigint, 
-c5 float, c6 double,
-c7 varbinary(10), 
-c8 varchar(50)));
-
-   mysqli_query($link,INSERT INTO test_bind_result 
VALUES(19,2999,3999,499,
-  
2345.6,5678.89563,
-  

[PHP-CVS] cvs: php-src /ext/mysqli/tests 020.phpt 021.phpt 022.phpt 023.phpt 024.phpt 025.phpt 026.phpt 027.phpt 028.phpt 029.phpt

2007-07-12 Thread Ulf Wendel
uw  Thu Jul 12 20:49:29 2007 UTC

  Modified files:  
/php-src/ext/mysqli/tests   020.phpt 021.phpt 022.phpt 023.phpt 
024.phpt 025.phpt 026.phpt 027.phpt 
028.phpt 029.phpt 
  Log:
  I forgot to mention: some will fail. In particular in unicode mode.
  
  Next 10 in row to be tweaked:

   - take connection parameter from connect.inc
   - use proper UEXPECTF
   - have 'print done!' or similar at the end to detect crashes
   - whitespace changes where needed
   - take care of portability: PHP 5 vs. PHP 5, MySQL 4.1 - 6.0
   - understand return value checking as sometime that makes you type
 more when you write but makes you happy when you debug
  
  
  http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/020.phpt?r1=1.8r2=1.9diff_format=u
Index: php-src/ext/mysqli/tests/020.phpt
diff -u php-src/ext/mysqli/tests/020.phpt:1.8 
php-src/ext/mysqli/tests/020.phpt:1.9
--- php-src/ext/mysqli/tests/020.phpt:1.8   Tue Sep 26 13:06:13 2006
+++ php-src/ext/mysqli/tests/020.phpt   Thu Jul 12 20:49:29 2007
@@ -4,27 +4,30 @@
 ?php require_once('skipif.inc'); ?
 --FILE--
 ?php
+   /* NOTE: There's an option in mysqlnd which controls if data and
+   time are returned as unicode or not. Consider this if you consider
+   adding a UEXPECTF to the test. */
 
include connect.inc;
-   
+
/*** test mysqli_connect 127.0.0.1 ***/
-   $link = mysqli_connect($host, $user, $passwd);
+   $link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
 
-   mysqli_select_db($link, test);
+   mysqli_select_db($link, $db);
mysqli_query($link, SET sql_mode='');
-   
+
mysqli_query($link,DROP TABLE IF EXISTS test_bind_result);
-   mysqli_query($link,CREATE TABLE test_bind_result(c1 date, c2 time, 
-c3 timestamp(14), 
-c4 year, 
-c5 datetime, 
-c6 timestamp(4), 
+   mysqli_query($link,CREATE TABLE test_bind_result(c1 date, c2 time,
+c3 timestamp(14),
+c4 year,
+c5 datetime,
+c6 timestamp(4),
 c7 timestamp(6)));
 
$stmt = mysqli_prepare($link, INSERT INTO test_bind_result VALUES 
(?,?,?,?,?,?,?));
mysqli_bind_param($stmt, sss, $d1, $d2, $d3, $d4, $d5, $d6, $d7);
 
-   $d1 = 2002-01-02;
+   $d1 = 2002-01-02;
$d2 = 12:49:00;
$d3 = 2002-01-02 17:46:59;
$d4 = 2010;
@@ -37,9 +40,9 @@
 
$stmt = mysqli_prepare($link, SELECT * FROM test_bind_result);
 
-   mysqli_bind_result($stmt,$c1, $c2, $c3, $c4, $c5, $c6, $c7);
-   
-   mysqli_execute($stmt);
+   mysqli_bind_result($stmt,$c1, $c2, $c3, $c4, $c5, $c6, $c7);
+
+   mysqli_execute($stmt);
mysqli_fetch($stmt);
 
$test = array($c1,$c2,$c3,$c4,$c5,$c6,$c7);
@@ -48,6 +51,8 @@
 
mysqli_stmt_close($stmt);
mysqli_close($link);
+
+   print done!;
 ?
 --EXPECTF--
 array(7) {
@@ -66,3 +71,4 @@
   [6]=
   %s(19) 1999-12-29 00:00:00
 }
+done!
\ No newline at end of file
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/021.phpt?r1=1.6r2=1.7diff_format=u
Index: php-src/ext/mysqli/tests/021.phpt
diff -u php-src/ext/mysqli/tests/021.phpt:1.6 
php-src/ext/mysqli/tests/021.phpt:1.7
--- php-src/ext/mysqli/tests/021.phpt:1.6   Tue Sep 26 13:06:13 2006
+++ php-src/ext/mysqli/tests/021.phpt   Thu Jul 12 20:49:29 2007
@@ -1,18 +1,18 @@
 --TEST--
-mysqli bind_param+bind_result char/text 
+mysqli bind_param+bind_result char/text
 --SKIPIF--
 ?php require_once('skipif.inc'); ?
 --FILE--
 ?php
include connect.inc;
-   
+
/*** test mysqli_connect 127.0.0.1 ***/
-   $link = mysqli_connect($host, $user, $passwd);
+   $link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
 
-   mysqli_select_db($link, test);
+   mysqli_select_db($link, $db);
 
-   mysqli_query($link,DROP TABLE IF EXISTS test_bind_fetch);
-   mysqli_query($link,CREATE TABLE test_bind_fetch(c1 char(10), c2 
text));
+   mysqli_query($link,DROP TABLE IF EXISTS test_bind_fetch);
+   mysqli_query($link,CREATE TABLE test_bind_fetch(c1 char(10), c2 
text));
 
$stmt = mysqli_prepare($link, INSERT INTO test_bind_fetch VALUES 
(?,?));
mysqli_bind_param($stmt, ss, $q1, $q2);
@@ -32,11 +32,21 @@
 
mysqli_stmt_close($stmt);
mysqli_close($link);
+   print done!;
 ?
 --EXPECTF--
 array(2) {
   [0]=
-  %s(10) 1234567890
+  string(10) 1234567890

[PHP-CVS] cvs: php-src /ext/mysqli/tests 030.phpt 031.phpt 032.phpt 033.phpt 034.phpt 035.phpt 036.phpt 037.phpt 038.phpt 039.phpt

2007-07-12 Thread Ulf Wendel
uw  Thu Jul 12 20:53:05 2007 UTC

  Modified files:  
/php-src/ext/mysqli/tests   030.phpt 031.phpt 032.phpt 033.phpt 
034.phpt 035.phpt 036.phpt 037.phpt 
038.phpt 039.phpt 
  Log:
  Connection parameter should be taken from connect.inc and used all in
  mysqli_connect() and friends. Use UEXPECTF instead of crippled EXPECTF.
  
  http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/030.phpt?r1=1.3r2=1.4diff_format=u
Index: php-src/ext/mysqli/tests/030.phpt
diff -u php-src/ext/mysqli/tests/030.phpt:1.3 
php-src/ext/mysqli/tests/030.phpt:1.4
--- php-src/ext/mysqli/tests/030.phpt:1.3   Sat Dec  4 08:50:33 2004
+++ php-src/ext/mysqli/tests/030.phpt   Thu Jul 12 20:53:05 2007
@@ -7,19 +7,21 @@
include connect.inc;
 
/*** test mysqli_connect 127.0.0.1 ***/
-   $link = mysqli_connect($host, $user, $passwd);
+   $link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
$errno = mysqli_errno($link);
var_dump($errno);
 
mysqli_select_db($link, test);
 
mysqli_query($link, select * from non_exisiting_table);
-   $errno = mysqli_errno($link);   
+   $errno = mysqli_errno($link);
 
var_dump($errno);
 
mysqli_close($link);
+   print done!;
 ?
 --EXPECT--
 int(0)
 int(1146)
+done!
\ No newline at end of file
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/031.phpt?r1=1.4r2=1.5diff_format=u
Index: php-src/ext/mysqli/tests/031.phpt
diff -u php-src/ext/mysqli/tests/031.phpt:1.4 
php-src/ext/mysqli/tests/031.phpt:1.5
--- php-src/ext/mysqli/tests/031.phpt:1.4   Tue Sep 26 13:06:13 2006
+++ php-src/ext/mysqli/tests/031.phpt   Thu Jul 12 20:53:05 2007
@@ -7,19 +7,25 @@
include connect.inc;
 
/*** test mysqli_connect 127.0.0.1 ***/
-   $link = mysqli_connect($host, $user, $passwd);
+   $link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
$error = mysqli_error($link);
var_dump($error);
 
-   mysqli_select_db($link, test);
+   mysqli_select_db($link, $db);
 
mysqli_query($link, select * from non_exisiting_table);
-   $error = mysqli_error($link);   
+   $error = mysqli_error($link);
 
var_dump($error);
 
mysqli_close($link);
+   print done!;
 ?
 --EXPECTF--
-%s(0) 
-%s(46) Table 'test.non_exisiting_table' doesn't exist
+string(0) 
+string(%d) %s
+done!
+--UEXPECTF--
+unicode(0) 
+unicode(%d) %s
+done!
\ No newline at end of file
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/032.phpt?r1=1.4r2=1.5diff_format=u
Index: php-src/ext/mysqli/tests/032.phpt
diff -u php-src/ext/mysqli/tests/032.phpt:1.4 
php-src/ext/mysqli/tests/032.phpt:1.5
--- php-src/ext/mysqli/tests/032.phpt:1.4   Tue Sep 26 13:06:13 2006
+++ php-src/ext/mysqli/tests/032.phpt   Thu Jul 12 20:53:05 2007
@@ -5,11 +5,11 @@
 --FILE--
 ?php
include connect.inc;
-   
+
/*** test mysqli_connect 127.0.0.1 ***/
-   $link = mysqli_connect($host, $user, $passwd);
+   $link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
 
-   mysqli_select_db($link, test);
+   mysqli_select_db($link, $db);
 
mysqli_query($link, drop table if exists general_test);
mysqli_query($link, create table general_test (a int));
@@ -20,6 +20,11 @@
var_dump($afc);
 
mysqli_close($link);
+   print done!;
 ?
 --EXPECTF--
-%s(38) Records: 3  Duplicates: 0  Warnings: 0
+string(38) Records: 3  Duplicates: 0  Warnings: 0
+done!
+--UEXPECTF--
+unicode(38) Records: 3  Duplicates: 0  Warnings: 0
+done!
\ No newline at end of file
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/033.phpt?r1=1.5r2=1.6diff_format=u
Index: php-src/ext/mysqli/tests/033.phpt
diff -u php-src/ext/mysqli/tests/033.phpt:1.5 
php-src/ext/mysqli/tests/033.phpt:1.6
--- php-src/ext/mysqli/tests/033.phpt:1.5   Tue Apr 19 15:45:07 2005
+++ php-src/ext/mysqli/tests/033.phpt   Thu Jul 12 20:53:05 2007
@@ -6,15 +6,20 @@
 --FILE--
 ?php
include connect.inc;
-   
+
/*** test mysqli_connect 127.0.0.1 ***/
-   $link = mysqli_connect($host, $user, $passwd);
+   $link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
 
$hinfo = mysqli_get_host_info($link);
 
var_dump(str_replace('/','', $hinfo));
 
mysqli_close($link);
+   print done!;
 ?
 --EXPECTF--
 string(%d) %s via %s
+done!
+--UEXPECTF--
+unicode(%d) %s via %s
+done!
\ No newline at end of file
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/034.phpt?r1=1.4r2=1.5diff_format=u
Index: php-src/ext/mysqli/tests/034.phpt
diff -u php-src/ext/mysqli/tests/034.phpt:1.4 
php-src/ext/mysqli/tests/034.phpt:1.5
--- php-src/ext/mysqli/tests/034.phpt:1.4   Fri Jan  7 14:59:59 2005
+++ php-src/ext/mysqli/tests/034.phpt   Thu Jul 12 20:53:05 2007
@@ -6,15 +6,17 @@
 --FILE--
 ?php
include connect.inc;
-   
+
/*** test 

[PHP-CVS] cvs: php-src /ext/mysqli/tests 040.phpt 041.phpt 042.phpt 043.phpt 044.phpt 045.phpt 046.phpt 047.phpt 048.phpt 049.phpt

2007-07-12 Thread Ulf Wendel
uw  Thu Jul 12 20:55:12 2007 UTC

  Modified files:  
/php-src/ext/mysqli/tests   040.phpt 041.phpt 042.phpt 043.phpt 
044.phpt 045.phpt 046.phpt 047.phpt 
048.phpt 049.phpt 
  Log:
  As usual:
  
   - connection parameter tweaking
   - a bit of whitespace here and there
   - use UEXPECTF if need be
  
  
  http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/040.phpt?r1=1.3r2=1.4diff_format=u
Index: php-src/ext/mysqli/tests/040.phpt
diff -u php-src/ext/mysqli/tests/040.phpt:1.3 
php-src/ext/mysqli/tests/040.phpt:1.4
--- php-src/ext/mysqli/tests/040.phpt:1.3   Sat Dec  4 08:50:33 2004
+++ php-src/ext/mysqli/tests/040.phpt   Thu Jul 12 20:55:12 2007
@@ -6,11 +6,11 @@
 ?php
 
include connect.inc;
-   
+
/*** test mysqli_connect 127.0.0.1 ***/
-   $link = mysqli_connect($host, $user, $passwd);
+   $link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
 
-   mysqli_select_db($link, test);
+   mysqli_select_db($link, $db);
 
mysqli_query($link, DROP TABLE IF EXISTS test_result);
 
@@ -28,6 +28,8 @@
var_dump($num);
 
mysqli_close($link);
+   print done!;
 ?
 --EXPECT--
 int(1)
+done!
\ No newline at end of file
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/041.phpt?r1=1.5r2=1.6diff_format=u
Index: php-src/ext/mysqli/tests/041.phpt
diff -u php-src/ext/mysqli/tests/041.phpt:1.5 
php-src/ext/mysqli/tests/041.phpt:1.6
--- php-src/ext/mysqli/tests/041.phpt:1.5   Fri Jul  8 08:53:25 2005
+++ php-src/ext/mysqli/tests/041.phpt   Thu Jul 12 20:55:12 2007
@@ -6,10 +6,10 @@
 ?php
 
include connect.inc;
-   
+
/*** test mysqli_connect 127.0.0.1 ***/
-   $link = mysqli_connect($host, $user, $passwd);
-   mysqli_select_db($link, test);
+   $link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
+   mysqli_select_db($link, $db);
 
mysqli_query($link, DROP TABLE IF EXISTS test_warnings);
mysqli_query($link, DROP TABLE IF EXISTS test_warnings);
@@ -17,6 +17,8 @@
var_dump(mysqli_warning_count($link));
 
mysqli_close($link);
+   print done!;
 ?
 --EXPECT--
 int(1)
+done!
\ No newline at end of file
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/042.phpt?r1=1.9r2=1.10diff_format=u
Index: php-src/ext/mysqli/tests/042.phpt
diff -u php-src/ext/mysqli/tests/042.phpt:1.9 
php-src/ext/mysqli/tests/042.phpt:1.10
--- php-src/ext/mysqli/tests/042.phpt:1.9   Tue Sep 26 13:06:13 2006
+++ php-src/ext/mysqli/tests/042.phpt   Thu Jul 12 20:55:12 2007
@@ -5,15 +5,15 @@
 --FILE--
 ?php
include connect.inc;
-   
+
/*** test mysqli_connect 127.0.0.1 ***/
-   $link = mysqli_connect($host, $user, $passwd);
+   $link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
 
-   mysqli_select_db($link, test);
+   mysqli_select_db($link, $db);
mysqli_query($link, SET sql_mode='');
 
-   mysqli_query($link,DROP TABLE IF EXISTS test_bind_fetch);
-   mysqli_query($link,CREATE TABLE test_bind_fetch(c1 smallint unsigned,
+   mysqli_query($link,DROP TABLE IF EXISTS test_bind_fetch);
+   mysqli_query($link,CREATE TABLE test_bind_fetch(c1 smallint unsigned,
  c2 smallint unsigned,
  c3 smallint,
  c4 smallint,
@@ -42,6 +42,7 @@
var_dump($test);
 
mysqli_close($link);
+   print done!
 ?
 --EXPECTF--
 object(stdClass)#%d (7) {
@@ -60,6 +61,7 @@
   [c7]=
   string(1) 0
 }
+done!
 --UEXPECTF--
 object(stdClass)#%d (7) {
   [uc1]=
@@ -77,3 +79,4 @@
   [uc7]=
   unicode(1) 0
 }
+done!
\ No newline at end of file
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/043.phpt?r1=1.6r2=1.7diff_format=u
Index: php-src/ext/mysqli/tests/043.phpt
diff -u php-src/ext/mysqli/tests/043.phpt:1.6 
php-src/ext/mysqli/tests/043.phpt:1.7
--- php-src/ext/mysqli/tests/043.phpt:1.6   Tue Sep 26 13:06:13 2006
+++ php-src/ext/mysqli/tests/043.phpt   Thu Jul 12 20:55:12 2007
@@ -5,14 +5,14 @@
 --FILE--
 ?php
include connect.inc;
-   
+
/*** test mysqli_connect 127.0.0.1 ***/
-   $link = mysqli_connect($host, $user, $passwd);
+   $link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
 
-   mysqli_select_db($link, test);
+   mysqli_select_db($link, $db);
 
-   mysqli_query($link,DROP TABLE IF EXISTS test_update);
-   mysqli_query($link,CREATE TABLE test_update(a varchar(10),
+   mysqli_query($link,DROP TABLE IF EXISTS test_update);
+   mysqli_query($link,CREATE TABLE test_update(a varchar(10),
  b int));
 
mysqli_query($link, INSERT INTO test_update VALUES ('foo', 2));
@@ -34,9 +34,17 @@
var_dump($test);
 
mysqli_close($link);
+   

[PHP-CVS] cvs: php-src /ext/mysqli/tests 050.phpt 051.phpt 052.phpt 053.phpt 054.phpt 055.phpt 056.phpt 057.phpt 058.phpt 059.phpt

2007-07-12 Thread Ulf Wendel
uw  Thu Jul 12 20:57:31 2007 UTC

  Modified files:  
/php-src/ext/mysqli/tests   050.phpt 051.phpt 052.phpt 053.phpt 
054.phpt 055.phpt 056.phpt 057.phpt 
058.phpt 059.phpt 
  Log:
  Will this never end?
 - connection parameter tweaking
 - a bit of whitespace here and there
 - use UEXPECTF if need be
  
  http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/050.phpt?r1=1.3r2=1.4diff_format=u
Index: php-src/ext/mysqli/tests/050.phpt
diff -u php-src/ext/mysqli/tests/050.phpt:1.3 
php-src/ext/mysqli/tests/050.phpt:1.4
--- php-src/ext/mysqli/tests/050.phpt:1.3   Sat Dec  4 08:50:33 2004
+++ php-src/ext/mysqli/tests/050.phpt   Thu Jul 12 20:57:30 2007
@@ -1,15 +1,15 @@
 --TEST--
-non freed statement test 
+non freed statement test
 --SKIPIF--
 ?php require_once('skipif.inc'); ?
 --FILE--
 ?php
include connect.inc;
-   
+
/
 * non freed stamement
 /
-   $link = mysqli_connect($host, $user, $passwd);
+   $link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
 
$stmt = mysqli_prepare($link, SELECT CURRENT_USER());
mysqli_execute($stmt);
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/051.phpt?r1=1.4r2=1.5diff_format=u
Index: php-src/ext/mysqli/tests/051.phpt
diff -u php-src/ext/mysqli/tests/051.phpt:1.4 
php-src/ext/mysqli/tests/051.phpt:1.5
--- php-src/ext/mysqli/tests/051.phpt:1.4   Sat Dec  4 08:50:33 2004
+++ php-src/ext/mysqli/tests/051.phpt   Thu Jul 12 20:57:30 2007
@@ -1,15 +1,15 @@
 --TEST--
-free statement after close 
+free statement after close
 --SKIPIF--
 ?php require_once('skipif.inc'); ?
 --FILE--
 ?php
include connect.inc;
-   
+
/
-* free statement after close 
+* free statement after close
 /
-   $link = mysqli_connect($host, $user, $passwd);
+   $link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
 
$stmt1 = mysqli_prepare($link, SELECT CURRENT_USER());
mysqli_execute($stmt1);
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/052.phpt?r1=1.4r2=1.5diff_format=u
Index: php-src/ext/mysqli/tests/052.phpt
diff -u php-src/ext/mysqli/tests/052.phpt:1.4 
php-src/ext/mysqli/tests/052.phpt:1.5
--- php-src/ext/mysqli/tests/052.phpt:1.4   Sat Dec  4 08:50:33 2004
+++ php-src/ext/mysqli/tests/052.phpt   Thu Jul 12 20:57:30 2007
@@ -9,7 +9,7 @@
/
 * statement call  after close 
 /
-   $link = mysqli_connect($host, $user, $passwd);
+   $link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
 
$stmt2 = mysqli_prepare($link, SELECT CURRENT_USER());
 
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/053.phpt?r1=1.3r2=1.4diff_format=u
Index: php-src/ext/mysqli/tests/053.phpt
diff -u php-src/ext/mysqli/tests/053.phpt:1.3 
php-src/ext/mysqli/tests/053.phpt:1.4
--- php-src/ext/mysqli/tests/053.phpt:1.3   Sat Dec  4 08:50:33 2004
+++ php-src/ext/mysqli/tests/053.phpt   Thu Jul 12 20:57:30 2007
@@ -9,7 +9,7 @@
/
 * non freed resultset 
 /
-   $link = mysqli_connect($host, $user, $passwd);
+   $link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
 
$result = mysqli_query($link, SELECT CURRENT_USER());
mysqli_close($link);
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/054.phpt?r1=1.3r2=1.4diff_format=u
Index: php-src/ext/mysqli/tests/054.phpt
diff -u php-src/ext/mysqli/tests/054.phpt:1.3 
php-src/ext/mysqli/tests/054.phpt:1.4
--- php-src/ext/mysqli/tests/054.phpt:1.3   Sat Dec  4 08:50:33 2004
+++ php-src/ext/mysqli/tests/054.phpt   Thu Jul 12 20:57:30 2007
@@ -9,7 +9,7 @@
/
 * free resultset after close 
 /
-   $link = mysqli_connect($host, $user, $passwd);
+   $link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
 
$result1 = mysqli_query($link, SELECT CURRENT_USER());
mysqli_close($link);
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/055.phpt?r1=1.3r2=1.4diff_format=u
Index: php-src/ext/mysqli/tests/055.phpt
diff -u php-src/ext/mysqli/tests/055.phpt:1.3 
php-src/ext/mysqli/tests/055.phpt:1.4
--- php-src/ext/mysqli/tests/055.phpt:1.3   Sat Dec  4 08:50:33 2004
+++ php-src/ext/mysqli/tests/055.phpt   Thu Jul 12 20:57:30 2007
@@ -9,7 +9,7 @@
/
 * don't free anything 
 /
-   $link = mysqli_connect($host, $user, $passwd);
+   $link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
 
$result2 = mysqli_query($link, SELECT CURRENT_USER());
$stmt2 = mysqli_prepare($link, SELECT CURRENT_USER());

[PHP-CVS] cvs: php-src /ext/mysqli/tests 060.phpt 061.phpt 062.phpt 063.phpt 064.phpt 065.phpt 066.phpt 067.phpt 068.phpt 069.phpt 070.phpt 071.phpt 072.phpt 073.phpt 074.phpt

2007-07-12 Thread Ulf Wendel
uw  Thu Jul 12 21:02:22 2007 UTC

  Modified files:  
/php-src/ext/mysqli/tests   060.phpt 061.phpt 062.phpt 063.phpt 
064.phpt 065.phpt 066.phpt 067.phpt 
068.phpt 069.phpt 070.phpt 071.phpt 
072.phpt 073.phpt 074.phpt 
  Log:
  The last bunch of changes to the old 0*.phpt tests. Once final time a 
  verbose explanation of changes:
  
   - take connection parameter from connect.inc
   - use proper UEXPECTF
   - have 'print done!' or similar at the end to detect crashes
   - whitespace changes where needed
   - take care of portability: PHP 5 vs. PHP 5, MySQL 4.1 - 6.0
   - understand return value checking as sometime that makes you type
 more when you write but makes you happy when you debug
  
  
  http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/060.phpt?r1=1.5r2=1.6diff_format=u
Index: php-src/ext/mysqli/tests/060.phpt
diff -u php-src/ext/mysqli/tests/060.phpt:1.5 
php-src/ext/mysqli/tests/060.phpt:1.6
--- php-src/ext/mysqli/tests/060.phpt:1.5   Tue Sep 26 13:06:13 2006
+++ php-src/ext/mysqli/tests/060.phpt   Thu Jul 12 21:02:21 2007
@@ -5,21 +5,21 @@
 --FILE--
 ?php
include connect.inc;
-   
+
class test_class {
function __construct($arg1, $arg2) {
echo __METHOD__ . ($arg1,$arg2)\n;
}
}
-   
+
/*** test mysqli_connect 127.0.0.1 ***/
-   $link = mysqli_connect($host, $user, $passwd);
+   $link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
 
-   mysqli_select_db($link, test);
+   mysqli_select_db($link, $db);
mysqli_query($link, SET sql_mode='');
 
-   mysqli_query($link,DROP TABLE IF EXISTS test_fetch);
-   mysqli_query($link,CREATE TABLE test_fetch(c1 smallint unsigned,
+   mysqli_query($link,DROP TABLE IF EXISTS test_fetch);
+   mysqli_query($link,CREATE TABLE test_fetch(c1 smallint unsigned,
  c2 smallint unsigned,
  c3 smallint,
  c4 smallint,
@@ -27,16 +27,16 @@
  c6 smallint unsigned,
  c7 smallint));
 
-   mysqli_query($link, INSERT INTO test_fetch VALUES ( -23, 35999, NULL, 
-500, -999, -0, 0)); 
+   mysqli_query($link, INSERT INTO test_fetch VALUES ( -23, 35999, NULL, 
-500, -999, -0, 0));
 
-   $result = mysqli_query($link, SELECT * FROM test_bind_fetch);
+   $result = mysqli_query($link, SELECT * FROM test_fetch);
$test = mysqli_fetch_object($result, 'test_class', array(1, 2));
mysqli_free_result($result);
 
var_dump($test);
 
mysqli_close($link);
-   
+
echo Done\n;
 ?
 --EXPECTF--
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/061.phpt?r1=1.6r2=1.7diff_format=u
Index: php-src/ext/mysqli/tests/061.phpt
diff -u php-src/ext/mysqli/tests/061.phpt:1.6 
php-src/ext/mysqli/tests/061.phpt:1.7
--- php-src/ext/mysqli/tests/061.phpt:1.6   Tue Sep 26 13:06:13 2006
+++ php-src/ext/mysqli/tests/061.phpt   Thu Jul 12 21:02:21 2007
@@ -10,34 +10,49 @@
$buffer = strrev(fread($fp, $buflen));
return(strlen($buffer));
}
-   
+
/*** test mysqli_connect 127.0.0.1 ***/
-   $link = mysqli_connect($host, $user, $passwd, test);
+   $link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
 
/* create temporary file */
$filename = dirname(__FILE__) . 061.csv;
$fp = fopen($filename, w);
-   @fwrite($fp, foo;bar);
+   fwrite($fp, bfoo;bar);
fclose($fp);
 
-   mysqli_query($link,DROP TABLE IF EXISTS t_061);
-   mysqli_query($link,CREATE TABLE t_061 (c1 varchar(10), c2 
varchar(10)));
+   if (!mysqli_query($link,DROP TABLE IF EXISTS t_061))
+   printf(Cannot drop table: [%d] %s\n, mysqli_errno($link), 
mysqli_error($link));
+   if (!mysqli_query($link,CREATE TABLE t_061 (c1 varchar(10), c2 
varchar(10
+   printf(Cannot create table: [%d] %s\n, mysqli_errno($link), 
mysqli_error($link));
 
-   mysqli_query($link, LOAD DATA LOCAL INFILE '{$filename}' INTO TABLE 
t_061 FIELDS TERMINATED BY ';'); 
+   if (!mysqli_query($link, sprintf(LOAD DATA LOCAL INFILE '%s' INTO 
TABLE t_061 FIELDS TERMINATED BY ';', mysqli_real_escape_string($link, 
$filename
+   printf(Cannot load data: [%d] %s\n, mysqli_errno($link), 
mysqli_error($link));
 
mysqli_set_local_infile_handler($link, my_read);
-   mysqli_query($link, LOAD DATA LOCAL INFILE '{$filename}' INTO TABLE 
t_061 FIELDS TERMINATED BY ';'); 
+   if (!mysqli_query($link, sprintf(LOAD DATA LOCAL INFILE '%s' INTO 
TABLE t_061 FIELDS TERMINATED BY 

[PHP-CVS] cvs: php-src(PHP_5_2) /ext/reflection/tests reflectionObject_FileInfo_basic.phpt reflectionObject_FileInfo_error.phpt reflectionObject_constructor_basic.phpt reflectionObject_constructor_err

2007-07-12 Thread Zoe Slattery
zoe Thu Jul 12 21:03:39 2007 UTC

  Added files: (Branch: PHP_5_2)
/php-src/ext/reflection/tests   reflectionObject_FileInfo_error.phpt 

reflectionObject_getConstructor_basic.phpt 

reflectionObject_isInstantiable_error.phpt 
reflectionObject_constructor_basic.phpt 
reflectionObject_getConstant_basic.phpt 
reflectionObject_isInternal_basic.phpt 
reflectionObject_getName_error.phpt 
reflectionObject_FileInfo_basic.phpt 

reflectionObject_isInstantiable_basic.phpt 
reflectionObject_getName_basic.phpt 

reflectionObject_isInstantiable_variation.phpt 

reflectionObject_isSubclassOf_error.phpt 

reflectionObject_getConstants_error.phpt 
reflectionObject_getName_error1.phpt 

reflectionObject_isSubclassOf_basic.phpt 
reflectionObject_isInstance_error.phpt 

reflectionObject_getConstants_basic.phpt 

reflectionObject_isUserDefined_error.phpt 

reflectionObject_getConstructor_error.phpt 
reflectionObject_isInstance_basic.phpt 

reflectionObject_isUserDefined_basic.phpt 
reflectionObject_constructor_error.phpt 
reflectionObject_getConstant_error.phpt 
reflectionObject_isInternal_error.phpt 
  Log:
  reflectionObject tests
  

http://cvs.php.net/viewvc.cgi/php-src/ext/reflection/tests/reflectionObject_FileInfo_error.phpt?view=markuprev=1.1
Index: php-src/ext/reflection/tests/reflectionObject_FileInfo_error.phpt
+++ php-src/ext/reflection/tests/reflectionObject_FileInfo_error.phpt

http://cvs.php.net/viewvc.cgi/php-src/ext/reflection/tests/reflectionObject_getConstructor_basic.phpt?view=markuprev=1.1
Index: php-src/ext/reflection/tests/reflectionObject_getConstructor_basic.phpt
+++ php-src/ext/reflection/tests/reflectionObject_getConstructor_basic.phpt

http://cvs.php.net/viewvc.cgi/php-src/ext/reflection/tests/reflectionObject_isInstantiable_error.phpt?view=markuprev=1.1
Index: php-src/ext/reflection/tests/reflectionObject_isInstantiable_error.phpt
+++ php-src/ext/reflection/tests/reflectionObject_isInstantiable_error.phpt

http://cvs.php.net/viewvc.cgi/php-src/ext/reflection/tests/reflectionObject_constructor_basic.phpt?view=markuprev=1.1
Index: php-src/ext/reflection/tests/reflectionObject_constructor_basic.phpt
+++ php-src/ext/reflection/tests/reflectionObject_constructor_basic.phpt

http://cvs.php.net/viewvc.cgi/php-src/ext/reflection/tests/reflectionObject_getConstant_basic.phpt?view=markuprev=1.1
Index: php-src/ext/reflection/tests/reflectionObject_getConstant_basic.phpt
+++ php-src/ext/reflection/tests/reflectionObject_getConstant_basic.phpt

http://cvs.php.net/viewvc.cgi/php-src/ext/reflection/tests/reflectionObject_isInternal_basic.phpt?view=markuprev=1.1
Index: php-src/ext/reflection/tests/reflectionObject_isInternal_basic.phpt
+++ php-src/ext/reflection/tests/reflectionObject_isInternal_basic.phpt

http://cvs.php.net/viewvc.cgi/php-src/ext/reflection/tests/reflectionObject_getName_error.phpt?view=markuprev=1.1
Index: php-src/ext/reflection/tests/reflectionObject_getName_error.phpt
+++ php-src/ext/reflection/tests/reflectionObject_getName_error.phpt

http://cvs.php.net/viewvc.cgi/php-src/ext/reflection/tests/reflectionObject_FileInfo_basic.phpt?view=markuprev=1.1
Index: php-src/ext/reflection/tests/reflectionObject_FileInfo_basic.phpt
+++ php-src/ext/reflection/tests/reflectionObject_FileInfo_basic.phpt

http://cvs.php.net/viewvc.cgi/php-src/ext/reflection/tests/reflectionObject_isInstantiable_basic.phpt?view=markuprev=1.1
Index: php-src/ext/reflection/tests/reflectionObject_isInstantiable_basic.phpt
+++ php-src/ext/reflection/tests/reflectionObject_isInstantiable_basic.phpt

http://cvs.php.net/viewvc.cgi/php-src/ext/reflection/tests/reflectionObject_getName_basic.phpt?view=markuprev=1.1
Index: php-src/ext/reflection/tests/reflectionObject_getName_basic.phpt
+++ php-src/ext/reflection/tests/reflectionObject_getName_basic.phpt

http://cvs.php.net/viewvc.cgi/php-src/ext/reflection/tests/reflectionObject_isInstantiable_variation.phpt?view=markuprev=1.1
Index: 
php-src/ext/reflection/tests/reflectionObject_isInstantiable_variation.phpt
+++ 

[PHP-CVS] cvs: php-src /ext/reflection/tests reflectionObject_FileInfo_basic.phpt reflectionObject_FileInfo_error.phpt reflectionObject_constructor_basic.phpt reflectionObject_constructor_error.phpt r

2007-07-12 Thread Zoe Slattery
zoe Thu Jul 12 21:08:02 2007 UTC

  Modified files:  
/php-src/ext/reflection/tests   reflectionObject_FileInfo_basic.phpt 

reflectionObject_isInstantiable_basic.phpt 

reflectionObject_isUserDefined_basic.phpt 
reflectionObject_constructor_error.phpt 
reflectionObject_getConstant_error.phpt 

reflectionObject_isInstantiable_variation.phpt 

reflectionObject_isSubclassOf_error.phpt 

reflectionObject_getConstants_error.phpt 
reflectionObject_constructor_basic.phpt 
reflectionObject_getConstant_basic.phpt 
reflectionObject_getName_error.phpt 
reflectionObject_getName_error1.phpt 

reflectionObject_isSubclassOf_basic.phpt 
reflectionObject_isInstance_error.phpt 

reflectionObject_getConstants_basic.phpt 
reflectionObject_getName_basic.phpt 

reflectionObject_getConstructor_error.phpt 
reflectionObject_isInstance_basic.phpt 
reflectionObject_isInternal_error.phpt 
reflectionObject_FileInfo_error.phpt 

reflectionObject_getConstructor_basic.phpt 

reflectionObject_isInstantiable_error.phpt 
reflectionObject_isInternal_basic.phpt 

reflectionObject_isUserDefined_error.phpt 
  Log:
  reflectionObject tests
  http://cvs.php.net/viewvc.cgi/php-src/ext/reflection/tests/reflectionObject_FileInfo_basic.phpt?r1=1.1r2=1.2diff_format=u
Index: php-src/ext/reflection/tests/reflectionObject_FileInfo_basic.phpt
diff -u /dev/null 
php-src/ext/reflection/tests/reflectionObject_FileInfo_basic.phpt:1.2
--- /dev/null   Thu Jul 12 21:08:02 2007
+++ php-src/ext/reflection/tests/reflectionObject_FileInfo_basic.phpt   Thu Jul 
12 21:08:01 2007
@@ -0,0 +1,32 @@
+--TEST--
+ReflectionObject::getFileName(), ReflectionObject::getStartLine(), 
ReflectionObject::getEndLine() - basic function
+--FILE-- 
+?php
+$rc = new ReflectionObject(new C);
+var_dump($rc-getFileName());
+var_dump($rc-getStartLine());
+var_dump($rc-getEndLine());
+
+$rc = new ReflectionObject(new stdclass);
+var_dump($rc-getFileName());
+var_dump($rc-getStartLine());
+var_dump($rc-getEndLine());
+
+Class C {
+
+}
+?
+--EXPECTF--
+string(%d) %sreflectionObject_FileInfo_basic.php
+int(12)
+int(14)
+bool(false)
+bool(false)
+bool(false)
+--UEXPECTF--
+unicode(%d) %sreflectionObject_FileInfo_basic.php
+int(12)
+int(14)
+bool(false)
+bool(false)
+bool(false)
http://cvs.php.net/viewvc.cgi/php-src/ext/reflection/tests/reflectionObject_isInstantiable_basic.phpt?r1=1.1r2=1.2diff_format=u
Index: php-src/ext/reflection/tests/reflectionObject_isInstantiable_basic.phpt
diff -u /dev/null 
php-src/ext/reflection/tests/reflectionObject_isInstantiable_basic.phpt:1.2
--- /dev/null   Thu Jul 12 21:08:02 2007
+++ php-src/ext/reflection/tests/reflectionObject_isInstantiable_basic.phpt 
Thu Jul 12 21:08:01 2007
@@ -0,0 +1,40 @@
+--TEST--
+ReflectionObject::IsInstantiable() - basic function test
+--FILE--
+?php
+class C {
+}
+
+interface iface {
+   function f1();
+}
+
+class ifaceImpl implements iface {
+   function f1() {}
+}
+
+abstract class abstractClass {
+   function f1() {}
+   abstract function f2();
+}
+
+class D extends abstractClass {
+   function f2() {}
+}
+
+$classes = array(C, ifaceImpl, D);
+
+foreach($classes  as $class ) {
+   $ro = new ReflectionObject(new $class);
+   echo Is $class instantiable?  ;
+   var_dump($ro-IsInstantiable()); 
+}
+?
+--EXPECTF--
+Is C instantiable?  bool(true)
+Is ifaceImpl instantiable?  bool(true)
+Is D instantiable?  bool(true)
+--UEXPECTF--
+Is C instantiable?  bool(true)
+Is ifaceImpl instantiable?  bool(true)
+Is D instantiable?  bool(true)
http://cvs.php.net/viewvc.cgi/php-src/ext/reflection/tests/reflectionObject_isUserDefined_basic.phpt?r1=1.1r2=1.2diff_format=u
Index: php-src/ext/reflection/tests/reflectionObject_isUserDefined_basic.phpt
diff -u /dev/null 
php-src/ext/reflection/tests/reflectionObject_isUserDefined_basic.phpt:1.2
--- /dev/null   Thu Jul 12 21:08:02 2007
+++ php-src/ext/reflection/tests/reflectionObject_isUserDefined_basic.phpt  
Thu Jul 12 21:08:01 2007
@@ -0,0 +1,29 @@
+--TEST--
+ReflectionObject::isUserDefined() - basic function test
+--FILE--

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

2007-07-12 Thread Jani Taskinen
janiThu Jul 12 22:05:10 2007 UTC

  Modified files:  
/php-src/ext/ldap   ldap.c 
  Log:
  - Fixed bug #39291 (ldap_sasl_bind() is mising sasl_authc_id paratemeter)
  # It's the equivalent for the ldapsearch -U parameter
  # @doc, @DOC or whatever the tag was..
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/ldap/ldap.c?r1=1.170r2=1.171diff_format=u
Index: php-src/ext/ldap/ldap.c
diff -u php-src/ext/ldap/ldap.c:1.170 php-src/ext/ldap/ldap.c:1.171
--- php-src/ext/ldap/ldap.c:1.170   Mon Apr 30 21:39:48 2007
+++ php-src/ext/ldap/ldap.c Thu Jul 12 22:05:09 2007
@@ -23,7 +23,7 @@
+--+
  */
  
-/* $Id: ldap.c,v 1.170 2007/04/30 21:39:48 tony2001 Exp $ */
+/* $Id: ldap.c,v 1.171 2007/07/12 22:05:09 jani Exp $ */
 #define IS_EXT_MODULE
 
 #ifdef HAVE_CONFIG_H
@@ -318,7 +318,7 @@
 
php_info_print_table_start();
php_info_print_table_row(2, LDAP Support, enabled);
-   php_info_print_table_row(2, RCS Version, $Id: ldap.c,v 1.170 
2007/04/30 21:39:48 tony2001 Exp $);
+   php_info_print_table_row(2, RCS Version, $Id: ldap.c,v 1.171 
2007/07/12 22:05:09 jani Exp $);
 
if (LDAPG(max_links) == -1) {
snprintf(tmp, 31, %ld/unlimited, LDAPG(num_links));
@@ -503,15 +503,15 @@
 
 /* {{{ _php_sasl_setdefs
  */
-static php_ldap_bictx *_php_sasl_setdefs(LDAP *ld, char *sasl_mech, char 
*sasl_realm, char *binddn, char *pass, char *sasl_authz_id)
+static php_ldap_bictx *_php_sasl_setdefs(LDAP *ld, char *sasl_mech, char 
*sasl_realm, char *sasl_authc_id, char *passwd, char *sasl_authz_id)
 {
php_ldap_bictx *ctx;
 
ctx = ber_memalloc(sizeof(php_ldap_bictx)); 
ctx-mech= (sasl_mech) ? ber_strdup(sasl_mech) : NULL;
ctx-realm   = (sasl_realm) ? ber_strdup(sasl_realm) : NULL;
-   ctx-authcid = (binddn) ? ber_strdup(binddn) : NULL;
-   ctx-passwd  = (pass) ? ber_strdup(pass) : NULL;
+   ctx-authcid = (sasl_authc_id) ? ber_strdup(sasl_authc_id) : NULL;
+   ctx-passwd  = (passwd) ? ber_strdup(passwd) : NULL;
ctx-authzid = (sasl_authz_id) ? ber_strdup(sasl_authz_id) : NULL;
 
if (ctx-mech == NULL) {
@@ -577,28 +577,29 @@
 }
 /* }}} */
 
-/* {{{ proto bool ldap_sasl_bind(resource link [, string binddn, string 
password, string sasl_mech, string sasl_realm, string sasl_authz_id, string 
props])
+/* {{{ proto bool ldap_sasl_bind(resource link [, string binddn, string 
password, string sasl_mech, string sasl_realm, string sasl_authc_id, string 
sasl_authz_id, string props])
Bind to LDAP directory using SASL */
 PHP_FUNCTION(ldap_sasl_bind)
 {
zval *link;
ldap_linkdata *ld;
char *binddn = NULL;
-   char *pass = NULL;
+   char *passwd = NULL;
char *sasl_mech = NULL;
char *sasl_realm = NULL;
char *sasl_authz_id = NULL;
+   char *sasl_authc_id = NULL;
char *props = NULL;
-   int rc, dn_len, pass_len, mech_len, realm_len, authz_id_len, props_len;
+   int rc, dn_len, passwd_len, mech_len, realm_len, authc_id_len, 
authz_id_len, props_len;
php_ldap_bictx *ctx;
 
-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, r|ss, link, 
binddn, dn_len, pass, pass_len, sasl_mech, mech_len, sasl_realm, 
realm_len, sasl_authz_id, authz_id_len, props, props_len) == FAILURE) {
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, r|sss, 
link, binddn, dn_len, passwd, passwd_len, sasl_mech, mech_len, 
sasl_realm, realm_len, sasl_authc_id, authc_id_len, sasl_authz_id, 
authz_id_len, props, props_len) == FAILURE) {
RETURN_FALSE;
}
 
ZEND_FETCH_RESOURCE(ld, ldap_linkdata *, link, -1, ldap link, 
le_link);
 
-   ctx = _php_sasl_setdefs(ld-link, sasl_mech, sasl_realm, binddn, pass, 
sasl_authz_id);
+   ctx = _php_sasl_setdefs(ld-link, sasl_mech, sasl_realm, sasl_authc_id, 
passwd, sasl_authz_id);
 
if (props) {
ldap_set_option(ld-link, LDAP_OPT_X_SASL_SECPROPS, props);

-- 
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/ldap ldap.c

2007-07-12 Thread Jani Taskinen
janiThu Jul 12 22:08:58 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-srcNEWS 
/php-src/ext/ldap   ldap.c 
  Log:
  MFH: - Fixed bug #39291 (ldap_sasl_bind() misses the sasl_authc_id parameter).
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.832r2=1.2027.2.547.2.833diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.832 php-src/NEWS:1.2027.2.547.2.833
--- php-src/NEWS:1.2027.2.547.2.832 Thu Jul 12 18:58:00 2007
+++ php-src/NEWSThu Jul 12 22:08:58 2007
@@ -142,9 +142,11 @@
   integer as sections). (Tony)
 - Fixed bug #41350 (my_thread_global_end() error during request shutdown
   on Windows). (Scott, Andrey)
-- Fixed bug #40419 (Trailing Slash in CGI request don't work). (Dmitry)
+- Fixed bug #40419 (Trailing slash in CGI request does not work). (Dmitry)
 - Fixed bug #39330 (apache2handler does not call shutdown actions before 
   apache child die). (isk at ecommerce dot com, Gopal, Tony)
+- Fixed bug #39291 (ldap_sasl_bind() misses the sasl_authc_id parameter).
+  (diafour at gmail dot com, Jani)
 - Fixed bug #35981 (pdo-pgsql should not use pkg-config when not present).
   (Jani)
 
http://cvs.php.net/viewvc.cgi/php-src/ext/ldap/ldap.c?r1=1.161.2.3.2.5r2=1.161.2.3.2.6diff_format=u
Index: php-src/ext/ldap/ldap.c
diff -u php-src/ext/ldap/ldap.c:1.161.2.3.2.5 
php-src/ext/ldap/ldap.c:1.161.2.3.2.6
--- php-src/ext/ldap/ldap.c:1.161.2.3.2.5   Mon Apr 30 21:40:02 2007
+++ php-src/ext/ldap/ldap.c Thu Jul 12 22:08:58 2007
@@ -23,7 +23,7 @@
+--+
  */
  
-/* $Id: ldap.c,v 1.161.2.3.2.5 2007/04/30 21:40:02 tony2001 Exp $ */
+/* $Id: ldap.c,v 1.161.2.3.2.6 2007/07/12 22:08:58 jani Exp $ */
 #define IS_EXT_MODULE
 
 #ifdef HAVE_CONFIG_H
@@ -318,7 +318,7 @@
 
php_info_print_table_start();
php_info_print_table_row(2, LDAP Support, enabled);
-   php_info_print_table_row(2, RCS Version, $Id: ldap.c,v 1.161.2.3.2.5 
2007/04/30 21:40:02 tony2001 Exp $);
+   php_info_print_table_row(2, RCS Version, $Id: ldap.c,v 1.161.2.3.2.6 
2007/07/12 22:08:58 jani Exp $);
 
if (LDAPG(max_links) == -1) {
snprintf(tmp, 31, %ld/unlimited, LDAPG(num_links));
@@ -503,15 +503,15 @@
 
 /* {{{ _php_sasl_setdefs
  */
-static php_ldap_bictx *_php_sasl_setdefs(LDAP *ld, char *sasl_mech, char 
*sasl_realm, char *binddn, char *pass, char *sasl_authz_id)
+static php_ldap_bictx *_php_sasl_setdefs(LDAP *ld, char *sasl_mech, char 
*sasl_realm, char *sasl_authc_id, char *passwd, char *sasl_authz_id)
 {
php_ldap_bictx *ctx;
 
ctx = ber_memalloc(sizeof(php_ldap_bictx)); 
ctx-mech= (sasl_mech) ? ber_strdup(sasl_mech) : NULL;
ctx-realm   = (sasl_realm) ? ber_strdup(sasl_realm) : NULL;
-   ctx-authcid = (binddn) ? ber_strdup(binddn) : NULL;
-   ctx-passwd  = (pass) ? ber_strdup(pass) : NULL;
+   ctx-authcid = (sasl_authc_id) ? ber_strdup(sasl_authc_id) : NULL;
+   ctx-passwd  = (passwd) ? ber_strdup(passwd) : NULL;
ctx-authzid = (sasl_authz_id) ? ber_strdup(sasl_authz_id) : NULL;
 
if (ctx-mech == NULL) {
@@ -577,28 +577,29 @@
 }
 /* }}} */
 
-/* {{{ proto bool ldap_sasl_bind(resource link [, string binddn, string 
password, string sasl_mech, string sasl_realm, string sasl_authz_id, string 
props])
+/* {{{ proto bool ldap_sasl_bind(resource link [, string binddn, string 
password, string sasl_mech, string sasl_realm, string sasl_authc_id, string 
sasl_authz_id, string props])
Bind to LDAP directory using SASL */
 PHP_FUNCTION(ldap_sasl_bind)
 {
zval *link;
ldap_linkdata *ld;
char *binddn = NULL;
-   char *pass = NULL;
+   char *passwd = NULL;
char *sasl_mech = NULL;
char *sasl_realm = NULL;
char *sasl_authz_id = NULL;
+   char *sasl_authc_id = NULL;
char *props = NULL;
-   int rc, dn_len, pass_len, mech_len, realm_len, authz_id_len, props_len;
+   int rc, dn_len, passwd_len, mech_len, realm_len, authc_id_len, 
authz_id_len, props_len;
php_ldap_bictx *ctx;
 
-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, r|ss, link, 
binddn, dn_len, pass, pass_len, sasl_mech, mech_len, sasl_realm, 
realm_len, sasl_authz_id, authz_id_len, props, props_len) == FAILURE) {
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, r|sss, 
link, binddn, dn_len, passwd, passwd_len, sasl_mech, mech_len, 
sasl_realm, realm_len, sasl_authc_id, authc_id_len, sasl_authz_id, 
authz_id_len, props, props_len) == FAILURE) {
RETURN_FALSE;
}
 
ZEND_FETCH_RESOURCE(ld, ldap_linkdata *, link, -1, ldap link, 
le_link);
 
-   ctx = _php_sasl_setdefs(ld-link, sasl_mech, sasl_realm, binddn, pass, 
sasl_authz_id);
+   ctx = _php_sasl_setdefs(ld-link, sasl_mech, sasl_realm, sasl_authc_id, 
passwd, sasl_authz_id);
 
if (props) {

[PHP-CVS] cvs: php-src(PHP_5_2) / README.CVS-RULES

2007-07-12 Thread Johannes Schl
johannesThu Jul 12 23:44:43 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-srcREADME.CVS-RULES 
  Log:
  MFH: - Mention [DOC] tag in the README
  - PHP_5_1 is closed meanwhile
  - Fixed a small typo
  
http://cvs.php.net/viewvc.cgi/php-src/README.CVS-RULES?r1=1.18.2.1.2.1r2=1.18.2.1.2.2diff_format=u
Index: php-src/README.CVS-RULES
diff -u php-src/README.CVS-RULES:1.18.2.1.2.1 
php-src/README.CVS-RULES:1.18.2.1.2.2
--- php-src/README.CVS-RULES:1.18.2.1.2.1   Sun May 21 09:12:34 2006
+++ php-src/README.CVS-RULESThu Jul 12 23:44:43 2007
@@ -39,9 +39,7 @@
 PHP_5_2  Is used to release the PHP 5.2.x series. Only minor feature
  enhancements may go in here, but please keep that as infrequent as
  possible.
-PHP_5_1  Is used to release the PHP 5.1.x series. Only bugfixes are permitted
- on this branch (Consult the releasemaster prior to commit).
-PHP_5_0  This branch is closed.
+PHP_5_1  This branch is closed.
 PHP_4_4  Is used to release the PHP 4.4.x series. Only bugfixes are permitted
  on this branch (Consult the releasemaster prior to commit).
 PHP_4_3  This branch is closed.
@@ -100,9 +98,13 @@
 
 The # lines will be omitted from the ChangeLog automagically.
 
+Use the [DOC] tag in your log message whenever you feel that your changes
+imply a documentation modification. The php-doc team will automatically
+get notified about your commit through the php-doc mailing list.
+
 If you fix some bugs, you should note the bug ID numbers in your
 commit message. Bug ID should be prefixed by # for easier access to
-bug report when developers are browsing CVS via. LXR or Bonsai.
+bug report when developers are browsing CVS via LXR or Bonsai.
 
 Example:
 

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



[PHP-CVS] cvs: php-src / README.CVS-RULES

2007-07-12 Thread Johannes Schl
johannesThu Jul 12 23:44:30 2007 UTC

  Modified files:  
/php-srcREADME.CVS-RULES 
  Log:
  - Mention [DOC] tag in the README
  - PHP_5_1 is closed meanwhile
  - Fixed a small typo
  
http://cvs.php.net/viewvc.cgi/php-src/README.CVS-RULES?r1=1.20r2=1.21diff_format=u
Index: php-src/README.CVS-RULES
diff -u php-src/README.CVS-RULES:1.20 php-src/README.CVS-RULES:1.21
--- php-src/README.CVS-RULES:1.20   Sun May 21 09:12:41 2006
+++ php-src/README.CVS-RULESThu Jul 12 23:44:30 2007
@@ -39,9 +39,7 @@
 PHP_5_2  Is used to release the PHP 5.2.x series. Only minor feature
  enhancements may go in here, but please keep that as infrequent as
  possible.
-PHP_5_1  Is used to release the PHP 5.1.x series. Only bugfixes are permitted
- on this branch (Consult the releasemaster prior to commit).
-PHP_5_0  This branch is closed.
+PHP_5_1  This branch is closed.
 PHP_4_4  Is used to release the PHP 4.4.x series. Only bugfixes are permitted
  on this branch (Consult the releasemaster prior to commit).
 PHP_4_3  This branch is closed.
@@ -100,9 +98,13 @@
 
 The # lines will be omitted from the ChangeLog automagically.
 
+Use the [DOC] tag in your log message whenever you feel that your changes
+imply a documentation modification. The php-doc team will automatically
+get notified about your commit through the php-doc mailing list.
+
 If you fix some bugs, you should note the bug ID numbers in your
 commit message. Bug ID should be prefixed by # for easier access to
-bug report when developers are browsing CVS via. LXR or Bonsai.
+bug report when developers are browsing CVS via LXR or Bonsai.
 
 Example:
 

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



[PHP-CVS] cvs: php-src(PHP_4_4) / README.CVS-RULES

2007-07-12 Thread Johannes Schl
johannesThu Jul 12 23:44:50 2007 UTC

  Modified files:  (Branch: PHP_4_4)
/php-srcREADME.CVS-RULES 
  Log:
  MFH: - Mention [DOC] tag in the README
  - PHP_5_1 is closed meanwhile
  - Fixed a small typo
  
http://cvs.php.net/viewvc.cgi/php-src/README.CVS-RULES?r1=1.16.2.2.2.1r2=1.16.2.2.2.2diff_format=u
Index: php-src/README.CVS-RULES
diff -u php-src/README.CVS-RULES:1.16.2.2.2.1 
php-src/README.CVS-RULES:1.16.2.2.2.2
--- php-src/README.CVS-RULES:1.16.2.2.2.1   Sun May 21 09:10:02 2006
+++ php-src/README.CVS-RULESThu Jul 12 23:44:50 2007
@@ -39,8 +39,7 @@
 PHP_5_2  Is used to release the PHP 5.2.x series. Only minor feature
  enhancements may go in here, but please keep that as infrequent as
  possible.
-PHP_5_1  Is used to release the PHP 5.1.x series. Only bugfixes are permitted
- on this branch (Consult the releasemaster prior to commit).
+PHP_5_1  This branch is closed.
 PHP_4_4  Is used to release the PHP 4.4.x series. Only bugfixes are permitted
  on this branch (Consult the releasemaster prior to commit).
 PHP_4_3  This branch is closed.
@@ -99,9 +98,13 @@
 
 The # lines will be omitted from the ChangeLog automagically.
 
+Use the [DOC] tag in your log message whenever you feel that your changes
+imply a documentation modification. The php-doc team will automatically
+get notified about your commit through the php-doc mailing list.
+
 If you fix some bugs, you should note the bug ID numbers in your
 commit message. Bug ID should be prefixed by # for easier access to
-bug report when developers are browsing CVS via. LXR or Bonsai.
+bug report when developers are browsing CVS via LXR or Bonsai.
 
 Example:
 

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



[PHP-CVS] cvs: php-src /ext/ldap php_ldap.h

2007-07-12 Thread Jani Taskinen
janiFri Jul 13 01:22:43 2007 UTC

  Modified files:  
/php-src/ext/ldap   php_ldap.h 
  Log:
  - Removed non-existing function entry
  
http://cvs.php.net/viewvc.cgi/php-src/ext/ldap/php_ldap.h?r1=1.34r2=1.35diff_format=u
Index: php-src/ext/ldap/php_ldap.h
diff -u php-src/ext/ldap/php_ldap.h:1.34 php-src/ext/ldap/php_ldap.h:1.35
--- php-src/ext/ldap/php_ldap.h:1.34Mon Jan  1 09:29:25 2007
+++ php-src/ext/ldap/php_ldap.h Fri Jul 13 01:22:43 2007
@@ -18,7 +18,7 @@
+--+
 */
 
-/* $Id: php_ldap.h,v 1.34 2007/01/01 09:29:25 sebastian Exp $ */
+/* $Id: php_ldap.h,v 1.35 2007/07/13 01:22:43 jani Exp $ */
 
 #ifndef PHP_LDAP_H
 #define PHP_LDAP_H
@@ -55,7 +55,6 @@
 PHP_FUNCTION(ldap_get_attributes);
 PHP_FUNCTION(ldap_get_values);
 PHP_FUNCTION(ldap_get_values_len);
-PHP_FUNCTION(ber_free);
 PHP_FUNCTION(ldap_get_dn);
 PHP_FUNCTION(ldap_explode_dn);
 PHP_FUNCTION(ldap_dn2ufn);

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



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

2007-07-12 Thread Jani Taskinen
janiFri Jul 13 01:15:47 2007 UTC

  Modified files:  
/php-src/ext/ldap   ldap.c 
  Log:
  - Fixed bug #41127 (Memory leak in ldap_{first|next}_attribute functions)
  [DOC] The last parameter ber is removed by this fix! (It's not needed)
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/ldap/ldap.c?r1=1.171r2=1.172diff_format=u
Index: php-src/ext/ldap/ldap.c
diff -u php-src/ext/ldap/ldap.c:1.171 php-src/ext/ldap/ldap.c:1.172
--- php-src/ext/ldap/ldap.c:1.171   Thu Jul 12 22:05:09 2007
+++ php-src/ext/ldap/ldap.c Fri Jul 13 01:15:47 2007
@@ -23,7 +23,7 @@
+--+
  */
  
-/* $Id: ldap.c,v 1.171 2007/07/12 22:05:09 jani Exp $ */
+/* $Id: ldap.c,v 1.172 2007/07/13 01:15:47 jani Exp $ */
 #define IS_EXT_MODULE
 
 #ifdef HAVE_CONFIG_H
@@ -75,6 +75,7 @@
 
 typedef struct {
LDAPMessage *data;
+   BerElement *ber;
int id;
 } ldap_resultentry;
 
@@ -91,7 +92,7 @@
ZEND_ARG_PASS_INFO(1)
ZEND_END_ARG_INFO();
 
-static int le_link, le_result, le_result_entry, le_ber_entry;
+static int le_link, le_result, le_result_entry;
 
 /*
This is just a small subset of the functionality provided by the LDAP 
library. All the 
@@ -217,6 +218,10 @@
 static void _free_ldap_result_entry(zend_rsrc_list_entry *rsrc TSRMLS_DC)
 {
ldap_resultentry *entry = (ldap_resultentry *)rsrc-ptr;
+
+   if (entry-ber != NULL) {
+   ber_free(entry-ber, 0);
+   }
zend_list_delete(entry-id);
efree(entry);
 } 
@@ -286,10 +291,9 @@
REGISTER_LONG_CONSTANT(GSLC_SSL_TWOWAY_AUTH, GSLC_SSL_TWOWAY_AUTH, 
CONST_PERSISTENT | CONST_CS);
 #endif
 
-   le_result = zend_register_list_destructors_ex(_free_ldap_result, NULL, 
ldap result, module_number);
le_link = zend_register_list_destructors_ex(_close_ldap_link, NULL, 
ldap link, module_number);
+   le_result = zend_register_list_destructors_ex(_free_ldap_result, NULL, 
ldap result, module_number);
le_result_entry = 
zend_register_list_destructors_ex(_free_ldap_result_entry, NULL, ldap result 
entry, module_number);
-   le_ber_entry = zend_register_list_destructors_ex(NULL, NULL, ldap ber 
entry, module_number);
 
Z_TYPE(ldap_module_entry) = type;
 
@@ -318,7 +322,7 @@
 
php_info_print_table_start();
php_info_print_table_row(2, LDAP Support, enabled);
-   php_info_print_table_row(2, RCS Version, $Id: ldap.c,v 1.171 
2007/07/12 22:05:09 jani Exp $);
+   php_info_print_table_row(2, RCS Version, $Id: ldap.c,v 1.172 
2007/07/13 01:15:47 jani Exp $);
 
if (LDAPG(max_links) == -1) {
snprintf(tmp, 31, %ld/unlimited, LDAPG(num_links));
@@ -993,6 +997,7 @@
resultentry-id = Z_LVAL_PP(result);
zend_list_addref(resultentry-id);
resultentry-data = entry;
+   resultentry-ber = NULL;
}
 }
 /* }}} */
@@ -1021,6 +1026,7 @@
resultentry_next-id = resultentry-id;
zend_list_addref(resultentry-id);
resultentry_next-data = entry_next;
+   resultentry_next-ber = NULL;
}
 }
 /* }}} */
@@ -1091,8 +1097,9 @@
attribute = ldap_next_attribute(ldap, 
ldap_result_entry, ber);
}
 #if (LDAP_API_VERSION  2000) || HAVE_NSLDAP || HAVE_ORALDAP_10 || WINDOWS
-   if (ber != NULL)
+   if (ber != NULL) {
ber_free(ber, 0);
+   }
 #endif
 
add_assoc_long(tmp1, count, num_attrib);
@@ -1115,28 +1122,25 @@
 }
 /* }}} */
 
-/* {{{ proto string ldap_first_attribute(resource link, resource result_entry, 
int ber)
+/* {{{ proto string ldap_first_attribute(resource link, resource result_entry)
Return first attribute */
 PHP_FUNCTION(ldap_first_attribute)
 {
-   zval **link, **result_entry, **berp;
+   zval **link, **result_entry;
ldap_linkdata *ld;
ldap_resultentry *resultentry;
-   BerElement *ber;
char *attribute;
 
-   if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, link, 
result_entry, berp) == FAILURE) {
+   if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, link, 
result_entry) == FAILURE) {
WRONG_PARAM_COUNT;
}
 
ZEND_FETCH_RESOURCE(ld, ldap_linkdata *, link, -1, ldap link, 
le_link);
ZEND_FETCH_RESOURCE(resultentry, ldap_resultentry *, result_entry, -1, 
ldap result entry, le_result_entry);
 
-   if ((attribute = ldap_first_attribute(ld-link, resultentry-data, 
ber)) == NULL) {
+   if ((attribute = ldap_first_attribute(ld-link, resultentry-data, 
resultentry-ber)) == NULL) {
RETURN_FALSE;
} else {
-   ZEND_REGISTER_RESOURCE(*berp, ber, le_ber_entry);
-
RETVAL_STRING(attribute, 1);
 #if (LDAP_API_VERSION  2000) || HAVE_NSLDAP || HAVE_ORALDAP_10 || WINDOWS

[PHP-CVS] cvs: php-src(PHP_5_2) / NEWS /ext/ldap ldap.c php_ldap.h

2007-07-12 Thread Jani Taskinen
janiFri Jul 13 01:24:16 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-srcNEWS 
/php-src/ext/ldap   ldap.c php_ldap.h 
  Log:
  MFH:- Fixed bug #41127 (Memory leak in ldap_{first|next}_attribute functions)
  # This removes an useless parameter from 2 functions. Perhaps the next 
  # release should be 5.3.0, there are lot of other new things done already.
  # Sneak in namespaces too.. ;)
  
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.833r2=1.2027.2.547.2.834diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.833 php-src/NEWS:1.2027.2.547.2.834
--- php-src/NEWS:1.2027.2.547.2.833 Thu Jul 12 22:08:58 2007
+++ php-src/NEWSFri Jul 13 01:24:15 2007
@@ -142,6 +142,8 @@
   integer as sections). (Tony)
 - Fixed bug #41350 (my_thread_global_end() error during request shutdown
   on Windows). (Scott, Andrey)
+- Fixed bug #41127 (Memory leak in ldap_{first|next}_attribute functions).
+  (Jani)
 - Fixed bug #40419 (Trailing slash in CGI request does not work). (Dmitry)
 - Fixed bug #39330 (apache2handler does not call shutdown actions before 
   apache child die). (isk at ecommerce dot com, Gopal, Tony)
http://cvs.php.net/viewvc.cgi/php-src/ext/ldap/ldap.c?r1=1.161.2.3.2.6r2=1.161.2.3.2.7diff_format=u
Index: php-src/ext/ldap/ldap.c
diff -u php-src/ext/ldap/ldap.c:1.161.2.3.2.6 
php-src/ext/ldap/ldap.c:1.161.2.3.2.7
--- php-src/ext/ldap/ldap.c:1.161.2.3.2.6   Thu Jul 12 22:08:58 2007
+++ php-src/ext/ldap/ldap.c Fri Jul 13 01:24:16 2007
@@ -23,7 +23,7 @@
+--+
  */
  
-/* $Id: ldap.c,v 1.161.2.3.2.6 2007/07/12 22:08:58 jani Exp $ */
+/* $Id: ldap.c,v 1.161.2.3.2.7 2007/07/13 01:24:16 jani Exp $ */
 #define IS_EXT_MODULE
 
 #ifdef HAVE_CONFIG_H
@@ -75,6 +75,7 @@
 
 typedef struct {
LDAPMessage *data;
+   BerElement *ber;
int id;
 } ldap_resultentry;
 
@@ -91,7 +92,7 @@
ZEND_ARG_PASS_INFO(1)
ZEND_END_ARG_INFO();
 
-static int le_link, le_result, le_result_entry, le_ber_entry;
+static int le_link, le_result, le_result_entry;
 
 /*
This is just a small subset of the functionality provided by the LDAP 
library. All the 
@@ -217,6 +218,10 @@
 static void _free_ldap_result_entry(zend_rsrc_list_entry *rsrc TSRMLS_DC)
 {
ldap_resultentry *entry = (ldap_resultentry *)rsrc-ptr;
+
+   if (entry-ber != NULL) {
+   ber_free(entry-ber, 0);
+   }
zend_list_delete(entry-id);
efree(entry);
 } 
@@ -286,10 +291,9 @@
REGISTER_LONG_CONSTANT(GSLC_SSL_TWOWAY_AUTH, GSLC_SSL_TWOWAY_AUTH, 
CONST_PERSISTENT | CONST_CS);
 #endif
 
-   le_result = zend_register_list_destructors_ex(_free_ldap_result, NULL, 
ldap result, module_number);
le_link = zend_register_list_destructors_ex(_close_ldap_link, NULL, 
ldap link, module_number);
+   le_result = zend_register_list_destructors_ex(_free_ldap_result, NULL, 
ldap result, module_number);
le_result_entry = 
zend_register_list_destructors_ex(_free_ldap_result_entry, NULL, ldap result 
entry, module_number);
-   le_ber_entry = zend_register_list_destructors_ex(NULL, NULL, ldap ber 
entry, module_number);
 
Z_TYPE(ldap_module_entry) = type;
 
@@ -318,7 +322,7 @@
 
php_info_print_table_start();
php_info_print_table_row(2, LDAP Support, enabled);
-   php_info_print_table_row(2, RCS Version, $Id: ldap.c,v 1.161.2.3.2.6 
2007/07/12 22:08:58 jani Exp $);
+   php_info_print_table_row(2, RCS Version, $Id: ldap.c,v 1.161.2.3.2.7 
2007/07/13 01:24:16 jani Exp $);
 
if (LDAPG(max_links) == -1) {
snprintf(tmp, 31, %ld/unlimited, LDAPG(num_links));
@@ -993,6 +997,7 @@
resultentry-id = Z_LVAL_PP(result);
zend_list_addref(resultentry-id);
resultentry-data = entry;
+   resultentry-ber = NULL;
}
 }
 /* }}} */
@@ -1021,6 +1026,7 @@
resultentry_next-id = resultentry-id;
zend_list_addref(resultentry-id);
resultentry_next-data = entry_next;
+   resultentry_next-ber = NULL;
}
 }
 /* }}} */
@@ -1091,8 +1097,9 @@
attribute = ldap_next_attribute(ldap, 
ldap_result_entry, ber);
}
 #if (LDAP_API_VERSION  2000) || HAVE_NSLDAP || HAVE_ORALDAP_10 || WINDOWS
-   if (ber != NULL)
+   if (ber != NULL) {
ber_free(ber, 0);
+   }
 #endif
 
add_assoc_long(tmp1, count, num_attrib);
@@ -1115,28 +1122,25 @@
 }
 /* }}} */
 
-/* {{{ proto string ldap_first_attribute(resource link, resource result_entry, 
int ber)
+/* {{{ proto string ldap_first_attribute(resource link, resource result_entry)
Return first attribute */
 PHP_FUNCTION(ldap_first_attribute)
 {
-   zval **link, **result_entry, **berp;
+   zval **link, **result_entry;

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

2007-07-12 Thread Jani Taskinen
janiFri Jul 13 02:00:26 2007 UTC

  Modified files:  
/php-src/ext/ldap   ldap.c 
  Log:
  - Make sure people call ldap_first_attribute() before ldap_next_attribute()
  
http://cvs.php.net/viewvc.cgi/php-src/ext/ldap/ldap.c?r1=1.172r2=1.173diff_format=u
Index: php-src/ext/ldap/ldap.c
diff -u php-src/ext/ldap/ldap.c:1.172 php-src/ext/ldap/ldap.c:1.173
--- php-src/ext/ldap/ldap.c:1.172   Fri Jul 13 01:15:47 2007
+++ php-src/ext/ldap/ldap.c Fri Jul 13 02:00:26 2007
@@ -23,7 +23,7 @@
+--+
  */
  
-/* $Id: ldap.c,v 1.172 2007/07/13 01:15:47 jani Exp $ */
+/* $Id: ldap.c,v 1.173 2007/07/13 02:00:26 jani Exp $ */
 #define IS_EXT_MODULE
 
 #ifdef HAVE_CONFIG_H
@@ -322,7 +322,7 @@
 
php_info_print_table_start();
php_info_print_table_row(2, LDAP Support, enabled);
-   php_info_print_table_row(2, RCS Version, $Id: ldap.c,v 1.172 
2007/07/13 01:15:47 jani Exp $);
+   php_info_print_table_row(2, RCS Version, $Id: ldap.c,v 1.173 
2007/07/13 02:00:26 jani Exp $);
 
if (LDAPG(max_links) == -1) {
snprintf(tmp, 31, %ld/unlimited, LDAPG(num_links));
@@ -1165,6 +1165,11 @@
ZEND_FETCH_RESOURCE(ld, ldap_linkdata *, link, -1, ldap link, 
le_link);
ZEND_FETCH_RESOURCE(resultentry, ldap_resultentry *, result_entry, -1, 
ldap result entry, le_result_entry);
 
+   if (resultentry-ber == NULL) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, called before 
calling ldap_first_attribute() or no attributes found in result entry);
+   RETURN_FALSE;
+   }
+
if ((attribute = ldap_next_attribute(ld-link, resultentry-data, 
resultentry-ber)) == NULL) {
 #if (LDAP_API_VERSION  2000) || HAVE_NSLDAP || HAVE_ORALDAP_10 || WINDOWS
if (resultentry-ber != NULL) {

-- 
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/ldap ldap.c

2007-07-12 Thread Jani Taskinen
janiFri Jul 13 02:00:39 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/ldap   ldap.c 
  Log:
  MFH: - Make sure people call ldap_first_attribute() before 
ldap_next_attribute()
  
http://cvs.php.net/viewvc.cgi/php-src/ext/ldap/ldap.c?r1=1.161.2.3.2.7r2=1.161.2.3.2.8diff_format=u
Index: php-src/ext/ldap/ldap.c
diff -u php-src/ext/ldap/ldap.c:1.161.2.3.2.7 
php-src/ext/ldap/ldap.c:1.161.2.3.2.8
--- php-src/ext/ldap/ldap.c:1.161.2.3.2.7   Fri Jul 13 01:24:16 2007
+++ php-src/ext/ldap/ldap.c Fri Jul 13 02:00:39 2007
@@ -23,7 +23,7 @@
+--+
  */
  
-/* $Id: ldap.c,v 1.161.2.3.2.7 2007/07/13 01:24:16 jani Exp $ */
+/* $Id: ldap.c,v 1.161.2.3.2.8 2007/07/13 02:00:39 jani Exp $ */
 #define IS_EXT_MODULE
 
 #ifdef HAVE_CONFIG_H
@@ -322,7 +322,7 @@
 
php_info_print_table_start();
php_info_print_table_row(2, LDAP Support, enabled);
-   php_info_print_table_row(2, RCS Version, $Id: ldap.c,v 1.161.2.3.2.7 
2007/07/13 01:24:16 jani Exp $);
+   php_info_print_table_row(2, RCS Version, $Id: ldap.c,v 1.161.2.3.2.8 
2007/07/13 02:00:39 jani Exp $);
 
if (LDAPG(max_links) == -1) {
snprintf(tmp, 31, %ld/unlimited, LDAPG(num_links));
@@ -1165,6 +1165,11 @@
ZEND_FETCH_RESOURCE(ld, ldap_linkdata *, link, -1, ldap link, 
le_link);
ZEND_FETCH_RESOURCE(resultentry, ldap_resultentry *, result_entry, -1, 
ldap result entry, le_result_entry);
 
+   if (resultentry-ber == NULL) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, called before 
calling ldap_first_attribute() or no attributes found in result entry);
+   RETURN_FALSE;
+   }
+
if ((attribute = ldap_next_attribute(ld-link, resultentry-data, 
resultentry-ber)) == NULL) {
 #if (LDAP_API_VERSION  2000) || HAVE_NSLDAP || HAVE_ORALDAP_10 || WINDOWS
if (resultentry-ber != NULL) {

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



[PHP-CVS] cvs: php-src /ext/mysql/tests mysql_stat.phpt

2007-07-12 Thread Ulf Wendel
uw  Thu Jul 12 13:31:27 2007 UTC

  Modified files:  
/php-src/ext/mysql/testsmysql_stat.phpt 
  Log:
  1) Whitespace/CS
  2) Added check for default connection
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/mysql/tests/mysql_stat.phpt?r1=1.1r2=1.2diff_format=u
Index: php-src/ext/mysql/tests/mysql_stat.phpt
diff -u php-src/ext/mysql/tests/mysql_stat.phpt:1.1 
php-src/ext/mysql/tests/mysql_stat.phpt:1.2
--- php-src/ext/mysql/tests/mysql_stat.phpt:1.1 Sun Nov 19 12:14:44 2006
+++ php-src/ext/mysql/tests/mysql_stat.phpt Thu Jul 12 13:31:27 2007
@@ -4,35 +4,41 @@
 ?php require_once('skipif.inc'); ?
 --FILE--
 ?php
-include_once connect.inc;
+include_once connect.inc;
 
-$dbname = 'test';
-$tmp= NULL;   
-$link   = NULL;
-
-if (!is_null($tmp = @mysql_stat($link)))
-printf([001] Expecting NULL, got %s/%s\n, gettype($tmp), $tmp);
-
-require('table.inc');
-
-if (!is_null($tmp = @mysql_stat($link, foo)))
-printf([002] Expecting NULL, got %s/%s\n, gettype($tmp), $tmp);
-
-if ((!is_string($tmp = mysql_stat($link))) || ('' === $tmp))
-printf([003] Expecting non empty string, got %s/'%s', [%d] %s\n, 
-gettype($tmp), $tmp, mysql_errno($link), mysql_error($link));
-
-if (ini_get('unicode.semantics')  !is_unicode($tmp)) {
-printf([004] Expecting Unicode error message!\n);
-var_inspect($tmp);
-}
-
-mysql_close($link); 
-
-if (false !== ($tmp = mysql_stat($link)))
-printf([005] Expecting boolean/false, got %s/%s\n, gettype($tmp), 
$tmp);
-   
-print done!;
+$dbname = 'test';
+$tmp= NULL;
+$link   = NULL;
+
+if (!is_null($tmp = @mysql_stat($link)))
+   printf([001] Expecting NULL, got %s/%s\n, gettype($tmp), $tmp);
+
+require('table.inc');
+
+if (!is_null($tmp = @mysql_stat($link, foo)))
+   printf([002] Expecting NULL, got %s/%s\n, gettype($tmp), $tmp);
+
+if ((!is_string($stat = mysql_stat($link))) || ('' === $stat))
+   printf([003] Expecting non empty string, got %s/'%s', [%d] %s\n,
+   gettype($stat), $stat, mysql_errno($link), mysql_error($link));
+
+if (ini_get('unicode.semantics')  !is_unicode($stat)) {
+   printf([004] Expecting Unicode error message!\n);
+   var_inspect($stat);
+}
+
+if ((!is_string($stat_def = mysql_stat())) || ('' === $stat_def))
+   printf([003] Expecting non empty string, got %s/'%s', [%d] %s\n,
+   gettype($stat_def), $stat_def, mysql_errno(), mysql_error());
+
+assert($stat === $stat_def);
+
+mysql_close($link);
+
+if (false !== ($tmp = mysql_stat($link)))
+   printf([005] Expecting boolean/false, got %s/%s\n, gettype($tmp), 
$tmp);
+
+print done!;
 ?
 --EXPECTF--
 Warning: mysql_stat(): %d is not a valid MySQL-Link resource 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 /ext/mysqli/tests 002.phpt

2007-07-12 Thread Ulf Wendel
uw  Thu Jul 12 20:31:18 2007 UTC

  Modified files:  
/php-src/ext/mysqli/tests   002.phpt 
  Log:
  More typical changes:
  
  1) Try to have portable SQL, don't create your own schema unless the test
 wants to test exactly this
  2) Don't rely on default SQL sort orders
  3) Use proper UEXPECTF. There have been a lot of tiny unicode issues when
 ext/mysqli has returned a binary string in unicode mode although a 
 unicode string could be expected and vice versa
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/002.phpt?r1=1.6r2=1.7diff_format=u
Index: php-src/ext/mysqli/tests/002.phpt
diff -u php-src/ext/mysqli/tests/002.phpt:1.6 
php-src/ext/mysqli/tests/002.phpt:1.7
--- php-src/ext/mysqli/tests/002.phpt:1.6   Tue Sep 26 13:06:13 2006
+++ php-src/ext/mysqli/tests/002.phpt   Thu Jul 12 20:31:18 2007
@@ -7,23 +7,28 @@
include connect.inc;

/*** test mysqli_connect 127.0.0.1 ***/
-   $link = mysqli_connect($host, $user, $passwd);
-$link-query(CREATE SCHEMA test);
+   if (!$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket))
+  printf([001] [%d] %s\n, mysqli_connect_errno(), 
mysqli_connect_error());   
 
-   mysqli_select_db($link, test);
-   $rc = mysqli_query($link,DROP TABLE IF EXISTS test_fetch_null);
+   if (!mysqli_query($link, DROP TABLE IF EXISTS test_fetch_null))
+   printf([002] Cannot drop table, [%d] %s\n, 
mysqli_errno($link), mysqli_error($link));
 
-   $rc = mysqli_query($link,CREATE TABLE test_fetch_null(col1 tinyint, 
col2 smallint,
-   col3 int, col4 bigint, 
-   col5 float, col6 double,
-   col7 date, col8 time, 
-   col9 varbinary(10), 
-   col10 varchar(50),
-   col11 char(20)));
+   $rc = mysqli_query($link,CREATE TABLE test_fetch_null(col1 tinyint, 
col2 smallint,
+   
col3 int, col4 bigint, 
+   
col5 float, col6 double,
+   
col7 date, col8 time, 
+   
col9 varbinary(10), 
+   
col10 varchar(50),
+   
col11 char(20)) ENGINE= . $engine);
+
+   if (!$rc)
+   printf([003] Cannot create table, [%d] %s\n, 
mysqli_errno($link), mysqli_error($link));
   
-   $rc = mysqli_query($link,INSERT INTO test_fetch_null(col1,col10, 
col11) VALUES(1,'foo1', 1000),(2,'foo2', 88),(3,'foo3', 389789));
+   $rc = mysqli_query($link, INSERT INTO test_fetch_null(col1,col10, 
col11) VALUES(1,'foo1', 1000),(2,'foo2', 88),(3,'foo3', 389789));
+   if (!$rc)
+   printf([004] Cannot insert records, [%d] %s\n, 
mysqli_errno($link), mysqli_error($link));
 
-   $stmt = mysqli_prepare($link, SELECT col1, col2, col3, col4, col5, 
col6, col7, col8, col9, col10, col11 from test_fetch_null);
+   $stmt = mysqli_prepare($link, SELECT col1, col2, col3, col4, col5, 
col6, col7, col8, col9, col10, col11 from test_fetch_null ORDER BY col1);
mysqli_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7, $c8, $c9, 
$c10, $c11); 
mysqli_execute($stmt);
 
@@ -35,6 +40,7 @@
 
mysqli_stmt_close($stmt);
mysqli_close($link);
+   print done!;
 ?
 --EXPECTF--
 array(11) {
@@ -57,7 +63,34 @@
   [8]=
   NULL
   [9]=
-  %s(4) foo1
+  string(4) foo1
+  [10]=
+  string(4) 1000
+}
+done!
+--UEXPECTF--
+array(11) {
+  [0]=
+  int(1)
+  [1]=
+  NULL
+  [2]=
+  NULL
+  [3]=
+  NULL
+  [4]=
+  NULL
+  [5]=
+  NULL
+  [6]=
+  NULL
+  [7]=
+  NULL
+  [8]=
+  NULL
+  [9]=
+  unicode(4) foo1
   [10]=
-  %s(4) 1000
+  unicode(4) 1000
 }
+done!

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