Skip to content

Commit 8dac32e

Browse files
request_parse_bodyの翻訳 (#206)
* request_parse_bodyの翻訳 * 改行やインデントを原文と揃える * 見出し文章の言い回しを他と統一 --------- Co-authored-by: 武田 憲太郎 <[email protected]>
1 parent 8f75a1d commit 8dac32e

File tree

4 files changed

+228
-2
lines changed

4 files changed

+228
-2
lines changed

language/errors/php7.xml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!-- $Revision$ -->
3-
<!-- EN-Revision: 1f7a0e4af85d1b74595626afa1ca774c896e8388 Maintainer: takagi Status: ready -->
3+
<!-- EN-Revision: 4bf789e981af0836c41daa16e57ef86c21497faa Maintainer: takagi Status: ready -->
44
<!-- Credits: mumumu -->
55

66
<sect1 xml:id="language.errors.php7" xmlns="http://docbook.org/ns/docbook">
@@ -80,6 +80,9 @@
8080
<listitem>
8181
<simpara><classname>FiberError</classname></simpara>
8282
</listitem>
83+
<listitem>
84+
<simpara><classname>RequestParseBodyException</classname></simpara>
85+
</listitem>
8386
</itemizedlist>
8487
</listitem>
8588
<listitem>

language/predefined/exceptions.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!-- $Revision$ -->
3-
<!-- EN-Revision: 49b7f738f43c1ea2113cc7931357a10224824539 Maintainer: takagi Status: ready -->
3+
<!-- EN-Revision: 4bf789e981af0836c41daa16e57ef86c21497faa Maintainer: takagi Status: ready -->
44
<!-- Credits: mumumu -->
55

66
<part xml:id="reserved.exceptions" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
@@ -29,6 +29,7 @@
2929
&language.predefined.valueerror;
3030
&language.predefined.unhandledmatcherror;
3131
&language.predefined.fibererror;
32+
&language.predefined.requestparsebodyexception;
3233
</part>
3334

3435
<!-- Keep this comment at the end of the file
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!-- $Revision$ -->
3+
<!-- EN-Revision: 4bf789e981af0836c41daa16e57ef86c21497faa Maintainer: ippey Status: ready -->
4+
<!-- Credits: ippey -->
5+
<reference xml:id="class.requestparsebodyexception" role="exception" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude">
6+
<title>RequestParseBodyException</title>
7+
<titleabbrev>RequestParseBodyException</titleabbrev>
8+
9+
<partintro>
10+
11+
<!-- {{{ Exception intro -->
12+
<section xml:id="RequestParseBodyException.intro">
13+
&reftitle.intro;
14+
<simpara>
15+
<classname>RequestParseBodyException</classname> は、
16+
<function>request_parse_body</function> 内でリクエストボディが無効な場合にスローされます。
17+
これは、 <literal>Content-Type</literal> ヘッダーに基づいて判断されます。
18+
</simpara>
19+
</section>
20+
<!-- }}} -->
21+
22+
<section xml:id="RequestParseBodyException.synopsis">
23+
&reftitle.classsynopsis;
24+
25+
<!-- {{{ Synopsis -->
26+
<classsynopsis class="class">
27+
<ooexception>
28+
<exceptionname>RequestParseBodyException</exceptionname>
29+
</ooexception>
30+
31+
<ooclass>
32+
<modifier>extends</modifier>
33+
<classname>Exception</classname>
34+
</ooclass>
35+
36+
<classsynopsisinfo role="comment">&InheritedProperties;</classsynopsisinfo>
37+
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.exception')/db:partintro/db:section/db:classsynopsis/db:fieldsynopsis[preceding-sibling::db:classsynopsisinfo[1][@role='comment' and text()='&Properties;']]))">
38+
<xi:fallback/>
39+
</xi:include>
40+
41+
<classsynopsisinfo role="comment">&InheritedMethods;</classsynopsisinfo>
42+
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.exception')/db:refentry/db:refsect1[@role='description']/descendant::db:constructorsynopsis[@role='Exception'])">
43+
<xi:fallback/>
44+
</xi:include>
45+
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.exception')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[@role='Exception'])">
46+
<xi:fallback/>
47+
</xi:include>
48+
</classsynopsis>
49+
50+
<!-- }}} -->
51+
52+
</section>
53+
</partintro>
54+
</reference>
55+
<!-- Keep this comment at the end of the file
56+
Local variables:
57+
mode: sgml
58+
sgml-omittag:t
59+
sgml-shorttag:t
60+
sgml-minimize-attributes:nil
61+
sgml-always-quote-attributes:t
62+
sgml-indent-step:1
63+
sgml-indent-data:t
64+
indent-tabs-mode:nil
65+
sgml-parent-document:nil
66+
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
67+
sgml-exposed-tags:nil
68+
sgml-local-catalogs:nil
69+
sgml-local-ecat-files:nil
70+
End:
71+
vim600: syn=xml fen fdm=syntax fdl=2 si
72+
vim: et tw=78 syn=sgml
73+
vi: ts=1 sw=1
74+
-->
Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!-- $Revision$ -->
3+
<!-- EN-Revision: 4bf789e981af0836c41daa16e57ef86c21497faa Maintainer: ippey Status: ready -->
4+
<!-- Credits: ippey -->
5+
<refentry xml:id="function.request-parse-body" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
6+
<refnamediv>
7+
<refname>request_parse_body</refname>
8+
<refpurpose>リクエストボディを読み取り、解析して結果を返す</refpurpose>
9+
</refnamediv>
10+
11+
<refsect1 role="description">
12+
&reftitle.description;
13+
<methodsynopsis>
14+
<type>array</type><methodname>request_parse_body</methodname>
15+
<methodparam choice="opt"><type class="union"><type>array</type><type>null</type></type><parameter>options</parameter><initializer>&null;</initializer></methodparam>
16+
</methodsynopsis>
17+
<simpara>
18+
この関数は リクエストボディを読み取り、
19+
<literal>Content-Type</literal> ヘッダーに基づき解析します。
20+
現在、2つのコンテンツタイプをサポートしています:
21+
</simpara>
22+
<itemizedlist>
23+
<listitem>
24+
<simpara>
25+
<literal>application/x-www-form-urlencoded</literal>
26+
</simpara>
27+
</listitem>
28+
<listitem>
29+
<simpara>
30+
<literal>multipart/form-data</literal>
31+
</simpara>
32+
</listitem>
33+
</itemizedlist>
34+
<simpara>
35+
この関数は、 <literal>POST</literal> 以外のHTTPメソッドで送信された
36+
<literal>multipart/form-data</literal> を解析するために使用されます。
37+
これらのリクエストでは、スーパーグローバルの
38+
<varname>$_POST</varname> や <varname>$_FILES</varname> は自動的に設定されません。
39+
</simpara>
40+
<caution>
41+
<simpara>
42+
<function>request_parse_body</function> は、リクエストボディを
43+
<literal>php://input</literal> ストリームにバッファせずに処理します。
44+
</simpara>
45+
</caution>
46+
</refsect1>
47+
48+
<refsect1 role="parameters">
49+
&reftitle.parameters;
50+
<variablelist>
51+
<varlistentry>
52+
<term><parameter>options</parameter></term>
53+
<listitem>
54+
<simpara>
55+
<parameter>options</parameter> パラメータは連想配列を受け取り、
56+
リクエストボディの解析に関連する以下のグローバル &php.ini; の設定を上書きします。
57+
</simpara>
58+
<itemizedlist>
59+
<listitem><simpara><literal>max_file_uploads</literal></simpara></listitem>
60+
<listitem><simpara><literal>max_input_vars</literal></simpara></listitem>
61+
<listitem><simpara><literal>max_multipart_body_parts</literal></simpara></listitem>
62+
<listitem><simpara><literal>post_max_size</literal></simpara></listitem>
63+
<listitem><simpara><literal>upload_max_filesize</literal></simpara></listitem>
64+
</itemizedlist>
65+
</listitem>
66+
</varlistentry>
67+
</variablelist>
68+
</refsect1>
69+
70+
<refsect1 role="returnvalues">
71+
&reftitle.returnvalues;
72+
<simpara>
73+
<function>request_parse_body</function> は、 <varname>$_POST</varname> に相当するものを
74+
インデックス <literal>0</literal> に、 <varname>$_FILES</varname> に相当するものを <literal>1</literal> に
75+
持つ配列ペアを返します。
76+
</simpara>
77+
</refsect1>
78+
79+
<refsect1 role="errors">
80+
&reftitle.errors;
81+
<simpara>
82+
<literal>Content-Type</literal> ヘッダーに基づいて解析を試み、リクエストボディが無効な場合、
83+
<exceptionname>RequestParseBodyException</exceptionname> をスローします。
84+
</simpara>
85+
<simpara>
86+
<parameter>options</parameter> に無効なキーが含まれている、
87+
または、対応するキーに無効な値が設定されている場合は、
88+
<exceptionname>ValueError</exceptionname> をスローします。
89+
</simpara>
90+
</refsect1>
91+
92+
<refsect1 role="examples">
93+
&reftitle.examples;
94+
<example xml:id="function.request-parse-body.example.basic">
95+
<title><function>request_parse_body</function> の例</title>
96+
<programlisting role="php">
97+
<![CDATA[
98+
<?php
99+
// Parse request and store result in the $_POST and $_FILES superglobals.
100+
[$_POST, $_FILES] = request_parse_body();
101+
// Echo the content of some transferred file
102+
echo file_get_contents($_FILES['file_name']['tmp_name']);
103+
?>
104+
]]>
105+
</programlisting>
106+
</example>
107+
<example xml:id="function.request-parse-body.example.options">
108+
<title>オプションを設定した <function>request_parse_body</function> の例</title>
109+
<programlisting role="php">
110+
<![CDATA[
111+
<?php
112+
// form.php
113+
114+
assert_logged_in();
115+
116+
// Only for this form, we allow a bigger upload size.
117+
[$_POST, $_FILES] = request_parse_body([
118+
'post_max_size' => '10M',
119+
'upload_max_filesize' => '10M',
120+
]);
121+
122+
// Do something with the uploaded files.
123+
?>
124+
]]>
125+
</programlisting>
126+
</example>
127+
</refsect1>
128+
</refentry>
129+
<!-- Keep this comment at the end of the file
130+
Local variables:
131+
mode: sgml
132+
sgml-omittag:t
133+
sgml-shorttag:t
134+
sgml-minimize-attributes:nil
135+
sgml-always-quote-attributes:t
136+
sgml-indent-step:1
137+
sgml-indent-data:t
138+
indent-tabs-mode:nil
139+
sgml-parent-document:nil
140+
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
141+
sgml-exposed-tags:nil
142+
sgml-local-catalogs:nil
143+
sgml-local-ecat-files:nil
144+
End:
145+
vim600: syn=xml fen fdm=syntax fdl=2 si
146+
vim: et tw=78 syn=sgml
147+
vi: ts=1 sw=1
148+
-->

0 commit comments

Comments
 (0)