Can i suggest the following modification to the function drd_server_server_domains
This essentially just makes an educated guess at all the domains on the server if the sites.php file hasn't been created
function drd_server_server_domains($sid) {
$user = drd_server_load_user($sid);
if (is_string($user)) {
return drd_server_error($user);
}
$sites = array();
if (file_exists(DRUPAL_ROOT . '/sites/sites.php')) {
include(DRUPAL_ROOT . '/sites/sites.php');
}
else {
foreach(scandir(DRUPAL_ROOT.'/sites') as $file) {
if(is_dir(DRUPAL_ROOT.'/sites/'.$file) && !in_array($file, array('.','..','default','all'))) {
$sites[$file] = $file;
}
}
}
$output = array();
foreach ($sites as $url => $id) {
if (isset($output[$id])) {
$output[$id]['aliases'][] = $url;
}
else {
if (file_exists(DRUPAL_ROOT . '/sites/'. $id .'/files/.htaccess')) {
$output[$id] = array(
'url' => $url,
'aliases' => array(),
);
}
}
}
return drupal_json_encode($output);
}
Maybe there could be some additional logic here.
perhaps even read some info from settings.php in each folder to figure out if there are multiple aliases to the same site.
Comments
Comment #1
jurgenhaasThis is a great idea, thanks a lot. Please find attached a patch which implements this into the latest dev release and I will submit when succesfully reviewed.
Comment #2
thtas commentedCool!
Additional logic i was thinking of is to translate special drupal naming conventions
i.e. domain.com.folder to domain.com/folder
From bootstrap.inc:
I'm thinking this may not actually possible though... shame.
Comment #3
jurgenhaasThe brand new version 2.x should now cover all of this. Pleae open new tickets if anything is still missing. Again, thanks a lot for your input.