您的位置:首页 > 移动开发

每天laravel-20160722|Application-2

2016-04-21 08:40 316 查看
/**
* Add a command to the console.
*
* @param  \Symfony\Component\Console\Command\Command  $command
* @return \Symfony\Component\Console\Command\Command
*/
public function add(SymfonyCommand $command)
{
if ($command instanceof Command) {// check the command instance is right,
$command->setLaravel($this->laravel);// command instance to run the set function
}

return $this->addToParent($command);// use this function to add to Parent frame
}// add a command to the console.

/**
* Add the command to the parent instance.
*
* @param  \Symfony\Component\Console\Command\Command  $command
* @return \Symfony\Component\Console\Command\Command
*/
protected function addToParent(SymfonyCommand $command)
{
return parent::add($command);// this a easy way or type
}// Add to the parent // use a wrap to make the function to easy know! or understand

/**
* Add a command, resolving through the application.
*
* @param  string  $command
* @return \Symfony\Component\Console\Command\Command
*/
public function resolve($command)
{
return $this->add($this->laravel->make($command));// a add wrap, like mysql function query and thinkphp function find. yeah
}// add a command resolving through the application
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: