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

config:store:get does not read config.php or env.php, or default xml #712

Open
convenient opened this issue Feb 9, 2021 · 2 comments
Open

Comments

@convenient
Copy link
Contributor

Current Implementation

When you have config stored in env.php and config.php then using config:store:get can produce values which arent actually used on the site.

For example putting into env.php

    'system' => [
        'default' => [
            'admin' => [
                'security' => [
                    'session_lifetime' => 31536000
                ]
            ],
        ]
    ]
];

Then running config:store:get we get the value from core_config_data which won't actually be used in the system.

$ magerun2 config:store:get admin/security/session_lifetime
+---------------------------------+---------+----------+-------+
| Path                            | Scope   | Scope-ID | Value |
+---------------------------------+---------+----------+-------+
| admin/security/session_lifetime | default | 0        | 86400 |
+---------------------------------+---------+----------+-------+

However magentos config:show command properly reads it

$ php bin/magento config:show admin/security/session_lifetime
31536000

If you remove the value from env.php then magentos config:show properly falls back to core_config_data

php bin/magento config:show admin/security/session_lifetime
86400

Suggested Enhancement

It would be neat if we could have config:store:get read default.xml, config.php, and env.php appropriately.

I really like mageruns ability to search with wildcards like '%yotpo%' but we cant trust the output of that based on the hardcoded values.

I'm working around this by php bin/magento config:show | grep yotpo

Expected Benefits

More truthful values of the actual configuration used on the site. I'm not sure how easy or difficult this is, or whether it would end up as a copy of config:show but with differing pattern matching after the full list of config has been worked out?

@cmuench
Copy link
Member

cmuench commented Feb 9, 2021

@convenient Yes, that would be a interesting enhancement. Maybe it's a bit difficult. Currently we use the DB to query the table.
In the new scenario we need to search in the merged config data.

@convenient
Copy link
Contributor Author

@cmuench yes thats what I was thinking which makes the sql syntax a bit difficult. For now i will use magento core config:show and try to remember a little grep -E regex to replace % wildcards :)

@convenient convenient changed the title config:store:get does not read config.php or env.php config:store:get does not read config.php or env.php, or default.xml Oct 20, 2022
@convenient convenient changed the title config:store:get does not read config.php or env.php, or default.xml config:store:get does not read config.php or env.php, or default xml Oct 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants