]> git.mxchange.org Git - hub.git/blobdiff - application/hub/main/source/urls/class_CrawlerUploadedListUrlSource.php
Continued with crawler:
[hub.git] / application / hub / main / source / urls / class_CrawlerUploadedListUrlSource.php
index 02ff77f32eb81c9c73f8f766db080acb776dc264..dd5ff03bcd9db1761e5ecaa168adc93abde7042b 100644 (file)
@@ -161,6 +161,20 @@ class CrawlerUploadedListUrlSource extends BaseUrlSource implements UrlSource, R
                // Debug message
                /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CRAWLER-SOURCE [' . __METHOD__ . ':' . __LINE__ . ']: csvData()=' . count($csvData) . ' - CALLED!');
 
+               // The array has 3 elements, later enhancements may accept more
+               assert(count($csvData) == self::CRAWL_ENTRY_SIZE);
+
+               /*
+                * First converted the indexed array into an assoziative array. Don't
+                * forget to expand this array as well when you want to add another
+                * column to the CSV file.
+                */
+               $csvArray = array(
+                       self::CRAWL_JOB_ARRAY_START_URL      => $csvData[0],
+                       self::CRAWL_JOB_ARRAY_DEPTH          => $csvData[1],
+                       self::CRAWL_JOB_ARRAY_EXTERNAL_DEPTH => $csvData[2]
+               );
+
                // Debug message
                /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CRAWLER-SOURCE [' . __METHOD__ . ':' . __LINE__ . ']: EXIT!');
        }
@@ -168,27 +182,27 @@ class CrawlerUploadedListUrlSource extends BaseUrlSource implements UrlSource, R
        /**
         * Checks whether a CSV file has been loaded (added to the stack)
         *
-        * @return      $isLoaded       Whether a CSV file has been loaded
+        * @return      $isAdded        Whether a CSV file has been loaded
         */
        private function isCsvFileAdded () {
                // Check whether the stacker is not empty
-               $isLoaded = (($this->getStackSourceInstance()->isStackInitialized(self::STACK_NAME_CSV_FILE)) && (!$this->getStackSourceInstance()->isStackEmpty(self::STACK_NAME_CSV_FILE)));
+               $isAdded = (($this->getStackSourceInstance()->isStackInitialized(self::STACK_NAME_CSV_FILE)) && (!$this->getStackSourceInstance()->isStackEmpty(self::STACK_NAME_CSV_FILE)));
 
                // Return the result
-               return $isLoaded;
+               return $isAdded;
        }
 
        /**
         * Checks whether a CSV entry has been added to the stack
         *
-        * @return      $isLoaded       Whether a CSV entry has been added
+        * @return      $isAdded        Whether a CSV entry has been added
         */
        private function isCsvEntryAdded () {
                // Check whether the stacker is not empty
-               $isLoaded = (($this->getStackSourceInstance()->isStackInitialized(self::STACK_NAME_CSV_ENTRY)) && (!$this->getStackSourceInstance()->isStackEmpty(self::STACK_NAME_CSV_ENTRY)));
+               $isAdded = (($this->getStackSourceInstance()->isStackInitialized(self::STACK_NAME_CSV_ENTRY)) && (!$this->getStackSourceInstance()->isStackEmpty(self::STACK_NAME_CSV_ENTRY)));
 
                // Return the result
-               return $isLoaded;
+               return $isAdded;
        }
 
        /**