function _drush_sitealias_site_list

8.0.x _drush_sitealias_site_list()
6.x _drush_sitealias_site_list()
7.x _drush_sitealias_site_list()
3.x _drush_sitealias_site_list()
4.x _drush_sitealias_site_list()
5.x _drush_sitealias_site_list()
master _drush_sitealias_site_list()

Return a list of all of the local sites at the current drupal root.

The array key is the site folder name, and the array value is the site specification for that site.

1 call to _drush_sitealias_site_list()
_drush_sitealias_all_list in commands/core/
Return the list of all site aliases and all local sites.


commands/core/, line 108
Site alias commands.


function _drush_sitealias_site_list() {
  $site_list = array();
  $base_path = drush_get_context('DRUSH_DRUPAL_ROOT');
  if ($base_path) {
    $base_path .= '/sites';
    $files = drush_scan_directory($base_path, '/settings\.php/', array('.', '..', 'CVS', 'all'), 0, 1);
    foreach ($files as $filename => $info) {
      if ($info->basename == 'settings.php') {
        $alias_record = drush_sitealias_build_record_from_settings_file($filename);
        if (!empty($alias_record)) {
          $site_list[drush_sitealias_uri_to_site_dir($alias_record['uri'])] = $alias_record;
  return $site_list;