Skip to content

Conversation

@nmalevanec
Copy link
Contributor

Original Pull Request

#13280

Taken over from #12178.

This is similar to the "lock" switch which writes configuration
values to app/etc/env.php. The "lock-config" switch writes it to
app/etc/config.php instead which can be shared between environments.
For consistency, the "lock" switch has been renamed to "lock-env".

Description

In most cases, configuration settings should be shared among all development, staging and live instances of a shop. To achieve this, you can use the same mechanism as with the --lock switch described in http://devdocs.magento.com/guides/v2.2/config-guide/cli/config-cli-subcommands-config-mgmt-set.html.

The only difference is that the configuration values will be stored in app/etc/config.php instead of app/etc/env.php. This file should usually be included in the VCS and thus shared between instances.

To store a config setting in the file via command line, the command would be as follows:

bin/magento config:set --lock-config <path> <value>

i.e.

bin/magento config:set --lock-config general/store_information/name "Sample Store"

Manual testing scenarios

  1. Call bin/magento config:set --lock-config general/store_information/name "Sample Store" from the command line
  2. Verify that the app/etc/config.php file contains a section as follows:
[...]
  'cache_types' => 
  array (
    'config' => 1,
    [...]
  ),
  'install' => 
  array (
    'date' => 'Wed, 08 Nov 2017 11:52:21 +0000',
  ),
  'system' => 
  array (
    'default' => 
    array (
      'general' => 
      array (
        'store_information' => 
        array (
          'name' => 'Sample Store',
        ),
      ),
    ),
  ),
);
  1. Verify that the configuration setting "Store Name" in the section "General", group "Store Information" is filled with "Sample Store" and greyed out:

grafik

Contribution checklist

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds on Travis CI are green)

@magento-engcom-team
Copy link
Contributor

Hi @okorshenko, thank you for the review.
ENGCOM-585 has been created to process this Pull Request

@magento-engcom-team magento-engcom-team merged commit 9ca5d97 into magento:2.3-develop Feb 28, 2018
@nmalevanec nmalevanec deleted the 2.3-develop-PR-port-13280 branch August 21, 2018 07:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants