<feed xmlns='http://www.w3.org/2005/Atom'>
<title>FreshRSS (Customized)/app/Services, branch 1.17.0</title>
<subtitle>Customized version of FreshRSS, a self-hosted RSS feed aggregator</subtitle>
<id>https://git.rdnlsmith.com/fresh-rss-custom/atom?h=1.17.0</id>
<link rel='self' href='https://git.rdnlsmith.com/fresh-rss-custom/atom?h=1.17.0'/>
<link rel='alternate' type='text/html' href='https://git.rdnlsmith.com/fresh-rss-custom/'/>
<updated>2020-06-13T17:36:24+00:00</updated>
<entry>
<title>tec: Refactor the export feature (#3045)</title>
<updated>2020-06-13T17:36:24+00:00</updated>
<author>
<name>Marien Fressinaud</name>
<email>dev@marienfressinaud.fr</email>
</author>
<published>2020-06-13T17:36:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rdnlsmith.com/fresh-rss-custom/commit/?id=15505a03779326f9497644e9827477cdcc26c2d2'/>
<id>urn:sha1:15505a03779326f9497644e9827477cdcc26c2d2</id>
<content type='text'>
Even if the issue #3035 seemed pretty simple at a first glance, it was
more complicated than I expected. Because we send CSP headers AFTER
running the controller actions, it means we can't "echo" any content
from the controller. It's in fact a good practice, but it was easier at
the time we developed the feature.

To fix that, the only thing I had to do was to move the `print()` and
`readfile()` function into the view. The problem was that we needed to
output the content from the CLI too. Then, things became more
complicated. I decided to extract the export-related methods in a
`FreshRSS_Export_Service` class, in order to use it from both the
controller and the CLI. It was an opportunity to refactor the whole
feature in order to make it a bit more linear and easy to read.

Reference: https://github.com/FreshRSS/FreshRSS/issues/3035</content>
</entry>
</feed>
