You are here

public function DefaultContentDeployCommands::contentDeployExportSite in Default Content Deploy 8

Exports a whole site content.

Config directory will be emptied and all content of all entities will be exported.

Use 'drush dcd-entity-list' for list of all content entities on this system. You can exclude any entity type from export.

@command default-content-deploy:export-site

@option add_entity_type DEPRECATED. Will be removed in beta. The dcdes command exports all entity types. @option force-update Deletes configurations files that are not used on the site. @option folder Path to the export folder. @option skip_entity_type The entity types to skip. Use 'drush dcd-entity-list' for list of all content entities. @usage drush dcdes Export complete website. @usage drush dcdes --folder='../content' Export complete website from the specified folder. @usage drush dcdes --skip_entity_type=node,user Export complete website but skip nodes and users. @aliases dcdes,default-content-deploy-export-site

Parameters

array $options: An associative array of options.

Throws

\Exception

File

src/Commands/DefaultContentDeployCommands.php, line 228

Class

DefaultContentDeployCommands
Class DefaultContentDeployCommands.

Namespace

Drupal\default_content_deploy\Commands

Code

public function contentDeployExportSite(array $options = [
  'skip_entity_type' => NULL,
  'force-update' => FALSE,
  'folder' => self::OPT,
]) {
  $skip_ids = $this
    ->processingArrayOption($options['skip_entity_type']);
  if (!empty($options['folder'])) {
    $this->exporter
      ->setFolder($options['folder']);
  }
  $this->exporter
    ->setMode('all');
  $this->exporter
    ->setForceUpdate($options['force-update']);
  if ($skip_ids) {
    $this->exporter
      ->setSkipEntityIds($skip_ids);
  }
  $result = $this->exporter
    ->export()
    ->getResult();
  $this
    ->displayExportResult($result);
}