Download the PHP package debril/rss-atom-bundle without Composer

On this page you can find all versions of the php package debril/rss-atom-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package rss-atom-bundle

RssAtomBundle - Read and Build Atom/RSS feeds

SensioLabsInsight Latest Stable Version Download Count Build Status Scrutinizer Code Quality Code Coverage

RssAtomBundle is a Bundle for Symfony made to easily access and deliver JSON / RSS / Atom feeds. It is built on top of feed-io and features:

Keep informed about new releases and incoming features : http://debril.org/category/rss-atom-bundle

You can try rss-atom-bundle through its Demo.

Installation

Dependencies

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

Your application uses Symfony 3.3 or later

Activate Symfony's contrib recipes and use Composer to require the bundle :

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

If your application uses Symfony < 3.3

Install the bundle using Composer :

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

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

Usage

rss-atom-bundle is designed to read feeds across the internet and to publish your own using feed-io feed-io provides two interfaces, each one being dedicated to feed's consuming and publishing :

Getting a FeedIo instance

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

Dependency injection (highly recommended)

Service Container

Wherever you have access to the service container :

Feed Reading

To read a feed you need to use the feedio service which provides two methods for that : read() and readSince(). This service is based upon FeedIo.

using read()

read() is designed to give a brand new Feed instance or any object of your own, as long as it implements the FeedInterface interface. It takes three arguments :

With a \FeedIo\FeedIo instance called $feedIo :

read() fetches the feed hosted at $url and removes items prior to $modifiedSince. If it is the first time you read this feed, then you must specify a date far enough in the past to keep all the items. This method does not loop until the $modifiedSince is reached, it justs performs one hit and filters the response to keep only the fresh articles.

using readSince()

readSince() helps you get a \FeedIo\Feed without creating its instance :

Providing feeds

RssAtomBundle offers the ability to provide JSON/RSS/Atom feeds. The route will match the following pattern : /{format}/{contentId}

The request will be handled by StreamController, according to the following steps :

Defining you own provider

You must give to RssAtomBundle the content you want it to display in the feed. For that, two steps :

FeedContentProviderInterface implementation

Your class just needs to implement the Debril\RssAtomBundle\Provider\FeedProviderInterface interface, for instance :

StreamController expects the getFeed()'s return value to be a FeedIo\FeedInterface instance. It can be a FeedIo\Feed or a class of your own and if so, your class MUST implement \FeedIo\FeedInterface.

You can also start from this class to save some time : App\Feed\Provider.php

configuration

Now, you need to configure the debril.rss_atom.provider service with the provider's class in your project's services.yml :

Or, if you need to build it with arguments, you can override debril.rss_atom.provider's declaration :

That's it. Go to http://localhost:8000/atom, it should display your feed.

Make the StreamController answer with a 404

If the reclaimed feed does not exist, you just need to throw a FeedNotFoundException to make the StreamController answer with a 404 error. Otherwise, getFeedContent(Options $options) must return a \FeedIo\FeedInterface instance. Then, the controller properly turns the object into a XML stream.

More information on the FeedContentProviderInterface interface and how to interface rss-atom-bundle directly with doctrine can be found in the Providing Feeds section

Useful Tips

Skipping 304 HTTP Code

The HTTP cache handling can be annoying during development process, you can skip it through configuration in your app/config/config.yml file :

This way, the StreamController will always display your feed's content and return a 200 HTTP code.

Private feeds

You may have private feeds, user-specific or behind some authentication.
In that case, you don't want to Cache-Control: public header to be added, not to have your feed cached by a reverse-proxy (such as Symfony AppCache or Varnish).
You can do so by setting private parameter to true in config:

Adding non-standard date formats

Some feeds use date formats which are not compliant with the specifications. You can fix this by adding the format in your configuration

Using custom Content Type header for feed generation

If you need to customize the Content-Type header of your feed you can specify the value in your configuration

Going back to feed-io 3.0

Starting from version 4.1 rss-atom-bundle comes with feed-io 4 if your application depends on PHP 7.1+. If you need to use feed-io 3 instead for some reason, you can do it in composer.json :

Override tip

It could happen that according to the order of the bundles registered in AppKernel, this override procedures do not work properly. This happens when a bundle is registered before rss-atom-bundle. In this case, you should use the Symfony CompilerPass as reported in the documentation.

Vendor/Bundle/VendorBundle.php:

and Vendor/Bundle/DependencyInjection/Compiler/OverrideRssAtomBundleProviderCompilerPass.php:

You can follow either services.xml or CompilerPass but with services, you have to pay attention to bundles registration order.

Fetching the repository

Do this if you want to contribute (and you're welcome to do so):

git clone https://github.com/alexdebril/rss-atom-bundle.git

composer.phar install --dev

Unit Testing

You can run the unit test suites using the following command in the Bundle's source director:

bin/phpunit

All versions of rss-atom-bundle with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1
symfony/config Version ~3.4|~4.0|^5.0|^6.0|^7.0
symfony/http-foundation Version ~3.4|~4.0|^5.0|^6.0|^7.0
symfony/http-kernel Version ~3.4|~4.0|^5.0|^6.0|^7.0
symfony/dependency-injection Version ~3.4|~4.0|^5.0|^6.0|^7.0
debril/feed-io Version ~3.0|~4.0|~5.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package debril/rss-atom-bundle contains the following files

Loading the files please wait ....