use Org\Mxchange\CoreFramework\Registry\Registerable;
// Import SPL stuff
+use \OutOfBoundsException;
use \SplFileInfo;
/**
private function saveCsvDataInCrawlerQueue (array $csvData) {
// The array must have a fixed amount of elements, later enhancements may accept more
/* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-UPLOADED-LIST-URL-SOURCE: csvData()=' . count($csvData) . ' - CALLED!');
- assert(count($csvData) == self::CRAWL_ENTRY_SIZE);
+ assert(count($csvData) == self::CRAWL_ENTRY_SIZE, sprintf('csvData has unexpected size %d/%d', count($csvData), self::CRAWL_ENTRY_SIZE));
/*
* First converted the indexed array into an assoziative array. Don't
$csvFileInstance = $this->getStackSourceInstance()->popNamed(self::STACK_NAME_CSV_FILE);
// Read full "CSV line"
- $csvData = $csvFileInstance->readCsvFileLine($this->columnSeparator);
+ $csvData = $csvFileInstance->readCsvFileLine($this->columnSeparator, self::CRAWL_ENTRY_SIZE);
// Is the array empty?
/* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('CRAWLER-UPLOADED-LIST-URL-SOURCE: csvData[%s]=%s', gettype($csvData), print_r($csvData, TRUE)));
}
// ... with a fixed amount of elements, later enhancements may accept more
- assert(count($csvData) == self::CRAWL_ENTRY_SIZE);
+ assert(count($csvData) == self::CRAWL_ENTRY_SIZE, sprintf('csvData has unexpected size %d/%d', count($csvData), self::CRAWL_ENTRY_SIZE));
/*
* Push the file back on stack as it may contain more entries. This way
// It must have a fixed amount of elements (see method parseCsvFile() for details)
/* PRINTR-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-UPLOADED-LIST-URL-SOURCE: csvData[' . gettype($csvData) . ']=' . print_r($csvData, TRUE));
- assert(count($csvData) == self::CRAWL_ENTRY_SIZE);
+ assert(count($csvData) == self::CRAWL_ENTRY_SIZE, sprintf('csvData has unexpected size %d/%d', count($csvData), self::CRAWL_ENTRY_SIZE));
// Save it in crawler queue (which will enrich it with way more informations
$this->saveCsvDataInCrawlerQueue($csvData);