Skip to content
Snippets Groups Projects
Commit a464cb98 authored by Tim Steiner's avatar Tim Steiner
Browse files

Support for creating sites inside of other sites. ie: music/ and music/choir

git-svn-id: file:///tmp/wdn_thm_drupal/trunk@235 20a16fea-79d4-4915-8869-1ea9d5ebf173
parent 44ae7b99
No related branches found
No related tags found
No related merge requests found
......@@ -73,10 +73,18 @@ function unl_add_site($site_path, $uri, $clean_url, $db_prefix) {
$db_url = escapeshellarg($db_url);
$db_prefix = escapeshellarg($db_prefix);
$command = "$php_path sites/all/modules/drush/drush.php -y --uri=$uri site-install unl_profile --sites-subdir=$sites_subdir --db-url=$db_url --db-prefix=$db_prefix --clean-url=$clean_url";
$subdir = explode('/', $site_path);
$symlink_name = array_pop($subdir);
$subdir_levels = count($subdir);
$subdir = implode('/', $subdir);
if ($subdir) {
mkdir($subdir, 0755, TRUE);
}
$subdir = realpath($subdir);
$subdir_levels = count(explode('/', $subdir)) - count(explode('/', DRUPAL_ROOT));
$symlink_target = array();
for ($i = 0; $i < $subdir_levels; $i++) {
......@@ -88,12 +96,11 @@ function unl_add_site($site_path, $uri, $clean_url, $db_prefix) {
$symlink_target = '.';
}
$command = "$php_path sites/all/modules/drush/drush.php -y --uri=$uri site-install unl_profile --sites-subdir=$sites_subdir --db-url=$db_url --db-prefix=$db_prefix --clean-url=$clean_url";
if ($subdir) {
mkdir($subdir, 0755, TRUE);
}
symlink($symlink_target, DRUPAL_ROOT . '/' . $subdir . '/' . $symlink_name);
symlink($symlink_target, $subdir . '/' . $symlink_name);
shell_exec($command);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment