2018-05-15
2018-05-15 本文已影响13人
wazi
publicfunctionfire(){//获取拼接命名空间后的全称$name =$this->qualifyClass($this->getNameInput());//获取文件的实际存储路径$path =$this->getPath($name);//若文件已存在,直接给出错误提示而不会覆盖原来的文件if($this->alreadyExists($this->getNameInput())) {$this->error($this->type.' already exists!');returnfalse; }//生成文件$this->makeDirectory($path);//适当地替换模版文件中的数据,如命名空间和类名$this->files->put($path,$this->buildClass($name));//控制台提示$this->info($this->type.' created successfully.'); }