Magento reads its configuration values at runtime directly from the configuration object's tree structure, so you need to use the configuration object's native setNode
method to change the values. However, because of the way Magento loads in scoped configuration (self link), it's not as straight forward as it seems.
With current versions of Magento (and I believe, but have not tested, with older versions), you'll need to set the configuration value in the set of nodes for the current store
.
Step one is getting the code for the currently set store. You can do this programmatically with the following
$store = Mage::app()->getStore();
$code = $store->getCode();
then, you can set a configuration value with the following call
$config = Mage::getConfig();
$config->setNode("stores/$code/web/unsecure/base_skin_url", 'value_to_set');
Keep in mind this all needs to happen after Magento has bootstrapped the configuration object. Also keep in mind there's a period of time where Magento will have a loaded configuration, but the store object will not be loaded. If this is the case you will not be able to load the store code from the store object.
I did something similar in my Pulse Storm Chaos module. If you're interested in working code it's on Github.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…