Skip to content

Commit f0ed1ff

Browse files
authored
Integrate SPL language-snippets and rearrange SPL docs を取り込み (#4286) (#293)
1 parent 883d9db commit f0ed1ff

8 files changed

+65
-141
lines changed

language-snippets.ent

-27
Original file line numberDiff line numberDiff line change
@@ -2634,33 +2634,6 @@ PHP 7.4 以降では <option role="configure">--with-libxml</option>、それよ
26342634
</listitem>
26352635
</varlistentry>'>
26362636

2637-
<!-- SPL -->
2638-
<!ENTITY spl.datastructures.intro.title '<title xmlns="http://docbook.org/ns/docbook">データ構造</title>'>
2639-
2640-
<!ENTITY spl.exceptions.intro.title '<title xmlns="http://docbook.org/ns/docbook">例外</title>'>
2641-
2642-
<!ENTITY spl.exceptions.intro '
2643-
<para xmlns="http://docbook.org/ns/docbook">
2644-
SPL には標準の例外が用意されています。
2645-
</para>
2646-
<para xmlns="http://docbook.org/ns/docbook">
2647-
<xref linkend="reserved.exceptions" /> も参照ください。
2648-
</para>
2649-
'>
2650-
2651-
<!ENTITY spl.files.intro.title '<title xmlns="http://docbook.org/ns/docbook">ファイル操作</title>'>
2652-
<!ENTITY spl.files.intro '<partintro xmlns="http://docbook.org/ns/docbook"><para xmlns="http://docbook.org/ns/docbook">SPL にはファイルを扱うためのクラスが用意されています。</para></partintro>'>
2653-
2654-
<!ENTITY spl.interfaces.intro.title '<title xmlns="http://docbook.org/ns/docbook">インターフェイス</title>'>
2655-
<!ENTITY spl.interfaces.intro '<para xmlns="http://docbook.org/ns/docbook">SPL にはインターフェイスが用意されています。</para><para xmlns="http://docbook.org/ns/docbook"><xref linkend="reserved.interfaces" /> も参照ください。</para>'>
2656-
<!ENTITY spl.interfaces.list '<title xmlns="http://docbook.org/ns/docbook">インターフェイス一覧</title>'>
2657-
2658-
<!ENTITY spl.iterators.intro.title '<title xmlns="http://docbook.org/ns/docbook">イテレータ</title>'>
2659-
<!ENTITY spl.iterators.intro '<para xmlns="http://docbook.org/ns/docbook">SPL にはイテレータが用意されており、オブジェクトを反復処理することができます。</para>'>
2660-
2661-
<!ENTITY spl.misc.intro.title '<title xmlns="http://docbook.org/ns/docbook">その他のクラスおよびインターフェイス</title>'>
2662-
<!ENTITY spl.misc.intro '<partintro xmlns="http://docbook.org/ns/docbook"><para>他の SPL カテゴリにあてはまらないクラスおよびインターフェイス群です。</para></partintro>'>
2663-
26642637
<!-- ZIP -->
26652638
<!ENTITY zip.filename.separator '<note xmlns="http://docbook.org/ns/docbook"><simpara>ポータビリティを考慮して、ZIP ファイル名のディレクトリ区切り文字には常にスラッシュ (<literal>/</literal>) を使うことを推奨します。</simpara></note>'>
26662639

reference/spl/book.xml

+15-21
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,32 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<!-- EN-Revision: 487afb09014843c0911daf7c7c962c3dd4a2c610 Maintainer: takagi Status: ready -->
2+
<!-- EN-Revision: e93feee2870bb551cd11d625271b7f82da3ccb05 Maintainer: takagi Status: ready -->
33
<!-- CREDITS: shimooka,hirokawa -->
4-
5-
<book xml:id="book.spl" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
4+
<book xml:id="book.spl" xmlns="http://docbook.org/ns/docbook">
65
<?phpdoc extension-membership="core" ?>
76
<title>Standard PHP Library (SPL)</title>
87
<titleabbrev>SPL</titleabbrev>
98

10-
<preface xml:id="intro.spl">
9+
<preface xml:id="intro.spl" annotations="chunk:false">
1110
&reftitle.intro;
12-
<para>
13-
The Standard PHP Library (SPL) は、標準的な問題を解決するためのインターフェイスやクラスを集めたものです。
14-
</para>
15-
<para>
16-
SPL は、標準データ構造や、オブジェクトを走査するためのイテレータ、インターフェイス、標準の例外、そしてファイルを扱うクラスなどを提供し、
17-
<function>spl_autoload_register</function> などの関数も提供します。
18-
</para>
11+
<simpara>
12+
The Standard PHP Library (SPL) 拡張モジュールでは、
13+
よくある問題を解決するためのインターフェイスやクラスを定義しています。
14+
</simpara>
15+
<simpara>
16+
この拡張モジュールは、さまざまなデータ構造や汎用的な例外、イテレータ、
17+
オブジェクト指向な <acronym>API</acronym> でファイルシステムを扱うクラス、
18+
ユーティリティ関数を提供します。
19+
</simpara>
1920
</preface>
2021

21-
&reference.spl.datastructures;
22-
&reference.spl.iterators;
2322
&reference.spl.interfaces;
23+
&reference.spl.datastructures;
2424
&reference.spl.exceptions;
25-
&reference.spl.reference;
25+
&reference.spl.iterators;
2626
&reference.spl.files;
27-
&reference.spl.miscellaneous;
28-
29-
<!-- TODO: Not documented
30-
&reference.spl.splfixedarray;
31-
&reference.spl.splobjectstorage;
32-
-->
27+
&reference.spl.reference;
3328

3429
</book>
35-
3630
<!-- Keep this comment at the end of the file
3731
Local variables:
3832
mode: sgml

reference/spl/datastructures.xml

+13-9
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!-- $Revision$ -->
3-
<!-- EN-Revision: a706ea6af5e3015603a3ecc0264b846af0ca7a7a Maintainer: takagi Status: ready -->
4-
5-
<part xml:id="spl.datastructures" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
6-
7-
&spl.datastructures.intro.title;
3+
<!-- EN-Revision: e93feee2870bb551cd11d625271b7f82da3ccb05 Maintainer: takagi Status: ready -->
4+
<part xml:id="spl.datastructures" xmlns="http://docbook.org/ns/docbook">
5+
<title>データ構造</title>
86

97
<partintro>
108
<para>
@@ -63,9 +61,15 @@
6361

6462
<para>
6563
配列は、データを連続的に格納してインデックス経由でアクセスできるようにした構造です。
66-
PHP の配列と混同しないようにしましょう。PHP の配列は、
67-
実際のところは順序つきハッシュテーブルとして実装されています。
6864
</para>
65+
<note>
66+
<simpara>
67+
PHP の組み込みの <type>array</type> 型と混同しないようにしましょう。
68+
PHP の配列は、実際のところ順序つきハッシュテーブルです。
69+
ただし SPL には、PHP の配列をオブジェクトとして扱うための
70+
<classname>ArrayObject</classname> クラスも用意されています。
71+
</simpara>
72+
</note>
6973

7074
<itemizedlist>
7175
<listitem>
@@ -104,11 +108,11 @@
104108
&reference.spl.splpriorityqueue;
105109

106110
&reference.spl.splfixedarray;
111+
&reference.spl.arrayobject;
112+
107113
&reference.spl.splobjectstorage;
108114

109115
</part>
110-
111-
112116
<!-- Keep this comment at the end of the file
113117
Local variables:
114118
mode: sgml

reference/spl/exceptions.xml

+13-8
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!-- $Revision$ -->
3-
<!-- EN-Revision: 14af302c9c0e561fa6f9cdd956268758ba9a89c5 Maintainer: takagi Status: ready -->
4-
5-
<part xml:id="spl.exceptions" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
6-
7-
&spl.exceptions.intro.title;
3+
<!-- EN-Revision: e93feee2870bb551cd11d625271b7f82da3ccb05 Maintainer: takagi Status: ready -->
4+
<part xml:id="spl.exceptions" xmlns="http://docbook.org/ns/docbook">
5+
<title>例外</title>
86

97
<partintro>
10-
&spl.exceptions.intro;
8+
<simpara>
9+
SPL には標準の例外が用意されています。
10+
</simpara>
1111

1212
<section xml:id="spl.exceptions.tree">
1313
<title>SPL 例外クラスツリー</title>
@@ -40,6 +40,13 @@
4040
</itemizedlist>
4141
</section>
4242

43+
<section role="seealso">
44+
&reftitle.seealso;
45+
<simplelist>
46+
<member><xref linkend="reserved.exceptions"/></member>
47+
</simplelist>
48+
</section>
49+
4350
</partintro>
4451

4552
&reference.spl.badfunctioncallexception;
@@ -57,7 +64,6 @@
5764
&reference.spl.unexpectedvalueexception;
5865

5966
</part>
60-
6167
<!-- Keep this comment at the end of the file
6268
Local variables:
6369
mode: sgml
@@ -78,4 +84,3 @@ vim600: syn=xml fen fdm=syntax fdl=2 si
7884
vim: et tw=78 syn=sgml
7985
vi: ts=1 sw=1
8086
-->
81-

reference/spl/files.xml

+8-7
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!-- $Revision$ -->
3-
<!-- EN-Revision: 14af302c9c0e561fa6f9cdd956268758ba9a89c5 Maintainer: takagi Status: ready -->
3+
<!-- EN-Revision: e93feee2870bb551cd11d625271b7f82da3ccb05 Maintainer: takagi Status: ready -->
4+
<part xml:id="spl.files" xmlns="http://docbook.org/ns/docbook">
5+
<title>ファイル操作</title>
46

5-
<part xml:id="spl.files" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
6-
7-
&spl.files.intro.title;
8-
&spl.files.intro;
7+
<partintro>
8+
<simpara>
9+
SPL にはファイルを扱うためのクラスが用意されています。
10+
</simpara>
11+
</partintro>
912

1013
&reference.spl.splfileinfo;
1114
&reference.spl.splfileobject;
1215
&reference.spl.spltempfileobject;
1316

1417
</part>
15-
1618
<!-- Keep this comment at the end of the file
1719
Local variables:
1820
mode: sgml
@@ -33,4 +35,3 @@ vim600: syn=xml fen fdm=syntax fdl=2 si
3335
vim: et tw=78 syn=sgml
3436
vi: ts=1 sw=1
3537
-->
36-

reference/spl/interfaces.xml

+10-19
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,18 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<!-- EN-Revision: 267a3d4e60d8a6da941e72d195386b5841052cca Maintainer: takagi Status: ready -->
3-
4-
<part xml:id="spl.interfaces" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
5-
6-
&spl.interfaces.intro.title;
2+
<!-- EN-Revision: e93feee2870bb551cd11d625271b7f82da3ccb05 Maintainer: takagi Status: ready -->
3+
<part xml:id="spl.interfaces" xmlns="http://docbook.org/ns/docbook">
4+
<title>インターフェイス</title>
75

86
<partintro>
9-
&spl.interfaces.intro;
7+
<simpara>
8+
SPL では、イテレータを強化するインターフェイスや、
9+
オブザーバーパターンを実装するためのインターフェイスを提供しています。
10+
</simpara>
1011

11-
<section xml:id="spl.interfaces.list">
12-
&spl.interfaces.list;
12+
<section role="seealso">
13+
&reftitle.seealso;
1314
<simplelist>
14-
<member><classname>OuterIterator</classname></member>
15-
<member><classname>RecursiveIterator</classname></member>
16-
<member><classname>SeekableIterator</classname></member>
17-
<member><classname>SplObserver</classname></member>
18-
<member><classname>SplSubject</classname></member>
15+
<member><xref linkend="reserved.interfaces"/></member>
1916
</simplelist>
2017
</section>
2118

@@ -24,15 +21,10 @@
2421
&reference.spl.outeriterator;
2522
&reference.spl.recursiveiterator;
2623
&reference.spl.seekableiterator;
27-
<!-- TODO: Not documented
2824
&reference.spl.splobserver;
2925
&reference.spl.splsubject;
30-
-->
3126

3227
</part>
33-
34-
35-
3628
<!-- Keep this comment at the end of the file
3729
Local variables:
3830
mode: sgml
@@ -53,4 +45,3 @@ vim600: syn=xml fen fdm=syntax fdl=2 si
5345
vim: et tw=78 syn=sgml
5446
vi: ts=1 sw=1
5547
-->
56-

reference/spl/iterators.xml

+6-14
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!-- $Revision$ -->
3-
<!-- EN-Revision: 14af302c9c0e561fa6f9cdd956268758ba9a89c5 Maintainer: takagi Status: ready -->
4-
5-
<part xml:id="spl.iterators" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
6-
7-
&spl.iterators.intro.title;
3+
<!-- EN-Revision: e93feee2870bb551cd11d625271b7f82da3ccb05 Maintainer: takagi Status: ready -->
4+
<part xml:id="spl.iterators" xmlns="http://docbook.org/ns/docbook">
5+
<title>イテレータ</title>
86

97
<partintro>
10-
&spl.iterators.intro;
8+
<simpara>
9+
SPL にはイテレータが用意されており、オブジェクトを反復処理することができます。
10+
</simpara>
1111

1212
<section xml:id="spl.iterators.tree">
1313
<title>SPL イテレータクラスツリー</title>
@@ -115,10 +115,6 @@
115115

116116
</partintro>
117117

118-
<!-- TODO: Not documented
119-
&reference.spl.recursivetreeiterator;
120-
-->
121-
122118
&reference.spl.appenditerator;
123119
&reference.spl.arrayiterator;
124120
&reference.spl.cachingiterator;
@@ -145,9 +141,6 @@
145141
&reference.spl.regexiterator;
146142

147143
</part>
148-
149-
150-
151144
<!-- Keep this comment at the end of the file
152145
Local variables:
153146
mode: sgml
@@ -168,4 +161,3 @@ vim600: syn=xml fen fdm=syntax fdl=2 si
168161
vim: et tw=78 syn=sgml
169162
vi: ts=1 sw=1
170163
-->
171-

reference/spl/miscellaneous.xml

-36
This file was deleted.

0 commit comments

Comments
 (0)