You are here

class Drush in DRD Agent 4.0.x

Same name and namespace in other branches
  1. 8.3 src/Commands/Drush.php \Drupal\drd_agent\Commands\Drush

Class Base.

@package Drupal\drd_agent

Hierarchy

  • class \Drupal\drd_agent\Commands\Drush extends \Drush\Commands\DrushCommands

Expanded class hierarchy of Drush

1 string reference to 'Drush'
drush.services.yml in ./drush.services.yml
drush.services.yml
1 service uses Drush
drd_agent.commands in ./drush.services.yml
Drupal\drd_agent\Commands\Drush

File

src/Commands/Drush.php, line 13

Namespace

Drupal\drd_agent\Commands
View source
class Drush extends DrushCommands {

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

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

  /**
   * Configure this domain for communication with a DRD instance.
   *
   * @param string $token
   *   Base64 and json encoded array of all variables required such that
   *   DRD can communicate with this domain in the future.
   *
   * @command drd:agent:setup
   * @aliases drd-agent-setup
   */
  public function setup($token) {
    $_SESSION['drd_agent_authorization_values'] = $token;
    $this->setupService
      ->execute();
    unset($_SESSION['drd_agent_authorization_values']);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
Drush::$setupService protected property
Drush::setup public function Configure this domain for communication with a DRD instance.
Drush::__construct public function Drush constructor.