Skip to content

Commit

Permalink
update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
nyamsprod committed Jul 12, 2017
1 parent 5091b2c commit 7fd45d7
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 19 deletions.
23 changes: 22 additions & 1 deletion docs/8.0/installation.md
Expand Up @@ -20,4 +20,25 @@ $ composer require league/csv:^8.0

## Going Solo

You can also use `Csv` without using Composer by downloading the library and using any other [PSR-4](http://www.php-fig.org/psr/psr-4/) compatible autoloader.
You can also use `League\Csv` without using Composer by downloading the library on Github.

- Visit [the releases page](https://github.com/thephpleague/csv/releases);
- Select the version you want
- click the Source Code download link in your preferred compress format;

The library is compatible with any [PSR-4](http://www.php-fig.org/psr/psr-4/) compatible autoloader.

Also, `League\Csv` comes bundle with its own autoloader script `autoload.php` located in the root directory.

~~~php
<?php

use League\Csv\Reader;
use League\Csv\Writer;

require '/path/to/league/csv/autoload.php';

//your script starts here
~~~

where `path/to/league/csv` represents the path where the library was extracted.
10 changes: 8 additions & 2 deletions docs/9.0/installation.md
Expand Up @@ -19,9 +19,15 @@ $ composer require league/csv:^9.0

## Going Solo

You can also use `League\Csv` without using Composer by downloading the library and using any other [PSR-4](http://www.php-fig.org/psr/psr-4/) compatible autoloader.
You can also use `League\Csv` without using Composer by downloading the library on Github.

`League\Csv` comes bundle with its own autoloader script `autoload.php` located in the root directory.
- Visit [the releases page](https://github.com/thephpleague/csv/releases);
- Select the version you want
- click the Source Code download link in your preferred compress format;

The library is compatible with any [PSR-4](http://www.php-fig.org/psr/psr-4/) compatible autoloader.

Also, `League\Csv` comes bundle with its own autoloader script `autoload.php` located in the root directory.

~~~php
<?php
Expand Down
21 changes: 5 additions & 16 deletions docs/9.0/writer/helpers.md
Expand Up @@ -5,7 +5,7 @@ title: Bundled Writer helpers

# Bundled insertion helpers

## Column consistency checker
## Column consistency validator

~~~php
<?php
Expand Down Expand Up @@ -43,7 +43,7 @@ $writer->insertOne(["foo", "bar"]); //will trigger a InsertionException exceptio

<p class="message-info">The default column count is set to <code>-1</code>.</p>

## Charset Converter
## Charset formatter

[League\Csv\CharsetConverter](/9.0/converter/charset/) will help you encode your records depending on your settings.

Expand All @@ -63,7 +63,7 @@ $writer->insertOne(["foo", "bébé", "jouet"]);
//all 'utf-8' caracters are now automatically encoded into 'iso-8859-15' charset
~~~

If your `Writer` object supports PHP stream filters then it's recommended to use the library [stream filtering mechanism](/9.0/connections/filters/) instead.
If your `Writer` object supports PHP stream filters then it's recommended to use the `CharsetConverter` object via the library [stream filtering mechanism](/9.0/connections/filters/) instead as shown below.

~~~php
<?php
Expand All @@ -78,20 +78,9 @@ $writer->insertOne(["foo", "bébé", "jouet"]);
//all 'utf-8' caracters are now automatically encoded into 'iso-8859-15' charset
~~~

## RFC4180 compliance
## RFC4180 field formatter

~~~php
<?php

public static RFC4180Field::addTo(AbstractCsv $csv): void
~~~

If your CSV object supports PHP stream filters then you can register the `RFC4180Field` stream filter to correct field formatting to comply with [RFC4180](https://tools.ietf.org/html/rfc4180#section-2).

The `RFC4180Field::addTo` static method:

- registers the `RFC4180Field` class under the following generic filtername `league.csv.rfc4180.field`.
- adds the stream filter to your current `Writer` object using the object CSV control properties.
If your `Writer` object supports PHP stream filters then you can register the [League\Csv\RFC4180Field](/9.0/interoperability/rfc4180-field/) stream filter to correct field formatting to comply with [RFC4180](https://tools.ietf.org/html/rfc4180#section-2) as seen below:

~~~php
<?php
Expand Down

0 comments on commit 7fd45d7

Please sign in to comment.