1
1
Fork 0
mirror of https://code.mensbeam.com/MensBeam/Arsse.git synced 2024-12-23 17:12:41 +00:00
Commit graph

75 commits

Author SHA1 Message Date
J. King
22cdc8916d Documentation tweaks and CS fixes 2017-11-29 22:42:50 -05:00
J. King
5cd7268c0a Added incorrectDbCharset to NCNv1 server status
This has been exposed since version 11.0.3, released before our version 0.1.0, but after implementation work had begun
2017-11-29 18:14:59 -05:00
J. King
5d4ea6edc0 Add ResultEmpty class
This allows for the creation of synthetic empty result sets
2017-11-19 15:49:41 -05:00
J. King
6da86428c4 Added per-file legal boilerplate
Includes PHPDoc license tag in the file-level block with accompanying copyright notice.

Also added an AUTHORS file on the off chance of outside contributions
2017-11-16 20:51:03 -05:00
J. King
11b2066922 Added per-file legal boilerplate
Includes PHPDoc license tag in the file-level block with accompanying copyright notice.

Also added an AUTHORS file on the off chance of outside contributions
2017-11-16 20:23:18 -05:00
J. King
42a5ccb96c Handle request splitting in data model rather than controllers
Queries for multiple specific articles are limited in size because of limits on  the number of bound query parameters.

Currently this limit is somewhat arbitrarily set at 50, but it may increase.

Historically controllers would be responsible for chunking input, but this will present problems when the expected output is a result set, and of course the maintenance burden increases as the number of controllers increases.

This commit transfers the burden to the data model, and consequently introduces a ResultAggregate class which collects chunked result sets (currently only for articleList).

In the course of making these changes the mock Result class was also largely rewritten, fixing many bugs with it.

This commit does not modify the controllers nor their tests; this will be done in a subsequent commit.
2017-11-06 23:32:29 -05:00
J. King
7d19a5add0 Merge from master 2017-11-06 15:58:26 -05:00
J. King
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
J. King
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
J. King
cc875be57e Backport testing improvements from ttrss branch 2017-10-19 15:32:18 -04:00
J. King
a343b78b02 Make exporting the database test fixture easier 2017-10-13 00:03:25 -04:00
J. King
20ff08a431 Implement TTTRSS getCounters operation; fixes #79 2017-10-11 12:55:50 -04:00
J. King
5488b994f7 Merged master; CS fixes 2017-09-28 10:16:24 -04:00
J. King
96ebf936e4 CS fixes 2017-09-28 09:01:43 -04:00
J. King
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
J. King
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
J. King
f7e50fe95d Passed code through linter 2017-08-29 10:50:31 -04:00
J. King
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
J. King
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
J. King
b8e091177b Add SQLite timeout (fixes #67) and implement configuration reading 2017-08-17 23:05:08 -04:00
J. King
69005ad61b Remove dependency on DrUUID until it's actually used 2017-07-22 23:18:42 -04:00
J. King
da80a8ffa6 Complete tests for database driver
- Fixes #62
2017-07-22 15:29:12 -04:00
J. King
1b970cc7c5 Experimental forking service and accompanying CLI
- Improves #48, #57, and #61
2017-07-21 17:15:43 -04:00
J. King
70f76f77fa More test coverage tweaks 2017-07-21 11:13:04 -04:00
J. King
d3bca6eb47 More code coverage accommodation 2017-07-20 22:40:09 -04:00
J. King
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
J. King
ac73ed0e7f More tweaks
- Changed Data::$l to Data::$lang; it's not used enough to justify the possibly confusing shortening
- Made database auto-update a general rather than per-driver setting
- Added settings for forthcoming feed fetching service
2017-07-11 20:27:37 -04:00
J. King
b3f631e335 Use more reliable database locking strategy; reorganize tests
PostgreSQL and MySQL both have better locking mechanisms than what was previously implemented, as well
2017-07-07 21:06:38 -04:00
J. King
17ec6cf669 Move date formatting out of SQL and standardize on the DateFormatter trait
Fixes #56
2017-07-07 15:25:47 -04:00
J. King
7e7b204d85 Cleanup
- Revamped design of Query class to be more consistent and predictable, and generally suck less
- Removed special case for Query class in Statement class
- Cleaned up database schema somewhat
2017-07-07 11:49:54 -04:00
J. King
483874e21d Implemented query contexts
- Fixes #55
- Included test for Context
- Adjusted Database::editionLatest() to use Context
- Adjusted NCN handler and tests accordingly
- Also refined experimental Database::articleList() method and added experimental Database::articlePropertiesSet() method
2017-06-18 10:23:37 -04:00
J. King
87fce033bd Fix failing tests
Not sure how I missed this...
2017-06-16 19:22:42 -04:00
J. King
c37d476ba0 Changes to Database internals
- Driver->prepare() can now take a new Database\Query object as the first parameter
- The Query class allows for building a complex query out of a main body, common table expressions, WHERE coniditions, ordering conditions, a limit, and offset
- The subscriptionList method is the prototypical example of usage
- The experimental articleList method will in time be adapted to use this as well
- A generic means of specifying a selection context is forthcoming; this would remove subscriptionList's $folder and $id parameters, for instance
2017-06-04 18:00:18 -04:00
J. King
590abaf0ef Start on tests for Feed
- Makes use of PHP's internal Web server to deliver expected responses from a real server
- Windows batch file can be used to run tests (Linux and Mac test runners to come later)
- Added PHPUnit to dev dependencies
2017-05-21 17:16:32 -04:00
J. King
4a816f827b NCNv1 feed calls and other changes
- Implemented all but one feed-related function (it's more ofan item function)
- Fixed time conversion for input into SQL; dates in PM were previously wrong
- Added miscellaneous tentative functions to Database to help with peculiarities of NCNv1; these may change
- Tests to come soon
2017-05-18 23:03:33 -04:00
J. King
0bc2841837 Last of subscription tests
- Also tweaked SQL dateformat() function to output proper HTTP dates
- Also introduced method to set a default output date format
2017-05-18 13:21:17 -04:00
J. King
8ebcb01cb5 Made out-of-order transaction handling more predictable 2017-05-07 18:27:16 -04:00
J. King
2083c6e397 Change transactions to auto-rollback on exceptions 2017-05-06 12:02:27 -04:00
J. King
db132c0c24 Various changes to Database
- Introduced "strict" binding types for use when inserting into NOT NULL columns: any null value supplied is always cast to the supplied type rather than passing through
- Fixed feed updating further
- Filled out full complement of subscription manipulation functions
- made folderPropertiesSet possibly return false
2017-05-04 19:12:33 -04:00
J. King
9c7f4710aa Fix feed fetching
There are almost certainly other bugs; proper tests forthcoming
2017-05-04 14:42:40 -04:00
J. King
119d42907e More feed update refactoring
Still very much incomplete: in its present form it would yield many false duplicates
2017-04-15 22:07:22 -04:00
J. King
a67fe30408 Fix whitespace
Also fixed my editor so tabs won't happen again!
2017-04-06 21:41:21 -04:00
J. King
b02abec250 Added test for recursive binding
Also fixed a bug uncovered by the test
2017-04-06 21:24:26 -04:00
J. King
929d763981 Simplify the creation of arbitrary UPDATEs
The type parameters of Db\Driver::prepare() and the parameters of Db\Statement::run() can now be arrays, which will be iterated over recursively to bind scalar values to the SQL statement.

This simplifies the construction of arbitrary UPDATE statements (the WHERE clause no longer needs to be taken into account) and should make it clearer what is happening in these cases.

It should also simplify the creation of IN() clauses down the road if they become necessary.
2017-04-06 11:02:47 -04:00
J. King
458eaac5c6 Tests for listing folders
- Fixed checking for existence of parent before listing
- Changed Result->getAll() to return an empty array rather than null for an empty result set
2017-03-31 17:42:28 -04:00
J. King
f902346b6c Eliminated passing of RuntimeData instances
- RuntimeData has now been replaced by a single static Data class
- The Data class has a load() method which fills the same role as the constructor of RuntimeData
- The static Lang class is now an instantiable class and is a member of Data
- All tests have been adjusted and pass
- The Exception tests no longer require convoluted workarounds: a simple mock  for Data::$l suffices; Lang tests also use a mock to prevent loops now instead of using a workaround
2017-03-28 18:50:00 -04:00
Dustin Wilson
7236020b8b Changed "NewsSync" to "Arsse" 2017-03-27 23:12:12 -05:00
J. King
b821d728e4 Add rest dependency; fix SQLite function def 2017-03-13 23:22:20 -04:00
J. King
6413d3a489 Re-order SQLite3 driver initialization
Should handle error reporting better
2017-03-13 19:13:06 -04:00
Dustin Wilson
bb8af5a62c Added Custom Functions into Db/SQLite3/Driver
• Created Db/SQLite3/CustomFunctions to house the dateFormat custom
function and potentially others in the future.
• Fixed a typo in Db/SQLite3/Driver
2017-03-13 13:33:31 -05:00