Robbo
Well-known member
I have just written a few importers and one was for iTrader from vBulletin to XenTrader. iTrader stored user IDs for any feedback given but it never stored usernames. This meant I need the import log from the initial vBulletin import. What I think you must expect is for me to extend the vBulletin importers and add my step in, I could of done that but some people may have already imported and some people may have moved to vBulletin and keep the data of old mods waiting for ports.
So I made the more standalone importer (used all the systems, just didn't extend the current importers) and was able to do some little hacky things to be able to get it to work. I will still have to make it clear to users about import logs so they don't stuff things up and lose their data.
So when configuring the importer it asks for the import log archive table name from the initial vBulletin import and then I do the hacky part...
I'm calling this at the start of my step, you can see why it is hacky... I don't like using define() at all, let alone in a method. And just in case you ask, when validating the config I do make sure the table is valid, I don't just inject the table name and hope.
So what I would like is a better way to handle this kind of stuff, keep your define() stuff for redirecting scripts but add something a little nicer for importers. Simply having XenForo_Model_Import::getImportContentMap() accept a third argument for the import log table would work. And then a XenForo_Model_Import::importLogExists() or something for validation.
And another thing I would like. After completing the import the controller executes some cache rebuilds. Since the caches that are being rebuilt don't have anything to do with my imports I would like to be able to skip it easily. Additionally, I would like to be able to inject my own cache rebuilds.
So basically I would like to be able to modify...
in the Import controller easily with extending it. Add to the importer getCachesToRebuild() or even just let me store them in the config and grab it from the session inthe controller.
Sorry for wall of text, I hope I made sense.
So I made the more standalone importer (used all the systems, just didn't extend the current importers) and was able to do some little hacky things to be able to get it to work. I will still have to make it clear to users about import logs so they don't stuff things up and lose their data.
So when configuring the importer it asks for the import log archive table name from the initial vBulletin import and then I do the hacky part...
PHP:
define('IMPORT_LOG_TABLE', $this->_config['importlog']);
So what I would like is a better way to handle this kind of stuff, keep your define() stuff for redirecting scripts but add something a little nicer for importers. Simply having XenForo_Model_Import::getImportContentMap() accept a third argument for the import log table would work. And then a XenForo_Model_Import::importLogExists() or something for validation.
And another thing I would like. After completing the import the controller executes some cache rebuilds. Since the caches that are being rebuilt don't have anything to do with my imports I would like to be able to skip it easily. Additionally, I would like to be able to inject my own cache rebuilds.
So basically I would like to be able to modify...
PHP:
$caches = array(
'User', 'Thread', 'Poll', 'Forum'
);
Sorry for wall of text, I hope I made sense.