Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Load the Feeds Source object.
- $importer_id = 'csv_file_importer';
- $csvfile_path='F:/ImportFile.csv';
- $source = feeds_source($importer_id);
- // Load the source fetcher config.
- $fetcher_config = $source->getConfigFor($source->importer->fetcher);
- $fetcher_config['source'] = $csvfile_path;
- $source->setConfigFor($source->importer->fetcher, $fetcher_config);
- $source->save();
- // Tweak the importer configuration, to enable "Process in the background".
- $config = array( 'process_in_background' => TRUE,);
- $source->importer->addConfig($config);
- $source->save();
- $source->startImport();
Add Comment
Please, Sign In to add comment