argument('ftn')); switch (strtolower($this->argument('type'))) { case 'netmail': $pkt = $ao->getNetmail(); break; case 'echomail': $pkt = $ao->getEchomail(); break; default: $this->error('Unknown type: '.$this->argument('type')); throw new \Exception('Unknown type: '.$this->argument('type')); } if (is_null($pkt)) { $this->info(sprintf('No packet for [%s] of type [%s]',$this->argument('ftn'),$this->argument('type'))); return self::SUCCESS; } if (! $this->argument('file')) { $this->info('Item Name:'.$pkt->name); $this->info('Item Type:'.get_class($pkt)); $this->info('Dump:'); echo hex_dump((string)$pkt); } else { $f = fopen($this->argument('file'),'w+'); fputs($f,(string)$pkt); fclose($f); } return self::SUCCESS; } }