summaryrefslogtreecommitdiffstats
path: root/vendor/fguillot/picofeed/docs/installation.markdown
blob: 894754ca436d9705d8d0cab1659a5f10f5fd4d9d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
Installation
============

Versions
--------

- Development version: master
- Available versions:
    - v0.1.0 (stable)
    - v0.0.2
    - v0.0.1

Note: The public API has changed between 0.0.x and 0.1.0

Installation with Composer
--------------------------

Configure your `composer.json`:

```json
{
    "require": {
        "fguillot/picofeed": "0.1.0"
    }
}
```

Or simply:

```bash
composer require fguillot/picofeed:0.1.0
```

And download the code:

```bash
composer install # or update
```

Usage example with the Composer autoloader:

```php
<?php

require 'vendor/autoload.php';

use PicoFeed\Reader\Reader;

try {

    $reader = new Reader;
    $resource = $reader->download('http://linuxfr.org/news.atom');

    $parser = $reader->getParser(
        $resource->getUrl(),
        $resource->getContent(),
        $resource->getEncoding()
    );

    $feed = $parser->execute();

    echo $feed;
}
catch (Exception $e) {
    // Do something...
}
```