function _drush_sitealias_site_list

8.0.x sitealias.drush.inc _drush_sitealias_site_list()
6.x sitealias.drush.inc _drush_sitealias_site_list()
7.x sitealias.drush.inc _drush_sitealias_site_list()
3.x sitealias.drush.inc _drush_sitealias_site_list()
4.x sitealias.drush.inc _drush_sitealias_site_list()
5.x sitealias.drush.inc _drush_sitealias_site_list()
master sitealias.drush.inc _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/sitealias.drush.inc
Return the list of all site aliases and all local sites.

File

commands/core/sitealias.drush.inc, line 108
Site alias commands.

Code

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;
}