/** * @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); }
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); }
/** * @return OutputInterface */ protected function getOutput() { return Config::get('output', new NullOutput()); }
/** * @return InputInterface */ protected function getInput() { return Config::get('input', new ArgvInput()); }
protected function getConfigValue($key, $default = null) { return Config::get(static::getClassKey($key), $default); }