Domanda

Is there a way to get a non-cached config value from Magento using Mage::getStoreConfig without having to first flush the entire config cache?

È stato utile?

Soluzione

I do not believe this is possible.

You could look into querying the database directly for the value in core_config_data but you should really let Magento handle the full configuration and merging as the configuration is built on top of the xml files, and split into varying groups then cached.

If you want to handle this in a programmatic way you could call Mage::getConfig()->reinit() which should reinitialise the configuration object and re-cache it, while ignoring the current values in the cache.

https://github.com/OpenMage/magento-mirror/blob/1.9.3.9/app/code/core/Mage/Core/Model/Config.php#L363-L374

/**
 * Reinitialize configuration
 *
 * @param   array $options
 * @return  Mage_Core_Model_Config
 */
public function reinit($options = array())
{
    $this->_allowCacheForInit = false;
    $this->_useCache = false;
    return $this->init($options);
}
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a magento.stackexchange
scroll top