public function check()
 {
     if (!$this->feof() and $this->getName() !== "UnknownData Packet") {
         $offset = strlen($this->buffer) - $this->offset;
         echo $this->getName() . ": Bufferの解析し残しています。 " . $offset . "\n";
         file_put_contents(PEPacketAnalyze::getInterface()->getPath() . "/" . $this->getName() . ".dat", $this->buffer);
         file_put_contents(PEPacketAnalyze::getInterface()->getPath() . "/" . $this->getName() . "1.dat", substr($this->buffer, $this->offset));
     }
 }
 public function check()
 {
     if (!$this->feof() and $this->getName() !== "UnknownData Packet") {
         if (PEPacketAnalyze::getInterface()->getDebugLevel() >= 1 and $this->echo) {
             $offset = strlen($this->buffer) - $this->offset;
             PEPacketAnalyze::getInterface()->getLogger()->debug("[" . $this->getName() . "] Bufferの解析し残しています。 " . $offset . "", 1);
             file_put_contents(PEPacketAnalyze::getInterface()->getPath() . "/" . $this->getName() . ".dat", $this->buffer);
             file_put_contents(PEPacketAnalyze::getInterface()->getPath() . "/" . $this->getName() . "1.dat", substr($this->buffer, $this->offset));
         }
     }
 }
 public function decode()
 {
     PEPacketAnalyze::getInterface()->getLogger()->debug("UnknownDataPacketが送信されました。 : 0x" . bin2hex($this->buffer[0]) . "", 1);
     file_put_contents(PEPacketAnalyze::getInterface()->getPath() . "/0x" . bin2hex($this->buffer[0]) . ".dat", $this->buffer);
     //$this->echo = true;
 }
 public function decode()
 {
     //print_r("0x".bin2hex($this->buffer)."\n");
     echo "UnknownDataPacketが送信されました。\n";
     file_put_contents(PEPacketAnalyze::getInterface()->getPath() . "/0x" . bin2hex($this->buffer[0]) . ".dat", $this->buffer);
 }
<?php

/*
 *▪   ▄▄▄·       ▄▄· ▄ •▄ ▄▄▄ .▄▄▄▄▄
 *██ ▐█ ▄█▪     ▐█ ▌▪█▌▄▌▪▀▄.▀·•██
 *▐█· ██▀· ▄█▀▄ ██ ▄▄▐▀▀▄·▐▀▀▪▄ ▐█.▪
 *▐█▌▐█▪·•▐█▌.▐▌▐███▌▐█.█▌▐█▄▄▌ ▐█▌·
 *▀▀▀.▀    ▀█▄▀▪·▀▀▀ ·▀  ▀ ▀▀▀  ▀▀▀
 *
 *This program is free software:
 *and PocketEdition Packet Analyze.
 *
*/
namespace PEPacketAnalyze;

use PEPacketAnalyze\PEPacketAnalyze;
use PEPacketAnalyze\utils\ClassLoader;
require_once __DIR__ . "/src/PEPacketAnalyze/utils/ClassLoader.php";
$loader = new ClassLoader();
$loader->addPath(__DIR__ . "/src");
$loader->register();
if (php_sapi_name() === "cli") {
    $class = new PEPacketAnalyze(__DIR__);
    $class->getLogger()->info("Thank you for using PEPacketAnalyze by iPocket!");
} else {
    echo "It cannot start from web.<br> Please start from a command-line<br>";
}