コード例 #1
0
ファイル: Application.php プロジェクト: nix9/laracasts
 /**
  * @param InputInterface  $input
  * @param OutputInterface $output
  *
  * @return int
  */
 public function doRun(InputInterface $input, OutputInterface $output)
 {
     $helperSet = $this->getHelperSet();
     $this->container->set('console.input', $input);
     $this->container->set('console.output', $output);
     $this->container->setShared('console.prompter.factory', function ($c) use($helperSet) {
         return new Factory($c->get('console.input'), $c->get('console.output'), $helperSet);
     });
     $this->container->setShared('process.executioncontext', function () {
         return JsonExecutionContext::fromEnv($_SERVER);
     });
     $assembler = new ContainerAssembler();
     $assembler->build($this->container);
     $this->loadConfigurationFile($input, $this->container);
     foreach ($this->container->getByPrefix('console.commands') as $command) {
         $this->add($command);
     }
     $this->setDispatcher($this->container->get('console_event_dispatcher'));
     $this->container->get('console.io')->setConsoleWidth($this->getTerminalWidth());
     StreamWrapper::reset();
     foreach ($this->container->getByPrefix('loader.resource_loader.spec_transformer') as $transformer) {
         StreamWrapper::addTransformer($transformer);
     }
     StreamWrapper::register();
     return parent::doRun($input, $output);
 }
コード例 #2
0
 /**
  * @beforeScenario
  */
 public function setupApplication()
 {
     StreamWrapper::register();
     $this->application = new Application('2.1-dev');
     $this->application->setAutoExit(false);
     $this->tester = new ApplicationTester($this->application);
     $this->setupReRunner();
     $this->setupPrompter();
 }
コード例 #3
0
ファイル: StreamWrapperTest.php プロジェクト: nix9/laracasts
 function setUp()
 {
     $wrapper = new StreamWrapper();
     $wrapper->addTransformer(new TypeHintRewriter(new TokenizedTypeHintRewriter(new InMemoryTypeHintIndex(), new TokenizedNamespaceResolver())));
     StreamWrapper::register();
 }