Last active
August 29, 2015 14:25
-
-
Save threeiem/9aab2428e87eec516b78 to your computer and use it in GitHub Desktop.
Get all the multisite paths from Drush.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Get Local Paths. | |
* | |
* Returns an array of full paths to the local Drupal sites. | |
* | |
* @return array Array of full paths for local sites or an empty array. | |
*/ | |
function _multisite_get_path(){ | |
$sites_record = (array) drush_sitealias_get_record('@sites'); | |
$self_record = (array) drush_sitealias_get_record('@self'); | |
if (drush_valid_drupal_root($self_record['root'])){ | |
foreach ($sites_record['site-list'] as $key => $value) { | |
$sites[$key] = str_replace('#', '/'.$sites_record['#name'].'/', $value); | |
} | |
} | |
return $sites; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment