You are here

class LockrDrupal7SecretInfo in Lockr 7.3

Hierarchy

Expanded class hierarchy of LockrDrupal7SecretInfo

File

./lockr.secret_info.inc, line 5

View source
class LockrDrupal7SecretInfo implements SecretInfoInterface {
  private $data;
  public function __construct() {
    $this->data = variable_get('lockr_secret_info') ?: [];
  }

  /**
   * {@inheritdoc}
   */
  public function getSecretInfo($name) {
    if (isset($this->data[$name])) {
      return $this->data[$name];
    }
    elseif ($key = key_get_key($name)) {
      if (isset($key['key_provider_settings']['encoded'])) {
        return [
          'wrapping_key' => $key['key_provider_settings']['encoded'],
        ];
      }
    }
    return [];
  }

  /**
   * {@inheritdoc}
   */
  public function setSecretInfo($name, array $info) {
    $this->data[$name] = $info;
    variable_set('lockr_secret_info', $this->data);
  }

  /**
   * {@inheritdoc}
   */
  public function getAllSecretInfo() {
    return $this->data;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
LockrDrupal7SecretInfo::$data private property
LockrDrupal7SecretInfo::getAllSecretInfo public function Returns all secret info. Overrides SecretInfoInterface::getAllSecretInfo
LockrDrupal7SecretInfo::getSecretInfo public function Gets secret info for a secret by name. Overrides SecretInfoInterface::getSecretInfo
LockrDrupal7SecretInfo::setSecretInfo public function Sets secret info for a secret by name. Overrides SecretInfoInterface::setSecretInfo
LockrDrupal7SecretInfo::__construct public function