fix tests; fix leaks in new http\Env\Request methods; release dev6
authorMichael Wallner <mike@php.net>
Thu, 1 Mar 2012 21:42:01 +0000 (21:42 +0000)
committerMichael Wallner <mike@php.net>
Thu, 1 Mar 2012 21:42:01 +0000 (21:42 +0000)
package.xml
php_http_env_request.c
tests/message002.phpt
tests/response002.phpt

index 2e2dec0..e91e84a 100644 (file)
@@ -27,9 +27,9 @@ Extended HTTP support. Again. Keep in mind that it's got the major version 2, be
   <email>mike@php.net</email>
   <active>yes</active>
  </lead>
- <date>2012-02-17</date>
+ <date>2012-03-01</date>
  <version>
-  <release>2.0.0dev5</release>
+  <release>2.0.0dev6</release>
   <api>2.0.0</api>
  </version>
  <stability>
@@ -38,11 +38,10 @@ Extended HTTP support. Again. Keep in mind that it's got the major version 2, be
  </stability>
  <license>BSD, revised</license>
  <notes><![CDATA[
-* Improved test coverage [1] and fixed a lot of issues with the cookie, params, querystring,
-  persistent handles, request factory, etag, stream filters, encoding streams, negotiation
-  and HTTP message info code.
-
-[1] http://dev.iworks.at/ext-http/lcov/ext/http/index.html
++ Added stream parsing capability to http\Message
++ Added http\Env\Request methods: getQuery(), getPost(), getFiles()
+* Changed http\Env\Response to only cache responses to GET or HEAD requests without authorization
+* Fixed possible crash when http\Url was initialized with empty urls
 ]]></notes>
  <contents>
   <dir name="/">
@@ -65,6 +64,8 @@ Extended HTTP support. Again. Keep in mind that it's got the major version 2, be
    <file role="src" name="php_http_encoding.h"/>
    <file role="src" name="php_http_env.c"/>
    <file role="src" name="php_http_env.h"/>
+   <file role="src" name="php_http_env_request.c"/>
+   <file role="src" name="php_http_env_request.h"/>
    <file role="src" name="php_http_env_response.c"/>
    <file role="src" name="php_http_env_response.h"/>
    <file role="src" name="php_http_etag.c"/>
index c11f730..4313370 100644 (file)
@@ -134,6 +134,7 @@ PHP_METHOD(HttpEnvRequest, __construct)
                                if (SUCCESS == php_http_querystring_ctor(zquery, zsg TSRMLS_CC)) {
                                        zend_update_property(php_http_env_request_class_entry, getThis(), ZEND_STRL("query"), zquery TSRMLS_CC);
                                }
+                               zval_ptr_dtor(&zquery);
                        }
                        if ((zsg = php_http_env_get_superglobal(ZEND_STRL("_POST") TSRMLS_CC))) {
                                zval *zpost;
@@ -143,6 +144,7 @@ PHP_METHOD(HttpEnvRequest, __construct)
                                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);
                                }
+                               zval_ptr_dtor(&zpost);
                        }
                        if ((zsg = php_http_env_get_superglobal(ZEND_STRL("_FILES") TSRMLS_CC))) {
                                zval *zfiles;
@@ -152,6 +154,7 @@ PHP_METHOD(HttpEnvRequest, __construct)
                                zend_hash_apply_with_arguments(Z_ARRVAL_P(zsg) TSRMLS_CC, grab_files, 1, zfiles);
 
                                zend_update_property(php_http_env_request_class_entry, getThis(), ZEND_STRL("files"), zfiles TSRMLS_CC);
+                               zval_ptr_dtor(&zfiles);
                        }
                }
        } end_error_handling();
index a76e9e5..bb19875 100644 (file)
@@ -25,7 +25,7 @@ var_dump((string)$m->getBody());
 echo "Done\n";
 --EXPECTF--
 Test
-object(%s)#%d (10) {
+object(%s)#%d (13) {
   ["errorHandling":protected]=>
   NULL
   ["type":protected]=>
@@ -46,7 +46,11 @@ object(%s)#%d (10) {
   ["httpVersion":protected]=>
   string(3) "1.1"
   ["headers":protected]=>
-  array(2) {
+  array(4) {
+    ["Content-Type"]=>
+    string(14) "test/something"
+    ["Content-Length"]=>
+    string(1) "3"
     ["X-Test"]=>
     string(4) "test"
     ["Cookie"]=>
@@ -54,6 +58,25 @@ object(%s)#%d (10) {
   }
   ["parentMessage":protected]=>
   NULL
+  ["query":protected]=>
+  object(http\QueryString)#2 (2) {
+    ["errorHandling":protected]=>
+    NULL
+    ["queryArray":"http\QueryString":private]=>
+    array(0) {
+    }
+  }
+  ["post":protected]=>
+  object(http\QueryString)#3 (2) {
+    ["errorHandling":protected]=>
+    NULL
+    ["queryArray":"http\QueryString":private]=>
+    array(0) {
+    }
+  }
+  ["files":protected]=>
+  array(0) {
+  }
 }
 POST / HTTP/1.1%a
 X-Test: test%a
index 0a815ad..9a2d3da 100644 (file)
@@ -2,7 +2,7 @@
 http response cache negative
 --SKIPIF--
 <?php include "skipif.inc"; ?>
---POST--
+--GET--
 a=b
 --ENV--
 HTTP_IF_MODIFIED_SINCE=Fri, 13 Feb 2009 23:31:30 GMT