reference/phar/Phar/buildFromIterator.xml
f03806fcd8fe03a0501bd40b6e3939ff6589a1d2
...
...
@@ -3,15 +3,15 @@
3
3
<refentry xml:id="phar.buildfromiterator" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
4
4
<refnamediv>
5
5
<refname>Phar::buildFromIterator</refname>
6
-
<refpurpose>Construct a phar archive from an iterator.</refpurpose>
6
+
<refpurpose>Construct a phar archive from an iterator</refpurpose>
7
7
</refnamediv>
8
8

9
9
<refsect1 role="description">
10
10
&reftitle.description;
11
-
<methodsynopsis>
11
+
<methodsynopsis role="Phar">
12
12
<modifier>public</modifier> <type>array</type><methodname>Phar::buildFromIterator</methodname>
13
-
<methodparam><type>Iterator</type><parameter>iter</parameter></methodparam>
14
-
<methodparam choice="opt"><type>string</type><parameter>base_directory</parameter></methodparam>
13
+
<methodparam><type>Traversable</type><parameter>iterator</parameter></methodparam>
14
+
<methodparam choice="opt"><type class="union"><type>string</type><type>null</type></type><parameter>baseDirectory</parameter><initializer>&null;</initializer></methodparam>
15
15
</methodsynopsis>
16
16
&phar.write;
17
17
<para>
...
...
@@ -28,7 +28,7 @@
28
28
<para>
29
29
<variablelist>
30
30
<varlistentry>
31
-
<term><parameter>iter</parameter></term>
31
+
<term><parameter>iterator</parameter></term>
32
32
<listitem>
33
33
<para>
34
34
Any iterator that either associatively maps phar file to location or
...
...
@@ -37,7 +37,7 @@
37
37
</listitem>
38
38
</varlistentry>
39
39
<varlistentry>
40
-
<term><parameter>base_directory</parameter></term>
40
+
<term><parameter>baseDirectory</parameter></term>
41
41
<listitem>
42
42
<para>
43
43
For iterators that return SplFileInfo objects, the portion of each
...
...
@@ -58,6 +58,46 @@
58
58
</para>
59
59
</refsect1>
60
60

61
+
<refsect1 role="errors">
62
+
&reftitle.errors;
63
+
<para>
64
+
This method returns <classname>UnexpectedValueException</classname> when the
65
+
iterator returns incorrect values, such as an integer key instead of a
66
+
string, a <classname>BadMethodCallException</classname> when an
67
+
SplFileInfo-based iterator is passed without a <parameter>baseDirectory</parameter>
68
+
parameter, or a <classname>PharException</classname> if there were errors
69
+
saving the phar archive.
70
+
</para>
71
+
</refsect1>
72
+

73
+
<refsect1 role="changelog">
74
+
&reftitle.changelog;
75
+
<informaltable>
76
+
<tgroup cols="2">
77
+
<thead>
78
+
<row>
79
+
<entry>&Version;</entry>
80
+
<entry>&Description;</entry>
81
+
</row>
82
+
</thead>
83
+
<tbody>
84
+
<row>
85
+
<entry>8.1.0</entry>
86
+
<entry>
87
+
<methodname>Phar::buildFromIterator</methodname> no longer returns &false;.
88
+
</entry>
89
+
</row>
90
+
<row>
91
+
<entry>8.0.0</entry>
92
+
<entry>
93
+
<parameter>baseDirectory</parameter> is now nullable.
94
+
</entry>
95
+
</row>
96
+
</tbody>
97
+
</tgroup>
98
+
</informaltable>
99
+
</refsect1>
100
+

61
101
<refsect1 role="examples">
62
102
&reftitle.examples;
63
103
<example>
...
...
@@ -134,7 +174,7 @@ $phar->setStub($phar->createDefaultStub('cli/index.php', 'www/index.php'));
134
174
<title>A <function>Phar::buildFromIterator</function> with other iterators</title>
135
175
<para>
136
176
The second form of the iterator can be used with any iterator that returns
137
-
a key => value mapping, such as an <classname>ArrayIterator</classname>:
177
+
a key =&gt; value mapping, such as an <classname>ArrayIterator</classname>:
138
178
</para>
139
179
<para>
140
180
<programlisting role="php">
...
...
@@ -156,19 +196,6 @@ $phar->setStub($phar->createDefaultStub('cli/index.php', 'www/index.php'));
156
196
</example>
157
197
</refsect1>
158
198
159
-
<refsect1 role="errors">
160
-
&reftitle.errors;
161
-
<para>
162
-
This method returns <classname>UnexpectedValueException</classname> when the
163
-
iterator returns incorrect values, such as an integer key instead of a
164
-
string, a <classname>BadMethodCallException</classname> when an
165
-
SplFileInfo-based iterator is passed without a <parameter>base_directory</parameter>
166
-
parameter, or a <classname>PharException</classname> if there were errors
167
-
saving the phar archive.
168
-
</para>
169
-
</refsect1>
170
-

171
-

172
199
<refsect1 role="seealso">
173
200
&reftitle.seealso;
174
201
<para>
...
...
@@ -179,7 +206,6 @@ $phar->setStub($phar->createDefaultStub('cli/index.php', 'www/index.php'));
179
206
</refsect1>
180
207

181
208
</refentry>
182
-

183
209
<!-- Keep this comment at the end of the file
184
210
Local variables:
185
211
mode: sgml
186
212