You are here

function key_get_keys in Key 7.3

Gets information about all key configurations.

Parameters

bool $reset: A flag to force the configurations to be retrieved from the database.

Return value

array An array of configurations.

8 calls to key_get_keys()
key_configs_list in includes/key.admin.inc
Menu callback; displays the list of key configurations.
key_get_key in ./key.module
Gets information about a specific key configuration.
key_get_keys_by_provider in ./key.module
Get keys that use the specified key provider.
key_get_keys_by_storage_method in ./key.module
Get keys that use the specified storage method.
key_get_keys_by_type in ./key.module
Get keys that use the specified key type.

... See full list

File

./key.module, line 342
Main Key functionality and hook implementations.

Code

function key_get_keys($reset = FALSE) {
  $configs =& drupal_static(__FUNCTION__);
  if (!isset($configs) || $reset) {
    $configs = db_query("SELECT * FROM {key_config} ORDER BY label ASC")
      ->fetchAllAssoc('id', PDO::FETCH_ASSOC);

    // Unserialize plugin settings fields.
    foreach ($configs as $id => $config) {
      foreach (array(
        'key_type',
        'key_provider',
        'key_input',
      ) as $type) {
        if (!empty($config[$type . '_settings'])) {
          $configs[$id][$type . '_settings'] = unserialize($config[$type . '_settings']);
        }
      }
    }
  }
  return $configs;
}