function DrupalFinder::discoverRoots
Discover all valid paths.
Parameters
$start_path: The path to start the search from.
Throws
\Exception
2 calls to DrupalFinder::discoverRoots()
- DrupalFinder::locateRoot in vendor/
webflo/ drupal-finder/ src/ DrupalFinder.php - Locate Drupal, Composer, and vendor directory paths.
- DrupalFinder::__construct in vendor/
webflo/ drupal-finder/ src/ DrupalFinder.php - Initialize finder.
File
-
vendor/
webflo/ drupal-finder/ src/ DrupalFinder.php, line 145
Class
Namespace
DrupalFinderCode
protected function discoverRoots($start_path) {
// Since we are discovering, reset all path variables.
$this->drupalRoot = false;
$this->composerRoot = false;
$this->vendorDir = false;
foreach (array(
true,
false,
) as $follow_symlinks) {
$path = $start_path;
if ($follow_symlinks && is_link($path)) {
$path = realpath($path);
}
// Check the start path.
if ($this->findAndValidateRoots($path)) {
return;
}
else {
// Move up dir by dir and check each.
while ($path = $this->shiftPathUp($path)) {
if ($follow_symlinks && is_link($path)) {
$path = realpath($path);
}
if ($this->findAndValidateRoots($path)) {
return;
}
}
}
}
}