Guest User

Untitled

a guest
Nov 24th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. // Load the Feeds Source object.
  2. $importer_id = 'csv_file_importer';
  3. $csvfile_path='F:/ImportFile.csv';
  4.  
  5. $source = feeds_source($importer_id);
  6.  
  7. // Load the source fetcher config.
  8. $fetcher_config = $source->getConfigFor($source->importer->fetcher);
  9. $fetcher_config['source'] = $csvfile_path;
  10. $source->setConfigFor($source->importer->fetcher, $fetcher_config);
  11. $source->save();
  12.  
  13. // Tweak the importer configuration, to enable "Process in the background".
  14. $config = array( 'process_in_background' => TRUE,);
  15. $source->importer->addConfig($config);
  16. $source->save();
  17.  
  18. $source->startImport();
Add Comment
Please, Sign In to add comment