update schema, new option: DATABASE_BACKED_SESSIONS

This commit is contained in:
Andrew Dolgov 2006-03-02 09:20:02 +01:00
parent 36bfab86c2
commit 8fd92701e9
6 changed files with 17 additions and 14 deletions

View file

@ -100,5 +100,9 @@
define('DAEMON_SLEEP_INTERVAL', 120);
// Interval between update daemon update runs
define('DATABASE_BACKED_SESSIONS', true);
// Store session information in a database (recommended)
// Uses default PHP session storing mechanism if disabled
// vim:ft=php
?>

View file

@ -256,8 +256,7 @@ create table ttrss_scheduled_updates (id integer not null primary key auto_incre
foreign key (owner_uid) references ttrss_users(id) ON DELETE CASCADE,
foreign key (feed_id) references ttrss_feeds(id) ON DELETE CASCADE) TYPE=InnoDB;
create table ttrss_sessions (int_id integer not null primary key auto_increment,
id varchar(300) unique not null,
create table ttrss_sessions (id varchar(300) unique not null primary key,
data text,
expire integer not null,
index (id),

View file

@ -231,12 +231,10 @@ create table ttrss_scheduled_updates (id serial not null primary key,
feed_id integer default null references ttrss_feeds(id) ON DELETE CASCADE,
entered timestamp not null default NOW());
create table ttrss_sessions (int_id serial not null primary key,
id varchar(300) unique not null,
create table ttrss_sessions (id varchar(300) unique not null primary key,
data text,
expire integer not null);
create index ttrss_sessions_id_index on ttrss_sessions(id);
create index ttrss_sessions_expire_index on ttrss_sessions(expire);
commit;

View file

@ -5,8 +5,7 @@ update ttrss_entries set author = '';
alter table ttrss_entries change author author varchar(250) not null;
alter table ttrss_entries alter column author set default '';
create table ttrss_sessions (int_id integer not null primary key auto_increment,
id varchar(300) unique not null,
create table ttrss_sessions (id varchar(300) unique not null primary key,
data text,
expire integer not null,
index (id),

View file

@ -7,8 +7,7 @@ update ttrss_entries set author = '';
alter table ttrss_entries alter column author set not null;
alter table ttrss_entries alter column author set default '';
create table ttrss_sessions (int_id serial not null primary key,
id varchar(300) unique not null,
create table ttrss_sessions (id varchar(300) unique not null primary key,
data text,
expire integer not null);

View file

@ -7,6 +7,7 @@
$session_expire = 600;
ini_set("session.gc_probability", 50);
ini_set("session.name", "ttrss_sid");
function open ($s, $n) {
@ -87,6 +88,9 @@
db_query($session_connection, $query);
}
if (DATABASE_BACKED_SESSIONS) {
session_set_save_handler ("open", "close", "read", "write", "destroy", "gc");
}
session_start();
?>