You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/9.0/connections/index.md
+18Lines changed: 18 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -81,3 +81,21 @@ try {
81
81
}
82
82
~~~
83
83
84
+
When using a non-seekable `SplFileObject`, a `RuntimeException` is thrown instead of a `League\Csv\Exception` when using features that requires a seekable CSV document. In the following example a seekable CSV document is required to update the inserted newline.
Copy file name to clipboardExpand all lines: docs/9.0/connections/instantiation.md
+8-2Lines changed: 8 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ title: Loading CSV documents
7
7
8
8
Because CSV documents come in different forms we use named constructors to offer several ways to load them.
9
9
10
-
<pclass="message-warning">Since version <code>9.1.0</code> non seekable CSV documents can be used but <code>Exception</code> will be thrown if features requiring seekable CSV document are used.</p>
10
+
<pclass="message-warning">Since version <code>9.1.0</code> non seekable CSV documents can be used but <strong>exceptions will be thrown if features requiring seekable CSV document are used.</strong></p>
Copy file name to clipboardExpand all lines: docs/9.0/connections/output.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,7 +23,7 @@ public AbstractCsv::getContent(void): string
23
23
public AbstractCsv::__toString(void): string
24
24
~~~
25
25
26
-
<pclass="message-notice">The <code>getContent</code> method is added in version <code>9.1.0</code> and replaces the <code>__toString</code> method</p>
26
+
<pclass="message-notice">The <code>getContent</code> method is added in version <code>9.1.0</code> and replaces the <code>__toString</code> method which is <strong>deprecated</strong>.</p>
27
27
28
28
Use the `getContent` method to return the CSV full content.
29
29
@@ -157,7 +157,7 @@ To avoid breaking the flow of your application, you should create a Response obj
-[bug #38301](https://bugs.php.net/bug.php?id=38301): field enclosure behavior in fputcsv (since version 9.1)
23
+
-[bug #38301](https://bugs.php.net/bug.php?id=38301): field enclosure behavior in `fputcsv` (since version `9.1.0`)
24
24
25
25
When using this stream filter you can easily create or read a [RFC4180 compliant CSV document](https://tools.ietf.org/html/rfc4180#section-2) using `League\Csv` connections objects.
26
26
27
27
28
28
<pclass="message-warning">Changing the CSV objects control characters <strong>after registering the stream filter</strong> may result in unexpected returned records.</p>
29
29
30
30
31
-
## Usage with CSV objects
31
+
## Usage with League\CSV objects
32
32
33
33
~~~php
34
34
<?php
@@ -48,14 +48,14 @@ The `RFC4180Field::addTo` method will register the stream filter if it is not al
RFC4180Field::addTo($writer); //adding the stream filter to fix field formatting
54
54
$writer->insertAll($iterable_data);
55
55
$writer->output('mycsvfile.csv'); //outputting a RFC4180 compliant CSV Document
56
56
~~~
57
57
58
-
<pclass="message-notice">the <code>$whitespace_replace</code> argument is available since version 9.1</p>
58
+
<pclass="message-notice">the <code>$whitespace_replace</code> argument is available since version <code>9.1.0</code></p>
59
59
60
60
When the `$whitespace_replace` sequence is different from the empty space and does not contain:
61
61
@@ -66,16 +66,27 @@ its value will be used to:
66
66
67
67
- To prevent `fputcsv` default behavior of always using enclosure when a whitespace is found in a record field
68
68
69
-
<pclass="message-warning">The <code>$whitespace_replace</code> sequence should be a sequence not present in the inserted records, otherwise your CSV content will be affected by it.</p>
echo $writer->getContent(); //display 'foo bar,bar' instead of '"foo bar",bar'
79
+
~~~
80
+
81
+
<pclass="message-warning">The <code>$whitespace_replace</code> sequence should be a sequence not present in the inserted records, otherwise your CSV content will be affected by it.</p>
The `League\Csv\Reader` class extends the general connections [capabilities](/9.0/connections/) to ease selecting and manipulating CSV document records.
24
24
25
-
<pclass="message-warning">
26
-
By default, the mode for a <code>Reader::createFromPath</code> is
27
-
<code>r+</code> which looks for write permissions on the file and throws an <code>Exception</code> if
28
-
the file cannot be opened with the permission set. For sake of clarity, it is
29
-
strongly suggested to set <code>r</code> mode on the file to ensure it can be opened.</p>
25
+
<pclass="message-notice">Starting with version <code>9.1.0</code>, <code>createFromPath</code> when used from the <code>Reader</code> object will have its default set to <code>r</code>.</p>
26
+
27
+
<pclass="message-notice">Prior to <code>9.1.0</code>, by default, the mode for a <code>Reader::createFromPath</code> is <code>r+</code> which looks for write permissions on the file and throws an <code>Exception</code> if the file cannot be opened with the permission set. For sake of clarity, it is strongly suggested to set <code>r</code> mode on the file to ensure it can be opened.</p>
0 commit comments