Programmatically changing the global site name? I'm making a multi-site setup using the same install and the same database, basing it off domains. I'm trying to programmatically alter the site_name variable so that it displays a different site name based on the domain being used.

I am using 3 different methods to achieve this at the same time, however even that is not bullet-proof. Certain instances (i.e. some administration pages, user login, or user profile edit) still display the default site name in the page title (or elsewhere).

I am doing the following:


$conf['site_name'] = $my_title; in settings.php
$vars['site_name'] = $my_title; in my theme's hook_preprocess_page
using hook_tokens_alter in a custom module to change the [site:name] token to $my_title


Despite all these measures, it seems I did not enforce the site name change in a bulletproof way. Is there a better method I have missed?

Worth mentioning: I am using the Metatag module, which seems to alter page titles on a fundamental level. I am not sure if this is related to my problem.
What is the value for the site_name variable in the variables table? (e.g. what's the output of variable_get('site_name')?)

If it's overridden from the value that you set in your settings file, reset it like so:

variable_set('site_name', $my_title)