|
@ -48,11 +48,6 @@ class IngestDocuments implements ShouldQueue |
|
|
*/ |
|
|
*/ |
|
|
private $parseHtmlArray; |
|
|
private $parseHtmlArray; |
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* @var \App\Parser\ParseTextArray |
|
|
|
|
|
*/ |
|
|
|
|
|
private $parserText; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* Create a new job instance. |
|
|
* Create a new job instance. |
|
|
* |
|
|
* |
|
@ -65,7 +60,6 @@ class IngestDocuments implements ShouldQueue |
|
|
|
|
|
|
|
|
$this->storage = Storage::disk('local'); |
|
|
$this->storage = Storage::disk('local'); |
|
|
$this->parserDocx = new ParseDocx(); |
|
|
$this->parserDocx = new ParseDocx(); |
|
|
$this->parserText = new ParseTextArray(); |
|
|
|
|
|
$this->parserXml = new ParseXml(); |
|
|
$this->parserXml = new ParseXml(); |
|
|
$this->parserHtml = new ParseHtml(); |
|
|
$this->parserHtml = new ParseHtml(); |
|
|
$this->parseHtmlArray = new ParseHtmlArray(); |
|
|
$this->parseHtmlArray = new ParseHtmlArray(); |
|
@ -87,7 +81,7 @@ class IngestDocuments implements ShouldQueue |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// $content = $this->convertToUTF8($content);
|
|
|
|
|
|
|
|
|
$content = $this->convertToUTF8($content); |
|
|
|
|
|
|
|
|
try { |
|
|
try { |
|
|
$filePath = $this->storeContent($content); |
|
|
$filePath = $this->storeContent($content); |
|
@ -129,7 +123,9 @@ class IngestDocuments implements ShouldQueue |
|
|
return $textParser->fromFile($this->storage->path($this->path)); |
|
|
return $textParser->fromFile($this->storage->path($this->path)); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
return $this->parserText->fromFile($this->storage->path($this->path)); |
|
|
|
|
|
|
|
|
$textParser = new ParseTextArray(); |
|
|
|
|
|
|
|
|
|
|
|
return $textParser->fromFile($this->storage->path($this->path)); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
protected function convertToUTF8($content) |
|
|
protected function convertToUTF8($content) |
|
|