I have a staging and development environment on the same machine. I would like to configure a different memcached port in ProjectConfiguration.class.php depending on my environment. I imagine its not safe to use $SERVER['HTTP_HOST'] inside of the ProjectConfiguration file because that won't account for tasks run from the command line.
What would be the best way to accomplish what this bit of code intends:
public function configureDoctrine(Doctrine_Manager $manager) {
if ($_SERVER['HTTP_HOST'] == 'dev.example.com') {
$memcached_port = 11211;
} else {
$memcached_port = 11212;
}
$servers = array(
'host' => '127.0.0.1',
'port' => $memcached_port,
'persistent' => true);
}