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

2007-07-13 Thread Derick Rethans
derick  Fri Jul 13 17:49:50 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/date/lib   timelib.c 
  Log:
  - MFH: Let's always use the macro as llabs() requires c99.
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/date/lib/timelib.c?r1=1.7.2.4.2.4&r2=1.7.2.4.2.5&diff_format=u
Index: php-src/ext/date/lib/timelib.c
diff -u php-src/ext/date/lib/timelib.c:1.7.2.4.2.4 
php-src/ext/date/lib/timelib.c:1.7.2.4.2.5
--- php-src/ext/date/lib/timelib.c:1.7.2.4.2.4  Fri Jul 13 12:50:00 2007
+++ php-src/ext/date/lib/timelib.c  Fri Jul 13 17:49:50 2007
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: timelib.c,v 1.7.2.4.2.4 2007/07/13 12:50:00 rrichards Exp $ */
+/* $Id: timelib.c,v 1.7.2.4.2.5 2007/07/13 17:49:50 derick Exp $ */
 
 #include "timelib.h"
 #include 
@@ -28,11 +28,7 @@
m = NULL;   \
}   \
 
-#if defined(_MSC_VER)
-   #define TIMELIB_LLABS(y) y < 0 ? (y * -1) : y
-#else
-   #define TIMELIB_LLABS(y) llabs(y)
-#endif
+#define TIMELIB_LLABS(y) (y < 0 ? (y * -1) : y)
 
 timelib_time* timelib_time_ctor()
 {

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



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

2007-07-13 Thread Derick Rethans
derick  Fri Jul 13 17:49:18 2007 UTC

  Modified files:  
/php-src/ext/date/lib   timelib.c 
  Log:
  - Let's always use the macro as llabs() requires c99.
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/date/lib/timelib.c?r1=1.15&r2=1.16&diff_format=u
Index: php-src/ext/date/lib/timelib.c
diff -u php-src/ext/date/lib/timelib.c:1.15 php-src/ext/date/lib/timelib.c:1.16
--- php-src/ext/date/lib/timelib.c:1.15 Fri Jul 13 12:48:47 2007
+++ php-src/ext/date/lib/timelib.c  Fri Jul 13 17:49:18 2007
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: timelib.c,v 1.15 2007/07/13 12:48:47 rrichards Exp $ */
+/* $Id: timelib.c,v 1.16 2007/07/13 17:49:18 derick Exp $ */
 
 #include "timelib.h"
 #include 
@@ -28,11 +28,7 @@
m = NULL;   \
}   \
 
-#if defined(_MSC_VER)
-   #define TIMELIB_LLABS(y) y < 0 ? (y * -1) : y
-#else
-   #define TIMELIB_LLABS(y) llabs(y)
-#endif
+#define TIMELIB_LLABS(y) (y < 0 ? (y * -1) : y)
 
 timelib_time* timelib_time_ctor()
 {

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

2007-07-13 Thread Antony Dovgal
tony2001Fri Jul 13 17:15:13 2007 UTC

  Modified files:  
/php-src/ext/standard/tests/array   locale_sort.phpt 
  Log:
  fix test
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/array/locale_sort.phpt?r1=1.8&r2=1.9&diff_format=u
Index: php-src/ext/standard/tests/array/locale_sort.phpt
diff -u php-src/ext/standard/tests/array/locale_sort.phpt:1.8 
php-src/ext/standard/tests/array/locale_sort.phpt:1.9
--- php-src/ext/standard/tests/array/locale_sort.phpt:1.8   Tue Jul 10 
15:19:13 2007
+++ php-src/ext/standard/tests/array/locale_sort.phpt   Fri Jul 13 17:15:12 2007
@@ -57,7 +57,8 @@
   ["NT"]=>
   string(25) "Territoires du Nord-Ouest"
 }
---UEXPECT--
+--UEXPECTF--
+Strict Standards: setlocale(): deprecated in Unicode mode, please use ICU 
locale functions in %s on line %d
 array(13) {
   [u"AB"]=>
   unicode(7) "Alberta"

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

2007-07-13 Thread Antony Dovgal
tony2001Fri Jul 13 17:07:33 2007 UTC

  Modified files:  
/php-src/ext/standard/tests/array   array_keys_variation_003.phpt 
  Log:
  add key values to the output
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/array/array_keys_variation_003.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/standard/tests/array/array_keys_variation_003.phpt
diff -u php-src/ext/standard/tests/array/array_keys_variation_003.phpt:1.1 
php-src/ext/standard/tests/array/array_keys_variation_003.phpt:1.2
--- php-src/ext/standard/tests/array/array_keys_variation_003.phpt:1.1  Fri Jul 
13 16:39:54 2007
+++ php-src/ext/standard/tests/array/array_keys_variation_003.phpt  Fri Jul 
13 17:07:33 2007
@@ -20,13 +20,15 @@
 );
 $values = array(TRUE, FALSE, 1, 0, -1, "1", "0", "-1",  NULL, array(), "php", 
"");
 foreach ($values as $value){
-  var_dump(array_keys($types_arr, $value)); 
+   var_dump($value);
+   var_dump(array_keys($types_arr, $value)); 
 }
 
 echo "Done\n";
 ?>
 --EXPECTF--
 *** Testing array_keys() on all the types other than arrays ***
+bool(true)
 array(3) {
   [0]=>
   int(1)
@@ -35,6 +37,7 @@
   [2]=>
   string(3) "php"
 }
+bool(false)
 array(4) {
   [0]=>
   int(0)
@@ -45,10 +48,12 @@
   [3]=>
   string(0) ""
 }
+int(1)
 array(1) {
   [0]=>
   int(1)
 }
+int(0)
 array(4) {
   [0]=>
   int(0)
@@ -59,22 +64,27 @@
   [3]=>
   string(0) ""
 }
+int(-1)
 array(1) {
   [0]=>
   int(-1)
 }
+string(1) "1"
 array(1) {
   [0]=>
   int(1)
 }
+string(1) "0"
 array(1) {
   [0]=>
   int(0)
 }
+string(2) "-1"
 array(1) {
   [0]=>
   int(-1)
 }
+NULL
 array(3) {
   [0]=>
   int(2)
@@ -83,16 +93,20 @@
   [2]=>
   string(0) ""
 }
+array(0) {
+}
 array(2) {
   [0]=>
   int(2)
   [1]=>
   int(3)
 }
+string(3) "php"
 array(1) {
   [0]=>
   string(3) "php"
 }
+string(0) ""
 array(2) {
   [0]=>
   int(2)
@@ -102,6 +116,7 @@
 Done
 --UEXPECTF--
 *** Testing array_keys() on all the types other than arrays ***
+bool(true)
 array(3) {
   [0]=>
   int(1)
@@ -110,6 +125,7 @@
   [2]=>
   unicode(3) "php"
 }
+bool(false)
 array(4) {
   [0]=>
   int(0)
@@ -120,10 +136,12 @@
   [3]=>
   unicode(0) ""
 }
+int(1)
 array(1) {
   [0]=>
   int(1)
 }
+int(0)
 array(4) {
   [0]=>
   int(0)
@@ -134,22 +152,27 @@
   [3]=>
   unicode(0) ""
 }
+int(-1)
 array(1) {
   [0]=>
   int(-1)
 }
+unicode(1) "1"
 array(1) {
   [0]=>
   int(1)
 }
+unicode(1) "0"
 array(1) {
   [0]=>
   int(0)
 }
+unicode(2) "-1"
 array(1) {
   [0]=>
   int(-1)
 }
+NULL
 array(3) {
   [0]=>
   int(2)
@@ -158,16 +181,20 @@
   [2]=>
   unicode(0) ""
 }
+array(0) {
+}
 array(2) {
   [0]=>
   int(2)
   [1]=>
   int(3)
 }
+unicode(3) "php"
 array(1) {
   [0]=>
   unicode(3) "php"
 }
+unicode(0) ""
 array(2) {
   [0]=>
   int(2)

-- 
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/array array_keys_error.phpt array_keys_variation_001.phpt array_keys_variation_002.phpt array_keys_variation_002_64bit.phpt array_keys_variation_003

2007-07-13 Thread Antony Dovgal
tony2001Fri Jul 13 16:47:39 2007 UTC

  Added files: (Branch: PHP_5_2)
/php-src/ext/standard/tests/array   array_keys_error.phpt 
array_keys_variation_001.phpt 
array_keys_variation_002_64bit.phpt 
array_keys_variation_002.phpt 
array_keys_variation_003.phpt 
array_keys_variation_004.phpt 
array_keys_variation_005.phpt 
  Log:
  MFH: split the test
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/array/array_keys_error.phpt?view=markup&rev=1.1
Index: php-src/ext/standard/tests/array/array_keys_error.phpt
+++ php-src/ext/standard/tests/array/array_keys_error.phpt
--TEST--
Test array_keys() function (error conditions)
--FILE--
 expected
var_dump(array_keys(array(1,2,3, array() => array(;  // (W)illegal offset

echo "Done\n";
?>
--EXPECTF--
*** Testing error conditions ***
Warning: array_keys() expects parameter 1 to be array, integer given in %s on 
line %d
NULL

Warning: array_keys() expects parameter 1 to be array, string given in %s on 
line %d
NULL

Warning: array_keys() expects parameter 1 to be array, object given in %s on 
line %d
NULL

Warning: array_keys() expects at least 1 parameter, 0 given in %s on line %d
NULL

Warning: array_keys() expects at most 3 parameters, 4 given in %s on line %d
NULL

Warning: Illegal offset type in %s on line %d
array(3) {
  [0]=>
  int(0)
  [1]=>
  int(1)
  [2]=>
  int(2)
}
Done
--UEXPECTF--
*** Testing error conditions ***
Warning: array_keys() expects parameter 1 to be array, integer given in %s on 
line %d
NULL

Warning: array_keys() expects parameter 1 to be array, Unicode string given in 
%s on line %d
NULL

Warning: array_keys() expects parameter 1 to be array, object given in %s on 
line %d
NULL

Warning: array_keys() expects at least 1 parameter, 0 given in %s on line %d
NULL

Warning: array_keys() expects at most 3 parameters, 4 given in %s on line %d
NULL

Warning: Illegal offset type in %s on line %d
array(3) {
  [0]=>
  int(0)
  [1]=>
  int(1)
  [2]=>
  int(2)
}
Done

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/array/array_keys_variation_001.phpt?view=markup&rev=1.1
Index: php-src/ext/standard/tests/array/array_keys_variation_001.phpt
+++ php-src/ext/standard/tests/array/array_keys_variation_001.phpt
--TEST--
Test array_keys() function (variation - 1)
--FILE--
 "World"), 
  array("" => ""),  
  array(1,2,3, "d" => array(4,6, "d")),
  array("a" => 1, "b" => 2, "c" =>3, "d" => array()),
  array(0 => 0, 1 => 1, 2 => 2, 3 => 3),  
  array(0.001=>3.000, 1.002=>2, 1.999=>3, "a"=>3, 3=>5, "5"=>3.000),
  array(TRUE => TRUE, FALSE => FALSE, NULL => NULL, "\x000", "\000"),
  array("a" => "abcd", "a" => "", "ab" => -6, "cd" => -0.5 ),
  array(0 => array(), 1=> array(0), 2 => array(1), ""=> array(),""=>"" )
);

$i = 0;
/* loop through to test array_keys() with different arrays */
foreach ($arrays as $array) {
  echo "\n-- Iteration $i --\n";
  var_dump(array_keys($array)); 
  $i++;
}

echo "Done\n";
?>
--EXPECTF--
*** Testing array_keys() on various arrays ***
-- Iteration 0 --
array(0) {
}

-- Iteration 1 --
array(1) {
  [0]=>
  int(0)
}

-- Iteration 2 --
array(1) {
  [0]=>
  int(0)
}

-- Iteration 3 --
array(1) {
  [0]=>
  string(5) "Hello"
}

-- Iteration 4 --
array(1) {
  [0]=>
  string(0) ""
}

-- Iteration 5 --
array(4) {
  [0]=>
  int(0)
  [1]=>
  int(1)
  [2]=>
  int(2)
  [3]=>
  string(1) "d"
}

-- Iteration 6 --
array(4) {
  [0]=>
  string(1) "a"
  [1]=>
  string(1) "b"
  [2]=>
  string(1) "c"
  [3]=>
  string(1) "d"
}

-- Iteration 7 --
array(4) {
  [0]=>
  int(0)
  [1]=>
  int(1)
  [2]=>
  int(2)
  [3]=>
  int(3)
}

-- Iteration 8 --
array(5) {
  [0]=>
  int(0)
  [1]=>
  int(1)
  [2]=>
  string(1) "a"
  [3]=>
  int(3)
  [4]=>
  int(5)
}

-- Iteration 9 --
array(5) {
  [0]=>
  int(1)
  [1]=>
  int(0)
  [2]=>
  string(0) ""
  [3]=>
  int(2)
  [4]=>
  int(3)
}

-- Iteration 10 --
array(3) {
  [0]=>
  string(1) "a"
  [1]=>
  string(2) "ab"
  [2]=>
  string(2) "cd"
}

-- Iteration 11 --
array(4) {
  [0]=>
  int(0)
  [1]=>
  int(1)
  [2]=>
  int(2)
  [3]=>
  string(0) ""
}
Done
--UEXPECTF--
*** Testing array_keys() on various arrays ***
-- Iteration 0 --
array(0) {
}

-- Iteration 1 --
array(1) {
  [0]=>
  int(0)
}

-- Iteration 2 --
array(1) {
  [0]=>
  int(0)
}

-- Iteration 3 --
array(1) {
  [0]=>
  unicode(5) "Hello"
}

-- Iteration 4 --
array(1) {
  [0]=>
  unicode(0) ""
}

-- Iteration 5 --
array(4) {
  [0]=>
  int(0)
  [1]=>
  int(1)
  [2]=>
  int(2)
  [3]=>
  unicode(1) "d"
}

-- Iteration 6 --
array(4) {
  [0]=>
  unicode(1) "a"
  [1]=>
  unicode(1) "b"
  [2]=>
  unicode(1) "c"
  [3]=>
  unicode(1) "d"
}

-- Iteration 7 --
array(4) {
  [0]=>
  int(0)
  [1]=>
  int(1)
  [2]=>
  int(2)
  [3]=>
  int(3)
}

-- Iteration 8 --
array(5) {
  [0]=>
  int(0)
  

[PHP-CVS] cvs: php-src /ext/standard/tests/array array_keys_variation_002_64bit.phpt

2007-07-13 Thread Antony Dovgal
tony2001Fri Jul 13 16:42:42 2007 UTC

  Added files: 
/php-src/ext/standard/tests/array   
array_keys_variation_002_64bit.phpt 
  Log:
  add 64bit version
  
  

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/array/array_keys_variation_002_64bit.phpt?view=markup&rev=1.1
Index: php-src/ext/standard/tests/array/array_keys_variation_002_64bit.phpt
+++ php-src/ext/standard/tests/array/array_keys_variation_002_64bit.phpt
--TEST--
Test array_keys() function (variation - 2)
--SKIPIF--

--FILE--
 1,
  2147483648 => 2,
  -2147483647 => 3, 
  -2147483648 => 4,
  -2147483649 => 5,
  -0 => 6,
  0 => 7
);
var_dump(array_keys($arr_range));

echo "\n*** Testing array_keys() on an array created on the fly ***\n";
var_dump(array_keys(array("a" => 1, "b" => 2, "c" => 3)));
var_dump(array_keys(array()));  // null array

echo "Done\n";
?>
--EXPECTF--
*** Testing array_keys() on range of values ***
array(6) {
  [0]=>
  int(2147483647)
  [1]=>
  int(2147483648)
  [2]=>
  int(-2147483647)
  [3]=>
  int(-2147483648)
  [4]=>
  int(-2147483649)
  [5]=>
  int(0)
}

*** Testing array_keys() on an array created on the fly ***
array(3) {
  [0]=>
  string(1) "a"
  [1]=>
  string(1) "b"
  [2]=>
  string(1) "c"
}
array(0) {
}
Done
--UEXPECTF--
*** Testing array_keys() on range of values ***
array(6) {
  [0]=>
  int(2147483647)
  [1]=>
  int(2147483648)
  [2]=>
  int(-2147483647)
  [3]=>
  int(-2147483648)
  [4]=>
  int(-2147483649)
  [5]=>
  int(0)
}

*** Testing array_keys() on an array created on the fly ***
array(3) {
  [0]=>
  unicode(1) "a"
  [1]=>
  unicode(1) "b"
  [2]=>
  unicode(1) "c"
}
array(0) {
}
Done

-- 
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_keys.phpt array_keys_64bit.phpt array_keys_basic.phpt array_keys_error.phpt array_keys_variation_001.phpt array_keys_variation_002.phpt array_key

2007-07-13 Thread Antony Dovgal
tony2001Fri Jul 13 16:39:55 2007 UTC

  Added files: 
/php-src/ext/standard/tests/array   array_keys_basic.phpt 
array_keys_error.phpt 
array_keys_variation_001.phpt 
array_keys_variation_002.phpt 
array_keys_variation_003.phpt 
array_keys_variation_004.phpt 
array_keys_variation_005.phpt 

  Removed files:   
/php-src/ext/standard/tests/array   array_keys.phpt 
array_keys_64bit.phpt 
  Log:
  split one more huge test into several smaller ones
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/array/array_keys_basic.phpt?view=markup&rev=1.1
Index: php-src/ext/standard/tests/array/array_keys_basic.phpt
+++ php-src/ext/standard/tests/array/array_keys_basic.phpt
--TEST--
Test array_keys() function (basic)
--FILE--
 1, "b" => 2, 2.0 => 2.0, -23.45 => "asdasd",
   array(1,2,3));
var_dump(array_keys($basic_arr));

echo "Done\n";
?>
--EXPECTF--
*** Testing array_keys() on basic array operation ***
array(5) {
  [0]=>
  string(1) "a"
  [1]=>
  string(1) "b"
  [2]=>
  int(2)
  [3]=>
  int(-23)
  [4]=>
  int(3)
}
Done
--UEXPECTF--
*** Testing array_keys() on basic array operation ***
array(5) {
  [0]=>
  unicode(1) "a"
  [1]=>
  unicode(1) "b"
  [2]=>
  int(2)
  [3]=>
  int(-23)
  [4]=>
  int(3)
}
Done

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/array/array_keys_error.phpt?view=markup&rev=1.1
Index: php-src/ext/standard/tests/array/array_keys_error.phpt
+++ php-src/ext/standard/tests/array/array_keys_error.phpt
--TEST--
Test array_keys() function (error conditions)
--FILE--
 expected
var_dump(array_keys(array(1,2,3, array() => array(;  // (W)illegal offset

echo "Done\n";
?>
--EXPECTF--
*** Testing error conditions ***
Warning: array_keys() expects parameter 1 to be array, integer given in %s on 
line %d
NULL

Warning: array_keys() expects parameter 1 to be array, string given in %s on 
line %d
NULL

Warning: array_keys() expects parameter 1 to be array, object given in %s on 
line %d
NULL

Warning: array_keys() expects at least 1 parameter, 0 given in %s on line %d
NULL

Warning: array_keys() expects at most 3 parameters, 4 given in %s on line %d
NULL

Warning: Illegal offset type in %s on line %d
array(3) {
  [0]=>
  int(0)
  [1]=>
  int(1)
  [2]=>
  int(2)
}
Done
--UEXPECTF--
*** Testing error conditions ***
Warning: array_keys() expects parameter 1 to be array, integer given in %s on 
line %d
NULL

Warning: array_keys() expects parameter 1 to be array, Unicode string given in 
%s on line %d
NULL

Warning: array_keys() expects parameter 1 to be array, object given in %s on 
line %d
NULL

Warning: array_keys() expects at least 1 parameter, 0 given in %s on line %d
NULL

Warning: array_keys() expects at most 3 parameters, 4 given in %s on line %d
NULL

Warning: Illegal offset type in %s on line %d
array(3) {
  [0]=>
  int(0)
  [1]=>
  int(1)
  [2]=>
  int(2)
}
Done

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/array/array_keys_variation_001.phpt?view=markup&rev=1.1
Index: php-src/ext/standard/tests/array/array_keys_variation_001.phpt
+++ php-src/ext/standard/tests/array/array_keys_variation_001.phpt
--TEST--
Test array_keys() function (variation - 1)
--FILE--
 "World"), 
  array("" => ""),  
  array(1,2,3, "d" => array(4,6, "d")),
  array("a" => 1, "b" => 2, "c" =>3, "d" => array()),
  array(0 => 0, 1 => 1, 2 => 2, 3 => 3),  
  array(0.001=>3.000, 1.002=>2, 1.999=>3, "a"=>3, 3=>5, "5"=>3.000),
  array(TRUE => TRUE, FALSE => FALSE, NULL => NULL, "\x000", "\000"),
  array("a" => "abcd", "a" => "", "ab" => -6, "cd" => -0.5 ),
  array(0 => array(), 1=> array(0), 2 => array(1), ""=> array(),""=>"" )
);

$i = 0;
/* loop through to test array_keys() with different arrays */
foreach ($arrays as $array) {
  echo "\n-- Iteration $i --\n";
  var_dump(array_keys($array)); 
  $i++;
}

echo "Done\n";
?>
--EXPECTF--
*** Testing array_keys() on various arrays ***
-- Iteration 0 --
array(0) {
}

-- Iteration 1 --
array(1) {
  [0]=>
  int(0)
}

-- Iteration 2 --
array(1) {
  [0]=>
  int(0)
}

-- Iteration 3 --
array(1) {
  [0]=>
  string(5) "Hello"
}

-- Iteration 4 --
array(1) {
  [0]=>
  string(0) ""
}

-- Iteration 5 --
array(4) {
  [0]=>
  int(0)
  [1]=>
  int(1)
  [2]=>
  int(2)
  [3]=>
  string(1) "d"
}

-- Iteration 6 --
array(4) {
  [0]=>
  string(1) "a"
  [1]=>
  string(1) "b"
  [2]=>
  string(1) "c"
  [3]=>
  string(1) "d"
}

-- Iteration 7 --
array(4) {
  [0]=>
  int(0)
  [1]=>
  int(1)
  [2]=>
  int(2)
  [3]=>
  int(3)
}

-- Iteration 8 --
array(5) {
  [0]=>
  int(0)
  [1]=>
  int(1)
  [2]=>
  string(1) "a"
  [3]=>
  int(3)
  [4]=>
  int(5)
}

-- Iteration 9 --
array(5) {
  [0]=>
  int(1)
  [1]=>
  int(0)
  [2]=>
  string(0) ""
  [3]=>
  i

[PHP-CVS] cvs: php-src /ext/standard/tests/array array_keys.phpt array_keys_64bit.phpt

2007-07-13 Thread Antony Dovgal
tony2001Fri Jul 13 16:07:42 2007 UTC

  Modified files:  
/php-src/ext/standard/tests/array   array_keys_64bit.phpt 
array_keys.phpt 
  Log:
  fix test, add 64bit version
  
  http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/array/array_keys_64bit.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/standard/tests/array/array_keys_64bit.phpt
diff -u /dev/null php-src/ext/standard/tests/array/array_keys_64bit.phpt:1.2
--- /dev/null   Fri Jul 13 16:07:42 2007
+++ php-src/ext/standard/tests/array/array_keys_64bit.phpt  Fri Jul 13 
16:07:42 2007
@@ -0,0 +1,472 @@
+--TEST--
+Test array_keys() function
+--SKIPIF--
+
+--INI--
+precision=14
+--FILE--
+ 1, "b" => 2, 2.0 => 2.0, -23.45 => "asdasd",
+   array(1,2,3));
+var_dump(array_keys($basic_arr));
+
+echo "\n*** Testing array_keys() on various arrays ***";
+$arrays = array(
+  array(), 
+  array(0),
+  array( array() ), 
+  array("Hello" => "World"), 
+  array("" => ""),  
+  array(1,2,3, "d" => array(4,6, "d")),
+  array("a" => 1, "b" => 2, "c" =>3, "d" => array()),
+  array(0 => 0, 1 => 1, 2 => 2, 3 => 3),  
+  array(0.001=>3.000, 1.002=>2, 1.999=>3, "a"=>3, 3=>5, "5"=>3.000),
+  array(TRUE => TRUE, FALSE => FALSE, NULL => NULL, "\x000", "\000"),
+  array("a" => "abcd", "a" => "", "ab" => -6, "cd" => -0.5 ),
+  array(0 => array(), 1=> array(0), 2 => array(1), ""=> array(),""=>"" )
+);
+
+$i = 0;
+/* loop through to test array_keys() with different arrays */
+foreach ($arrays as $array) {
+  echo "\n-- Iteration $i --\n";
+  var_dump(array_keys($array)); 
+  $i++;
+}
+
+echo "\n*** Testing array_keys() on all the types other than arrays ***";
+$types_arr = array(
+  TRUE => TRUE,
+  FALSE => FALSE,
+  1 => 1,
+  0 => 0,
+  -1 => -1, 
+  "1" => "1",
+  "0" => "0",
+  "-1" => "-1",
+  NULL,
+  array(),
+  "php" => "php",
+  "" => ""
+);
+$values = array(TRUE, FALSE, 1, 0, -1, "1", "0", "-1",  NULL, array(), "php", 
"");
+foreach ($values as $value){
+  echo "\n-- Loose type checking --\n";
+  var_dump(array_keys($types_arr, $value)); 
+  echo "\n-- strict type checking --\n";
+  var_dump(array_keys($types_arr, $value, TRUE));
+}
+
+echo "\n*** Testing array_keys() with resource type ***\n";
+$resource1 = fopen( __FILE__, "r");
+$resource2 = opendir( "." );
+
+/* creating an array with resource types as elements */
+$arr_resource = array($resource1, $resource2); 
+
+var_dump(array_keys($arr_resource, $resource1));  // loose type checking 
+var_dump(array_keys($arr_resource, $resource1, TRUE));  // strict type checking
+var_dump(array_keys($arr_resource, $resource2));  // loose type checking
+var_dump(array_keys($arr_resource, $resource2, TRUE));  // strict type checking
+
+echo "\n*** Testing array_keys() on range of values ***\n";
+$arr_range = array(
+  2147483647 => 1,
+  2147483648 => 2,
+  -2147483647 => 3, 
+  -2147483648 => 4,
+  -2147483649 => 5,
+  -0 => 6,
+  0 => 7
+);
+var_dump(array_keys($arr_range));
+
+echo "\n*** Testing array_keys() on an array created on the fly ***\n";
+var_dump(array_keys(array("a" => 1, "b" => 2, "c" => 3)));
+var_dump(array_keys(array()));  // null array
+
+echo "\n*** Testing error conditions ***";
+var_dump(array_keys(100));
+var_dump(array_keys("string"));
+var_dump(array_keys(new stdclass));  // object
+var_dump(array_keys());  // Zero arguments
+var_dump(array_keys(array(), "", TRUE, 100));  // args > expected
+var_dump(array_keys(array(1,2,3, array() => array(;  // (W)illegal offset
+
+echo "Done\n";
+
+--CLEAN--
+/* Closing the resource handles */
+fclose( $resource1 );
+closedir( $resource2 );
+?>
+--EXPECTF--
+*** Testing array_keys() on basic array operation ***
+array(5) {
+  [0]=>
+  string(1) "a"
+  [1]=>
+  string(1) "b"
+  [2]=>
+  int(2)
+  [3]=>
+  int(-23)
+  [4]=>
+  int(3)
+}
+
+*** Testing array_keys() on various arrays ***
+-- Iteration 0 --
+array(0) {
+}
+
+-- Iteration 1 --
+array(1) {
+  [0]=>
+  int(0)
+}
+
+-- Iteration 2 --
+array(1) {
+  [0]=>
+  int(0)
+}
+
+-- Iteration 3 --
+array(1) {
+  [0]=>
+  string(5) "Hello"
+}
+
+-- Iteration 4 --
+array(1) {
+  [0]=>
+  string(0) ""
+}
+
+-- Iteration 5 --
+array(4) {
+  [0]=>
+  int(0)
+  [1]=>
+  int(1)
+  [2]=>
+  int(2)
+  [3]=>
+  string(1) "d"
+}
+
+-- Iteration 6 --
+array(4) {
+  [0]=>
+  string(1) "a"
+  [1]=>
+  string(1) "b"
+  [2]=>
+  string(1) "c"
+  [3]=>
+  string(1) "d"
+}
+
+-- Iteration 7 --
+array(4) {
+  [0]=>
+  int(0)
+  [1]=>
+  int(1)
+  [2]=>
+  int(2)
+  [3]=>
+  int(3)
+}
+
+-- Iteration 8 --
+array(5) {
+  [0]=>
+  int(0)
+  [1]=>
+  int(1)
+  [2]=>
+  string(1) "a"
+  [3]=>
+  int(3)
+  [4]=>
+  int(5)
+}
+
+-- Iteration 9 --
+array(5) {
+  [0]=>
+  int(1)
+  [1]=>
+  int(0)
+  [2]=>
+  string(0) ""
+  [3]=>
+  int(2)
+  [4]=>
+  int(3)
+}
+
+-- Iteration 10 --
+array(3) {
+  [0]=>
+  string(1) "a"
+  [1]=>
+  string(2) "ab"
+  [2]=>
+  string(2) "cd"
+}
+
+-- Iteration 11 --
+array(4) {
+  [0]=>
+  int(0)
+  [1]=>
+  in

[PHP-CVS] cvs: php-src /ext/standard formatted_print.c /ext/standard/tests/array bug35014_64bit.phpt

2007-07-13 Thread Antony Dovgal
tony2001Fri Jul 13 15:52:38 2007 UTC

  Modified files:  
/php-src/ext/standard   formatted_print.c 
/php-src/ext/standard/tests/array   bug35014_64bit.phpt 
  Log:
  fix %u in Unicode mode
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/formatted_print.c?r1=1.101&r2=1.102&diff_format=u
Index: php-src/ext/standard/formatted_print.c
diff -u php-src/ext/standard/formatted_print.c:1.101 
php-src/ext/standard/formatted_print.c:1.102
--- php-src/ext/standard/formatted_print.c:1.101Sun Jun  3 09:11:52 2007
+++ php-src/ext/standard/formatted_print.c  Fri Jul 13 15:52:38 2007
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: formatted_print.c,v 1.101 2007/06/03 09:11:52 shire Exp $ */
+/* $Id: formatted_print.c,v 1.102 2007/07/13 15:52:38 tony2001 Exp $ */
 
 #include   /* modf() */
 #include "php.h"
@@ -308,7 +308,7 @@
register unsigned long magn, nmagn;
register unsigned int i = NUM_BUF_SIZE - 1;
 
-   magn = (unsigned int) number;
+   magn = (unsigned long) number;
 
/* Can't right-pad 0's on integers */
if (alignment == 0 && padding == 0x30 /* '0' */) padding = 0x20 /* ' ' 
*/;
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/array/bug35014_64bit.phpt?r1=1.4&r2=1.5&diff_format=u
Index: php-src/ext/standard/tests/array/bug35014_64bit.phpt
diff -u php-src/ext/standard/tests/array/bug35014_64bit.phpt:1.4 
php-src/ext/standard/tests/array/bug35014_64bit.phpt:1.5
--- php-src/ext/standard/tests/array/bug35014_64bit.phpt:1.4Mon Jun  4 
01:23:22 2007
+++ php-src/ext/standard/tests/array/bug35014_64bit.phptFri Jul 13 
15:52:38 2007
@@ -31,8 +31,8 @@
 int(9)
 float(1)
 int(99980001)
-float(2.8404260053903E+20)
-int(8589934590)
+float(1.219953680145E+30)
+float(3.6893488147419E+19)
 --UEXPECTF--
 Warning: array_product() expects parameter 1 to be array, Unicode string given 
in %s on line %d
 NULL

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



[PHP-CVS] cvs: php-src(PHP_5_2) /ext/dba config.m4

2007-07-13 Thread Jani Taskinen
janiFri Jul 13 15:09:19 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/dbaconfig.m4 
  Log:
  MFH: fix wrong logic
  
http://cvs.php.net/viewvc.cgi/php-src/ext/dba/config.m4?r1=1.70.2.2.2.6&r2=1.70.2.2.2.7&diff_format=u
Index: php-src/ext/dba/config.m4
diff -u php-src/ext/dba/config.m4:1.70.2.2.2.6 
php-src/ext/dba/config.m4:1.70.2.2.2.7
--- php-src/ext/dba/config.m4:1.70.2.2.2.6  Fri Jul 13 14:23:59 2007
+++ php-src/ext/dba/config.m4   Fri Jul 13 15:09:19 2007
@@ -1,5 +1,5 @@
 dnl
-dnl $Id: config.m4,v 1.70.2.2.2.6 2007/07/13 14:23:59 jani Exp $
+dnl $Id: config.m4,v 1.70.2.2.2.7 2007/07/13 15:09:19 jani Exp $
 dnl
 
 dnl Suppose we need FlatFile if no support or only CDB is used.
@@ -477,7 +477,7 @@
 dnl
 dnl Bundled modules that should be enabled by default if any other option is 
enabled
 dnl
-if test "$PHP_DBA" != "no" || test "$HAVE_DBA" = "1" || test "$with_cdb" != 
"no" || test "$enable_inifile" != "no" || test "$enable_flatfile" != "no"; then
+if test "$PHP_DBA" != "no" || test "$HAVE_DBA" = "1" || test "$with_cdb" = 
"yes" || test "$enable_inifile" = "yes" || test "$enable_flatfile" = "yes"; then
   php_dba_enable=yes
 else
   php_dba_enable=no

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



[PHP-CVS] cvs: php-src /ext/date php_date.c /ext/date/tests 010.phpt bug35499.phpt bug41523.phpt bug41964.phpt

2007-07-13 Thread Dmitry Stogov
dmitry  Fri Jul 13 15:22:34 2007 UTC

  Modified files:  
/php-src/ext/date   php_date.c 
/php-src/ext/date/tests 010.phpt bug35499.phpt bug41523.phpt 
bug41964.phpt 
  Log:
  Unicode support
  
  http://cvs.php.net/viewvc.cgi/php-src/ext/date/php_date.c?r1=1.142&r2=1.143&diff_format=u
Index: php-src/ext/date/php_date.c
diff -u php-src/ext/date/php_date.c:1.142 php-src/ext/date/php_date.c:1.143
--- php-src/ext/date/php_date.c:1.142   Thu Jul 12 18:58:48 2007
+++ php-src/ext/date/php_date.c Fri Jul 13 15:22:34 2007
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: php_date.c,v 1.142 2007/07/12 18:58:48 derick Exp $ */
+/* $Id: php_date.c,v 1.143 2007/07/13 15:22:34 dmitry Exp $ */
 
 #include "php.h"
 #include "php_streams.h"
@@ -1915,16 +1915,16 @@
break;
case TIMELIB_ZONETYPE_ID:
if (parsed_time->tz_abbr) {
-   add_ascii_assoc_string(return_value, 
"tz_abbr", parsed_time->tz_abbr, 1);
+   
add_ascii_assoc_ascii_string(return_value, "tz_abbr", parsed_time->tz_abbr, 1);
}
if (parsed_time->tz_info) {
-   add_ascii_assoc_string(return_value, 
"tz_id", parsed_time->tz_info->name, 1);
+   
add_ascii_assoc_ascii_string(return_value, "tz_id", parsed_time->tz_info->name, 
1);
}
break;
case TIMELIB_ZONETYPE_ABBR:
PHP_DATE_PARSE_DATE_SET_TIME_ELEMENT(zone, z);
add_ascii_assoc_bool(return_value, "is_dst", 
parsed_time->dst);
-   add_ascii_assoc_string(return_value, "tz_abbr", 
parsed_time->tz_abbr, 1);
+   add_ascii_assoc_ascii_string(return_value, 
"tz_abbr", parsed_time->tz_abbr, 1);
break;
}
}
@@ -2318,7 +2318,7 @@
add_ascii_assoc_string(element, "time", 
php_format_date(DATE_FORMAT_ISO8601, 13, tzobj->tz->trans[i], 0 TSRMLS_CC), 0);
add_ascii_assoc_long(element, "offset", 
tzobj->tz->type[tzobj->tz->trans_idx[i]].offset);
add_ascii_assoc_bool(element, "isdst",  
tzobj->tz->type[tzobj->tz->trans_idx[i]].isdst);
-   add_ascii_assoc_string(element, "abbr", 
&tzobj->tz->timezone_abbr[tzobj->tz->type[tzobj->tz->trans_idx[i]].abbr_idx], 
1);
+   add_ascii_assoc_ascii_string(element, "abbr", 
&tzobj->tz->timezone_abbr[tzobj->tz->type[tzobj->tz->trans_idx[i]].abbr_idx], 
1);
 
add_next_index_zval(return_value, element);
}
@@ -2364,7 +2364,7 @@
add_ascii_assoc_bool(element, "dst", entry->type);
add_ascii_assoc_long(element, "offset", entry->gmtoffset);
if (entry->full_tz_name) {
-   add_ascii_assoc_string(element, "timezone_id", 
entry->full_tz_name, 1);
+   add_ascii_assoc_ascii_string(element, "timezone_id", 
entry->full_tz_name, 1);
} else {
add_ascii_assoc_null(element, "timezone_id");
}
http://cvs.php.net/viewvc.cgi/php-src/ext/date/tests/010.phpt?r1=1.2&r2=1.3&diff_format=u
Index: php-src/ext/date/tests/010.phpt
diff -u php-src/ext/date/tests/010.phpt:1.2 php-src/ext/date/tests/010.phpt:1.3
--- php-src/ext/date/tests/010.phpt:1.2 Fri Apr 20 20:57:57 2007
+++ php-src/ext/date/tests/010.phpt Fri Jul 13 15:22:34 2007
@@ -660,7 +660,7 @@
 [u"offset"]=>
 int(-18000)
 [u"timezone_id"]=>
-string(16) "America/New_York"
+unicode(16) "America/New_York"
   }
   [1]=>
   array(3) {
@@ -669,7 +669,7 @@
 [u"offset"]=>
 int(-18000)
 [u"timezone_id"]=>
-string(15) "America/Antigua"
+unicode(15) "America/Antigua"
   }
   [2]=>
   array(3) {
@@ -678,7 +678,7 @@
 [u"offset"]=>
 int(-18000)
 [u"timezone_id"]=>
-string(16) "America/Atikokan"
+unicode(16) "America/Atikokan"
   }
   [3]=>
   array(3) {
@@ -687,7 +687,7 @@
 [u"offset"]=>
 int(-18000)
 [u"timezone_id"]=>
-string(21) "America/Cambridge_Bay"
+unicode(21) "America/Cambridge_Bay"
   }
   [4]=>
   array(3) {
@@ -696,7 +696,7 @@
 [u"offset"]=>
 int(-18000)
 [u"timezone_id"]=>
-string(14) "America/Cancun"
+unicode(14) "America/Cancun"
   }
   [5]=>
   array(3) {
@@ -705,7 +705,7 @@
 [u"offset"]=>
 int(-18000)
 [u"timezone_id"]=>
-string(14) "America/Cayman"
+unicode(14) "America/Cayman"
   }
   [6]=>
   array(3) {
@@ -714,7 +714,7 @@
 [u"offset"]=>
 int(-18000)
 [u"timezone_id"]=>
-string(15) "America/Chicago"
+unicode(15) "America/

[PHP-CVS] cvs: php-src(PHP_5_2) /ext/standard/tests/assert assert_basic.phpt assert_basic1.phpt assert_basic2.phpt assert_basic3.phpt assert_basic4.phpt assert_basic5.phpt assert_error.phpt assert_err

2007-07-13 Thread Zoe Slattery
zoe Fri Jul 13 15:20:13 2007 UTC

  Added files: (Branch: PHP_5_2)
/php-src/ext/standard/tests/assert  assert_basic1.phpt 
assert_basic2.phpt 
assert_basic3.phpt 
assert_error.phpt 
assert_basic4.phpt 
assert_basic5.phpt 
assert_error1.phpt 
assert_basic.phpt 
assert_variation.phpt 
  Log:
  Assert test cases
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/assert/assert_basic1.phpt?view=markup&rev=1.1
Index: php-src/ext/standard/tests/assert/assert_basic1.phpt
+++ php-src/ext/standard/tests/assert/assert_basic1.phpt
--TEST--
assert() - basic - check  that assert can be switched off
--INI--
assert.active = 0
assert.warning = 0
assert.callback = f1
assert.bail = 0
assert.quiet_eval = 0
--FILE--
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/assert/assert_basic2.phpt?view=markup&rev=1.1
Index: php-src/ext/standard/tests/assert/assert_basic2.phpt
+++ php-src/ext/standard/tests/assert/assert_basic2.phpt
--TEST--
assert() basic - correct call back values before and after assert.
--INI--
assert.active = 1
assert.warning = 1
assert.callback=f1
assert.bail = 0
assert.quiet_eval = 0
--FILE--

--EXPECTF--
string(2) "f1"
f1 called

Warning: assert(): Assertion failed in %s on line 13
string(2) "f1"
string(2) "f2"
f2 called

Warning: assert(): Assertion failed in %s on line 17
--UEXPECTF--
unicode(2) "f1"
f1 called

Warning: assert(): Assertion failed in %s on line 13
unicode(2) "f1"
unicode(2) "f2"
f2 called

Warning: assert(): Assertion failed in %s on line 17

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/assert/assert_basic3.phpt?view=markup&rev=1.1
Index: php-src/ext/standard/tests/assert/assert_basic3.phpt
+++ php-src/ext/standard/tests/assert/assert_basic3.phpt
--TEST--
assert() - basic - Test that bailout works
--INI--
assert.active = 1
assert.warning = 1
assert.callback = f1
assert.quiet_eval = 1
assert.bail = 0
--FILE--
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/assert/assert_error.phpt?view=markup&rev=1.1
Index: php-src/ext/standard/tests/assert/assert_error.phpt
+++ php-src/ext/standard/tests/assert/assert_error.phpt
--TEST--
assert() - error - give assert nonsense string with quiet_eval on then off
--INI--
assert.active = 1
assert.warning = 1
assert.callback = f1
assert.bail = 0
assert.quiet_eval = 0
--FILE--
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/assert/assert_basic4.phpt?view=markup&rev=1.1
Index: php-src/ext/standard/tests/assert/assert_basic4.phpt
+++ php-src/ext/standard/tests/assert/assert_basic4.phpt
--TEST--
assert() - basic - test initial values using ini.get and assert_options
--INI--
assert.active = 0
assert.warning = 0
assert.bail = 0
assert.quiet_eval = 0
assert.callback = f1
--FILE--
 
[".assert_options(ASSERT_ACTIVE)."]\n";
echo "Initial values: assert_options(ASSERT_WARNING) => 
[".assert_options(ASSERT_WARNING)."]\n";
echo "Initial values: assert_options(ASSERT_BAIL) => 
[".assert_options(ASSERT_BAIL)."]\n";
echo "Initial values: assert_options(ASSERT_QUIET_EVAL) => 
[".assert_options(ASSERT_QUIET_EVAL)."]\n";
echo "Initial values: assert_options(ASSERT_CALLBACK) => 
[".assert_options(ASSERT_CALLBACK)."]\n";

//Using ini.get;
echo "Initial values: ini.get(\"assert.active\") => 
[".ini_get("assert.active")."]\n";
echo "Initial values: ini.get(\"assert.warning\") => 
[".ini_get("assert.warning")."]\n";
echo "Initial values: ini.get(\"assert.bail\") => 
[".ini_get("assert.bail")."]\n";
echo "Initial values: ini.get(\"assert.quiet_eval\") => 
[".ini_get("assert.quiet_eval")."]\n";
echo "Initial values: ini.get(\"assert.callback\") => 
[".ini_get("assert.callback")."]\n\n";

--EXPECTF--
Initial values: assert_options(ASSERT_ACTIVE) => [0]
Initial values: assert_options(ASSERT_WARNING) => [0]
Initial values: assert_options(ASSERT_BAIL) => [0]
Initial values: assert_options(ASSERT_QUIET_EVAL) => [0]
Initial values: assert_options(ASSERT_CALLBACK) => [f1]
Initial values: ini.get("assert.active") => [0]
Initial values: ini.get("assert.warning") => [0]
Initial values: ini.get("assert.bail") => [0]
Initial values: ini.get("assert.quiet_eval") => [0]
Initial values: ini.get("assert.callback") => [f1]
--UEXPECTF--
Initial values: assert_options(ASSERT_ACTIVE) => [0]
Initial values: assert_options(ASSERT_WARNING) => [0]
Initial values: assert_options(ASSERT_BAIL) => [0]
Initial values: assert_options(ASSERT_QUIET_EVAL) => [0]
Initial values: assert_options(ASSERT_CALLBACK) => [f1]
Initial values: ini.get("assert.active") => [0]
Initial values: ini.get("assert.warning") => [0]
Initial values: ini.get("assert.bail") => [0]
Initial values: ini.get("assert.quiet_eval") => [0]
Initial values: ini.ge

[PHP-CVS] cvs: php-src /ext/standard/tests/assert assert_basic.phpt assert_basic1.phpt assert_basic3.phpt assert_basic4.phpt assert_basic5.phpt assert_error.phpt assert_error1.phpt assert_variation.ph

2007-07-13 Thread Zoe Slattery
zoe Fri Jul 13 15:17:28 2007 UTC

  Added files: 
/php-src/ext/standard/tests/assert  assert_basic.phpt 
assert_variation.phpt 
assert_basic1.phpt 
assert_basic3.phpt 
assert_basic4.phpt 
assert_basic5.phpt 
assert_error.phpt 
assert_error1.phpt 
  Log:
  Assert test cases
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/assert/assert_basic.phpt?view=markup&rev=1.1
Index: php-src/ext/standard/tests/assert/assert_basic.phpt
+++ php-src/ext/standard/tests/assert/assert_basic.phpt
--TEST--
assert() - basic - check  that assert runs when assert.active is set to 1.
--INI--
assert.active = 1
assert.warning = 0
assert.callback = f1
assert.bail = 0
assert.quiet_eval = 0
--FILE--
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/assert/assert_variation.phpt?view=markup&rev=1.1
Index: php-src/ext/standard/tests/assert/assert_variation.phpt
+++ php-src/ext/standard/tests/assert/assert_variation.phpt
--TEST--
assert() - variation  - test callback options using 
ini_get/ini_set/assert_options 
--INI--
assert.active = 1
assert.warning = 0
assert.callback = f1
assert.bail = 0
assert.quiet_eval = 0
--FILE--
 
[".assert_options(ASSERT_CALLBACK)."]\n";
echo "Initial values: ini.get(\"assert.callback\") => 
[".ini_get("assert.callback")."]\n";
$sa = "0 != 0";
var_dump($r2=assert($sa));
echo"\n";

echo "Change callback function using ini.set and test return value \n";
var_dump($rv = ini_set("assert.callback","f2"));
echo "assert_options(ASSERT_CALLBACK) => 
[".assert_options(ASSERT_CALLBACK)."]\n";
echo "ini.get(\"assert.callback\") => [".ini_get("assert.callback")."]\n";
var_dump($r2=assert($sa));
echo"\n";

echo "Change callback function using assert_options and test return value \n";
var_dump($rv=assert_options(ASSERT_CALLBACK, "f3"));
echo "assert_options(ASSERT_CALLBACK) => 
[".assert_options(ASSERT_CALLBACK)."]\n";
echo "ini.get(\"assert.callback\") => [".ini_get("assert.callback")."]\n";
var_dump($r2=assert($sa));
echo"\n";


echo "Reset the name of the callback routine to a class method and check that 
it works\n";
var_dump($rc=assert_options(ASSERT_CALLBACK, "c1"));
echo "assert_options(ASSERT_CALLBACK) => 
[".assert_options(ASSERT_CALLBACK)."]\n";
echo "ini.get(\"assert.callback\") => [".ini_get("assert.callback")."]\n";
var_dump($r2=assert($sa));
echo"\n";

echo "Reset callback options to use a class method \n";
var_dump($rc = assert_options(ASSERT_CALLBACK,array("c1","assert")));
var_dump($rao=assert_options(ASSERT_CALLBACK));
echo "ini.get(\"assert.callback\") => [".ini_get("assert.callback")."]\n\n";
var_dump($r2=assert($sa));
echo"\n";

echo "Reset callback options to use an object method \n";
$o = new c1();
var_dump($rc=assert_options(ASSERT_CALLBACK,array(&$o,"assert")));
var_dump($rao=assert_options(ASSERT_CALLBACK));
echo "ini.get(\"assert.callback\") => [".ini_get("assert.callback")."]\n\n";
var_dump($r2=assert($sa));
echo"\n";

--EXPECTF--
Initial values: assert_options(ASSERT_CALLBACK) => [f1]
Initial values: ini.get("assert.callback") => [f1]
f1 called
NULL

Change callback function using ini.set and test return value 
string(2) "f1"
assert_options(ASSERT_CALLBACK) => [f2]
ini.get("assert.callback") => [f2]
f2 called
NULL

Change callback function using assert_options and test return value 
string(2) "f2"
assert_options(ASSERT_CALLBACK) => [f3]
ini.get("assert.callback") => [f2]
f3 called
NULL

Reset the name of the callback routine to a class method and check that it works
string(2) "f3"
assert_options(ASSERT_CALLBACK) => [c1]
ini.get("assert.callback") => [f2]
NULL

Reset callback options to use a class method 
string(2) "c1"
array(2) {
  [0]=>
  string(2) "c1"
  [1]=>
  string(6) "assert"
}
ini.get("assert.callback") => [f2]


Strict Standards: Non-static method c1::assert() cannot be called statically in 
%s on line 53
Class assertion failed 53, "0 != 0"
NULL

Reset callback options to use an object method 
array(2) {
  [0]=>
  string(2) "c1"
  [1]=>
  string(6) "assert"
}
array(2) {
  [0]=>
  &object(c1)#1 (0) {
  }
  [1]=>
  string(6) "assert"
}
ini.get("assert.callback") => [f2]

Class assertion failed 61, "0 != 0"
NULL
--UEXPECTF--
Initial values: assert_options(ASSERT_CALLBACK) => [f1]
Initial values: ini.get("assert.callback") => [f1]
f1 called
NULL

Change callback function using ini.set and test return value 
unicode(2) "f1"
assert_options(ASSERT_CALLBACK) => [f2]
ini.get("assert.callback") => [f2]
f2 called
NULL

Change callback function using assert_options and test return value 
unicode(2) "f2"
assert_options(ASSERT_CALLBACK) => [f3]
ini.get("assert.callback") => [f2]
f3 called
NULL

Reset the name of the callback routine to a class method and check that it works
u

[PHP-CVS] cvs: php-src /ext/dba config.m4

2007-07-13 Thread Jani Taskinen
janiFri Jul 13 15:08:55 2007 UTC

  Modified files:  
/php-src/ext/dbaconfig.m4 
  Log:
  - fix wrong logic
  
http://cvs.php.net/viewvc.cgi/php-src/ext/dba/config.m4?r1=1.75&r2=1.76&diff_format=u
Index: php-src/ext/dba/config.m4
diff -u php-src/ext/dba/config.m4:1.75 php-src/ext/dba/config.m4:1.76
--- php-src/ext/dba/config.m4:1.75  Fri Jul 13 14:23:41 2007
+++ php-src/ext/dba/config.m4   Fri Jul 13 15:08:55 2007
@@ -1,5 +1,5 @@
 dnl
-dnl $Id: config.m4,v 1.75 2007/07/13 14:23:41 jani Exp $
+dnl $Id: config.m4,v 1.76 2007/07/13 15:08:55 jani Exp $
 dnl
 
 dnl Suppose we need FlatFile if no support or only CDB is used.
@@ -477,7 +477,7 @@
 dnl
 dnl Bundled modules that should be enabled by default if any other option is 
enabled
 dnl
-if test "$PHP_DBA" != "no" || test "$HAVE_DBA" = "1" || test "$with_cdb" != 
"no" || test "$enable_inifile" != "no" || test "$enable_flatfile" != "no"; then
+if test "$PHP_DBA" != "no" || test "$HAVE_DBA" = "1" || test "$with_cdb" = 
"yes" || test "$enable_inifile" = "yes" || test "$enable_flatfile" = "yes"; then
   php_dba_enable=yes
 else
   php_dba_enable=no

-- 
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/assert assert_basic2.phpt

2007-07-13 Thread Zoe Slattery
zoe Fri Jul 13 14:57:32 2007 UTC

  Added files: 
/php-src/ext/standard/tests/assert  assert_basic2.phpt 
  Log:
  Assert test
  

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/assert/assert_basic2.phpt?view=markup&rev=1.1
Index: php-src/ext/standard/tests/assert/assert_basic2.phpt
+++ php-src/ext/standard/tests/assert/assert_basic2.phpt
--TEST--
assert() basic - correct call back values before and after assert.
--INI--
assert.active = 1
assert.warning = 1
assert.callback=f1
assert.bail = 0
assert.quiet_eval = 0
--FILE--

--EXPECTF--
string(2) "f1"
f1 called

Warning: assert(): Assertion failed in %s on line 13
string(2) "f1"
string(2) "f2"
f2 called

Warning: assert(): Assertion failed in %s on line 17
--UEXPECTF--
unicode(2) "f1"
f1 called

Warning: assert(): Assertion failed in %s on line 13
unicode(2) "f1"
unicode(2) "f2"
f2 called

Warning: assert(): Assertion failed in %s on line 17

-- 
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/dba config.m4

2007-07-13 Thread Jani Taskinen
janiFri Jul 13 14:23:59 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/dbaconfig.m4 
  Log:
  MFH: cleanups + fixes
  http://cvs.php.net/viewvc.cgi/php-src/ext/dba/config.m4?r1=1.70.2.2.2.5&r2=1.70.2.2.2.6&diff_format=u
Index: php-src/ext/dba/config.m4
diff -u php-src/ext/dba/config.m4:1.70.2.2.2.5 
php-src/ext/dba/config.m4:1.70.2.2.2.6
--- php-src/ext/dba/config.m4:1.70.2.2.2.5  Mon May 21 11:38:53 2007
+++ php-src/ext/dba/config.m4   Fri Jul 13 14:23:59 2007
@@ -1,5 +1,5 @@
 dnl
-dnl $Id: config.m4,v 1.70.2.2.2.5 2007/05/21 11:38:53 tony2001 Exp $
+dnl $Id: config.m4,v 1.70.2.2.2.6 2007/07/13 14:23:59 jani Exp $
 dnl
 
 dnl Suppose we need FlatFile if no support or only CDB is used.
@@ -27,7 +27,7 @@
 
 dnl Standard check
 AC_DEFUN([PHP_DBA_STD_CHECK],[
-  THIS_RESULT="yes"
+  THIS_RESULT=yes
   if test -z "$THIS_INCLUDE"; then
 AC_MSG_ERROR([DBA: Could not find necessary header file(s).])
   fi
@@ -44,128 +44,154 @@
 
 dnl Print the result message
 dnl parameters(name [, full name [, empty or error message]])
-AC_DEFUN([AC_DBA_STD_RESULT],[
+AC_DEFUN([PHP_DBA_STD_RESULT],[
   THIS_NAME=[]translit($1,a-z0-9-,A-Z0-9_)
   if test -n "$2"; then
 THIS_FULL_NAME="$2"
   else
 THIS_FULL_NAME="$THIS_NAME"
   fi
-  AC_MSG_CHECKING(for $THIS_FULL_NAME support)
+  AC_MSG_CHECKING([for $THIS_FULL_NAME support])
   if test -n "$3"; then
 AC_MSG_ERROR($3)
   fi
   if test "$THIS_RESULT" = "yes" || test "$THIS_RESULT" = "builtin"; then
 HAVE_DBA=1
 eval HAVE_$THIS_NAME=1
-AC_MSG_RESULT($THIS_RESULT)
+AC_MSG_RESULT([$THIS_RESULT])
   else
 AC_MSG_RESULT(no)
   fi
   unset THIS_RESULT THIS_NAME THIS_FULL_NAME
 ])
 
-PHP_ARG_ENABLE(dba,whether to enable DBA,
-[  --enable-dbaBuild DBA with builtin modules. To build shared DBA
+dnl
+dnl Options
+dnl
+
+PHP_ARG_ENABLE(dba,,
+[  --enable-dbaBuild DBA with bundled modules. To build shared DBA
   extension use --enable-dba=shared])
 
-AC_ARG_WITH(qdbm,
-[  --with-qdbm[=DIR] DBA: Include QDBM support],[
-  if test "$withval" != "no"; then
-PHP_DBA_STD_BEGIN
-for i in $withval /usr/local /usr; do
-  if test -f "$i/include/depot.h"; then
-THIS_PREFIX=$i
-THIS_INCLUDE=$i/include/depot.h
-break
-  fi
-done
+PHP_ARG_WITH(qdbm,,
+[  --with-qdbm[=DIR] DBA: QDBM support], no, no)
 
-if test -n "$THIS_INCLUDE"; then
-  for LIB in qdbm; do
-PHP_CHECK_LIBRARY($LIB, dpopen, [
-  AC_DEFINE_UNQUOTED(QDBM_INCLUDE_FILE, "$THIS_INCLUDE", [ ])
-  AC_DEFINE(DBA_QDBM, 1, [ ])
-  THIS_LIBS=$LIB
-], [], [-L$THIS_PREFIX/$PHP_LIBDIR])
-if test -n "$THIS_LIBS"; then
-  break
-fi
-  done
-fi
+PHP_ARG_WITH(gdbm,,
+[  --with-gdbm[=DIR] DBA: GDBM support], no, no)
 
-PHP_DBA_STD_ASSIGN
-PHP_DBA_STD_CHECK
-PHP_DBA_STD_ATTACH
-  fi
-])
-AC_DBA_STD_RESULT(qdbm)
+PHP_ARG_WITH(ndbm,,
+[  --with-ndbm[=DIR] DBA: NDBM support], no, no)
 
-AC_ARG_WITH(gdbm,
-[  --with-gdbm[=DIR] DBA: Include GDBM support],[
-  if test "$withval" != "no"; then
-PHP_DBA_STD_BEGIN
-if test "$HAVE_QDBM" = "1"; then
-  AC_DBA_STD_RESULT(gdbm,gdbm,You cannot combine --with-gdbm with 
--with-qdbm)
+PHP_ARG_WITH(db4,,
+[  --with-db4[=DIR]  DBA: Berkeley DB4 support], no, no)
+
+PHP_ARG_WITH(db3,,
+[  --with-db3[=DIR]  DBA: Berkeley DB3 support], no, no)
+
+PHP_ARG_WITH(db2,,
+[  --with-db2[=DIR]  DBA: Berkeley DB2 support], no, no)
+
+PHP_ARG_WITH(db1,,
+[  --with-db1[=DIR]  DBA: Berkeley DB1 support/emulation], no, no)
+
+PHP_ARG_WITH(dbm,,
+[  --with-dbm[=DIR]  DBA: DBM support], no, no)
+
+dnl
+dnl Library checks
+dnl
+
+# QDBM
+if test "$PHP_QDBM" != "no"; then
+  PHP_DBA_STD_BEGIN
+  for i in $PHP_QDBM /usr/local /usr; do
+if test -f "$i/include/depot.h"; then
+  THIS_PREFIX=$i
+  THIS_INCLUDE=$i/include/depot.h
+  break
 fi
-for i in $withval /usr/local /usr; do
-  if test -f "$i/include/gdbm.h"; then
-THIS_PREFIX=$i
-THIS_INCLUDE=$i/include/gdbm.h
+  done
+
+  if test -n "$THIS_INCLUDE"; then
+for LIB in qdbm; do
+  PHP_CHECK_LIBRARY($LIB, dpopen, [
+AC_DEFINE_UNQUOTED(QDBM_INCLUDE_FILE, "$THIS_INCLUDE", [ ])
+AC_DEFINE(DBA_QDBM, 1, [ ])
+THIS_LIBS=$LIB
+  ], [], [-L$THIS_PREFIX/$PHP_LIBDIR])
+  if test -n "$THIS_LIBS"; then
 break
   fi
 done
+  fi
 
-if test -n "$THIS_INCLUDE"; then
-  PHP_CHECK_LIBRARY(gdbm, gdbm_open, [
-AC_DEFINE_UNQUOTED(GDBM_INCLUDE_FILE, "$THIS_INCLUDE", [ ])
-AC_DEFINE(DBA_GDBM, 1, [ ]) 
-THIS_LIBS=gdbm
-  ], [], [-L$THIS_PREFIX/$PHP_LIBDIR])
+  PHP_DBA_STD_ASSIGN
+  PHP_DBA_STD_CHECK
+  PHP_DBA_STD_ATTACH
+fi
+PHP_DBA_STD_RESULT(qdbm)
+
+# GDBM
+if test "$PHP_GDBM" != "no"; then
+  PHP_DBA_STD_BEGIN
+  if test "$HAVE_

[PHP-CVS] cvs: php-src /ext/dba config.m4

2007-07-13 Thread Jani Taskinen
janiFri Jul 13 14:23:41 2007 UTC

  Modified files:  
/php-src/ext/dbaconfig.m4 
  Log:
  - Fixed some issues with enabling builtin stuff when anything else is 
enabled
  - Changed all AC_ARG_* options to PHP_ARG_* options
  - Cleanups.
  
  http://cvs.php.net/viewvc.cgi/php-src/ext/dba/config.m4?r1=1.74&r2=1.75&diff_format=u
Index: php-src/ext/dba/config.m4
diff -u php-src/ext/dba/config.m4:1.74 php-src/ext/dba/config.m4:1.75
--- php-src/ext/dba/config.m4:1.74  Mon May 21 11:37:43 2007
+++ php-src/ext/dba/config.m4   Fri Jul 13 14:23:41 2007
@@ -1,5 +1,5 @@
 dnl
-dnl $Id: config.m4,v 1.74 2007/05/21 11:37:43 tony2001 Exp $
+dnl $Id: config.m4,v 1.75 2007/07/13 14:23:41 jani Exp $
 dnl
 
 dnl Suppose we need FlatFile if no support or only CDB is used.
@@ -27,7 +27,7 @@
 
 dnl Standard check
 AC_DEFUN([PHP_DBA_STD_CHECK],[
-  THIS_RESULT="yes"
+  THIS_RESULT=yes
   if test -z "$THIS_INCLUDE"; then
 AC_MSG_ERROR([DBA: Could not find necessary header file(s).])
   fi
@@ -44,135 +44,161 @@
 
 dnl Print the result message
 dnl parameters(name [, full name [, empty or error message]])
-AC_DEFUN([AC_DBA_STD_RESULT],[
+AC_DEFUN([PHP_DBA_STD_RESULT],[
   THIS_NAME=[]translit($1,a-z0-9-,A-Z0-9_)
   if test -n "$2"; then
 THIS_FULL_NAME="$2"
   else
 THIS_FULL_NAME="$THIS_NAME"
   fi
-  AC_MSG_CHECKING(for $THIS_FULL_NAME support)
+  AC_MSG_CHECKING([for $THIS_FULL_NAME support])
   if test -n "$3"; then
 AC_MSG_ERROR($3)
   fi
-  if test "$THIS_RESULT" = "yes" -o "$THIS_RESULT" = "builtin"; then
+  if test "$THIS_RESULT" = "yes" || test "$THIS_RESULT" = "builtin"; then
 HAVE_DBA=1
 eval HAVE_$THIS_NAME=1
-AC_MSG_RESULT($THIS_RESULT)
+AC_MSG_RESULT([$THIS_RESULT])
   else
 AC_MSG_RESULT(no)
   fi
   unset THIS_RESULT THIS_NAME THIS_FULL_NAME
 ])
 
-PHP_ARG_ENABLE(dba,whether to enable DBA,
-[  --enable-dbaBuild DBA with builtin modules. To build shared DBA
+dnl
+dnl Options
+dnl
+
+PHP_ARG_ENABLE(dba,,
+[  --enable-dbaBuild DBA with bundled modules. To build shared DBA
   extension use --enable-dba=shared])
 
-AC_ARG_WITH(qdbm,
-[  --with-qdbm[=DIR] DBA: Include QDBM support],[
-  if test "$withval" != "no"; then
-PHP_DBA_STD_BEGIN
-for i in $withval /usr/local /usr; do
-  if test -f "$i/include/depot.h"; then
-THIS_PREFIX=$i
-THIS_INCLUDE=$i/include/depot.h
-break
-  fi
-done
+PHP_ARG_WITH(qdbm,,
+[  --with-qdbm[=DIR] DBA: QDBM support], no, no)
 
-if test -n "$THIS_INCLUDE"; then
-  for LIB in qdbm; do
-PHP_CHECK_LIBRARY($LIB, dpopen, [
-  AC_DEFINE_UNQUOTED(QDBM_INCLUDE_FILE, "$THIS_INCLUDE", [ ])
-  AC_DEFINE(DBA_QDBM, 1, [ ])
-  THIS_LIBS=$LIB
-], [], [-L$THIS_PREFIX/$PHP_LIBDIR])
-if test -n "$THIS_LIBS"; then
-  break
-fi
-  done
-fi
+PHP_ARG_WITH(gdbm,,
+[  --with-gdbm[=DIR] DBA: GDBM support], no, no)
 
-PHP_DBA_STD_ASSIGN
-PHP_DBA_STD_CHECK
-PHP_DBA_STD_ATTACH
-  fi
-])
-AC_DBA_STD_RESULT(qdbm)
+PHP_ARG_WITH(ndbm,,
+[  --with-ndbm[=DIR] DBA: NDBM support], no, no)
 
-AC_ARG_WITH(gdbm,
-[  --with-gdbm[=DIR] DBA: Include GDBM support],[
-  if test "$withval" != "no"; then
-PHP_DBA_STD_BEGIN
-if test "$HAVE_QDBM" = "1"; then
-  AC_DBA_STD_RESULT(gdbm,gdbm,You cannot combine --with-gdbm with 
--with-qdbm)
+PHP_ARG_WITH(db4,,
+[  --with-db4[=DIR]  DBA: Berkeley DB4 support], no, no)
+
+PHP_ARG_WITH(db3,,
+[  --with-db3[=DIR]  DBA: Berkeley DB3 support], no, no)
+
+PHP_ARG_WITH(db2,,
+[  --with-db2[=DIR]  DBA: Berkeley DB2 support], no, no)
+
+PHP_ARG_WITH(db1,,
+[  --with-db1[=DIR]  DBA: Berkeley DB1 support/emulation], no, no)
+
+PHP_ARG_WITH(dbm,,
+[  --with-dbm[=DIR]  DBA: DBM support], no, no)
+
+dnl
+dnl Library checks
+dnl
+
+# QDBM
+if test "$PHP_QDBM" != "no"; then
+  PHP_DBA_STD_BEGIN
+  for i in $PHP_QDBM /usr/local /usr; do
+if test -f "$i/include/depot.h"; then
+  THIS_PREFIX=$i
+  THIS_INCLUDE=$i/include/depot.h
+  break
 fi
-for i in $withval /usr/local /usr; do
-  if test -f "$i/include/gdbm.h"; then
-THIS_PREFIX=$i
-THIS_INCLUDE=$i/include/gdbm.h
+  done
+
+  if test -n "$THIS_INCLUDE"; then
+for LIB in qdbm; do
+  PHP_CHECK_LIBRARY($LIB, dpopen, [
+AC_DEFINE_UNQUOTED(QDBM_INCLUDE_FILE, "$THIS_INCLUDE", [ ])
+AC_DEFINE(DBA_QDBM, 1, [ ])
+THIS_LIBS=$LIB
+  ], [], [-L$THIS_PREFIX/$PHP_LIBDIR])
+  if test -n "$THIS_LIBS"; then
 break
   fi
 done
+  fi
 
-if test -n "$THIS_INCLUDE"; then
-  PHP_CHECK_LIBRARY(gdbm, gdbm_open, [
-AC_DEFINE_UNQUOTED(GDBM_INCLUDE_FILE, "$THIS_INCLUDE", [ ])
-AC_DEFINE(DBA_GDBM, 1, [ ]) 
-THIS_LIBS=gdbm
-  ], [], [-L$THIS_PREFIX/$PHP_LIBDIR])
+  PHP_DBA_STD_ASSIGN
+  PHP_DBA_STD_CHECK
+  PHP_D

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

2007-07-13 Thread Dmitry Stogov
dmitry  Fri Jul 13 14:01:11 2007 UTC

  Modified files:  
/php-src/ext/soap   soap.c 
  Log:
  Fixed bug #41635 (SoapServer and zlib.output_compression with FastCGI result 
in major slowdown
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/soap/soap.c?r1=1.224&r2=1.225&diff_format=u
Index: php-src/ext/soap/soap.c
diff -u php-src/ext/soap/soap.c:1.224 php-src/ext/soap/soap.c:1.225
--- php-src/ext/soap/soap.c:1.224   Fri Jul  6 10:36:20 2007
+++ php-src/ext/soap/soap.c Fri Jul 13 14:01:11 2007
@@ -17,7 +17,7 @@
   |  Dmitry Stogov <[EMAIL PROTECTED]> |
   +--+
 */
-/* $Id: soap.c,v 1.224 2007/07/06 10:36:20 dmitry Exp $ */
+/* $Id: soap.c,v 1.225 2007/07/13 14:01:11 dmitry Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -2134,8 +2134,6 @@
php_error_docref(NULL TSRMLS_CC, E_ERROR, "Dump memory 
failed");
}
 
-   snprintf(cont_len, sizeof(cont_len), "Content-Length: %d", 
size);
-   sapi_add_header(cont_len, strlen(cont_len), 1);
if (soap_version == SOAP_1_2) {
sapi_add_header("Content-Type: application/soap+xml; 
charset=utf-8", sizeof("Content-Type: application/soap+xml; charset=utf-8")-1, 
1);
} else {
@@ -2147,10 +2145,18 @@
old_output_conv = UG(output_encoding_conv);
UG(runtime_encoding_conv) = UG(utf8_conv);
UG(output_encoding_conv) = UG(utf8_conv);
+
+   if (zend_ini_long("zlib.output_compression", 
sizeof("zlib.output_compression"), 0)) {
+   sapi_add_header("Connection: close", 
sizeof("Connection: close")-1, 1);
+   } else {
+   snprintf(cont_len, sizeof(cont_len), "Content-Length: 
%d", size);
+   sapi_add_header(cont_len, strlen(cont_len), 1);
+   }
php_write(buf, size TSRMLS_CC);
+   xmlFree(buf);
+
UG(runtime_encoding_conv) = old_runtime_conv;
UG(output_encoding_conv) = old_output_conv;
-   xmlFree(buf);
} else {
sapi_add_header("HTTP/1.1 202 Accepted", sizeof("HTTP/1.1 202 
Accepted")-1, 1);
sapi_add_header("Content-Length: 0", sizeof("Content-Length: 
0")-1, 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_2) / NEWS /ext/soap soap.c

2007-07-13 Thread Dmitry Stogov
dmitry  Fri Jul 13 14:00:06 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-srcNEWS 
/php-src/ext/soap   soap.c 
  Log:
  Fixed bug #41635 (SoapServer and zlib.output_compression with FastCGI result 
in major slowdown
  
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.834&r2=1.2027.2.547.2.835&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.834 php-src/NEWS:1.2027.2.547.2.835
--- php-src/NEWS:1.2027.2.547.2.834 Fri Jul 13 01:24:15 2007
+++ php-src/NEWSFri Jul 13 14:00:04 2007
@@ -108,6 +108,8 @@
 - Fixed bug #41655 (open_basedir bypass via glob()). (Ilia)
 - Fixed bug #41640 (get_class_vars produces error on class constants).
   (Johannes)
+- Fixed bug #41635 (SoapServer and zlib.output_compression with FastCGI result
+  in major slowdown). (Dmitry)
 - Fixed bug #41633 (Crash instantiating classes with self-referencing
   constants). (Dmitry)
 - Fixed bug #41630 (segfault when an invalid color index is present in
http://cvs.php.net/viewvc.cgi/php-src/ext/soap/soap.c?r1=1.156.2.28.2.25&r2=1.156.2.28.2.26&diff_format=u
Index: php-src/ext/soap/soap.c
diff -u php-src/ext/soap/soap.c:1.156.2.28.2.25 
php-src/ext/soap/soap.c:1.156.2.28.2.26
--- php-src/ext/soap/soap.c:1.156.2.28.2.25 Sun May 27 17:46:46 2007
+++ php-src/ext/soap/soap.c Fri Jul 13 14:00:05 2007
@@ -17,7 +17,7 @@
   |  Dmitry Stogov <[EMAIL PROTECTED]> |
   +--+
 */
-/* $Id: soap.c,v 1.156.2.28.2.25 2007/05/27 17:46:46 iliaa Exp $ */
+/* $Id: soap.c,v 1.156.2.28.2.26 2007/07/13 14:00:05 dmitry Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -1848,8 +1848,6 @@
php_error_docref(NULL TSRMLS_CC, E_ERROR, "Dump memory 
failed");
}   
 
-   snprintf(cont_len, sizeof(cont_len), "Content-Length: %d", 
size);
-   sapi_add_header(cont_len, strlen(cont_len), 1);
if (soap_version == SOAP_1_2) {
sapi_add_header("Content-Type: application/soap+xml; 
charset=utf-8", sizeof("Content-Type: application/soap+xml; charset=utf-8")-1, 
1);
} else {
@@ -1857,8 +1855,38 @@
}
 
xmlFreeDoc(doc_return);
-   php_write(buf, size TSRMLS_CC);
-   xmlFree(buf);
+
+   if (zend_ini_long("zlib.output_compression", 
sizeof("zlib.output_compression"), 0) &&   
+   zend_hash_exists(EG(function_table), "ob_gzhandler", 
sizeof("ob_gzhandler"))) {
+   zval nm_ob_gzhandler;
+   zval str;
+   zval mode;
+   zval result;
+   zval *params[2];
+
+   INIT_ZVAL(result);
+   ZVAL_STRINGL(&nm_ob_gzhandler, "ob_gzhandler", 
sizeof("ob_gzhandler") - 1, 0);
+   ZVAL_STRINGL(&str, (char*)buf, size, 0);
+   params[0] = &str;
+   ZVAL_LONG(&mode, PHP_OUTPUT_HANDLER_START | 
PHP_OUTPUT_HANDLER_END);
+   params[1] = &mode;
+   if (call_user_function(CG(function_table), NULL, 
&nm_ob_gzhandler, &result, 2, params TSRMLS_CC) != FAILURE &&
+   Z_TYPE(result) == IS_STRING &&
+   zend_alter_ini_entry("zlib.output_compression", 
sizeof("zlib.output_compression"), "0", sizeof("0")-1, PHP_INI_USER, 
PHP_INI_STAGE_RUNTIME) == SUCCESS) {
+   xmlFree(buf);
+   buf = NULL;
+   snprintf(cont_len, sizeof(cont_len), 
"Content-Length: %d", Z_STRLEN(result));
+   sapi_add_header(cont_len, strlen(cont_len), 1);
+   php_write(Z_STRVAL(result), Z_STRLEN(result) 
TSRMLS_CC);
+   }
+   zval_dtor(&result);
+   }
+   if (buf) {
+   snprintf(cont_len, sizeof(cont_len), "Content-Length: 
%d", size);
+   sapi_add_header(cont_len, strlen(cont_len), 1);
+   php_write(buf, size TSRMLS_CC);
+   xmlFree(buf);
+   }
} else {
sapi_add_header("HTTP/1.1 202 Accepted", sizeof("HTTP/1.1 202 
Accepted")-1, 1);
sapi_add_header("Content-Length: 0", sizeof("Content-Length: 
0")-1, 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_2) /ext/date/lib timelib.c

2007-07-13 Thread Rob Richards
rrichards   Fri Jul 13 12:50:00 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/date/lib   timelib.c 
  Log:
  MFH: use macro - llabs not always available on win32
  
http://cvs.php.net/viewvc.cgi/php-src/ext/date/lib/timelib.c?r1=1.7.2.4.2.3&r2=1.7.2.4.2.4&diff_format=u
Index: php-src/ext/date/lib/timelib.c
diff -u php-src/ext/date/lib/timelib.c:1.7.2.4.2.3 
php-src/ext/date/lib/timelib.c:1.7.2.4.2.4
--- php-src/ext/date/lib/timelib.c:1.7.2.4.2.3  Thu Jul 12 18:58:00 2007
+++ php-src/ext/date/lib/timelib.c  Fri Jul 13 12:50:00 2007
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: timelib.c,v 1.7.2.4.2.3 2007/07/12 18:58:00 derick Exp $ */
+/* $Id: timelib.c,v 1.7.2.4.2.4 2007/07/13 12:50:00 rrichards Exp $ */
 
 #include "timelib.h"
 #include 
@@ -28,6 +28,12 @@
m = NULL;   \
}   \
 
+#if defined(_MSC_VER)
+   #define TIMELIB_LLABS(y) y < 0 ? (y * -1) : y
+#else
+   #define TIMELIB_LLABS(y) llabs(y)
+#endif
+
 timelib_time* timelib_time_ctor()
 {
timelib_time *t;
@@ -168,7 +174,7 @@
printf("TYPE: %d ", d->zone_type);
}
printf("TS: %lld | %s%04lld-%02lld-%02lld %02lld:%02lld:%02lld",
-   d->sse, d->y < 0 ? "-" : "", llabs(d->y), d->m, d->d, d->h, 
d->i, d->s);
+   d->sse, d->y < 0 ? "-" : "", TIMELIB_LLABS(d->y), d->m, d->d, 
d->h, d->i, d->s);
if (d->f > +0.0) {
printf(" %.5f", d->f);
}

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



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

2007-07-13 Thread Rob Richards
rrichards   Fri Jul 13 12:48:47 2007 UTC

  Modified files:  
/php-src/ext/date/lib   timelib.c 
  Log:
  use macro - llabs not always available on win32
  
http://cvs.php.net/viewvc.cgi/php-src/ext/date/lib/timelib.c?r1=1.14&r2=1.15&diff_format=u
Index: php-src/ext/date/lib/timelib.c
diff -u php-src/ext/date/lib/timelib.c:1.14 php-src/ext/date/lib/timelib.c:1.15
--- php-src/ext/date/lib/timelib.c:1.14 Thu Jul 12 18:56:41 2007
+++ php-src/ext/date/lib/timelib.c  Fri Jul 13 12:48:47 2007
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: timelib.c,v 1.14 2007/07/12 18:56:41 derick Exp $ */
+/* $Id: timelib.c,v 1.15 2007/07/13 12:48:47 rrichards Exp $ */
 
 #include "timelib.h"
 #include 
@@ -28,6 +28,12 @@
m = NULL;   \
}   \
 
+#if defined(_MSC_VER)
+   #define TIMELIB_LLABS(y) y < 0 ? (y * -1) : y
+#else
+   #define TIMELIB_LLABS(y) llabs(y)
+#endif
+
 timelib_time* timelib_time_ctor()
 {
timelib_time *t;
@@ -168,7 +174,7 @@
printf("TYPE: %d ", d->zone_type);
}
printf("TS: %lld | %s%04lld-%02lld-%02lld %02lld:%02lld:%02lld",
-   d->sse, d->y < 0 ? "-" : "", llabs(d->y), d->m, d->d, d->h, 
d->i, d->s);
+   d->sse, d->y < 0 ? "-" : "", TIMELIB_LLABS(d->y), d->m, d->d, 
d->h, d->i, d->s);
if (d->f > +0.0) {
printf(" %.5f", d->f);
}

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



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

2007-07-13 Thread Jani Taskinen
janiFri Jul 13 10:55:43 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/ldap   ldap.c 
  Log:
  - Do not break thousands of scripts.. (will remove in 5.3)
  
http://cvs.php.net/viewvc.cgi/php-src/ext/ldap/ldap.c?r1=1.161.2.3.2.8&r2=1.161.2.3.2.9&diff_format=u
Index: php-src/ext/ldap/ldap.c
diff -u php-src/ext/ldap/ldap.c:1.161.2.3.2.8 
php-src/ext/ldap/ldap.c:1.161.2.3.2.9
--- php-src/ext/ldap/ldap.c:1.161.2.3.2.8   Fri Jul 13 02:00:39 2007
+++ php-src/ext/ldap/ldap.c Fri Jul 13 10:55:43 2007
@@ -23,7 +23,7 @@
+--+
  */
  
-/* $Id: ldap.c,v 1.161.2.3.2.8 2007/07/13 02:00:39 jani Exp $ */
+/* $Id: ldap.c,v 1.161.2.3.2.9 2007/07/13 10:55:43 jani Exp $ */
 #define IS_EXT_MODULE
 
 #ifdef HAVE_CONFIG_H
@@ -322,7 +322,7 @@
 
php_info_print_table_start();
php_info_print_table_row(2, "LDAP Support", "enabled");
-   php_info_print_table_row(2, "RCS Version", "$Id: ldap.c,v 1.161.2.3.2.8 
2007/07/13 02:00:39 jani Exp $");
+   php_info_print_table_row(2, "RCS Version", "$Id: ldap.c,v 1.161.2.3.2.9 
2007/07/13 10:55:43 jani Exp $");
 
if (LDAPG(max_links) == -1) {
snprintf(tmp, 31, "%ld/unlimited", LDAPG(num_links));
@@ -1130,8 +1130,9 @@
ldap_linkdata *ld;
ldap_resultentry *resultentry;
char *attribute;
+   int argc = ZEND_NUM_ARGS();
 
-   if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &link, 
&result_entry) == FAILURE) {
+   if ((argc < 2 || argc > 3) || zend_get_parameters_ex(2, &link, 
&result_entry) == FAILURE) {
WRONG_PARAM_COUNT;
}
 
@@ -1157,8 +1158,9 @@
ldap_linkdata *ld;
ldap_resultentry *resultentry;
char *attribute;
+   int argc = ZEND_NUM_ARGS();
 
-   if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &link, 
&result_entry) == FAILURE) {
+   if ((argc < 2 || argc > 3) || zend_get_parameters_ex(2, &link, 
&result_entry) == FAILURE) {
WRONG_PARAM_COUNT;
}
 

-- 
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 config.m4

2007-07-13 Thread Antony Dovgal
tony2001Fri Jul 13 09:24:30 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/oci8   config.m4 
  Log:
  MFH: don't allow $PHP_OCI8 to be empty if OCI8 is enabled
  fixes bug #41988
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/config.m4?r1=1.55.2.3.2.8&r2=1.55.2.3.2.9&diff_format=u
Index: php-src/ext/oci8/config.m4
diff -u php-src/ext/oci8/config.m4:1.55.2.3.2.8 
php-src/ext/oci8/config.m4:1.55.2.3.2.9
--- php-src/ext/oci8/config.m4:1.55.2.3.2.8 Wed Jul 11 22:16:11 2007
+++ php-src/ext/oci8/config.m4  Fri Jul 13 09:24:30 2007
@@ -1,5 +1,5 @@
 dnl
-dnl $Id: config.m4,v 1.55.2.3.2.8 2007/07/11 22:16:11 tony2001 Exp $
+dnl $Id: config.m4,v 1.55.2.3.2.9 2007/07/13 09:24:30 tony2001 Exp $
 dnl
 
 if test -z "$SED"; then
@@ -138,12 +138,18 @@
 if test "$PHP_OCI8_INSTANT_CLIENT" = ""; then
 PHP_OCI8_INSTANT_CLIENT="yes"
 fi
+if test -z "$PHP_OCI8"; then
+PHP_OCI8=yes
+fi
 elif test "`echo $PHP_OCI8 | cut -d, -f1`" = "instantclient"; then
 PHP_OCI8_INSTANT_CLIENT="`echo $PHP_OCI8 | cut -d, -f2`"
 PHP_OCI8="`echo $PHP_OCI8 | cut -d, -f3,4`"
 if test "$PHP_OCI8_INSTANT_CLIENT" = ""; then
 PHP_OCI8_INSTANT_CLIENT="yes"
 fi
+if test -z "$PHP_OCI8"; then
+PHP_OCI8=yes
+fi
 fi
 
 if test "$PHP_OCI8" != "no" && test "$PHP_OCI8_INSTANT_CLIENT" = "no"; then

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



[PHP-CVS] cvs: php-src /ext/oci8 config.m4

2007-07-13 Thread Antony Dovgal
tony2001Fri Jul 13 09:23:46 2007 UTC

  Modified files:  
/php-src/ext/oci8   config.m4 
  Log:
  don't allow $PHP_OCI8 to be empty when OCI8 is enabled
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/config.m4?r1=1.67&r2=1.68&diff_format=u
Index: php-src/ext/oci8/config.m4
diff -u php-src/ext/oci8/config.m4:1.67 php-src/ext/oci8/config.m4:1.68
--- php-src/ext/oci8/config.m4:1.67 Wed Jul 11 22:15:44 2007
+++ php-src/ext/oci8/config.m4  Fri Jul 13 09:23:46 2007
@@ -1,5 +1,5 @@
 dnl
-dnl $Id: config.m4,v 1.67 2007/07/11 22:15:44 tony2001 Exp $
+dnl $Id: config.m4,v 1.68 2007/07/13 09:23:46 tony2001 Exp $
 dnl
 
 if test -z "$SED"; then
@@ -138,12 +138,18 @@
 if test "$PHP_OCI8_INSTANT_CLIENT" = ""; then
 PHP_OCI8_INSTANT_CLIENT="yes"
 fi
+if test -z "$PHP_OCI8"; then
+PHP_OCI8=yes
+fi
 elif test "`echo $PHP_OCI8 | cut -d, -f1`" = "instantclient"; then
 PHP_OCI8_INSTANT_CLIENT="`echo $PHP_OCI8 | cut -d, -f2`"
 PHP_OCI8="`echo $PHP_OCI8 | cut -d, -f3,4`"
 if test "$PHP_OCI8_INSTANT_CLIENT" = ""; then
 PHP_OCI8_INSTANT_CLIENT="yes"
 fi
+if test -z "$PHP_OCI8"; then
+PHP_OCI8=yes
+fi
 fi
 
 if test "$PHP_OCI8" != "no" && test "$PHP_OCI8_INSTANT_CLIENT" = "no"; then

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



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

2007-07-13 Thread Dmitry Stogov
dmitry  Fri Jul 13 09:15:04 2007 UTC

  Modified files:  
/php-src/ext/soap   php_http.c 
  Log:
  Fixed memleak
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/soap/php_http.c?r1=1.107&r2=1.108&diff_format=u
Index: php-src/ext/soap/php_http.c
diff -u php-src/ext/soap/php_http.c:1.107 php-src/ext/soap/php_http.c:1.108
--- php-src/ext/soap/php_http.c:1.107   Mon May 28 23:43:24 2007
+++ php-src/ext/soap/php_http.c Fri Jul 13 09:15:03 2007
@@ -17,7 +17,7 @@
   |  Dmitry Stogov <[EMAIL PROTECTED]> |
   +--+
 */
-/* $Id: php_http.c,v 1.107 2007/05/28 23:43:24 iliaa Exp $ */
+/* $Id: php_http.c,v 1.108 2007/07/13 09:15:03 dmitry Exp $ */
 
 #include "php_soap.h"
 #include "ext/standard/base64.h"
@@ -284,6 +284,7 @@
request_size = Z_STRLEN(retval);
} else {
if (request != buf) {efree(request);}
+   smart_str_free(&soap_headers_z);
return FALSE;
}
  }
@@ -305,6 +306,7 @@
  if (phpurl != NULL) {php_url_free(phpurl);}
if (request != buf) {efree(request);}
add_soap_fault(this_ptr, "HTTP", "Unable to parse URL", NULL, 
NULL TSRMLS_CC);
+   smart_str_free(&soap_headers_z);
return FALSE;
}
 
@@ -315,6 +317,7 @@
php_url_free(phpurl);
if (request != buf) {efree(request);}
add_soap_fault(this_ptr, "HTTP", "Unknown protocol. Only http 
and https are allowed.", NULL, NULL TSRMLS_CC);
+   smart_str_free(&soap_headers_z);
return FALSE;
}
 
@@ -328,6 +331,7 @@
if (request != buf) {efree(request);}
add_soap_fault(this_ptr, "HTTP", "SSL support is not available 
in this build", NULL, NULL TSRMLS_CC);
zend_alter_ini_entry("allow_url_fopen", 
sizeof("allow_url_fopen"), old_allow_url_fopen_list, 
strlen(old_allow_url_fopen_list), PHP_INI_SYSTEM, PHP_INI_STAGE_RUNTIME);
+   smart_str_free(&soap_headers_z);
return FALSE;
}
 
@@ -381,6 +385,7 @@
if (request != buf) {efree(request);}
add_soap_fault(this_ptr, "HTTP", "Could not connect to 
host", NULL, NULL TSRMLS_CC);
zend_alter_ini_entry("allow_url_fopen", 
sizeof("allow_url_fopen"), old_allow_url_fopen_list, 
strlen(old_allow_url_fopen_list), PHP_INI_SYSTEM, PHP_INI_STAGE_RUNTIME);
+   smart_str_free(&soap_headers_z);
return FALSE;
}
}
@@ -437,7 +442,6 @@
}
 
smart_str_append(&soap_headers, &soap_headers_z);
-   smart_str_free(&soap_headers_z);
 
if (soap_version == SOAP_1_2) {
smart_str_append_const(&soap_headers,"Content-Type: 
application/soap+xml; charset=utf-8");
@@ -690,12 +694,14 @@
client->stream = NULL;
client->use_proxy = 0;
add_soap_fault(this_ptr, "HTTP", "Failed Sending HTTP 
SOAP request", NULL, NULL TSRMLS_CC);
+   smart_str_free(&soap_headers_z);
return FALSE;
}
smart_str_free(&soap_headers);
 
} else {
add_soap_fault(this_ptr, "HTTP", "Failed to create stream??", 
NULL, NULL TSRMLS_CC);
+   smart_str_free(&soap_headers_z);
return FALSE;
}
 
@@ -703,6 +709,7 @@
php_stream_close(stream);
client->stream = NULL;
client->use_proxy = 0;
+   smart_str_free(&soap_headers_z);
return TRUE;
}
 
@@ -714,6 +721,7 @@
client->stream = NULL;
client->use_proxy = 0;
add_soap_fault(this_ptr, "HTTP", "Error Fetching http 
headers", NULL, NULL TSRMLS_CC);
+   smart_str_free(&soap_headers_z);
return FALSE;
}
 
@@ -867,6 +875,7 @@
if (http_msg) {
efree(http_msg);
}
+   smart_str_free(&soap_headers_z);
return FALSE;
}
 
@@ -1009,6 +1018,7 @@
}
if (auth) efree(auth);
}
+   smart_str_free(&soap_headers_z);
 
/* Check and see if the server even sent a xml document */
content_type = get_http_header_value(http_headers,"Content-Type: ");

-- 
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/soap php_http.c

2007-07-13 Thread Dmitry Stogov
dmitry  Fri Jul 13 09:14:03 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/soap   php_http.c 
  Log:
  Fixed memleak
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/soap/php_http.c?r1=1.77.2.11.2.10&r2=1.77.2.11.2.11&diff_format=u
Index: php-src/ext/soap/php_http.c
diff -u php-src/ext/soap/php_http.c:1.77.2.11.2.10 
php-src/ext/soap/php_http.c:1.77.2.11.2.11
--- php-src/ext/soap/php_http.c:1.77.2.11.2.10  Thu May 10 21:52:10 2007
+++ php-src/ext/soap/php_http.c Fri Jul 13 09:14:03 2007
@@ -17,7 +17,7 @@
   |  Dmitry Stogov <[EMAIL PROTECTED]> |
   +--+
 */
-/* $Id: php_http.c,v 1.77.2.11.2.10 2007/05/10 21:52:10 tony2001 Exp $ */
+/* $Id: php_http.c,v 1.77.2.11.2.11 2007/07/13 09:14:03 dmitry Exp $ */
 
 #include "php_soap.h"
 #include "ext/standard/base64.h"
@@ -288,6 +288,7 @@
request_size = Z_STRLEN(retval);
} else {
if (request != buf) {efree(request);}
+   smart_str_free(&soap_headers_z);
return FALSE;
}
  }
@@ -311,6 +312,7 @@
  if (phpurl != NULL) {php_url_free(phpurl);}
if (request != buf) {efree(request);}
add_soap_fault(this_ptr, "HTTP", "Unable to parse URL", NULL, 
NULL TSRMLS_CC);
+   smart_str_free(&soap_headers_z);
return FALSE;
}
 
@@ -321,6 +323,7 @@
php_url_free(phpurl);
if (request != buf) {efree(request);}
add_soap_fault(this_ptr, "HTTP", "Unknown protocol. Only http 
and https are allowed.", NULL, NULL TSRMLS_CC);
+   smart_str_free(&soap_headers_z);
return FALSE;
}
 
@@ -331,6 +334,7 @@
if (request != buf) {efree(request);}
add_soap_fault(this_ptr, "HTTP", "SSL support is not available 
in this build", NULL, NULL TSRMLS_CC);
PG(allow_url_fopen) = old_allow_url_fopen;
+   smart_str_free(&soap_headers_z);
return FALSE;
}
 
@@ -380,6 +384,7 @@
if (request != buf) {efree(request);}
add_soap_fault(this_ptr, "HTTP", "Could not connect to 
host", NULL, NULL TSRMLS_CC);
PG(allow_url_fopen) = old_allow_url_fopen;
+   smart_str_free(&soap_headers_z);
return FALSE;
}
}
@@ -438,7 +443,6 @@
}
 
smart_str_append(&soap_headers, &soap_headers_z);
-   smart_str_free(&soap_headers_z);
 
if (soap_version == SOAP_1_2) {
smart_str_append_const(&soap_headers,"Content-Type: 
application/soap+xml; charset=utf-8");
@@ -695,6 +699,7 @@
 
} else {
add_soap_fault(this_ptr, "HTTP", "Failed to create stream??", 
NULL, NULL TSRMLS_CC);
+   smart_str_free(&soap_headers_z);
return FALSE;
}
 
@@ -702,6 +707,7 @@
php_stream_close(stream);
zend_hash_del(Z_OBJPROP_P(this_ptr), "httpsocket", 
sizeof("httpsocket"));
zend_hash_del(Z_OBJPROP_P(this_ptr), "_use_proxy", 
sizeof("_use_proxy"));
+   smart_str_free(&soap_headers_z);
return TRUE;
}
 
@@ -713,6 +719,7 @@
zend_hash_del(Z_OBJPROP_P(this_ptr), "httpsocket", 
sizeof("httpsocket"));
zend_hash_del(Z_OBJPROP_P(this_ptr), "_use_proxy", 
sizeof("_use_proxy"));
add_soap_fault(this_ptr, "HTTP", "Error Fetching http 
headers", NULL, NULL TSRMLS_CC);
+   smart_str_free(&soap_headers_z);
return FALSE;
}
 
@@ -861,6 +868,7 @@
if (http_msg) {
efree(http_msg);
}
+   smart_str_free(&soap_headers_z);
return FALSE;
}
 
@@ -1008,6 +1016,7 @@
}
if (auth) efree(auth);
}
+   smart_str_free(&soap_headers_z);
 
/* Check and see if the server even sent a xml document */
content_type = get_http_header_value(http_headers,"Content-Type: ");

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

2007-07-13 Thread Antony Dovgal
tony2001Fri Jul 13 09:13:59 2007 UTC

  Modified files:  
/php-src/ext/standard/tests/general_functions   

call_user_func_return.phpt 
  Log:
  fix test
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/general_functions/call_user_func_return.phpt?r1=1.2&r2=1.3&diff_format=u
Index: php-src/ext/standard/tests/general_functions/call_user_func_return.phpt
diff -u 
php-src/ext/standard/tests/general_functions/call_user_func_return.phpt:1.2 
php-src/ext/standard/tests/general_functions/call_user_func_return.phpt:1.3
--- php-src/ext/standard/tests/general_functions/call_user_func_return.phpt:1.2 
Tue Mar  6 20:45:15 2007
+++ php-src/ext/standard/tests/general_functions/call_user_func_return.phpt 
Fri Jul 13 09:13:58 2007
@@ -40,7 +40,7 @@
 Direct Call
 string(5) "test2" refcount(2)
 User Func
-string(5) "test2" refcount(2)
+string(5) "test2" refcount(1)
 ===DONE===
 --UEXPECTF--
 Direct Call
@@ -50,5 +50,5 @@
 Direct Call
 unicode(5) "test2" { 0074 0065 0073 0074 0032 } refcount(2)
 User Func
-unicode(5) "test2" { 0074 0065 0073 0074 0032 } refcount(2)
+unicode(5) "test2" { 0074 0065 0073 0074 0032 } refcount(1)
 ===DONE===

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



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

2007-07-13 Thread Antony Dovgal
tony2001Fri Jul 13 08:50:53 2007 UTC

  Modified files:  
/php-src/ext/standard   basic_functions.c 
  Log:
  simplify the patch and prevent NULL retval_ptr_ptr's
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/basic_functions.c?r1=1.865&r2=1.866&diff_format=u
Index: php-src/ext/standard/basic_functions.c
diff -u php-src/ext/standard/basic_functions.c:1.865 
php-src/ext/standard/basic_functions.c:1.866
--- php-src/ext/standard/basic_functions.c:1.865Thu Jul 12 09:19:04 2007
+++ php-src/ext/standard/basic_functions.c  Fri Jul 13 08:50:53 2007
@@ -17,7 +17,7 @@
+--+
  */
 
-/* $Id: basic_functions.c,v 1.865 2007/07/12 09:19:04 tony2001 Exp $ */
+/* $Id: basic_functions.c,v 1.866 2007/07/13 08:50:53 tony2001 Exp $ */
 
 #include "php.h"
 #include "php_streams.h"
@@ -5042,10 +5042,8 @@
 
fci.retval_ptr_ptr = &retval_ptr;
 
-   if (zend_call_function(&fci, &fci_cache TSRMLS_CC) == SUCCESS) {
-   *return_value = **fci.retval_ptr_ptr;
-   zval_copy_ctor(return_value);
-   zval_ptr_dtor(fci.retval_ptr_ptr);
+   if (zend_call_function(&fci, &fci_cache TSRMLS_CC) == SUCCESS && 
fci.retval_ptr_ptr && *fci.retval_ptr_ptr) {
+   COPY_PZVAL_TO_ZVAL(*return_value, *fci.retval_ptr_ptr);
}
 
if (fci.params) {
@@ -5069,10 +5067,8 @@
zend_fcall_info_args(&fci, params TSRMLS_CC);
fci.retval_ptr_ptr = &retval_ptr;
 
-   if (zend_call_function(&fci, &fci_cache TSRMLS_CC) == SUCCESS) {
-   *return_value = **fci.retval_ptr_ptr;
-   zval_copy_ctor(return_value);
-   zval_ptr_dtor(fci.retval_ptr_ptr);
+   if (zend_call_function(&fci, &fci_cache TSRMLS_CC) == SUCCESS && 
fci.retval_ptr_ptr && *fci.retval_ptr_ptr) {
+   COPY_PZVAL_TO_ZVAL(*return_value, *fci.retval_ptr_ptr);
}
 
zend_fcall_info_args_clear(&fci, 1);

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