TripalImporter.inc 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740
  1. <?php
  2. class TripalImporter {
  3. // --------------------------------------------------------------------------
  4. // EDITABLE STATIC CONSTANTS
  5. //
  6. // The following constants SHOULD be set for each descendent class. They are
  7. // used by the static functions to provide information to Drupal about
  8. // the field and it's default widget and formatter.
  9. // --------------------------------------------------------------------------
  10. /**
  11. * The name of this loader. This name will be presented to the site
  12. * user.
  13. */
  14. public static $name = 'Tripal Loader';
  15. /**
  16. * The machine name for this loader. This name will be used to construct
  17. * the URL for the loader.
  18. */
  19. public static $machine_name = 'tripal_loader';
  20. /**
  21. * A brief description for this loader. This description will be
  22. * presented to the site user.
  23. */
  24. public static $description = 'A base loader for all Tripal loaders';
  25. /**
  26. * An array containing the extensions of allowed file types.
  27. */
  28. public static $file_types = array();
  29. /**
  30. * Provides information to the user about the file upload. Typically this
  31. * may include a description of the file types allowed.
  32. */
  33. public static $upload_description = '';
  34. /**
  35. * The title that should appear above the upload button.
  36. */
  37. public static $upload_title = 'File Upload';
  38. /**
  39. * If the loader should require an analysis record. To maintain provenance
  40. * we should always indiate where the data we are uploading comes from.
  41. * The method that Tripal attempts to use for this by associating upload files
  42. * with an analysis record. The analysis record provides the details for
  43. * how the file was created or obtained. Set this to FALSE if the loader
  44. * should not require an analysis when loading. if $use_analysis is set to
  45. * true then the form values will have an 'analysis_id' key in the $form_state
  46. * array on submitted forms.
  47. */
  48. public static $use_analysis = TRUE;
  49. /**
  50. * If the $use_analysis value is set above then this value indicates if the
  51. * analysis should be required.
  52. */
  53. public static $require_analysis = TRUE;
  54. /**
  55. * Text that should appear on the button at the bottom of the importer
  56. * form.
  57. */
  58. public static $button_text = 'Import File';
  59. /**
  60. * Indicates the methods that the file uploader will support.
  61. */
  62. public static $methods = array(
  63. // Allow the user to upload a file to the server.
  64. 'file_upload' => TRUE,
  65. // Allow the user to provide the path on the Tripal server for the file.
  66. 'file_local' => TRUE,
  67. // Allow the user to provide a remote URL for the file.
  68. 'file_remote' => TRUE,
  69. );
  70. /**
  71. * Indicates if the file must be provided. An example when it may not be
  72. * necessary to require that the user provide a file for uploading if the
  73. * loader keeps track of previous files and makes those available for
  74. * selection.
  75. */
  76. public static $file_required = TRUE;
  77. /**
  78. * The array of arguments used for this loader. Each argument should
  79. * be a separate array containing a machine_name, name, and description
  80. * keys. This information is used to build the help text for the loader.
  81. */
  82. public static $argument_list = array();
  83. /**
  84. * Indicates how many files are allowed to be uploaded. By default this is
  85. * set to allow only one file. Change to any positive number. A value of
  86. * zero indicates an unlimited number of uploaded files are allowed.
  87. */
  88. public static $cardinality = 1;
  89. /**
  90. * Be default, all loaders are automaticlly added to the Admin >
  91. * Tripal > Data Laders menu. However, if this loader should be
  92. * made available via a different menu path, then set it here. If the
  93. * value is empty then the path will be the default.
  94. */
  95. public static $menu_path = '';
  96. /**
  97. * If your importer requires more flexibility and advanced features than
  98. * the TripalImporter provides, you can indicate a callback function. If set,
  99. * the callback will be used to provide the importer interface to the
  100. * end-user. However, because this bypasses the class infrastructure the
  101. * run() function will also not be available and your importer must be
  102. * fully self-sufficient outside of this class. The benefit for using a
  103. * TripalImporter despite your loader being self-sufficient is that Tripal
  104. * will treat your loader like all others providing a consistent location
  105. * in the menu and set of permissions.
  106. *
  107. * Note: use of a callback is discouraged as the importer provides a
  108. * consistent workflow for all importers. Try your best to fit your importer
  109. * within the class. Use this if you absolutely cannot fit your importer
  110. * into TripalImporter implementation.
  111. *
  112. */
  113. public static $callback = '';
  114. /**
  115. * The name of the module that provides the callback function.
  116. */
  117. public static $callback_module = '';
  118. /**
  119. * An include path for the callback function. Use a relative path within
  120. * this scope of this module
  121. * (e.g. includes/loaders/tripal_chado_pub_importers).
  122. */
  123. public static $callback_path = '';
  124. // --------------------------------------------------------------------------
  125. // PRIVATE MEMBERS -- DO NOT EDIT or OVERRIDE
  126. // --------------------------------------------------------------------------
  127. /**
  128. * The number of items that this importer needs to process. A progress
  129. * can be calculated by dividing the number of items process by this
  130. * number.
  131. */
  132. private $total_items;
  133. /**
  134. * The number of items that have been handled so far. This must never
  135. * be below 0 and never exceed $total_items;
  136. */
  137. private $num_handled;
  138. /**
  139. * The interval when the job progress should be updated. Updating the job
  140. * progress incurrs a database write which takes time and if it occurs to
  141. * frequently can slow down the loader. This should be a value between
  142. * 0 and 100 to indicate a percent interval (e.g. 1 means update the
  143. * progress every time the num_handled increases by 1%).
  144. */
  145. private $interval;
  146. /**
  147. * Each time the job progress is updated this variable gets set. It is
  148. * used to calculate if the $interval has passed for the next update.
  149. */
  150. private $prev_update;
  151. /**
  152. * The job that this importer is associated with. This is needed for
  153. * updating the status of the job.
  154. */
  155. protected $job;
  156. /**
  157. * The arguments needed for the importer. This is a list of key/value
  158. * pairs in an associative array.
  159. */
  160. protected $arguments;
  161. /**
  162. * The ID for this import record.
  163. */
  164. protected $import_id;
  165. /**
  166. * Prior to running an importer it must be prepared to make sure the file
  167. * is available. Preparing the importer will download all the necessary
  168. * files. This value is set to TRUE after the importer is prepared for
  169. * funning.
  170. */
  171. protected $is_prepared;
  172. /**
  173. * Stores the last percentage that progress was reported.
  174. * @var integer
  175. */
  176. protected $reported = 0;
  177. // --------------------------------------------------------------------------
  178. // CONSTRUCTORS
  179. // --------------------------------------------------------------------------
  180. /**
  181. * Instantiates a new TripalImporter object.
  182. *
  183. * @param TripalJob $job
  184. * An optional TripalJob object that this loader is associated with.
  185. */
  186. public function __construct(TripalJob $job = NULL) {
  187. // Intialize the private member variables.
  188. $this->is_prepared = FALSE;
  189. $this->import_id = NULL;
  190. $this->arguments = array();
  191. $this->job = NULL;
  192. $this->total_items = 0;
  193. $this->interval = 1;
  194. $this->num_handled = 0;
  195. $this->prev_update = 0;
  196. }
  197. /**
  198. * Instantiates a new TripalImporter object using the import record ID.
  199. *
  200. * This function will automatically instantiate the correct TripalImporter
  201. * child class that is appropriate for the provided ID.
  202. *
  203. * @param $import_id
  204. * The ID of the import recrod.
  205. * @return
  206. * An TripalImporter object of the appropriate child class.
  207. */
  208. static public function byID($import_id) {
  209. // Get the importer.
  210. $import = db_select('tripal_import', 'ti')
  211. ->fields('ti')
  212. ->condition('ti.import_id', $import_id)
  213. ->execute()
  214. ->fetchObject();
  215. if (!$import) {
  216. throw new Exception('Cannot find an importer that matches the given import ID.');
  217. }
  218. $class = $import->class;
  219. tripal_load_include_importer_class($class);
  220. if (class_exists($class)) {
  221. $loader = new $class();
  222. $loader->load($import_id);
  223. return $loader;
  224. }
  225. else {
  226. throw new Exception('Cannot find the matching class for this import record.');
  227. }
  228. }
  229. /**
  230. * Associate this importer with the Tripal job that is running it.
  231. *
  232. * Associating an import with a job will allow the importer to log messages
  233. * to the job log.
  234. *
  235. * @param TripalJob $job
  236. * An instnace of a TripalJob.
  237. */
  238. public function setJob(TripalJob $job) {
  239. $this->job = $job;
  240. }
  241. /**
  242. * Creates a new importer record.
  243. *
  244. * @param $run_args
  245. * An associative array of the arguments needed to run the importer. Each
  246. * importer will have its own defined set of arguments.
  247. *
  248. * @param $file_details
  249. * An associative array with one of the following keys:
  250. * -fid: provides the Drupal managed File ID for the file.
  251. * -file_local: provides the full path to the file on the server.
  252. * -file_remote: provides the remote URL for the file.
  253. * This argument is optional if the loader does not use the built-in
  254. * file loader.
  255. *
  256. * @throws Exception
  257. */
  258. public function create($run_args, $file_details = array()) {
  259. global $user;
  260. $class = get_called_class();
  261. try {
  262. // Build the values for the tripal_importer table insert.
  263. $values = array(
  264. 'uid' => $user->uid,
  265. 'class' => $class,
  266. 'submit_date' => time(),
  267. );
  268. // Build the arguments array, which consists of the run arguments
  269. // and the file.
  270. $arguments = array(
  271. 'run_args' => $run_args,
  272. 'files' => array(),
  273. );
  274. // Get the file argument.
  275. $has_file = 0;
  276. if (array_key_exists('file_local', $file_details)) {
  277. $arguments['files'][] = array(
  278. 'file_local' => $file_details['file_local'],
  279. 'file_path' => $file_details['file_local']
  280. );
  281. $has_file++;
  282. }
  283. if (array_key_exists('file_remote', $file_details)) {
  284. $arguments['files'][] = array(
  285. 'file_remote' => $file_details['file_remote']
  286. );
  287. $has_file++;
  288. }
  289. if (array_key_exists('fid', $file_details)) {
  290. $values['fid'] = $file_details['fid'];
  291. // Handle multiple file uploads.
  292. if (preg_match('/\|/', $file_details['fid'])) {
  293. $fids = explode('|', $file_details['fid']);
  294. foreach ($fids as $fid) {
  295. $file = file_load($fid);
  296. $arguments['files'][] = array(
  297. 'file_path' => drupal_realpath($file->uri),
  298. 'fid' => $fid
  299. );
  300. $has_file++;
  301. }
  302. }
  303. // Handle a single file.
  304. else {
  305. $fid = $file_details['fid'];
  306. $file = file_load($fid);
  307. $arguments['files'][] = array(
  308. 'file_path' => drupal_realpath($file->uri),
  309. 'fid' => $fid
  310. );
  311. $has_file++;
  312. // For backwards compatibility add the old 'file' element.
  313. $arguments['file'] = array(
  314. 'file_path' => drupal_realpath($file->uri),
  315. 'fid' => $fid
  316. );
  317. }
  318. }
  319. // Validate the $file_details argument.
  320. if ($has_file == 0 and $class::$file_required == TRUE) {
  321. throw new Exception("Must provide a proper file identifier for the \$file_details argument.");
  322. }
  323. // Store the arguments in the class and serialize for table insertion.
  324. $this->arguments = $arguments;
  325. $values['arguments'] = serialize($arguments);
  326. // Insert the importer record.
  327. $import_id = db_insert('tripal_import')
  328. ->fields($values)
  329. ->execute();
  330. $this->import_id = $import_id;
  331. }
  332. catch (Exception $e){
  333. throw new Exception('Cannot create importer: ' . $e->getMessage());
  334. }
  335. }
  336. /**
  337. * Loads an existing import record into this object.
  338. *
  339. * @param $import_id
  340. * The ID of the import record.
  341. */
  342. public function load($import_id) {
  343. $class = get_called_class();
  344. // Get the importer.
  345. $import = db_select('tripal_import', 'ti')
  346. ->fields('ti')
  347. ->condition('ti.import_id', $import_id)
  348. ->execute()
  349. ->fetchObject();
  350. if (!$import) {
  351. throw new Exception('Cannot find an importer that matches the given import ID.');
  352. }
  353. if ($import->class != $class) {
  354. throw new Exception('The importer specified by the given ID does not match this importer class.');
  355. }
  356. $this->arguments = unserialize($import->arguments);
  357. $this->import_id = $import_id;
  358. }
  359. /**
  360. * Submits the importer for execution as a job.
  361. *
  362. * @return
  363. * The ID of the newly submitted job.
  364. */
  365. public function submitJob() {
  366. global $user;
  367. $class = get_called_class();
  368. if (!$this->import_id) {
  369. throw new Exception('Cannot submit an importer job without an import record. Please run create() first.');
  370. }
  371. // Add a job to run the importer.
  372. try {
  373. $args = array($this->import_id);
  374. $includes = array(
  375. module_load_include('inc', 'tripal', 'api/tripal.importer.api'),
  376. );
  377. $job_id = tripal_add_job($class::$button_text, 'tripal',
  378. 'tripal_run_importer', $args, $user->uid, 10, $includes);
  379. return $job_id;
  380. }
  381. catch (Exception $e){
  382. throw new Exception('Cannot create importer job: ' . $e->getMessage());
  383. }
  384. }
  385. /**
  386. * Prepares the importer files for execution.
  387. *
  388. * This function must be run prior to the run() function to ensure that
  389. * the import file is ready to go.
  390. */
  391. public function prepareFiles() {
  392. $class = get_called_class();
  393. // If no file is required then just indicate that all is good to go.
  394. if ($class::$file_required == FALSE) {
  395. $this->is_prepared = TRUE;
  396. return;
  397. }
  398. try {
  399. for($i = 0; $i < count($this->arguments['files']); $i++) {
  400. if (!empty($this->arguments['files'][$i]['file_remote'])) {
  401. $file_remote = $this->arguments['files'][$i]['file_remote'];
  402. $this->logMessage('Download file: !file_remote...', array('!file_remote' => $file_remote));
  403. // If this file is compressed then keepthe .gz extension so we can
  404. // uncompress it.
  405. $ext = '';
  406. if (preg_match('/^(.*?)\.gz$/', $file_remote)) {
  407. $ext = '.gz';
  408. }
  409. // Create a temporary file.
  410. $temp = tempnam("temporary://", 'import_') . $ext;
  411. $this->logMessage("Saving as: !file", array('!file' => $temp));
  412. $url_fh = fopen($file_remote, "r");
  413. $tmp_fh = fopen($temp, "w");
  414. if (!$url_fh) {
  415. throw new Exception(t("Unable to download the remote file at %url. Could a firewall be blocking outgoing connections?",
  416. array('%url', $file_remote)));
  417. }
  418. // Write the contents of the remote file to the temp file.
  419. while (!feof($url_fh)) {
  420. fwrite($tmp_fh, fread($url_fh, 255), 255);
  421. }
  422. // Set the path to the file for the importer to use.
  423. $this->arguments['files'][$i]['file_path'] = $temp;
  424. $this->is_prepared = TRUE;
  425. }
  426. // Is this file compressed? If so, then uncompress it
  427. $matches = array();
  428. if (preg_match('/^(.*?)\.gz$/', $this->arguments['files'][$i]['file_path'], $matches)) {
  429. $this->logMessage("Uncompressing: !file", array('!file' => $this->arguments['files'][$i]['file_path']));
  430. $buffer_size = 4096;
  431. $new_file_path = $matches[1];
  432. $gzfile = gzopen($this->arguments['files'][$i]['file_path'], 'rb');
  433. $out_file = fopen($new_file_path, 'wb');
  434. if (!$out_file) {
  435. throw new Exception("Cannot uncompress file: new temporary file, '$new_file_path', cannot be created.");
  436. }
  437. // Keep repeating until the end of the input file
  438. while (!gzeof($gzfile)) {
  439. // Read buffer-size bytes
  440. // Both fwrite and gzread and binary-safe
  441. fwrite($out_file, gzread($gzfile, $buffer_size));
  442. }
  443. // Files are done, close files
  444. fclose($out_file);
  445. gzclose($gzfile);
  446. // Now remove the .gz file and reset the file_path to the new
  447. // uncompressed version.
  448. unlink($this->arguments['files'][$i]['file_path']);
  449. $this->arguments['files'][$i]['file_path'] = $new_file_path;
  450. }
  451. }
  452. }
  453. catch (Exception $e){
  454. throw new Exception('Cannot prepare the importer: ' . $e->getMessage());
  455. }
  456. }
  457. /**
  458. * Cleans up any temporary files that were created by the prepareFile().
  459. *
  460. * This function should be called after a run() to remove any temporary
  461. * files and keep them from building up on the server.
  462. */
  463. public function cleanFile() {
  464. try {
  465. // If a remote file was downloaded then remove it.
  466. for($i = 0; $i < count($this->arguments['files']); $i++) {
  467. if (!empty($this->arguments['files'][$i]['file_remote']) and
  468. file_exists($this->arguments['files'][$i]['file_path'])) {
  469. $this->logMessage('Removing downloaded file...');
  470. unlink($this->arguments['files'][$i]['file_path']);
  471. $this->is_prepared = FALSE;
  472. }
  473. }
  474. }
  475. catch (Exception $e){
  476. throw new Exception('Cannot prepare the importer: ' . $e->getMessage());
  477. }
  478. }
  479. /**
  480. * Logs a message for the importer.
  481. *
  482. * There is no distinction between status messages and error logs. Any
  483. * message that is intended for the user to review the status of the loading
  484. * can be provided here. If this importer is associated with a job then
  485. * the logging is passed on to the job for storage.
  486. *
  487. * Messages that are are of severity TRIPAL_CRITICAL or TRIPAL_ERROR
  488. * are also logged to the watchdog.
  489. *
  490. * @param $message
  491. * The message to store in the log. Keep $message translatable by not
  492. * concatenating dynamic values into it! Variables in the message should
  493. * be added by using placeholder strings alongside the variables argument
  494. * to declare the value of the placeholders. See t() for documentation on
  495. * how $message and $variables interact.
  496. * @param $variables
  497. * Array of variables to replace in the message on display or NULL if
  498. * message is already translated or not possible to translate.
  499. * @param $severity
  500. * The severity of the message; one of the following values:
  501. * - TRIPAL_CRITICAL: Critical conditions.
  502. * - TRIPAL_ERROR: Error conditions.
  503. * - TRIPAL_WARNING: Warning conditions.
  504. * - TRIPAL_NOTICE: Normal but significant conditions.
  505. * - TRIPAL_INFO: (default) Informational messages.
  506. * - TRIPAL_DEBUG: Debug-level messages.
  507. */
  508. public function logMessage($message, $variables = array(), $severity = TRIPAL_INFO) {
  509. // Generate a translated message.
  510. $tmessage = t($message, $variables);
  511. // If we have a job then pass along the messaging to the job.
  512. if ($this->job) {
  513. $this->job->logMessage($message, $variables, $severity);
  514. }
  515. // If we don't have a job then just use the drpual_set_message.
  516. else {
  517. // Report this message to watchdog or set a message.
  518. if ($severity == TRIPAL_CRITICAL or $severity == TRIPAL_ERROR) {
  519. drupal_set_message($tmessage, 'error');
  520. }
  521. if ($severity == TRIPAL_WARNING) {
  522. drupal_set_message($tmessage, 'warning');
  523. }
  524. }
  525. }
  526. /**
  527. * Sets the total number if items to be processed.
  528. *
  529. * This should typically be called near the beginning of the loading process
  530. * to indicate the number of items that must be processed.
  531. *
  532. * @param $total_items
  533. * The total number of items to process.
  534. */
  535. protected function setTotalItems($total_items) {
  536. $this->total_items = $total_items;
  537. }
  538. /**
  539. * Adds to the count of the total number of items that have been handled.
  540. *
  541. * @param $num_handled
  542. */
  543. protected function addItemsHandled($num_handled) {
  544. $items_handled = $this->num_handled = $this->num_handled + $num_handled;
  545. $this->setItemsHandled($items_handled);
  546. }
  547. /**
  548. * Sets the number of items that have been processed.
  549. *
  550. * This should be called anytime the loader wants to indicate how many
  551. * items have been processed. The amount of progress will be
  552. * calculated using this number. If the amount of items handled exceeds
  553. * the interval specified then the progress is reported to the user. If
  554. * this loader is associated with a job then the job progress is also updated.
  555. *
  556. * @param $total_handled
  557. * The total number of items that have been processed.
  558. */
  559. protected function setItemsHandled($total_handled) {
  560. // First set the number of items handled.
  561. $this->num_handled = $total_handled;
  562. if ($total_handled == 0) {
  563. $memory = number_format(memory_get_usage());
  564. print t("Percent complete: 0%. Memory: !memory bytes.", ['!memory' => $memory]) . "\r";
  565. return;
  566. }
  567. // Now see if we need to report to the user the percent done. A message
  568. // will be printed on the command-line if the job is run there.
  569. $percent = ($this->num_handled / $this->total_items) * 100;
  570. $ipercent = (int) $percent;
  571. // If we've reached our interval then print update info.
  572. if ($ipercent > 0 and $ipercent != $this->reported and $ipercent % $this->interval == 0) {
  573. $memory = number_format(memory_get_usage());
  574. $spercent = sprintf("%.2f", $percent);
  575. print t("Percent complete: !percent %. Memory: !memory bytes.",
  576. ['!percent' => $spercent, '!memory' => $memory]) . "\r";
  577. // If we have a job the update the job progress too.
  578. if ($this->job) {
  579. $this->job->setProgress($percent);
  580. }
  581. $this->reported = $ipercent;
  582. }
  583. }
  584. /**
  585. * Updates the percent interval when the job progress is updated.
  586. *
  587. * Updating the job progress incurrs a database write which takes time
  588. * and if it occurs to frequently can slow down the loader. This should
  589. * be a value between 0 and 100 to indicate a percent interval (e.g. 1
  590. * means update the progress every time the num_handled increases by 1%).
  591. *
  592. * @param $interval
  593. * A number between 0 and 100.
  594. */
  595. protected function setInterval($interval) {
  596. $this->interval = $interval;
  597. }
  598. // --------------------------------------------------------------------------
  599. // OVERRIDEABLE FUNCTIONS
  600. // --------------------------------------------------------------------------
  601. /**
  602. * Provides form elements to be added to the loader form.
  603. *
  604. * These form elements are added after the file uploader section that
  605. * is automaticaly provided by the TripalImporter.
  606. *
  607. * @return
  608. * A $form array.
  609. */
  610. public function form($form, &$form_state) {
  611. return $form;
  612. }
  613. /**
  614. * Handles submission of the form elements.
  615. *
  616. * The form elements provided in the implementation of the form() function
  617. * can be used for special submit if needed.
  618. */
  619. public function formSubmit($form, &$form_state) {
  620. }
  621. /**
  622. * Handles validation of the form elements.
  623. *
  624. * The form elements provided in the implementation of the form() function
  625. * should be validated using this function.
  626. */
  627. public function formValidate($form, &$form_state) {
  628. }
  629. /**
  630. * Performs the import.
  631. */
  632. public function run() {
  633. }
  634. /**
  635. * Performs the import.
  636. */
  637. public function postRun() {
  638. }
  639. /**
  640. * Retrieves the list of arguments that were provided to the importer.
  641. *
  642. * @return
  643. * The array of arguments as passed to create function.
  644. */
  645. public function getArguments() {
  646. return $this->arguments;
  647. }
  648. }