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

每天laravel-20160723|Application-3

2016-04-22 09:15 267 查看
/**
* Resolve an array of commands through the application.
*
* @param  array|mixed  $commands
* @return $this
*/
public function resolveCommands($commands)// function name is resolveCommands
{
$commands = is_array($commands) ? $commands : func_get_args();// if the commands is a array, get it or get the arguments, use a function fuc_get_args()

foreach ($commands as $command) {
$this->resolve($command);
}// use a foreach() function to get all the callback function like use a function array_map();

return $this;
}// Resolve an array of commands through the application

/**
* Get the default input definitions for the applications.
*
* This is used to add the --env option to every available command.
*
* @return \Symfony\Component\Console\Input\InputDefinition
*/
protected function getDefaultInputDefinition()// Get Default Input Definition
{
$definition = parent::getDefaultInputDefinition();// use parents function

$definition->addOption($this->getEnvironmentOption());// addOption()// get the EvironmentOption

return $definition;
}// Get the default input definitions for the applications.
// This is used to add the --env option to every available command.

/**
* Get the global environment option for the definition.
*
* @return \Symfony\Component\Console\Input\InputOption
*/
protected function getEnvironmentOption()
{
$message = 'The environment the command should run under.';// a message

return new InputOption('--env', null, InputOption::VALUE_OPTIONAL, $message);// get the class
}// Get the golobal environment option for the definition

/**
* Get the Laravel application instance.
*
* @return \Illuminate\Contracts\Foundation\Application
*/
public function getLaravel()
{
return $this->laravel;
}// Get the laravel application instance.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: