Commit 31d0569d authored by ergonlogic's avatar ergonlogic

Only re-write our own aliases in sites.php.

parent 6037f87f
......@@ -45,9 +45,10 @@ print "<?php \n"; ?>
*/
<?php
$aliases = d()->aliases;
// Fix our subdir aliases.
foreach ($records as $alias => $site) {
$records[str_replace('/', '.', $alias)] = $site;
foreach ($aliases as $alias) {
$records[str_replace('/', '.', $alias)] = $records[$alias];
unset($records[$alias]);
}
?>
......
......@@ -75,8 +75,17 @@ function drush_subdirs_pre_provision_enable() {
*/
function subdirs_provision_config_load_templates($config) {
if ($config->template == 'provision_drupal_sites.tpl.php') {
drush_log('Generating sites.php for use with subdirectories.', 'notice');
return dirname(__FILE__) . '/Provision/Config/subdirs_drupal_sites.tpl.php';
$context = d();
$use_subdirs_tpl = FALSE;
foreach ($context->aliases as $alias) {
if (strpos($alias, '/')) {
$use_subdirs_tpl = TRUE;
}
}
if ($use_subdirs_tpl) {
drush_log('Generating sites.php for use with subdirectories.', 'notice');
return dirname(__FILE__) . '/Provision/Config/subdirs_drupal_sites.tpl.php';
}
}
}
......@@ -105,7 +114,6 @@ function _subdirs_remove_site_configs() {
$context = d();
$aliases = $context->aliases;
$subdirs_path = $context->server->http_app_path . '/subdirs.d';
if (count($aliases)) {
foreach ($aliases as $alias) {
_subdirs_delete_site_location($alias);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment