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.
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.
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+.
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
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.
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.
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.load() in a guard) before pointing it at untrusted URLs, otherwise a slow or huge feed becomes a DoS vector.getItems() returns objects whose property names mirror the feed's XML tags, so consumers must be tolerant of missing fields. Always default: $item->description ?? ''.RockBeeRssBundle.php and the DI extension first — the whole bundle is usually a few dozen lines. Do not wait for upstream fixes.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.laminas/laminas-feed (or debril/feed-io) behind your own FeedReader interface. Do this before your Symfony version forces the issue.composer why-not rockbee/rss-bundle to diagnose; a fork with updated constraints is often faster than fighting resolution.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.How can I help you explore Laravel packages today?