[PHP-CVS] cvs: php-src(PHP_5_3) /ext/sqlite3 sqlite3.c /ext/sqlite3/tests sqlite3_enable_exceptions.phpt

2009-06-07 Thread Scott MacVicar
scottmacMon Jun  8 02:15:54 2009 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/sqlite3sqlite3.c 
/php-src/ext/sqlite3/tests  sqlite3_enable_exceptions.phpt 
  Log:
  MFH make SQLite3::enableExceptions() return the previous value.
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite3/sqlite3.c?r1=1.1.2.38&r2=1.1.2.39&diff_format=u
Index: php-src/ext/sqlite3/sqlite3.c
diff -u php-src/ext/sqlite3/sqlite3.c:1.1.2.38 
php-src/ext/sqlite3/sqlite3.c:1.1.2.39
--- php-src/ext/sqlite3/sqlite3.c:1.1.2.38  Fri May  8 07:58:19 2009
+++ php-src/ext/sqlite3/sqlite3.c   Mon Jun  8 02:15:54 2009
@@ -16,7 +16,7 @@
+--+
 */
 
-/* $Id: sqlite3.c,v 1.1.2.38 2009/05/08 07:58:19 tony2001 Exp $ */
+/* $Id: sqlite3.c,v 1.1.2.39 2009/06/08 02:15:54 scottmac Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -1109,8 +1109,8 @@
 }
 /* }}} */
 
-/* {{{ proto void SQLite3::enableExceptions([bool enableExceptions = false])
-   Open a blob as a stream which we can read / write to. */
+/* {{{ proto bool SQLite3::enableExceptions([bool enableExceptions = false])
+   Enables an exception error mode. */
 PHP_METHOD(sqlite3, enableExceptions)
 {
php_sqlite3_db_object *db_obj;
@@ -1123,6 +1123,8 @@
return;
}
 
+   RETVAL_BOOL(db_obj->exception);
+
db_obj->exception = enableExceptions;
 }
 /* }}} */
http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite3/tests/sqlite3_enable_exceptions.phpt?r1=1.1.2.2&r2=1.1.2.3&diff_format=u
Index: php-src/ext/sqlite3/tests/sqlite3_enable_exceptions.phpt
diff -u php-src/ext/sqlite3/tests/sqlite3_enable_exceptions.phpt:1.1.2.2 
php-src/ext/sqlite3/tests/sqlite3_enable_exceptions.phpt:1.1.2.3
--- php-src/ext/sqlite3/tests/sqlite3_enable_exceptions.phpt:1.1.2.2Sun May 
17 16:51:59 2009
+++ php-src/ext/sqlite3/tests/sqlite3_enable_exceptions.phptMon Jun  8 
02:15:54 2009
@@ -23,9 +23,9 @@
 echo "Done\n";
 ?>
 --EXPECTF--
-NULL
+bool(false)
 no such table: non_existent_table
-NULL
+bool(true)
 
 Warning: SQLite3::query(): no such table: non_existent_table 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/sqlite3 php_sqlite3_structs.h sqlite3.c /ext/sqlite3/tests sqlite3_enable_exceptions.phpt

2009-06-07 Thread Scott MacVicar
scottmacMon Jun  8 02:15:42 2009 UTC

  Modified files:  
/php-src/ext/sqlite3php_sqlite3_structs.h sqlite3.c 
/php-src/ext/sqlite3/tests  sqlite3_enable_exceptions.phpt 
  Log:
  Change more things to the UTF-16 API and make SQLite3::enableExceptions() 
return the previous value.
  
  
  http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite3/php_sqlite3_structs.h?r1=1.8&r2=1.9&diff_format=u
Index: php-src/ext/sqlite3/php_sqlite3_structs.h
diff -u php-src/ext/sqlite3/php_sqlite3_structs.h:1.8 
php-src/ext/sqlite3/php_sqlite3_structs.h:1.9
--- php-src/ext/sqlite3/php_sqlite3_structs.h:1.8   Mon Apr 27 18:15:54 2009
+++ php-src/ext/sqlite3/php_sqlite3_structs.h   Mon Jun  8 02:15:42 2009
@@ -16,7 +16,7 @@
+--+
 */
 
-/* $Id: php_sqlite3_structs.h,v 1.8 2009/04/27 18:15:54 scottmac Exp $ */
+/* $Id: php_sqlite3_structs.h,v 1.9 2009/06/08 02:15:42 scottmac Exp $ */
 
 #ifndef PHP_SQLITE_STRUCTS_H
 #define PHP_SQLITE_STRUCTS_H
@@ -55,7 +55,7 @@
 typedef struct _php_sqlite3_func {
struct _php_sqlite3_func *next;
 
-   const char *func_name;
+   const UChar *func_name;
int argc;
 
zval *func, *step, *fini;
http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite3/sqlite3.c?r1=1.43&r2=1.44&diff_format=u
Index: php-src/ext/sqlite3/sqlite3.c
diff -u php-src/ext/sqlite3/sqlite3.c:1.43 php-src/ext/sqlite3/sqlite3.c:1.44
--- php-src/ext/sqlite3/sqlite3.c:1.43  Sun May 17 16:39:30 2009
+++ php-src/ext/sqlite3/sqlite3.c   Mon Jun  8 02:15:42 2009
@@ -16,7 +16,7 @@
+--+
 */
 
-/* $Id: sqlite3.c,v 1.43 2009/05/17 16:39:30 felipe Exp $ */
+/* $Id: sqlite3.c,v 1.44 2009/06/08 02:15:42 scottmac Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -30,6 +30,8 @@
 #include "php_sqlite3_structs.h"
 #include "main/SAPI.h"
 
+#include "SAPI.h"
+
 #include 
 
 #include "zend_exceptions.h"
@@ -424,14 +426,14 @@
 }
 /* }}} */
 
-/* {{{ proto SQLite3Stmt SQLite3::prepare(String Query)
+/* {{{ proto SQLite3Stmt SQLite3::prepare(String Query) U
Returns a prepared SQL statement for execution. */
 PHP_METHOD(sqlite3, prepare)
 {
php_sqlite3_db_object *db_obj;
php_sqlite3_stmt *stmt_obj;
zval *object = getThis();
-   char *sql;
+   UChar *sql;
int sql_len, errcode;
php_sqlite3_free_list *free_item;
 
@@ -439,7 +441,7 @@
 
SQLITE3_CHECK_INITIALIZED(db_obj, db_obj->initialised, SQLite3)
 
-   if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", 
&sql, &sql_len)) {
+   if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "u", 
&sql, &sql_len)) {
return;
}
 
@@ -454,8 +456,8 @@
 
Z_ADDREF_P(object);
 
-   /* Todo: utf-8 or utf-16 = sqlite3_prepare16_v2 */
-   errcode = sqlite3_prepare_v2(db_obj->db, sql, sql_len, 
&(stmt_obj->stmt), NULL);
+   /* TODO: We can pass the length in bytes potentially in future */
+   errcode = sqlite3_prepare16_v2(db_obj->db, sql, -1, &(stmt_obj->stmt), 
NULL);
if (errcode != SQLITE_OK) {
php_sqlite3_error(db_obj, "Unable to prepare statement: %d, 
%s", errcode, sqlite3_errmsg(db_obj->db));
zval_dtor(return_value);
@@ -472,7 +474,7 @@
 }
 /* }}} */
 
-/* {{{ proto SQLite3Result SQLite3::query(String Query)
+/* {{{ proto SQLite3Result SQLite3::query(String Query) U
Returns true or false, for queries that return data it will return a 
SQLite3Result object. */
 PHP_METHOD(sqlite3, query)
 {
@@ -487,7 +489,7 @@
 
SQLITE3_CHECK_INITIALIZED(db_obj, db_obj->initialised, SQLite3)
 
-   if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", 
&sql, &sql_len)) {
+   if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s&", 
&sql, &sql_len, UG(utf8_conv))) {
return;
}
 
@@ -497,8 +499,8 @@
 
/* If there was no return value then just execute the query */
if (!return_value_used) {
-   /* Todo: utf-8 */
if (sqlite3_exec(db_obj->db, sql, NULL, NULL, &errtext) != 
SQLITE_OK) {
+   /* TODO: Check if errtext is UTF-8 */
php_sqlite3_error(db_obj, "%s", errtext);
sqlite3_free(errtext);
}
@@ -514,8 +516,8 @@
 
Z_ADDREF_P(object);
 
-   /* Todo: utf-8 or utf-16 = sqlite3_prepare16_v2 */
-   return_code = sqlite3_prepare_v2(db_obj->db, sql, sql_len, 
&(stmt_obj->stmt), NULL);
+   /* TODO: Use bytes if we know it */
+   return_code = sqlite3_prepare_v2(db_obj->db, sql, -1, 
&(stmt_obj->stmt), NULL);
if (return_code != SQLITE_OK) {
php_sqlite3_error(db_obj, "Unable to prepare statement: %d, 
%s", return_code, sqlite3_errmsg(db_obj->db));
zval_ptr_dtor(&stmt);
@@ -588,7 +590,7 @@
 }
 /* }}}

[PHP-CVS] cvs: php-src(PHP_5_2) / NEWS

2009-06-07 Thread Ilia Alshanetsky
iliaa   Mon Jun  8 01:26:54 2009 UTC

  Modified files:  (Branch: PHP_5_2)
/php-srcNEWS 
  Log:
  BFN
  
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.1542&r2=1.2027.2.547.2.1543&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.1542 php-src/NEWS:1.2027.2.547.2.1543
--- php-src/NEWS:1.2027.2.547.2.1542Sun Jun  7 19:28:32 2009
+++ php-src/NEWSMon Jun  8 01:26:53 2009
@@ -23,6 +23,8 @@
   PHP_INT_MAX index value). (Matt)
 - Fixed bug #46386 (Digest authentication with SOAP module fails against MSSQL 
   SOAP services). (Ilia, lordelph at gmail dot com)
+- Fixed bug #44827 (define() is missing error checks for class constants).
+  (Ilia)
 - Fixed bug #42143 (The constant NAN is reported as 0 on Windows)
   (Kanwaljeet Singla, Venkat Raman Don)
 



-- 
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

2009-06-07 Thread Patrick Allaert
patrickallaert  Sun Jun  7 21:27:42 2009 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/ldap   ldap.c 
  Log:
  MFH: Removed credit
  
http://cvs.php.net/viewvc.cgi/php-src/ext/ldap/ldap.c?r1=1.161.2.3.2.15&r2=1.161.2.3.2.16&diff_format=u
Index: php-src/ext/ldap/ldap.c
diff -u php-src/ext/ldap/ldap.c:1.161.2.3.2.15 
php-src/ext/ldap/ldap.c:1.161.2.3.2.16
--- php-src/ext/ldap/ldap.c:1.161.2.3.2.15  Sun Jun  7 13:14:30 2009
+++ php-src/ext/ldap/ldap.c Sun Jun  7 21:27:42 2009
@@ -19,12 +19,11 @@
|  Jani Taskinen|
|  Stig Venaas  |
|  Doug Goldstein   |
-   |  Patrick Allaert |
| PHP 4.0 updates:  Zeev Suraski|
+--+
  */
  
-/* $Id: ldap.c,v 1.161.2.3.2.15 2009/06/07 13:14:30 patrickallaert Exp $ */
+/* $Id: ldap.c,v 1.161.2.3.2.16 2009/06/07 21:27:42 patrickallaert Exp $ */
 #define IS_EXT_MODULE
 
 #ifdef HAVE_CONFIG_H
@@ -323,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.15 2009/06/07 13:14:30 patrickallaert Exp $");
+   php_info_print_table_row(2, "RCS Version", "$Id: ldap.c,v 
1.161.2.3.2.16 2009/06/07 21:27:42 patrickallaert Exp $");
 
if (LDAPG(max_links) == -1) {
snprintf(tmp, 31, "%ld/unlimited", LDAPG(num_links));



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



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

2009-06-07 Thread Patrick Allaert
patrickallaert  Sun Jun  7 21:27:19 2009 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/ldap   ldap.c 
  Log:
  MFH: Removed credit
  
http://cvs.php.net/viewvc.cgi/php-src/ext/ldap/ldap.c?r1=1.161.2.3.2.11.2.26&r2=1.161.2.3.2.11.2.27&diff_format=u
Index: php-src/ext/ldap/ldap.c
diff -u php-src/ext/ldap/ldap.c:1.161.2.3.2.11.2.26 
php-src/ext/ldap/ldap.c:1.161.2.3.2.11.2.27
--- php-src/ext/ldap/ldap.c:1.161.2.3.2.11.2.26 Sun Jun  7 13:07:58 2009
+++ php-src/ext/ldap/ldap.c Sun Jun  7 21:27:19 2009
@@ -19,12 +19,11 @@
|  Jani Taskinen|
|  Stig Venaas  |
|  Doug Goldstein   |
-   |  Patrick Allaert |
| PHP 4.0 updates:  Zeev Suraski|
+--+
  */
  
-/* $Id: ldap.c,v 1.161.2.3.2.11.2.26 2009/06/07 13:07:58 patrickallaert Exp $ 
*/
+/* $Id: ldap.c,v 1.161.2.3.2.11.2.27 2009/06/07 21:27:19 patrickallaert Exp $ 
*/
 #define IS_EXT_MODULE
 
 #ifdef HAVE_CONFIG_H
@@ -225,7 +224,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.11.2.26 2009/06/07 13:07:58 patrickallaert Exp $");
+   php_info_print_table_row(2, "RCS Version", "$Id: ldap.c,v 
1.161.2.3.2.11.2.27 2009/06/07 21:27:19 patrickallaert Exp $");
 
if (LDAPG(max_links) == -1) {
snprintf(tmp, 31, "%ld/unlimited", LDAPG(num_links));



-- 
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

2009-06-07 Thread Patrick Allaert
patrickallaert  Sun Jun  7 21:26:45 2009 UTC

  Modified files:  
/php-src/ext/ldap   ldap.c 
  Log:
  Removed credit
  
http://cvs.php.net/viewvc.cgi/php-src/ext/ldap/ldap.c?r1=1.200&r2=1.201&diff_format=u
Index: php-src/ext/ldap/ldap.c
diff -u php-src/ext/ldap/ldap.c:1.200 php-src/ext/ldap/ldap.c:1.201
--- php-src/ext/ldap/ldap.c:1.200   Sun Jun  7 20:00:32 2009
+++ php-src/ext/ldap/ldap.c Sun Jun  7 21:26:45 2009
@@ -19,12 +19,11 @@
|  Jani Taskinen|
|  Stig Venaas  |
|  Doug Goldstein   |
-   |  Patrick Allaert |
| PHP 4.0 updates:  Zeev Suraski|
+--+
  */
  
-/* $Id: ldap.c,v 1.200 2009/06/07 20:00:32 patrickallaert Exp $ */
+/* $Id: ldap.c,v 1.201 2009/06/07 21:26:45 patrickallaert Exp $ */
 #define IS_EXT_MODULE
 
 #ifdef HAVE_CONFIG_H
@@ -236,7 +235,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.200 
2009/06/07 20:00:32 patrickallaert Exp $");
+   php_info_print_table_row(2, "RCS Version", "$Id: ldap.c,v 1.201 
2009/06/07 21:26:45 patrickallaert Exp $");
 
if (LDAPG(max_links) == -1) {
snprintf(tmp, 31, "%ld/unlimited", LDAPG(num_links));



-- 
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) /tests/lang foreachLoop.001.phpt foreachLoop.002.phpt foreachLoop.003.phpt foreachLoop.004.phpt foreachLoop.005.phpt foreachLoop.006.phpt foreachLoop.007.phpt foreachLo

2009-06-07 Thread Robert Nicholson
nicholsrSun Jun  7 21:05:10 2009 UTC

  Added files: (Branch: PHP_5_2)
/php-src/tests/lang foreachLoop.017.phpt foreachLoop.016.phpt 
foreachLoop.003.phpt foreachLoop.012.phpt 
foreachLoop.010.phpt foreachLoop.015.phpt 
foreachLoop.005.phpt foreachLoop.013.phpt 
foreachLoop.008.phpt foreachLoop.007.phpt 
foreachLoop.006.phpt foreachLoop.011.phpt 
foreachLoop.002.phpt foreachLoop.014.phpt 
foreachLoop.004.phpt foreachLoop.001.phpt 
foreachLoop.009.phpt 
  Log:
  New tests for foreach loops. These were written by another member of the 
Projectzero team. 
  
http://cvs.php.net/viewvc.cgi/php-src/tests/lang/foreachLoop.017.phpt?view=markup&rev=1.1
Index: php-src/tests/lang/foreachLoop.017.phpt
+++ php-src/tests/lang/foreachLoop.017.phpt
--TEST--
Ensure foreach works with arrays with Binary keys.
--FILE--
 10 );
foreach ($a as $val=>$key) echo $key;
echo "\nDone\n";
?> 
--EXPECTF--
10
Done
http://cvs.php.net/viewvc.cgi/php-src/tests/lang/foreachLoop.016.phpt?view=markup&rev=1.1
Index: php-src/tests/lang/foreachLoop.016.phpt
+++ php-src/tests/lang/foreachLoop.016.phpt
--TEST--
Ensure foreach splits the iterated entity from its cow reference set, for all 
sorts of iterated entities.
--FILE--
&$v) {
 $v = 'changed';
  }
  var_dump($b);
  unset($a, $b);
  
  echo "\n" . '${\'a\'}' . "\n";
  $b = $a = array('original');
  foreach(${'a'} as $k=>&$v) {
 $v = 'changed';
  }
  var_dump($b);
  unset($a, $b);
  
  echo "\n" . '$$a' . "\n";
  $a = 'blah';
  $$a = array('original');
  $b = $$a;
  foreach($$a as $k=>&$v) {
 $v = 'changed';
  }
  var_dump($b);
  unset($a, $b);
  
  echo "\n" . '$a[0]' . "\n";
  $b = $a[0] = array('original');
  foreach($a[0] as $k=>&$v) {
 $v = 'changed';
  }
  var_dump($b);
  unset($a, $b);
  
  echo "\n" . '$a[0][0]' . "\n";
  $b = $a[0][0] = array('original');
  foreach($a[0][0] as $k=>&$v) {
 $v = 'changed';
  }
  var_dump($b);
  unset($a, $b);
  
  echo "\n" . '$a->b' . "\n";
  $b = $a->b = array('original');
  foreach($a->b as $k=>&$v) {
 $v = 'changed';
  }
  var_dump($b);
  unset($a, $b);
  
  echo "\n" . '$a->b->c' . "\n";
  $b = $a->b->c = array('original');
  foreach($a->b as $k=>&$v) {
 $v = 'changed';
  }
  var_dump($b);
  unset($a, $b);
  
  echo "\n" . '$a->b[0]' . "\n";
  $b = $a->b[0] = array('original');
  foreach($a->b[0] as $k=>&$v) {
 $v = 'changed';
  }
  var_dump($b);
  unset($a, $b);
  
  echo "\n" . '$a->b[0][0]' . "\n";
  $b = $a->b[0][0] = array('original');
  foreach($a->b[0][0] as $k=>&$v) {
 $v = 'changed';
  }
  var_dump($b);
  unset($a, $b);
  
  echo "\n" . '$a->b[0]->c' . "\n";
  $b = $a->b[0]->c = array('original');
  foreach($a->b[0]->c as $k=>&$v) {
 $v = 'changed';
  }
  var_dump($b);
  unset($a, $b);
  
  class C {
public static $a;
  }
  
  echo "\n" . 'C::$a' . "\n";
  C::$a = array('original');
  $b = C::$a;
  foreach(C::$a as $k=>&$v) {
 $v = 'changed';
  }
  var_dump($b);
  unset($a, $b);
  
  echo "\n" . 'C::$a[0]' . "\n";
  C::$a[0] = array('original');
  $b = C::$a[0];
  foreach(C::$a[0] as $k=>&$v) {
 $v = 'changed';
  }
  var_dump($b);
  unset(C::$a[0], $b);
  
  echo "\n" . 'C::$a[0]->b' . "\n";
  C::$a[0]->b = array('original');
  $b = C::$a[0]->b;
  foreach(C::$a[0]->b as $k=>&$v) {
 $v = 'changed';
  }
  var_dump($b);
  unset(C::$a[0]->b, $b);
?>
--EXPECTF--

$a
array(1) {
  [0]=>
  unicode(8) "original"
}

${'a'}
array(1) {
  [0]=>
  unicode(8) "original"
}

$$a
array(1) {
  [0]=>
  unicode(8) "original"
}

$a[0]
array(1) {
  [0]=>
  unicode(8) "original"
}

$a[0][0]
array(1) {
  [0]=>
  unicode(8) "original"
}

$a->b
array(1) {
  [0]=>
  unicode(8) "original"
}

$a->b->c
array(1) {
  [0]=>
  unicode(8) "original"
}

$a->b[0]
array(1) {
  [0]=>
  unicode(8) "original"
}

$a->b[0][0]
array(1) {
  [0]=>
  unicode(8) "original"
}

$a->b[0]->c
array(1) {
  [0]=>
  unicode(8) "original"
}

C::$a
array(1) {
  [0]=>
  unicode(8) "original"
}

C::$a[0]
array(1) {
  [0]=>
  unicode(8) "original"
}

C::$a[0]->b
array(1) {
  [0]=>
  unicode(8) "original"
}
http://cvs.php.net/viewvc.cgi/php-src/tests/lang/foreachLoop.003.phpt?view=markup&rev=1.1
Index: php-src/tests/lang/foreachLoop.003.phpt
+++ php-src/tests/lang/foreachLoop.003.phpt
--TEST--
Foreach loop tests - error case: not an array.
--FILE--

--EXPECTF--

Not an array.

Warning: Invalid argument supplied for foreach() in %s on line 4

Warning: Invalid argument supplied for foreach() in %s on line 9

Warning: Invalid argument supplied for foreach() in %s on line 14

Warning: Invalid argument supplied for foreach() in %s on line 19

Warning: Invalid argument supplied for foreach() in %s on line 24
done.

http://cvs.php.net/viewvc.cgi/php-src/tests/lang/foreachLoo

[PHP-CVS] cvs: php-src(PHP_5_3) /tests/lang foreachLoop.001.phpt foreachLoop.002.phpt foreachLoop.003.phpt foreachLoop.004.phpt foreachLoop.005.phpt foreachLoop.006.phpt foreachLoop.007.phpt foreachLo

2009-06-07 Thread Robert Nicholson
nicholsrSun Jun  7 21:03:48 2009 UTC

  Added files: (Branch: PHP_5_3)
/php-src/tests/lang foreachLoop.016.phpt foreachLoop.006.phpt 
foreachLoop.007.phpt foreachLoop.011.phpt 
foreachLoop.001.phpt foreachLoop.013.phpt 
foreachLoop.010.phpt foreachLoop.015.phpt 
foreachLoop.017.phpt foreachLoop.005.phpt 
foreachLoop.009.phpt foreachLoop.014.phpt 
foreachLoop.008.phpt foreachLoop.002.phpt 
foreachLoop.012.phpt foreachLoop.004.phpt 
foreachLoop.003.phpt 
  Log:
  New tests for foreach loops. These were written by another member of the 
Projectzero team. 
  
http://cvs.php.net/viewvc.cgi/php-src/tests/lang/foreachLoop.016.phpt?view=markup&rev=1.1
Index: php-src/tests/lang/foreachLoop.016.phpt
+++ php-src/tests/lang/foreachLoop.016.phpt
--TEST--
Ensure foreach splits the iterated entity from its cow reference set, for all 
sorts of iterated entities.
--FILE--
&$v) {
 $v = 'changed';
  }
  var_dump($b);
  unset($a, $b);
  
  echo "\n" . '${\'a\'}' . "\n";
  $b = $a = array('original');
  foreach(${'a'} as $k=>&$v) {
 $v = 'changed';
  }
  var_dump($b);
  unset($a, $b);
  
  echo "\n" . '$$a' . "\n";
  $a = 'blah';
  $$a = array('original');
  $b = $$a;
  foreach($$a as $k=>&$v) {
 $v = 'changed';
  }
  var_dump($b);
  unset($a, $b);
  
  echo "\n" . '$a[0]' . "\n";
  $b = $a[0] = array('original');
  foreach($a[0] as $k=>&$v) {
 $v = 'changed';
  }
  var_dump($b);
  unset($a, $b);
  
  echo "\n" . '$a[0][0]' . "\n";
  $b = $a[0][0] = array('original');
  foreach($a[0][0] as $k=>&$v) {
 $v = 'changed';
  }
  var_dump($b);
  unset($a, $b);
  
  echo "\n" . '$a->b' . "\n";
  $b = $a->b = array('original');
  foreach($a->b as $k=>&$v) {
 $v = 'changed';
  }
  var_dump($b);
  unset($a, $b);
  
  echo "\n" . '$a->b->c' . "\n";
  $b = $a->b->c = array('original');
  foreach($a->b as $k=>&$v) {
 $v = 'changed';
  }
  var_dump($b);
  unset($a, $b);
  
  echo "\n" . '$a->b[0]' . "\n";
  $b = $a->b[0] = array('original');
  foreach($a->b[0] as $k=>&$v) {
 $v = 'changed';
  }
  var_dump($b);
  unset($a, $b);
  
  echo "\n" . '$a->b[0][0]' . "\n";
  $b = $a->b[0][0] = array('original');
  foreach($a->b[0][0] as $k=>&$v) {
 $v = 'changed';
  }
  var_dump($b);
  unset($a, $b);
  
  echo "\n" . '$a->b[0]->c' . "\n";
  $b = $a->b[0]->c = array('original');
  foreach($a->b[0]->c as $k=>&$v) {
 $v = 'changed';
  }
  var_dump($b);
  unset($a, $b);
  
  class C {
public static $a;
  }
  
  echo "\n" . 'C::$a' . "\n";
  C::$a = array('original');
  $b = C::$a;
  foreach(C::$a as $k=>&$v) {
 $v = 'changed';
  }
  var_dump($b);
  unset($a, $b);
  
  echo "\n" . 'C::$a[0]' . "\n";
  C::$a[0] = array('original');
  $b = C::$a[0];
  foreach(C::$a[0] as $k=>&$v) {
 $v = 'changed';
  }
  var_dump($b);
  unset(C::$a[0], $b);
  
  echo "\n" . 'C::$a[0]->b' . "\n";
  C::$a[0]->b = array('original');
  $b = C::$a[0]->b;
  foreach(C::$a[0]->b as $k=>&$v) {
 $v = 'changed';
  }
  var_dump($b);
  unset(C::$a[0]->b, $b);
?>
--EXPECTF--

$a
array(1) {
  [0]=>
  unicode(8) "original"
}

${'a'}
array(1) {
  [0]=>
  unicode(8) "original"
}

$$a
array(1) {
  [0]=>
  unicode(8) "original"
}

$a[0]
array(1) {
  [0]=>
  unicode(8) "original"
}

$a[0][0]
array(1) {
  [0]=>
  unicode(8) "original"
}

$a->b
array(1) {
  [0]=>
  unicode(8) "original"
}

$a->b->c
array(1) {
  [0]=>
  unicode(8) "original"
}

$a->b[0]
array(1) {
  [0]=>
  unicode(8) "original"
}

$a->b[0][0]
array(1) {
  [0]=>
  unicode(8) "original"
}

$a->b[0]->c
array(1) {
  [0]=>
  unicode(8) "original"
}

C::$a
array(1) {
  [0]=>
  unicode(8) "original"
}

C::$a[0]
array(1) {
  [0]=>
  unicode(8) "original"
}

C::$a[0]->b
array(1) {
  [0]=>
  unicode(8) "original"
}
http://cvs.php.net/viewvc.cgi/php-src/tests/lang/foreachLoop.006.phpt?view=markup&rev=1.1
Index: php-src/tests/lang/foreachLoop.006.phpt
+++ php-src/tests/lang/foreachLoop.006.phpt
--TEST--
Foreach loop tests - error case: key is a reference.
--FILE--
$v) {
  var_dump($v);
}
?>
--EXPECTF--
Fatal error: Key element cannot be a reference in %s on line 3
http://cvs.php.net/viewvc.cgi/php-src/tests/lang/foreachLoop.007.phpt?view=markup&rev=1.1
Index: php-src/tests/lang/foreachLoop.007.phpt
+++ php-src/tests/lang/foreachLoop.007.phpt
--TEST--
Foreach loop tests - error case: reference to constant array.
--FILE--

--EXPECTF--
Parse error: %s on line 3

http://cvs.php.net/viewvc.cgi/php-src/tests/lang/foreachLoop.011.phpt?view=markup&rev=1.1
Index: php-src/tests/lang/foreachLoop.011.phpt
+++ php-src/tests/lang/foreachLoop.011.phpt
--TEST-- 
Changing from an interable type to a non iterable type during the iteration 
--FILE--
a=1;
$a->b=2;
$b=&$a;
foreach ($a as $v) {
var_dump($v);
$b='

[PHP-CVS] cvs: php-src /tests/lang foreachLoop.001.phpt foreachLoop.002.phpt foreachLoop.003.phpt foreachLoop.004.phpt foreachLoop.005.phpt foreachLoop.006.phpt foreachLoop.007.phpt foreachLoop.008.ph

2009-06-07 Thread Robert Nicholson
nicholsrSun Jun  7 21:01:52 2009 UTC

  Added files: 
/php-src/tests/lang foreachLoop.008.phpt foreachLoop.005.phpt 
foreachLoop.011.phpt foreachLoop.015.phpt 
foreachLoop.014.phpt foreachLoop.013.phpt 
foreachLoop.003.phpt foreachLoop.001.phpt 
foreachLoop.009.phpt foreachLoop.006.phpt 
foreachLoop.016.phpt foreachLoop.010.phpt 
foreachLoop.017.phpt foreachLoop.007.phpt 
foreachLoop.004.phpt foreachLoop.012.phpt 
foreachLoop.002.phpt 
  Log:
  New tests for foreach loops. These were written by another member of the 
Projectzero team. 
  
http://cvs.php.net/viewvc.cgi/php-src/tests/lang/foreachLoop.008.phpt?view=markup&rev=1.1
Index: php-src/tests/lang/foreachLoop.008.phpt
+++ php-src/tests/lang/foreachLoop.008.phpt
--TEST--
Foreach loop tests - error case: reference to constant array, with key.
--FILE--
&$v) {
  var_dump($v);
}
?>
--EXPECTF--
Fatal error: Cannot create references to elements of a temporary array 
expression in %s on line 2

http://cvs.php.net/viewvc.cgi/php-src/tests/lang/foreachLoop.005.phpt?view=markup&rev=1.1
Index: php-src/tests/lang/foreachLoop.005.phpt
+++ php-src/tests/lang/foreachLoop.005.phpt
--TEST--
Foreach loop tests - modifying the array during the loop: special case. 
Behaviour is good since php 5.2.2.
--FILE--
&$v){
  $a[$k] = "changed.$k";
  echo "After changing \$a directly, \...@$k is: $v\n";
}
//--- Expected output:
//After changing $a directly, $...@0 is: changed.0
//After changing $a directly, $...@1 is: changed.1
//After changing $a directly, $...@2 is: changed.2
//--- Actual output from php.net before 5.2.2:
//After changing $a directly, $...@0 is: changed.0
//After changing $a directly, $...@1 is: original.1
//After changing $a directly, $...@2 is: original.2

?>
--EXPECT--
After changing $a directly, $...@0 is: changed.0
After changing $a directly, $...@1 is: changed.1
After changing $a directly, $...@2 is: changed.2

http://cvs.php.net/viewvc.cgi/php-src/tests/lang/foreachLoop.011.phpt?view=markup&rev=1.1
Index: php-src/tests/lang/foreachLoop.011.phpt
+++ php-src/tests/lang/foreachLoop.011.phpt
--TEST-- 
Changing from an interable type to a non iterable type during the iteration 
--FILE--
a=1;
$a->b=2;
$b=&$a;
foreach ($a as $v) {
var_dump($v);
$b='x'; 
}

?>
--EXPECTF--

Change from array to non iterable:
int(1)

Warning: Invalid argument supplied for foreach() in %s on line 5

Change from object to non iterable:
int(1)

Warning: Invalid argument supplied for foreach() in %s on line 15
http://cvs.php.net/viewvc.cgi/php-src/tests/lang/foreachLoop.015.phpt?view=markup&rev=1.1
Index: php-src/tests/lang/foreachLoop.015.phpt
+++ php-src/tests/lang/foreachLoop.015.phpt
--TEST--
Directly modifying a REFERENCED array when foreach'ing over it while using 
&$value syntax.
--FILE--
 State of referenced array before loop:\n";
var_dump($a);

echo "--> Do loop:\n";  
foreach ($a as $k=>&$v) {
echo " iteration $counter:  \$k=$k; \$v=$v\n";
eval($transform);
$counter++;
if ($counter>MAX_LOOPS) {
echo "  ** Stuck in a loop! **\n";
break;
}
}

echo "--> State of array after loop:\n";
var_dump($a);
}


echo "\nPopping elements off end of a referenced array, using &\$value";
$transform = 'array_pop($a);';
withRefValue(1, $transform);
withRefValue(2, $transform);
withRefValue(3, $transform);
withRefValue(4, $transform);

echo "\n\n\nShift elements off start of a referenced array, using &\$value";
$transform = 'array_shift($a);';
withRefValue(1, $transform);
withRefValue(2, $transform);
withRefValue(3, $transform);
withRefValue(4, $transform);

echo "\n\n\nRemove current element of a referenced array, using &\$value";
$transform = 'unset($a[$k]);';
withRefValue(1, $transform);
withRefValue(2, $transform);
withRefValue(3, $transform);
withRefValue(4, $transform);

echo "\n\n\nAdding elements to the end of a referenced array, using &\$value";
$transform = 'array_push($a, "new.$counter");';
withRefValue(1, $transform);
withRefValue(2, $transform);
withRefValue(3, $transform);
withRefValue(4, $transform);

echo "\n\n\nAdding elements to the start of a referenced array, using &\$value";
$transform = 'array_unshift($a, "new.$counter");';
withRefValue(1, $transform);
withRefValue(2, $transform);
withRefValue(3, $transform);
withRefValue(4, $transform);

?>
--EXPECTF--

Popping elements off end of a referenced array, using &$value
---( Array with 1 element(s): )---
--> State of referenced array before loop:
array(1) {
  [0]=>
  unicode(3) "v.0"
}
--> Do loop:
 iteration 0:  $k=0; $v=v.0
--> State of array after loop:
array(0) {
}

---( Array with 2 element

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

2009-06-07 Thread Patrick Allaert
patrickallaert  Sun Jun  7 20:00:32 2009 UTC

  Modified files:  
/php-src/ext/ldap   ldap.c 
  Log:
  Fixed ldap_(first|next)_attribute() function producing 2 warning messages in 
case wrong parameters given
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/ldap/ldap.c?r1=1.199&r2=1.200&diff_format=u
Index: php-src/ext/ldap/ldap.c
diff -u php-src/ext/ldap/ldap.c:1.199 php-src/ext/ldap/ldap.c:1.200
--- php-src/ext/ldap/ldap.c:1.199   Sun Jun  7 13:06:03 2009
+++ php-src/ext/ldap/ldap.c Sun Jun  7 20:00:32 2009
@@ -24,7 +24,7 @@
+--+
  */
  
-/* $Id: ldap.c,v 1.199 2009/06/07 13:06:03 patrickallaert Exp $ */
+/* $Id: ldap.c,v 1.200 2009/06/07 20:00:32 patrickallaert Exp $ */
 #define IS_EXT_MODULE
 
 #ifdef HAVE_CONFIG_H
@@ -236,7 +236,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.199 
2009/06/07 13:06:03 patrickallaert Exp $");
+   php_info_print_table_row(2, "RCS Version", "$Id: ldap.c,v 1.200 
2009/06/07 20:00:32 patrickallaert Exp $");
 
if (LDAPG(max_links) == -1) {
snprintf(tmp, 31, "%ld/unlimited", LDAPG(num_links));
@@ -1051,8 +1051,8 @@
ldap_resultentry *resultentry;
char *attribute;
 
-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rr", &link, 
&result_entry) == FAILURE) {
-   WRONG_PARAM_COUNT;
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rr", &link, 
&result_entry) != SUCCESS) {
+   return;
}
 
ZEND_FETCH_RESOURCE(ld, ldap_linkdata *, &link, -1, "ldap link", 
le_link);
@@ -1078,8 +1078,8 @@
ldap_resultentry *resultentry;
char *attribute;
 
-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rr", &link, 
&result_entry) == FAILURE) {
-   WRONG_PARAM_COUNT;
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rr", &link, 
&result_entry) != SUCCESS) {
+   return;
}
 
ZEND_FETCH_RESOURCE(ld, ldap_linkdata *, &link, -1, "ldap link", 
le_link);



-- 
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/array array_push_error2.phpt ZendEngine2 zend_hash.c ZendEngine2/tests bug47836.phpt

2009-06-07 Thread Matt Wilmas
mattwil Sun Jun  7 19:28:33 2009 UTC

  Added files: (Branch: PHP_5_2)
/ZendEngine2/tests  bug47836.phpt 

  Modified files:  
/php-srcNEWS 
/ZendEngine2zend_hash.c 
/php-src/ext/standard/tests/array   array_push_error2.phpt 
  Log:
  MFH: Fixed bug #47836 (array operator [] inconsistency when the array has 
PHP_INT_MAX index value)
  Also simplified related array_push() test
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.1541&r2=1.2027.2.547.2.1542&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.1541 php-src/NEWS:1.2027.2.547.2.1542
--- php-src/NEWS:1.2027.2.547.2.1541Wed Jun  3 12:41:46 2009
+++ php-src/NEWSSun Jun  7 19:28:32 2009
@@ -19,6 +19,8 @@
 - Fixed bug #48273 (snmp*_real_walk() returns SNMP errors as values).
   (Ilia, lytboris at gmail dot com)
 - Fixed bug #48247 (Crash on errors during startup). (Stas)
+- Fixed bug #47836 (array operator [] inconsistency when the array has
+  PHP_INT_MAX index value). (Matt)
 - Fixed bug #46386 (Digest authentication with SOAP module fails against MSSQL 
   SOAP services). (Ilia, lordelph at gmail dot com)
 - Fixed bug #42143 (The constant NAN is reported as 0 on Windows)
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_hash.c?r1=1.121.2.4.2.10&r2=1.121.2.4.2.11&diff_format=u
Index: ZendEngine2/zend_hash.c
diff -u ZendEngine2/zend_hash.c:1.121.2.4.2.10 
ZendEngine2/zend_hash.c:1.121.2.4.2.11
--- ZendEngine2/zend_hash.c:1.121.2.4.2.10  Wed Dec 31 11:17:33 2008
+++ ZendEngine2/zend_hash.c Sun Jun  7 19:28:32 2009
@@ -17,7 +17,7 @@
+--+
 */
 
-/* $Id: zend_hash.c,v 1.121.2.4.2.10 2008/12/31 11:17:33 sebastian Exp $ */
+/* $Id: zend_hash.c,v 1.121.2.4.2.11 2009/06/07 19:28:32 mattwil Exp $ */
 
 #include "zend.h"
 
@@ -376,7 +376,7 @@
UPDATE_DATA(ht, p, pData, nDataSize);
HANDLE_UNBLOCK_INTERRUPTIONS();
if ((long)h >= (long)ht->nNextFreeElement) {
-   ht->nNextFreeElement = h + 1;
+   ht->nNextFreeElement = h < LONG_MAX ? h + 1 : 
LONG_MAX;
}
if (pDest) {
*pDest = p->pData;
@@ -404,7 +404,7 @@
HANDLE_UNBLOCK_INTERRUPTIONS();
 
if ((long)h >= (long)ht->nNextFreeElement) {
-   ht->nNextFreeElement = h + 1;
+   ht->nNextFreeElement = h < LONG_MAX ? h + 1 : LONG_MAX;
}
ht->nNumOfElements++;
ZEND_HASH_IF_FULL_DO_RESIZE(ht);
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/array/array_push_error2.phpt?r1=1.1.2.2&r2=1.1.2.3&diff_format=u
Index: php-src/ext/standard/tests/array/array_push_error2.phpt
diff -u php-src/ext/standard/tests/array/array_push_error2.phpt:1.1.2.2 
php-src/ext/standard/tests/array/array_push_error2.phpt:1.1.2.3
--- php-src/ext/standard/tests/array/array_push_error2.phpt:1.1.2.2 Fri Mar 
14 23:13:07 2008
+++ php-src/ext/standard/tests/array/array_push_error2.phpt Sun Jun  7 
19:28:33 2009
@@ -1,9 +1,5 @@
 --TEST--
-Test array_push() function : error conditions - min and max int values as keys
---SKIPIF--
-
+Test array_push() function : error conditions - max int value as key
 --FILE--
  'min', PHP_INT_MAX => 'max');
+$array = array(PHP_INT_MAX => 'max');
 
 var_dump(array_push($array, 'new'));
 var_dump($array);
-var_dump(array_push($array, 'var'));
-var_dump($array);
 
 echo "Done";
 ?>
 
 --EXPECTF--
 *** Testing array_push() : error conditions ***
-int(3)
-array(3) {
-  [-2147483647]=>
-  string(3) "min"
-  [2147483647]=>
-  string(3) "max"
-  [-2147483648]=>
-  string(3) "new"
-}
 
 Warning: array_push(): Cannot add element to the array as the next element is 
already occupied in %s on line %d
 bool(false)
-array(3) {
-  [-2147483647]=>
-  string(3) "min"
-  [2147483647]=>
+array(1) {
+  [%d]=>
   string(3) "max"
-  [-2147483648]=>
-  string(3) "new"
 }
 Done

http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug47836.phpt?view=markup&rev=1.1
Index: ZendEngine2/tests/bug47836.phpt
+++ ZendEngine2/tests/bug47836.phpt
--TEST--
Bug #47836 (array operator [] inconsistency when the array has PHP_INT_MAX 
index value)
--FILE--

--EXPECTF--
Warning: Cannot add element to the array as the next element is already 
occupied in %s on line 4
array(1) {
  [%d]=>
  int(1)
}



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



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/standard/tests/array array_push_error2.phpt ZendEngine2 zend_hash.c ZendEngine2/tests bug47836.phpt

2009-06-07 Thread Matt Wilmas
mattwil Sun Jun  7 19:28:15 2009 UTC

  Added files: (Branch: PHP_5_3)
/ZendEngine2/tests  bug47836.phpt 

  Modified files:  
/ZendEngine2zend_hash.c 
/php-src/ext/standard/tests/array   array_push_error2.phpt 
  Log:
  MFH: Fixed bug #47836 (array operator [] inconsistency when the array has 
PHP_INT_MAX index value)
  Also simplified related array_push() test
  
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_hash.c?r1=1.121.2.4.2.8.2.8&r2=1.121.2.4.2.8.2.9&diff_format=u
Index: ZendEngine2/zend_hash.c
diff -u ZendEngine2/zend_hash.c:1.121.2.4.2.8.2.8 
ZendEngine2/zend_hash.c:1.121.2.4.2.8.2.9
--- ZendEngine2/zend_hash.c:1.121.2.4.2.8.2.8   Wed Dec 31 11:15:32 2008
+++ ZendEngine2/zend_hash.c Sun Jun  7 19:28:15 2009
@@ -17,7 +17,7 @@
+--+
 */
 
-/* $Id: zend_hash.c,v 1.121.2.4.2.8.2.8 2008/12/31 11:15:32 sebastian Exp $ */
+/* $Id: zend_hash.c,v 1.121.2.4.2.8.2.9 2009/06/07 19:28:15 mattwil Exp $ */
 
 #include "zend.h"
 
@@ -376,7 +376,7 @@
UPDATE_DATA(ht, p, pData, nDataSize);
HANDLE_UNBLOCK_INTERRUPTIONS();
if ((long)h >= (long)ht->nNextFreeElement) {
-   ht->nNextFreeElement = h + 1;
+   ht->nNextFreeElement = h < LONG_MAX ? h + 1 : 
LONG_MAX;
}
if (pDest) {
*pDest = p->pData;
@@ -404,7 +404,7 @@
HANDLE_UNBLOCK_INTERRUPTIONS();
 
if ((long)h >= (long)ht->nNextFreeElement) {
-   ht->nNextFreeElement = h + 1;
+   ht->nNextFreeElement = h < LONG_MAX ? h + 1 : LONG_MAX;
}
ht->nNumOfElements++;
ZEND_HASH_IF_FULL_DO_RESIZE(ht);
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/array/array_push_error2.phpt?r1=1.1.4.5&r2=1.1.4.6&diff_format=u
Index: php-src/ext/standard/tests/array/array_push_error2.phpt
diff -u php-src/ext/standard/tests/array/array_push_error2.phpt:1.1.4.5 
php-src/ext/standard/tests/array/array_push_error2.phpt:1.1.4.6
--- php-src/ext/standard/tests/array/array_push_error2.phpt:1.1.4.5 Wed Mar 
19 03:15:56 2008
+++ php-src/ext/standard/tests/array/array_push_error2.phpt Sun Jun  7 
19:28:15 2009
@@ -1,5 +1,5 @@
 --TEST--
-Test array_push() function : error conditions - min and max int values as keys
+Test array_push() function : error conditions - max int value as key
 --FILE--
  'min', PHP_INT_MAX => 'max');
+$array = array(PHP_INT_MAX => 'max');
 
 var_dump(array_push($array, 'new'));
 var_dump($array);
-var_dump(array_push($array, 'var'));
-var_dump($array);
 
 echo "Done";
 ?>
 
 --EXPECTF--
 *** Testing array_push() : error conditions ***
-int(3)
-array(3) {
-  [-%d]=>
-  string(3) "min"
-  [%d]=>
-  string(3) "max"
-  [-%d]=>
-  string(3) "new"
-}
 
 Warning: array_push(): Cannot add element to the array as the next element is 
already occupied in %s on line %d
 bool(false)
-array(3) {
-  [-%d]=>
-  string(3) "min"
+array(1) {
   [%d]=>
   string(3) "max"
-  [-%d]=>
-  string(3) "new"
 }
 Done
\ No newline at end of file

http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug47836.phpt?view=markup&rev=1.1
Index: ZendEngine2/tests/bug47836.phpt
+++ ZendEngine2/tests/bug47836.phpt
--TEST--
Bug #47836 (array operator [] inconsistency when the array has PHP_INT_MAX 
index value)
--FILE--

--EXPECTF--
Warning: Cannot add element to the array as the next element is already 
occupied in %s on line 4
array(1) {
  [%d]=>
  int(1)
}



-- 
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/array array_push_error2.phpt ZendEngine2 zend_hash.c ZendEngine2/tests bug47836.phpt

2009-06-07 Thread Matt Wilmas
mattwil Sun Jun  7 19:28:02 2009 UTC

  Added files: 
/ZendEngine2/tests  bug47836.phpt 

  Modified files:  
/ZendEngine2zend_hash.c 
/php-src/ext/standard/tests/array   array_push_error2.phpt 
  Log:
  Fixed bug #47836 (array operator [] inconsistency when the array has 
PHP_INT_MAX index value)
  Also simplified related array_push() test
  
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_hash.c?r1=1.166&r2=1.167&diff_format=u
Index: ZendEngine2/zend_hash.c
diff -u ZendEngine2/zend_hash.c:1.166 ZendEngine2/zend_hash.c:1.167
--- ZendEngine2/zend_hash.c:1.166   Wed May 27 11:58:44 2009
+++ ZendEngine2/zend_hash.c Sun Jun  7 19:28:02 2009
@@ -17,7 +17,7 @@
+--+
 */
 
-/* $Id: zend_hash.c,v 1.166 2009/05/27 11:58:44 dsp Exp $ */
+/* $Id: zend_hash.c,v 1.167 2009/06/07 19:28:02 mattwil Exp $ */
 
 #include "zend.h"
 #include "zend_operators.h"
@@ -507,7 +507,7 @@
UPDATE_DATA(ht, p, pData, nDataSize);
HANDLE_UNBLOCK_INTERRUPTIONS();
if ((long)h >= (long)ht->nNextFreeElement) {
-   ht->nNextFreeElement = h + 1;
+   ht->nNextFreeElement = h < LONG_MAX ? h + 1 : 
LONG_MAX;
}
if (pDest) {
*pDest = p->pData;
@@ -537,7 +537,7 @@
HANDLE_UNBLOCK_INTERRUPTIONS();
 
if ((long)h >= (long)ht->nNextFreeElement) {
-   ht->nNextFreeElement = h + 1;
+   ht->nNextFreeElement = h < LONG_MAX ? h + 1 : LONG_MAX;
}
ht->nNumOfElements++;
ZEND_HASH_IF_FULL_DO_RESIZE(ht);
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/array/array_push_error2.phpt?r1=1.5&r2=1.6&diff_format=u
Index: php-src/ext/standard/tests/array/array_push_error2.phpt
diff -u php-src/ext/standard/tests/array/array_push_error2.phpt:1.5 
php-src/ext/standard/tests/array/array_push_error2.phpt:1.6
--- php-src/ext/standard/tests/array/array_push_error2.phpt:1.5 Fri Apr 24 
17:13:49 2009
+++ php-src/ext/standard/tests/array/array_push_error2.phpt Sun Jun  7 
19:28:02 2009
@@ -1,5 +1,5 @@
 --TEST--
-Test array_push() function : error conditions - min and max int values as keys
+Test array_push() function : error conditions - max int value as key
 --FILE--
  'min', PHP_INT_MAX => 'max');
+$array = array(PHP_INT_MAX => 'max');
 
 var_dump(array_push($array, 'new'));
 var_dump($array);
-var_dump(array_push($array, 'var'));
-var_dump($array);
 
 echo "Done";
 ?>
 
 --EXPECTF--
 *** Testing array_push() : error conditions ***
-int(3)
-array(3) {
-  [-%d]=>
-  unicode(3) "min"
-  [%d]=>
-  unicode(3) "max"
-  [-%d]=>
-  unicode(3) "new"
-}
 
 Warning: array_push(): Cannot add element to the array as the next element is 
already occupied in %s on line %d
 bool(false)
-array(3) {
-  [-%d]=>
-  unicode(3) "min"
+array(1) {
   [%d]=>
   unicode(3) "max"
-  [-%d]=>
-  unicode(3) "new"
 }
 Done

http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug47836.phpt?view=markup&rev=1.1
Index: ZendEngine2/tests/bug47836.phpt
+++ ZendEngine2/tests/bug47836.phpt
--TEST--
Bug #47836 (array operator [] inconsistency when the array has PHP_INT_MAX 
index value)
--FILE--

--EXPECTF--
Warning: Cannot add element to the array as the next element is already 
occupied in %s on line 4
array(1) {
  [%d]=>
  int(1)
}



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



[PHP-CVS] cvs: php-src(PHP_5_3) /tests/classes __call_005.phpt __call_007.phpt ZendEngine2 zend_compile.c zend_vm_def.h zend_vm_execute.h ZendEngine2/tests call_static_006.phpt magic_methods_002.php

2009-06-07 Thread Matt Wilmas
mattwil Sun Jun  7 15:46:58 2009 UTC

  Modified files:  (Branch: PHP_5_3)
/ZendEngine2zend_compile.c zend_vm_def.h zend_vm_execute.h 
/ZendEngine2/tests  call_static_006.phpt magic_methods_002.phpt 
magic_methods_003.phpt magic_methods_004.phpt 
magic_methods_005.phpt magic_methods_007.phpt 
magic_methods_008.phpt magic_methods_010.phpt 
/php-src/tests/classes  __call_005.phpt __call_007.phpt 
  Log:
  MFH: Changed error messages to use "cannot" instead of "can not" (meaning 
"also can")
  http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_compile.c?r1=1.647.2.27.2.41.2.108&r2=1.647.2.27.2.41.2.109&diff_format=u
Index: ZendEngine2/zend_compile.c
diff -u ZendEngine2/zend_compile.c:1.647.2.27.2.41.2.108 
ZendEngine2/zend_compile.c:1.647.2.27.2.41.2.109
--- ZendEngine2/zend_compile.c:1.647.2.27.2.41.2.108Thu Jun  4 18:20:42 2009
+++ ZendEngine2/zend_compile.c  Sun Jun  7 15:46:51 2009
@@ -17,7 +17,7 @@
+--+
 */
 
-/* $Id: zend_compile.c,v 1.647.2.27.2.41.2.108 2009/06/04 18:20:42 mattwil Exp 
$ */
+/* $Id: zend_compile.c,v 1.647.2.27.2.41.2.109 2009/06/07 15:46:51 mattwil Exp 
$ */
 
 #include 
 #include "zend.h"
@@ -1211,7 +1211,7 @@
if (CG(active_class_entry)->ce_flags & ZEND_ACC_INTERFACE) {
if ((name_len == sizeof(ZEND_CALL_FUNC_NAME)-1) && 
(!memcmp(lcname, ZEND_CALL_FUNC_NAME, sizeof(ZEND_CALL_FUNC_NAME)-1))) {
if (fn_flags & ((ZEND_ACC_PPP_MASK | 
ZEND_ACC_STATIC) ^ ZEND_ACC_PUBLIC)) {
-   zend_error(E_WARNING, "The magic method 
__call() must have public visibility and can not be static");
+   zend_error(E_WARNING, "The magic method 
__call() must have public visibility and cannot be static");
}
} else if ((name_len == 
sizeof(ZEND_CALLSTATIC_FUNC_NAME)-1) && (!memcmp(lcname, 
ZEND_CALLSTATIC_FUNC_NAME, sizeof(ZEND_CALLSTATIC_FUNC_NAME)-1))) {
if ((fn_flags & (ZEND_ACC_PPP_MASK ^ 
ZEND_ACC_PUBLIC)) || (fn_flags & ZEND_ACC_STATIC) == 0) {
@@ -1219,23 +1219,23 @@
}
} else if ((name_len == sizeof(ZEND_GET_FUNC_NAME)-1) 
&& (!memcmp(lcname, ZEND_GET_FUNC_NAME, sizeof(ZEND_GET_FUNC_NAME)-1))) {
if (fn_flags & ((ZEND_ACC_PPP_MASK | 
ZEND_ACC_STATIC) ^ ZEND_ACC_PUBLIC)) {
-   zend_error(E_WARNING, "The magic method 
__get() must have public visibility and can not be static");
+   zend_error(E_WARNING, "The magic method 
__get() must have public visibility and cannot be static");
}
} else if ((name_len == sizeof(ZEND_SET_FUNC_NAME)-1) 
&& (!memcmp(lcname, ZEND_SET_FUNC_NAME, sizeof(ZEND_SET_FUNC_NAME)-1))) {
if (fn_flags & ((ZEND_ACC_PPP_MASK | 
ZEND_ACC_STATIC) ^ ZEND_ACC_PUBLIC)) {
-   zend_error(E_WARNING, "The magic method 
__set() must have public visibility and can not be static");
+   zend_error(E_WARNING, "The magic method 
__set() must have public visibility and cannot be static");
}
} else if ((name_len == sizeof(ZEND_UNSET_FUNC_NAME)-1) 
&& (!memcmp(lcname, ZEND_UNSET_FUNC_NAME, sizeof(ZEND_UNSET_FUNC_NAME)-1))) {
if (fn_flags & ((ZEND_ACC_PPP_MASK | 
ZEND_ACC_STATIC) ^ ZEND_ACC_PUBLIC)) {
-   zend_error(E_WARNING, "The magic method 
__unset() must have public visibility and can not be static");
+   zend_error(E_WARNING, "The magic method 
__unset() must have public visibility and cannot be static");
}
} else if ((name_len == sizeof(ZEND_ISSET_FUNC_NAME)-1) 
&& (!memcmp(lcname, ZEND_ISSET_FUNC_NAME, sizeof(ZEND_ISSET_FUNC_NAME)-1))) {
if (fn_flags & ((ZEND_ACC_PPP_MASK | 
ZEND_ACC_STATIC) ^ ZEND_ACC_PUBLIC)) {
-   zend_error(E_WARNING, "The magic method 
__isset() must have public visibility and can not be static");
+   zend_error(E_WARNING, "The magic method 
__isset() must have public visibility and cannot be static");
}
} else if ((name_len == 
sizeof(ZEND_TOSTRING_FUNC_NAME)-1) && (!memcmp(lcname, ZEND_TOSTRING_FUNC_NAME, 
sizeof(ZEND_TOSTRING_FUNC_NAME)-1))) {
if (fn_flags & ((ZEND_ACC_PPP_MASK | 
ZEND_ACC_STATIC) ^ ZEND_ACC_PUBLIC)) {
-  

[PHP-CVS] cvs: php-src /tests/classes __call_005.phpt __call_007.phpt ZendEngine2 zend_compile.c zend_vm_def.h zend_vm_execute.h ZendEngine2/tests call_static_006.phpt magic_methods_002.phpt magic_m

2009-06-07 Thread Matt Wilmas
mattwil Sun Jun  7 15:45:47 2009 UTC

  Modified files:  
/ZendEngine2zend_compile.c zend_vm_def.h zend_vm_execute.h 
/ZendEngine2/tests  call_static_006.phpt magic_methods_002.phpt 
magic_methods_003.phpt magic_methods_004.phpt 
magic_methods_005.phpt magic_methods_007.phpt 
magic_methods_008.phpt magic_methods_010.phpt 
/php-src/tests/classes  __call_005.phpt __call_007.phpt 
  Log:
  Changed error messages to use "cannot" instead of "can not" (meaning "also 
can")
  http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_compile.c?r1=1.860&r2=1.861&diff_format=u
Index: ZendEngine2/zend_compile.c
diff -u ZendEngine2/zend_compile.c:1.860 ZendEngine2/zend_compile.c:1.861
--- ZendEngine2/zend_compile.c:1.860Thu Jun  4 18:18:46 2009
+++ ZendEngine2/zend_compile.c  Sun Jun  7 15:45:46 2009
@@ -17,7 +17,7 @@
+--+
 */
 
-/* $Id: zend_compile.c,v 1.860 2009/06/04 18:18:46 mattwil Exp $ */
+/* $Id: zend_compile.c,v 1.861 2009/06/07 15:45:46 mattwil Exp $ */
 
 #include 
 #include "zend.h"
@@ -1273,7 +1273,7 @@
if (CG(active_class_entry)->ce_flags & ZEND_ACC_INTERFACE) {
if ((lcname_len == sizeof(ZEND_CALL_FUNC_NAME)-1) && 
(ZEND_U_EQUAL(Z_TYPE(function_name->u.constant), lcname, lcname_len, 
ZEND_CALL_FUNC_NAME, sizeof(ZEND_CALL_FUNC_NAME)-1))) {
if (fn_flags & ((ZEND_ACC_PPP_MASK | 
ZEND_ACC_STATIC) ^ ZEND_ACC_PUBLIC)) {
-   zend_error(E_COMPILE_ERROR, "The magic 
method __call() must have public visibility and can not be static");
+   zend_error(E_COMPILE_ERROR, "The magic 
method __call() must have public visibility and cannot be static");
}
} else if ((lcname_len == 
sizeof(ZEND_CALLSTATIC_FUNC_NAME)-1) && 
(ZEND_U_EQUAL(Z_TYPE(function_name->u.constant), lcname, lcname_len, 
ZEND_CALLSTATIC_FUNC_NAME, sizeof(ZEND_CALLSTATIC_FUNC_NAME)-1))) {
if ((fn_flags & (ZEND_ACC_PPP_MASK ^ 
ZEND_ACC_PUBLIC)) || (fn_flags & ZEND_ACC_STATIC) == 0) {
@@ -1281,23 +1281,23 @@
}
} else if ((lcname_len == sizeof(ZEND_GET_FUNC_NAME)-1) 
&& (ZEND_U_EQUAL(Z_TYPE(function_name->u.constant), lcname, lcname_len, 
ZEND_GET_FUNC_NAME, sizeof(ZEND_GET_FUNC_NAME)-1))) {
if (fn_flags & ((ZEND_ACC_PPP_MASK | 
ZEND_ACC_STATIC) ^ ZEND_ACC_PUBLIC)) {
-   zend_error(E_COMPILE_ERROR, "The magic 
method __get() must have public visibility and can not be static");
+   zend_error(E_COMPILE_ERROR, "The magic 
method __get() must have public visibility and cannot be static");
}
} else if ((lcname_len == sizeof(ZEND_SET_FUNC_NAME)-1) 
&& (ZEND_U_EQUAL(Z_TYPE(function_name->u.constant), lcname, lcname_len, 
ZEND_SET_FUNC_NAME, sizeof(ZEND_SET_FUNC_NAME)-1))) {
if (fn_flags & ((ZEND_ACC_PPP_MASK | 
ZEND_ACC_STATIC) ^ ZEND_ACC_PUBLIC)) {
-   zend_error(E_COMPILE_ERROR, "The magic 
method __set() must have public visibility and can not be static");
+   zend_error(E_COMPILE_ERROR, "The magic 
method __set() must have public visibility and cannot be static");
}
} else if ((lcname_len == 
sizeof(ZEND_UNSET_FUNC_NAME)-1) && 
(ZEND_U_EQUAL(Z_TYPE(function_name->u.constant), lcname, lcname_len, 
ZEND_UNSET_FUNC_NAME, sizeof(ZEND_UNSET_FUNC_NAME)-1))) {
if (fn_flags & ((ZEND_ACC_PPP_MASK | 
ZEND_ACC_STATIC) ^ ZEND_ACC_PUBLIC)) {
-   zend_error(E_COMPILE_ERROR, "The magic 
method __unset() must have public visibility and can not be static");
+   zend_error(E_COMPILE_ERROR, "The magic 
method __unset() must have public visibility and cannot be static");
}
} else if ((lcname_len == 
sizeof(ZEND_ISSET_FUNC_NAME)-1) && 
(ZEND_U_EQUAL(Z_TYPE(function_name->u.constant), lcname, lcname_len, 
ZEND_ISSET_FUNC_NAME, sizeof(ZEND_ISSET_FUNC_NAME)-1))) {
if (fn_flags & ((ZEND_ACC_PPP_MASK | 
ZEND_ACC_STATIC) ^ ZEND_ACC_PUBLIC)) {
-   zend_error(E_COMPILE_ERROR, "The magic 
method __isset() must have public visibility and can not be static");
+   zend_error(E_COMPILE_ERROR, "The magic 
method __isset() must have public visibility and cannot be static");
}
} else if ((lcname_len == 
siz

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

2009-06-07 Thread Patrick ALLAERT
Yes, indead, but I have several patchs to commit, bug #48441 and
#42060 are assigned to me.
Those patch will change the code a lot more.

But no problem :) I can remove my name from the authors, I think it
was best practice to mention who touched the file...

Cheers,
Patrick

2009/6/7 Hannes Magnusson :
> On Sun, Jun 7, 2009 at 15:06, Patrick Allaert wrote:
>> patrickallaert          Sun Jun  7 13:06:04 2009 UTC
>>
>>  Modified files:
>>    /php-src/ext/ldap   ldap.c
>>  Log:
>>  Fixed bug #48469 (ldap_get_entries() memory leaks on empty search results)
>>
>> http://cvs.php.net/viewvc.cgi/php-src/ext/ldap/ldap.c?r1=1.198&r2=1.199&diff_format=u
>> Index: php-src/ext/ldap/ldap.c
>> diff -u php-src/ext/ldap/ldap.c:1.198 php-src/ext/ldap/ldap.c:1.199
>> --- php-src/ext/ldap/ldap.c:1.198       Tue Apr 21 18:07:42 2009
>> +++ php-src/ext/ldap/ldap.c     Sun Jun  7 13:06:03 2009
>> @@ -19,11 +19,12 @@
>>    |          Jani Taskinen                                |
>>    |          Stig Venaas                              |
>>    |          Doug Goldstein                           |
>> +   |          Patrick Allaert                     |
>
> Heh? You barely touched the file.
>
> -Hannes
>



-- 
Patrick Allaert
---
http://code.google.com/p/peclapm/ - Alternative PHP Monitor

--
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

2009-06-07 Thread Patrick Allaert
patrickallaert  Sun Jun  7 13:14:30 2009 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/ldap   ldap.c 
  Log:
  MFH: Fixed bug #48469 (ldap_get_entries() memory leaks on empty search 
results)
  
http://cvs.php.net/viewvc.cgi/php-src/ext/ldap/ldap.c?r1=1.161.2.3.2.14&r2=1.161.2.3.2.15&diff_format=u
Index: php-src/ext/ldap/ldap.c
diff -u php-src/ext/ldap/ldap.c:1.161.2.3.2.14 
php-src/ext/ldap/ldap.c:1.161.2.3.2.15
--- php-src/ext/ldap/ldap.c:1.161.2.3.2.14  Wed Dec 31 11:17:39 2008
+++ php-src/ext/ldap/ldap.c Sun Jun  7 13:14:30 2009
@@ -19,11 +19,12 @@
|  Jani Taskinen|
|  Stig Venaas  |
|  Doug Goldstein   |
+   |  Patrick Allaert |
| PHP 4.0 updates:  Zeev Suraski|
+--+
  */
  
-/* $Id: ldap.c,v 1.161.2.3.2.14 2008/12/31 11:17:39 sebastian Exp $ */
+/* $Id: ldap.c,v 1.161.2.3.2.15 2009/06/07 13:14:30 patrickallaert Exp $ */
 #define IS_EXT_MODULE
 
 #ifdef HAVE_CONFIG_H
@@ -322,7 +323,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.14 2008/12/31 11:17:39 sebastian Exp $");
+   php_info_print_table_row(2, "RCS Version", "$Id: ldap.c,v 
1.161.2.3.2.15 2009/06/07 13:14:30 patrickallaert Exp $");
 
if (LDAPG(max_links) == -1) {
snprintf(tmp, 31, "%ld/unlimited", LDAPG(num_links));
@@ -1057,15 +1058,15 @@
ldap = ld->link;
num_entries = ldap_count_entries(ldap, ldap_result);
 
-   array_init(return_value);
-   add_assoc_long(return_value, "count", num_entries);
-
if (num_entries == 0) return;
num_entries = 0;

ldap_result_entry = ldap_first_entry(ldap, ldap_result);
if (ldap_result_entry == NULL) RETURN_FALSE;
 
+   array_init(return_value);
+   add_assoc_long(return_value, "count", num_entries);
+
while (ldap_result_entry != NULL) {
 
MAKE_STD_ZVAL(tmp1);



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



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

2009-06-07 Thread Patrick Allaert
patrickallaert  Sun Jun  7 13:07:58 2009 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/ldap   ldap.c 
  Log:
  MFH: Fixed bug #48469 (ldap_get_entries() memory leaks on empty search 
results)
  
http://cvs.php.net/viewvc.cgi/php-src/ext/ldap/ldap.c?r1=1.161.2.3.2.11.2.25&r2=1.161.2.3.2.11.2.26&diff_format=u
Index: php-src/ext/ldap/ldap.c
diff -u php-src/ext/ldap/ldap.c:1.161.2.3.2.11.2.25 
php-src/ext/ldap/ldap.c:1.161.2.3.2.11.2.26
--- php-src/ext/ldap/ldap.c:1.161.2.3.2.11.2.25 Tue Apr 21 18:08:34 2009
+++ php-src/ext/ldap/ldap.c Sun Jun  7 13:07:58 2009
@@ -19,11 +19,12 @@
|  Jani Taskinen|
|  Stig Venaas  |
|  Doug Goldstein   |
+   |  Patrick Allaert |
| PHP 4.0 updates:  Zeev Suraski|
+--+
  */
  
-/* $Id: ldap.c,v 1.161.2.3.2.11.2.25 2009/04/21 18:08:34 bjori Exp $ */
+/* $Id: ldap.c,v 1.161.2.3.2.11.2.26 2009/06/07 13:07:58 patrickallaert Exp $ 
*/
 #define IS_EXT_MODULE
 
 #ifdef HAVE_CONFIG_H
@@ -224,7 +225,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.11.2.25 2009/04/21 18:08:34 bjori Exp $");
+   php_info_print_table_row(2, "RCS Version", "$Id: ldap.c,v 
1.161.2.3.2.11.2.26 2009/06/07 13:07:58 patrickallaert Exp $");
 
if (LDAPG(max_links) == -1) {
snprintf(tmp, 31, "%ld/unlimited", LDAPG(num_links));
@@ -961,9 +962,6 @@
ldap = ld->link;
num_entries = ldap_count_entries(ldap, ldap_result);
 
-   array_init(return_value);
-   add_assoc_long(return_value, "count", num_entries);
-
if (num_entries == 0) {
RETURN_NULL();
}
@@ -974,6 +972,9 @@
RETURN_FALSE;
}
 
+   array_init(return_value);
+   add_assoc_long(return_value, "count", num_entries);
+
while (ldap_result_entry != NULL) {
 
MAKE_STD_ZVAL(tmp1);



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



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

2009-06-07 Thread Hannes Magnusson
On Sun, Jun 7, 2009 at 15:06, Patrick Allaert wrote:
> patrickallaert          Sun Jun  7 13:06:04 2009 UTC
>
>  Modified files:
>    /php-src/ext/ldap   ldap.c
>  Log:
>  Fixed bug #48469 (ldap_get_entries() memory leaks on empty search results)
>
> http://cvs.php.net/viewvc.cgi/php-src/ext/ldap/ldap.c?r1=1.198&r2=1.199&diff_format=u
> Index: php-src/ext/ldap/ldap.c
> diff -u php-src/ext/ldap/ldap.c:1.198 php-src/ext/ldap/ldap.c:1.199
> --- php-src/ext/ldap/ldap.c:1.198       Tue Apr 21 18:07:42 2009
> +++ php-src/ext/ldap/ldap.c     Sun Jun  7 13:06:03 2009
> @@ -19,11 +19,12 @@
>    |          Jani Taskinen                                |
>    |          Stig Venaas                              |
>    |          Doug Goldstein                           |
> +   |          Patrick Allaert                     |

Heh? You barely touched the file.

-Hannes

--
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

2009-06-07 Thread Patrick Allaert
patrickallaert  Sun Jun  7 13:06:04 2009 UTC

  Modified files:  
/php-src/ext/ldap   ldap.c 
  Log:
  Fixed bug #48469 (ldap_get_entries() memory leaks on empty search results)
  
http://cvs.php.net/viewvc.cgi/php-src/ext/ldap/ldap.c?r1=1.198&r2=1.199&diff_format=u
Index: php-src/ext/ldap/ldap.c
diff -u php-src/ext/ldap/ldap.c:1.198 php-src/ext/ldap/ldap.c:1.199
--- php-src/ext/ldap/ldap.c:1.198   Tue Apr 21 18:07:42 2009
+++ php-src/ext/ldap/ldap.c Sun Jun  7 13:06:03 2009
@@ -19,11 +19,12 @@
|  Jani Taskinen|
|  Stig Venaas  |
|  Doug Goldstein   |
+   |  Patrick Allaert |
| PHP 4.0 updates:  Zeev Suraski|
+--+
  */
  
-/* $Id: ldap.c,v 1.198 2009/04/21 18:07:42 bjori Exp $ */
+/* $Id: ldap.c,v 1.199 2009/06/07 13:06:03 patrickallaert Exp $ */
 #define IS_EXT_MODULE
 
 #ifdef HAVE_CONFIG_H
@@ -235,7 +236,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.198 
2009/04/21 18:07:42 bjori Exp $");
+   php_info_print_table_row(2, "RCS Version", "$Id: ldap.c,v 1.199 
2009/06/07 13:06:03 patrickallaert Exp $");
 
if (LDAPG(max_links) == -1) {
snprintf(tmp, 31, "%ld/unlimited", LDAPG(num_links));
@@ -972,9 +973,6 @@
ldap = ld->link;
num_entries = ldap_count_entries(ldap, ldap_result);
 
-   array_init(return_value);
-   add_assoc_long(return_value, "count", num_entries);
-
if (num_entries == 0) {
RETURN_NULL();
}
@@ -985,6 +983,9 @@
RETURN_FALSE;
}
 
+   array_init(return_value);
+   add_assoc_long(return_value, "count", num_entries);
+
while (ldap_result_entry != NULL) {
 
MAKE_STD_ZVAL(tmp1);



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



[PHP-CVS] cvs: phpruntests /src/testcase rtTestDifference.php rtTestStatus.php /src/testcase/output rtTestOutputWriterList.php /src/testgroup rtPhpTestGroup.php /src/testrun rtPhpTestRun.php

2009-06-07 Thread Zoe Slattery
zoe Sun Jun  7 11:06:51 2009 UTC

  Modified files:  
/phpruntests/src/testcase   rtTestStatus.php rtTestDifference.php 
/phpruntests/src/testcase/outputrtTestOutputWriterList.php 
/phpruntests/src/testrunrtPhpTestRun.php 
/phpruntests/src/testgroup  rtPhpTestGroup.php 
  Log:
  move name to constructor in testStatus
  
http://cvs.php.net/viewvc.cgi/phpruntests/src/testcase/rtTestStatus.php?r1=1.2&r2=1.3&diff_format=u
Index: phpruntests/src/testcase/rtTestStatus.php
diff -u phpruntests/src/testcase/rtTestStatus.php:1.2 
phpruntests/src/testcase/rtTestStatus.php:1.3
--- phpruntests/src/testcase/rtTestStatus.php:1.2   Tue Jun  2 19:12:07 2009
+++ phpruntests/src/testcase/rtTestStatus.php   Sun Jun  7 11:06:51 2009
@@ -17,7 +17,7 @@
 private $testName;
 private $states = array();
 private $messages = array();
-private $stateName = array ('skip',
+private $testStateNames = array ('skip',
 'bork',
 'warn',
 'xfail',
@@ -29,14 +29,15 @@
 'pass_headers',
 );
 
-public function __construct()
+public function __construct($testName)
 {
+$this->testName = $testName;
 $this->init();
 }
 
 private function init()
 {
-foreach ($this->stateName as $name) {
+foreach ($this->testStateNames as $name) {
 $this->states[$name] = false;
 $this->messages[$name] = '';
 }
@@ -62,12 +63,8 @@
 return $this->messages[$name];
 }
 
-public function getName() {
-return $this->stateName;
-}
-
-public function setTestName($name) {
-$this->testName = $name;
+public function getTestStateNames() {
+return $this->testStateNames;
 }
 
 public function getTestName() {
http://cvs.php.net/viewvc.cgi/phpruntests/src/testcase/rtTestDifference.php?r1=1.5&r2=1.6&diff_format=u
Index: phpruntests/src/testcase/rtTestDifference.php
diff -u phpruntests/src/testcase/rtTestDifference.php:1.5 
phpruntests/src/testcase/rtTestDifference.php:1.6
--- phpruntests/src/testcase/rtTestDifference.php:1.5   Fri Jun  5 09:30:19 2009
+++ phpruntests/src/testcase/rtTestDifference.php   Sun Jun  7 11:06:51 2009
@@ -62,7 +62,6 @@
  */
 public function generateArrayDiff($ar1, $ar2, $is_reg, $w)
 {
-var_dump($is_reg);
  
 file_put_contents("/home/zoe/bug/ar1_my.out", $ar1);
 file_put_contents("/home/zoe/bug/ar2_my.out", $ar2);
@@ -204,8 +203,6 @@
 public function compLine($l1, $l2, $is_reg)
 {
 if ($is_reg) {
-  /*  var_dump($l1);
-var_dump($l2);*/
 return preg_match((binary) "/^$l1$/s", (binary) $l2);
 } else {
 return !strcmp((binary) $l1, (binary) $l2);
http://cvs.php.net/viewvc.cgi/phpruntests/src/testcase/output/rtTestOutputWriterList.php?r1=1.4&r2=1.5&diff_format=u
Index: phpruntests/src/testcase/output/rtTestOutputWriterList.php
diff -u phpruntests/src/testcase/output/rtTestOutputWriterList.php:1.4 
phpruntests/src/testcase/output/rtTestOutputWriterList.php:1.5
--- phpruntests/src/testcase/output/rtTestOutputWriterList.php:1.4  Tue Jun 
 2 19:12:08 2009
+++ phpruntests/src/testcase/output/rtTestOutputWriterList.php  Sun Jun  7 
11:06:51 2009
@@ -33,7 +33,7 @@
 foreach ($testResults as $testResult) {
 $outputString = "";
 $testStatus = $testResult->getStatus();
-foreach($testStatus->getName() as $name) {
+foreach($testStatus->getTestStateNames() as $name) {
 if($testStatus->getValue($name)) {
 $outputString .= " ". strtoupper($name);
 $outputString .= " " . $testStatus->getMessage($name);
http://cvs.php.net/viewvc.cgi/phpruntests/src/testrun/rtPhpTestRun.php?r1=1.10&r2=1.11&diff_format=u
Index: phpruntests/src/testrun/rtPhpTestRun.php
diff -u phpruntests/src/testrun/rtPhpTestRun.php:1.10 
phpruntests/src/testrun/rtPhpTestRun.php:1.11
--- phpruntests/src/testrun/rtPhpTestRun.php:1.10   Tue Jun  2 19:52:53 2009
+++ phpruntests/src/testrun/rtPhpTestRun.phpSun Jun  7 11:06:51 2009
@@ -89,8 +89,8 @@
 $testFile->doRead($testName);
 $testFile->normaliseLineEndings($testName);
 
-$testStatus = new rtTestStatus();
-$testStatus->setTestName($testFile->getTestName());
+$testStatus = new rtTestStatus($testFile->getTestName());
+   
 
 if ($testFile->arePreconditionsMet()) {
 
http://cvs.php.net/viewvc.cgi/phpruntests/src/testgroup/rtPhpTestGroup.php?r1=1.7&r2=1.8&diff_format=u
Index: phpruntests/src/testgroup/rtPhpTestGroup.php
diff -u phpruntests/src/testgroup/rtPhpTestGroup.php:1.7 
phpruntests/src/testgroup/rtPhpTestGroup.php:1.8
--

[PHP-CVS] cvs: phpruntests /src/testcase/sections/executablesections rtFileExternalSection.php

2009-06-07 Thread Zoe Slattery
zoe Sun Jun  7 08:34:15 2009 UTC

  Modified files:  
/phpruntests/src/testcase/sections/executablesections   

rtFileExternalSection.php 
  Log:
  fixed typo
  
http://cvs.php.net/viewvc.cgi/phpruntests/src/testcase/sections/executablesections/rtFileExternalSection.php?r1=1.7&r2=1.8&diff_format=u
Index: 
phpruntests/src/testcase/sections/executablesections/rtFileExternalSection.php
diff -u 
phpruntests/src/testcase/sections/executablesections/rtFileExternalSection.php:1.7
 
phpruntests/src/testcase/sections/executablesections/rtFileExternalSection.php:1.8
--- 
phpruntests/src/testcase/sections/executablesections/rtFileExternalSection.php:1.7
  Tue Jun  2 19:12:08 2009
+++ 
phpruntests/src/testcase/sections/executablesections/rtFileExternalSection.php  
Sun Jun  7 08:34:15 2009
@@ -51,7 +51,7 @@
 }

 $this->sectionContents[0] = file_get_contents($file);
-return $this->testStatus;
+return $testStatus;
 }
 
 public function writeExecutableFile() {



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