From 419214ed6c9d7bea635f07b0f66799082305c141 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Paul=20Bentz?= Date: Sat, 29 Nov 2014 21:53:04 +0100 Subject: [PATCH] Update pdo_session_storage.rst Changes after the 2.6.0 release keeping the names of the values as they where. --- .../configuration/pdo_session_storage.rst | 47 ++++++++++--------- 1 file changed, 26 insertions(+), 21 deletions(-) diff --git a/cookbook/configuration/pdo_session_storage.rst b/cookbook/configuration/pdo_session_storage.rst index be5e606d2ef..e14ecf0ad74 100644 --- a/cookbook/configuration/pdo_session_storage.rst +++ b/cookbook/configuration/pdo_session_storage.rst @@ -26,10 +26,11 @@ configuration format of your choice): parameters: pdo.db_options: - db_table: session - db_id_col: session_id - db_data_col: session_value - db_time_col: session_time + db_table: session + db_id_col: session_id + db_data_col: session_data + db_time_col: session_time + db_lifetime_col: session_lifetime services: pdo: @@ -56,8 +57,9 @@ configuration format of your choice): session session_id - session_value + session_data session_time + session_lifetime @@ -93,10 +95,11 @@ configuration format of your choice): )); $container->setParameter('pdo.db_options', array( - 'db_table' => 'session', - 'db_id_col' => 'session_id', - 'db_data_col' => 'session_value', - 'db_time_col' => 'session_time', + 'db_table' => 'session', + 'db_id_col' => 'session_id', + 'db_data_col' => 'session_data', + 'db_time_col' => 'session_time', + 'db_lifetime_col' => 'session_lifetime', )); $pdoDefinition = new Definition('PDO', array( @@ -114,9 +117,10 @@ configuration format of your choice): $container->setDefinition('session.handler.pdo', $storageDefinition); * ``db_table``: The name of the session table in your database -* ``db_id_col``: The name of the id column in your session table (VARCHAR(255) or larger) -* ``db_data_col``: The name of the value column in your session table (TEXT or CLOB) +* ``db_id_col``: The name of the id column in your session table (VARCHAR(128)) +* ``db_data_col``: The name of the value column in your session table (BLOB) * ``db_time_col``: The name of the time column in your session table (INTEGER) +* ``db_lifetime_col``: The name of the lifetime column in your session table (INTEGER) Sharing your Database Connection Information -------------------------------------------- @@ -168,11 +172,11 @@ following (MySQL): .. code-block:: sql CREATE TABLE `session` ( - `session_id` varchar(255) NOT NULL, - `session_value` text NOT NULL, - `session_time` int(11) NOT NULL, - PRIMARY KEY (`session_id`) - ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + `session_id` VARBINARY(128) NOT NULL PRIMARY KEY, + `session_data` BLOB NOT NULL, + `session_time` INTEGER UNSIGNED NOT NULL, + `session_lifetime` MEDIUMINT NOT NULL + ) COLLATE utf8_bin, ENGINE = InnoDB; PostgreSQL ~~~~~~~~~~ @@ -182,10 +186,10 @@ For PostgreSQL, the statement should look like this: .. code-block:: sql CREATE TABLE session ( - session_id character varying(255) NOT NULL, - session_value text NOT NULL, - session_time integer NOT NULL, - CONSTRAINT session_pkey PRIMARY KEY (session_id) + session_id VARCHAR(128) NOT NULL PRIMARY KEY, + session_data BYTEA NOT NULL, + session_time INTEGER NOT NULL, + session_lifetime INTEGER NOT NULL ); Microsoft SQL Server @@ -197,8 +201,9 @@ For MSSQL, the statement might look like the following: CREATE TABLE [dbo].[session]( [session_id] [nvarchar](255) NOT NULL, - [session_value] [ntext] NOT NULL, + [session_data] [ntext] NOT NULL, [session_time] [int] NOT NULL, + [session_lifetime] [int] NOT NULL, PRIMARY KEY CLUSTERED( [session_id] ASC ) WITH (