Skip to content

Latest commit

 

History

History
116 lines (79 loc) · 1.66 KB

UPGRADE-3.0.md

File metadata and controls

116 lines (79 loc) · 1.66 KB

UPGRADE FROM 2.x to 3.0

use feedio service instead of debril.reader

Replace

$reader = $this->container->get('debril.reader');

$feed = $reader->getFeedContent($url, $date);

With

$feedIo = $this->container->get('feedio');

$feed = $feedIo->readSince($url, $date)->getFeed();

use \FeedIo\Feed instead of \Protocol\FeedContent

Replace

use Debril\RssAtomBundle\Protocol\Parser\FeedContent;
$feed = new FeedContent();

With

use FeedIo\Feed;
$feed = new Feed();

use \FeedIo\FeedInterface instead of \Protocol\FeedInInterface and \Protocol\FeedOutInterface

Replace

use Debril\RssAtomBundle\Protocol\FeedOutInterface;
use Debril\RssAtomBundle\Protocol\FeedInInterface;

With

use FeedIo\FeedInterface;

\FeedIo\FeedInterface is an iterator

Replace

$items = $feed->getItems();
foreach ( $items as $item ) {
    echo $item->getTitle();
    // ...
}

With

foreach ( $feed as $item ) {
    echo $item->getTitle();
    // ...
}

use \FeedIo\ItemInterface instead of \Protocol\ItemInInterface and \Protocol\ItemOutInterface

Replace

use Debril\RssAtomBundle\Protocol\ItemOutInterface;
use Debril\RssAtomBundle\Protocol\ItemInInterface;

With

use FeedIo\Feed\ItemInterface;

ItemInterface::getLastModified() instead of ItemOutInterface::getUpdated()

$items = $feed->getItems();
foreach ( $items as $item ) {
    $date = $item->getUpdated();
    // ...
}
foreach ( $feed as $item ) {
    $date = $item->getLastModified();
    // ...
}

getAuthor() and getComment() are removed

use getElement($name) instead