您的位置:首页 > 其它

凌阳c61学习笔记_1第一次接触单片机

2011-03-27 16:24 246 查看
namespace Illuminate\Console;

use Illuminate\Contracts\Events\Dispatcher;
use Illuminate\Contracts\Container\Container;
use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\BufferedOutput;
use Symfony\Component\Console\Application as SymfonyApplication;
use Symfony\Component\Console\Command\Command as SymfonyCommand;
use Illuminate\Contracts\Console\Application as ApplicationContract;
// my name space
class Application extends SymfonyApplication implements ApplicationContract
{// class Application extends SymfonyApplication implements ApplicationContract
/**
* The Laravel application instance.
*
* @var \Illuminate\Contracts\Container\Container
*/
protected $laravel;// The laravel application instance.
// all use this instance in the

/**
* The output from the previous command.
*
* @var \Symfony\Component\Console\Output\BufferedOutput
*/
protected $lastOutput;//The output from the previous command.
// The previous command output String.

/**
* Create a new Artisan console application.
*
* @param  \Illuminate\Contracts\Container\Container  $laravel
* @param  \Illuminate\Contracts\Events\Dispatcher  $events
* @param  string  $version
* @return void
*/
public function __construct(Container $laravel, Dispatcher $events, $version)
{
parent::__construct('Laravel Framework', $version);// use parents construct , may like set

$this->laravel = $laravel;// set the instance the laravel
$this->setAutoExit(false);// set the auto Exit
$this->setCatchExceptions(false);//set Catch Exceptions

$events->fire(new Events\ArtisanStarting($this));//fire the Events \Artisan Starting
}// Create a new Artisan console application

/**
* Run an Artisan console command by name.
*
* @param  string  $command
* @param  array  $parameters
* @return int
*/ // Run an Artisan console command by name.
public function call($command, array $parameters = [])//Run an Artisan console command by name.
{// call $command array $parameters
$parameters = collect($parameters)->prepend($command);// collect($parameters)->prepend($command)
// set the parameters ,format the parameters.
// set parameter
$this->lastOutput = new BufferedOutput;// $this->lastOutput get the new Buffered Output
// the Output string is a Output class
// set the lastOutput
$this->setCatchExceptions(false);// set Catch Exceptions
// Set Catch Exceptions
// set the Exceptions
$result = $this->run(new ArrayInput($parameters->toArray()), $this->lastOutput);// run ()
// run the function use parameters and Output.
$this->setCatchExceptions(true);// set the Set Catch Exception

return $result;// back the result to the call
}

/**
* Get the output for the last run command.
*
* @return string
*/
public function output()
{
return $this->lastOutput ? $this->lastOutput->fetch() : '';
}// Get the output for the last run command.
// return $this->lastOutput ? $this->lastOutput->fetch():


本文出自 “专注php” 博客,请务必保留此出处http://jingshanls.blog.51cto.com/3357095/1765638
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: