diff --git a/kiri-engine/Abstracts/BaseApplication.php b/kiri-engine/Abstracts/BaseApplication.php index 2d728911..39d2cc42 100644 --- a/kiri-engine/Abstracts/BaseApplication.php +++ b/kiri-engine/Abstracts/BaseApplication.php @@ -27,8 +27,6 @@ use Psr\Log\LoggerInterface; abstract class BaseApplication extends Component { - use TraitApplication; - /** * @var string diff --git a/kiri-engine/Abstracts/Command.php b/kiri-engine/Abstracts/Command.php deleted file mode 100644 index 8738ea55..00000000 --- a/kiri-engine/Abstracts/Command.php +++ /dev/null @@ -1,10 +0,0 @@ -params = $params; - } - - - /** - * @return array - * @throws Exception - */ - public function toArray(): array - { - return $this->params; - } - - - /** - * @param $name - * @return mixed - * @throws Exception - */ - public function get($name): mixed - { - $array = $this->toArray(); - if (!isset($array[$name])) { - return null; - } - return $array[$name]; - } - - -} diff --git a/kiri-engine/Error/LoggerProcess.php b/kiri-engine/Error/LoggerProcess.php deleted file mode 100644 index ade6455d..00000000 --- a/kiri-engine/Error/LoggerProcess.php +++ /dev/null @@ -1,97 +0,0 @@ -message($process); - } - - - /** - * @param OnBroadcastInterface $message - * @return void - */ - public function onBroadcast(OnBroadcastInterface $message): void - { - $logger = Kiri::getDi()->get(LoggerInterface::class); - $logger->debug($message->data . '::' . static::class); - } - - - /** - * @param Process $process - * @throws ComponentException - * @throws Exception - */ - public function message(Process $process) - { - if ($this->isStop()) { - return; - } - $message = Json::decode($process->read()); - if (!empty($message)) { - Kiri::writeFile($this->getDirName($message), $message[0], FILE_APPEND); - - $this->checkLogFile($message[1]); - } - - Coroutine\System::sleep(1); - - $this->message($process); - } - - - /** - * @param $message - * @return string - * @throws Exception - */ - private function getDirName($message): string - { - return storage('server-' . date('Y-m-d') . '.log', $message[1]); - } - - - /** - * @param $dirName - * @throws Exception - */ - private function checkLogFile($dirName) - { - $files = new \DirectoryIterator(storage(null, $dirName)); - if ($files->getSize() < 15) { - return; - } - Coroutine\System::exec('find ' . storage(null, $dirName) . '/ -mtime +15 -name "*.log" -exec rm -rf {} \;'); - } - -} diff --git a/kiri-engine/IAspect.php b/kiri-engine/IAspect.php deleted file mode 100644 index 86a0c17f..00000000 --- a/kiri-engine/IAspect.php +++ /dev/null @@ -1,27 +0,0 @@ -