Ejemplo n.º 1
0
 /**
  * JiraConfig constructor.
  *
  * @param string $filename
  * @param bool   $eager
  */
 public function __construct($filename, $eager = false)
 {
     $crypt = Container::getInstance()->get('crypt');
     $this->addMutators('jiraPassword', function ($val) use($crypt) {
         return $crypt->encrypt($val);
     });
     $this->addAccessor('jiraPassword', function ($val) use($crypt) {
         return $crypt->decrypt($val);
     });
     parent::__construct($filename, $eager);
 }
Ejemplo n.º 2
0
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $this->setInputOutput($input, $output);
     $this->config = Config::factory($this->provider, true);
     $this->boot();
     $this->output->writeln(PHP_EOL);
     $this->startProgress(null);
     $this->ensureConfigExists();
     $this->setProgressMessage('Creating "' . $this->provider . '" provider instance.');
     $this->providerInstance = $this->createProvider($this->config, $this->options);
     $this->advanceProgress();
     $this->setProgressMessage('Sending data..');
     // Call actual command handler
     $this->setResponse($this->handle($input, $output));
     $this->advanceProgress();
     $this->setProgressMessage('[' . $this->provider . '] ' . $this->getResponse()->getMessage());
     $this->finishProgress();
 }
Ejemplo n.º 3
0
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $provider = $input->getArgument('provider');
     $baseDir = $_SERVER['HOME'] . DIRECTORY_SEPARATOR . '.slackpipe';
     if (!is_dir($_SERVER['HOME'] . DIRECTORY_SEPARATOR . '.slackpipe')) {
         mkdir($baseDir);
     }
     $config = Config::factory($provider);
     // Custom Handler
     if ($class = Asserts::hasCustomSetup($provider)) {
         $command = new $class($this, $config);
         $command->handle($input, $output);
     } else {
         $helper = $this->getHelper('question');
         $question = new Question('Please enter your token: ', false);
         $token = $helper->ask($input, $output, $question);
         if ($config->write(['token' => $token]) !== false) {
             $output->writeln('Token written to file: ' . $config->filePath());
         } else {
             $output->writeln('Nothing written..');
         }
     }
 }
Ejemplo n.º 4
0
 /**
  * JiraConfig constructor.
  *
  * @param string $filename
  */
 public function __construct($filename = '')
 {
     parent::__construct();
 }