Hi everyone,
Hope I'm posting in the right place for this question/discussion. I'm starting to use Drush frequently. I find it a great natural extension to the way I work as I develop on Linux.
I've come up against a bit of a problem though. I'm not sure but I assume that drush parses the settings file to do it's stuff. The way I develop I usually work with a number of sub domains , dev , test , staging.
My settings file deals with this by looking at the $_SERVER['SERVER_NAME'] to determine which domain the code is on and defining which DB to connect to.
<?php
$host = $_SERVER['SERVER_NAME'];
switch( $host )
{
case 'drupal-dev.idevelop.com': # Development server
$db_url = 'mysqli://drupal@localhost/d6_dev';
$base_url = 'http://'.$host;
break;
case 'drupal-test.idevelop.com': # Testing server
$db_url = 'mysqli://drupal@localhost/d6_test';
$base_url = 'http://'.$host;
break;
case 'drupal-staging.idevelop.com': # Tag server
$db_url = 'mysqli://drupal@localhost/d6_staging';
$base_url = 'http://'.$host;
break;
}
?>
This appears to stop drush in it's tracks.
I probably get round it by doing a multi-site setup - but I don't want to maintain numerous copies of the settings.php file.
Does anyone else develop in a similar way? Any suggestions about how to deal with this would be greatly appreciated.
Sam