class Base in DRD Agent 4.0.x
Same name in this branch
- 4.0.x src/Crypt/Base.php \Drupal\drd_agent\Crypt\Base
- 4.0.x src/Agent/Action/Base.php \Drupal\drd_agent\Agent\Action\Base
- 4.0.x src/Agent/Remote/Base.php \Drupal\drd_agent\Agent\Remote\Base
- 4.0.x src/Agent/Auth/Base.php \Drupal\drd_agent\Agent\Auth\Base
Same name and namespace in other branches
- 8.3 src/Crypt/Base.php \Drupal\drd_agent\Crypt\Base
Provides base encryption functionality.
Hierarchy
- class \Drupal\drd_agent\Crypt\Base implements BaseInterface
Expanded class hierarchy of Base
2 files declare their use of Base
File
- src/
Crypt/ Base.php, line 12
Namespace
Drupal\drd_agent\CryptView source
class Base implements BaseInterface {
/**
* {@inheritdoc}
*/
public static function getInstance(ContainerInterface $container, $method, array $settings) : BaseMethodInterface {
$classname = "\\Drupal\\drd_agent\\Crypt\\Method\\{$method}";
return new $classname($container, $settings);
}
/**
* {@inheritdoc}
*/
public static function getMethods(ContainerInterface $container, $instances = FALSE) : array {
$methods = [];
foreach ([
'MCrypt',
'OpenSSL',
'TLS',
] as $item) {
$classname = "\\Drupal\\drd_agent\\Crypt\\Method\\{$item}";
/* @var BaseMethodInterface $method */
$method = new $classname($container);
if ($method instanceof BaseMethodInterface && $method
->isAvailable()) {
if ($instances) {
$methods[$method
->getLabel()] = $method;
}
else {
$methods[$method
->getLabel()] = [
'classname' => $classname,
'cipher' => $method
->getCipherMethods(),
];
}
}
}
return $methods;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
Base:: |
public static | function |
Create instance of a crypt object of given method with provided settings. Overrides BaseInterface:: |
|
Base:: |
public static | function |
Get a list of crypt methods, either just their ids or instances of each. Overrides BaseInterface:: |