src/Robo/Commands/Setup/ToggleModulesCommand.php
protected function doToggleModules($command, $config_key) {
    if ($this->getConfig()->has($config_key)) {
      $this->say("Executing <comment>drush $command</comment> for modules defined in <comment>$config_key</comment>...");
      $modules = (array) $this->getConfigValue($config_key);
      $modules_list = implode(' ', $modules);
      $result = $this->taskDrush()
        ->drush("$command $modules_list")
        ->run();
      $exit_code = $result->getExitCode();
    }
    else {
      $exit_code = 0;
      $this->logger->info("$config_key is not set.");
    }

    if ($exit_code) {
      throw new BltException("Could not toggle modules listed in $config_key.");
    }
  }
protected function doToggleModules($command, $config_key) {
    if ($this->getConfig()->has($config_key)) {
      $this->say("Executing <comment>drush $command</comment> for modules defined in <comment>$config_key</comment>...");
      $modules = (array) $this->getConfigValue($config_key);
      $modules_list = implode(' ', $modules);
      $result = $this->taskDrush()
        ->drush("$command $modules_list")
        ->run();
      $exit_code = $result->getExitCode();
    }
    else {
      $exit_code = 0;
      $this->logger->info("$config_key is not set.");
    }

    if ($exit_code) {
      throw new BltException("Could not toggle modules listed in $config_key.");
    }
  }
protected function doToggleModules ( $ command , $ config_key ) { if ( $ this -> getConfig ( ) -> has ( $ config_key ) ) { $ this -> say ( "Executing <comment>drush $command</comment> for modules defined in <comment>$config_key</comment>..." ) ; $ modules = ( array ) $ this -> getConfigValue ( $ config_key ) ; $ modules_list = implode ( ' ' , $ modules ) ; $ result = $ this -> taskDrush ( ) -> drush ( "$command $modules_list" ) -> run ( ) ; $ exit_code = $ result -> getExitCode ( ) ; } else { $ exit_code = 0 ; $ this -> logger -> info ( "$config_key is not set." ) ; } if ( $ exit_code ) { throw new BltException ( "Could not toggle modules listed in $config_key." ) ; } }
Enables or uninstalls an array of modules.

@param string $command
The drush command to execute, e.g., pm-enable or pm-uninstall.
@param string $config_key
The config key containing the array of modules.

@throws \Acquia\Blt\Robo\Exceptions\BltException
Enables or uninstalls an array of modules .