Remove ADODB.
PRs:
TODO:
createDatabase in lib/pkp/classes/install/PKPInstall.inc.php) (Opted at least for now for removal: https://github.com/asmecher/pkp-lib/commit/cdb0b949850ffcdbe25713cb4810bd0a9abc0c50)Highlights/implications:
DAOResultFactory->getCount / DAOResultFactory->wasEmpty). It's always been inefficient to both iterate and count, and using Generators (as we will do more in the future) means it's a bad pattern. It's sometimes necessary, though, e.g. for paging.DAOResultFactory (e.g. EmailLogDAO::_getByEventType) to allow it to count with a separate query (ADODB used to do this behind the scenes anyway).DAOResultFactory instances cannot be counted unless supplied in constructor exception if you need to adjust this.DAOResultFactory is still available and works roughly the same, though it should be considered deprecated.Generators (e.g. AnnouncementDAO::getByTypeId), which can be looped through using foreach but don't instantiate the objects it's fetching until they're needed, orSubscriptionTypeDAO::getById for an object, and ContextDAO::existsByPath for single fields).DAO::retrieve, DAO::retrieveLimit, DAO::retrieveRange, DAO::update) you're used to are still mostly present, but have some slight behavioural changes:ContextDAO::getByPath.) You will see Argument 1 passed to Illuminate\Database\Connection::prepareBindings() must be of the type array if you need to adjust this.$dao->update now returns a count of affected rows, whereas before it returned a success/failure boolean that was frequently misused and undocumented. I have not cleaned up all these cases. See e.g. TemporaryFileDAO::deleteTemporaryFileById. Error conditions should use Exceptions rather than null/false returns that frequently go uncaught.DAO::retrieveCached has been removed pending a suitable replacement (probably a different approach than a query-level cache).Capsule object to construct queries directly in the DAO. See e.g. AnnouncementDAO::getById.tools/dbXMLtoSQL.php.tools/xmlSchemaToMigration.php. See https://github.com/pkp/pkp-lib/issues/2493#issuecomment-627482515 for details.@NateWr, I've finally got this passing tests; could you take a preliminary review? There are notes on the coding implications (and links to the PRs) at https://github.com/pkp/pkp-lib/issues/6264#issuecomment-702926627 (these should be adapted into the release notebook).
I'm OK to wait to merge this until after your submission file stuff is done, if that makes life easier.
Looks really good @asmecher! I've done a review of those PRs with a few comments but nothing major. Thanks for the helpful guide to the changes in your comment. :+1: I've got a running list for the release notebook and I've added your comment to that.
Thanks, @NateWr! I've run through the issues you flagged and fixed some minor ones, flagging a couple bigger ones with specific commits to resolve them. If you're OK with the result, next step will be to port to OMP and OPS, but I suggest holding off on that until you get the submission file stuff merged; then I'll rebase my OJS work on top of that before porting to the other apps.
Great! Looks good to me. If that lastInsertId thing is ok as-is, I can have the submission file stuff merged tomorrow.
@NateWr, I've added pulls for OPS and OMP to https://github.com/pkp/pkp-lib/issues/6264#issuecomment-702926627 -- could you have a quick look at these? They're essentially straight adaptations of the OJS PR (that is to say, lots of DAO class clean-up and little else).
All PRs merged, not including the testing-purposes-only commits.
Closing this; there will doubtlessly be related errors but they can either reopen this issue with details or file new entries.