I want to modify a setting, which I know how to find and change in the Magento Admin, - but I want to modify it in the config.php file. Which way can i find out the configuration path / syntax within the config.php file for that specific setting?
Example I want to set the cookie restriction mode to Yes via config.php. http://docs.magento.com/m2/ee/user_guide/stores/compliance-cookie-restriction-mode.html describes how to change the setting in the Magento Admin.
It seems to be possible to get the path from /src/vendor/magento/module-cookie/etc/config.xml:
<?xml version="1.0"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd">
<default>
<web>
<cookie>
<cookie_lifetime>3600</cookie_lifetime>
<cookie_httponly>1</cookie_httponly>
<cookie_restriction>0</cookie_restriction>
<cookie_restriction_lifetime>31536000</cookie_restriction_lifetime>
</cookie>
</web>
</default>
</config>
... which could translate into ...
'system' =>
array (
'default' =>
array (
'web' =>
array (
'cookie' =>
array (
'cookie_lifetime' => '3600',
'cookie_restriction' => '1'
... but that seems a bit complicated to me for everyday usage (1. find the right module, 2. investigate source code, 3. translate xml to config.php format). Is there an easier way?
bin/magento app:config:dump
. The script updated env.php and config.php for me; I stored the two updated files in a safe place and restored the backup, so that the environment would run the same way as before. I then was able to find and copy the configurations I needed in the stored config.php file. Thank you, @Ramkishan!