码迷,mamicode.com
首页 > 移动开发 > 详细

每天laravel-20160723|Application-3

时间:2016-04-22 10:43:48      阅读:225      评论:0      收藏:0      [点我收藏+]

标签:laravle

   /**
    * 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.


本文出自 “专注php” 博客,请务必保留此出处http://jingshanls.blog.51cto.com/3357095/1766530

每天laravel-20160723|Application-3

标签:laravle

原文地址:http://jingshanls.blog.51cto.com/3357095/1766530

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!