function tripal_run_importer_run
3.x tripal.importer.api.inc | tripal_run_importer_run($loader, $job) |
First step of the tripal_run_importer.
Parameters
$loader: The TripalImporter object.
$job: The TripalJob object.$this
Throws
Exception
Related topics
1 call to tripal_run_importer_run()
- tripal_run_importer in tripal/
api/ tripal.importer.api.inc - Imports data into the database.
File
- tripal/
api/ tripal.importer.api.inc, line 166 - Provides an application programming interface (API) for working with data file importers using the TripalImporter class.
Code
function tripal_run_importer_run($loader, $job) {
try {
// begin the transaction
$transaction = db_transaction();
$loader->run();
if ($job) {
$job->logMessage("\nDone.\n");
}
// Remove the temp file
if (!empty($details->arguments['file_url'])) {
$loader->logMessage('Removing downloaded file...');
unlink($temp);
}
}
catch (Exception $e) {
// Rollback and re-throw the error.
$transaction->rollback();
throw $e;
}
}