[PHP-CVS] cvs: php-src /ext/oci8/tests details.inc function_aliases.phpt lob_aliases.phpt num.phpt statement_type.phpt statement_type_old.phpt

2006-12-27 Thread Antony Dovgal
tony2001Wed Dec 27 09:48:05 2006 UTC

  Added files: 
/php-src/ext/oci8/tests function_aliases.phpt lob_aliases.phpt 

  Modified files:  
/php-src/ext/oci8/tests details.inc num.phpt statement_type.phpt 
statement_type_old.phpt 
  Log:
  more test improvements by Chris Jones
  
  http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/details.inc?r1=1.1r2=1.2diff_format=u
Index: php-src/ext/oci8/tests/details.inc
diff -u php-src/ext/oci8/tests/details.inc:1.1 
php-src/ext/oci8/tests/details.inc:1.2
--- php-src/ext/oci8/tests/details.inc:1.1  Tue Dec 12 12:57:02 2006
+++ php-src/ext/oci8/tests/details.inc  Wed Dec 27 09:48:05 2006
@@ -7,7 +7,7 @@
 
 $user   = system;
 $password   = system;
-$dbase  = oracle;
+$dbase  = HP;
 
 /* Set this variable to TRUE if Oracle is installed @ localhost */
 
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/num.phpt?r1=1.3r2=1.4diff_format=u
Index: php-src/ext/oci8/tests/num.phpt
diff -u php-src/ext/oci8/tests/num.phpt:1.3 php-src/ext/oci8/tests/num.phpt:1.4
--- php-src/ext/oci8/tests/num.phpt:1.3 Tue Dec  6 19:26:57 2005
+++ php-src/ext/oci8/tests/num.phpt Wed Dec 27 09:48:05 2006
@@ -8,32 +8,117 @@
 require dirname(__FILE__)./connect.inc;
 require dirname(__FILE__).'/create_table.inc';
 
+echo Test 1\n;
+var_dump(ocirowcount());
+var_dump(oci_num_rows());
+var_dump(ocinumcols());
+var_dump(oci_num_fields());
+
 $insert_sql = INSERT INTO .$schema.$table_name. (id, value) VALUES (1,1);
 
 if (!($s = oci_parse($c, $insert_sql))) {
-   die(oci_parse(insert) failed!\n);
+  die(oci_parse(insert) failed!\n);
 }
 
+echo Test 2\n;
+var_dump(ocirowcount($s));
+var_dump(oci_num_rows($s));
+var_dump(ocinumcols($s));
+var_dump(oci_num_fields($s));
+
 for ($i = 0; $i3; $i++) {
-   if (!oci_execute($s)) {
-   die(oci_execute(insert) failed!\n);
-   }
+  if (!oci_execute($s)) {
+die(oci_execute(insert) failed!\n);
+  }
 }
 
+echo Test 3\n;
+var_dump(ocirowcount($s));
+var_dump(oci_num_rows($s));
+var_dump(ocinumcols($s));
+var_dump(oci_num_fields($s));
+
 if (!oci_commit($c)) {
-   die(oci_commit() failed!\n);
+  die(oci_commit() failed!\n);
 }
 
+echo Test 4\n;
+var_dump(ocirowcount($s));
+var_dump(oci_num_rows($s));
+var_dump(ocinumcols($s));
+var_dump(oci_num_fields($s));
+
+// All rows
 $select_sql = SELECT * FROM .$schema.$table_name.;
 
 if (!($s = oci_parse($c, $select_sql))) {
-   die(oci_parse(select) failed!\n);
+  die(oci_parse(select) failed!\n);
+}
+
+echo Test 5a\n;
+var_dump(ocirowcount($s));
+var_dump(oci_num_rows($s));
+var_dump(ocinumcols($s));
+var_dump(oci_num_fields($s));
+
+if (!oci_execute($s)) {
+  die(oci_execute(select) failed!\n);
+}
+
+echo Test 5b\n;
+var_dump(ocirowcount($s));
+var_dump(oci_num_rows($s));
+var_dump(ocinumcols($s));
+var_dump(oci_num_fields($s));
+
+
+if (oci_fetch_all($s,$r) === false) {
+  die(oci_fetch_all(select) failed!\n);
+}
+
+echo Test 5c\n;
+var_dump(ocirowcount($s));
+var_dump(oci_num_rows($s));
+var_dump(ocinumcols($s));
+var_dump(oci_num_fields($s));
+
+// One row
+$select_sql = SELECT id, value FROM .$schema.$table_name. WHERE ROWNUM  2;
+
+if (!($s = oci_parse($c, $select_sql))) {
+  die(oci_parse(select) failed!\n);
+}
+
+if (!oci_execute($s)) {
+  die(oci_execute(select) failed!\n);
+}
+
+if (oci_fetch_all($s,$r) === false) {
+  die(oci_fetch_all(select) failed!\n);
+}
+
+echo Test 6\n;
+var_dump(ocirowcount($s));
+var_dump(oci_num_rows($s));
+var_dump(ocinumcols($s));
+var_dump(oci_num_fields($s));
+
+// No rows
+$select_sql = SELECT id FROM .$schema.$table_name. WHERE 1=0;
+
+if (!($s = oci_parse($c, $select_sql))) {
+  die(oci_parse(select) failed!\n);
 }
 
 if (!oci_execute($s)) {
-   die(oci_execute(select) failed!\n);
+  die(oci_execute(select) failed!\n);
+}
+
+if (oci_fetch_all($s,$r) === false) {
+  die(oci_fetch_all(select) failed!\n);
 }
 
+echo Test 7\n;
 var_dump(ocirowcount($s));
 var_dump(oci_num_rows($s));
 var_dump(ocinumcols($s));
@@ -48,19 +133,89 @@
 if (!oci_execute($s)) {
 die(oci_execute(delete) failed!\n);
 }
+
+echo Test 8a\n;
+var_dump(ocirowcount($s));
+var_dump(oci_num_rows($s));
+var_dump(ocinumcols($s));
+var_dump(oci_num_fields($s));
+
+
 oci_commit($c);
 
+echo Test 8b\n;
+var_dump(ocirowcount($s));
 var_dump(oci_num_rows($s));
+var_dump(ocinumcols($s));
+var_dump(oci_num_fields($s));
 
 require dirname(__FILE__).'/drop_table.inc';
 
 echo Done\n;
 
 ?
---EXPECT--
+--EXPECTF--
+Test 1
+
+Warning: ocirowcount() expects exactly 1 parameter, 0 given in %s on line %d
+NULL
+
+Warning: oci_num_rows() expects exactly 1 parameter, 0 given in %s on line %d
+NULL
+
+Warning: ocinumcols() expects exactly 1 parameter, 0 given in %s on line %d
+NULL
+
+Warning: oci_num_fields() expects exactly 1 parameter, 0 given in %s on line %d
+NULL
+Test 2
+int(0)
 int(0)
 int(0)
+int(0)
+Test 3
+int(1)
+int(1)
+int(0)
+int(0)
+Test 4
+int(1)
+int(1)
+int(0)

[PHP-CVS] cvs: php-src /ext/oci8/tests details.inc

2006-12-27 Thread Antony Dovgal
tony2001Wed Dec 27 09:49:06 2006 UTC

  Modified files:  
/php-src/ext/oci8/tests details.inc 
  Log:
  that should not be there..
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/details.inc?r1=1.2r2=1.3diff_format=u
Index: php-src/ext/oci8/tests/details.inc
diff -u php-src/ext/oci8/tests/details.inc:1.2 
php-src/ext/oci8/tests/details.inc:1.3
--- php-src/ext/oci8/tests/details.inc:1.2  Wed Dec 27 09:48:05 2006
+++ php-src/ext/oci8/tests/details.inc  Wed Dec 27 09:49:06 2006
@@ -7,7 +7,7 @@
 
 $user   = system;
 $password   = system;
-$dbase  = HP;
+$dbase  = oracle;
 
 /* Set this variable to TRUE if Oracle is installed @ localhost */
 

-- 
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/oci8/tests function_aliases.phpt lob_aliases.phpt num.phpt statement_type.phpt statement_type_old.phpt

2006-12-27 Thread Antony Dovgal
tony2001Wed Dec 27 09:49:53 2006 UTC

  Added files: (Branch: PHP_5_2)
/php-src/ext/oci8/tests function_aliases.phpt lob_aliases.phpt 

  Modified files:  
/php-src/ext/oci8/tests num.phpt statement_type_old.phpt 
statement_type.phpt 
  Log:
  MFH more test improvements by Chris Jones
  
  http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/num.phpt?r1=1.1.2.3r2=1.1.2.3.2.1diff_format=u
Index: php-src/ext/oci8/tests/num.phpt
diff -u php-src/ext/oci8/tests/num.phpt:1.1.2.3 
php-src/ext/oci8/tests/num.phpt:1.1.2.3.2.1
--- php-src/ext/oci8/tests/num.phpt:1.1.2.3 Tue Dec  6 19:28:25 2005
+++ php-src/ext/oci8/tests/num.phpt Wed Dec 27 09:49:53 2006
@@ -8,32 +8,117 @@
 require dirname(__FILE__)./connect.inc;
 require dirname(__FILE__).'/create_table.inc';
 
+echo Test 1\n;
+var_dump(ocirowcount());
+var_dump(oci_num_rows());
+var_dump(ocinumcols());
+var_dump(oci_num_fields());
+
 $insert_sql = INSERT INTO .$schema.$table_name. (id, value) VALUES (1,1);
 
 if (!($s = oci_parse($c, $insert_sql))) {
-   die(oci_parse(insert) failed!\n);
+  die(oci_parse(insert) failed!\n);
 }
 
+echo Test 2\n;
+var_dump(ocirowcount($s));
+var_dump(oci_num_rows($s));
+var_dump(ocinumcols($s));
+var_dump(oci_num_fields($s));
+
 for ($i = 0; $i3; $i++) {
-   if (!oci_execute($s)) {
-   die(oci_execute(insert) failed!\n);
-   }
+  if (!oci_execute($s)) {
+die(oci_execute(insert) failed!\n);
+  }
 }
 
+echo Test 3\n;
+var_dump(ocirowcount($s));
+var_dump(oci_num_rows($s));
+var_dump(ocinumcols($s));
+var_dump(oci_num_fields($s));
+
 if (!oci_commit($c)) {
-   die(oci_commit() failed!\n);
+  die(oci_commit() failed!\n);
 }
 
+echo Test 4\n;
+var_dump(ocirowcount($s));
+var_dump(oci_num_rows($s));
+var_dump(ocinumcols($s));
+var_dump(oci_num_fields($s));
+
+// All rows
 $select_sql = SELECT * FROM .$schema.$table_name.;
 
 if (!($s = oci_parse($c, $select_sql))) {
-   die(oci_parse(select) failed!\n);
+  die(oci_parse(select) failed!\n);
+}
+
+echo Test 5a\n;
+var_dump(ocirowcount($s));
+var_dump(oci_num_rows($s));
+var_dump(ocinumcols($s));
+var_dump(oci_num_fields($s));
+
+if (!oci_execute($s)) {
+  die(oci_execute(select) failed!\n);
+}
+
+echo Test 5b\n;
+var_dump(ocirowcount($s));
+var_dump(oci_num_rows($s));
+var_dump(ocinumcols($s));
+var_dump(oci_num_fields($s));
+
+
+if (oci_fetch_all($s,$r) === false) {
+  die(oci_fetch_all(select) failed!\n);
+}
+
+echo Test 5c\n;
+var_dump(ocirowcount($s));
+var_dump(oci_num_rows($s));
+var_dump(ocinumcols($s));
+var_dump(oci_num_fields($s));
+
+// One row
+$select_sql = SELECT id, value FROM .$schema.$table_name. WHERE ROWNUM  2;
+
+if (!($s = oci_parse($c, $select_sql))) {
+  die(oci_parse(select) failed!\n);
+}
+
+if (!oci_execute($s)) {
+  die(oci_execute(select) failed!\n);
+}
+
+if (oci_fetch_all($s,$r) === false) {
+  die(oci_fetch_all(select) failed!\n);
+}
+
+echo Test 6\n;
+var_dump(ocirowcount($s));
+var_dump(oci_num_rows($s));
+var_dump(ocinumcols($s));
+var_dump(oci_num_fields($s));
+
+// No rows
+$select_sql = SELECT id FROM .$schema.$table_name. WHERE 1=0;
+
+if (!($s = oci_parse($c, $select_sql))) {
+  die(oci_parse(select) failed!\n);
 }
 
 if (!oci_execute($s)) {
-   die(oci_execute(select) failed!\n);
+  die(oci_execute(select) failed!\n);
+}
+
+if (oci_fetch_all($s,$r) === false) {
+  die(oci_fetch_all(select) failed!\n);
 }
 
+echo Test 7\n;
 var_dump(ocirowcount($s));
 var_dump(oci_num_rows($s));
 var_dump(ocinumcols($s));
@@ -48,19 +133,89 @@
 if (!oci_execute($s)) {
 die(oci_execute(delete) failed!\n);
 }
+
+echo Test 8a\n;
+var_dump(ocirowcount($s));
+var_dump(oci_num_rows($s));
+var_dump(ocinumcols($s));
+var_dump(oci_num_fields($s));
+
+
 oci_commit($c);
 
+echo Test 8b\n;
+var_dump(ocirowcount($s));
 var_dump(oci_num_rows($s));
+var_dump(ocinumcols($s));
+var_dump(oci_num_fields($s));
 
 require dirname(__FILE__).'/drop_table.inc';
 
 echo Done\n;
 
 ?
---EXPECT--
+--EXPECTF--
+Test 1
+
+Warning: ocirowcount() expects exactly 1 parameter, 0 given in %s on line %d
+NULL
+
+Warning: oci_num_rows() expects exactly 1 parameter, 0 given in %s on line %d
+NULL
+
+Warning: ocinumcols() expects exactly 1 parameter, 0 given in %s on line %d
+NULL
+
+Warning: oci_num_fields() expects exactly 1 parameter, 0 given in %s on line %d
+NULL
+Test 2
+int(0)
 int(0)
 int(0)
+int(0)
+Test 3
+int(1)
+int(1)
+int(0)
+int(0)
+Test 4
+int(1)
+int(1)
+int(0)
+int(0)
+Test 5a
+int(0)
+int(0)
+int(0)
+int(0)
+Test 5b
+int(0)
+int(0)
+int(5)
+int(5)
+Test 5c
+int(3)
+int(3)
 int(5)
 int(5)
+Test 6
+int(1)
+int(1)
+int(2)
+int(2)
+Test 7
+int(0)
+int(0)
+int(1)
+int(1)
+Test 8a
+int(3)
 int(3)
+int(0)
+int(0)
+Test 8b
+int(3)
+int(3)
+int(0)
+int(0)
 Done
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/tests/statement_type_old.phpt?r1=1.1.2.3r2=1.1.2.3.2.1diff_format=u
Index: php-src/ext/oci8/tests/statement_type_old.phpt
diff -u 

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

2006-12-27 Thread Antony Dovgal
tony2001Wed Dec 27 10:30:48 2006 UTC

  Modified files:  
/php-src/ext/pdo_ocioci_statement.c 
  Log:
  initialize memory with 0's, so we won't get garbage if the statement does not 
set the var
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/pdo_oci/oci_statement.c?r1=1.20r2=1.21diff_format=u
Index: php-src/ext/pdo_oci/oci_statement.c
diff -u php-src/ext/pdo_oci/oci_statement.c:1.20 
php-src/ext/pdo_oci/oci_statement.c:1.21
--- php-src/ext/pdo_oci/oci_statement.c:1.20Sat Mar 18 22:06:45 2006
+++ php-src/ext/pdo_oci/oci_statement.c Wed Dec 27 10:30:47 2006
@@ -16,7 +16,7 @@
   +--+
 */
 
-/* $Id: oci_statement.c,v 1.20 2006/03/18 22:06:45 tony2001 Exp $ */
+/* $Id: oci_statement.c,v 1.21 2006/12/27 10:30:47 tony2001 Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -204,7 +204,7 @@
zval_dtor(param-parameter);
 
Z_STRLEN_P(param-parameter) = param-max_value_len;
-   Z_STRVAL_P(param-parameter) = emalloc(Z_STRLEN_P(param-parameter)+1);
+   Z_STRVAL_P(param-parameter) = ecalloc(1, 
Z_STRLEN_P(param-parameter)+1);
P-used_for_output = 1;
 
P-actual_len = Z_STRLEN_P(param-parameter);   

-- 
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/pdo_oci oci_statement.c

2006-12-27 Thread Antony Dovgal
tony2001Wed Dec 27 10:31:10 2006 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/pdo_ocioci_statement.c 
  Log:
  MFH
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/pdo_oci/oci_statement.c?r1=1.16.2.10r2=1.16.2.10.2.1diff_format=u
Index: php-src/ext/pdo_oci/oci_statement.c
diff -u php-src/ext/pdo_oci/oci_statement.c:1.16.2.10 
php-src/ext/pdo_oci/oci_statement.c:1.16.2.10.2.1
--- php-src/ext/pdo_oci/oci_statement.c:1.16.2.10   Sat Mar 18 22:06:30 2006
+++ php-src/ext/pdo_oci/oci_statement.c Wed Dec 27 10:31:10 2006
@@ -16,7 +16,7 @@
   +--+
 */
 
-/* $Id: oci_statement.c,v 1.16.2.10 2006/03/18 22:06:30 tony2001 Exp $ */
+/* $Id: oci_statement.c,v 1.16.2.10.2.1 2006/12/27 10:31:10 tony2001 Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -222,7 +222,7 @@
zval_dtor(param-parameter);
 
Z_STRLEN_P(param-parameter) = param-max_value_len;
-   Z_STRVAL_P(param-parameter) = emalloc(Z_STRLEN_P(param-parameter)+1);
+   Z_STRVAL_P(param-parameter) = ecalloc(1, 
Z_STRLEN_P(param-parameter)+1);
P-used_for_output = 1;
 
P-actual_len = Z_STRLEN_P(param-parameter);   

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



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

2006-12-27 Thread Nuno Lopes
nlopess Wed Dec 27 15:11:35 2006 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/standard/tests/strings htmlentities02.phpt 
  Log:
  add [EMAIL PROTECTED] to the setlocale list
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/htmlentities02.phpt?r1=1.8r2=1.8.6.1diff_format=u
Index: php-src/ext/standard/tests/strings/htmlentities02.phpt
diff -u php-src/ext/standard/tests/strings/htmlentities02.phpt:1.8 
php-src/ext/standard/tests/strings/htmlentities02.phpt:1.8.6.1
--- php-src/ext/standard/tests/strings/htmlentities02.phpt:1.8  Mon May 26 
22:16:14 2003
+++ php-src/ext/standard/tests/strings/htmlentities02.phpt  Wed Dec 27 
15:11:35 2006
@@ -2,7 +2,7 @@
 htmlentities() test 2 (setlocale / fr_FR.ISO-8859-15) 
 --SKIPIF--
 ?php
-$result = (bool)setlocale(LC_CTYPE, fr_FR.ISO-8859-15, fr_FR.ISO8859-15);
+$result = (bool)setlocale(LC_CTYPE, fr_FR.ISO-8859-15, fr_FR.ISO8859-15, 
'[EMAIL PROTECTED]');
 if (!$result || preg_match('/ISO/i', setlocale(LC_CTYPE, 0)) == 0) {
die(skip setlocale() failed\n);
 }
@@ -14,7 +14,7 @@
 mbstring.internal_encoding=none
 --FILE--
 ?php
-   setlocale( LC_CTYPE, fr_FR.ISO-8859-15, fr_FR.ISO8859-15 );
+   setlocale(LC_CTYPE, fr_FR.ISO-8859-15, fr_FR.ISO8859-15, '[EMAIL 
PROTECTED]');
var_dump(htmlentities(\xbc\xbd\xbe, ENT_QUOTES, ''));
 ?
 --EXPECT--

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



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

2006-12-27 Thread Nuno Lopes
nlopess Wed Dec 27 15:17:04 2006 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/standard/tests/strings htmlentities02.phpt 
  Log:
  oops: remove uneeded code in the skip condition
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/htmlentities02.phpt?r1=1.8.6.1r2=1.8.6.2diff_format=u
Index: php-src/ext/standard/tests/strings/htmlentities02.phpt
diff -u php-src/ext/standard/tests/strings/htmlentities02.phpt:1.8.6.1 
php-src/ext/standard/tests/strings/htmlentities02.phpt:1.8.6.2
--- php-src/ext/standard/tests/strings/htmlentities02.phpt:1.8.6.1  Wed Dec 
27 15:11:35 2006
+++ php-src/ext/standard/tests/strings/htmlentities02.phpt  Wed Dec 27 
15:17:04 2006
@@ -3,7 +3,7 @@
 --SKIPIF--
 ?php
 $result = (bool)setlocale(LC_CTYPE, fr_FR.ISO-8859-15, fr_FR.ISO8859-15, 
'[EMAIL PROTECTED]');
-if (!$result || preg_match('/ISO/i', setlocale(LC_CTYPE, 0)) == 0) {
+if (!$result) {
die(skip setlocale() failed\n);
 }
 echo warn possibly braindead libc\n;

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

2006-12-27 Thread Nuno Lopes
nlopess Wed Dec 27 15:18:16 2006 UTC

  Modified files:  
/php-src/ext/standard/tests/strings htmlentities02.phpt 
  Log:
  MFB
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/htmlentities02.phpt?r1=1.8r2=1.9diff_format=u
Index: php-src/ext/standard/tests/strings/htmlentities02.phpt
diff -u php-src/ext/standard/tests/strings/htmlentities02.phpt:1.8 
php-src/ext/standard/tests/strings/htmlentities02.phpt:1.9
--- php-src/ext/standard/tests/strings/htmlentities02.phpt:1.8  Mon May 26 
22:16:14 2003
+++ php-src/ext/standard/tests/strings/htmlentities02.phpt  Wed Dec 27 
15:18:15 2006
@@ -2,8 +2,8 @@
 htmlentities() test 2 (setlocale / fr_FR.ISO-8859-15) 
 --SKIPIF--
 ?php
-$result = (bool)setlocale(LC_CTYPE, fr_FR.ISO-8859-15, fr_FR.ISO8859-15);
-if (!$result || preg_match('/ISO/i', setlocale(LC_CTYPE, 0)) == 0) {
+$result = (bool)setlocale(LC_CTYPE, fr_FR.ISO-8859-15, fr_FR.ISO8859-15, 
'[EMAIL PROTECTED]');
+if (!$result) {
die(skip setlocale() failed\n);
 }
 echo warn possibly braindead libc\n;
@@ -14,7 +14,7 @@
 mbstring.internal_encoding=none
 --FILE--
 ?php
-   setlocale( LC_CTYPE, fr_FR.ISO-8859-15, fr_FR.ISO8859-15 );
+   setlocale(LC_CTYPE, fr_FR.ISO-8859-15, fr_FR.ISO8859-15, '[EMAIL 
PROTECTED]');
var_dump(htmlentities(\xbc\xbd\xbe, ENT_QUOTES, ''));
 ?
 --EXPECT--

-- 
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/session/tests 008.phpt

2006-12-27 Thread Nuno Lopes
nlopess Wed Dec 27 15:22:28 2006 UTC

  Removed files:   (Branch: PHP_5_2)
/php-src/ext/session/tests  008.phpt 
  Log:
  die(skip this is for PHP  4.2.3);
  

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



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

2006-12-27 Thread Antony Dovgal
tony2001Wed Dec 27 15:22:46 2006 UTC

  Modified files:  
/php-src/main   php_streams.h 
  Log:
  fix php_stream_u_get_line() macro
  
  
http://cvs.php.net/viewvc.cgi/php-src/main/php_streams.h?r1=1.118r2=1.119diff_format=u
Index: php-src/main/php_streams.h
diff -u php-src/main/php_streams.h:1.118 php-src/main/php_streams.h:1.119
--- php-src/main/php_streams.h:1.118Thu Nov  9 01:06:45 2006
+++ php-src/main/php_streams.h  Wed Dec 27 15:22:46 2006
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: php_streams.h,v 1.118 2006/11/09 01:06:45 tony2001 Exp $ */
+/* $Id: php_streams.h,v 1.119 2006/12/27 15:22:46 tony2001 Exp $ */
 
 #ifndef PHP_STREAMS_H
 #define PHP_STREAMS_H
@@ -335,7 +335,7 @@
 
 
 PHPAPI UChar *_php_stream_u_get_line(php_stream *stream, UChar *buf, int32_t 
*pmax_bytes, int32_t *pmax_chars, int *pis_unicode TSRMLS_DC);
-#define php_stream_u_get_line(stream, buf, maxlen_buf, maxlen_chars, buf_type) 
_php_stream_u_get_line((stream), (buf), (maxlen_buf), (maxlen_chars), 
(buf_type) TSRMLS_CC)
+#define php_stream_u_get_line(stream, buf, maxlen_buf, maxlen_chars, retlen)   
_php_stream_get_line((stream), IS_UNICODE, (buf), (maxlen_buf), (maxlen_chars), 
(retlen) TSRMLS_CC)
 
 /* CAREFUL! this is equivalent to puts NOT fputs! */
 PHPAPI int _php_stream_puts(php_stream *stream, char *buf TSRMLS_DC);

-- 
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 fscanf.phpt /ext/standard/tests/strings bug21730.phpt

2006-12-27 Thread Antony Dovgal
tony2001Wed Dec 27 15:26:13 2006 UTC

  Modified files:  
/php-src/ext/standard/tests/filefscanf.phpt 
/php-src/ext/standard/tests/strings bug21730.phpt 
  Log:
  fix *scanf() tests
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/file/fscanf.phpt?r1=1.1r2=1.2diff_format=u
Index: php-src/ext/standard/tests/file/fscanf.phpt
diff -u php-src/ext/standard/tests/file/fscanf.phpt:1.1 
php-src/ext/standard/tests/file/fscanf.phpt:1.2
--- php-src/ext/standard/tests/file/fscanf.phpt:1.1 Tue Nov 14 21:59:02 2006
+++ php-src/ext/standard/tests/file/fscanf.phpt Wed Dec 27 15:26:13 2006
@@ -11,17 +11,17 @@
 
 file_put_contents($filename, data);
 
-$fp = fopen($filename, r);
+$fp = fopen($filename, rt);
 var_dump(fscanf($fp, %d, $v));
 var_dump($v);
 fclose($fp);
 
-$fp = fopen($filename, r);
+$fp = fopen($filename, rt);
 var_dump(fscanf($fp, %s, $v));
 var_dump($v);
 fclose($fp);
 
-$fp = fopen($filename, r);
+$fp = fopen($filename, rt);
 var_dump(fscanf($fp, %s, $v, $v1));
 var_dump($v);
 var_dump($v1);
@@ -29,7 +29,7 @@
 
 $v = array();
 $v1 = array();
-$fp = fopen($filename, r);
+$fp = fopen($filename, rt);
 var_dump(fscanf($fp, , $v, $v1));
 var_dump($v);
 var_dump($v1);
@@ -37,7 +37,7 @@
 
 $v = array();
 $v1 = array();
-$fp = fopen($filename, r);
+$fp = fopen($filename, rt);
 var_dump(fscanf($fp, %.a, $v, $v1));
 var_dump($v);
 var_dump($v1);
@@ -46,14 +46,14 @@
 @unlink($filename);
 touch($filename);
 
-$fp = fopen($filename, r);
+$fp = fopen($filename, rt);
 var_dump(fscanf($fp, %s, $v));
 var_dump($v);
 fclose($fp);
 
 file_put_contents($filename, data);
 
-$fp = fopen($filename, r);
+$fp = fopen($filename, rt);
 var_dump(fscanf($fp, %s%d, $v));
 
 @unlink($filename);
@@ -98,3 +98,42 @@
 Warning: fscanf(): Different numbers of variable names and field specifiers in 
%s on line %d
 int(-1)
 Done
+--UEXPECTF--
+Warning: Wrong parameter count for fscanf() in %s on line %d
+NULL
+
+Warning: Wrong parameter count for fscanf() in %s on line %d
+NULL
+
+Warning: fscanf(): supplied argument is not a valid File-Handle resource in %s 
on line %d
+bool(false)
+int(0)
+NULL
+int(1)
+unicode(4) data
+
+Warning: fscanf(): Variable is not assigned by any conversion specifiers in %s 
on line %d
+int(-1)
+unicode(4) data
+NULL
+
+Warning: fscanf(): Variable is not assigned by any conversion specifiers in %s 
on line %d
+int(-1)
+array(0) {
+}
+array(0) {
+}
+
+Warning: fscanf(): Bad scan conversion character . in %s on line %d
+int(-1)
+array(0) {
+}
+array(0) {
+}
+bool(false)
+array(0) {
+}
+
+Warning: fscanf(): Different numbers of variable names and field specifiers in 
%s on line %d
+int(-1)
+Done
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/bug21730.phpt?r1=1.2r2=1.3diff_format=u
Index: php-src/ext/standard/tests/strings/bug21730.phpt
diff -u php-src/ext/standard/tests/strings/bug21730.phpt:1.2 
php-src/ext/standard/tests/strings/bug21730.phpt:1.3
--- php-src/ext/standard/tests/strings/bug21730.phpt:1.2Sat Jan 18 
19:02:21 2003
+++ php-src/ext/standard/tests/strings/bug21730.phptWed Dec 27 15:26:13 2006
@@ -33,3 +33,20 @@
   [2]=
   int(9)
 }
+--UEXPECT--
+array(3) {
+  [0]=
+  unicode(3) ABC
+  [1]=
+  unicode(3) DEF
+  [2]=
+  int(9)
+}
+array(3) {
+  [0]=
+  unicode(3) ABC
+  [1]=
+  unicode(3) DEF
+  [2]=
+  int(9)
+}

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



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

2006-12-27 Thread Antony Dovgal
tony2001Wed Dec 27 19:07:28 2006 UTC

  Modified files:  
/php-src/ext/standard   math.c 
  Log:
  NULL is a special value for number_format() meaning use default separator
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/math.c?r1=1.140r2=1.141diff_format=u
Index: php-src/ext/standard/math.c
diff -u php-src/ext/standard/math.c:1.140 php-src/ext/standard/math.c:1.141
--- php-src/ext/standard/math.c:1.140   Fri Dec 22 21:18:30 2006
+++ php-src/ext/standard/math.c Wed Dec 27 19:07:28 2006
@@ -19,7 +19,7 @@
+--+
 */
 
-/* $Id: math.c,v 1.140 2006/12/22 21:18:30 andrei Exp $ */
+/* $Id: math.c,v 1.141 2006/12/27 19:07:28 tony2001 Exp $ */
 
 #include php.h
 #include php_math.h
@@ -1018,30 +1018,30 @@
Formats a number with grouped thousands */
 PHP_FUNCTION(number_format)
 {
-   char *sep1 = NULL, *sep2 = NULL;
-   int sep1_len, sep2_len;
+   zval *sep1 = NULL, *sep2 = NULL;
double num;
int dec = 0;
char thousand_sep=',', dec_point='.';
char *tmp;

-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, d|lss, num, 
dec,
- sep1, sep1_len, 
UG(ascii_conv),
- sep2, sep2_len, 
UG(ascii_conv)) == FAILURE) {
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, d|lzz, num, 
dec, sep1, sep2) == FAILURE) {
return;
}
 
-   if (sep1) {
-   if (sep1_len = 1) {
-   dec_point = sep1[0];
-   } else if (sep1_len == 0) {
+   if (sep1  Z_TYPE_P(sep1) != IS_NULL) {
+   convert_to_string_with_converter(sep1, UG(ascii_conv));
+   if (Z_STRLEN_P(sep1)) {
+   dec_point  = Z_STRVAL_P(sep1)[0];
+   } else {
dec_point = 0;
}
}
-   if (sep2) {
-   if (sep2_len = 1) {
-   thousand_sep = sep2[0];
-   } else if (sep2_len == 0) {
+
+   if (sep2  Z_TYPE_P(sep2) != IS_NULL) {
+   convert_to_string_with_converter(sep2, UG(ascii_conv));
+   if (Z_STRLEN_P(sep2)) {
+   thousand_sep = Z_STRVAL_P(sep2)[0];
+   } else {
thousand_sep = 0;
}
}

-- 
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 include_path.phpt parse_ini_file.phpt /ext/standard/tests/strings bug20108.phpt bug25671.phpt bug27278.phpt bug39873.phpt /ext/standard/t

2006-12-27 Thread Antony Dovgal
tony2001Wed Dec 27 19:17:02 2006 UTC

  Modified files:  
/php-src/ext/standard/tests/general_functions   include_path.phpt 
parse_ini_file.phpt 
/php-src/ext/standard/tests/strings bug20108.phpt bug25671.phpt 
bug27278.phpt bug39873.phpt 
/php-src/ext/standard/tests/timebug38524.phpt 
  Log:
  fix tests
  
  http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/general_functions/include_path.phpt?r1=1.1r2=1.2diff_format=u
Index: php-src/ext/standard/tests/general_functions/include_path.phpt
diff -u php-src/ext/standard/tests/general_functions/include_path.phpt:1.1 
php-src/ext/standard/tests/general_functions/include_path.phpt:1.2
--- php-src/ext/standard/tests/general_functions/include_path.phpt:1.1  Thu Nov 
16 13:00:03 2006
+++ php-src/ext/standard/tests/general_functions/include_path.phpt  Wed Dec 
27 19:17:02 2006
@@ -44,14 +44,14 @@
 --EXPECTF--
 string(1) .
 
-Warning: Wrong parameter count for get_include_path() in %s on line %d
+Warning: get_include_path() expects exactly 0 parameters, 1 given in %s on 
line %d
 NULL
 NULL
 
-Warning: Wrong parameter count for restore_include_path() in %s on line %d
+Warning: restore_include_path() expects exactly 0 parameters, 1 given in %s on 
line %d
 NULL
 
-Warning: Wrong parameter count for set_include_path() in %s on line %d
+Warning: set_include_path() expects exactly 1 parameter, 0 given in %s on line 
%d
 NULL
 string(1) .
 string(1) .
@@ -67,9 +67,41 @@
 NULL
 string(1) .
 
-Notice: Array to string conversion in %s on line %d
+Warning: set_include_path() expects parameter 1 to be string (Unicode or 
binary), array given in %s on line %d
+NULL
 string(1) .
-string(5) Array
 NULL
 string(1) .
 Done
+--UEXPECTF--
+unicode(1) .
+
+Warning: get_include_path() expects exactly 0 parameters, 1 given in %s on 
line %d
+NULL
+NULL
+
+Warning: restore_include_path() expects exactly 0 parameters, 1 given in %s on 
line %d
+NULL
+
+Warning: set_include_path() expects exactly 1 parameter, 0 given in %s on line 
%d
+NULL
+unicode(1) .
+unicode(1) .
+unicode(3) var
+NULL
+unicode(1) .
+unicode(1) .
+unicode(14) .:/path/to/dir
+NULL
+unicode(1) .
+unicode(1) .
+unicode(1) .
+NULL
+unicode(1) .
+
+Warning: set_include_path() expects parameter 1 to be string (Unicode or 
binary), array given in %s on line %d
+NULL
+unicode(1) .
+NULL
+unicode(1) .
+Done
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/general_functions/parse_ini_file.phpt?r1=1.1r2=1.2diff_format=u
Index: php-src/ext/standard/tests/general_functions/parse_ini_file.phpt
diff -u php-src/ext/standard/tests/general_functions/parse_ini_file.phpt:1.1 
php-src/ext/standard/tests/general_functions/parse_ini_file.phpt:1.2
--- php-src/ext/standard/tests/general_functions/parse_ini_file.phpt:1.1
Thu Nov 16 13:00:03 2006
+++ php-src/ext/standard/tests/general_functions/parse_ini_file.phptWed Dec 
27 19:17:02 2006
@@ -95,10 +95,10 @@
 echo Done\n;
 ?
 --EXPECTF--
-Warning: Wrong parameter count for parse_ini_file() in %s on line %d
+Warning: parse_ini_file() expects at least 1 parameter, 0 given in %s on line 
%d
 NULL
 
-Warning: Wrong parameter count for parse_ini_file() in %s on line %d
+Warning: parse_ini_file() expects at most 2 parameters, 3 given in %s on line 
%d
 NULL
 
 Warning: parse_ini_file(%sparse_ini_file.dat): failed to open stream: No such 
file or directory in %s on line %d
@@ -173,3 +173,83 @@
   string(5) test4
 }
 Done
+--UEXPECTF--
+Warning: parse_ini_file() expects at least 1 parameter, 0 given in %s on line 
%d
+NULL
+
+Warning: parse_ini_file() expects at most 2 parameters, 3 given in %s on line 
%d
+NULL
+
+Warning: parse_ini_file(%sparse_ini_file.dat): failed to open stream: No such 
file or directory in %s on line %d
+array(0) {
+}
+
+Warning: parse_ini_file(%sparse_ini_file.dat): failed to open stream: No such 
file or directory in %s on line %d
+array(0) {
+}
+array(1) {
+  [utest]=
+  unicode(0) 
+}
+
+Warning: Error parsing %sparse_ini_file.dat on line 2
+ in %s on line %d
+array(1) {
+  [utest]=
+  unicode(0) 
+}
+
+Warning: Error parsing %sparse_ini_file.dat on line 2
+ in %s on line %d
+array(1) {
+  [utest]=
+  unicode(4) test
+}
+array(1) {
+  [utest]=
+  unicode(8) new
+line
+}
+array(1) {
+  [utest]=
+  unicode(16) test const value
+}
+array(1) {
+  [usection]=
+  array(1) {
+[utest]=
+unicode(5) hello
+  }
+}
+array(1) {
+  [utest]=
+  unicode(5) hello
+}
+array(1) {
+  [usection.test]=
+  unicode(5) hello
+}
+array(1) {
+  [usection]=
+  array(1) {
+[usection.test]=
+unicode(5) hello
+  }
+}
+array(1) {
+  [usection]=
+  array(1) {
+[1]=
+unicode(1) 2
+  }
+}
+array(1) {
+  [1]=
+  unicode(1) 2
+}
+array(1) {
+  [utest]=
+  unicode(5) test4
+}
+Done
+
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/bug20108.phpt?r1=1.5r2=1.6diff_format=u
Index: 

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

2006-12-27 Thread Andrei Zmievski


On Dec 27, 2006, at 11:07 AM, Antony Dovgal wrote:

-	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, d|lss, 
num, dec,

- sep1, sep1_len, 
UG(ascii_conv),
- sep2, sep2_len, 
UG(ascii_conv)) == FAILURE) {
+	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, d|lzz, num, 
dec, sep1, sep2) == FAILURE) {

return;
}


Why not use '!' modifier to say that the arg can be NULL? The the code 
below is not necessary.



-   if (sep1) {
-   if (sep1_len = 1) {
-   dec_point = sep1[0];
-   } else if (sep1_len == 0) {
+   if (sep1  Z_TYPE_P(sep1) != IS_NULL) {
+   convert_to_string_with_converter(sep1, UG(ascii_conv));
+   if (Z_STRLEN_P(sep1)) {
+   dec_point  = Z_STRVAL_P(sep1)[0];
+   } else {
dec_point = 0;


If you don't want to use '!', at least check for return value of 
convert_to_string_with_converter() and fail, if needed.


-Andrei

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



[PHP-CVS] cvs: php-src /ext/session/tests 001.phpt 004.phpt 005.phpt

2006-12-27 Thread Antony Dovgal
tony2001Wed Dec 27 19:22:29 2006 UTC

  Modified files:  
/php-src/ext/session/tests  001.phpt 004.phpt 005.phpt 
  Log:
  fix tests
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/session/tests/001.phpt?r1=1.13r2=1.14diff_format=u
Index: php-src/ext/session/tests/001.phpt
diff -u php-src/ext/session/tests/001.phpt:1.13 
php-src/ext/session/tests/001.phpt:1.14
--- php-src/ext/session/tests/001.phpt:1.13 Tue Mar  7 00:20:53 2006
+++ php-src/ext/session/tests/001.phpt  Wed Dec 27 19:22:29 2006
@@ -25,7 +25,8 @@
 session_start();
 $_SESSION[baz] = $baz;
 $_SESSION[arr] = $arr;
-print session_encode();
+var_dump(session_encode());
 session_destroy();
+?
 --EXPECT--
-baz|O:3:foo:2:{s:3:bar;s:2:ok;s:3:yes;s:4:done;}arr|a:1:{i:3;O:3:foo:2:{s:3:bar;s:2:ok;s:3:yes;s:4:done;}}
+string(126) 
baz|O:3:foo:2:{S:3:bar;S:2:ok;S:3:yes;S:4:done;}arr|a:1:{i:3;O:3:foo:2:{S:3:bar;S:2:ok;S:3:yes;S:4:done;}}
http://cvs.php.net/viewvc.cgi/php-src/ext/session/tests/004.phpt?r1=1.17r2=1.18diff_format=u
Index: php-src/ext/session/tests/004.phpt
diff -u php-src/ext/session/tests/004.phpt:1.17 
php-src/ext/session/tests/004.phpt:1.18
--- php-src/ext/session/tests/004.phpt:1.17 Tue Mar  7 00:20:53 2006
+++ php-src/ext/session/tests/004.phpt  Wed Dec 27 19:22:29 2006
@@ -91,7 +91,7 @@
 int(2)
   }
 }
-WRITE: abtest, 
baz|O:3:foo:2:{s:3:bar;s:2:ok;s:3:yes;i:2;}arr|a:1:{i:3;O:3:foo:2:{s:3:bar;s:2:ok;s:3:yes;i:2;}}
+WRITE: abtest, 
baz|O:3:foo:2:{S:3:bar;S:2:ok;S:3:yes;i:2;}arr|a:1:{i:3;O:3:foo:2:{S:3:bar;S:2:ok;S:3:yes;i:2;}}
 OPEN: PHPSESSID
 READ: abtest
 object(foo)#%d (2) {
http://cvs.php.net/viewvc.cgi/php-src/ext/session/tests/005.phpt?r1=1.15r2=1.16diff_format=u
Index: php-src/ext/session/tests/005.phpt
diff -u php-src/ext/session/tests/005.phpt:1.15 
php-src/ext/session/tests/005.phpt:1.16
--- php-src/ext/session/tests/005.phpt:1.15 Tue Mar  7 00:20:53 2006
+++ php-src/ext/session/tests/005.phpt  Wed Dec 27 19:22:29 2006
@@ -107,7 +107,7 @@
 int(2)
   }
 }
-WRITE: abtest, 
baz|O:3:foo:2:{s:3:bar;s:2:ok;s:3:yes;i:2;}arr|a:1:{i:3;O:3:foo:2:{s:3:bar;s:2:ok;s:3:yes;i:2;}}
+WRITE: abtest, 
baz|O:3:foo:2:{S:3:bar;S:2:ok;S:3:yes;i:2;}arr|a:1:{i:3;O:3:foo:2:{S:3:bar;S:2:ok;S:3:yes;i:2;}}
 CLOSE
 OPEN: PHPSESSID
 READ: abtest
@@ -127,7 +127,7 @@
   }
 }
 int(123)
-WRITE: abtest, 
baz|O:3:foo:2:{s:3:bar;s:2:ok;s:3:yes;i:3;}arr|a:1:{i:3;O:3:foo:2:{s:3:bar;s:2:ok;s:3:yes;i:3;}}c|i:123;
+WRITE: abtest, 
baz|O:3:foo:2:{S:3:bar;S:2:ok;S:3:yes;i:3;}arr|a:1:{i:3;O:3:foo:2:{S:3:bar;S:2:ok;S:3:yes;i:3;}}c|i:123;
 CLOSE
 OPEN: PHPSESSID
 READ: abtest

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