Enhance config:store:get to read from all configuration sources #1750
+109
−3
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The
config:store:getcommand previously only read configuration values from thecore_config_datadatabase table, missing values that were overridden inenv.php,config.php, or XML default configuration files. This led to displaying incorrect or outdated values when configuration was managed through these files instead of the database.Problem
When Magento configuration is stored in deployment files (
config.php), environment files (env.php), or defined in XML defaults, theconfig:store:getcommand would show stale database values instead of the actual effective configuration that Magento uses at runtime.Solution
Enhanced the command using a hybrid approach that:
Preserves wildcard functionality: Still uses the existing database collection query to find matching config paths (supporting patterns like
'%yotpo%','admin/*', etc.)Gets accurate values: For each found path, uses
ScopeConfigInterface::getValue()to retrieve the actual effective configuration value from all sourcesProper scope mapping: Maps database scope names (
'websites','stores') to ScopeConfigInterface scope names ('website','store')Maintains full compatibility: All existing functionality preserved (formatting options, filtering, output modes, etc.)
Configuration Priority Order
The command now correctly follows Magento's configuration priority:
config.php(deployment configuration)env.php(environment configuration)core_config_datatable - highest priority)Example Use Cases
This resolves the issue where users couldn't trust the command output when configuration was stored in
env.phporconfig.phpfiles.Fixes #712.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.