forked from GNUsocial/gnu-social
Merge branch 'master' into testing
Conflicts: classes/Profile.php
This commit is contained in:
commit
47f31bce47
@ -87,6 +87,7 @@ class Session extends Memcached_DataObject
|
|||||||
$session->id = $id;
|
$session->id = $id;
|
||||||
$session->session_data = $session_data;
|
$session->session_data = $session_data;
|
||||||
$session->created = common_sql_now();
|
$session->created = common_sql_now();
|
||||||
|
$session->modified = common_sql_now();
|
||||||
|
|
||||||
$result = $session->insert();
|
$result = $session->insert();
|
||||||
|
|
||||||
@ -108,6 +109,7 @@ class Session extends Memcached_DataObject
|
|||||||
$orig = clone($session);
|
$orig = clone($session);
|
||||||
|
|
||||||
$session->session_data = $session_data;
|
$session->session_data = $session_data;
|
||||||
|
$session->modified = common_sql_now();
|
||||||
|
|
||||||
$result = $session->update($orig);
|
$result = $session->update($orig);
|
||||||
|
|
||||||
@ -156,6 +158,13 @@ class Session extends Memcached_DataObject
|
|||||||
$session->selectAdd();
|
$session->selectAdd();
|
||||||
$session->selectAdd('id');
|
$session->selectAdd('id');
|
||||||
|
|
||||||
|
$limit = common_config('sessions', 'gc_limit');
|
||||||
|
if ($limit > 0) {
|
||||||
|
// On large sites, too many sessions to expire
|
||||||
|
// at once will just result in failure.
|
||||||
|
$session->limit($limit);
|
||||||
|
}
|
||||||
|
|
||||||
$session->find();
|
$session->find();
|
||||||
|
|
||||||
while ($session->fetch()) {
|
while ($session->fetch()) {
|
||||||
|
@ -513,7 +513,20 @@ profile_id = K
|
|||||||
id = 130
|
id = 130
|
||||||
session_data = 34
|
session_data = 34
|
||||||
created = 142
|
created = 142
|
||||||
modified = 384
|
modified = 142
|
||||||
|
; Warning: using DB_DATAOBJECT_MYSQLTIMESTAMP (256) causes DB_DataObject
|
||||||
|
; to SILENTLY REMOVE ATTEMPTS TO SET THIS FIELD DIRECTLY, which is pretty
|
||||||
|
; bad because the default behavior for auto-updated TIMESTAMP fields is
|
||||||
|
; to use local time. Local time can't be compared to UTC in any useful
|
||||||
|
; way, so doing that breaks session GC.
|
||||||
|
;
|
||||||
|
; Instead we'll use the plain datetime settings so it'll actually save the
|
||||||
|
; UTC value we provide when updating.
|
||||||
|
;
|
||||||
|
; Long-term fix: punch MySQL in the face until it understands that local
|
||||||
|
; time is a tool of the cyber-devil.
|
||||||
|
;
|
||||||
|
;modified = 384
|
||||||
|
|
||||||
[session__keys]
|
[session__keys]
|
||||||
id = K
|
id = K
|
||||||
|
@ -269,8 +269,9 @@ $default =
|
|||||||
'search' =>
|
'search' =>
|
||||||
array('type' => 'fulltext'),
|
array('type' => 'fulltext'),
|
||||||
'sessions' =>
|
'sessions' =>
|
||||||
array('handle' => false, // whether to handle sessions ourselves
|
array('handle' => false, // whether to handle sessions ourselves
|
||||||
'debug' => false), // debugging output for sessions
|
'debug' => false, // debugging output for sessions
|
||||||
|
'gc_limit' => 1000), // max sessions to expire at a time
|
||||||
'design' =>
|
'design' =>
|
||||||
array('backgroundcolor' => null, // null -> 'use theme default'
|
array('backgroundcolor' => null, // null -> 'use theme default'
|
||||||
'contentcolor' => null,
|
'contentcolor' => null,
|
||||||
|
Loading…
Reference in New Issue
Block a user