Skip to content

Integrate SPL language-snippets and rearrange SPL docs を取り込み (#4286) #293

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 1 commit into from
May 1, 2025
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
27 changes: 0 additions & 27 deletions language-snippets.ent
Original file line number Diff line number Diff line change
Expand Up @@ -2634,33 +2634,6 @@ PHP 7.4 以降では <option role="configure">--with-libxml</option>、それよ
</listitem>
</varlistentry>'>

<!-- SPL -->
<!ENTITY spl.datastructures.intro.title '<title xmlns="http://docbook.org/ns/docbook">データ構造</title>'>

<!ENTITY spl.exceptions.intro.title '<title xmlns="http://docbook.org/ns/docbook">例外</title>'>

<!ENTITY spl.exceptions.intro '
<para xmlns="http://docbook.org/ns/docbook">
SPL には標準の例外が用意されています。
</para>
<para xmlns="http://docbook.org/ns/docbook">
<xref linkend="reserved.exceptions" /> も参照ください。
</para>
'>

<!ENTITY spl.files.intro.title '<title xmlns="http://docbook.org/ns/docbook">ファイル操作</title>'>
<!ENTITY spl.files.intro '<partintro xmlns="http://docbook.org/ns/docbook"><para xmlns="http://docbook.org/ns/docbook">SPL にはファイルを扱うためのクラスが用意されています。</para></partintro>'>

<!ENTITY spl.interfaces.intro.title '<title xmlns="http://docbook.org/ns/docbook">インターフェイス</title>'>
<!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>'>
<!ENTITY spl.interfaces.list '<title xmlns="http://docbook.org/ns/docbook">インターフェイス一覧</title>'>

<!ENTITY spl.iterators.intro.title '<title xmlns="http://docbook.org/ns/docbook">イテレータ</title>'>
<!ENTITY spl.iterators.intro '<para xmlns="http://docbook.org/ns/docbook">SPL にはイテレータが用意されており、オブジェクトを反復処理することができます。</para>'>

<!ENTITY spl.misc.intro.title '<title xmlns="http://docbook.org/ns/docbook">その他のクラスおよびインターフェイス</title>'>
<!ENTITY spl.misc.intro '<partintro xmlns="http://docbook.org/ns/docbook"><para>他の SPL カテゴリにあてはまらないクラスおよびインターフェイス群です。</para></partintro>'>

<!-- ZIP -->
<!ENTITY zip.filename.separator '<note xmlns="http://docbook.org/ns/docbook"><simpara>ポータビリティを考慮して、ZIP ファイル名のディレクトリ区切り文字には常にスラッシュ (<literal>/</literal>) を使うことを推奨します。</simpara></note>'>

Expand Down
36 changes: 15 additions & 21 deletions reference/spl/book.xml
Original file line number Diff line number Diff line change
@@ -1,38 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: 487afb09014843c0911daf7c7c962c3dd4a2c610 Maintainer: takagi Status: ready -->
<!-- EN-Revision: e93feee2870bb551cd11d625271b7f82da3ccb05 Maintainer: takagi Status: ready -->
<!-- CREDITS: shimooka,hirokawa -->

<book xml:id="book.spl" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<book xml:id="book.spl" xmlns="http://docbook.org/ns/docbook">
<?phpdoc extension-membership="core" ?>
<title>Standard PHP Library (SPL)</title>
<titleabbrev>SPL</titleabbrev>

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

&reference.spl.datastructures;
&reference.spl.iterators;
&reference.spl.interfaces;
&reference.spl.datastructures;
&reference.spl.exceptions;
&reference.spl.reference;
&reference.spl.iterators;
&reference.spl.files;
&reference.spl.miscellaneous;

<!-- TODO: Not documented
&reference.spl.splfixedarray;
&reference.spl.splobjectstorage;
-->
&reference.spl.reference;

</book>

<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
Expand Down
22 changes: 13 additions & 9 deletions reference/spl/datastructures.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- EN-Revision: a706ea6af5e3015603a3ecc0264b846af0ca7a7a Maintainer: takagi Status: ready -->

<part xml:id="spl.datastructures" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">

&spl.datastructures.intro.title;
<!-- EN-Revision: e93feee2870bb551cd11d625271b7f82da3ccb05 Maintainer: takagi Status: ready -->
<part xml:id="spl.datastructures" xmlns="http://docbook.org/ns/docbook">
<title>データ構造</title>

<partintro>
<para>
Expand Down Expand Up @@ -63,9 +61,15 @@

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

<itemizedlist>
<listitem>
Expand Down Expand Up @@ -104,11 +108,11 @@
&reference.spl.splpriorityqueue;

&reference.spl.splfixedarray;
&reference.spl.arrayobject;

&reference.spl.splobjectstorage;

</part>


<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
Expand Down
21 changes: 13 additions & 8 deletions reference/spl/exceptions.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: 14af302c9c0e561fa6f9cdd956268758ba9a89c5 Maintainer: takagi Status: ready -->

<part xml:id="spl.exceptions" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">

&spl.exceptions.intro.title;
<!-- EN-Revision: e93feee2870bb551cd11d625271b7f82da3ccb05 Maintainer: takagi Status: ready -->
<part xml:id="spl.exceptions" xmlns="http://docbook.org/ns/docbook">
<title>例外</title>

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

<section xml:id="spl.exceptions.tree">
<title>SPL 例外クラスツリー</title>
Expand Down Expand Up @@ -40,6 +40,13 @@
</itemizedlist>
</section>

<section role="seealso">
&reftitle.seealso;
<simplelist>
<member><xref linkend="reserved.exceptions"/></member>
</simplelist>
</section>

</partintro>

&reference.spl.badfunctioncallexception;
Expand All @@ -57,7 +64,6 @@
&reference.spl.unexpectedvalueexception;

</part>

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

15 changes: 8 additions & 7 deletions reference/spl/files.xml
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- EN-Revision: 14af302c9c0e561fa6f9cdd956268758ba9a89c5 Maintainer: takagi Status: ready -->
<!-- EN-Revision: e93feee2870bb551cd11d625271b7f82da3ccb05 Maintainer: takagi Status: ready -->
<part xml:id="spl.files" xmlns="http://docbook.org/ns/docbook">
<title>ファイル操作</title>

<part xml:id="spl.files" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">

&spl.files.intro.title;
&spl.files.intro;
<partintro>
<simpara>
SPL にはファイルを扱うためのクラスが用意されています。
</simpara>
</partintro>

&reference.spl.splfileinfo;
&reference.spl.splfileobject;
&reference.spl.spltempfileobject;

</part>

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

29 changes: 10 additions & 19 deletions reference/spl/interfaces.xml
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: 267a3d4e60d8a6da941e72d195386b5841052cca Maintainer: takagi Status: ready -->

<part xml:id="spl.interfaces" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">

&spl.interfaces.intro.title;
<!-- EN-Revision: e93feee2870bb551cd11d625271b7f82da3ccb05 Maintainer: takagi Status: ready -->
<part xml:id="spl.interfaces" xmlns="http://docbook.org/ns/docbook">
<title>インターフェイス</title>

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

<section xml:id="spl.interfaces.list">
&spl.interfaces.list;
<section role="seealso">
&reftitle.seealso;
<simplelist>
<member><classname>OuterIterator</classname></member>
<member><classname>RecursiveIterator</classname></member>
<member><classname>SeekableIterator</classname></member>
<member><classname>SplObserver</classname></member>
<member><classname>SplSubject</classname></member>
<member><xref linkend="reserved.interfaces"/></member>
</simplelist>
</section>

Expand All @@ -24,15 +21,10 @@
&reference.spl.outeriterator;
&reference.spl.recursiveiterator;
&reference.spl.seekableiterator;
<!-- TODO: Not documented
&reference.spl.splobserver;
&reference.spl.splsubject;
-->

</part>



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

20 changes: 6 additions & 14 deletions reference/spl/iterators.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: 14af302c9c0e561fa6f9cdd956268758ba9a89c5 Maintainer: takagi Status: ready -->

<part xml:id="spl.iterators" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">

&spl.iterators.intro.title;
<!-- EN-Revision: e93feee2870bb551cd11d625271b7f82da3ccb05 Maintainer: takagi Status: ready -->
<part xml:id="spl.iterators" xmlns="http://docbook.org/ns/docbook">
<title>イテレータ</title>

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

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

</partintro>

<!-- TODO: Not documented
&reference.spl.recursivetreeiterator;
-->

&reference.spl.appenditerator;
&reference.spl.arrayiterator;
&reference.spl.cachingiterator;
Expand All @@ -145,9 +141,6 @@
&reference.spl.regexiterator;

</part>



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

36 changes: 0 additions & 36 deletions reference/spl/miscellaneous.xml

This file was deleted.