|
cvs: pecl /http http_request_object.c php_http_std_defs.h /http/tests date: msg#00257php.pecl.cvs
helly Fri Jul 29 14:12:13 2005 EDT Modified files: /pecl/http http_request_object.c php_http_std_defs.h /pecl/http/tests date_002.phpt get_request_data_001.phpt Log: - Fix property handling - Fix tests http://cvs.php.net/diff.php/pecl/http/http_request_object.c?r1=1.31&r2=1.32&ty=u Index: pecl/http/http_request_object.c diff -u pecl/http/http_request_object.c:1.31 pecl/http/http_request_object.c:1.32 --- pecl/http/http_request_object.c:1.31 Fri Jul 29 04:57:34 2005 +++ pecl/http/http_request_object.c Fri Jul 29 14:12:07 2005 @@ -13,7 +13,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: http_request_object.c,v 1.31 2005/07/29 08:57:34 mike Exp $ */ +/* $Id: http_request_object.c,v 1.32 2005/07/29 18:12:07 helly Exp $ */ #ifdef HAVE_CONFIG_H @@ -278,7 +278,7 @@ HTTP_REQUEST_ALIAS(methodUnregister, http_request_method_unregister) HTTP_REQUEST_ALIAS(methodName, http_request_method_name) HTTP_REQUEST_ALIAS(methodExists, http_request_method_exists) - + {NULL, NULL, NULL} }; static zend_object_handlers http_request_object_handlers; @@ -287,6 +287,8 @@ { HTTP_REGISTER_CLASS_EX(HttpRequest, http_request_object, NULL, 0); + _http_request_object_declare_default_properties(TSRMLS_C); + /* HTTP/1.1 */ HTTP_LONG_CONSTANT("HTTP_GET", HTTP_GET); HTTP_LONG_CONSTANT("HTTP_HEAD", HTTP_HEAD); http://cvs.php.net/diff.php/pecl/http/php_http_std_defs.h?r1=1.31&r2=1.32&ty=u Index: pecl/http/php_http_std_defs.h diff -u pecl/http/php_http_std_defs.h:1.31 pecl/http/php_http_std_defs.h:1.32 --- pecl/http/php_http_std_defs.h:1.31 Fri Jul 29 04:57:36 2005 +++ pecl/http/php_http_std_defs.h Fri Jul 29 14:12:09 2005 @@ -13,7 +13,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_http_std_defs.h,v 1.31 2005/07/29 08:57:36 mike Exp $ */ +/* $Id: php_http_std_defs.h,v 1.32 2005/07/29 18:12:09 helly Exp $ */ #ifndef PHP_HTTP_STD_DEFS_H #define PHP_HTTP_STD_DEFS_H @@ -289,15 +289,15 @@ zval_dtor(__tmp); \ efree(__tmp); \ } -# define DCL_PROP(a, t, n, v) zend_declare_property_ ##t(ce, (#n), sizeof(#n), (v), (ZEND_ACC_ ##a) TSRMLS_CC) -# define DCL_PROP_Z(a, n, v) zend_declare_property(ce, (#n), sizeof(#n), (v), (ZEND_ACC_ ##a) TSRMLS_CC) -# define DCL_PROP_N(a, n) zend_declare_property_null(ce, (#n), sizeof(#n), (ZEND_ACC_ ##a) TSRMLS_CC) +# define DCL_PROP(a, t, n, v) zend_declare_property_ ##t(ce, (#n), sizeof(#n)-1, (v), (ZEND_ACC_ ##a) TSRMLS_CC) +# define DCL_PROP_Z(a, n, v) zend_declare_property(ce, (#n), sizeof(#n)-1, (v), (ZEND_ACC_ ##a) TSRMLS_CC) +# define DCL_PROP_N(a, n) zend_declare_property_null(ce, (#n), sizeof(#n)-1, (ZEND_ACC_ ##a) TSRMLS_CC) # define UPD_PROP(o, t, n, v) UPD_PROP_EX(o, getThis(), t, n, v) -# define UPD_PROP_EX(o, this, t, n, v) zend_update_property_ ##t(o->zo.ce, this, (#n), sizeof(#n), (v) TSRMLS_CC) +# define UPD_PROP_EX(o, this, t, n, v) zend_update_property_ ##t(o->zo.ce, this, (#n), sizeof(#n)-1, (v) TSRMLS_CC) # define SET_PROP(o, n, z) SET_PROP_EX(o, getThis(), n, z) -# define SET_PROP_EX(o, this, n, z) zend_update_property(o->zo.ce, this, (#n), sizeof(#n), (z) TSRMLS_CC) +# define SET_PROP_EX(o, this, n, z) zend_update_property(o->zo.ce, this, (#n), sizeof(#n)-1, (z) TSRMLS_CC) # define GET_PROP(o, n) GET_PROP_EX(o, getThis(), n) -# define GET_PROP_EX(o, this, n) zend_read_property(o->zo.ce, this, (#n), sizeof(#n), 0 TSRMLS_CC) +# define GET_PROP_EX(o, this, n) zend_read_property(o->zo.ce, this, (#n), sizeof(#n)-1, 0 TSRMLS_CC) # define ACC_PROP_PRIVATE(ce, flags) ((flags & ZEND_ACC_PRIVATE) && (EG(scope) && ce == EG(scope)) # define ACC_PROP_PROTECTED(ce, flags) ((flags & ZEND_ACC_PROTECTED) && (zend_check_protected(ce, EG(scope)))) @@ -314,8 +314,8 @@ # define FREE_PARR(o, p) \ { \ - zval *__tmp = NULL; \ - if (__tmp = GET_PROP(o, p)) { \ + zval *__tmp = GET_PROP(o, p); \ + if (__tmp) { \ zval_dtor(__tmp); \ FREE_ZVAL(__tmp); \ __tmp = NULL; \ http://cvs.php.net/diff.php/pecl/http/tests/date_002.phpt?r1=1.4&r2=1.5&ty=u Index: pecl/http/tests/date_002.phpt diff -u pecl/http/tests/date_002.phpt:1.4 pecl/http/tests/date_002.phpt:1.5 --- pecl/http/tests/date_002.phpt:1.4 Sun Jul 24 04:51:41 2005 +++ pecl/http/tests/date_002.phpt Fri Jul 29 14:12:12 2005 @@ -4,6 +4,8 @@ <?php include 'skip.inc'; ?> +--INI-- +date.timezone=GMT --FILE-- <?php echo "-TEST\n"; http://cvs.php.net/diff.php/pecl/http/tests/get_request_data_001.phpt?r1=1.1&r2=1.2&ty=u Index: pecl/http/tests/get_request_data_001.phpt diff -u pecl/http/tests/get_request_data_001.phpt:1.1 pecl/http/tests/get_request_data_001.phpt:1.2 --- pecl/http/tests/get_request_data_001.phpt:1.1 Sun Jul 24 14:23:37 2005 +++ pecl/http/tests/get_request_data_001.phpt Fri Jul 29 14:12:12 2005 @@ -12,9 +12,15 @@ --FILE-- <?php echo "-TEST\n"; -print_r(http_get_request_headers()); -var_dump(http_get_request_body()); +$h = http_get_request_headers(); +ksort($h); +print_r($h); +$b = http_get_request_body(); +if (php_sapi_name() == 'cli' || $b == 'a=b&c=d') { + echo "OK\n"; +} ?> +===DONE=== --EXPECTF-- %sTEST Array @@ -22,5 +28,5 @@ [Accept-Charset] => iso-8859-1, * [User-Agent] => Mozilla/5.0 ) -string(7) "a=b&c=d" - +OK +===DONE=== |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | cvs: pecl /http/tests run-tests.diff: 00257, Marcus Boerger |
|---|---|
| Next by Date: | cvs: pecl /http/tests date_002.phpt: 00257, Michael Wallner |
| Previous by Thread: | cvs: pecl /http/tests run-tests.diffi: 00257, Marcus Boerger |
| Next by Thread: | cvs: pecl /http/tests date_002.phpt: 00257, Michael Wallner |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |