You are here

function drush_key_provider_list in Key 8

Same name and namespace in other branches
  1. 7.3 drush/key.drush.inc \drush_key_provider_list()

Get a list of available key providers.

File

drush/key_provider_list.drush.inc, line 11
Display a list of available key providers.

Code

function drush_key_provider_list() {
  $result = [];
  $storage_method = drush_get_option('storage-method');
  $plugins = \Drupal::service('plugin.manager.key.key_provider')
    ->getDefinitions();
  foreach ($plugins as $id => $plugin) {
    if (!isset($storage_method) || $plugin['storage_method'] == $storage_method) {
      $row = [];
      $row['id'] = $id;
      $row['description'] = $plugin['description'];
      $result[$id] = $row;
    }
  }
  return $result;
}