Пример #1
0
function deleteExpiredSessions($maxLifeTime)
{
    foreach (getAllDbsForSessions() as $dbInfo) {
        $link = $dbInfo ? connect($dbInfo) : null;
        if (!$link || !\database\deleteExpiredSessions($link, $maxLifeTime)) {
            return false;
        }
    }
    return true;
}
Пример #2
0
function getDbForSessions($sessionId)
{
    $key = hexdec(substr(md5($sessionId), 0, 3));
    return chooseShard(getAllDbsForSessions(), $key);
}