diff --git a/src/Import/History.php b/src/Import/History.php deleted file mode 100644 index a50913f..0000000 --- a/src/Import/History.php +++ /dev/null @@ -1,34 +0,0 @@ - - */ -class History -{ - /** - * @var AdapterInterface - */ - private $dbAdapter; - - public function __construct(ResourceConnection $resourceConnection) - { - $this->dbAdapter = $resourceConnection->getConnection(); - } - - public function isImported(Source $source): bool - { - $select = $this->dbAdapter - ->select() - ->from('jh_import_history', 'COUNT(id)') - ->where('source_id = ?', $source->getSourceId()) - ->where('finished IS NOT NULL'); - - return $this->dbAdapter->fetchOne($select) > 0; - } -} diff --git a/src/Import/Importer.php b/src/Import/Importer.php index e343bff..0d129c1 100644 --- a/src/Import/Importer.php +++ b/src/Import/Importer.php @@ -60,11 +60,6 @@ class Importer */ private $locker; - /** - * @var History - */ - private $history; - /** * @var ArchiverFactory */ @@ -82,7 +77,6 @@ public function __construct( ReportFactory $reportFactory, ArchiverFactory $archiverFactory, Locker $locker, - History $history, Indexer $indexer, Progress $progress ) { @@ -92,7 +86,6 @@ public function __construct( $this->archiverFactory = $archiverFactory; $this->reportFactory = $reportFactory; $this->locker = $locker; - $this->history = $history; $this->indexer = $indexer; $importSpecification->configure($this); @@ -110,14 +103,6 @@ public function transform(callable $transform): void private function canImport(Config $config, Report $report, Archiver $archiver): bool { - if ($this->history->isImported($this->source)) { - $report->addError('This import source has already been imported.'); - if ($config->get('archive_already_imported_files')) { - $archiver->failed(); - } - return false; - } - if ($this->source instanceof Countable && $this->source->count() === 0) { $report->addError('Source is empty - no data to be imported.'); return false; diff --git a/src/Import/ImporterFactory.php b/src/Import/ImporterFactory.php index b6e979b..332c2dc 100644 --- a/src/Import/ImporterFactory.php +++ b/src/Import/ImporterFactory.php @@ -39,11 +39,6 @@ class ImporterFactory */ private $locker; - /** - * @var History - */ - private $history; - /** * @var IndexerRegistry */ @@ -64,7 +59,6 @@ public function __construct( Factory $archiverFactory, State $appState, Locker $locker, - History $history, IndexerRegistry $indexerRegistry, ProgressFactory $progressFactory, OutputFactory $outputFactory @@ -73,7 +67,6 @@ public function __construct( $this->archiverFactory = $archiverFactory; $this->appState = $appState; $this->locker = $locker; - $this->history = $history; $this->indexerRegistry = $indexerRegistry; $this->progressFactory = $progressFactory; $this->outputFactory = $outputFactory; @@ -88,7 +81,6 @@ public function create(Source $source, ImportSpecification $specification, Write $this->reportFactory, $this->archiverFactory, $this->locker, - $this->history, new Indexer($this->indexerRegistry, $this->outputFactory->get()), $this->progressFactory->get() );