diff --git a/app/Http/Controllers/FeedController.php b/app/Http/Controllers/FeedController.php deleted file mode 100644 index 600a1af2e8e3..000000000000 --- a/app/Http/Controllers/FeedController.php +++ /dev/null @@ -1,124 +0,0 @@ - - */ -class FeedController extends Controller -{ - /** - * Feed facade. - * - * @var \Roumen\Feed\Feed - */ - protected $feed; - - /** - * Create a new feed controller instance. - * - * @return void - */ - public function __construct(Feed $feed) - { - $this->feed = $feed; - $this->feed->title = Config::get('setting.app_name'); - $this->feed->description = trans('cachet.feed'); - $this->feed->link = Str::canonicalize(Config::get('setting.app_domain')); - $this->feed->ctype = 'text/xml'; - $this->feed->setDateFormat('datetime'); - } - - /** - * Generates an Atom feed of all incidents. - * - * @param \CachetHQ\Cachet\Models\ComponentGroup|null $group - * - * @return \Illuminate\Http\Response - */ - public function atomAction(ComponentGroup $group = null) - { - return $this->feedAction($group, false); - } - - /** - * Generates a Rss feed of all incidents. - * - * @param \CachetHQ\Cachet\Models\ComponentGroup|null $group - * - * @return \Illuminate\Http\Response - */ - public function rssAction(ComponentGroup $group = null) - { - $this->feed->lang = Config::get('setting.app_locale'); - - return $this->feedAction($group, true); - } - - /** - * Generates a Rss feed of all incidents. - * - * @param \CachetHQ\Cachet\Models\ComponentGroup|null $group - * @param bool $isRss - * - * @return \Illuminate\Http\Response - */ - private function feedAction(ComponentGroup $group = null, $isRss = true) - { - if ($group) { - $group->components->map(function ($component) use ($isRss) { - $component->incidents()->visible()->orderBy('occurred_at', 'desc')->get()->map(function ($incident) use ($isRss) { - $this->feedAddItem($incident, $isRss); - }); - }); - } else { - Incident::visible()->orderBy('occurred_at', 'desc')->get()->map(function ($incident) use ($isRss) { - $this->feedAddItem($incident, $isRss); - }); - } - - return $this->feed->render($isRss ? 'rss' : 'atom'); - } - - /** - * Adds an item to the feed. - * - * @param \CachetHQ\Cachet\Models\Incident $incident - * @param bool $isRss - */ - private function feedAddItem(Incident $incident, $isRss) - { - $incident = AutoPresenter::decorate($incident); - - $this->feed->add( - $incident->name, - Config::get('setting.app_name'), - Str::canonicalize(cachet_route('incident', [$incident->id])), - $isRss ? $incident->getWrappedObject()->occurred_at->toRssString() : $incident->getWrappedObject()->occurred_at->toAtomString(), - Markdown::convertToHtml($incident->message), - null, - [], - $isRss ? $incident->human_status : null - ); - } -} diff --git a/app/Http/Routes/FeedRoutes.php b/app/Http/Routes/FeedRoutes.php deleted file mode 100644 index 2a4f930efd7f..000000000000 --- a/app/Http/Routes/FeedRoutes.php +++ /dev/null @@ -1,53 +0,0 @@ - - */ -class FeedRoutes -{ - /** - * Defines if these routes are for the browser. - * - * @var bool - */ - public static $browser = true; - - /** - * Define the status page routes. - * - * @param \Illuminate\Contracts\Routing\Registrar $router - * - * @return void - */ - public function map(Registrar $router) - { - $router->group([ - 'middleware' => ['ready'], - ], function (Registrar $router) { - $router->get('/atom/{component_group?}', [ - 'as' => 'get:feed.atom', - 'uses' => 'FeedController@atomAction', - ]); - - $router->get('/rss/{component_group?}', [ - 'as' => 'get:feed.rss', - 'uses' => 'FeedController@rssAction', - ]); - }); - } -} diff --git a/composer.json b/composer.json index ea0c5969deb6..4dcbb9ce7ce0 100644 --- a/composer.json +++ b/composer.json @@ -55,7 +55,6 @@ "nexmo/client": "^1.5", "pragmarx/google2fa": "^0.7.1", "predis/predis": "^1.1", - "roumen/feed": "^2.10", "twig/twig": "^1.35" }, "require-dev": { diff --git a/config/app.php b/config/app.php index 40636c40d1b0..3ca795a70e86 100644 --- a/config/app.php +++ b/config/app.php @@ -187,7 +187,6 @@ Laravolt\Avatar\ServiceProvider::class, McCool\LaravelAutoPresenter\AutoPresenterServiceProvider::class, PragmaRX\Google2FA\Vendor\Laravel\ServiceProvider::class, - Roumen\Feed\FeedServiceProvider::class, /* * Application Service Providers... diff --git a/resources/views/layout/master.blade.php b/resources/views/layout/master.blade.php index 8278704dc62a..c77e725984df 100644 --- a/resources/views/layout/master.blade.php +++ b/resources/views/layout/master.blade.php @@ -7,9 +7,6 @@ - - - diff --git a/resources/views/partials/footer.blade.php b/resources/views/partials/footer.blade.php index bee52e98062f..12601f9874cd 100644 --- a/resources/views/partials/footer.blade.php +++ b/resources/views/partials/footer.blade.php @@ -26,12 +26,6 @@ {{ trans('dashboard.logout') }} @endif -
  • - {{ trans('cachet.rss-feed') }} -
  • -
  • - {{ trans('cachet.atom-feed') }} -
  • @if($enableSubscribers)
  • {{ trans('cachet.subscriber.button') }} diff --git a/resources/views/vendor/feed/atom.blade.php b/resources/views/vendor/feed/atom.blade.php deleted file mode 100644 index 78bffe8f82ca..000000000000 --- a/resources/views/vendor/feed/atom.blade.php +++ /dev/null @@ -1,29 +0,0 @@ -{!! '<'.'?'.'xml version="1.0" encoding="UTF-8" ?>' !!} -> - {!! $channel['title'] !!} - - - {{ $channel['link'] }} - - -@if (!empty($channel['logo'])) - {{ $channel['logo'] }} -@endif -@if (!empty($channel['icon'])) - {{ $channel['icon'] }} -@endif - {{ $channel['pubdate'] }} -@foreach($items as $item) - - - {{ $item['author'] }} - - <![CDATA[{!! $item['title'] !!}]]> - - {{ $item['link'] }} - - - {{ $item['pubdate'] }} - -@endforeach - diff --git a/resources/views/vendor/feed/rss.blade.php b/resources/views/vendor/feed/rss.blade.php deleted file mode 100644 index 812e9cd5f5da..000000000000 --- a/resources/views/vendor/feed/rss.blade.php +++ /dev/null @@ -1,89 +0,0 @@ -{!! '<'.'?'.'xml version="1.0" encoding="UTF-8" ?>' !!} -> - - {!! $channel['title'] !!} - {{ Request::url() }} - - - @if (!empty($channel['copyright'])) - {{ $channel['copyright'] }} - @endif - @if (!empty($channel['color'])) - {{ $channel['color'] }} - @endif - @if (!empty($channel['cover'])) - - @endif - @if (!empty($channel['icon'])) - {{ $channel['icon'] }} - @endif - @if (!empty($channel['logo'])) - {{ $channel['logo'] }} - - {{ $channel['logo'] }} - {{ $channel['title'] }} - {{ Request::url() }} - - @endif - @if (!empty($channel['related'])) - - @endif - @if (!empty($channel['ga'])) - - @endif - {{ $channel['lang'] }} - {{ $channel['pubdate'] }} - @foreach($items as $item) - - <![CDATA[{!! $item['title'] !!}]]> - @if (!empty($item['category'])) - {{ $item['category'] }} - @endif - {{ $item['link'] }} - {{ $item['link'] }} - - @if (!empty($item['content'])) - - @endif - {{ $item['author'] }} - {{ $item['pubdate'] }} - @if (!empty($item['enclosure'])) - $v) - {!! $k.'="'.$v.'" ' !!} - @endforeach - /> - @endif - @if (!empty($item['media:content'])) - $v) - {!! $k.'="'.$v.'" ' !!} - @endforeach - /> - @endif - @if (!empty($item['media:thumbnail'])) - $v) - {!! $k.'="'.$v.'" ' !!} - @endforeach - /> - @endif - @if (!empty($item['media:title'])) - {{ $item['media:title'] }} - @endif - @if (!empty($item['media:description'])) - {{ $item['media:description'] }} - @endif - @if (!empty($item['media:keywords'])) - {{ $item['media:title'] }} - @endif - @if (!empty($item['media:rating'])) - {{ $item['media:rating'] }} - @endif - @if (!empty($item['creativeCommons:license'])) - {{ $item['creativeCommons:license'] }} - @endif - - @endforeach - - diff --git a/tests/Foundation/Providers/RouteServiceProviderTest.php b/tests/Foundation/Providers/RouteServiceProviderTest.php index f88f03f8b60c..ffd727aaf352 100644 --- a/tests/Foundation/Providers/RouteServiceProviderTest.php +++ b/tests/Foundation/Providers/RouteServiceProviderTest.php @@ -126,8 +126,6 @@ public function testWhenAlwaysAuthenticateIsEnabledAllNormalRoutesAreAuthenticat 'core::get:schedule', 'core::get:metric', 'core::get:component_shield', - 'core::get:feed.atom', - 'core::get:feed.rss', 'core::get:subscribe', 'core::post:subscribe', 'core::get:subscribe.manage', @@ -151,8 +149,6 @@ public function testWhenAlwaysAuthenticateIsDisabledAllNormalRoutesAreUnauthenti 'core::get:schedule', 'core::get:metric', 'core::get:component_shield', - 'core::get:feed.atom', - 'core::get:feed.rss', 'core::get:subscribe', 'core::post:subscribe', 'core::get:subscribe.manage',