凌阳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
相关文章推荐
- 单片机学习笔记090710
- android 开发零起步学习笔记(四):学习几个原来没接触的概念之Jcenter
- 【学习笔记】STC 12C系列1T单片机主频配置
- AVR单片机学习笔记
- 学习笔记 从零开始学单片机(1) 建立实验环境
- 学习笔记 从零开始学单片机(5) A/D转化
- db4o学习笔记(二)、第一次亲密接触
- 单片机学习笔记(Arduino Uno r3)
- 【学习笔记】AVR单片机之ADC和DAC的应用
- 嵌入式学习笔记(10)——51单片机之中断(定时器中断)
- STM32单片机学习详细局部介绍笔记
- 学习笔记 从零开始学单片机(0) 系统结构
- 51单片机学习笔记【七】——蜂鸣器和继电器
- zigbee学习笔记4----初次接触zstack
- 嵌入式学习笔记(21)——AVR单片机之片内EEPROM
- 大学学习笔记—单片机第一章
- 嵌入式学习笔记(17)——AVR单片机之头文件简介和使用
- 刚接触到linux,对一些命令的学习,做个笔记
- 单片机学习笔记(五)—— 键盘
- 单片机学习笔记--51单片机