]> 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 dd5ff03bcd9db1761e5ecaa168adc93abde7042b..749c3f631ed66821cb3da2b55c6aff0f6e930851 100644 (file)
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 class CrawlerUploadedListUrlSource extends BaseUrlSource implements UrlSource, Registerable {
-       /**
-        * "Cached" CSV path
-        */
-       private $csvFilePath = '';
-
-       /**
-        * Last CSV file instance
-        */
-       private $lastCsvFileInstance = NULL;
-
-       /**
-        * Stack for pushing data from this clas to another
-        */
-       private $stackSourceInstance = NULL;
-
        /**
         * Stack name for a CSV file
         */
@@ -56,6 +41,21 @@ class CrawlerUploadedListUrlSource extends BaseUrlSource implements UrlSource, R
         */
        const CRAWL_ENTRY_SIZE = 3;
 
+       /**
+        * "Cached" CSV path
+        */
+       private $csvFilePath = '';
+
+       /**
+        * Last CSV file instance
+        */
+       private $lastCsvFileInstance = NULL;
+
+       /**
+        * Stack for pushing data from this clas to another
+        */
+       private $stackSourceInstance = NULL;
+
        /**
         * "Imported" CSV files
         */
@@ -175,6 +175,9 @@ class CrawlerUploadedListUrlSource extends BaseUrlSource implements UrlSource, R
                        self::CRAWL_JOB_ARRAY_EXTERNAL_DEPTH => $csvData[2]
                );
 
+               // Then add more data to it
+               $this->enrichCrawlerQueueData($csvData);
+
                // Debug message
                /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CRAWLER-SOURCE [' . __METHOD__ . ':' . __LINE__ . ']: EXIT!');
        }
@@ -318,12 +321,12 @@ class CrawlerUploadedListUrlSource extends BaseUrlSource implements UrlSource, R
        }
 
        /**
-        * Processes entries in the stack.
+        * Fills the URL stack with new entries from source
         *
         * @return      void
-        * @todo        ~20% done
+        * @todo        ~40% done
         */
-       public function processStack () {
+       public function fillUrlStack () {
                // Does the stack have some entries left?
                if ($this->isCsvEntryAdded()) {
                        /*
@@ -344,12 +347,6 @@ class CrawlerUploadedListUrlSource extends BaseUrlSource implements UrlSource, R
                         * depth, handling of 3rd-party URLs and such.
                         */
                        $this->addCsvFile();
-               } elseif (!$this->isUrlStackEmpty()) {
-                       /*
-                        * Handle next entry. This method will be called very often, so need
-                        * to process more than one entry at a time.
-                        */
-                       $this->processNextEntry();
                }
 
                $this->partialStub('Please implement this method.');