From: Michael Wallner Date: Sat, 17 Mar 2012 10:36:22 +0000 (+0000) Subject: rename http\Env\Request::getPost() to getForm(), because it actually retrieves form... X-Git-Tag: DEV_2-before-client~15 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=517336efe27e1f8e58e36352478a6d9ffdcdf378;p=m6w6%2Fext-http rename http\Env\Request::getPost() to getForm(), because it actually retrieves form data; add tests to pacakge.xml as suggested by Remi Collet --- diff --git a/package.xml b/package.xml index 0f56341..1652fc2 100644 --- a/package.xml +++ b/package.xml @@ -29,7 +29,7 @@ Extended HTTP support. Again. Keep in mind that it's got the major version 2, be 2012-03-16 - 2.0.0dev8 + 2.0.0dev 2.0.0 @@ -125,6 +125,52 @@ Extended HTTP support. Again. Keep in mind that it's got the major version 2, be + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/php_http.h b/php_http.h index 36dae96..e8d5e40 100644 --- a/php_http.h +++ b/php_http.h @@ -13,7 +13,7 @@ #ifndef PHP_EXT_HTTP_H #define PHP_EXT_HTTP_H -#define PHP_HTTP_EXT_VERSION "2.0.0dev8" +#define PHP_HTTP_EXT_VERSION "2.0.0dev" extern zend_module_entry http_module_entry; #define phpext_http_ptr &http_module_entry diff --git a/php_http_env_request.c b/php_http_env_request.c index 4313370..cd9dae0 100644 --- a/php_http_env_request.c +++ b/php_http_env_request.c @@ -22,13 +22,13 @@ zend_class_entry *php_http_env_request_class_entry; #define PHP_HTTP_ENV_REQUEST_ME(method, visibility) PHP_ME(HttpEnvRequest, method, PHP_HTTP_ARGS(HttpEnvRequest, method), visibility) PHP_HTTP_EMPTY_ARGS(__construct); -PHP_HTTP_EMPTY_ARGS(getPost); +PHP_HTTP_EMPTY_ARGS(getForm); PHP_HTTP_EMPTY_ARGS(getQuery); PHP_HTTP_EMPTY_ARGS(getFiles); zend_function_entry php_http_env_request_method_entry[] = { PHP_HTTP_ENV_REQUEST_ME(__construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) - PHP_HTTP_ENV_REQUEST_ME(getPost, ZEND_ACC_PUBLIC) + PHP_HTTP_ENV_REQUEST_ME(getForm, ZEND_ACC_PUBLIC) PHP_HTTP_ENV_REQUEST_ME(getQuery, ZEND_ACC_PUBLIC) PHP_HTTP_ENV_REQUEST_ME(getFiles, ZEND_ACC_PUBLIC) @@ -142,7 +142,7 @@ PHP_METHOD(HttpEnvRequest, __construct) MAKE_STD_ZVAL(zpost); object_init_ex(zpost, php_http_querystring_class_entry); if (SUCCESS == php_http_querystring_ctor(zpost, zsg TSRMLS_CC)) { - zend_update_property(php_http_env_request_class_entry, getThis(), ZEND_STRL("post"), zpost TSRMLS_CC); + zend_update_property(php_http_env_request_class_entry, getThis(), ZEND_STRL("form"), zpost TSRMLS_CC); } zval_ptr_dtor(&zpost); } @@ -160,10 +160,10 @@ PHP_METHOD(HttpEnvRequest, __construct) } end_error_handling(); } -PHP_METHOD(HttpEnvRequest, getPost) +PHP_METHOD(HttpEnvRequest, getForm) { if (SUCCESS == zend_parse_parameters_none()) { - RETURN_PROP(php_http_env_request_class_entry, "post"); + RETURN_PROP(php_http_env_request_class_entry, "form"); } } @@ -186,7 +186,7 @@ PHP_MINIT_FUNCTION(http_env_request) { PHP_HTTP_REGISTER_CLASS(http\\Env, Request, http_env_request, php_http_message_class_entry, 0); zend_declare_property_null(php_http_env_request_class_entry, ZEND_STRL("query"), ZEND_ACC_PROTECTED TSRMLS_CC); - zend_declare_property_null(php_http_env_request_class_entry, ZEND_STRL("post"), ZEND_ACC_PROTECTED TSRMLS_CC); + zend_declare_property_null(php_http_env_request_class_entry, ZEND_STRL("form"), ZEND_ACC_PROTECTED TSRMLS_CC); zend_declare_property_null(php_http_env_request_class_entry, ZEND_STRL("files"), ZEND_ACC_PROTECTED TSRMLS_CC); return SUCCESS; diff --git a/php_http_env_request.h b/php_http_env_request.h index 9a27f10..cc59664 100644 --- a/php_http_env_request.h +++ b/php_http_env_request.h @@ -17,7 +17,7 @@ extern zend_class_entry *php_http_env_request_class_entry; extern zend_function_entry php_http_env_request_method_entry[]; PHP_METHOD(HttpEnvRequest, __construct); -PHP_METHOD(HttpEnvRequest, getPost); +PHP_METHOD(HttpEnvRequest, getForm); PHP_METHOD(HttpEnvRequest, getQuery); PHP_METHOD(HttpEnvRequest, getFiles); diff --git a/tests/message002.phpt b/tests/message002.phpt index dcaacf3..810c1e8 100644 --- a/tests/message002.phpt +++ b/tests/message002.phpt @@ -66,7 +66,7 @@ object(%s)#%d (13) { array(0) { } } - ["post":protected]=> + ["form":protected]=> object(http\QueryString)#3 (2) { ["errorHandling":protected]=> NULL