diff --git a/app/Console/Commands/Debug/DynamicItem.php b/app/Console/Commands/Debug/DynamicItem.php new file mode 100644 index 0000000..aa6f50b --- /dev/null +++ b/app/Console/Commands/Debug/DynamicItem.php @@ -0,0 +1,36 @@ +argument('name'))->single(); + + if (! $do) + throw new \Exception(sprintf('Dynamic Item [%s] doesnt exist?',$this->argument('name'))); + + $ao = Address::findFTN($this->argument('ftn')); + + $d = new Dynamic($do,$ao,Send::T_FILE); + + $d->open(); + echo $d->read($d->size); + + return self::SUCCESS; + } +} \ No newline at end of file diff --git a/app/Console/Commands/Debug/PacketDump.php b/app/Console/Commands/Debug/PacketDump.php new file mode 100644 index 0000000..1cf1fb4 --- /dev/null +++ b/app/Console/Commands/Debug/PacketDump.php @@ -0,0 +1,67 @@ +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 ($this->option('dump')) { + $this->info('Item Name:'.$pkt->name); + $this->info('Item Type:'.get_class($pkt)); + $this->info('Dump:'); + echo hex_dump($pkt); + + } else { + $f = fopen($this->argument('file'),'w+'); + fputs($f,(string)$pkt); + fclose($f); + } + + return self::SUCCESS; + } +} \ No newline at end of file