If you have several domains, then, presumably, you have several stores. Instead of reading the domain to determine which storage you can just read the storage directly:
$store = Mage::app()->getStore()
$store , then you have all the necessary information. For example, to get the "repository code" that you set in using the administrator,
$store->getCode()
In addition to object-oriented and, therefore, easier to write, you benefit from the fact that the domains are fully customizable by the administrator, you will not need to rewrite your code every time there is a change.
source share