* Initializes the import of the CSV file which is being processed by other task
*
* @return void
- * @throws NullPointerException If lastCsvFileInstance is not set
*/
private function addCsvFile () {
- // Is the instance set?
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-UPLOADED-LIST-URL-SOURCE: CALLED!');
- if (is_null($this->lastCsvFileInstance)) {
- // This should not happen
- throw new NullPointerException($this, self::EXCEPTION_IS_NULL_POINTER);
- } elseif ($this->isLastCsvFileImported()) {
- // Already stacked
- return;
- }
-
// Stack this file
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-UPLOADED-LIST-URL-SOURCE: this->lastCsvFileInstance=' . $this->lastCsvFileInstance);
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('CRAWLER-UPLOADED-LIST-URL-SOURCE: this->lastCsvFileInstance=%s - CALLED!', $this->lastCsvFileInstance->__toString()));
$this->getStackSourceInstance()->pushNamed(self::STACK_NAME_CSV_FILE, $this->lastCsvFileInstance);
// ... and mark it as "imported"
*/
public function fillUrlStack () {
// Does the stack have some entries left?
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-UPLOADED-LIST-URL-SOURCE: CALLED!');
if ($this->isCsvEntryAdded()) {
/*
* A CSV file has been found and "imported" (added to stack). Now
* the file can be read line by line and checked every one of it.
*/
$this->parseCsvFile();
- } elseif ($this->isCsvFileFound()) {
+ } elseif ($this->isCsvFileFound() && !$this->isLastCsvFileImported()) {
/*
* A file containing an URL list is found. Please note the format is
* CSV-like as you may wish to provide meta data such as crawl
}
$this->partialStub('Please implement this method.');
+
+ // Trace message
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-UPLOADED-LIST-URL-SOURCE: EXIT!');
}
}