[PHP-CVS] cvs: php-src /tests/classes bug24445.phpt
helly Wed Jul 2 02:40:34 2003 EDT Modified files: /php-src/tests/classes bug24445.phpt Log: Fix test name Index: php-src/tests/classes/bug24445.phpt diff -u php-src/tests/classes/bug24445.phpt:1.1 php-src/tests/classes/bug24445.phpt:1.2 --- php-src/tests/classes/bug24445.phpt:1.1 Wed Jul 2 00:30:45 2003 +++ php-src/tests/classes/bug24445.phpt Wed Jul 2 02:40:34 2003 @@ -1,5 +1,5 @@ --TEST-- -Bug #24399: get_parent_class() returns the current class when passed an object +Bug #24445: get_parent_class() returns the current class when passed an object --FILE-- ?php class Test { } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /tests/classes clone_002.phpt clone_003.phpt ZendEngine2 zend_objects.c
helly Wed Jul 2 03:24:11 2003 EDT Modified files: /ZendEngine2zend_objects.c /php-src/tests/classes clone_002.phpt clone_003.phpt Log: Finally fix property cloning and fix the tests accordingly. # The default behaviour is to copy all properties with all current values # from the old object. But if __clone is overwritten then only the default # properties are cloned with their correct default values. So we keep # the type system intact and also allow real __clone overwriting now. Index: ZendEngine2/zend_objects.c diff -u ZendEngine2/zend_objects.c:1.31 ZendEngine2/zend_objects.c:1.32 --- ZendEngine2/zend_objects.c:1.31 Tue Jul 1 19:29:36 2003 +++ ZendEngine2/zend_objects.c Wed Jul 2 03:24:10 2003 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: zend_objects.c,v 1.31 2003/07/01 23:29:36 helly Exp $ */ +/* $Id: zend_objects.c,v 1.32 2003/07/02 07:24:10 helly Exp $ */ #include zend.h #include zend_globals.h @@ -108,12 +108,13 @@ zend_object *new_object; zend_object_handle handle = Z_OBJ_HANDLE_P(zobject); + /* assume that create isn't overwritten, so when clone depends on the +* overwritten one then it must itself be overwritten */ old_object = zend_objects_get_address(zobject TSRMLS_CC); retval = zend_objects_new(new_object, old_object-ce TSRMLS_CC); ALLOC_HASHTABLE(new_object-properties); zend_hash_init(new_object-properties, 0, NULL, ZVAL_PTR_DTOR, 0); - zend_hash_copy(new_object-properties, old_object-properties, (copy_ctor_func_t) zval_add_ref, (void *) NULL /* Not used anymore */, sizeof(zval *)); if (old_object-ce-clone) { zval *old_obj; @@ -121,6 +122,9 @@ zval *clone_func_name; zval *retval_ptr; HashTable symbol_table; + zend_class_entry *ce = old_object-ce; + + zend_hash_copy(new_object-properties, ce-default_properties, (copy_ctor_func_t) zval_add_ref, NULL, sizeof(zval *)); MAKE_STD_ZVAL(new_obj); new_obj-type = IS_OBJECT; @@ -148,6 +152,8 @@ zval_ptr_dtor(new_obj); zval_ptr_dtor(clone_func_name); zval_ptr_dtor(retval_ptr); + } else { + zend_hash_copy(new_object-properties, old_object-properties, (copy_ctor_func_t) zval_add_ref, (void *) NULL /* Not used anymore */, sizeof(zval *)); } return retval; Index: php-src/tests/classes/clone_002.phpt diff -u php-src/tests/classes/clone_002.phpt:1.3 php-src/tests/classes/clone_002.phpt:1.4 --- php-src/tests/classes/clone_002.phpt:1.3Tue Jul 1 19:20:48 2003 +++ php-src/tests/classes/clone_002.phptWed Jul 2 03:24:11 2003 @@ -38,7 +38,7 @@ [p1]= int(1) [p2]= - string(1) A + int(2) [p3]= string(1) C } Index: php-src/tests/classes/clone_003.phpt diff -u php-src/tests/classes/clone_003.phpt:1.1 php-src/tests/classes/clone_003.phpt:1.2 --- php-src/tests/classes/clone_003.phpt:1.1Tue Jul 1 19:57:27 2003 +++ php-src/tests/classes/clone_003.phptWed Jul 2 03:24:11 2003 @@ -5,26 +5,29 @@ --FILE-- ?php class base { - private $p1 = 1; - protected $p2 = 2; - public $p3; + protected $p1 = 'base:1'; + public $p2 = 'base:2'; + public $p3 = 'base:3'; + public $p4 = 'base:4'; + public $p5 = 'base:5'; + private $p6 = 'base:6'; public function __clone() { } }; -class test { - public $p1 = 4; - protected $p4 = 5; - public $p5; +class test extends base { + public $p1 = 'test:1'; + public $p3 = 'test:3'; + public $p4 = 'test:4'; + public $p5 = 'test:5'; public function __clone() { + $this-p5 = 'clone:5'; } } $obj = new test; -$obj-p2 = 'A'; -$obj-p3 = 'B'; +$obj-p4 = 'A'; $copy = $obj-__clone(); -$copy-p3 = 'C'; echo Object\n; print_r($obj); echo Clown\n; @@ -35,20 +38,23 @@ Object test Object ( -[p1] = 4 -[p4:protected] = 5 -[p5] = -[p2] = A -[p3] = B +[p1] = test:1 +[p3] = test:3 +[p4] = A +[p5] = test:5 +[p1:protected] = base:1 +[p2] = base:2 +[p6:private] = base:6 ) Clown test Object ( -[p1] = 4 -[p4:protected] = 5 -[p5] = -[p1:private] = 1 -[p2] = A -[p3] = C +[p1] = test:1 +[p3] = test:3 +[p4] = test:4 +[p5] = clone:5 +[p1:protected] = base:1 +[p2] = base:2 +[p6:private] = base:6 ) Done -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/gd/libgd gd.c
pajoye Wed Jul 2 07:23:56 2003 EDT Modified files: /php-src/ext/gd/libgd gd.c Log: - Fix #23808 Index: php-src/ext/gd/libgd/gd.c diff -u php-src/ext/gd/libgd/gd.c:1.55 php-src/ext/gd/libgd/gd.c:1.56 --- php-src/ext/gd/libgd/gd.c:1.55 Thu Jun 12 15:31:44 2003 +++ php-src/ext/gd/libgd/gd.c Wed Jul 2 07:23:56 2003 @@ -2075,9 +2075,12 @@ } else { dc = gdImageGetPixel(dst, tox, toy); - ncR = (int)(gdImageRed (src, c) * (pct / 100.0f) + ((100 - pct) / 100.0f)); - ncG = (int)(gdImageGreen (src, c) * (pct / 100.0f) + ((100 - pct) / 100.0f)); - ncB = (int)(gdImageBlue (src, c) * (pct / 100.0f) + ((100 - pct) / 100.0f)); +ncR = (int)gdImageRed (src, c) * (pct / 100.0) ++ gdImageRed (dst, dc) * ((100 - pct) / 100.0); +ncG = (int)gdImageGreen (src, c) * (pct / 100.0) ++ (int)gdImageGreen (dst, dc) * ((100 - pct) / 100.0); +ncB = (int)gdImageBlue (src, c) * (pct / 100.0) ++ gdImageBlue (dst, dc) * ((100 - pct) / 100.0); /* Find a reasonable color */ nc = gdImageColorResolve (dst, ncR, ncG, ncB); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_4_3) /ext/gd/libgd gd.c
pajoye Wed Jul 2 07:24:52 2003 EDT Modified files: (Branch: PHP_4_3) /php-src/ext/gd/libgd gd.c Log: - MFH Index: php-src/ext/gd/libgd/gd.c diff -u php-src/ext/gd/libgd/gd.c:1.24.2.14 php-src/ext/gd/libgd/gd.c:1.24.2.15 --- php-src/ext/gd/libgd/gd.c:1.24.2.14 Thu Jun 12 15:33:19 2003 +++ php-src/ext/gd/libgd/gd.c Wed Jul 2 07:24:52 2003 @@ -2075,9 +2075,12 @@ } else { dc = gdImageGetPixel(dst, tox, toy); - ncR = (int)(gdImageRed (src, c) * (pct / 100.0f) + ((100 - pct) / 100.0f)); - ncG = (int)(gdImageGreen (src, c) * (pct / 100.0f) + ((100 - pct) / 100.0f)); - ncB = (int)(gdImageBlue (src, c) * (pct / 100.0f) + ((100 - pct) / 100.0f)); +ncR = (int)gdImageRed (src, c) * (pct / 100.0) ++ gdImageRed (dst, dc) * ((100 - pct) / 100.0); +ncG = (int)gdImageGreen (src, c) * (pct / 100.0) ++ (int)gdImageGreen (dst, dc) * ((100 - pct) / 100.0); +ncB = (int)gdImageBlue (src, c) * (pct / 100.0) ++ gdImageBlue (dst, dc) * ((100 - pct) / 100.0); /* Find a reasonable color */ nc = gdImageColorResolve (dst, ncR, ncG, ncB); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_4_3) /ext/gd/libgd gd.c
pajoye Wed Jul 2 07:33:35 2003 EDT Modified files: (Branch: PHP_4_3) /php-src/ext/gd/libgd gd.c Log: - tabs... Index: php-src/ext/gd/libgd/gd.c diff -u php-src/ext/gd/libgd/gd.c:1.24.2.15 php-src/ext/gd/libgd/gd.c:1.24.2.16 --- php-src/ext/gd/libgd/gd.c:1.24.2.15 Wed Jul 2 07:24:52 2003 +++ php-src/ext/gd/libgd/gd.c Wed Jul 2 07:33:35 2003 @@ -2075,12 +2075,9 @@ } else { dc = gdImageGetPixel(dst, tox, toy); -ncR = (int)gdImageRed (src, c) * (pct / 100.0) -+ gdImageRed (dst, dc) * ((100 - pct) / 100.0); -ncG = (int)gdImageGreen (src, c) * (pct / 100.0) -+ (int)gdImageGreen (dst, dc) * ((100 - pct) / 100.0); -ncB = (int)gdImageBlue (src, c) * (pct / 100.0) -+ gdImageBlue (dst, dc) * ((100 - pct) / 100.0); + ncR = (int)gdImageRed (src, c) * (pct / 100.0) + gdImageRed (dst, dc) * ((100 - pct) / 100.0); + ncG = (int)gdImageGreen (src, c) * (pct / 100.0) + (int)gdImageGreen (dst, dc) * ((100 - pct) / 100.0); + ncB = (int)gdImageBlue (src, c) * (pct / 100.0) + gdImageBlue (dst, dc) * ((100 - pct) / 100.0); /* Find a reasonable color */ nc = gdImageColorResolve (dst, ncR, ncG, ncB); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/gd/libgd gd.c
pajoye Wed Jul 2 07:36:17 2003 EDT Modified files: /php-src/ext/gd/libgd gd.c Log: - tabs Index: php-src/ext/gd/libgd/gd.c diff -u php-src/ext/gd/libgd/gd.c:1.56 php-src/ext/gd/libgd/gd.c:1.57 --- php-src/ext/gd/libgd/gd.c:1.56 Wed Jul 2 07:23:56 2003 +++ php-src/ext/gd/libgd/gd.c Wed Jul 2 07:36:17 2003 @@ -2075,12 +2075,9 @@ } else { dc = gdImageGetPixel(dst, tox, toy); -ncR = (int)gdImageRed (src, c) * (pct / 100.0) -+ gdImageRed (dst, dc) * ((100 - pct) / 100.0); -ncG = (int)gdImageGreen (src, c) * (pct / 100.0) -+ (int)gdImageGreen (dst, dc) * ((100 - pct) / 100.0); -ncB = (int)gdImageBlue (src, c) * (pct / 100.0) -+ gdImageBlue (dst, dc) * ((100 - pct) / 100.0); + ncR = (int)gdImageRed (src, c) * (pct / 100.0) + gdImageRed (dst, dc) * ((100 - pct) / 100.0); + ncG = (int)gdImageGreen (src, c) * (pct / 100.0) + (int)gdImageGreen (dst, dc) * ((100 - pct) / 100.0); + ncB = (int)gdImageBlue (src, c) * (pct / 100.0) + gdImageBlue (dst, dc) * ((100 - pct) / 100.0); /* Find a reasonable color */ nc = gdImageColorResolve (dst, ncR, ncG, ncB); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php-src /ext/gd/libgd gd.c
Please add the NEWS entry for the bugfix in PHP_4_3 NEWS file. --Jani On Wed, 2 Jul 2003, Pierre-Alain Joye wrote: pajoye Wed Jul 2 07:23:56 2003 EDT Modified files: /php-src/ext/gd/libgd gd.c Log: - Fix #23808 Index: php-src/ext/gd/libgd/gd.c diff -u php-src/ext/gd/libgd/gd.c:1.55 php-src/ext/gd/libgd/gd.c:1.56 --- php-src/ext/gd/libgd/gd.c:1.55 Thu Jun 12 15:31:44 2003 +++ php-src/ext/gd/libgd/gd.c Wed Jul 2 07:23:56 2003 @@ -2075,9 +2075,12 @@ } else { dc = gdImageGetPixel(dst, tox, toy); - ncR = (int)(gdImageRed (src, c) * (pct / 100.0f) + ((100 - pct) / 100.0f)); - ncG = (int)(gdImageGreen (src, c) * (pct / 100.0f) + ((100 - pct) / 100.0f)); - ncB = (int)(gdImageBlue (src, c) * (pct / 100.0f) + ((100 - pct) / 100.0f)); +ncR = (int)gdImageRed (src, c) * (pct / 100.0) ++ gdImageRed (dst, dc) * ((100 - pct) / 100.0); +ncG = (int)gdImageGreen (src, c) * (pct / 100.0) ++ (int)gdImageGreen (dst, dc) * ((100 - pct) / 100.0); +ncB = (int)gdImageBlue (src, c) * (pct / 100.0) ++ gdImageBlue (dst, dc) * ((100 - pct) / 100.0); /* Find a reasonable color */ nc = gdImageColorResolve (dst, ncR, ncG, ncB); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_4_3) /sapi/nsapi nsapi.c
thetaphiWed Jul 2 09:37:39 2003 EDT Modified files: (Branch: PHP_4_3) /php-src/sapi/nsapi nsapi.c Log: Prevent user from making nested PHP requests with virtual() Index: php-src/sapi/nsapi/nsapi.c diff -u php-src/sapi/nsapi/nsapi.c:1.28.2.14 php-src/sapi/nsapi/nsapi.c:1.28.2.15 --- php-src/sapi/nsapi/nsapi.c:1.28.2.14Sun Jun 1 17:15:52 2003 +++ php-src/sapi/nsapi/nsapi.c Wed Jul 2 09:37:39 2003 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: nsapi.c,v 1.28.2.14 2003/06/01 21:15:52 thetaphi Exp $ */ +/* $Id: nsapi.c,v 1.28.2.15 2003/07/02 13:37:39 thetaphi Exp $ */ /* * PHP includes @@ -203,7 +203,7 @@ NULL, NULL, PHP_MINFO(nsapi), - $Id: nsapi.c,v 1.28.2.14 2003/06/01 21:15:52 thetaphi Exp $, + $Revision: 1.28.2.15 $, STANDARD_MODULE_PROPERTIES }; /* }}} */ @@ -827,6 +827,15 @@ TSRMLS_FETCH(); + /* check if this uri was included in an other PHP script with virtual() + by looking for a request context in the current thread */ + if (SG(server_context)) { + /* send 500 internal server error */ + log_error(LOG_WARN, php4_execute, sn, rq, Cannot make nesting PHP requests with virtual()); + protocol_status(sn, rq, 500, NULL); + return REQ_ABORTED; + } + request_context = (nsapi_request_context *)MALLOC(sizeof(nsapi_request_context)); request_context-pb = pb; request_context-sn = sn; @@ -874,6 +883,7 @@ nsapi_free((void*)(SG(request_info).content_type)); FREE(request_context); + SG(server_context) = NULL; return retval; } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /sapi/nsapi nsapi.c
thetaphiWed Jul 2 09:39:41 2003 EDT Modified files: /php-src/sapi/nsapi nsapi.c Log: prevent user from making nested PHP requests using virtual() Index: php-src/sapi/nsapi/nsapi.c diff -u php-src/sapi/nsapi/nsapi.c:1.47 php-src/sapi/nsapi/nsapi.c:1.48 --- php-src/sapi/nsapi/nsapi.c:1.47 Sun Jun 15 07:50:17 2003 +++ php-src/sapi/nsapi/nsapi.c Wed Jul 2 09:39:41 2003 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: nsapi.c,v 1.47 2003/06/15 11:50:17 edink Exp $ */ +/* $Id: nsapi.c,v 1.48 2003/07/02 13:39:41 thetaphi Exp $ */ /* * PHP includes @@ -198,7 +198,7 @@ NULL, NULL, PHP_MINFO(nsapi), - $Id: nsapi.c,v 1.47 2003/06/15 11:50:17 edink Exp $, + $Revision: 1.48 $, STANDARD_MODULE_PROPERTIES }; /* }}} */ @@ -822,6 +822,15 @@ TSRMLS_FETCH(); + /* check if this uri was included in an other PHP script with virtual() + by looking for a request context in the current thread */ + if (SG(server_context)) { + /* send 500 internal server error */ + log_error(LOG_WARN, php4_execute, sn, rq, Cannot make nesting PHP requests with virtual()); + protocol_status(sn, rq, 500, NULL); + return REQ_ABORTED; + } + request_context = (nsapi_request_context *)MALLOC(sizeof(nsapi_request_context)); request_context-pb = pb; request_context-sn = sn; @@ -869,6 +878,7 @@ nsapi_free((void*)(SG(request_info).content_type)); FREE(request_context); + SG(server_context) = NULL; return retval; } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_4_3) / NEWS
sniper Wed Jul 2 10:05:45 2003 EDT Modified files: (Branch: PHP_4_3) /php-srcNEWS Log: BFN Index: php-src/NEWS diff -u php-src/NEWS:1.1247.2.274 php-src/NEWS:1.1247.2.275 --- php-src/NEWS:1.1247.2.274 Mon Jun 30 09:37:43 2003 +++ php-src/NEWSWed Jul 2 10:05:44 2003 @@ -12,11 +12,11 @@ - Fixed bug #24312 (base64_decode() does not skip 0xF0-0xFF characters). (gereon.steffens[at]onvista.de, Ilia) - Fixed bug #24284 (Fixed memory leak inside pg_ping()). (Ilia) -- Fixed bug #24063 (*printf() did not handle scientific notation correctly). - (Ilia) +- Fixed bug #24063 (scientific notation broken in *printf()). (Ilia) - Fixed bug #24028 (Reading raw post message by php://input failed). (Jani) -- Fixed bug #24009 FastCGI handling of file not found. (Shane) -- Fixed bug #23664 FastCGI socket listenting. (Shane) +- Fixed bug #24009 (FastCGI handling of file not found). (Shane) +- Fixed bug #23808 (broken imagecopymerge()). (Pierre-Alain Joye) +- Fixed bug #23664 (FastCGI socket listenting). (Shane) 19 Jun 2003, Version 4.3.3RC1 - Synchronized bundled GD library with GD 2.0.15. (Ilia) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /tests/lang bug22367.phpt
zeevWed Jul 2 11:08:11 2003 EDT Modified files: /php-src/tests/lang bug22367.phpt Log: Adjust expectations :) Index: php-src/tests/lang/bug22367.phpt diff -u php-src/tests/lang/bug22367.phpt:1.1 php-src/tests/lang/bug22367.phpt:1.2 --- php-src/tests/lang/bug22367.phpt:1.1Mon Feb 24 14:37:27 2003 +++ php-src/tests/lang/bug22367.phptWed Jul 2 11:08:11 2003 @@ -48,7 +48,7 @@ $a = new bar(5); var_dump($a-idx); [EMAIL PROTECTED]c(); +$a-c(); $b = $a-b(); var_dump($b); var_dump($a-test); @@ -61,58 +61,10 @@ var_dump($a-test); ? ---EXPECT-- +--EXPECTF-- int(5) bool(false) -bool(false) -array(5) { - [0]= - int(0) - [1]= - int(1) - [2]= - int(2) - [3]= - int(3) - [4]= - int(4) -} -array(5) { - [0]= - int(0) - [1]= - int(1) - [2]= - int(2) - [3]= - int(3) - [4]= - int(4) -} -int(2) -bool(true) -bool(true) -array(5) { - [0]= - int(0) - [1]= - int(1) - [2]= - int(2) - [3]= - int(3) - [4]= - int(4) -} -array(5) { - [0]= - int(0) - [1]= - int(1) - [2]= - int(2) - [3]= - int(3) - [4]= - int(4) -} + +Notice: Undefined offset: %d in %s on line %d + +Fatal error: Only variables or references can be returned by reference in %s on line %d -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /tests/lang bug22510.phpt
moriyoshi Wed Jul 2 11:38:51 2003 EDT Modified files: /php-src/tests/lang bug22510.phpt Log: Adjust test. # This was also fixed by the Zeev's patch for bug #22367. Index: php-src/tests/lang/bug22510.phpt diff -u php-src/tests/lang/bug22510.phpt:1.1 php-src/tests/lang/bug22510.phpt:1.2 --- php-src/tests/lang/bug22510.phpt:1.1Tue Mar 4 14:52:22 2003 +++ php-src/tests/lang/bug22510.phptWed Jul 2 11:38:51 2003 @@ -13,7 +13,7 @@ function method1() { print __CLASS__.::.__FUNCTION__.\n; - return @$this-foo; + return $this-foo; } function method2() { @@ -23,7 +23,7 @@ function method3() { print __CLASS__.::.__FUNCTION__.\n; - return @$this-foo; + return $this-foo; } } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php-src /tests/lang bug22510.phpt
This is the wrong adjustment. The bug Zeev fixed also existed here (not related to objects). You should adjust the EXPECT portion to the current output. -Sterling On Wed, 2003-07-02 at 11:38, Moriyoshi Koizumi wrote: moriyoshi Wed Jul 2 11:38:51 2003 EDT Modified files: /php-src/tests/lang bug22510.phpt Log: Adjust test. # This was also fixed by the Zeev's patch for bug #22367. Index: php-src/tests/lang/bug22510.phpt diff -u php-src/tests/lang/bug22510.phpt:1.1 php-src/tests/lang/bug22510.phpt:1.2 --- php-src/tests/lang/bug22510.phpt:1.1 Tue Mar 4 14:52:22 2003 +++ php-src/tests/lang/bug22510.phpt Wed Jul 2 11:38:51 2003 @@ -13,7 +13,7 @@ function method1() { print __CLASS__.::.__FUNCTION__.\n; - return @$this-foo; + return $this-foo; } function method2() { @@ -23,7 +23,7 @@ function method3() { print __CLASS__.::.__FUNCTION__.\n; - return @$this-foo; + return $this-foo; } } -- First they ignore you, then they laugh at you, then they fight you, then you win. - Gandhi -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/standard var_unserializer.c var_unserializer.re
moriyoshi Wed Jul 2 12:19:58 2003 EDT Modified files: /php-src/ext/standard var_unserializer.re var_unserializer.c Log: Fixed a leak that occurs with R reference variable specifier. Index: php-src/ext/standard/var_unserializer.re diff -u php-src/ext/standard/var_unserializer.re:1.18 php-src/ext/standard/var_unserializer.re:1.19 --- php-src/ext/standard/var_unserializer.re:1.18 Wed Jun 25 23:24:11 2003 +++ php-src/ext/standard/var_unserializer.reWed Jul 2 12:19:57 2003 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: var_unserializer.re,v 1.18 2003/06/26 03:24:11 sterling Exp $ */ +/* $Id: var_unserializer.re,v 1.19 2003/07/02 16:19:57 moriyoshi Exp $ */ #include php.h #include ext/standard/php_var.h @@ -265,6 +265,9 @@ return 0; } + if (*rval != NULL) { + zval_ptr_dtor(rval); + } *rval = *rval_ref; (*rval)-refcount++; (*rval)-is_ref = 1; Index: php-src/ext/standard/var_unserializer.c diff -u php-src/ext/standard/var_unserializer.c:1.27 php-src/ext/standard/var_unserializer.c:1.28 --- php-src/ext/standard/var_unserializer.c:1.27Wed Jun 25 23:53:17 2003 +++ php-src/ext/standard/var_unserializer.c Wed Jul 2 12:19:57 2003 @@ -1,5 +1,5 @@ -/* Generated by re2c 0.5 on Wed Jun 25 23:00:04 2003 */ -#line 1 /home/rei/PHP_CVS/php-src/ext/standard/var_unserializer.re +/* Generated by re2c 0.5 on Thu Jul 3 01:22:57 2003 */ +#line 1 /home/koizumi/src/php-src-5/ext/standard/var_unserializer.re /* +--+ | PHP Version 4| @@ -18,7 +18,7 @@ +--+ */ -/* $Id: var_unserializer.c,v 1.27 2003/06/26 03:53:17 sterling Exp $ */ +/* $Id: var_unserializer.c,v 1.28 2003/07/02 16:19:57 moriyoshi Exp $ */ #include php.h #include ext/standard/php_var.h @@ -115,6 +115,7 @@ + static inline int parse_iv2(const char *p, const char **q) { char cursor; @@ -338,7 +339,7 @@ yych = *(YYMARKER = ++YYCURSOR); if(yych == ':') goto yy74; yy4: -#line 440 +#line 443 { return 0; } yy5: yych = *++YYCURSOR; if(yych == ';') goto yy72; @@ -373,7 +374,7 @@ goto yy4; yy13: yych = *++YYCURSOR; yy14: -#line 434 +#line 437 { /* this is the case where we have less data than planned */ php_error_docref(NULL TSRMLS_CC, E_NOTICE, Unexpected end of serialized data); @@ -397,7 +398,7 @@ if(yych != '') goto yy2; yy21: yych = *++YYCURSOR; yy22: -#line 349 +#line 352 { int len; int elements; @@ -504,7 +505,7 @@ if(yych != '') goto yy2; yy28: yych = *++YYCURSOR; yy29: -#line 341 +#line 344 { INIT_PZVAL(*rval); @@ -534,7 +535,7 @@ if(yych != '{') goto yy2; yy35: yych = *++YYCURSOR; yy36: -#line 323 +#line 326 { int elements = parse_iv(start + 2); @@ -574,7 +575,7 @@ if(yych != '') goto yy2; yy42: yych = *++YYCURSOR; yy43: -#line 303 +#line 306 { int len; char *str; @@ -651,7 +652,7 @@ } yy51: yych = *++YYCURSOR; yy52: -#line 296 +#line 299 { *p = YYCURSOR; INIT_PZVAL(*rval); @@ -724,7 +725,7 @@ if(yych != ';') goto yy2; yy64: yych = *++YYCURSOR; yy65: -#line 289 +#line 292 { *p = YYCURSOR; INIT_PZVAL(*rval); @@ -751,7 +752,7 @@ if(yych != ';') goto yy2; yy70: yych = *++YYCURSOR; yy71: -#line 282 +#line 285 { *p = YYCURSOR; INIT_PZVAL(*rval); @@ -760,7 +761,7 @@ } yy72: yych = *++YYCURSOR; yy73: -#line 275 +#line 278 { *p = YYCURSOR; INIT_PZVAL(*rval); @@ -799,6 +800,9 @@ return 0; } + if (*rval != NULL) { + zval_ptr_dtor(rval); + } *rval = *rval_ref; (*rval)-refcount++; (*rval)-is_ref = 1; @@ -806,7 +810,7 @@ return 1; } } -#line 442 +#line 445 return 0; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_4_3) /ext/standard/tests/file bug12556.phpt bug22382.phpt
moriyoshi Wed Jul 2 13:09:26 2003 EDT Modified files: (Branch: PHP_4_3) /php-src/ext/standard/tests/filebug12556.phpt bug22382.phpt Log: MFH(r-1.4, r-1.2): s/cvs/csv/ Index: php-src/ext/standard/tests/file/bug12556.phpt diff -u php-src/ext/standard/tests/file/bug12556.phpt:1.2.2.2 php-src/ext/standard/tests/file/bug12556.phpt:1.2.2.3 --- php-src/ext/standard/tests/file/bug12556.phpt:1.2.2.2 Wed Dec 18 18:08:22 2002 +++ php-src/ext/standard/tests/file/bug12556.phpt Wed Jul 2 13:09:26 2003 @@ -1,5 +1,5 @@ --TEST-- -Bug #12556: fgetcvs ignores lengths when quotes not closed +Bug #12556 (fgetcsv() ignores lengths when quotes not closed) --POST-- --GET-- --FILE-- Index: php-src/ext/standard/tests/file/bug22382.phpt diff -u php-src/ext/standard/tests/file/bug22382.phpt:1.1.2.1 php-src/ext/standard/tests/file/bug22382.phpt:1.1.2.2 --- php-src/ext/standard/tests/file/bug22382.phpt:1.1.2.1 Sun Feb 23 22:15:54 2003 +++ php-src/ext/standard/tests/file/bug22382.phpt Wed Jul 2 13:09:26 2003 @@ -1,5 +1,5 @@ --TEST-- -Bug #22382: fgetcvs does not handle escaped quotes correctly +Bug #22382 (fgetcsv() does not handle escaped quotes correctly) --POST-- --GET-- --FILE-- @@ -24,4 +24,4 @@ string(2) \\ [5]= string(28) \\\ -} \ No newline at end of file +} -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /tests/classes factory_and_singleton_001.phpt factory_and_singleton_002.phpt
moriyoshi Wed Jul 2 13:13:28 2003 EDT Modified files: /php-src/tests/classes factory_and_singleton_001.phpt factory_and_singleton_002.phpt Log: Changed line break characters from CRLF to LF. Index: php-src/tests/classes/factory_and_singleton_001.phpt diff -u php-src/tests/classes/factory_and_singleton_001.phpt:1.1 php-src/tests/classes/factory_and_singleton_001.phpt:1.2 --- php-src/tests/classes/factory_and_singleton_001.phpt:1.1Tue Jul 1 14:34:42 2003 +++ php-src/tests/classes/factory_and_singleton_001.phptWed Jul 2 13:13:27 2003 @@ -1,85 +1,85 @@ ---TEST-- -ZE2 factory and singleton, test 1 ---SKIPIF-- -?php if (version_compare(zend_version(), '2.0.0-dev', '')) die('skip ZendEngine 2 needed'); ? ---FILE-- -?php -class test { - protected $x; - - static private $test = NULL; - static private $cnt = 0; - - static function factory($x) { -if (test::$test) { - return test::$test; -} else { - test::$test = new test($x); - return test::$test; -} - } - - protected function __construct($x) { -test::$cnt++; -$this-x = $x; - } - - static function destroy() { -test::$test = NULL; - } - - protected function __destruct() { - test::$cnt--; - } - - public function get() { -return $this-x; - } - - static public function getX() { -if (test::$test) { - return test::$test-x; -} else { - return NULL; -} - } - - static public function count() { -return test::$cnt; - } -} - -echo Access static members\n; -var_dump(test::getX()); -var_dump(test::count()); - -echo Create x and y\n; -$x = test::factory(1); -$y = test::factory(2); -var_dump(test::getX()); -var_dump(test::count()); -var_dump($x-get()); -var_dump($y-get()); - -echo Destruct x\n; -$x = NULL; -var_dump(test::getX()); -var_dump(test::count()); -var_dump($y-get()); - -echo Destruct y\n; -$y = NULL; -var_dump(test::getX()); -var_dump(test::count()); - -echo Destruct static\n; -test::destroy(); -var_dump(test::getX()); -var_dump(test::count()); - -echo Done\n; -? ---EXPECT-- +--TEST-- +ZE2 factory and singleton, test 1 +--SKIPIF-- +?php if (version_compare(zend_version(), '2.0.0-dev', '')) die('skip ZendEngine 2 needed'); ? +--FILE-- +?php +class test { + protected $x; + + static private $test = NULL; + static private $cnt = 0; + + static function factory($x) { +if (test::$test) { + return test::$test; +} else { + test::$test = new test($x); + return test::$test; +} + } + + protected function __construct($x) { +test::$cnt++; +$this-x = $x; + } + + static function destroy() { +test::$test = NULL; + } + + protected function __destruct() { + test::$cnt--; + } + + public function get() { +return $this-x; + } + + static public function getX() { +if (test::$test) { + return test::$test-x; +} else { + return NULL; +} + } + + static public function count() { +return test::$cnt; + } +} + +echo Access static members\n; +var_dump(test::getX()); +var_dump(test::count()); + +echo Create x and y\n; +$x = test::factory(1); +$y = test::factory(2); +var_dump(test::getX()); +var_dump(test::count()); +var_dump($x-get()); +var_dump($y-get()); + +echo Destruct x\n; +$x = NULL; +var_dump(test::getX()); +var_dump(test::count()); +var_dump($y-get()); + +echo Destruct y\n; +$y = NULL; +var_dump(test::getX()); +var_dump(test::count()); + +echo Destruct static\n; +test::destroy(); +var_dump(test::getX()); +var_dump(test::count()); + +echo Done\n; +? +--EXPECT-- Access static members NULL int(0) @@ -98,4 +98,4 @@ Destruct static NULL int(0) -Done +Done Index: php-src/tests/classes/factory_and_singleton_002.phpt diff -u php-src/tests/classes/factory_and_singleton_002.phpt:1.1 php-src/tests/classes/factory_and_singleton_002.phpt:1.2 --- php-src/tests/classes/factory_and_singleton_002.phpt:1.1Tue Jul 1 14:34:42 2003 +++ php-src/tests/classes/factory_and_singleton_002.phptWed Jul 2 13:13:27 2003 @@ -1,85 +1,85 @@ ---TEST-- -ZE2 factory and singleton, test 2 ---SKIPIF-- -?php if (version_compare(zend_version(), '2.0.0-dev', '')) die('skip ZendEngine 2 needed'); ? ---FILE-- -?php -class test { - protected $x; - - static private $test = NULL; - static private $cnt = 0; - - static function factory($x) { -if (test::$test) { - return test::$test; -} else { - test::$test = new test($x); - return test::$test; -} - } - - protected function __construct($x) { -test::$cnt++; -$this-x = $x; - } - - static function destroy() { -test::$test = NULL; - } - - protected function __destruct() { - test::$cnt--; - } - - public function get() { -return $this-x; - } - - static public function getX() { -if (test::$test) { - return test::$test-x; -} else { - return NULL; -} - } - - static public function count() { -return
[PHP-CVS] cvs: php-src /tests/lang bug24403.phpt
derick Wed Jul 2 14:00:51 2003 EDT Modified files: /php-src/tests/lang bug24403.phpt Log: - use ?php in testcases Index: php-src/tests/lang/bug24403.phpt diff -u php-src/tests/lang/bug24403.phpt:1.1 php-src/tests/lang/bug24403.phpt:1.2 --- php-src/tests/lang/bug24403.phpt:1.1Wed Jul 2 13:51:15 2003 +++ php-src/tests/lang/bug24403.phptWed Jul 2 14:00:51 2003 @@ -1,7 +1,7 @@ --TEST-- Bug #24403 (scope doesn't properly propagate into internal functions) --FILE-- -? +?php class a { var $a = array(); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /tests/lang bug23922.phpt
zeevWed Jul 2 14:05:45 2003 EDT Added files: /php-src/tests/lang bug23922.phpt Log: Another test case Index: php-src/tests/lang/bug23922.phpt +++ php-src/tests/lang/bug23922.phpt --TEST-- Bug #23922 (scope doesn't properly propagate into internal functions) --FILE-- ?php class foo { var $foo = 1; function as_string() { assert('$this-foo == 1'); } function as_expr() { assert($this-foo == 1); } } $foo = new foo(); $foo-as_expr(); $foo-as_string(); ? --EXPECT-- -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/xml xml.c
sterlingWed Jul 2 16:05:13 2003 EDT Modified files: /php-src/ext/xmlxml.c Log: Not really the best way to solve this. But it doesn't give a segfault on self-referential structures, which is always a bonus Index: php-src/ext/xml/xml.c diff -u php-src/ext/xml/xml.c:1.133 php-src/ext/xml/xml.c:1.134 --- php-src/ext/xml/xml.c:1.133 Sat Jun 14 14:14:05 2003 +++ php-src/ext/xml/xml.c Wed Jul 2 16:05:13 2003 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: xml.c,v 1.133 2003/06/14 18:14:05 rrichards Exp $ */ +/* $Id: xml.c,v 1.134 2003/07/02 20:05:13 sterling Exp $ */ #define IS_EXT_MODULE @@ -374,17 +374,17 @@ /* {{{ xml_set_handler() */ static void xml_set_handler(zval **handler, zval **data) { - /* IS_ARRAY might indicate that we're using array($obj, 'method') syntax */ - if (Z_TYPE_PP(data) != IS_ARRAY) { - convert_to_string_ex(data); - } - /* If we have already a handler, release it */ if (*handler) { zval_ptr_dtor(handler); } - zval_add_ref(data); + /* IS_ARRAY might indicate that we're using array($obj, 'method') syntax */ + if (Z_TYPE_PP(data) != IS_ARRAY) { + convert_to_string_ex(data); + zval_add_ref(data); + } + *handler = *data; } /* }}} */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main/streams transports.c
wez Wed Jul 2 17:11:35 2003 EDT Modified files: /php-src/main/streams transports.c Log: more size_t - socklen_t. Noticed by [EMAIL PROTECTED] Index: php-src/main/streams/transports.c diff -u php-src/main/streams/transports.c:1.5 php-src/main/streams/transports.c:1.6 --- php-src/main/streams/transports.c:1.5 Sat Jun 28 07:06:11 2003 +++ php-src/main/streams/transports.c Wed Jul 2 17:11:35 2003 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: transports.c,v 1.5 2003/06/28 11:06:11 wez Exp $ */ +/* $Id: transports.c,v 1.6 2003/07/02 21:11:35 wez Exp $ */ #include php.h #include php_streams_int.h @@ -255,7 +255,7 @@ /* Get the next client and their address (as a string) */ PHPAPI int php_stream_xport_accept(php_stream *stream, php_stream **client, char **textaddr, int *textaddrlen, - void **addr, size_t *addrlen, + void **addr, socklen_t *addrlen, struct timeval *timeout, char **error_text TSRMLS_DC) @@ -294,7 +294,7 @@ PHPAPI int php_stream_xport_get_name(php_stream *stream, int want_peer, char **textaddr, int *textaddrlen, - void **addr, size_t *addrlen + void **addr, socklen_t *addrlen TSRMLS_DC) { php_stream_xport_param param; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/ming ming.c
helly Wed Jul 2 17:37:45 2003 EDT Modified files: /php-src/ext/ming ming.c Log: ZTS fix Index: php-src/ext/ming/ming.c diff -u php-src/ext/ming/ming.c:1.48 php-src/ext/ming/ming.c:1.49 --- php-src/ext/ming/ming.c:1.48Tue Jul 1 22:03:59 2003 +++ php-src/ext/ming/ming.c Wed Jul 2 17:37:45 2003 @@ -15,7 +15,7 @@ | Author: [EMAIL PROTECTED] | +--+ - $Id: ming.c,v 1.48 2003/07/02 02:03:59 iliaa Exp $ + $Id: ming.c,v 1.49 2003/07/02 21:37:45 helly Exp $ */ @@ -2386,7 +2386,7 @@ if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, s) == FAILURE) { WRONG_PARAM_COUNT; } - if (!getFont(getText(getThis() TSRMLS_CC))) { + if (!getFont(getText(getThis() TSRMLS_CC) TSRMLS_CC)) { php_error_docref(NULL TSRMLS_CC, E_WARNING, You must specify a font before writing text.); RETURN_FALSE; } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/sqlite sess_sqlite.c
helly Wed Jul 2 17:40:55 2003 EDT Modified files: /php-src/ext/sqlite sess_sqlite.c Log: funny fixes Index: php-src/ext/sqlite/sess_sqlite.c diff -u php-src/ext/sqlite/sess_sqlite.c:1.9 php-src/ext/sqlite/sess_sqlite.c:1.10 --- php-src/ext/sqlite/sess_sqlite.c:1.9Tue Jul 1 23:12:06 2003 +++ php-src/ext/sqlite/sess_sqlite.cWed Jul 2 17:40:54 2003 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: sess_sqlite.c,v 1.9 2003/07/02 03:12:06 sterling Exp $ */ +/* $Id: sess_sqlite.c,v 1.10 2003/07/02 21:40:54 helly Exp $ */ #include php.h @@ -151,7 +151,7 @@ } efree(binary); - SQLITE_RETVAL(rv); + return SQLITE_RETVAL(rv); } PS_DESTROY_FUNC(sqlite) @@ -161,7 +161,7 @@ rv = sqlite_exec_printf(db, DELETE FROM session_data WHERE sess_id='%q', NULL, NULL, NULL, key); - SQLITE_RETVAL(rv);return rv == SQLITE_OK ? SUCCESS : FAILURE; + return SQLITE_RETVAL(rv); } PS_GC_FUNC(sqlite) @@ -174,7 +174,7 @@ DELETE FROM session_data WHERE (%d - updated) %d, NULL, NULL, NULL, t, maxlifetime); - SQLITE_RETVAL(rv); + return SQLITE_RETVAL(rv); } #endif /* HAVE_PHP_SESSION */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main/streams php_stream_context.h streams.c
pollita Wed Jul 2 18:18:59 2003 EDT Modified files: /php-src/main/streams php_stream_context.h streams.c Log: Introduce connection pooling API. I'll use these in http/ftp fopen wrappers soon. Index: php-src/main/streams/php_stream_context.h diff -u php-src/main/streams/php_stream_context.h:1.6 php-src/main/streams/php_stream_context.h:1.7 --- php-src/main/streams/php_stream_context.h:1.6 Fri Jun 27 12:23:58 2003 +++ php-src/main/streams/php_stream_context.h Wed Jul 2 18:18:59 2003 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_stream_context.h,v 1.6 2003/06/27 16:23:58 pollita Exp $ */ +/* $Id: php_stream_context.h,v 1.7 2003/07/02 22:18:59 pollita Exp $ */ /* Stream context and status notification related definitions */ @@ -53,6 +53,7 @@ struct _php_stream_context { php_stream_notifier *notifier; zval *options; /* hash keyed by wrapper family or specific wrapper */ + zval *links;/* hash keyed by hostent for connection pooling */ int rsrc_id;/* used for auto-cleanup */ }; @@ -62,6 +63,13 @@ const char *wrappername, const char *optionname, zval ***optionvalue); PHPAPI int php_stream_context_set_option(php_stream_context *context, const char *wrappername, const char *optionname, zval *optionvalue); + +PHPAPI int php_stream_context_get_link(php_stream_context *context, + const char *hostent, php_stream **stream); +PHPAPI int php_stream_context_set_link(php_stream_context *context, + const char *hostent, php_stream *stream); +PHPAPI int php_stream_context_del_link(php_stream_context *context, + php_stream *stream); PHPAPI php_stream_notifier *php_stream_notification_alloc(void); PHPAPI void php_stream_notification_free(php_stream_notifier *notifier); Index: php-src/main/streams/streams.c diff -u php-src/main/streams/streams.c:1.29 php-src/main/streams/streams.c:1.30 --- php-src/main/streams/streams.c:1.29 Fri Jun 27 12:23:58 2003 +++ php-src/main/streams/streams.c Wed Jul 2 18:18:59 2003 @@ -19,7 +19,7 @@ +--+ */ -/* $Id: streams.c,v 1.29 2003/06/27 16:23:58 pollita Exp $ */ +/* $Id: streams.c,v 1.30 2003/07/02 22:18:59 pollita Exp $ */ #define _GNU_SOURCE #include php.h @@ -306,6 +306,11 @@ zend_list_delete(stream-rsrc_id); } + /* Remove stream from any context link list */ + if (stream-context stream-context-links) { + php_stream_context_del_link(stream-context, stream); + } + if (close_options PHP_STREAM_FREE_CALL_DTOR) { if (release_cast stream-fclose_stdiocast == PHP_STREAM_FCLOSE_FOPENCOOKIE) { /* calling fclose on an fopencookied stream will ultimately @@ -1626,6 +1631,10 @@ php_stream_notification_free(context-notifier); context-notifier = NULL; } + if (context-links) { + zval_ptr_dtor(context-links); + context-links = NULL; + } efree(context); } @@ -1687,6 +1696,66 @@ wrapperhash = category; } return zend_hash_update(Z_ARRVAL_PP(wrapperhash), (char*)optionname, strlen(optionname)+1, (void**)copied_val, sizeof(zval *), NULL); +} + +PHPAPI int php_stream_context_get_link(php_stream_context *context, +const char *hostent, php_stream **stream) +{ + php_stream **pstream; + + if (!stream || !hostent || !context || !(context-links)) { + return FAILURE; + } + if (SUCCESS == zend_hash_find(Z_ARRVAL_P(context-links), (char*)hostent, strlen(hostent)+1, (void**)pstream)) { + *stream = *pstream; + return SUCCESS; + } + return FAILURE; +} + +PHPAPI int php_stream_context_set_link(php_stream_context *context, +const char *hostent, php_stream *stream) +{ + if (!context) { + return FAILURE; + } + if (!context-links) { + ALLOC_INIT_ZVAL(context-links); + array_init(context-links); + } + if (!stream) { + /* Delete any entry for hostent */ + return zend_hash_del(Z_ARRVAL_P(context-links), (char*)hostent, strlen(hostent)+1); + } + return zend_hash_update(Z_ARRVAL_P(context-links), (char*)hostent, strlen(hostent)+1, (void**)stream, sizeof(php_stream *), NULL); +} + +PHPAPI int php_stream_context_del_link(php_stream_context *context, +php_stream *stream) +{ + php_stream **pstream; + char *hostent; + int ret = SUCCESS; + + if (!context || !context-links || !stream) { + return FAILURE; + } + + for(zend_hash_internal_pointer_reset(Z_ARRVAL_P(context-links)); + SUCCESS ==
Re: [PHP-CVS] cvs: php-src /main/streams transports.c
On Wed, 2 Jul 2003, Wez Furlong wrote: wez Wed Jul 2 17:11:35 2003 EDT Modified files: /php-src/main/streams transports.c Log: more size_t - socklen_t. Noticed by [EMAIL PROTECTED] Any reason for not using struct sockaddr in favor of void? That would align the interfaces with common socket APIs. - Sascha -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /sapi/nsapi nsapi-readme.txt nsapi.c
thetaphiWed Jul 2 18:39:37 2003 EDT Modified files: /php-src/sapi/nsapi nsapi-readme.txt nsapi.c Log: rename functions to php5_* Index: php-src/sapi/nsapi/nsapi-readme.txt diff -u php-src/sapi/nsapi/nsapi-readme.txt:1.6 php-src/sapi/nsapi/nsapi-readme.txt:1.7 --- php-src/sapi/nsapi/nsapi-readme.txt:1.6 Sun Jun 1 17:14:58 2003 +++ php-src/sapi/nsapi/nsapi-readme.txt Wed Jul 2 18:39:37 2003 @@ -1,5 +1,5 @@ -Configuration of your Netscape/SunONE/iPlanet Web Server for PHP4 -- +Configuration of your Netscape/SunONE/iPlanet Web Server for PHP5 +- These instructions are targetted at Netscape Enterprise Web Server and SUN/Netscape Alliance iPlanet Web Server/SunONE Webserver. @@ -28,13 +28,13 @@ for iPlanet/SunONE Web Server 6.0 and above however at the end of the path-to-server/https-servername/config/magnus.conf file: -Init fn=load-modules funcs=php4_init,php4_execute,php4_auth_trans shlib=/path/to/phplibrary -Init fn=php4_init errorString=Failed to initialize PHP! [php_ini=/path/to/php.ini] +Init fn=load-modules funcs=php5_init,php5_execute,php5_auth_trans shlib=/path/to/phplibrary +Init fn=php5_init errorString=Failed to initialize PHP! [php_ini=/path/to/php.ini] The shlib will vary depending on your OS: - Unix: path-to-server/bin/libphp4.so. - Windows: c:/path/to/PHP4/nsapiPHP4.dll + Unix: path-to-server/bin/libphp5.so. + Windows: c:/path/to/php5/php5nsapi.dll In obj.conf (for virtual server classes [SunONE 6.0] in their vserver.obj.conf): @@ -50,7 +50,7 @@ # For boolean ini-keys please use 0/1 as value, NOT On,Off,... (this will not work # correctly), e.g. zlib.output_compression=1 instead of zlib.output_compression=On -Service fn=php4_execute type=magnus-internal/x-httpd-php [inikey=value ...] +Service fn=php5_execute type=magnus-internal/x-httpd-php [inikey=value ...] . . . @@ -61,7 +61,7 @@ Object name=x-httpd-php ObjectType fn=force-type type=magnus-internal/x-httpd-php -Service fn=php4_execute [inikey=value ...] +Service fn=php5_execute [inikey=value ...] /Object After that you can configure a directory in the Administration server and assign it @@ -77,7 +77,7 @@ Authentication for the entire server, add the following line: Object name=default -AuthTrans fn=php4_auth_trans +AuthTrans fn=php5_auth_trans . . . @@ -88,6 +88,6 @@ To use PHP Authentication on a single directory, add the following: Object ppath=d:\path\to\authenticated\dir\* -AuthTrans fn=php4_auth_trans +AuthTrans fn=php5_auth_trans /Object Index: php-src/sapi/nsapi/nsapi.c diff -u php-src/sapi/nsapi/nsapi.c:1.48 php-src/sapi/nsapi/nsapi.c:1.49 --- php-src/sapi/nsapi/nsapi.c:1.48 Wed Jul 2 09:39:41 2003 +++ php-src/sapi/nsapi/nsapi.c Wed Jul 2 18:39:37 2003 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: nsapi.c,v 1.48 2003/07/02 13:39:41 thetaphi Exp $ */ +/* $Id: nsapi.c,v 1.49 2003/07/02 22:39:37 thetaphi Exp $ */ /* * PHP includes @@ -198,7 +198,7 @@ NULL, NULL, PHP_MINFO(nsapi), - $Revision: 1.48 $, + $Revision: 1.49 $, STANDARD_MODULE_PROPERTIES }; /* }}} */ @@ -750,7 +750,7 @@ if (zend_alter_ini_entry(entry-param-name, strlen(entry-param-name)+1, entry-param-value, strlen(entry-param-value), PHP_INI_USER, PHP_INI_STAGE_RUNTIME)==FAILURE) { - log_error(LOG_WARN, php4_execute, NSG(sn), NSG(rq), Cannot change php.ini key \%s\ to \%s\, entry-param-name, entry-param-value); + log_error(LOG_WARN, php5_execute, NSG(sn), NSG(rq), Cannot change php.ini key \%s\ to \%s\, entry-param-name, entry-param-value); } } entry=entry-next; @@ -758,7 +758,7 @@ } } -void NSAPI_PUBLIC php4_close(void *vparam) +void NSAPI_PUBLIC php5_close(void *vparam) { if (nsapi_sapi_module.shutdown) { nsapi_sapi_module.shutdown(nsapi_sapi_module); @@ -770,10 +770,10 @@ tsrm_shutdown(); - log_error(LOG_INFORM, php4_close, NULL, NULL, Shutdown PHP Module); + log_error(LOG_INFORM, php5_close, NULL, NULL, Shutdown PHP Module); } -int NSAPI_PUBLIC php4_init(pblock *pb, Session *sn, Request *rq) +int NSAPI_PUBLIC php5_init(pblock *pb, Session *sn, Request *rq) { php_core_globals *core_globals; char *ini_path; @@ -790,7 +790,7 @@ core_globals = ts_resource(core_globals_id); - /* look if php_ini parameter is given to php4_init */ + /* look if php_ini
[PHP-CVS] cvs: php-src /main rfc1867.c
iliaa Wed Jul 2 20:55:20 2003 EDT Modified files: /php-src/main rfc1867.c Log: Compiler warning fix. Index: php-src/main/rfc1867.c diff -u php-src/main/rfc1867.c:1.138 php-src/main/rfc1867.c:1.139 --- php-src/main/rfc1867.c:1.138Sat Jun 28 19:37:18 2003 +++ php-src/main/rfc1867.c Wed Jul 2 20:55:20 2003 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: rfc1867.c,v 1.138 2003/06/28 23:37:18 hirokawa Exp $ */ +/* $Id: rfc1867.c,v 1.139 2003/07/03 00:55:20 iliaa Exp $ */ /* * This product includes software developed by the Apache Group @@ -696,8 +696,10 @@ { char *boundary, *s=NULL, *boundary_end = NULL, *start_arr=NULL, *array_index=NULL; char *temp_filename=NULL, *lbuf=NULL, *abuf=NULL; - int boundary_len=0, total_bytes=0, cancel_upload=0, is_arr_upload=0, array_len=0, max_file_size=0, skip_upload=0, str_len=0, anonindex=0, is_anonymous; - zval *http_post_files=NULL; + int boundary_len=0, total_bytes=0, cancel_upload=0, is_arr_upload=0, array_len=0, max_file_size=0, skip_upload=0, anonindex=0, is_anonymous;zval *http_post_files=NULL; +#if HAVE_MBSTRING !defined(COMPILE_DL_MBSTRING) + int str_len=0 +#endif zend_bool magic_quotes_gpc; multipart_buffer *mbuff; zval *array_ptr = (zval *) arg; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main rfc1867.c
sniper Wed Jul 2 22:59:05 2003 EDT Modified files: /php-src/main rfc1867.c Log: Cut the long line a bit for readability.. Index: php-src/main/rfc1867.c diff -u php-src/main/rfc1867.c:1.139 php-src/main/rfc1867.c:1.140 --- php-src/main/rfc1867.c:1.139Wed Jul 2 20:55:20 2003 +++ php-src/main/rfc1867.c Wed Jul 2 22:59:04 2003 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: rfc1867.c,v 1.139 2003/07/03 00:55:20 iliaa Exp $ */ +/* $Id: rfc1867.c,v 1.140 2003/07/03 02:59:04 sniper Exp $ */ /* * This product includes software developed by the Apache Group @@ -696,7 +696,9 @@ { char *boundary, *s=NULL, *boundary_end = NULL, *start_arr=NULL, *array_index=NULL; char *temp_filename=NULL, *lbuf=NULL, *abuf=NULL; - int boundary_len=0, total_bytes=0, cancel_upload=0, is_arr_upload=0, array_len=0, max_file_size=0, skip_upload=0, anonindex=0, is_anonymous;zval *http_post_files=NULL; + int boundary_len=0, total_bytes=0, cancel_upload=0, is_arr_upload=0, array_len=0; + int max_file_size=0, skip_upload=0, anonindex=0, is_anonymous; + zval *http_post_files=NULL; #if HAVE_MBSTRING !defined(COMPILE_DL_MBSTRING) int str_len=0 #endif -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src / INSTALL README.TESTING README.UNIX-BUILD-SYSTEM
jon Thu Jul 3 00:14:42 2003 EDT Modified files: /php-srcINSTALL README.TESTING README.UNIX-BUILD-SYSTEM Log: Update documentation for PHP 5. Index: php-src/INSTALL diff -u php-src/INSTALL:1.32 php-src/INSTALL:1.33 --- php-src/INSTALL:1.32Sat Feb 1 06:18:53 2003 +++ php-src/INSTALL Thu Jul 3 00:14:42 2003 @@ -1,4 +1,4 @@ -Installation Instructions for PHP 4 +Installation Instructions for PHP 5 --- STOP! @@ -108,8 +108,8 @@ $ make install $ cd ../apache_1.3.x -$ ./configure --prefix=/www --activate-module=src/modules/php4/libphp4.a - (The above line is correct! Yes, we know libphp4.a does not exist at this +$ ./configure --prefix=/www --activate-module=src/modules/php5/libphp5.a + (The above line is correct! Yes, we know libphp5.a does not exist at this stage. It isn't supposed to. It will be created.) $ make (you should now have an httpd binary which you can copy to your Apache bin dir if @@ -226,7 +226,7 @@ 3b. Static Module Installation For the Apache module version this will copy the appropriate files - to the src/modules/php4 directory in your Apache distribution if + to the src/modules/php5 directory in your Apache distribution if you are using Apache 1.3.x. If you are still running Apache 1.2.x these files will be copied directly to the main src directory. @@ -235,7 +235,7 @@ cd apache_1.3.x ./configure --prefix=/path/apache \ - --activate-module=src/modules/php4/libphp4.a + --activate-module=src/modules/php5/libphp5.a make make install @@ -248,29 +248,29 @@ For Apache 1.3.x add: - AddModule modules/php4/libphp4.a + AddModule modules/php5/libphp5.a For Apache 1.3.x don't do anything else. Just add this line and then run ./Configure followed by make. For Apache 1.2.x add: - Module php4_module mod_php4.o + Module php5_module mod_php5.o - For Apache 1.2.x you will also have to look in the libphp4.module file, + For Apache 1.2.x you will also have to look in the libphp5.module file, which was copied to the src directory. The EXTRA_LIBS line in the Apache Configuration file needs to be set to use the same libs as specified on - the LIBS line in libphp4.module. You also need to make sure to add + the LIBS line in libphp5.module. You also need to make sure to add -L. to the beginning of the EXTRA_LIBS line. So, as an example, your EXTRA_LIBS line might look like: - EXTRA_LIBS=-L. -lphp4 -lgdbm -ldb -L/usr/local/mysql/lib -lmysqlclient + EXTRA_LIBS=-L. -lphp5 -lgdbm -ldb -L/usr/local/mysql/lib -lmysqlclient NOTE: You should not enclose the EXTRA_LIBS line in double-quotes, as it - is in the libphp4.module file. + is in the libphp5.module file. - Also, look at the RULE_WANTHSREGEX setting in the libphp4.module file + Also, look at the RULE_WANTHSREGEX setting in the libphp5.module file and set the WANTHSREGEX directive accordingly in your Configuration file. This last step applies to versions of Apache prior to 1.3b3. @@ -291,17 +291,17 @@ enable the dynamic PHP module. To verify this, look for a line that looks like this: - LoadModule php4_module libexec/libphp4.so + LoadModule php5_module libexec/libphp5.so - The actual path before the libphp4.so part might differ slightly. This + The actual path before the libphp5.so part might differ slightly. This is likely fine. If you are paranoid you can examine the output from the - make install step to see where the libphp4.so file was actually put and + make install step to see where the libphp5.so file was actually put and place the full path to this file on this LoadModule line. If somewhere in your httpd.conf file you have a ClearModuleList line then you also need this line: - AddModule mod_php4.c + AddModule mod_php5.c And finally you need to tell Apache which file extension should trigger PHP. You do this by creating a special mime type and associating it Index: php-src/README.TESTING diff -u php-src/README.TESTING:1.21 php-src/README.TESTING:1.22 --- php-src/README.TESTING:1.21 Wed Mar 19 13:04:17 2003 +++ php-src/README.TESTING Thu Jul 3 00:14:42 2003 @@ -108,7 +108,7 @@ == qa-test.sh = #!/bin/sh -CO_DIR=$HOME/cvs/php4 +CO_DIR=$HOME/cvs/php5 [EMAIL PROTECTED] TMPDIR=/var/tmp TODAY=`date +%Y%m%d` Index: php-src/README.UNIX-BUILD-SYSTEM diff -u php-src/README.UNIX-BUILD-SYSTEM:1.3 php-src/README.UNIX-BUILD-SYSTEM:1.4 --- php-src/README.UNIX-BUILD-SYSTEM:1.3Wed Oct 23 17:46:40 2002 +++ php-src/README.UNIX-BUILD-SYSTEMThu Jul 3 00:14:42 2003 @@ -108,7 +108,7 @@ For example for APXS: -PHP_SELECT_SAPI(apache, shared, sapi_apache.c mod_php4.c php_apache.c) +PHP_SELECT_SAPI(apache, shared, sapi_apache.c mod_php5.c