123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- <?php
- namespace app\command;
- use think\console\Input;
- use think\console\Output;
- use think\facade\Log;
- class Base extends \think\console\Command
- {
- protected $input;
- protected $output;
-
- protected function writeln($obj,$type="info"){
- $msg=print_r($obj,true);
- Log::record($msg,$type);
- $this->output->writeln("[".$type."]".$msg);
- }
-
- protected function execute(Input $input, Output $output)
- {
- $this->input=$input;
- $this->output=$output;
- $this->main();
- }
-
- protected function main(){
- }
- }
|