|
@@ -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());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+}
|