PHPackages                             janwebdev/rss-atom-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. janwebdev/rss-atom-bundle

ActiveSymfony-bundle

janwebdev/rss-atom-bundle
=========================

RSS / Atom and JSONFeed support for Symfony

v1.2(8mo ago)07MITPHPPHP &gt;=7.1

Since Sep 15Pushed 8mo agoCompare

[ Source](https://github.com/janwebdev/rss-atom-bundle)[ Packagist](https://packagist.org/packages/janwebdev/rss-atom-bundle)[ Docs](http://debril.org/category/rss-atom-bundle/)[ RSS](/packages/janwebdev-rss-atom-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (12)Versions (4)Used By (0)

RssAtomBundle - Read and Build Atom/RSS feeds
=============================================

[](#rssatombundle---read-and-build-atomrss-feeds)

[![SensioLabsInsight](https://camo.githubusercontent.com/9a6ebbd5b30a2301db2ef4bbb0c91e7c626b8a1400a8f05e23c84b4ea791bee8/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f39653062313330312d643761352d343966642d393136622d3439646135343433383961632f6269672e706e67)](https://insight.sensiolabs.com/projects/9e0b1301-d7a5-49fd-916b-49da544389ac)[![Latest Stable Version](https://camo.githubusercontent.com/ee10a1963010ef69c321531322d5a611f2b55c443d64e999d83af7ee74de10d7/68747470733a2f2f706f7365722e707567782e6f72672f64656272696c2f7273732d61746f6d2d62756e646c652f762f737461626c652e706e67)](https://packagist.org/packages/debril/rss-atom-bundle)[![Download Count](https://camo.githubusercontent.com/b379f8802b8931d8b59411dcbebe1beb9f111f1adc759d674712a0eff804f342/68747470733a2f2f706f7365722e707567782e6f72672f64656272696c2f7273732d61746f6d2d62756e646c652f642f746f74616c)](https://packagist.org/packages/debril/rss-atom-bundle)[![Build Status](https://camo.githubusercontent.com/8d53cac3e2f2d7784f708ac7debcdcaddd28acf6447c5caf775ae128e1b46b3e/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f616c657864656272696c2f7273732d61746f6d2d62756e646c652e706e673f6272616e63683d6d6173746572)](http://travis-ci.org/alexdebril/rss-atom-bundle)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/0b434330d5d1f309762214f033a1d3833278eecbf4a78697e7f79a375e6a9eb7/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f616c657864656272696c2f7273732d61746f6d2d62756e646c652f6261646765732f7175616c6974792d73636f72652e706e673f733d36653463633362393336386464626631346231303636313134623661663664393031313839346439)](https://scrutinizer-ci.com/g/alexdebril/rss-atom-bundle/)[![Code Coverage](https://camo.githubusercontent.com/9989a701b8c553a73515776c702a7df06308f7df688a58fbc9a864d7e1196a16/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f616c657864656272696c2f7273732d61746f6d2d62756e646c652f6261646765732f636f7665726167652e706e673f733d35626264313931663362393336346238633331643866313838316634633166643036383239666333)](https://scrutinizer-ci.com/g/alexdebril/rss-atom-bundle/)

RssAtomBundle is a Bundle for Symfony made to easily access and deliver JSON / RSS / Atom feeds. It is built on top of [feed-io](https://github.com/alexdebril/feed-io) and features:

- Detection of the feed format (JSON / RSS / Atom)
- enclosures support
- A generic StreamController built to write all your feeds. This controller is able to send a 304 HTTP Code if the feed didn't change since the last visit
- HTTP Headers support when reading feeds in order to save network traffic
- Content filtering to fetch only the newest items
- multiple feeds writing
- Ability to use doctrine as a data source
- PSR compliant logging
- DateTime detection and conversion
- Guzzle Client integration

Keep informed about new releases and incoming features :

You can try rss-atom-bundle through its [Demo](https://rss-atom-demo.herokuapp.com/).

Installation
------------

[](#installation)

### Dependencies

[](#dependencies)

As a Symfony Bundle, RssAtomBundle must be installed using Composer. If you do not know Composer, please refer to its website:

### Your application uses Symfony 3.3 or later

[](#your-application-uses-symfony-33-or-later)

Activate Symfony's [contrib recipes](https://github.com/symfony/recipes-contrib) and use Composer to require the bundle :

```
composer config extra.symfony.allow-contrib true
composer require debril/rss-atom-bundle
```

That's it. To check the installation, you can start your application and hit  in your browser. You should see a mock RSS stream.

### If your application uses Symfony &lt; 3.3

[](#if-your-application-uses-symfony--33)

Install the bundle using Composer :

```
composer require debril/rss-atom-bundle
```

Add the bundle's routing configuration in app/config/routing.yml :

```
rssatom:
    resource: "@DebrilRssAtomBundle/Resources/config/routing.yml"
```

Edit your app/AppKernel.php to register the bundle in the registerBundles() method as above:

```
class AppKernel extends Kernel
{

    public function registerBundles()
    {
        $bundles = array(
            new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
            // ...
            // register the bundle here
            new Debril\RssAtomBundle\DebrilRssAtomBundle(),
```

Usage
-----

[](#usage)

rss-atom-bundle is designed to read feeds across the internet and to publish your own using [feed-io](https://github.com/alexdebril/feed-io)feed-io provides two interfaces, each one being dedicated to feed's consuming and publishing :

- [FeedInterface](https://github.com/alexdebril/feed-io/blob/master/src/FeedIo/FeedInterface.php) to handle the feed
- [ItemInterface](https://github.com/alexdebril/feed-io/blob/master/src/FeedIo/Feed/ItemInterface.php) to handle feed's items

### Getting a FeedIo instance

[](#getting-a-feedio-instance)

You can fetch a `FeedIo\FeedIo` instance through dependency injection or the service container.

#### Dependency injection (highly recommended)

[](#dependency-injection-highly-recommended)

```
namespace App\Feed;

class Consumer
{

    /**
     * @type \FeedIo\FeedIo
     */
    private $feedIo;

    public function __construct(FeedIo $feedIo)
    {
        $this->feedIo = $feedIo;
    }
}
```

#### Service Container

[](#service-container)

Wherever you have access to the service container :

```
