Hello!
I'm looking for a nice solution how to refractor a dirty code snippet
which runs threw the code.
The actual state:
My symfony project runs on two dedicated servers. The first server
hosts the site for the tld 'at' and the second one for 'de' and 'ch'.
So all of them are german based websites, but for the future other
languages will be available as well.
If I need different values for a domain I call a method
getCountryCode(), which looks like this:
[CODE]
function getCountryCode() {
if ($_SERVER['SERVER_NAME'] == "domain.at" ||
$_SERVER['SERVER_NAME'] == "www.domain.at") {
return "AT";
} else if ($_SERVER['SERVER_NAME'] == "domain.ch" ||
$_SERVER['SERVER_NAME'] == www.domain.ch") {
return "CH";
} else {
return "DE";
}
}
[/CODE]
As I guess it isn't the best way to do this, but this has been done by
another developer.
One possibilty would be to generate different files for each domain
and server but that would be a lot of files...
Thx and BR Stefan
--
If you want to report a vulnerability issue on symfony, please send it to
security at symfony-project.com
You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en