Skip to content
Snippets Groups Projects

#3295666

Open
Nitin Lamarequested to merge
issue/sessionless-3295666:1.x into 1.x
12 open threads

Files

@@ -22,18 +22,64 @@ use Drupal\sessionless\CryptoService;
@@ -22,18 +22,64 @@ use Drupal\sessionless\CryptoService;
*/
*/
class SessionlessFormCache implements FormCacheInterface {
class SessionlessFormCache implements FormCacheInterface {
 
/**
 
* The root directory of the Drupal installation.
 
*
 
* @var string
 
*/
protected string $root;
protected string $root;
 
/**
 
* The module handler.
 
*
 
* @var \Drupal\Core\Extension\ModuleHandlerInterface
 
*/
protected ModuleHandlerInterface $moduleHandler;
protected ModuleHandlerInterface $moduleHandler;
 
/**
 
* The currently logged-in user account.
 
*
 
* @var \Drupal\Core\Session\AccountInterface
 
*/
protected AccountInterface $currentUser;
protected AccountInterface $currentUser;
 
/**
 
* The CSRF token generator.
 
*
 
* @var \Drupal\Core\Access\CsrfTokenGenerator
 
*/
protected CsrfTokenGenerator $csrfToken;
protected CsrfTokenGenerator $csrfToken;
 
/**
 
* The logger channel.
 
*
 
* @var \Drupal\Core\Logger\LoggerChannelInterface
 
*/
protected LoggerChannelInterface $logger;
protected LoggerChannelInterface $logger;
 
/**
 
* The cryptography service.
 
*
 
* @var \Drupal\sessionless\CryptoService
 
*/
protected CryptoService $cryptoService;
protected CryptoService $cryptoService;
 
/**
 
* Constructs a new Drupal\sessionless_forms\SessionlessFormCache object.
 
*
 
* @param string $root
 
* The app root.
 
* @param \Drupal\Core\Extension\ModuleHandlerInterface $moduleHandler
 
* The module handler.
 
* @param \Drupal\Core\Session\AccountInterface $currentUser
 
* The current user.
 
* @param \Drupal\Core\Access\CsrfTokenGenerator $csrfToken
 
* The CSRF token generator.
 
* @param \Drupal\Core\Logger\LoggerChannelInterface $logger
 
* The logger.
 
* @param \Drupal\sessionless\CryptoService $cryptoService
 
* The cryptography service.
 
*/
public function __construct(string $root, ModuleHandlerInterface $moduleHandler, AccountInterface $currentUser, CsrfTokenGenerator $csrfToken, LoggerChannelInterface $logger, CryptoService $cryptoService) {
public function __construct(string $root, ModuleHandlerInterface $moduleHandler, AccountInterface $currentUser, CsrfTokenGenerator $csrfToken, LoggerChannelInterface $logger, CryptoService $cryptoService) {
$this->root = $root;
$this->root = $root;
$this->moduleHandler = $moduleHandler;
$this->moduleHandler = $moduleHandler;
@@ -43,6 +89,9 @@ class SessionlessFormCache implements FormCacheInterface {
@@ -43,6 +89,9 @@ class SessionlessFormCache implements FormCacheInterface {
$this->cryptoService = $cryptoService;
$this->cryptoService = $cryptoService;
}
}
 
/**
 
* {@inheritdoc}
 
*/
public function getCache($form_build_id, FormStateInterface $form_state) {
public function getCache($form_build_id, FormStateInterface $form_state) {
$input = $form_state->getUserInput();
$input = $form_state->getUserInput();
if (
if (
@@ -120,6 +169,9 @@ class SessionlessFormCache implements FormCacheInterface {
@@ -120,6 +169,9 @@ class SessionlessFormCache implements FormCacheInterface {
}
}
}
}
 
/**
 
* {@inheritdoc}
 
*/
public function deleteCache($form_build_id) {}
public function deleteCache($form_build_id) {}
}
}
Loading