function drush_get_context_options

8.0.x context.inc drush_get_context_options($option, $flatten = FALSE)
6.x context.inc drush_get_context_options($option, $flatten = FALSE)
7.x context.inc drush_get_context_options($option, $flatten = FALSE)
3.x context.inc drush_get_context_options($option, $flatten = FALSE)
4.x context.inc drush_get_context_options($option, $flatten = FALSE)
5.x context.inc drush_get_context_options($option, $flatten = FALSE)
master context.inc drush_get_context_options($option, $flatten = FALSE)

Get all of the values for an option in every context.

Parameters

option: The name of the option to get

Return value

An array whose key is the context name and value is the specific value for the option in that context.

3 calls to drush_get_context_options()
drush_build_drush_command in includes/environment.inc
Build a drush command suitable for use for Drush to call itself e.g. in backend_invoke.
drush_core_config_load in commands/core/core.drush.inc
_core_site_status_table in commands/core/core.drush.inc

File

includes/context.inc, line 510
The Drush context API implementation.

Code

function drush_get_context_options($option, $flatten = FALSE) {
  $result = array();

  $contexts = drush_context_names();
  foreach ($contexts as $context) {
    $value = _drush_get_option($option, drush_get_context($context));

    if ($value !== NULL) {
      if ($flatten && is_array($value)) {
        $result = array_merge($value, $result);
      }
      else {
        $result[$context] = $value;
      }
    }
  }

  return $result;
}