dongasai před 1 rokem
rodič
revize
73d607137c

+ 22 - 0
src/think/console/Command.php

@@ -0,0 +1,22 @@
+<?php
+
+namespace DysUtil\think\console;
+
+use think\console\Input;
+use think\console\Output;
+use think\Log;
+
+abstract class Command extends \think\console\Command implements CommandInterface
+{
+    protected function execute(Input $input, Output $output)
+    {
+        try {
+            $this->handle($input, $output);
+
+        } catch (\Exception $exception) {
+            Log::error($exception->getTraceAsString());
+            return $output->error($exception->getMessage());
+        }
+    }
+
+}

+ 13 - 0
src/think/console/CommandInterface.php

@@ -0,0 +1,13 @@
+<?php
+
+namespace DysUtil\think\console;
+
+
+use think\console\Input;
+use think\console\Output;
+
+interface CommandInterface
+{
+
+    public function handle(Input $input, Output $output);
+}