aboutsummaryrefslogtreecommitdiff
path: root/app/Controllers/importExportController.php
AgeCommit message (Collapse)Author
2025-01-08Add some missing PHP native types (#7191)Gravatar Alexandre Alapetite
* Add some missing PHP native types Replaces https://github.com/FreshRSS/FreshRSS/pull/7184 * Clean some types
2024-12-27PHPStan 2.0 (#7131)Gravatar Alexandre Alapetite
* PHPStan 2.0 fix https://github.com/FreshRSS/FreshRSS/issues/6989 https://github.com/phpstan/phpstan/releases/tag/2.0.0 https://github.com/phpstan/phpstan/blob/2.0.x/UPGRADING.md * More * More * Done * fix i18n CLI * Restore a PHPStan Next test For work towards PHPStan Level 10 * 4 more on Level 10 * fix getTagsForEntry * API at Level 10 * More Level 10 * Finish Minz at Level 10 * Finish CLI at Level 10 * Finish Controllers at Level 10 * More Level 10 * More * Pass bleedingEdge * Clean PHPStan options and add TODOs * Level 10 for main config * More * Consitency array vs. list * Sanitize themes get_infos * Simplify TagDAO->getTagsForEntries() * Finish reportAnyTypeWideningInVarTag * Prepare checkBenevolentUnionTypes and checkImplicitMixed * Fixes * Refix * Another fix * Casing of __METHOD__ constant
2024-11-28Upgrade code to php 8.1 (#6748)Gravatar Luc SANCHEZ
* revert Fix code indentation Fix code Upgrade code to php 8.1 * fix remarques * code review * code review * code review * Apply suggestions from code review * code review * Fixes * Many remainging updates of array syntax * Lost case 'reading-list' * Uneeded PHPDoc --------- Co-authored-by: Luc Sanchez <l.sanchez-prestataire@alptis.fr> Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2024-10-23Web export SQLite (#6931)Gravatar Alexandre Alapetite
* Web export SQLite https://github.com/FreshRSS/FreshRSS/discussions/6930 * Implement download * Fix operator precedence * Set Last-Modified * Sort by time, newest first * Fix Last-Modified * Use DateTimeInterface::RFC7231 * Add not_applicable message
2024-09-11PHPStan booleansInConditions (#6793)Gravatar Alexandre Alapetite
* PHPStan booleansInConditions * Uniformisation
2024-09-09Better import Inoreader (#6791)Gravatar Alexandre Alapetite
fix https://github.com/FreshRSS/FreshRSS/discussions/6762
2024-09-06Upgrade to PHP 8.1 (#6711)Gravatar Alexandre Alapetite
* Upgrade to PHP 8.1 As discussed in https://github.com/FreshRSS/FreshRSS/discussions/5474 https://www.php.net/releases/8.0/en.php https://www.php.net/releases/8.1/en.php Upgrade to available native type declarations https://php.net/language.types.declarations Upgrade to https://phpunit.de/announcements/phpunit-10.html which requires PHP 8.1+ (good timing, as version 9 was not maintained anymore) Upgrade `:oldest` Docker dev image to oldest Alpine version supporting PHP 8.1: Alpine 3.16, which includes PHP 8.1.22. * Include 6736 https://github.com/FreshRSS/FreshRSS/pull/6736
2024-08-01Minor update whitespace PHPCS rules (#6666)Gravatar Alexandre Alapetite
* Minor update whitespace PHPCS rules To simplify our configuration, apply more rules, and be clearer about what is added or removed compared with PSR12. Does not change our current conventions, but just a bit more consistent. * Forgotten *.phtml * Sort exclusion patterns + add a few for Extensions repo * Relaxed some rules
2024-06-09Pass PHPStan level 9 (#6544)Gravatar Alexandre Alapetite
* More PHPStan * More, passing * 4 more files * Update to PHPStan 1.11.4 Needed for fixed bug: Consider numeric-string types after string concat https://github.com/phpstan/phpstan/releases/tag/1.11.4 * Pass PHPStan level 9 Start tracking booleansInConditions * Fix mark as read * Fix doctype * ctype_digit
2024-06-05Modernize code to php7.4 (#6043)Gravatar Luc SANCHEZ
* Modernize code to php7.4 * Modernize code to php7.4 * Modernize code to php7.4 * Modernize code to php7.4 * Modernize code to php7.4 * Modernize code to php7.4 * Modernize code to php7.4 * Modernize code to php7.4 * Modernize code to php7.4 * Modernize code to php7.4 * Modernize code to php7.4 * Modernize code to php7.4 * Modernize code to php7.4 * Consistency --------- Co-authored-by: Luc <sanchezluc+freshrss@gmail.com> Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2024-04-10PHP 8.3 #[\Override] (#6273)Gravatar Alexandre Alapetite
* PHP 8.3 #[\Override] https://php.watch/versions/8.3/override-attr With PHPStan `checkMissingOverrideMethodAttribute` https://phpstan.org/config-reference#checkmissingoverridemethodattribute And modified the call to phpstan-next on the model of https://github.com/FreshRSS/Extensions/pull/228 (more robust than the find method, which gave some strange errors) * Update extension example accordingly
2024-02-26New feature: shareable user query (#6052)Gravatar Alexandre Alapetite
* New feature: shareable user query Share the output of a user query by RSS / HTML / OPML with other people through unique URLs. Replaces the global admin token, which was the only option (but unsafe) to share RSS outputs with other people. Also add a new HTML output for people without an RSS reader. fix https://github.com/FreshRSS/FreshRSS/issues/3066#issuecomment-648977890 fix https://github.com/FreshRSS/FreshRSS/issues/3178#issuecomment-769435504 * Remove unused method * Fix token saving * Implement HTML view * Update i18n for master token * Revert i18n get_favorite * Fix missing i18n for user queries from before this PR * Remove irrelevant tests * Add link to RSS version * Fix getGet * Fix getState * Fix getSearch * Alternative getSearch * Default getOrder * Explicit default state * Fix test * Add OPML sharing * Remove many redundant SQL queries from original implementation of user queries * Fix article tags * Use default user settings * Prepare public search * Fixes * Allow user search on article tags * Implement user search * Revert filter bug * Revert wrong SQL left outer join change * Implement checkboxes * Safe check of OPML * Fix label * Remove RSS button to favour new sharing method That sharing button was using a global admin token * First version of HTTP 304 * Disallow some recusrivity fix https://github.com/FreshRSS/FreshRSS/issues/6086 * Draft of nav * Minor httpConditional * Add support for offset for pagination * Fix offset pagination * Fix explicit order ASC * Add documentation * Help links i18n * Note about deprecated master token * Typo * Doc about format
2023-12-18Pass PHPStan level 8 (#5946)Gravatar Alexandre Alapetite
* Pass PHPStan level 8 And prepare for PHPStan level 9 https://phpstan.org/user-guide/rule-levels * Revert wrong replace in comment * Fix PHPStan level 8 * Update PHPStan and other dev dependencies * Remove obsolete comment * noVariableVariables and towards bleedingEdge https://github.com/phpstan/phpstan-strict-rules https://phpstan.org/blog/what-is-bleeding-edge * More bleedingEdge * A bit more PHPStan level 9 * More PHPStan level 9 * Prepare for booleansInConditions Ignore int and null * Revert wrong line * More fixes * Fix keep_max_n_unread * Stricter attribute functions * Stricter callHooks and more PHPStan level 9 * More typing * A tiny more
2023-11-16Use strict_types (#5830)Gravatar Luc SANCHEZ
* Little's optimisations and booleans in conditions * Apply strict type * Apply strict type * Apply strict type * Fix multiple bugs with PHP 8.2 and 8.3 * Many declares missing, more errors fixed * Apply strict type * Another approach * Stronger typing for Minz_Session * Fix case of SQLite --------- Co-authored-by: Luc <sanchezluc+freshrss@gmail.com> Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2023-10-30Require PHP 7.4+ (#5720)Gravatar Alexandre Alapetite
* Require PHP 7.4+ https://github.com/FreshRSS/FreshRSS/discussions/5474 * Update Docker oldest Alpine 3.13 with PHP 7.4.26 * Add missing packets to Docker oldest * Update to typed properties https://php.net/migration74.new-features#migration74.new-features.core.typed-properties * More types
2023-10-22Do not update feeds after import (#5629)Gravatar robertdahlem
* Add checkbox to not update feeds after import to avoid duplicate feeds when importing multiple files. * Import without updating feeds, but now unconditionally * Added hint to click "Update feeds" to all translations * Update app/i18n/fr/feedback.php * Fix i18n --------- Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2023-09-27Test if set_time_limit exists (#5675)Gravatar VYSE V.E.O
* Fix @set_time_limit as @-operator after PHP8 no longer suppresses disabled functions * preserve @ decorator * Fix whitespace --------- Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2023-09-04Fix JSON export/import (#5626)Gravatar Alexandre Alapetite
* Fix import with empty content fix https://github.com/FreshRSS/FreshRSS/issues/5622 Cherry picks on https://github.com/FreshRSS/FreshRSS/pull/5584 * Fix export of tags / labels Article-defined tags were wrongly exported as user-defined labels. * Fix export of tags / labels Article-defined tags were wrongly exported as user-defined labels. * Fix bug with many labels * Better typing * Comments
2023-07-07Chore/processing of depreciations and updating code to php72 minimum (#5504)Gravatar Luc SANCHEZ
* processing of depreciations and updating of code to php7.2 minimum * Autoformat many strange array indenting And revert a few unwanted changes --------- Co-authored-by: Luc <sanchezluc+freshrss@gmail.com> Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2023-05-16Fix again updateLastSeenUnchanged (#5404)Gravatar Alexandre Alapetite
* Fix again updateLastSeenUnchanged https://github.com/FreshRSS/FreshRSS/pull/5382 was not good enough to fix markAsReadUponGone and introduced a regression in `entry.lastSeen`. New approach. Follow-up of https://github.com/FreshRSS/FreshRSS/pull/5315 * Minor change of mind * Fix handling of lastSeen entry.lastSeen was not always correctly initialised, and sometimes overriden
2023-05-04phpstan level 7 for importExportController.php (#5361)Gravatar Luc SANCHEZ
* phpstan level 7 for importExportController.php * Update app/Controllers/importExportController.php Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr> * Update app/Controllers/importExportController.php Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr> * Update app/Controllers/importExportController.php Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr> * Update app/Controllers/importExportController.php Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr> * phpstan level 7 for importExportController.php * phpstan level 7 for importExportController.php * phpstan level 7 for importExportController.php * A few edits --------- Co-authored-by: Luc <sanchezluc+freshrss@gmail.com> Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2023-04-17Complete PHPStan Level 6 (#5305)Gravatar Alexandre Alapetite
* Complete PHPStan Level 6 Fix https://github.com/FreshRSS/FreshRSS/issues/4112 And initiate PHPStan Level 7 * PHPStan Level 6 for tests * Use phpstan/phpstan-phpunit * Update to PHPStan version 1.10 * Fix mixed bug * Fix mixed return bug * Fix paginator bug * Fix FreshRSS_UserConfiguration * A couple more Minz_Configuration bug fixes * A few trivial PHPStan Level 7 fixes * A few more simple PHPStan Level 7 * More files passing PHPStan Level 7 Add interface to replace removed class from https://github.com/FreshRSS/FreshRSS/pull/5251 * A few more PHPStan Level 7 preparations * A few last details
2023-04-07Use typed access to request parameters (#5267)Gravatar Alexandre Alapetite
* Use typed access to request parameters This was a big source of mixed datatypes in many places * Fix notifications * Fix bookmarkAction
2023-03-26Modernize Constants and use new constant for string 'currentUser' (#5089)Gravatar Luc SANCHEZ
* Modernize Constants and use new constant 'currentUser' * Add FreshRSS_Context::currentUser() function and use * Add FreshRSS_Context::currentUser() function and use * Add FreshRSS_Context::currentUser() function and use * Add FreshRSS_Context::currentUser() function and use * Add FreshRSS_Context::currentUser() function and use * Update app/Controllers/userController.php * Update app/Controllers/userController.php * Update app/Controllers/userController.php * Update app/Models/Auth.php * Update p/api/greader.php * Update p/api/greader.php * Update p/api/greader.php * Update app/Models/Context.php * Update app/Models/LogDAO.php * Update lib/Minz/Log.php * Update p/api/greader.php * Update app/layout/header.phtml * Update app/views/helpers/export/articles.phtml * Update cli/do-install.php * Remarque's from Alkarex * Remarque's from Alkarex * Refactor using new Minz_User class * Consistent naming of public constants --------- Co-authored-by: Luc <sanchezluc+freshrss@gmail.com> Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2023-03-22Consistent entry ID type (32-bit compatibility) (#5213)Gravatar Alexandre Alapetite
* Remove FreshRSS_Searchable for better types The interface was not used, and it was preventing more precise types for the different `searchById()` methods, as they each have different input and output types. * Consistent entry ID Entry IDs (which are 64-bit integers) must be processed as string to be compatible with 32-bit platforms * Fix type * A few more related types * PHPStan level 6 * Some more casts needed * String cast for htmlspecialchars
2023-03-21Typehint some Controllers (#5106)Gravatar Luc SANCHEZ
* Typehint to Controllers * Remarque's from Alkarex * Remarque's from Alkarex * Remarque's from Alkarex * Remarque's from Alkarex * Remarque's from Alkarex * Remarque's from Alkarex --------- Co-authored-by: Luc <sanchezluc+freshrss@gmail.com>
2023-01-18tec: Update the lib_opml (#4403)Gravatar berumuron
* fix: Fix undefined GLOB_BRACE on Alpine The manual states that: > Note: The GLOB_BRACE flag is not available on some non GNU systems, > like Solaris or Alpine Linux. This generated an error on Alpine. Reference: https://www.php.net/manual/function.glob.php * fix: List details of feeds for OPML exportation The details are necessary to export the XPath information, the CSS full content path and read actions filters. * Update LibOpml to 0.4.0 * Refactor OPML importation to be more robust First, it fixes two regressions introduced by the update of lib_opml: - title attribute is used when text attribute is missing; - the OPML category attribute is used as a fallback for feeds categories. In a related way, if also fixes a problem when a feed had both a parent category outline and a category attribute. Before, it only considered the attribute as its category, but now it considers the parent outline. Then, it counts category limit correctly by not increasing `$nb_categories` if the category already exists. * Exclude lib_opml from the CodeSniffer * Fix variable names when logging some errors * Fix catch of LibOpml Exception * Make sure to declare the category * Exclude lib_opml from PHPStan analyze * Disable markdownlint for lib_opml * Fix typos * Use auto-loading and allow updates via Composer * Fix broken links to lib_opml * Bring back the ability to import the OPML frss:opmlUrl attribute * Refactor the logs of OPML errors * Update lib_opml to the version 0.5.0 Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2022-08-08Refactor entry-to-GReader API format (#4490)Gravatar Alexandre Alapetite
* Refactor entry to GReader API format Some code was copied in two locations and not completely uniform. Cleaning of related variables and functions (e.g. better types for entries and categories as objects vs. as IDs). Usecase: I need to call the same GReader-compatible serialization from an extension * Fixed some edge cases * Keep summary instead of content `summary` and `content` seems to be used interchangeably in the Google Reader API. We have been using `summary` for our client API and `content` in our export/import, so stick to that.
2022-07-19Add database field attributes for entries (#4444)Gravatar Alexandre Alapetite
* Add database field attributes for entries Just like we already have for categories, feeds, etc. No core use yet, but allows in particular extensions to save per-entry data * Fix PHPStand * Fix wrong variable
2022-07-04Dynamic OPML (#4407)Gravatar Alexandre Alapetite
* Dynamic OPML draft #fix https://github.com/FreshRSS/FreshRSS/issues/4191 * Export dynamic OPML http://opml.org/spec2.opml#1629043127000 * Restart with simpler approach * Minor revert * Export dynamic OPML also for single feeds * Special category type for importing dynamic OPML * Parameter for excludeMutedFeeds * Details * More draft * i18n * Fix update * Draft manual import working * Working manual refresh * Draft automatic update * Working Web refresh + fixes * Import/export dynamic OPML settings * Annoying numerous lines in SQL logs * Fix minor JavaScript error * Fix auto adding new columns * Add require * Add missing 🗲 * Missing space * Disable adding new feeds to dynamic categories * Link from import * i18n typo * Improve theme icon function * Fix pink-dark
2022-02-01Compat import JSON milliseconds (#4186)Gravatar Alexandre Alapetite
#fix https://github.com/FreshRSS/FreshRSS/issues/4185
2022-01-08Use typographic quotes (#4133)Gravatar Alexandre Alapetite
* Use typographic quotes * A few fixes * Fix * Fix not saved * Implement feedback * Detail * Revert spoken English fixes Left for a future dedicated discussion * More reverts * Final reverts * Final minor
2022-01-08Fix various typos and spelling errors in documentation, comments and code. ↵Gravatar Thomas Renes
(#4134)
2022-01-07Optimise Minz_ModelPdo::class (#4119)Gravatar Luc SANCHEZ
* - Fix typo, - remove unnecessary null in property, - remove unused property, - add phpDoc, - add ext PDO in composer.json, - use strict comparison, - indentation * Translate * Update lib/Minz/ModelPdo.php Co-authored-by: Frans de Jonge <fransdejonge@gmail.com> * The code is more explicite * Fix phpstan * Fix phpstan expect one * Fix phpstan * Return in back... * make fix-all * Fix exception and more types * Fix more types * Remove ext- in composer.json Co-authored-by: Luc SANCHEZ <l.sanchez-ext@ubitransport.com> Co-authored-by: Frans de Jonge <fransdejonge@gmail.com> Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2022-01-04PHPStan level 5 (#4110)Gravatar Alexandre Alapetite
* Fix most PHPDocs errors Contributes to https://github.com/FreshRSS/FreshRSS/issues/4103 https://phpstan.org/writing-php-code/phpdoc-types * Avoid func_get_args Use variadic syntax instead https://php.net/manual/functions.arguments#functions.variable-arg-list And avoid dynamic functions names when possible to more easily identify calls and unused functions. Contributes to https://github.com/FreshRSS/FreshRSS/issues/4103 * PHPStan level 3 * PHPStand level 4 * Update default to PHPStan level 4 * Towards level 5 * Fix level 4 regression * Towards level 5 * Pass PHPStan level 5 * Towards level 6 * Remove erronenous regression from changelog https://github.com/FreshRSS/FreshRSS/pull/4116
2021-12-31Add PHPStan (#4021)Gravatar Alexandre Alapetite
* Add PHPStan #fix https://github.com/FreshRSS/FreshRSS/issues/4016 https://phpstan.org/ ```sh composer run-script phpstan ``` * More fixes * Fix global variables * Add .phtml * Fix merge https://github.com/FreshRSS/FreshRSS/pull/4090 * Fix more warnings * Fix view errors and enable in CI * ReturnTypeWillChange * Dynamic view type * Fix Minz static/self bug
2021-03-24Fix TT-RSS import (#3553)Gravatar Alexandre Alapetite
2021-02-28Travis: Enforce phpcs line length + whitespace (#3488)Gravatar Alexandre Alapetite
* Update Travis line length * Also check whitespace in CSS files * Fix line length ext.php * More syntax, string templates * Fix exclude-pattern * Test JS files as well
2021-02-21Change zip handling methods (#3470)Gravatar Alexis Degrugillier
Before, we were using zip function but they are marked as deprecated as of PHP 8.0. It's not safe to use them anymore since they can be removed at any given time. Now, we are using the ZipArchive class to handle our zip methods. It's safe to use it since it's available for PHP 5.2 and higher. See #3460
2021-02-06API implement OPML import/export (#3424)Gravatar Alexandre Alapetite
#fix https://github.com/FreshRSS/FreshRSS/issues/3421
2020-12-26Better OPML import of feeds in multiple categories (#3286)Gravatar Alexandre Alapetite
#fix https://github.com/FreshRSS/FreshRSS/issues/3284 Helps https://github.com/FreshRSS/FreshRSS/issues/1989 In OPMLs files in which feeds are listed several times, favour the version in a category instead of in no category.
2020-06-13tec: Refactor the export feature (#3045)Gravatar Marien Fressinaud
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
2020-04-30Fix filenames for files exported with CLI (#2932)Gravatar Marien Fressinaud
Filenames were created with the username of the current user. However, when we export the files with the CLI, the current user is "_". This commit makes the username always required in the `exportFile` method so we make sure to always manipulate a real value. Consequently, the filenames can be formatted correctly. Obviously, this has absolutely no impacts since the CLI doesn't consider the HTTP headers. It just makes things a bit more clear. It's a first step to remove the concept of "default user".
2019-10-08Increase import size (#2563)Gravatar Alexandre Alapetite
* Increase import size This is merely a temporary workaround to allow at least some medium size imports https://framateam.org/freshrss/pl/7wbt4tcyetrfmris9xdcbq7uuw The import module should be rewritten to process files one by one and as data streams instead of loading multiple copies of the whole dataset in memory as is the case now :-( https://github.com/FreshRSS/FreshRSS/issues/1890 Note that the new SQLite export/import is distinct from this case. * Use parameter
2019-09-15CLI to export/import any database to/from SQLite (#2496)Gravatar Alexandre Alapetite
* CLI to export/import any database to/from SQLite Require PHP 5.5+ https://github.com/FreshRSS/FreshRSS/pull/2495 * Travis * Execution rights * Fix wrong static fields * Fix MySQL bad default buffering https://stackoverflow.com/questions/6895098/pdo-mysql-memory-consumption-with-large-result-set/6935271#6935271 https://php.net/manual/ref.pdo-mysql * Fix count on progression * Avoid static DB information To ease working with two DBs at the same time * Less static, simplify Needs some testing * Small corrections * Special case for SQLite to SQLite * Modify special case for SQLite * Remove special case for SQLite More uniform logic for the 3 databases. Fix wrong DROP TABLE for SQLite. * Drop indexes * Revert "Drop indexes" This reverts commit f28d2bae0935745c1c74ea38f2ee083f3fd4bf9d. * Fix deletion * Fix classic export * Update cli/README.md Co-Authored-By: Marien Fressinaud <dev@marienfressinaud.fr> * Addressing part of review * Remove goto :cry: * Travis * Comment for SQLite case * Fix missing fields when inserting
2019-08-02Allow to change the view layout (#2467)Gravatar Marien Fressinaud
The `_useLayout` function is marked as deprecated, replaced by a more powerful `_layout` function.
2019-03-19No old ID (#2276)Gravatar Alexandre Alapetite
* No old ID https://github.com/FreshRSS/FreshRSS/issues/2273 * PostgreSQL insert or ignore
2019-01-26Import FeedBin (#2228)Gravatar Alexandre Alapetite
* Import FeedBin https://github.com/FreshRSS/FreshRSS/issues/2227 And more tolerant import * Mute import fake feed + Changelog * strtotime for published dates in string
2019-01-24Export/import articles read/unread state (#2226)Gravatar Alexandre Alapetite
2019-01-24Fix import labels (#2225)Gravatar Alexandre Alapetite
All labelled articles were wrongly marked as starred.