Skip to content

[PHP 8.4] Document http_(get|clear)_last_response_headers() functions #204

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions language/predefined/variables/httpresponseheader.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- EN-Revision: c2cf2290247ae581d10dc4d74d91cc4f97293daa Maintainer: takagi Status: ready -->
<!-- EN-Revision: 3f1cd5121f7c9f8347ca69c8f657fdb24c0f9729 Maintainer: takagi Status: ready -->

<refentry role="variable" xml:id="reserved.variables.httpresponseheader" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>$http_response_header</refname>
<refpurpose>HTTP レスポンスヘッダ</refpurpose>
</refnamediv>

<refsect1 role="description">
&reftitle.description;
<para>
Expand Down Expand Up @@ -70,9 +70,16 @@ NULL
</example>
</para>
</refsect1>


<refsect1 role="seealso">
&reftitle.seealso;
<simplelist>
<member><function>http_get_last_response_headers</function></member>
<member><function>http_clear_last_response_headers</function></member>
</simplelist>
</refsect1>

</refentry>

<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
Expand All @@ -93,4 +100,3 @@ vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

62 changes: 62 additions & 0 deletions reference/network/functions/http-clear-last-response-headers.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- EN-Revision: 3f1cd5121f7c9f8347ca69c8f657fdb24c0f9729 Maintainer: Ippey Status: ready -->

<refentry xml:id="function.http-clear-last-response-headers" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>http_clear_last_response_headers</refname>
<refpurpose>保存された HTTP レスポンスヘッダーをクリア</refpurpose>
</refnamediv>

<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>void</type><methodname>http_clear_last_response_headers</methodname>
<void/>
</methodsynopsis>
<simpara>
<link linkend="wrappers.http">HTTP ラッパー</link> を使って受け取った
<acronym>HTTP</acronym> レスポンスをクリアします。
</simpara>
</refsect1>

<refsect1 role="parameters">
&reftitle.parameters;
&no.function.parameters;
</refsect1>

<refsect1 role="returnvalues">
&reftitle.returnvalues;
<simpara>
&return.void;
</simpara>
</refsect1>

<refsect1 role="seealso">
&reftitle.seealso;
<simplelist>
<member><function>http_get_last_response_headers</function></member>
</simplelist>
</refsect1>

</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->
118 changes: 118 additions & 0 deletions reference/network/functions/http-get-last-response-headers.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- EN-Revision: 3f1cd5121f7c9f8347ca69c8f657fdb24c0f9729 Maintainer: Ippey Status: ready -->

<refentry xml:id="function.http-get-last-response-headers" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>http_get_last_response_headers</refname>
<refpurpose>最後の HTTP レスポンスヘッダーを取得します</refpurpose>
</refnamediv>

<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type class="union"><type>array</type><type>null</type></type><methodname>http_get_last_response_headers</methodname>
<void/>
</methodsynopsis>
<simpara>
<link linkend="wrappers.http">HTTP ラッパー</link> を介して受け取った最後の <acronym>HTTP</acronym> レスポンスヘッダーを含む
<type>配列</type> を返します。
レスポンスヘッダーがない場合は、 &null; を返します。
</simpara>
</refsect1>

<refsect1 role="parameters">
&reftitle.parameters;
&no.function.parameters;
</refsect1>

<refsect1 role="returnvalues">
&reftitle.returnvalues;
<simpara>
<link linkend="wrappers.http">HTTP ラッパー</link> を使って受け取った <acronym>HTTP</acronym> ヘッダーを
インデックス付きの <type>配列</type> で返します。
ヘッダーがない場合は、 &null; を返します。
</simpara>
</refsect1>

<refsect1 role="examples">
&reftitle.examples;
<example xml:id="function.http-get-last-response-headers.example.basic">
<title><function>http_get_last_response_headers</function> example</title>
<simpara>
Description.
</simpara>
<programlisting role="php">
<![CDATA[
<?php
file_get_contents("http://example.com");
var_dump(http_get_last_response_headers());
?>
]]>
</programlisting>
&example.outputs.similar;
<screen>
<![CDATA[
array(14) {
[0]=>
string(15) "HTTP/1.1 200 OK"
[1]=>
string(20) "Accept-Ranges: bytes"
[2]=>
string(11) "Age: 326940"
[3]=>
string(29) "Cache-Control: max-age=604800"
[4]=>
string(38) "Content-Type: text/html; charset=UTF-8"
[5]=>
string(35) "Date: Mon, 11 Nov 2024 13:34:09 GMT"
[6]=>
string(23) "Etag: "3147526947+gzip""
[7]=>
string(38) "Expires: Mon, 18 Nov 2024 13:34:09 GMT"
[8]=>
string(44) "Last-Modified: Thu, 17 Oct 2019 07:18:26 GMT"
[9]=>
string(24) "Server: ECAcc (nyd/D16C)"
[10]=>
string(21) "Vary: Accept-Encoding"
[11]=>
string(12) "X-Cache: HIT"
[12]=>
string(20) "Content-Length: 1256"
[13]=>
string(17) "Connection: close"
}
]]>
</screen>
</example>
</refsect1>

<refsect1 role="seealso">
&reftitle.seealso;
<simplelist>
<member><function>http_clear_last_response_headers</function></member>
</simplelist>
</refsect1>

</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->