public function identify() { $downloadedFiles = File::where('file_process_id', '=', 2)->get(); foreach ($downloadedFiles as $file) { $txtFilePath = config('monitor.text_file_path') . $file->id . '.txt'; if (is_file($txtFilePath)) { $file->update(['file_process_id' => '3']); //OCRd } clearstatcache(); } }
public function analyze() { $analyzedFiles = File::where('file_process_id', '=', 4)->get(); foreach ($analyzedFiles as $file) { $this->updateParcelLocation($file->id); $this->updateFileLocation($file->id); $this->updateProceedingLocation($file->id); $this->updateProjectLocation($file->id); $file->update(['file_process_id' => 5]); //analyzed } }
public function recognize() { $ocrdFiles = File::where('file_process_id', '=', 3)->get(); foreach ($ocrdFiles as $file) { $txtFilePath = config('monitor.text_file_path') . $file->id . '.txt'; $text = file_get_contents($txtFilePath); $parcelsNums = $this->findParcelNumbers($text); if ($parcelsNums) { $parcels = $this->createDbDataArray($parcelsNums, $file->id); Parcel::insert($parcels); } $listNums = $this->findOwnershipListNumbers($text); if ($listNums) { $ownershipLists = $this->createDbDataArray($listNums, $file->id); OwnershipList::insert($ownershipLists); } $file->update(['file_process_id' => '4']); //recognized } }