You are here

function key_get_configs in Key 7.2

Same name and namespace in other branches
  1. 7 key.module \key_get_configs()

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.

4 calls to key_get_configs()
key_configs_list in includes/key.admin.inc
Menu callback; displays the list of key configurations.
key_get_config in ./key.module
Gets information about a specific key configuration.
key_get_configs_as_options in ./key.module
Gets all key configurations as options, for use in forms.
_key_configs_filter in ./key.module
Filter an array of key configurations.

File

./key.module, line 294
Provides the ability to manage keys, which can be used by other modules.

Code

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

    // Unserialize provider_settings field.
    foreach ($configs as $name => $config) {
      if (!empty($config['provider_settings'])) {
        $provider_settings = unserialize($config['provider_settings']);
        $configs[$name]['provider_settings'] = $provider_settings;
      }
    }
  }
  return $configs;
}