2014-12-24 03:28:26 +01:00
|
|
|
Installation
|
|
|
|
============
|
|
|
|
|
|
|
|
Versions
|
|
|
|
--------
|
|
|
|
|
|
|
|
- Development version: master
|
2015-04-11 15:40:09 +02:00
|
|
|
- Stable version: v0.1.3
|
2014-12-24 03:28:26 +01:00
|
|
|
|
|
|
|
Installation with Composer
|
|
|
|
--------------------------
|
|
|
|
|
|
|
|
Configure your `composer.json`:
|
|
|
|
|
|
|
|
```json
|
|
|
|
{
|
|
|
|
"require": {
|
2015-04-11 15:40:09 +02:00
|
|
|
"fguillot/picofeed": "0.1.3"
|
2014-12-24 03:28:26 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
Or simply:
|
|
|
|
|
|
|
|
```bash
|
2015-04-11 15:40:09 +02:00
|
|
|
composer require fguillot/picofeed:0.1.3
|
2014-12-24 03:28:26 +01:00
|
|
|
```
|
|
|
|
|
|
|
|
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...
|
|
|
|
}
|
|
|
|
```
|