Commit 39966f5b authored by anarcat's avatar anarcat Committed by anarcat

rewrite provision_drupal_find_sites() to avoid recursing into the

sites directory, but just find the directories below

Closes: #327205
parent 7bd186f9
......@@ -406,11 +406,16 @@ function provision_drupal_provision_delete($url, $data) {
}
function provision_drupal_find_sites() {
$sitephp = file_scan_directory('./sites', 'settings\.php$', array('.', '..', 'CVS', '.svn'), 0, TRUE, 'filename', 0);
foreach ($sitephp as $file => $info) {
$path = explode("/", $file);
array_pop($path);
$sites[array_pop($path)] = $file;
if ($dir = opendir("./sites")) {
while (FALSE !== ($subdir = readdir($dir))) {
$file = "./sites/$subdir/settings.php";
if (file_exists("$file")) {
$sites[$subdir] = $file;
}
}
} else {
provision_log("error", t("Cannot find sites directory"));
$sites = FALSE;
}
return $sites;
}
......
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