SwitchDbHashCommand
extends Command
in package
Console command: switch database encryption algorithm.
Tags
Table of Contents
- $config : Config
- $pathResolver : PathResolver|null
- $userCardService : UserCardServiceInterface
- $userService : UserServiceInterface
- __construct() : mixed
- Constructor
- configure() : void
- Configure the command.
- execute() : int
- Run the command.
- fixEntity() : void
- Re-encrypt an entity.
- getConfigWriter() : Writer
- Get a config writer
- getOpenSsl() : Openssl
- Get an OpenSsl object for the specified algorithm (or return null if the algorithm is 'none').
Properties
$config
protected
Config
$config
$pathResolver
protected
PathResolver|null
$pathResolver
= null
$userCardService
protected
UserCardServiceInterface
$userCardService
$userService
protected
UserServiceInterface
$userService
Methods
__construct()
Constructor
public
__construct(Config $config, UserServiceInterface $userService, UserCardServiceInterface $userCardService[, string|null $name = null ][, PathResolver|null $pathResolver = null ]) : mixed
Parameters
- $config : Config
-
VuFind configuration
- $userService : UserServiceInterface
-
User database service
- $userCardService : UserCardServiceInterface
-
UserCard database service
- $name : string|null = null
-
The name of the command; passing null means it must be set in configure()
- $pathResolver : PathResolver|null = null
-
Config file path resolver
Return values
mixed —configure()
Configure the command.
protected
configure() : void
Return values
void —execute()
Run the command.
protected
execute(InputInterface $input, OutputInterface $output) : int
Parameters
- $input : InputInterface
-
Input object
- $output : OutputInterface
-
Output object
Return values
int —0 for success
fixEntity()
Re-encrypt an entity.
protected
fixEntity(AbstractDbService $service, UserEntityInterface|UserCardEntityInterface $entity, BlockCipher|null $oldcipher, BlockCipher $newcipher) : void
Parameters
- $service : AbstractDbService
-
Database service
- $entity : UserEntityInterface|UserCardEntityInterface
-
Row to update
- $oldcipher : BlockCipher|null
-
Old cipher (null for none)
- $newcipher : BlockCipher
-
New cipher
Tags
Return values
void —getConfigWriter()
Get a config writer
protected
getConfigWriter(string $path) : Writer
Parameters
- $path : string
-
Path of file to write
Return values
Writer —getOpenSsl()
Get an OpenSsl object for the specified algorithm (or return null if the algorithm is 'none').
protected
getOpenSsl(string $algorithm) : Openssl
Parameters
- $algorithm : string
-
Encryption algorithm