Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #5146. Document single file config import using config:set #5543

Merged
merged 2 commits into from
Apr 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions src/Drupal/Commands/config/ConfigCommands.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ public function get($config_name, $key = '', $options = ['format' => 'yaml', 'so
#[CLI\Usage(name: 'drush config:set --input-format=yaml user.role.authenticated permissions [foo,bar]', description: 'Use a sequence as value for the key <info>permissions</info> of <info>user.role.authenticated</info> config object.')]
#[CLI\Usage(name: "drush config:set --input-format=yaml system.site page {403: '403', front: home}", description: 'Use a mapping as value for the key <info>page</info> of <info>system.site</info> config object.')]
#[CLI\Usage(name: 'drush config:set --input-format=yaml user.role.authenticated ? "{label: \'Auth user\', weight: 5}"', description: 'Update two top level keys (label, weight) in the <info>system.site</info> config object.')]
#[CLI\Usage(name: 'cat tmp.yml | drush config:set --input-format=yaml user.mail ? -', description: 'Update the <info>user.mail</info> config object in its entirety.')]
#[CLI\Complete(method_name_or_callable: 'configComplete')]
public function set($config_name, $key, $value, $options = ['input-format' => 'string'])
{
Expand Down
3 changes: 3 additions & 0 deletions src/Drupal/Commands/config/ConfigImportCommands.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,9 @@ public function __construct(
#[CLI\Option(name: 'source', description: 'An arbitrary directory that holds the configuration files.')]
#[CLI\Option(name: 'partial', description: 'Allows for partial config imports from the source directory. Only updates and new configs will be processed with this flag (missing configs will not be deleted). No config transformation happens.')]
#[CLI\Bootstrap(level: DrupalBootLevels::FULL)]
#[CLI\Usage(name: 'drush config:import', description: 'Update Drupal\'s configuration so it matches the contents of the config directory.')]
#[CLI\Usage(name: 'drush config:import --partial --source=/app/config', description: 'Import from the /app/config directory which typically contains one or a few yaml files.')]
#[CLI\Usage(name: 'cat tmp.yml | drush config:set --input-format=yaml user.mail ? -', description: 'Update the <info>user.mail</info> config object in its entirety.')]
#[CLI\Topics(topics: [DocsCommands::DEPLOY])]
public function import(array $options = ['source' => self::REQ, 'partial' => false, 'diff' => false])
{
Expand Down