function _core_site_status_table

8.0.x core.drush.inc _core_site_status_table($project = '')
6.x core.drush.inc _core_site_status_table($project = '')
7.x core.drush.inc _core_site_status_table($project = '')
3.x core.drush.inc _core_site_status_table($project = '')
4.x core.drush.inc _core_site_status_table($project = '')
5.x core.drush.inc _core_site_status_table($project = '', $full = FALSE)
master core.drush.inc _core_site_status_table($project = '')
3 calls to _core_site_status_table()
drush_core_status in commands/core/core.drush.inc
Command callback. Provides a birds-eye view of the current Drupal installation.
drush_sitealias_resolve_path_references in includes/sitealias.inc
If there are any path aliases (items beginning with "%") in the test string, then resolve them as path aliases and add them to the provided alias record.
_core_site_credentials in commands/core/core.drush.inc

File

commands/core/core.drush.inc, line 560
Core drush commands.

Code

function _core_site_status_table($project = '') {
  $phase = drush_get_context('DRUSH_BOOTSTRAP_PHASE');
  if ($drupal_root = drush_get_context('DRUSH_DRUPAL_ROOT')) {
    $status_table['drupal-version'] = drush_drupal_version();
    if ($site_root = drush_get_context('DRUSH_DRUPAL_SITE_ROOT')) {
      $status_table['uri'] = drush_get_context('DRUSH_URI');
      try {
        $sql = drush_sql_get_class();
        $db_spec = $sql->db_spec();
        $status_table['db-driver'] = $db_spec['driver'];
        if (!empty($db_spec['unix_socket'])) {
          $status_table['db-socket'] = $db_spec['unix_socket'];
        }
        elseif (isset($db_spec['host'])) {
          $status_table['db-hostname'] = $db_spec['host'];
        }
        $status_table['db-username'] = isset($db_spec['username']) ? $db_spec['username'] : NULL;
        $status_table['db-password'] = isset($db_spec['password']) ? $db_spec['password'] : NULL;
        $status_table['db-name'] = isset($db_spec['database']) ? $db_spec['database'] : NULL;
        $status_table['db-port'] = isset($db_spec['port']) ? $db_spec['port'] : NULL;
        if ($phase > DRUSH_BOOTSTRAP_DRUPAL_CONFIGURATION) {
          $boot_object = drush_get_bootstrap_object();
          $status_table['install-profile'] = $boot_object->get_profile();
          if ($phase > DRUSH_BOOTSTRAP_DRUPAL_FULL) {
            $status_table['bootstrap'] = dt('Successful');
            if ($phase == DRUSH_BOOTSTRAP_DRUPAL_LOGIN) {
              $status_table['user'] = drush_user_get_class()->getCurrentUserAsSingle()->getUsername();
            }
          }
        }
      }
      catch (Exception $e) {
        // Don't worry be happy.
      }
    }
    if (drush_has_boostrapped(DRUSH_BOOTSTRAP_DRUPAL_FULL)) {
      $status_table['theme'] = drush_theme_get_default();
      $status_table['admin-theme'] = drush_theme_get_admin();
    }
  }
  if ($php_bin = drush_get_option('php')) {
    $status_table['php-bin'] = $php_bin;
  }
  $status_table['php-os'] = PHP_OS;
  if ($php_ini_files = _drush_core_config_php_ini_files()) {
    $status_table['php-conf'] = $php_ini_files;
  }
  $status_table['drush-script'] = DRUSH_COMMAND;
  $status_table['drush-version'] = DRUSH_VERSION;
  $status_table['drush-temp'] = drush_find_tmp();
  $status_table['drush-conf'] = drush_flatten_array(drush_get_context_options('context-path', ''));
  $alias_files = _drush_sitealias_find_alias_files();
  $status_table['drush-alias-files'] = $alias_files;

  $paths = _core_path_aliases($project);
  if (!empty($paths)) {
    foreach ($paths as $target => $one_path) {
      $name = $target;
      if (substr($name, 0, 1) == '%') {
        $name = substr($name, 1);
      }
      $status_table[$name] = $one_path;
    }
  }

  // Store the paths into the '%paths' index; this will be
  // used by other code, but will not be included in the output
  // of the drush status command.
  $status_table['%paths'] = $paths;

  return $status_table;
}