- release 0.10.0
authorMichael Wallner <mike@php.net>
Mon, 25 Jul 2005 12:51:39 +0000 (12:51 +0000)
committerMichael Wallner <mike@php.net>
Mon, 25 Jul 2005 12:51:39 +0000 (12:51 +0000)
- update docs

docs/functions.html
http_requestpool_object.c
package.xml
tests/run-tests.diff

index d00adae33987548fd6e00520bc1cbc6cc66439dd..100e1f3d500032e619e0b349a7d736e065d9bc6c 100644 (file)
@@ -430,7 +430,7 @@ GET example:</p><pre><blockquote><code><span style="color: #000000"><br />
 able to send several HttpRequests in parallel.<br />
 <br />
 Example:</p><pre><blockquote><code><span style="color: #000000"><br />
-<span style="color: #0000BB">&lt;?php<br />&nbsp;&nbsp;&nbsp;&nbsp;$urls </span><span style="color: #007700">= array(</span><span style="color: #DD0000">'www.php.net'</span><span style="color: #007700">, </span><span style="color: #DD0000">'pecl.php.net'</span><span style="color: #007700">, </span><span style="color: #DD0000">'pear.php.net'</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$pool </span><span style="color: #007700">= new </span><span style="color: #0000BB">HttpRequestPool</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;foreach (</span><span style="color: #0000BB">$urls </span><span style="color: #007700">as </span><span style="color: #0000BB">$url</span><span style="color: #007700">) {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$req</span><span style="color: #007700">[</span><span style="color: #0000BB">$url</span><span style="color: #007700">] = new </span><span style="color: #0000BB">HttpRequest</span><span style="color: #007700">(</span><span style="color: #DD0000">"http://$url"</span><span style="color: #007700">, </span><span style="color: #0000BB">HTTP_HEAD</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$pool</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">attach</span><span style="color: #007700">(</span><span style="color: #0000BB">$req</span><span style="color: #007700">[</span><span style="color: #0000BB">$url</span><span style="color: #007700">]);<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$pool</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">send</span><span style="color: #007700">();<br />&nbsp;&nbsp;&nbsp;&nbsp;foreach (</span><span style="color: #0000BB">$urls </span><span style="color: #007700">as </span><span style="color: #0000BB">$url</span><span style="color: #007700">) {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">printf</span><span style="color: #007700">(</span><span style="color: #DD0000">"%s (%s) is %s\n"</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$url</span><span style="color: #007700">, </span><span style="color: #0000BB">$req</span><span style="color: #007700">[</span><span style="color: #0000BB">$url</span><span style="color: #007700">]-&gt;</span><span style="color: #0000BB">getResponseInfo</span><span style="color: #007700">(</span><span style="color: #DD0000">'effective_url'</span><span style="color: #007700">),<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$r</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getResponseCode</span><span style="color: #007700">() == </span><span style="color: #0000BB">200 </span><span style="color: #007700">? </span><span style="color: #DD0000">'alive' </span><span style="color: #007700">: </span><span style="color: #DD0000">'not alive'<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br /></span><span style="color: #0000BB">?&gt;</span><br />
+<span style="color: #0000BB">&lt;?php<br /></span><span style="color: #007700">try {<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$pool </span><span style="color: #007700">= new </span><span style="color: #0000BB">HttpRequestPool</span><span style="color: #007700">(<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;new </span><span style="color: #0000BB">HttpRequest</span><span style="color: #007700">(</span><span style="color: #DD0000">'http://www.google.com/'</span><span style="color: #007700">, </span><span style="color: #0000BB">HTTP_HEAD</span><span style="color: #007700">),<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;new </span><span style="color: #0000BB">HttpRequest</span><span style="color: #007700">(</span><span style="color: #DD0000">'http://www.php.net/'</span><span style="color: #007700">, </span><span style="color: #0000BB">HTTP_HEAD</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;);<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$pool</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">send</span><span style="color: #007700">();<br />&nbsp;&nbsp;&nbsp;&nbsp;foreach(</span><span style="color: #0000BB">$pool </span><span style="color: #007700">as </span><span style="color: #0000BB">$request</span><span style="color: #007700">) {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">printf</span><span style="color: #007700">(</span><span style="color: #DD0000">"%s is %s (%d)\n"</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$request</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getUrl</span><span style="color: #007700">(),<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$request</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getResponseCode</span><span style="color: #007700">() ? </span><span style="color: #DD0000">'alive' </span><span style="color: #007700">: </span><span style="color: #DD0000">'not alive'</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$request</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getResponseCode</span><span style="color: #007700">()<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;);<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br />} catch (</span><span style="color: #0000BB">HttpException $e</span><span style="color: #007700">) {<br />&nbsp;&nbsp;&nbsp;&nbsp;echo </span><span style="color: #0000BB">$e</span><span style="color: #007700">;<br />}<br /></span><span style="color: #0000BB">?&gt;</span><br />
 </span><br />
 </code></blockquote><br />
 <br />
@@ -457,6 +457,16 @@ NOTE: set all options prior attaching!</p>
 <p>See HttpRequestPool::socketSend().</p>
 <h3 id="HttpRequestPool_socketRead">protected void HttpRequestPool::socketRead()</h3>
 <p>See HttpRequestPool::socketSend().</p>
+<h3 id="HttpRequestPool_valid">bool HttpRequestPool::valid()</h3>
+<p>Implements Iterator::valid().</p>
+<h3 id="HttpRequestPool_current">HttpRequest HttpRequestPool::current()</h3>
+<p>Implements Iterator::current().</p>
+<h3 id="HttpRequestPool_key">long HttpRequestPool::key()</h3>
+<p>Implements Iterator::key().</p>
+<h3 id="HttpRequestPool_next">void HttpRequestPool::next()</h3>
+<p>Implements Iterator::next().</p>
+<h3 id="HttpRequestPool_rewind">void HttpRequestPool::rewind()</h3>
+<p>Implements Iterator::rewind().</p>
 <hr noshade>
 <h1>http_response_object.c</h1>
 <h3 id="HttpResponse_setCache">static bool HttpResponse::setCache(bool cache)</h3>
@@ -531,7 +541,7 @@ Example:</p><pre><blockquote><code><span style="color: #000000"><br />
 <br />
 </pre></p>
 <hr noshade>
-    <p><b>Generated at: Fri, 22 Jul 2005 17:44:59 +0200</b></p>
+    <p><b>Generated at: Mon, 25 Jul 2005 14:47:50 +0200</b></p>
 </body>
 </html>
 
index c940f71107400f9e868db35b9041ca216f07b302..e01e26d21db5f8066a0119572b48c69fd3628664 100644 (file)
@@ -159,7 +159,7 @@ void _http_requestpool_object_free(zend_object *object TSRMLS_DC)
  *     $pool->send();
  *     foreach($pool as $request) {
  *         printf("%s is %s (%d)\n",
- *             $request->getResponseInfo('effective_url'),
+ *             $request->getUrl(),
  *             $request->getResponseCode() ? 'alive' : 'not alive',
  *             $request->getResponseCode()
  *         );
@@ -330,6 +330,8 @@ PHP_METHOD(HttpRequestPool, socketRead)
 /* implements Iterator */
 
 /* {{{ proto bool HttpRequestPool::valid()
+ *
+ * Implements Iterator::valid().
  */
 PHP_METHOD(HttpRequestPool, valid)
 {
@@ -343,6 +345,8 @@ PHP_METHOD(HttpRequestPool, valid)
 /* }}} */
 
 /* {{{ proto HttpRequest HttpRequestPool::current()
+ *
+ * Implements Iterator::current().
  */
 PHP_METHOD(HttpRequestPool, current)
 {
@@ -355,8 +359,8 @@ PHP_METHOD(HttpRequestPool, current)
                getObject(http_requestpool_object, obj);
 
                if (obj->iterator.pos < zend_llist_count(&obj->pool.handles)) {
-                       for (   current = zend_llist_get_first_ex(&obj->pool.handles, &lpos); 
-                                       current && obj->iterator.pos != pos++; 
+                       for (   current = zend_llist_get_first_ex(&obj->pool.handles, &lpos);
+                                       current && obj->iterator.pos != pos++;
                                        current = zend_llist_get_next_ex(&obj->pool.handles, &lpos));
                        if (current) {
                                RETURN_OBJECT(*current);
@@ -368,6 +372,8 @@ PHP_METHOD(HttpRequestPool, current)
 /* }}} */
 
 /* {{{ proto long HttpRequestPool::key()
+ *
+ * Implements Iterator::key().
  */
 PHP_METHOD(HttpRequestPool, key)
 {
@@ -381,6 +387,8 @@ PHP_METHOD(HttpRequestPool, key)
 /* }}} */
 
 /* {{{ proto void HttpRequestPool::next()
+ *
+ * Implements Iterator::next().
  */
 PHP_METHOD(HttpRequestPool, next)
 {
@@ -392,6 +400,8 @@ PHP_METHOD(HttpRequestPool, next)
 /* }}} */
 
 /* {{{ proto void HttpRequestPool::rewind()
+ *
+ * Implements Iterator::rewind().
  */
 PHP_METHOD(HttpRequestPool, rewind)
 {
index c9855a60120fbf68be07f936567e9e5021ffc498..f238ee9e0cb0f7ec94c7b8f2df1d69c6420a647d 100644 (file)
   </maintainers>
 
   <release>
-    <version>0.10.0dev</version>
-    <date>2005-07-00</date>
+    <version>0.10.0</version>
+    <date>2005-07-25</date>
     <state>beta</state>
     <notes><![CDATA[
 * changed HttpResponse to a completely static class, please see docs/functions.html for reference
 * added http_get_request_body()
 * several bug fixes
+* added test files
 ]]>
     </notes>
   </release>
@@ -46,6 +47,7 @@
       <file role="doc">CREDITS</file>
       <file role="doc">EXPERIMENTAL</file>
       <file role="doc">docs/functions.html</file>
+      <file role="doc">KnownIssues.txt</file>
       
       <file role="src" platform="windows">http.dsp</file>
       <file role="src" platform="windows">config.w32</file>
       <file role="src">http_response_object.c</file>
       <file role="src">http_exception_object.c</file>
       
+      <dir name="tests" role="test">
+        <file>README.txt</file>
+        <file>run-tests.diff</file>
+        <file>data.txt</file>
+        <file>skip.inc</file>
+        <file>abs_uri_001.phpt</file>
+        <file>abs_uri_002.phpt</file>
+        <file>allowed_methods_001.phpt</file>
+        <file>chunked_decode_001.phpt</file>
+        <file>date_001.phpt</file>
+        <file>date_002.phpt</file>
+        <file>get_request_data_001.phpt</file>
+        <file>HttpMessage_001.phpt</file>
+        <file>HttpRequestPool_001.phpt</file>
+        <file>HttpRequest_001.phpt</file>
+        <file>HttpRequest_002.phpt</file>
+        <file>HttpRequest_003.phpt</file>
+        <file>HttpResponse_001.phpt</file>
+        <file>HttpResponse_002.phpt</file>
+        <file>INI_001.phpt</file>
+        <file>parse_headers_001.phpt</file>
+        <file>redirect_001.phpt</file>
+        <file>redirect_002.phpt</file>
+        <file>redirect_003.phpt</file>
+        <file>send_data_001.phpt</file>
+        <file>send_data_002.phpt</file>
+        <file>send_data_003.phpt</file>
+        <file>send_data_004.phpt</file>
+        <file>send_data_005.phpt</file>
+        <file>send_data_006.phpt</file>
+        <file>send_data_007.phpt</file>
+        <file>send_data_008.phpt</file>
+        <file>send_data_009.phpt</file>
+        <file>send_file_001.phpt</file>
+        <file>send_file_002.phpt</file>
+        <file>send_file_003.phpt</file>
+        <file>send_file_004.phpt</file>
+        <file>send_file_005.phpt</file>
+        <file>send_file_006.phpt</file>
+        <file>send_file_007.phpt</file>
+        <file>split_response_001.phpt</file>
+        <file>split_response_002.phpt</file>
+      </dir>
     </dir>
   </filelist>
+  <deps>
+       <dep type="php" rel="ge" version="4.3.1" optional="no" />
+       <dep type="php" rel="ge" version="5.0.4" optional="yes" />
+       <dep type="ext" rel="has" optional="yes">session</dep>
+       <dep type="ext" rel="has" optional="yes">zlib</dep>
+  </deps>
 </package>
 
index 90b03aedf49d4651fef3ff1406c5f7fd168ebaf4..9295b87fb1de22d4112768b9b12337d017af8399 100644 (file)
@@ -1,24 +1,24 @@
 Index: run-tests.php
 ===================================================================
 RCS file: /repository/php-src/run-tests.php,v
-retrieving revision 1.209
-diff -u -r1.209 run-tests.php
---- run-tests.php      20 Mar 2005 19:47:13 -0000      1.209
-+++ run-tests.php      3 May 2005 06:13:20 -0000
-@@ -836,6 +836,12 @@
+retrieving revision 1.223
+diff -u -r1.223 run-tests.php
+--- run-tests.php      18 Jul 2005 00:19:28 -0000      1.223
++++ run-tests.php      25 Jul 2005 12:28:31 -0000
+@@ -926,6 +926,12 @@
                $query_string = '';
        }
  
-+    if (!empty($section_text['ENV'])) {
-+        foreach (explode("\n", $section_text['ENV']) as $env) {
-+            ($env = trim($env)) and putenv($env);
-+        }
-+    }
++      if (!empty($section_text['ENV'])) {
++              foreach (explode("\n", $section_text['ENV']) as $env) {
++                      ($env = trim($env)) and putenv($env);
++              }
++      }
 +
        putenv("REDIRECT_STATUS=1");
        putenv("QUERY_STRING=$query_string");
        putenv("PATH_TRANSLATED=$tmp_file");
-@@ -861,7 +867,7 @@
+@@ -951,7 +957,7 @@
                putenv("CONTENT_TYPE=");
                putenv("CONTENT_LENGTH=");
  
@@ -27,15 +27,16 @@ diff -u -r1.209 run-tests.php
        }
  
        if ($DETAILED) echo "
-@@ -878,6 +884,12 @@
+@@ -968,6 +974,13 @@
  //    $out = `$cmd`;
        $out = system_with_timeout($cmd);
  
-+    if (!empty($section_text['ENV'])) {
-+        foreach (explode("\n", $section_text['ENV']) as $env) {
-+            ($env = trim($env)) and putenv(array_shift(explode('=', $env)).'=');
-+        }
-+    }
++      if (!empty($section_text['ENV'])) {
++              foreach (explode("\n", $section_text['ENV']) as $env) {
++                      $env = explode('=', $env);
++                      ($env = trim($env)) and putenv($env[0] .'=');
++              }
++      }
 +
        @unlink($tmp_post);