Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Clean up the Drupal importers #235
Big refactoring of the Drupal importers.
All the code that was repeated on both Drupal6 and Drupal7 importers was pulled up into a generic
I would appreciate it if someone could test importing non-Drupal content, though, because I don't have another blog to test the non-Drupal importers with.
Great start, @borfast! I would love to see this as a module instead of a superclass, or have the one class handle both options and allowing folks to specify the version in the options, maybe. What do you think about that? That gets around the sub-subclassing issue and keeps the inheritance tree very clean.
I actually thought about fixing the sub-subclassing issue by using modules instead but it turned out to cause more issues and since it required less code changes, I ended up going down the other route.
I do agree it's not pretty, though.
Having everything in one single class may not be the best option because it will get messy soon - there are already two Drupal importers and another one may soon pop up for Drupal 8. Having all these things in a single class sounds a bit too cramped.
But having a single Drupal class deriving from Importer, allowing the version to be specified which in turn dictates which specific module will be used sounds like a good idea, a much cleaner approach.
If you agree, I can take a stab at making it work that way.
@parkr, sorry for taking so long, life hasn't been kind to me lately and I fell behind on several things.
I had already made a few of the easiest changes, which I just pushed in one commit. I'm not sure I'll have time for the rest in the next week, so if you want to finish up the rest of the stuff, go ahead.