Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Rss Bundle Laravel Package

rockbee/rss-bundle

Rockbee RSS Bundle is a PHP/Symfony package for reading, parsing, and rendering RSS and Atom feeds. It simplifies fetching feed items, normalizing content, and exposing feeds to templates or APIs with minimal configuration.

View on GitHub
Deep Wiki
Context7

Getting Started

This bundle is a thin Symfony2 wrapper around a standalone RSS-PHP library — it does not implement feed parsing or generation itself, so treat it as a service-registration layer, not a full-featured feed solution.

  1. Install and register. Require it via Composer, then add the bundle to app/AppKernel.php:

    new RockBee\RssBundle\RockBeeRssBundle(),
    

    Because the package is old (Symfony2-era, zero dependents, no documentation), expect to pin symfony/* constraints or alias the bundle namespace if you are on Symfony 3+.

  2. Find the service before writing code. Open vendor/rockbee/rss-bundle/Resources/config/services.xml and read it alongside DependencyInjection/Configuration.php. This is the single most important step — there is no README worth trusting, and the service ID plus any config key (source URL, cache path, timeout) only exist there. Confirm with:

    php app/console container:debug | grep -i rss
    
  3. First use case: render an external feed. Inject the bundle service into a controller, fetch a remote feed, and pass the parsed items to Twig:

    public function newsAction()
    {
        $feed = $this->get('rockbee.rss')->load('https://example.com/feed.xml');
        return $this->render('AppBundle:News:list.html.twig', ['items' => $feed->getItems()]);
    }
    

If the service only exposes the raw library class, skip the bundle entirely and instantiate the underlying RSS class directly — you lose nothing.

Implementation Patterns

Wrap it in your own service. Never call the bundle service from controllers or templates directly. Create an AppBundle\Feed\FeedReader that depends on the bundle service, normalizes items into your own DTOs, and is the only thing your app knows about. This isolates the abandoned dependency so you can swap it for laminas/laminas-feed later without touching call sites.

class FeedReader
{
    private $rss;
    public function __construct($rss) { $this->rss = $rss; }

    public function latest($url, $limit = 10)
    {
        $feed = $this->rss->load($url);
        $items = array_slice($feed->getItems(), 0, $limit);
        return array_map(fn($i) => FeedItem::fromRssPhp($i), $items);
    }
}

Cache aggressively. The bundle has no caching layer, and load() performs a blocking HTTP request. Cache the normalized item array in your app's cache pool for 5–15 minutes, keyed by feed URL. On cache miss, catch exceptions and fall back to the last-known-good copy (store that separately with a long TTL) so a dead third-party feed never takes down your page.

Feed generation. RSS-PHP supports the write side as well. Build a controller that assembles items from your entities, hands them to the library, and returns a Response with Content-Type: application/rss+xml. Register a route like /feed.xml and emit an absolute <link> / <guid> per item — relative URLs silently break most readers.

Console command for warm-up. Add a app:feed:refresh command that iterates every configured feed URL and populates the cache. Schedule it via cron or a periodic Symfony command so user requests are always served from cache and never block on a third party.

Twig presentation. Register a small Twig extension for date formatting and HTML sanitization — feed content is untrusted and often contains raw markup. Use |striptags or a proper sanitizer; do not pipe feed descriptions through |raw.

Gotchas and Tips

  • It is a Symfony2 bundle. This is the biggest pitfall. Symfony 3+ deprecates much of what it assumes; Symfony 4+ eliminates bundles-that-only-register-services. In modern Symfony you can still require the package, but it is usually cleaner to require the underlying RSS-PHP library and define one service in config/services.yaml yourself. Then the bundle's existence — and its age — stops mattering.
  • Parsing is synchronous and uncapped. There is no timeout or size limit configured out of the box. Set a timeout on the transport (or wrap load() in a guard) before pointing it at untrusted URLs, otherwise a slow or huge feed becomes a DoS vector.
  • XML security. Confirm the underlying RSS-PHP version disables external entity expansion. Old parsers were vulnerable to XXE and billion-laughs attacks. If you cannot verify it, do not feed untrusted input to it.
  • Namespace and Atom support is uneven. RSS-PHP handles basic RSS 2.0 well; Atom and namespaced extensions (Dublin Core, Media RSS, georss) may be dropped silently. Test each real feed URL you intend to consume, not just one sample.
  • Item field names are inconsistent. getItems() returns objects whose property names mirror the feed's XML tags, so consumers must be tolerant of missing fields. Always default: $item->description ?? ''.
  • No dependents means no community answers. When you hit a bug, the bundle repository is your only source. Read RockBeeRssBundle.php and the DI extension first — the whole bundle is usually a few dozen lines. Do not wait for upstream fixes.
  • Extension points. You can override the bundle's service definition in your config.yml (services:) or by using a compiler pass to decorate it. This is the safest way to inject a caching decorator or a custom HTTP client without forking.
  • Migration plan. Because the wrapper adds no value beyond a container registration, plan to replace it with laminas/laminas-feed (or debril/feed-io) behind your own FeedReader interface. Do this before your Symfony version forces the issue.
  • Composer conflicts. The library may bundle or reference old dependencies (Guzzle, XML extensions) that clash with your app. Use composer why-not rockbee/rss-bundle to diagnose; a fork with updated constraints is often faster than fighting resolution.
  • Debugging. If a feed "returns nothing," check in this order: HTTP status via a raw curl, the parsed item count, then field names in one item with var_dump. The failure is almost always a 403 from a feed provider blocking your User-Agent, not a parsing bug.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
elsayed85/laravel-api-exceptions
ouhssini/laravel-demo-mode
daworks/ncloud-outbound-mailer-driver
gp247/cms
ignibyte/aic-gates
nexa-merchant/blog
novasa/laravel-language-center
opencage/geocode
adolfoholzer/parameters
livenetworks/ln-starter
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
cgv/localized-resource