From: Roland Haeder Date: Sun, 11 Jan 2015 20:55:35 +0000 (+0100) Subject: Merge branch 'master' into refacuring/protocol_handler X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=0553b20da2815d73580a07212106ee3be7aa3407;p=hub.git Merge branch 'master' into refacuring/protocol_handler Now with latest "core". Signed-off-by: Roland Haeder Conflicts: application/hub/main/source/urls/class_CrawlerUploadedListUrlSource.php core --- 0553b20da2815d73580a07212106ee3be7aa3407 diff --cc application/hub/main/source/urls/class_CrawlerUploadedListUrlSource.php index 7063492b0,80d029b80..395ae5685 --- a/application/hub/main/source/urls/class_CrawlerUploadedListUrlSource.php +++ b/application/hub/main/source/urls/class_CrawlerUploadedListUrlSource.php @@@ -87,16 -103,12 +87,16 @@@ class CrawlerUploadedListUrlSource exte } // END - if // Read next entry - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CRAWLER-SOURCE [' . __METHOD__ . ':' . __LINE__ . ']: this->csvFileImported=' . print_r($this->csvFileImported, TRUE)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CRAWLER-SOURCE [' . __METHOD__ . ':' . __LINE__ . ']: this->csvFileImported=' . print_r($this->csvFileImported, TRUE)); $directoryEntry = $this->getDirectoryInstance()->readDirectoryExcept(array_merge(array('.htaccess', '.', '..'), $this->csvFileImported)); - // The read entry has not to be empty and extension must be '.csv' + // Debug message + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CRAWLER-SOURCE[' . __METHOD__ . ':' . __LINE__ . '] directoryEntry(' . strlen($directoryEntry) . ')=' . $directoryEntry); + + // Is it empty or wrong file extension? if ((empty($directoryEntry)) || (substr($directoryEntry, -4, 4) != '.csv')) { // Skip further processing + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CRAWLER-SOURCE[' . __METHOD__ . ':' . __LINE__ . '] directoryEntry(' . strlen($directoryEntry) . ')=' . $directoryEntry . ' - SKIPPED!'); return FALSE; } // END - if @@@ -107,23 -122,19 +110,35 @@@ return TRUE; } + /** + * Creates an instance of this class + * + * @return $sourceInstance An instance of a Source class + */ + public final static function createCrawlerUploadedListUrlSource () { + // Get new instance + $sourceInstance = new CrawlerUploadedListUrlSource(); + + // Init source + $sourceInstance->initSource('crawler', 'uploaded_list'); + + // Return the prepared instance + return $sourceInstance; + } + + /** + * Checks whether a CSV file has been loaded (added to the stack) + * + * @return $isLoaded 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))); + + // Return the result + return $isLoaded; + } + /** * Initializes the import of the CSV file which is being processed by other task * diff --cc core index 75c9f46a8,7c82fc25a..3288f03df --- a/core +++ b/core @@@ -1,1 -1,1 +1,1 @@@ - Subproject commit 75c9f46a844e78f1adeb6de63f2efe539f8e1d34 -Subproject commit 7c82fc25abc53c41e45953f4c3d9f50ed982b75c ++Subproject commit 3288f03df9e42997670846535cc0390f080599e5