Skip to content

Commit

Permalink
Injecting 'session_start_options' app setting as last argument to the…
Browse files Browse the repository at this point in the history
… constructor of Vespula\Auth\Session\Session
  • Loading branch information
rotimi committed May 24, 2024
1 parent de774a5 commit cf5c26b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions config/dependencies-dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

// Try to update to previously selected language if stored in session
if (
session_status() === PHP_SESSION_ACTIVE
session_status() === \PHP_SESSION_ACTIVE
&& array_key_exists(BaseController::SESSN_PARAM_CURRENT_LOCALE_LANG, $_SESSION)
) {
$locale_obj->setCode($_SESSION[BaseController::SESSN_PARAM_CURRENT_LOCALE_LANG]);
Expand All @@ -45,7 +45,7 @@
$file = SMVC_APP_ROOT_PATH . "{$ds}logs{$ds}daily_log_" . date('Y_M_d') . '.txt';
$adapter = new \Vespula\Log\Adapter\ErrorLog($log_type , $file);
$adapter->setMessageFormat('[{timestamp}] [{level}] {message}');
$adapter->setMinLevel(Psr\Log\LogLevel::DEBUG);
$adapter->setMinLevel(\Psr\Log\LogLevel::DEBUG);
$adapter->setDateFormat('Y-M-d g:i:s A');

return new \Vespula\Log\Log('error-log', $adapter);
Expand Down Expand Up @@ -104,7 +104,6 @@
$container[ContainerKeys::VESPULA_AUTH] = function ($c) {

// See https://packagist.org/packages/vespula/auth

$pdo = new \PDO(
'sqlite::memory:',
null,
Expand Down Expand Up @@ -132,7 +131,8 @@
//expires (in seconds)
$expire = 3600;
$max_idle = 1200;
$session = new \Vespula\Auth\Session\Session($max_idle, $expire);
$session_start_settings = $c->get(ContainerKeys::APP_SETTINGS)['session_start_options'];
$session = new \Vespula\Auth\Session\Session($max_idle, $expire, null, $session_start_settings);

$cols = ['username', 'password'];
$from = 'user_authentication_accounts';
Expand Down

0 comments on commit cf5c26b

Please sign in to comment.