aboutsummaryrefslogtreecommitdiff
path: root/app/Controllers/importExportController.php
AgeCommit message (Collapse)Author
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.
2019-01-16Export labels (#2217)Gravatar Alexandre Alapetite
* Export labels https://github.com/FreshRSS/FreshRSS/issues/2196 * Small fixes * Backport code from 1.14.0 https://github.com/FreshRSS/FreshRSS/pull/2199/commits/4888f919f104b2d170302565e481a0b731eb4145 * More fixes
2018-11-18PHP 7.1 tempnam warning fix (#2134)Gravatar Alexandre Alapetite
And suggested dir was wrong. https://bugs.php.net/bug.php?id=69489 ``` <b>Notice</b>: tempnam(): file created in the system's temporary directory in <b>/var/www/html/FreshRSS/app/Controllers/importExportController.php</b> on line <b>800</b><br /> ```
2018-11-18Add username in configuration menu and exports (#2133)Gravatar Alexandre Alapetite
* Add username in configuration menu https://github.com/FreshRSS/FreshRSS/pull/2099#issuecomment-435944803 * Add username to exported files
2018-11-05TT-RSS import (#2099)Gravatar Alexandre Alapetite
* TT-RSS import Import of Tiny Tiny RSS favourites https://github.com/FreshRSS/FreshRSS/issues/2018#issuecomment-432710462 * Fallback feed_url * Simpler JSON * TT-RSS import custom labels * Fix syntax
2018-05-28Fix import: invalid variable scope (#1901)Gravatar Alexandre Alapetite
* Fix import: invalid variable scope https://github.com/FreshRSS/FreshRSS/issues/1890 https://github.com/FreshRSS/FreshRSS/pull/1315 * Changelog 1890 https://github.com/FreshRSS/FreshRSS/issues/1890 https://github.com/FreshRSS/FreshRSS/pull/1901
2017-09-23Fix SQL constraint insert into entrytmp tableGravatar Alexandre Alapetite
https://github.com/FreshRSS/FreshRSS/issues/1614
2017-09-22[ci] Add Travis (#1619)Gravatar Frans de Jonge
* [ci] Add Travis * Exclude some libs * Semi-auto whitespace fixes * line length in SQLite * Exclude tests from line length * Feed.php line length * Feed.php: get rid of unnecessary concat * Feed.php: line length * bootstrap.php: no newline at end of file * Allow concatenating across multiple lines * Add Travis badge * do-install line length * update-or-create-user line length * cli/create-user line length * tests/app/Models/SearchTest.php fix indentation * tests/app/Models/UserQueryTest.php fix indentation * tests/app/Models/CategoryTest.php fix indentation * [fix] PHP 5.3 on precise * cli/do-install no spaces * cli/list-users line length * cli/reconfigure line length * empty catch statements * api/index line length nonsense * spaces before semicolon * app/Models/EntryDAO bunch of indentation * extra blank lines * spaces before comma in function call * testing tabwidth * increase to 10 * comment out tabwidth line * try older phpcs version 3.0.0RC4 * line length exception for app/install.php * proper spaces * stray spaces in i18n * Minz/ModelPdo line length * Minz whitespace * greader line length * greader elseif placement * app/Models/Feed.php spacing in function argument * ignore php 5.3 * app/Models/ConfigurationSetter.php stray whitespace * EntryDAOSQLite line length * I vote for higher max line length =P * ignore SQL * remove classname complaint * line length/more legible SQL * ignore line length nonsense * greader line length * feedController issues * uppercase TRUE, FALSE, NULL * revert * importExportController lowercase null * Share.php default value not necessary because ! is_array () a few lines down * CategoryDAO constants should be UPPERCASE * EntryDAO reduce line length * contentious autofix * Allow failures on all versions of PHP except 7.1 because reasons
2017-03-27More defered insertionGravatar Alexandre Alapetite
2017-03-26Merge branch 'FreshRSS/dev' into defered-insertionGravatar Alexandre Alapetite
2017-03-26PDO fix PHP 7.1Gravatar Alexandre Alapetite
http://php.net/manual/migration71.changed-functions.php#migration71.changed-functions.pdo
2017-03-26Candidate implementation of defered insertionGravatar Alexandre Alapetite
https://github.com/FreshRSS/FreshRSS/issues/530
2016-11-15Function to disable MySQL buffering for large exportsGravatar Alexandre Alapetite