]> git.mxchange.org Git - hub.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Sat, 5 Dec 2020 23:57:54 +0000 (00:57 +0100)
committerRoland Häder <roland@mxchange.org>
Sun, 6 Dec 2020 01:24:59 +0000 (02:24 +0100)
- removed deprecated ?> PHP tag close
- improved some logger messages
- updated core framework

Signed-off-by: Roland Häder <roland@mxchange.org>
application/hub/classes/iterator/pool/monitor/class_MonitorPoolIterator.php
application/hub/classes/iterator/pool/shutdown/class_ShutdownPoolIterator.php
application/hub/classes/source/urls/class_CrawlerUploadedListUrlSource.php
core

index f8784f2116276ba2d89c159ad35f0349ed100bd7..8cc1e41e7f48e9d298f9b2671bbf55787cd44b63 100644 (file)
@@ -129,7 +129,5 @@ class MonitorPoolIterator extends BaseIterator implements Iterator, Registerable
                // Return result
                return $isValid;
        }
-}
 
-// [EOF]
-?>
+}
index 9300f66ae6e43c3f12f8e68cbf917c64255f57b5..2ed3dec88bde476c776de604fb0191688208cf25 100644 (file)
@@ -126,7 +126,5 @@ class ShutdownPoolIterator extends BaseIterator implements Iterator {
                // Return result
                return $isValid;
        }
-}
 
-// [EOF]
-?>
+}
index 60aaf6501e91419d02afb7cdfc0c16e14fb4f540..325d19d533729cc6ee54e61136ddfc0503a2982b 100644 (file)
@@ -165,22 +165,20 @@ class CrawlerUploadedListUrlSource extends BaseUrlSource implements UrlSource, R
                // Is it valid?
                /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-UPLOADED-LIST-URL-SOURCE: CALLED!');
                if (!$this->getDirectoryInstance()->getDirectoryIteratorInstance()->valid()) {
-                       // Debug message
-                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-UPLOADED-LIST-URL-SOURCE: Rewinding iterator ...');
-
                        // Rewind to start
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-UPLOADED-LIST-URL-SOURCE: Rewinding iterator ...');
                        $this->getDirectoryInstance()->getDirectoryIteratorInstance()->rewind();
                }
 
                // Read next entry
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-UPLOADED-LIST-URL-SOURCE: this->csvFileImported=' . print_r($this->csvFileImported, TRUE));
-               $directoryEntry = $this->getDirectoryInstance()->readDirectoryExcept(array_merge(array('.htaccess', '.', '..'), $this->csvFileImported));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('CRAWLER-UPLOADED-LIST-URL-SOURCE: this->csvFileImported=%s', print_r($this->csvFileImported, TRUE)));
+               $directoryEntry = $this->getDirectoryInstance()->readDirectoryExcept(array_merge(['.htaccess', '.', '..'], $this->csvFileImported));
 
                // Is it empty or wrong file extension?
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-UPLOADED-LIST-URL-SOURCE: directoryEntry(' . strlen($directoryEntry) . ')=' . $directoryEntry);
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('CRAWLER-UPLOADED-LIST-URL-SOURCE: directoryEntry(%d)=%s', strlen($directoryEntry), $directoryEntry));
                if ((empty($directoryEntry)) || (substr($directoryEntry, -4, 4) != '.csv')) {
                        // Skip further processing
-                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-UPLOADED-LIST-URL-SOURCE: directoryEntry(' . strlen($directoryEntry) . ')=' . $directoryEntry . ' - SKIPPED!');
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('CRAWLER-UPLOADED-LIST-URL-SOURCE: directoryEntry(%d)=%s, returning FALSE ... - EXIT!', strlen($directoryEntry), $directoryEntry));
                        return FALSE;
                }
 
@@ -326,18 +324,11 @@ class CrawlerUploadedListUrlSource extends BaseUrlSource implements UrlSource, R
                // Read full "CSV line"
                $csvData = $csvFileInstance->readCsvFileLine($this->columnSeparator);
 
-               // Debug message
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-UPLOADED-LIST-URL-SOURCE: csvData[' . gettype($csvData) . ']=' . print_r($csvData, TRUE));
-
-               // Expect always an array
-               assert(is_array($csvData));
-
                // 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)));
                if (count($csvData) == 0) {
-                       // Debug message
-                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-UPLOADED-LIST-URL-SOURCE: File ' . $csvFileInstance->getFilename() . ' has been fully read.');
-
                        // 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()));
                        unset($csvFileInstance);
 
                        // This file as been fully read, so don't push it back on stack.
diff --git a/core b/core
index c1841c5d8ad644456ea408caf315e858d89fc555..5a6770f3b6d3da3e22297844d8077dc2aba4663b 160000 (submodule)
--- a/core
+++ b/core
@@ -1 +1 @@
-Subproject commit c1841c5d8ad644456ea408caf315e858d89fc555
+Subproject commit 5a6770f3b6d3da3e22297844d8077dc2aba4663b