Support for ZIP archives
This commit is contained in:
@@ -3,8 +3,9 @@
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use Illuminate\Console\Command;
|
||||
use Symfony\Component\HttpFoundation\File\File;
|
||||
use Illuminate\Support\Arr;
|
||||
|
||||
use App\Classes\File;
|
||||
use App\Classes\FTN\Packet;
|
||||
use App\Jobs\MessageProcess as Job;
|
||||
use App\Models\Address;
|
||||
@@ -17,7 +18,7 @@ class PacketProcess extends Command
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'packet:process'
|
||||
.' {pkt : Packet to process}'
|
||||
.' {file : Packet to process}'
|
||||
.' {--N|nobot : Dont process bots}'
|
||||
.' {ftn? : System the packet is from}';
|
||||
|
||||
@@ -36,17 +37,19 @@ class PacketProcess extends Command
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$f = new File($this->argument('pkt'));
|
||||
$f = new File($this->argument('file'));
|
||||
$s = $this->argument('ftn') ? Address::findFTN($this->argument('ftn'))->system : NULL;
|
||||
|
||||
foreach (Packet::open($f,$s) as $msg) {
|
||||
// @todo Quick check that the packet should be processed by us.
|
||||
// @todo validate that the packet's zone is in the domain.
|
||||
foreach ($f as $packet) {
|
||||
foreach (Packet::process($packet,$f->itemName(),$f->itemSize(),$s) as $msg) {
|
||||
// @todo Quick check that the packet should be processed by us.
|
||||
// @todo validate that the packet's zone is in the domain.
|
||||
|
||||
$this->info(sprintf('Processing message from [%s] with msgid [%s]',$msg->fboss,$msg->msgid));
|
||||
$this->info(sprintf('Processing message from [%s] with msgid [%s]',$msg->fboss,$msg->msgid));
|
||||
|
||||
// Dispatch job.
|
||||
Job::dispatchSync($msg,$this->option('nobot'));
|
||||
// Dispatch job.
|
||||
Job::dispatchSync($msg,$this->option('nobot'));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user