You are here

protected function MigrateSourceCSV::getNextLine in Migrate 6.2

Same name and namespace in other branches
  1. 7.2 plugins/sources/csv.inc \MigrateSourceCSV::getNextLine()
4 calls to MigrateSourceCSV::getNextLine()
MigrateSourceCSV::computeCount in plugins/sources/csv.inc
Return a count of all available source records.
MigrateSourceCSV::getNextRow in plugins/sources/csv.inc
Implementation of MigrateSource::getNextRow(). Return the next line of the source CSV file as an object.
MigrateSourceCSV::performRewind in plugins/sources/csv.inc
Implementation of MigrateSource::performRewind().
MigrateSourceCSV::__construct in plugins/sources/csv.inc
Simple initialization.

File

plugins/sources/csv.inc, line 197
Define a MigrateSource for importing from comma separated values files.

Class

MigrateSourceCSV
Implementation of MigrateSource, to handle imports from CSV files.

Code

protected function getNextLine() {

  // escape parameter was added in PHP 5.3.
  if (version_compare(phpversion(), '5.3', '<')) {
    $row = fgetcsv($this->csvHandle, $this->fgetcsv['length'], $this->fgetcsv['delimiter'], $this->fgetcsv['enclosure']);
  }
  else {
    $row = fgetcsv($this->csvHandle, $this->fgetcsv['length'], $this->fgetcsv['delimiter'], $this->fgetcsv['enclosure'], $this->fgetcsv['escape']);
  }
  return $row;
}