Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is an attempt to further structure the migration tool. This is NOT a working and finished solution, but this code has proper dependency injection for the application and the database, as well as consistently named wordpress database. It also does not use loadAssocList() everywhere and instead uses the proper database methods (mostly). So far the only part working on this is importing users. It also started converting the whole thing to not require continous keys for the different data sources. I started adding mappings from WP IDs to Joomla IDs, which still needs to be used everywhere and I added a new event which moves the calls to getUserState to the event instead of in the plugin. Lots of unnecessary code was removed and half the logging has been converted to the Joomla core logger instead of the custom class included in this project.
There si still a lot to do here. The events should have better names and importPostsAndPage is simply wrong and way to WP specific. We want to have steps for Joomla entities, not for Wordpress entities. So it would have to be something like importArticles and then in importMenuitems we could create menu items for articles which were pages in WP. The key parameter of the ajax requests have to be removed, the whole error handling needs to be improved both in the WP plugin and in the component itself. I've been using the table objects so far mostly, but in some cases this would have to be the model instead to properly create everything.