Commit graph

189 commits

Author SHA1 Message Date
f51152980c Introduce abstract class for result sets
Most of the SQLite3 Result class' methods are fully generic, so it should be helpful for future result sets
2017-11-05 22:28:19 -05:00
9304f99032 Make result sets single-use; change savewepoint exceptions
- Result sets are now single-use; this is required for PDO drivers (PDO result sets are not rewindable)
- Change savepoint exceptions to be simple database exceptions; codes remain the same
2017-11-05 22:13:44 -05:00
65963f228f CS fixes 2017-10-20 18:41:21 -04:00
f690bbb3a9 Alias Date::normalize to ValueInfo::normalize 2017-10-19 22:39:39 -04:00
d45401fb8b Adapt NCN to new type converter
This has the side-effect of removing the ability to reset a feed's title by passing null explicitly. As a non-standard behaviour it was simpler to just remove it.
2017-10-19 20:35:45 -04:00
cc875be57e Backport testing improvements from ttrss branch 2017-10-19 15:32:18 -04:00
1271a0c8c0 Add ValueInfo::normalize method
This method provides generalized, consistent type casting more versatile than PHP's basic type juggling while hiding the significant complexity in achieving this.

While this commit does not change any existing code to use the new method, the intent is for both API handlers and database drivers to use the same basic rules for type conversion while still allowing for differing failure modes.
2017-10-19 15:18:58 -04:00
a80e283abc Perform feed discovery correctly; fixes #118 2017-10-02 11:53:52 -04:00
1b72d45adf Relegate bootstrap.php to testing; fixes #117 2017-10-01 09:33:49 -04:00
474f7fc2f6 Changelog; CS fixes 2017-09-30 12:05:57 -04:00
3482a35e54 Implement feed discovery; fixes #110 2017-09-30 11:43:43 -04:00
d1e4c6eed3 Fix 405 response of NCN version lister 2017-09-29 18:11:39 -04:00
00bc7a00a0 Transparently handle HEAD requests; fixes #114 2017-09-29 17:40:07 -04:00
1ca5b4b456 Add newline after password in CLI 2017-09-28 19:25:31 -04:00
96ebf936e4 CS fixes 2017-09-28 09:01:43 -04:00
5ebf6cb689 Treat objects which are convertible to strings the same as actual strings in ValueInfo 2017-09-28 08:55:47 -04:00
d365529493 Multiple fixes to input sanitization
- Database functions now accept any input, but throw typeViolation exceptions where appropriate instead of idMissing or subjectMissing
- Added unit tests for the new Misc\ValueInfo static class
- Added ValueInfo::id() method to centrally validate database IDs, and made use of it consistently
- Made use of PHP's filter_var() function where appropriate when validating or sanitizing input
- Made the NCN protocol handler reject most invalid IDs before handing off to method handlers
- Made NCN's feedUpdate and subscriptionMove methods return 422 on invalid input
- Adjusted several tests to handler type violations
2017-09-27 22:25:45 -04:00
e74a3ae3cb Fix numerous bugs when adding or changing folders
- Specifying a non-integer parent no longer silently casts to 0 or 1
- Specifying a folder ID of 0 now always converts to null automatically
- Performing both a rename and move to root in the same operation no longer results in potential duplicates
- Calling folderSetProperties with an empty data array no peforms an update; it now returns false before the update call
- Modification timestamps are now actually updated when a folder is modified
- Constraint violation exceptions triggered by code (rather than the database) now print a message
- Renaming a folder or subscription to a non-string value (e.g. an array) throws an exception rather than silently casting
- Added tests to better cover all the above
- Centralized the normalization of integers and title strings into a new ValueInfo static class
2017-09-26 16:45:41 -04:00
c393dfc42b Sundry fixes
- Make use of PHP 7's null coalescing operator
- remove use of static property in Lang class
- Improve code coverage slightly
2017-09-05 19:35:14 -04:00
bd95d23c8a Fix export of nulls in Conf 2017-08-29 23:17:57 -04:00
f7e50fe95d Passed code through linter 2017-08-29 10:50:31 -04:00
f5efa39839 More changes in anticipation of a release
- Added a 'user add' function to the CLI
- Removed the last trace of paths from configuration; paths must default to null and Arsse must determine sensible defaults at runtime
2017-08-28 19:38:58 -04:00
14951e2e4f Chnage "retain" settings to mean "purge; remove unused database settings 2017-08-20 15:46:35 -04:00
cc2296522c More changes in anticipation of a release:
- Don't load a config (and possibly create a database) in CLI if a configuration is not required
- Removed the 'dbSchemaBase' config option, which is really a testing hack
- Added sample Nginx configuration
- Fixed bug in REST handler
- Readme still needs work
2017-08-19 23:56:32 -04:00
a485913535 Update readme; remove username composition; default pre-auth to false 2017-08-18 10:20:43 -04:00
b8e091177b Add SQLite timeout (fixes #67) and implement configuration reading 2017-08-17 23:05:08 -04:00
52104fb647 Implement article cleanup; fixes #28 2017-08-17 22:36:15 -04:00
eeb834fe4c Record the size of feeds upon update
Used to retain at least N articles when cleaning up, so that very infrequently changed feeds do not have their most recent articles purged
2017-08-14 20:07:31 -04:00
67203679aa Changed foreign key on marks table
Previously arsse_marks had a reference to arsse_users along with arsse_articles; the former has now changed to arsse_subscriptions.

Consequently deleting a subscription now deletes marks. Tests have been simplified as a consequence.

This change was understaken to simplify counting valid marks on articles for the purposes of article cleanup; now all marks are valid marks
2017-08-14 17:18:18 -04:00
3b018c89d1 Implemented cleanup of orphaned feeds; fixes #25 2017-08-02 18:27:04 -04:00
0773e21034 Finish good-enough REST output; fixes #48
Tests can come later
2017-07-27 09:21:00 -04:00
78faf88563 Implemented configuration exporting; fixes #63
Default user agent string creation moved to Feed class as a consequence of difficulties in exporting it reliably
2017-07-27 09:09:39 -04:00
5df7217cff Improve REST test coverage 2017-07-24 08:15:37 -04:00
69005ad61b Remove dependency on DrUUID until it's actually used 2017-07-22 23:18:42 -04:00
4066bba05e Full code coverage for Database class
- Fixes #49
2017-07-22 23:08:08 -04:00
da80a8ffa6 Complete tests for database driver
- Fixes #62
2017-07-22 15:29:12 -04:00
1b970cc7c5 Experimental forking service and accompanying CLI
- Improves #48, #57, and #61
2017-07-21 17:15:43 -04:00
70f76f77fa More test coverage tweaks 2017-07-21 11:13:04 -04:00
d3bca6eb47 More code coverage accommodation 2017-07-20 22:40:09 -04:00
4cded011ff Complete implementations of server status and user status REST calls
- Fixes #30
- Fixes #31
- Avatars are not yet supported by the data model; blocked by issue #52
2017-07-19 18:07:36 -04:00
3a26c75044 Tests for Database::meta*() functions
Improves #49
2017-07-18 16:38:23 -04:00
feadf51096 Workaround for picoFeed memory leak. Fixes #58 2017-07-18 12:52:26 -04:00
aaa4d1e988 Basic support for PicoFeed content scraping
- At the moment this is a completely manual setting: feed deduplication makes the setting very hard to handle for multiple users
- Improves #60
2017-07-17 14:56:50 -04:00
da092d5f8c Changed Misc\DateFormatter to a collection of static methods and renamed it to Date; renamed Data to Arsse to avoid confusion and better reflect its centrality 2017-07-17 07:47:57 -04:00
fd1f23fd82 Docblocks for Conf
- Improves #36
- Updated dependencies
2017-07-16 22:27:55 -04:00
bfde232870 Experimental curl-based Service driver
Probably it's not yet functional
2017-07-16 14:56:43 -04:00
9f90756ede Improvements to Service 2017-07-16 14:55:37 -04:00
6d4aa4db6e Minimally functional, highly experimental, working server
- Basic update service handles only one feed at a time and possibly leaks memory
- Output for REST requests is still very basic
- No avatar support
- No reporting of whether cron works
- No cleanup before or after feed updates
2017-07-15 16:44:06 -04:00
d4674c61b2 More bug fixes
- use DateFormatter throughout the Feed class
- Ensure dates have TEXT affinity in SQLite, in case it matters
- Add a userPreAuth setting for when relying on the Web server to do authentication
2017-07-15 13:33:17 -04:00
15285dba1e Add PHPHDoc type hints for certain class properties
This should aid autocompletion in IDEs
2017-07-14 10:16:16 -04:00