mirror of
https://github.com/friendica/friendica
synced 2025-04-26 15:10:11 +00:00
Add support for Memcached/Improve database cache
- Create Cache Driver interface - Update cache table fields - Add CacheSessionHandler
This commit is contained in:
parent
7bd4a52156
commit
3628b62aeb
9 changed files with 326 additions and 192 deletions
|
@ -5,8 +5,8 @@
|
|||
*/
|
||||
namespace Friendica\Core;
|
||||
|
||||
use Friendica\Core\Session\CacheSessionHandler;
|
||||
use Friendica\Core\Session\DatabaseSessionHandler;
|
||||
use Friendica\Core\Session\MemcacheSessionHandler;
|
||||
|
||||
/**
|
||||
* High-level Session service class
|
||||
|
@ -28,10 +28,10 @@ class Session
|
|||
ini_set('session.cookie_secure', 1);
|
||||
}
|
||||
|
||||
if (!Config::get('system', 'disable_database_session')) {
|
||||
$memcache = Cache::memcache();
|
||||
if (is_object($memcache)) {
|
||||
$SessionHandler = new MemcacheSessionHandler($memcache);
|
||||
$session_handler = Config::get('system', 'session_handler', 'database');
|
||||
if ($session_handler != 'native') {
|
||||
if ($session_handler == 'cache' && Config::get('system', 'cache_driver', 'database') != 'database') {
|
||||
$SessionHandler = new CacheSessionHandler();
|
||||
} else {
|
||||
$SessionHandler = new DatabaseSessionHandler();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue