]> git.mxchange.org Git - hub.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Thu, 16 Sep 2021 02:13:14 +0000 (04:13 +0200)
committerRoland Häder <roland@mxchange.org>
Thu, 16 Sep 2021 02:13:14 +0000 (04:13 +0200)
- readCsvFileLine() returns a non-array (currently NULL) when the end-of-file
  has been reached, this needs to be respected here.

Signed-off-by: Roland Häder <roland@mxchange.org>
application/hub/classes/source/urls/class_CrawlerUploadedListUrlSource.php

index d9cfeb9bede3841d9bd4de70b01d1a4f45fcb459..7a5bf1a8851c64be73d71ec05f9864f5a947c7d7 100644 (file)
@@ -305,8 +305,16 @@ class CrawlerUploadedListUrlSource extends BaseUrlSource implements UrlSource, R
                // Read full "CSV line"
                $csvData = $csvFileInstance->readCsvFileLine($this->columnSeparator, self::CRAWL_ENTRY_SIZE);
 
+               // Is $csvData set?
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('CRAWLER-UPLOADED-LIST-URL-SOURCE: csvData[]=%s', gettype($csvData)));
+               if (!is_array($csvData)) {
+                       // Is not array, then reading the file has reached EOF
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-UPLOADED-LIST-URL-SOURCE: EXIT!');
+                       return;
+               }
+
                // 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)));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('CRAWLER-UPLOADED-LIST-URL-SOURCE: csvData(%d)=%s', count($csvData), print_r($csvData, TRUE)));
                if (count($csvData) == 0) {
                        // Try to close it by actually unsetting (destructing) it
                        /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('CRAWLER-UPLOADED-LIST-URL-SOURCE: File "%s" has been fully read.', $csvFileInstance->getFilename()));