feat(legacy): move session store to database (#2523)

This commit is contained in:
Jonas L 2023-05-30 22:25:50 +02:00 committed by GitHub
parent be282fac80
commit 001466f8fd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 2259 additions and 5 deletions

View file

@ -14,7 +14,29 @@ if (!isset($configRun) || !$configRun) {
Logging::setLogPath(LIBRETIME_LOG_FILEPATH);
Zend_Session::setOptions(['strict' => true]);
if (APPLICATION_ENV != 'testing') {
Zend_Session::setOptions([
'strict' => true,
'serialize_handler' => 'php_serialize',
]);
$db = Zend_Db::factory('PDO_' . $CC_CONFIG['dsn']['phptype'], [
'host' => $CC_CONFIG['dsn']['host'],
'port' => $CC_CONFIG['dsn']['port'],
'username' => $CC_CONFIG['dsn']['username'],
'password' => $CC_CONFIG['dsn']['password'],
'dbname' => $CC_CONFIG['dsn']['database'],
]);
Zend_Db_Table_Abstract::setDefaultAdapter($db);
Zend_Session::setSaveHandler(new Zend_Session_SaveHandler_DbTable([
'name' => 'sessions',
'primary' => 'id',
'modifiedColumn' => 'modified',
'dataColumn' => 'data',
'lifetimeColumn' => 'lifetime',
]));
}
Config::setAirtimeVersion();
require_once CONFIG_PATH . '/navigation.php';