Cleanup of some console commands

This commit is contained in:
Nabeel Shahzad
2017-12-29 10:23:42 -06:00
parent a5c5518a12
commit 5ec99167e8
7 changed files with 131 additions and 52 deletions

View File

@@ -2,39 +2,16 @@
namespace App\Console\Commands;
use Illuminate\Console\Command;
use League\Geotools\Coordinate\Coordinate;
use App\Console\BaseCommand;
use App\Models\Navdata;
use App\Models\Enums\NavaidType;
class NavdataCommand extends Command
class NavdataCommand extends BaseCommand
{
protected $signature = 'phpvms:navdata';
protected $description = '';
/**
* Streaming file read
* @param $filename
* @return \Generator
*/
protected function readFile($filename)
{
$fp = fopen($filename, 'rb');
while (($line = fgets($fp)) !== false) {
$line = rtrim($line, "\r\n");
if($line[0] === ';') {
continue;
}
yield $line;
}
fclose($fp);
}
/**
* Read and parse in the navaid file
* @throws \League\Geotools\Exception\InvalidArgumentException