You are here

class ConfigSplitCommands in Configuration Split 8

Same name and namespace in other branches
  1. 2.0.x src/Commands/ConfigSplitCommands.php \Drupal\config_split\Commands\ConfigSplitCommands

Class ConfigSplitCommands.

This is the Drush 9 and 10 commands.

@package Drupal\config_split\Commands

Hierarchy

Expanded class hierarchy of ConfigSplitCommands

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

File

src/Commands/ConfigSplitCommands.php, line 15

Namespace

Drupal\config_split\Commands
View source
class ConfigSplitCommands extends DrushCommands {

  /**
   * The interoperability cli service.
   *
   * @var \Drupal\config_split\ConfigSplitCliService
   */
  protected $cliService;

  /**
   * ConfigSplitCommands constructor.
   *
   * @param \Drupal\config_split\ConfigSplitCliService $cliService
   *   The CLI service which allows interoperability.
   */
  public function __construct(ConfigSplitCliService $cliService) {
    $this->cliService = $cliService;
  }

  /**
   * Export only split configuration to a directory.
   *
   * @param string $split
   *   The split configuration to export, if none is given do a normal export.
   *
   * @command config-split:export
   *
   * @usage drush config-split:export development
   *   Export development configuration; assumes a "development" split export
   *   only that.
   *
   * @aliases csex
   */
  public function splitExport($split = NULL) {
    $this->cliService
      ->ioExport($split, $this
      ->io(), 'dt');
  }

  /**
   * Import only config from a split.
   *
   * @param string $split
   *   The split configuration to export, if none is given do a normal import.
   *
   * @command config-split:import
   *
   * @usage drush config-split:import development
   *   Import development configuration; assumes a "development" split import
   *   only that.
   *
   * @aliases csim
   */
  public function splitImport($split = NULL) {
    $this->cliService
      ->ioImport($split, $this
      ->io(), 'dt');
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ConfigSplitCommands::$cliService protected property The interoperability cli service.
ConfigSplitCommands::splitExport public function Export only split configuration to a directory.
ConfigSplitCommands::splitImport public function Import only config from a split.
ConfigSplitCommands::__construct public function ConfigSplitCommands constructor.