Skip to content

Commit e93feee

Browse files
authored
Integrate SPL language-snippets and rearrange SPL docs (#4286)
* Integrate SPL language-snippets They are only used once, having them as entities is useless. * Move SPL interfaces from misc to interface page * Rearrange SPL docs Move ArrayObject to data structures, get rid of misc page, do not chunk introduction * Remove interface list, the ToC shows the same info
1 parent 557acaf commit e93feee

File tree

8 files changed

+61
-136
lines changed

8 files changed

+61
-136
lines changed

language-snippets.ent

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2721,32 +2721,6 @@ to be references, then they must be references in the passed argument list.'>
27212721
</listitem>
27222722
</varlistentry>'>
27232723

2724-
<!-- SPL -->
2725-
<!ENTITY spl.datastructures.intro.title '<title xmlns="http://docbook.org/ns/docbook">Datastructures</title>'>
2726-
2727-
<!ENTITY spl.exceptions.intro.title '<title xmlns="http://docbook.org/ns/docbook">Exceptions</title>'>
2728-
<!ENTITY spl.exceptions.intro '
2729-
<para xmlns="http://docbook.org/ns/docbook">
2730-
SPL provides a set of standard Exceptions.
2731-
</para>
2732-
<para xmlns="http://docbook.org/ns/docbook">
2733-
See also the <xref linkend="reserved.exceptions" />.
2734-
</para>
2735-
'>
2736-
2737-
<!ENTITY spl.files.intro.title '<title xmlns="http://docbook.org/ns/docbook">File Handling</title>'>
2738-
<!ENTITY spl.files.intro '<partintro xmlns="http://docbook.org/ns/docbook"><para>SPL provides a number of classes to work with files.</para></partintro>'>
2739-
2740-
<!ENTITY spl.interfaces.intro.title '<title xmlns="http://docbook.org/ns/docbook">Interfaces</title>'>
2741-
<!ENTITY spl.interfaces.intro '<para xmlns="http://docbook.org/ns/docbook">SPL provides a set of interfaces.</para><para xmlns="http://docbook.org/ns/docbook">See also the <xref linkend="reserved.interfaces" /></para>'>
2742-
<!ENTITY spl.interfaces.list '<title xmlns="http://docbook.org/ns/docbook">Interface list</title>'>
2743-
2744-
<!ENTITY spl.iterators.intro.title '<title xmlns="http://docbook.org/ns/docbook">Iterators</title>'>
2745-
<!ENTITY spl.iterators.intro '<para xmlns="http://docbook.org/ns/docbook">SPL provides a set of iterators to traverse over objects.</para>'>
2746-
2747-
<!ENTITY spl.misc.intro.title '<title xmlns="http://docbook.org/ns/docbook">Miscellaneous Classes and Interfaces</title>'>
2748-
<!ENTITY spl.misc.intro '<partintro xmlns="http://docbook.org/ns/docbook"><para>Classes and interfaces which do not fit into the other SPL categories.</para></partintro>'>
2749-
27502724
<!-- ZIP -->
27512725
<!ENTITY zip.filename.separator '<note xmlns="http://docbook.org/ns/docbook"><simpara>For maximum portability, it is recommended to always use forward slashes (<literal>/</literal>) as directory separator in ZIP filenames.</simpara></note>'>
27522726

reference/spl/book.xml

Lines changed: 14 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,31 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!-- $Revision$ -->
3-
4-
<book xml:id="book.spl" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
3+
<book xml:id="book.spl" xmlns="http://docbook.org/ns/docbook">
54
<?phpdoc extension-membership="core" ?>
65
<title>Standard PHP Library (SPL)</title>
76
<titleabbrev>SPL</titleabbrev>
87

9-
<preface xml:id="intro.spl">
8+
<preface xml:id="intro.spl" annotations="chunk:false">
109
&reftitle.intro;
11-
<para>
12-
The Standard PHP Library (SPL) is a collection of interfaces and classes that are meant to solve
13-
common problems.
14-
</para>
15-
<para>
16-
SPL provides a set of standard datastructure, a set of iterators to traverse over objects, a set of interfaces, a set of standard Exceptions, a number of classes to work with files and it provides a set of functions like <function>spl_autoload_register</function>
17-
</para>
10+
<simpara>
11+
The Standard PHP Library (SPL) extension defines interfaces and classes
12+
that are meant to solve common problems.
13+
</simpara>
14+
<simpara>
15+
The extension provides various datastructures, generic exceptions,
16+
iterators, classes to work with filesystems using an object
17+
oriented <acronym>API</acronym>, and utility functions.
18+
</simpara>
1819
</preface>
1920

20-
&reference.spl.datastructures;
21-
&reference.spl.iterators;
2221
&reference.spl.interfaces;
22+
&reference.spl.datastructures;
2323
&reference.spl.exceptions;
24-
&reference.spl.reference;
24+
&reference.spl.iterators;
2525
&reference.spl.files;
26-
&reference.spl.miscellaneous;
27-
28-
<!-- TODO: Not documented
29-
&reference.spl.splfixedarray;
30-
&reference.spl.splobjectstorage;
31-
-->
26+
&reference.spl.reference;
3227

3328
</book>
34-
3529
<!-- Keep this comment at the end of the file
3630
Local variables:
3731
mode: sgml
@@ -52,4 +46,3 @@ vim600: syn=xml fen fdm=syntax fdl=2 si
5246
vim: et tw=78 syn=sgml
5347
vi: ts=1 sw=1
5448
-->
55-

reference/spl/datastructures.xml

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!-- $Revision$ -->
3-
4-
<part xml:id="spl.datastructures" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
5-
6-
&spl.datastructures.intro.title;
3+
<part xml:id="spl.datastructures" xmlns="http://docbook.org/ns/docbook">
4+
<title>Datastructures</title>
75

86
<partintro>
97
<para>
@@ -61,10 +59,17 @@
6159
<title>Arrays</title>
6260

6361
<para>
64-
Arrays are structures that store the data in a continuous way, accessible
65-
via indexes. Don't confuse them with PHP arrays: PHP arrays are in fact
66-
implemented as ordered hashtables.
62+
Arrays are structures that store the data in a contiguous way,
63+
accessible via indexes.
6764
</para>
65+
<note>
66+
<simpara>
67+
Do not confuse this with PHP's native <type>array</type> type.
68+
PHP arrays are in reality ordered hashtables.
69+
However, SPL provides the <classname>ArrayObject</classname> class
70+
to wrap PHP arrays into an object.
71+
</simpara>
72+
</note>
6873

6974
<itemizedlist>
7075
<listitem>
@@ -100,12 +105,11 @@
100105
&reference.spl.splpriorityqueue;
101106

102107
&reference.spl.splfixedarray;
108+
&reference.spl.arrayobject;
109+
103110
&reference.spl.splobjectstorage;
104111

105112
</part>
106-
107-
108-
109113
<!-- Keep this comment at the end of the file
110114
Local variables:
111115
mode: sgml
@@ -126,4 +130,3 @@ vim600: syn=xml fen fdm=syntax fdl=2 si
126130
vim: et tw=78 syn=sgml
127131
vi: ts=1 sw=1
128132
-->
129-

reference/spl/exceptions.xml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!-- $Revision$ -->
3-
4-
<part xml:id="spl.exceptions" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
5-
6-
&spl.exceptions.intro.title;
3+
<part xml:id="spl.exceptions" xmlns="http://docbook.org/ns/docbook">
4+
<title>Exceptions</title>
75

86
<partintro>
9-
&spl.exceptions.intro;
7+
<simpara>
8+
SPL provides a set of standard Exceptions.
9+
</simpara>
1010

1111
<section xml:id="spl.exceptions.tree">
1212
<title>SPL Exceptions Class Tree</title>
@@ -39,6 +39,13 @@
3939
</itemizedlist>
4040
</section>
4141

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

4451
&reference.spl.badfunctioncallexception;
@@ -56,7 +63,6 @@
5663
&reference.spl.unexpectedvalueexception;
5764

5865
</part>
59-
6066
<!-- Keep this comment at the end of the file
6167
Local variables:
6268
mode: sgml
@@ -77,4 +83,3 @@ vim600: syn=xml fen fdm=syntax fdl=2 si
7783
vim: et tw=78 syn=sgml
7884
vi: ts=1 sw=1
7985
-->
80-

reference/spl/files.xml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!-- $Revision$ -->
3+
<part xml:id="spl.files" xmlns="http://docbook.org/ns/docbook">
4+
<title>File Handling</title>
35

4-
<part xml:id="spl.files" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
5-
6-
&spl.files.intro.title;
7-
&spl.files.intro;
6+
<partintro>
7+
<simpara>
8+
SPL provides a number of classes to work with files.
9+
</simpara>
10+
</partintro>
811

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

1316
</part>
14-
1517
<!-- Keep this comment at the end of the file
1618
Local variables:
1719
mode: sgml

reference/spl/interfaces.xml

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,18 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!-- $Revision$ -->
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;
3+
<part xml:id="spl.interfaces" xmlns="http://docbook.org/ns/docbook">
4+
<title>Interfaces</title>
75

86
<partintro>
9-
&spl.interfaces.intro;
7+
<simpara>
8+
SPL provides a set of interfaces to enhance iterators,
9+
and a pair of interfaces to implement the Observer Design Pattern.
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

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!-- $Revision$ -->
3-
4-
<part xml:id="spl.iterators" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
5-
6-
&spl.iterators.intro.title;
3+
<part xml:id="spl.iterators" xmlns="http://docbook.org/ns/docbook">
4+
<title>Iterators</title>
75

86
<partintro>
9-
&spl.iterators.intro;
7+
<simpara>
8+
SPL provides a set of iterators to traverse over objects.
9+
</simpara>
1010

1111
<section xml:id="spl.iterators.tree">
1212
<title>SPL Iterators Class Tree</title>
@@ -114,10 +114,6 @@
114114

115115
</partintro>
116116

117-
<!-- TODO: Not documented
118-
&reference.spl.recursivetreeiterator;
119-
-->
120-
121117
&reference.spl.appenditerator;
122118
&reference.spl.arrayiterator;
123119
&reference.spl.cachingiterator;
@@ -144,9 +140,6 @@
144140
&reference.spl.regexiterator;
145141

146142
</part>
147-
148-
149-
150143
<!-- Keep this comment at the end of the file
151144
Local variables:
152145
mode: sgml
@@ -167,4 +160,3 @@ vim600: syn=xml fen fdm=syntax fdl=2 si
167160
vim: et tw=78 syn=sgml
168161
vi: ts=1 sw=1
169162
-->
170-

reference/spl/miscellaneous.xml

Lines changed: 0 additions & 35 deletions
This file was deleted.

0 commit comments

Comments
 (0)