miniflux-legacy/vendor/fguillot/picofeed/docs/installation.markdown
Frederic Guillot b1ded7ff7c Update PicoFeed
2015-04-11 09:40:09 -04:00

860 B

Installation

Versions

  • Development version: master
  • Stable version: v0.1.3

Installation with Composer

Configure your composer.json:

{
    "require": {
        "fguillot/picofeed": "0.1.3"
    }
}

Or simply:

composer require fguillot/picofeed:0.1.3

And download the code:

composer install # or update

Usage example with the Composer autoloader:

<?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...
}