svn: /phpdoc/en/trunk/language/context/ http.xml
| From: | Joey Smith | Date: | Wed, 17 Feb 2010 00:35:23 +0000 |
| Subject: | svn: /phpdoc/en/trunk/language/context/ http.xml | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-6084@lists.php.net to get a copy of this message | ||
joey Wed, 17 Feb 2010 00:35:23 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=295190
Log:
Apply user-patch from David Tajchreber, closes PHP Bug #38802
Bug: http://bugs.php.net/38802 (To be documented)
'max_redirects' context options doesn't work when value is 1
Changed paths:
U phpdoc/en/trunk/language/context/http.xml
Modified: phpdoc/en/trunk/language/context/http.xml
===================================================================
--- phpdoc/en/trunk/language/context/http.xml 2010-02-17 00:17:47 UTC (rev 295189)
+++ phpdoc/en/trunk/language/context/http.xml 2010-02-17 00:35:23 UTC (rev 295190)
@@ -273,6 +273,36 @@
</programlisting>
</example><!-- }}} -->
</para>
+ <para>
+ <example xml:id="context.http.example-fetch-ignore-redirect"><!-- {{{ -->
+ <title>Ignore redirects but fetch headers and content </title>
+ <programlisting role="php">
+<![CDATA[
+<?php
+
+$url = "http://www.example.org/header.php";
+
+$opts = array(
+ 'http' => array('method' => 'GET',
+ 'max_redirects' => '0',
+ 'ignore_errors' => '1')
+ );
+
+$context = stream_context_create($opts);
+$stream = fopen($url, 'r', false, $context);
+
+// header information as well as meta data
+// about the stream
+var_dump(stream_get_meta_data($stream));
+
+// actual data at $url
+var_dump(stream_get_contents($stream));
+fclose($stream);
+?>
+]]>
+ </programlisting>
+ </example><!-- }}} -->
+ </para>
</refsect1><!-- }}} -->
<refsect1 role="notes">