You are here

class Setup in DRD Agent 8.3

Same name in this branch
  1. 8.3 src/Setup.php \Drupal\drd_agent\Setup
  2. 8.3 src/Command/Setup.php \Drupal\drd_agent\Command\Setup
Same name and namespace in other branches
  1. 4.0.x src/Command/Setup.php \Drupal\drd_agent\Command\Setup

Class Setup.

@package Drupal\drd_agent

Hierarchy

  • class \Drupal\drd_agent\Command\Setup extends \Symfony\Component\Console\Command\Command uses \Drupal\Console\Core\Command\Shared\CommandTrait

Expanded class hierarchy of Setup

1 string reference to 'Setup'
console.services.yml in ./console.services.yml
console.services.yml
1 service uses Setup
drd_agent.command.setup in ./console.services.yml
Drupal\drd_agent\Command\Setup

File

src/Command/Setup.php, line 18

Namespace

Drupal\drd_agent\Command
View source
class Setup extends Command {
  use CommandTrait;

  /**
   * @var \Drupal\drd_agent\Setup
   */
  protected $setupService;

  /**
   * Setup constructor.
   *
   * @param \Drupal\drd_agent\Setup $setup_service
   */
  public function __construct(SetupService $setup_service) {
    parent::__construct();
    $this->setupService = $setup_service;
  }

  /**
   * {@inheritdoc}
   */
  protected function configure() {
    parent::configure();
    $this
      ->setName('drd:agent:setup')
      ->setDescription($this
      ->trans('Initially setup the site for the DRD Agent, only used internally by the setup process.'))
      ->addArgument('token', InputArgument::REQUIRED, $this
      ->trans('Base64 and json encoded array of all variables required such that DRD can communicate with this domain in the future'));
  }

  /**
   * {@inheritdoc}
   */
  protected function execute(InputInterface $input, OutputInterface $output) {
    $_SESSION['drd_agent_authorization_values'] = $input
      ->getArgument('token');
    $this->setupService
      ->execute();
    unset($_SESSION['drd_agent_authorization_values']);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
Setup::$setupService protected property
Setup::configure protected function Configures the current command.
Setup::execute protected function Executes the current command.
Setup::__construct public function Setup constructor.