示例#1
0
 /**
  * @inheritdoc
  * @throws TerminusException
  */
 public function get($key, $defaultOverride = null)
 {
     if (!$this->configured) {
         $this->configure();
         $this->configured = true;
     }
     if (!isset($this->config[$key])) {
         throw new TerminusException('No configuration setting for {key} found.', compact('key'));
     }
     return parent::get($key);
 }
示例#2
0
 public function addInitRoboFileCommand($roboFile, $roboClass)
 {
     $createRoboFile = new Command('init');
     $createRoboFile->setDescription("Intitalizes basic RoboFile in current dir");
     $createRoboFile->setCode(function () use($roboClass, $roboFile) {
         $output = Config::get('output');
         $output->writeln("<comment>  ~~~ Welcome to Robo! ~~~~ </comment>");
         $output->writeln("<comment>  " . $roboFile . " will be created in current dir </comment>");
         file_put_contents($roboFile, '<?php' . "\n/**" . "\n * This is project's console commands configuration for Robo task runner." . "\n *" . "\n * @see http://robo.li/" . "\n */" . "\nclass " . $roboClass . " extends \\Robo\\Tasks\n{\n    // define public methods as commands\n}");
         $output->writeln("<comment>  Edit RoboFile.php to add your commands! </comment>");
     });
     $this->add($createRoboFile);
 }
示例#3
0
文件: IO.php 项目: stefanhuber/Robo
 /**
  * @return OutputInterface
  */
 protected function getOutput()
 {
     return Config::get('output', new NullOutput());
 }
示例#4
0
文件: IO.php 项目: zondor/Robo
 /**
  * @return InputInterface
  */
 protected function getInput()
 {
     return Config::get('input', new ArgvInput());
 }
示例#5
0
 protected function getConfigValue($key, $default = null)
 {
     return Config::get(static::getClassKey($key), $default);
 }