I was trying to read some backend config using the ScopeConfigInterface.
di.xml
< preference for="Magento\Framework\Logger\Monolog" type="Foo\Log\Helper\Data" / >
public function __constructor(
Magento\Framework\App\Config\ScopeConfigInterface $config
) {
config->getValue('dev/debug/remote_server_host');
}
Error:::
Circular dependency: Magento\Config\Model\Config\Backend\Encrypted depends on Magento\Framework\Model\Context and vice versa.
When I use the same code, but using another preference in di.xml I can read the config as expected.
Example
(just for testing)
< preference for="Magento\Cms\Controller\Index\Index" type="Foo\Log\Helper\Data" / >
Is this an issue with dependency compiliation because it is only possible to use ScopeConfigInterface on certain objects?
Thanks