// Import application-specific stuff
use Org\ShipSimu\Hub\Communicator\Communicator;
use Org\Shipsimu\Hub\Container\Socket\StorableSocket;
-use Org\Shipsimu\Hub\Crawler\Crawler;
use Org\Shipsimu\Hub\Crawler\Source\Source;
-use Org\Shipsimu\Hub\Crawler\Source\Url\UrlSource;
use Org\Shipsimu\Hub\Handler\Protocol\HandleableProtocol;
use Org\Shipsimu\Hub\Handler\Network\RawData\HandleableRawData;
use Org\Shipsimu\Hub\Information\ShareableInfo;
*/
private $sourceInstance = NULL;
- /**
- * An instance of a UrlSource class
- */
- private $urlSourceInstance = NULL;
-
- /**
- * An instance of a Crawler class
- */
- private $crawlerInstance = NULL;
-
/**
* Name of used protocol
*/
return $this->sourceInstance;
}
- /**
- * Setter for a UrlSource instance
- *
- * @param $urlSourceInstance An instance of a UrlSource class
- * @return void
- */
- public final function setUrlSourceInstance (UrlSource $urlSourceInstance) {
- $this->urlSourceInstance = $urlSourceInstance;
- }
-
- /**
- * Getter for a UrlSource instance
- *
- * @return $urlSourceInstance An instance of a UrlSource class
- */
- public final function getUrlSourceInstance () {
- return $this->urlSourceInstance;
- }
-
- /**
- * Setter for a Crawler instance
- *
- * @param $crawlerInstance An instance of a Crawler class
- * @return void
- */
- protected final function setCrawlerInstance (Crawler $crawlerInstance) {
- $this->crawlerInstance = $crawlerInstance;
- }
-
- /**
- * Getter for a Crawler instance
- *
- * @return $crawlerInstance An instance of a Crawler class
- */
- protected final function getCrawlerInstance () {
- return $this->crawlerInstance;
- }
-
}
// Get a registry
$applicationInstance = GenericRegistry::getRegistry()->getInstance('application');
- // Set the app instance
- $nodeInstance->setApplicationInstance($applicationInstance);
-
// Add node-specific filters
$nodeInstance->addExtraFilters($applicationInstance->getControllerInstance(), $responseInstance);
+++ /dev/null
-Deny from all
+++ /dev/null
-<?php
-// Own namespace
-namespace Org\Shipsimu\Hub\Factory\Scanner;
-
-// Import framework stuff
-use Org\Mxchange\CoreFramework\Factory\ObjectFactory;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
-use Org\Mxchange\CoreFramework\Task\Taskable;
-
-/**
- * A factory class for scanners
- *
- * @author Roland Haeder <webmaster@shipsimu.org>
- * @version 0.0.0
- * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2015 Hub Developer Team
- * @license GNU GPL 3.0 or any newer version
- * @link http://www.shipsimu.org
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-class ScannerObjectFactory extends ObjectFactory {
- /**
- * Protected constructor
- *
- * @return void
- */
- protected function __construct () {
- // Call parent constructor
- parent::__construct(__CLASS__);
- }
-
- /**
- * Returns a singleton (registry-based) Scanner instance
- *
- * @param $taskInstance An instance of a class with an Taskable interface
- * @return $sourceInstance An instance of a Scanner class
- */
- public static final function createScannerInstance (Taskable $taskInstance) {
- // Get new factory instance
- $factoryInstance = new ScannerObjectFactory();
-
- // Get task handler instance
- $handlerInstance = GenericRegistry::getRegistry()->getInstance('task_handler');
-
- // Get scanner type for given task instance by searching it in task handler
- $scannerType = $handlerInstance->searchTask($taskInstance);
-
- // Only let registered tasks pass
- assert(!empty($scannerType));
-
- // If there is no handler?
- if (GenericRegistry::getRegistry()->instanceExists('scanner_' . $scannerType)) {
- // Get handler from registry
- $scannerInstance = GenericRegistry::getRegistry()->getInstance('scanner_' . $scannerType);
- } else {
- // Get the scanner instance
- $scannerInstance = ObjectFactory::createObjectByConfiguredName($scannerType);
-
- // Add it to the registry
- GenericRegistry::getRegistry()->addInstance('scanner_' . $scannerType, $scannerInstance);
- }
-
- // Return the instance
- return $scannerInstance;
- }
-
-}
// Get a registry
$applicationInstance = GenericRegistry::getRegistry()->getInstance('application');
- // Set the app instance
- $proxyInstance->setApplicationInstance($applicationInstance);
-
// Add apt-proxy-specific filters
$proxyInstance->addExtraFilters($applicationInstance->getControllerInstance(), $responseInstance);
// Get a registry
$applicationInstance = GenericRegistry::getRegistry()->getInstance('application');
- // Set the app instance
- $chatInstance->setApplicationInstance($applicationInstance);
-
// Add chat-specific filters
$chatInstance->addExtraFilters($applicationInstance->getControllerInstance(), $responseInstance);
// Get a registry
$applicationInstance = GenericRegistry::getRegistry()->getInstance('application');
- // Set the app instance
- $crawlerInstance->setApplicationInstance($applicationInstance);
-
// Add crawler-specific filters
$crawlerInstance->addExtraFilters($applicationInstance->getControllerInstance(), $responseInstance);
}
// Get a registry
$applicationInstance = GenericRegistry::getRegistry()->getInstance('application');
- // Set the app instance
- $cruncherInstance->setApplicationInstance($applicationInstance);
-
// Add cruncher-specific filters
$cruncherInstance->addExtraFilters($applicationInstance->getControllerInstance(), $responseInstance);
} catch (ClassNotFoundException $e) {
// Get a registry
$applicationInstance = GenericRegistry::getRegistry()->getInstance('application');
- // Set the app instance
- $minerInstance->setApplicationInstance($applicationInstance);
-
// Add miner-specific filters
$minerInstance->addExtraFilters($applicationInstance->getControllerInstance(), $responseInstance);
} catch (ClassNotFoundException $e) {
// Get a new task handler instance
$handlerInstance = ObjectFactory::createObjectByConfiguredName('task_handler_class');
- // Put the task handler in registry
- GenericRegistry::getRegistry()->addInstance('task_handler', $handlerInstance);
-
/*
* Register all tasks:
*
// 10) URL sources
foreach (explode(':', $this->getConfigInstance()->getConfigEntry('crawler_url_stacks')) as $stack) {
// Init task instance
- $taskInstance = ObjectFactory::createObjectByConfiguredName('crawler_url_source_' . $stack . '_task_class', array($crawlerInstance));
+ $taskInstance = ObjectFactory::createObjectByConfiguredName('crawler_url_source_' . $stack . '_task_class');
// And register it
$handlerInstance->registerTask('crawler_url_source_' . $stack, $taskInstance);
} // END - foreach
- // 11) Uploaded list scanner (checks for wanted files)
- $taskInstance = ObjectFactory::createObjectByConfiguredName('crawler_uploaded_list_scanner_task_class');
- $handlerInstance->registerTask('crawler_uploaded_list_scanner', $taskInstance);
+ // Put the task handler in registry
+ GenericRegistry::getRegistry()->addInstance('task_handler', $handlerInstance);
}
}
// Set namespace and application instance
$resolverInstance->setNamespace('Org\Shipsimu\Hub\Command');
- $resolverInstance->setApplicationInstance($applicationInstance);
+ $resolverInstance->setCommandName($commandName);
// Return the prepared instance
return $resolverInstance;
}
-}
-// [EOF]
-?>
+}
// Set namespace and application instance
$resolverInstance->setNamespace('Org\Shipsimu\Hub\Command');
- $resolverInstance->setApplicationInstance($applicationInstance);
+ $resolverInstance->setCommandName($commandName);
// Return the prepared instance
return $resolverInstance;
}
-}
-// [EOF]
-?>
+}
throw new InvalidControllerException(array($resolverInstance, $controllerName), self::EXCEPTION_INVALID_CONTROLLER);
}
- // Set the application instance
- $resolverInstance->setApplicationInstance($applicationInstance);
-
// Set namespace and command name
$resolverInstance->setNamespace('Org\Shipsimu\Hub\Controller');
$resolverInstance->setControllerName($controllerName);
// Return the maybe resolved instance
return $controllerInstance;
}
-}
-// [EOF]
-?>
+}
throw new InvalidControllerException(array($resolverInstance, $controllerName), self::EXCEPTION_INVALID_CONTROLLER);
}
- // Set the application instance
- $resolverInstance->setApplicationInstance($applicationInstance);
-
// Set namespace and command name
$resolverInstance->setNamespace('Org\Shipsimu\Hub\Controller');
$resolverInstance->setControllerName($controllerName);
// Return the maybe resolved instance
return $controllerInstance;
}
-}
-// [EOF]
-?>
+}
+++ /dev/null
-Deny from all
+++ /dev/null
-<?php
-/**
- * A ??? scanner class
- *
- * @author Roland Haeder <webmaster@ship-simu.org>
- * @version 0.0.0
- * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2015 Hub Developer Team
- * @license GNU GPL 3.0 or any newer version
- * @link http://www.ship-simu.org
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-class ???Scanner extends BaseScanner implements Scanner, Registerable {
- /**
- * Protected constructor
- *
- * @return void
- */
- protected function __construct () {
- // Call parent constructor
- parent::__construct(__CLASS__);
- }
-
- /**
- * Creates an instance of this class
- *
- * @return $scannerInstance An instance of a Scanner class
- */
- public final static function create???Scanner () {
- // Get new instance
- $scannerInstance = new ???Scanner();
-
- // Return the prepared instance
- return $scannerInstance;
- }
-
- /**
- * Runs the scanner (please no loops here)
- *
- * @return void
- * @todo 0% done
- */
- public function execute () {
- $this->partialStub('Please implement this method.');
- }
-}
-
-// [EOF]
-?>
+++ /dev/null
-<?php
-// Own namespace
-namespace Org\Shipsimu\Hub\Scanner;
-
-// Import application-specific stuff
-use Org\Shipsimu\Hub\Generic\BaseHubSystem;
-
-/**
- * A general scanner class
- *
- * @author Roland Haeder <webmaster@ship-simu.org>
- * @version 0.0.0
- * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2015 Hub Developer Team
- * @license GNU GPL 3.0 or any newer version
- * @link http://www.ship-simu.org
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-abstract class BaseScanner extends BaseHubSystem {
- /**
- * Protected constructor
- *
- * @param $className Name of the class
- * @return void
- */
- protected function __construct ($className) {
- // Call parent constructor
- parent::__construct($className);
- }
-
-}
+++ /dev/null
-Deny from all
+++ /dev/null
-<?php
-/**
- * A ??? scanner class for crawlers
- *
- * @author Roland Haeder <webmaster@ship-simu.org>
- * @version 0.0.0
- * @copyright Copyright (c) 2014 Crawler Developer Team
- * @license GNU GPL 3.0 or any newer version
- * @link http://www.ship-simu.org
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-class Crawler???Scanner extends BaseScanner implements Scanner, Registerable {
- /**
- * Protected constructor
- *
- * @return void
- */
- protected function __construct () {
- // Call parent constructor
- parent::__construct(__CLASS__);
- }
-
- /**
- * Creates an instance of this class
- *
- * @return $scannerInstance An instance of a Scanner class
- */
- public final static function createCrawler???Scanner () {
- // Get new instance
- $scannerInstance = new Crawler???Scanner();
-
- // Return the prepared instance
- return $scannerInstance;
- }
-
- /**
- * Runs the scanner (please no loops here)
- *
- * @return void
- * @todo 0% done
- */
- public function execute () {
- $this->partialStub('Please implement this method.');
- }
-}
-
-// [EOF]
-?>
+++ /dev/null
-Deny from all
+++ /dev/null
-<?php
-// Own namespace
-namespace Org\Shipsimu\Hub\Crawler\Scanner\UploadedList;
-
-// Import application-specific stuff
-use Org\Shipsimu\Hub\Scanner\BaseScanner;
-use Org\Shipsimu\Hub\Scanner\Scanner;
-
-// Import framework stuff
-use Org\Mxchange\CoreFramework\Registry\Registerable;
-
-/**
- * A UploadedList scanner class for crawlers
- *
- * @author Roland Haeder <webmaster@ship-simu.org>
- * @version 0.0.0
- * @copyright Copyright (c) 2014 Crawler Developer Team
- * @license GNU GPL 3.0 or any newer version
- * @link http://www.ship-simu.org
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-class CrawlerUploadedListScanner extends BaseScanner implements Scanner, Registerable {
- /**
- * Protected constructor
- *
- * @return void
- */
- protected function __construct () {
- // Call parent constructor
- parent::__construct(__CLASS__);
- }
-
- /**
- * Creates an instance of this class
- *
- * @return $scannerInstance An instance of a Scanner class
- */
- public final static function createCrawlerUploadedListScanner () {
- // Get new instance
- $scannerInstance = new CrawlerUploadedListScanner();
-
- // Return the prepared instance
- return $scannerInstance;
- }
-
- /**
- * Runs the scanner (please no loops here)
- *
- * @return void
- * @todo 0% done
- */
- public function execute () {
- $this->partialStub('Please implement this method.');
- }
-}
-
-// [EOF]
-?>
* @return void
*/
protected function initSource ($prefix, $sourceName) {
+ // Trace message
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-SOURCE: prefix=' . $prefix . ',sourceName=' . $sourceName . ' - CALLED!');
+
// Use another object factory
$stackInstance = FileStackFactory::createFileStackInstance($prefix . '_url', $sourceName);
// Set the stack here
$this->setStackInstance($stackInstance);
+
+ // Trace message
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-SOURCE: EXIT!');
}
/**
*
* @param $crawlData Array with partial data for being queued
* @return void
- * @todo ~10% done
+ * @todo ~1% done
*/
protected function enrichCrawlerQueueData (array &$crawlData) {
// Debug message
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-SOURCE : crawlData()=' . count($crawlData) . ' - CALLED!');
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-SOURCE: crawlData()=' . count($crawlData) . ' - CALLED!');
// Check for minimum array elements
assert(isset($crawlData[self::CRAWL_JOB_ARRAY_START_URL]));
// @TODO Add more elements
// Debug message
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-SOURCE : EXIT!');
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-SOURCE: EXIT!');
}
/**
*/
protected function enqueueInFileStack (array $crawlData) {
// Debug message
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-SOURCE : crawlData()=' . count($crawlData) . ' - CALLED!');
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-SOURCE: crawlData()=' . count($crawlData) . ' - CALLED!');
// Get the stack instance and enqueue it
$this->getStackInstance()->pushNamed(self::STACKER_NAME_URLS, $crawlData);
// Debug message
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-SOURCE : EXIT!');
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-SOURCE: EXIT!');
}
}
use Org\Mxchange\CoreFramework\Generic\NullPointerException;
use Org\Mxchange\CoreFramework\Registry\Registerable;
+// Import SPL stuff
+use \SplFileInfo;
+
/**
* A UploadedList URL source class for crawlers
*
parent::__construct(__CLASS__);
// "Cache" CSV path for faster usage
- $this->csvFilePath = $this->getConfigInstance()->getConfigEntry('root_base_path') . '/' . $this->getConfigInstance()->getConfigEntry('crawler_csv_file_path');
+ $this->csvFilePath = $this->getConfigInstance()->getConfigEntry('root_base_path') . $this->getConfigInstance()->getConfigEntry('crawler_csv_file_path');
+
+ // Debug message
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-SOURCE: this->csvFilePath=' . $this->csvFilePath);
// Initialize directory instance
$directoryInstance = ObjectFactory::createObjectByConfiguredName('directory_class', array($this->csvFilePath));
// "Cache" column separator
$this->columnSeparator = $this->getConfigInstance()->getConfigEntry('crawler_url_list_column_separator');
+
+ // Debug message
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-SOURCE: Finished contructing object.');
}
/**
* @return $isFound Whether a CSV file is found
*/
private function isCsvFileFound () {
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-SOURCE : CALLED!');
+ // Trace message
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-SOURCE: CALLED!');
// Is it valid?
if (!$this->getDirectoryInstance()->getDirectoryIteratorInstance()->valid()) {
+ // Debug message
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-SOURCE: Rewinding iterator ...');
+
// Rewind to start
$this->getDirectoryInstance()->getDirectoryIteratorInstance()->rewind();
} // END - if
// Read next entry
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-SOURCE : this->csvFileImported=' . print_r($this->csvFileImported, TRUE));
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-SOURCE: this->csvFileImported=' . print_r($this->csvFileImported, TRUE));
$directoryEntry = $this->getDirectoryInstance()->readDirectoryExcept(array_merge(array('.htaccess', '.', '..'), $this->csvFileImported));
// Debug message
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-SOURCE directoryEntry(' . strlen($directoryEntry) . ')=' . $directoryEntry);
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-SOURCE: 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__, __LINE__)->debugOutput('CRAWLER-SOURCE directoryEntry(' . strlen($directoryEntry) . ')=' . $directoryEntry . ' - SKIPPED!');
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-SOURCE: directoryEntry(' . strlen($directoryEntry) . ')=' . $directoryEntry . ' - SKIPPED!');
return FALSE;
} // END - if
+ // Init SPL file instance
+ $infoInstance = new SplFileInfo($this->csvFilePath . '/' . $directoryEntry);
+
// Initialize CSV file instance
- $this->lastCsvFileInstance = ObjectFactory::createObjectByConfiguredName('csv_input_file_class', array($this->csvFilePath . '/' . $directoryEntry));
+ $this->lastCsvFileInstance = ObjectFactory::createObjectByConfiguredName('csv_input_file_class', array($infoInstance));
// Debug message
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-SOURCE directoryEntry(' . strlen($directoryEntry) . ')=' . $directoryEntry . ' - Instance created - EXIT!');
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-SOURCE: directoryEntry(' . strlen($directoryEntry) . ')=' . $directoryEntry . ' - Instance created - EXIT!');
// Found an entry
return TRUE;
* @return $sourceInstance An instance of an UrlSource class
*/
public final static function createCrawlerUploadedListUrlSource () {
+ // Debug message
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-SOURCE: - CONSTRUCTOR!');
+
// Get new instance
$sourceInstance = new CrawlerUploadedListUrlSource();
*/
private function saveCsvDataInCrawlerQueue (array $csvData) {
// Debug message
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-SOURCE : csvData()=' . count($csvData) . ' - CALLED!');
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-SOURCE: csvData()=' . count($csvData) . ' - CALLED!');
// The array must have a fixed amount of elements, later enhancements may accept more
assert(count($csvData) == self::CRAWL_ENTRY_SIZE);
);
// Debug message
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-SOURCE : csvArray()=' . count($csvArray) . ' - BEFORE!');
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-SOURCE: csvArray()=' . count($csvArray) . ' - BEFORE!');
// Then add more data to it
$this->enrichCrawlerQueueData($csvArray);
// Debug message
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-SOURCE : csvArray()=' . count($csvArray) . ' - AFTER!');
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-SOURCE: csvArray()=' . count($csvArray) . ' - AFTER!');
/*
* Then enqueue it in the file stack. The local crawler "task" will
$this->enqueueInFileStack($csvArray);
// Debug message
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-SOURCE : EXIT!');
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-SOURCE: EXIT!');
}
/**
* @throws NullPointerException If lastCsvFileInstance is not set
*/
private function addCsvFile () {
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-SOURCE : CALLED!');
+ // Trace message
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-SOURCE: CALLED!');
// Is the instance set?
if (is_null($this->lastCsvFileInstance)) {
// This should not happen
throw new NullPointerException($this, self::EXCEPTION_IS_NULL_POINTER);
- } // END - if
+ } elseif (in_array($this->lastCsvFileInstance->getFileObject()->getBasename(), $this->csvFileImported)) {
+ // Already stacked
+ return;
+ }
+
+ // Debug message
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-SOURCE: this->lastCsvFileInstance=' . $this->lastCsvFileInstance);
// Stack this file
$this->getStackSourceInstance()->pushNamed(self::STACK_NAME_CSV_FILE, $this->lastCsvFileInstance);
// ... and mark it as "imported"
- array_push($this->csvFileImported, basename($this->lastCsvFileInstance->getFileName()));
+ array_push($this->csvFileImported, $this->lastCsvFileInstance->getFileObject()->getBasename());
// ... and finally NULL it (to save some RAM)
$this->lastCsvFileInstance = NULL;
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-SOURCE : EXIT!');
+ // Trace message
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-SOURCE: EXIT!');
}
/**
*/
private function parseCsvFile () {
// Debug message
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-SOURCE : CALLED!');
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-SOURCE: CALLED!');
// Get next entry
$csvFileInstance = $this->getStackSourceInstance()->popNamed(self::STACK_NAME_CSV_FILE);
$csvData = $csvFileInstance->readCsvFileLine($this->columnSeparator);
// Debug message
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-SOURCE : csvData[' . gettype($csvData) . ']=' . print_r($csvData, TRUE));
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-SOURCE: csvData[' . gettype($csvData) . ']=' . print_r($csvData, TRUE));
// Expect always an array
assert(is_array($csvData));
// Is the array empty?
if (count($csvData) == 0) {
// Debug message
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-SOURCE : File ' . $csvFileInstance->getFileName() . ' has been fully read.');
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-SOURCE: File ' . $csvFileInstance->getFilename() . ' has been fully read.');
// Try to close it by actually unsetting (destructing) it
unset($csvFileInstance);
$this->getStackSourceInstance()->pushNamed(self::STACK_NAME_CSV_ENTRY, $csvData);
// Debug message
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-SOURCE : EXIT!');
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-SOURCE: EXIT!');
}
/**
*/
private function parseCsvEntry () {
// Debug message
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-SOURCE : CALLED!');
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-SOURCE: CALLED!');
// Pop it from stack
$csvData = $this->getStackSourceInstance()->popNamed(self::STACK_NAME_CSV_ENTRY);
// Debug message
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-SOURCE : csvData[' . gettype($csvData) . ']=' . print_r($csvData, TRUE));
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-SOURCE: csvData[' . gettype($csvData) . ']=' . print_r($csvData, TRUE));
// It must have a fixed amount of elements (see method parseCsvFile() for details)
assert(count($csvData) == self::CRAWL_ENTRY_SIZE);
$this->saveCsvDataInCrawlerQueue($csvData);
// Debug message
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-SOURCE : EXIT!');
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-SOURCE: EXIT!');
}
/**
namespace Org\Shipsimu\Hub\Crawler\Task\Source\Url;
// Import application-specific stuff
-use Org\Shipsimu\Hub\Crawler\Crawler;
+use Org\Shipsimu\Hub\Crawler\Source\Url\UrlSource;
use Org\Shipsimu\Hub\Crawler\Source\Url\UrlSourceObjectFactory;
// Import framework stuff
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
abstract class BaseUrlSourceTask extends BaseTask {
+
/**
- * An instance of a Crawler class
+ * An instance of a UrlSource class
*/
- private $crawlerInstance = NULL;
+ private $urlSourceInstance = NULL;
/**
* Protected constructor
$sourceInstance = UrlSourceObjectFactory::createUrlSourceInstance($this);
// And set it here
- $this->getCrawlerInstance()->setUrlSourceInstance($sourceInstance);
+ $this->setUrlSourceInstance($sourceInstance);
}
/**
- * Setter for a Crawler instance
+ * Setter for a UrlSource instance
*
- * @param $crawlerInstance An instance of a Crawler class
+ * @param $urlSourceInstance An instance of a UrlSource class
* @return void
*/
- protected final function setCrawlerInstance (Crawler $crawlerInstance) {
- $this->crawlerInstance = $crawlerInstance;
+ private function setUrlSourceInstance (UrlSource $urlSourceInstance) {
+ $this->urlSourceInstance = $urlSourceInstance;
}
/**
- * Getter for a Crawler instance
+ * Getter for a UrlSource instance
*
- * @return $crawlerInstance An instance of a Crawler class
+ * @return $urlSourceInstance An instance of a UrlSource class
*/
- protected final function getCrawlerInstance () {
- return $this->crawlerInstance;
+ protected final function getUrlSourceInstance () {
+ return $this->urlSourceInstance;
}
}
+++ /dev/null
-Deny from all
+++ /dev/null
-<?php
-// Own namespace
-namespace Org\Mxchange\Hub\Task\Crawler\Scanner\;
-
-// Import framework stuff
-use Org\Mxchange\CoreFramework\Task\BaseTask;
-use Org\Mxchange\CoreFramework\Task\Taskable;
-use Org\Mxchange\CoreFramework\Visitor\Visitable;
-use Org\Mxchange\CoreFramework\Visitor\Visitor;
-
-/**
- * A ??? scanner task for crawlers
- *
- * @author Roland Haeder <webmaster@ship-simu.org>
- * @version 0.0.0
- * @copyright Copyright (c) 2014 Crawler Developer Team
- * @license GNU GPL 3.0 or any newer version
- * @link http://www.ship-simu.org
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-class Crawler???ScannerTask extends BaseTask implements Taskable, Visitable {
- /**
- * Protected constructor
- *
- * @return void
- */
- protected function __construct () {
- // Call parent constructor
- parent::__construct(__CLASS__);
- }
-
- /**
- * Creates an instance of this class
- *
- * @return $taskInstance An instance of a Visitable class
- */
- public final static function createCrawler???ScannerTask () {
- // Get new instance
- $taskInstance = new Crawler???ScannerTask();
-
- // Return the prepared instance
- return $taskInstance;
- }
-
- /**
- * Accepts the visitor to process the visitor
- *
- * @param $visitorInstance An instance of a Visitor class
- * @return void
- * @todo Maybe visit some sub-objects
- */
- public function accept (Visitor $visitorInstance) {
- // Visit this task
- $visitorInstance->visitTask($this);
- }
-
- /**
- * Executes the task
- *
- * @return void
- */
- public function executeTask () {
- // Call factory for a scanner instance and execute it
- ScannerFactory::createScannerInstance($this)->execute();
- }
-
- /**
- * Shuts down the task
- *
- * @return void
- * @todo 0% done
- */
- public function doShutdown () {
- self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-TASK: Shutting down...');
- }
-
-}
+++ /dev/null
-Deny from all
+++ /dev/null
-<?php
-// Own namespace
-namespace Org\Shipsimu\Hub\Crawler\Task\Scanner\UploadedList;
-
-// Import application-specific stuff
-use Org\Shipsimu\Hub\Factory\Scanner\ScannerObjectFactory;
-
-// Import framework stuff
-use Org\Mxchange\CoreFramework\Task\BaseTask;
-use Org\Mxchange\CoreFramework\Task\Taskable;
-use Org\Mxchange\CoreFramework\Visitor\Visitable;
-use Org\Mxchange\CoreFramework\Visitor\Visitor;
-
-/**
- * A UploadedList scanner task for crawlers
- *
- * @author Roland Haeder <webmaster@ship-simu.org>
- * @version 0.0.0
- * @copyright Copyright (c) 2014 Crawler Developer Team
- * @license GNU GPL 3.0 or any newer version
- * @link http://www.ship-simu.org
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-class CrawlerUploadedListScannerTask extends BaseTask implements Taskable, Visitable {
- /**
- * Protected constructor
- *
- * @return void
- */
- protected function __construct () {
- // Call parent constructor
- parent::__construct(__CLASS__);
- }
-
- /**
- * Creates an instance of this class
- *
- * @return $taskInstance An instance of a Visitable class
- */
- public final static function createCrawlerUploadedListScannerTask () {
- // Get new instance
- $taskInstance = new CrawlerUploadedListScannerTask();
-
- // Return the prepared instance
- return $taskInstance;
- }
-
- /**
- * Accepts the visitor to process the visitor
- *
- * @param $visitorInstance An instance of a Visitor class
- * @return void
- * @todo Maybe visit some sub-objects
- */
- public function accept (Visitor $visitorInstance) {
- // Visit this task
- $visitorInstance->visitTask($this);
- }
-
- /**
- * Executes the task
- *
- * @return void
- */
- public function executeTask () {
- // Call factory for a scanner instance and execute it
- ScannerObjectFactory::createScannerInstance($this)->execute();
- }
-
- /**
- * Shuts down the task
- *
- * @return void
- * @todo 0% done
- */
- public function doShutdown () {
- self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-UPLOADED-LIST-SCANNER-TASK: Shutting down...');
- }
-
-}
namespace Org\Shipsimu\Hub\Crawler\Task\Source\FoundRss;
// Import application-specific stuff
-use Org\Shipsimu\Hub\Crawler\Crawler;
use Org\Shipsimu\Hub\Crawler\Task\Source\Url\BaseUrlSourceTask;
// Import framework stuff
/**
* Creates an instance of this class
*
- * @param $crawlerInstance An instance of a Crawler class
* @return $taskInstance An instance of a Visitable class
*/
- public final static function createCrawlerUrlSourceFoundRssTask (Crawler $crawlerInstance) {
+ public final static function createCrawlerUrlSourceFoundRssTask () {
// Get new instance
$taskInstance = new CrawlerUrlSourceFoundRssTask();
- // Set crawler instance here
- $taskInstance->setCrawlerInstance($crawlerInstance);
-
// Return the prepared instance
return $taskInstance;
}
* @return void
*/
public function executeTask () {
+ // Trace message
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-URL-SOURCE-UPLOADED-LIST-TASK: CALLED!');
+
// Get source instance
- $sourceInstance = $this->getCrawlerInstance()->getUrlSourceInstance();
+ $sourceInstance = $this->getUrlSourceInstance();
+
+ // Debug message
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-URL-SOURCE-UPLOADED-LIST-TASK: sourceInstance[]=' . gettype($sourceInstance));
// Is it not set?
if (is_null($sourceInstance)) {
+ // Debug message
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-URL-SOURCE-UPLOADED-LIST-TASK: Initializing source ...');
+
// Initialize it
$this->initUrlSourceTask();
// And re-get it
- $sourceInstance = $this->getCrawlerInstance()->getUrlSourceInstance();
+ $sourceInstance = $this->getUrlSourceInstance();
} // END - if
+ // Debug message
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-URL-SOURCE-UPLOADED-LIST-TASK: sourceInstance[]=' . gettype($sourceInstance));
+
// Get the URL source instance and fill the stack with crawl entries
$sourceInstance->fillUrlStack();
+
+ // Trace message
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-URL-SOURCE-UPLOADED-LIST-TASK: EXIT!');
}
/**
namespace Org\Shipsimu\Hub\Crawler\Task\Source\LocalStart;
// Import application-specific stuff
-use Org\Shipsimu\Hub\Crawler\Crawler;
use Org\Shipsimu\Hub\Crawler\Task\Source\Url\BaseUrlSourceTask;
// Import framework stuff
/**
* Creates an instance of this class
*
- * @param $crawlerInstance An instance of a Crawler class
* @return $taskInstance An instance of a Visitable class
*/
- public final static function createCrawlerUrlSourceLocalStartTask (Crawler $crawlerInstance) {
+ public final static function createCrawlerUrlSourceLocalStartTask () {
// Get new instance
$taskInstance = new CrawlerUrlSourceLocalStartTask();
- // Set crawler instance here
- $taskInstance->setCrawlerInstance($crawlerInstance);
-
// Return the prepared instance
return $taskInstance;
}
* @return void
*/
public function executeTask () {
+ // Trace message
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-URL-SOURCE-UPLOADED-LIST-TASK: CALLED!');
+
// Get source instance
- $sourceInstance = $this->getCrawlerInstance()->getUrlSourceInstance();
+ $sourceInstance = $this->getUrlSourceInstance();
+
+ // Debug message
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-URL-SOURCE-UPLOADED-LIST-TASK: sourceInstance[]=' . gettype($sourceInstance));
// Is it not set?
if (is_null($sourceInstance)) {
+ // Debug message
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-URL-SOURCE-UPLOADED-LIST-TASK: Initializing source ...');
+
// Initialize it
$this->initUrlSourceTask();
// And re-get it
- $sourceInstance = $this->getCrawlerInstance()->getUrlSourceInstance();
+ $sourceInstance = $this->getUrlSourceInstance();
} // END - if
+ // Debug message
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-URL-SOURCE-UPLOADED-LIST-TASK: sourceInstance[]=' . gettype($sourceInstance));
+
// Get the URL source instance and fill the stack with crawl entries
$sourceInstance->fillUrlStack();
+
+ // Trace message
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-URL-SOURCE-UPLOADED-LIST-TASK: EXIT!');
}
/**
namespace Org\Shipsimu\Hub\Crawler\Task\Source\RssStart;
// Import application-specific stuff
-use Org\Shipsimu\Hub\Crawler\Crawler;
use Org\Shipsimu\Hub\Crawler\Task\Source\Url\BaseUrlSourceTask;
// Import framework stuff
/**
* Creates an instance of this class
*
- * @param $crawlerInstance An instance of a Crawler class
* @return $taskInstance An instance of a Visitable class
*/
- public final static function createCrawlerUrlSourceRssStartTask (Crawler $crawlerInstance) {
+ public final static function createCrawlerUrlSourceRssStartTask () {
// Get new instance
$taskInstance = new CrawlerUrlSourceRssStartTask();
- // Set crawler instance here
- $taskInstance->setCrawlerInstance($crawlerInstance);
-
// Return the prepared instance
return $taskInstance;
}
* @return void
*/
public function executeTask () {
+ // Trace message
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-URL-SOURCE-UPLOADED-LIST-TASK: CALLED!');
+
// Get source instance
- $sourceInstance = $this->getCrawlerInstance()->getUrlSourceInstance();
+ $sourceInstance = $this->getUrlSourceInstance();
+
+ // Debug message
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-URL-SOURCE-UPLOADED-LIST-TASK: sourceInstance[]=' . gettype($sourceInstance));
// Is it not set?
if (is_null($sourceInstance)) {
+ // Debug message
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-URL-SOURCE-UPLOADED-LIST-TASK: Initializing source ...');
+
// Initialize it
$this->initUrlSourceTask();
// And re-get it
- $sourceInstance = $this->getCrawlerInstance()->getUrlSourceInstance();
+ $sourceInstance = $this->getUrlSourceInstance();
} // END - if
+ // Debug message
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-URL-SOURCE-UPLOADED-LIST-TASK: sourceInstance[]=' . gettype($sourceInstance));
+
// Get the URL source instance and fill the stack with crawl entries
$sourceInstance->fillUrlStack();
+
+ // Trace message
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-URL-SOURCE-UPLOADED-LIST-TASK: EXIT!');
}
/**
namespace Org\Shipsimu\Hub\Crawler\Task\Source\UploadedList;
// Import application-specific stuff
-use Org\Shipsimu\Hub\Crawler\Crawler;
use Org\Shipsimu\Hub\Crawler\Task\Source\Url\BaseUrlSourceTask;
// Import framework stuff
/**
* Creates an instance of this class
*
- * @param $crawlerInstance An instance of a Crawler class
* @return $taskInstance An instance of a Visitable class
*/
- public final static function createCrawlerUrlSourceUploadedListTask (Crawler $crawlerInstance) {
+ public final static function createCrawlerUrlSourceUploadedListTask () {
// Get new instance
$taskInstance = new CrawlerUrlSourceUploadedListTask();
- // Set cralwer instance here
- $taskInstance->setCrawlerInstance($crawlerInstance);
-
// Return the prepared instance
return $taskInstance;
}
* @return void
*/
public function executeTask () {
+ // Trace message
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-URL-SOURCE-UPLOADED-LIST-TASK: CALLED!');
+
// Get source instance
- $sourceInstance = $this->getCrawlerInstance()->getUrlSourceInstance();
+ $sourceInstance = $this->getUrlSourceInstance();
+
+ // Debug message
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-URL-SOURCE-UPLOADED-LIST-TASK: sourceInstance[]=' . gettype($sourceInstance));
// Is it not set?
if (is_null($sourceInstance)) {
+ // Debug message
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-URL-SOURCE-UPLOADED-LIST-TASK: Initializing source ...');
+
// Initialize it
$this->initUrlSourceTask();
// And re-get it
- $sourceInstance = $this->getCrawlerInstance()->getUrlSourceInstance();
+ $sourceInstance = $this->getUrlSourceInstance();
} // END - if
+ // Debug message
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-URL-SOURCE-UPLOADED-LIST-TASK: sourceInstance[]=' . gettype($sourceInstance));
+
// Get the URL source instance and fill the stack with crawl entries
$sourceInstance->fillUrlStack();
+
+ // Trace message
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-URL-SOURCE-UPLOADED-LIST-TASK: EXIT!');
}
/**
// CFG: COMMUNICATOR-INIT-STATE-CLASS
$cfg->setConfigEntry('communicator_init_state_class', 'Org\Shipsimu\Hub\State\Communicator\CommunicatorInitState');
-// CFG: CRAWLER-UPLOADED-LIST-SCANNER
-$cfg->setConfigEntry('crawler_uploaded_list_scanner', 'Org\Shipsimu\Hub\Crawler\Scanner\UploadedList\CrawlerUploadedListScanner');
-
// CFG: CRAWLER-URL-SOURCE-LOCAL-START-CLASS
$cfg->setConfigEntry('crawler_url_source_local_start_class', 'Org\Shipsimu\Hub\Crawler\Source\LocalStart\CrawlerLocalStartUrlSource');
// CFG: TASK-CRAWLER-URL-SOURCE-FOUND-RSS-MAX-RUNS
$cfg->setConfigEntry('task_crawler_url_source_found_rss_max_runs', 0);
-// CFG: CRAWLER-URL-SOURCE-FOUND-RSS-TASK-CLASS
-$cfg->setConfigEntry('crawler_uploaded_list_scanner_task_class', 'Org\Shipsimu\Hub\Crawler\Task\Scanner\UploadedList\CrawlerUploadedListScannerTask');
-
-// CFG: TASK-CRAWLER-URL-SOURCE-FOUND-RSS-STARTUP-DELAY
-$cfg->setConfigEntry('task_crawler_uploaded_list_scanner_startup_delay', 500);
-
-// CFG: TASK-CRAWLER-URL-SOURCE-FOUND-RSS-INTERVAL-DELAY
-$cfg->setConfigEntry('task_crawler_uploaded_list_scanner_interval_delay', 1000);
-
-// CFG: TASK-CRAWLER-URL-SOURCE-FOUND-RSS-MAX-RUNS
-$cfg->setConfigEntry('task_crawler_uploaded_list_scanner_max_runs', 0);
-
// CFG: CRAWLER-CSV-FILE-PATH
$cfg->setConfigEntry('crawler_csv_file_path', 'data/url_lists');
+++ /dev/null
-Deny from all
+++ /dev/null
-<?php
-// Own namespace
-namespace Org\Shipsimu\Hub\Scanner;
-
-// Import application-specific stuff
-use Org\Shipsimu\Hub\Generic\HubInterface;
-
-/**
- * An interface for scanners
- *
- * @author Roland Haeder <webmaster@shipsimu.org>
- * @version 0.0.0
- * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2015 Hub Developer Team
- * @license GNU GPL 3.0 or any newer version
- * @link http://www.shipsimu.org
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-interface Scanner extends HubInterface {
- /**
- * Runs the scanner (please no loops here)
- *
- * @return void
- */
- function execute ();
-
-}
-Subproject commit 3191b3ee467d8844ec574321291cfc6ddc34eb69
+Subproject commit 868c877607670760eb36e63ebeb1a04237907be9