Exemplo n.º 1
0
 public function testCatMultiRoot()
 {
     $conf = Magmi_Config::getInstance();
     $conf->load(__DIR__ . "/test.ini");
     $dp = Magmi_DataPumpFactory::getDataPumpInstance("productimport");
     $reader = new Magmi_CSVReader();
     $reader->initialize(array("CSV:filename" => __DIR__ . '/categories/category_multiroot.csv'));
     $reader->openCSV();
     $reader->getColumnNames();
     $dp->beginImportSession("catconf", "create", new FileLogger(__DIR__ . '/test.log'));
     while ($item = $reader->getNextRecord()) {
         $dp->ingest($item);
     }
     $dp->endImportSession();
     $reader->closeCSV();
 }
Exemplo n.º 2
0
<?php
$f = fopen(__DIR__.'/magento_csv/t1.csv','r');
var_dump(fgetcsv($f));
die('HI');
require 'include/magmi_csvreader.php';
$magmiCsv = new Magmi_CSVReader();
$magmiCsv->initialize(__DIR__.'/magento_csv/last_import.csv');
$magmiCsv->openCsv();
$column_names = $magmiCsv->getColumnNames();
$c=0;
while (true) {
   $row = $magmiCsv->getNextRecord();
   if ($row == false) break;
   file_put_contents(__DIR__.'/log/'.$c++.'.txt',var_export($row,true));
}