From 23dcd38b9b78703115e121b4e95e29315055e592 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Mon, 22 Jan 2018 16:02:52 +0100 Subject: [PATCH 1/3] Added a mention of the createTable() method of the session handler --- doctrine/pdo_session_storage.rst | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/doctrine/pdo_session_storage.rst b/doctrine/pdo_session_storage.rst index 13ccfddc2b5..dc684e160de 100644 --- a/doctrine/pdo_session_storage.rst +++ b/doctrine/pdo_session_storage.rst @@ -143,7 +143,7 @@ a second array argument to ``PdoSessionHandler``: The ``db_lifetime_col`` was introduced in Symfony 2.6. Prior to 2.6, this column did not exist. -These are parameters that you must configure: +These are parameters that you can configure: ``db_table`` (default ``sessions``): The name of the session table in your database; @@ -216,8 +216,17 @@ Preparing the Database to Store Sessions ---------------------------------------- Before storing sessions in the database, you must create the table that stores -the information. The following sections contain some examples of the SQL statements -you may use for your specific database engine. +the information. The session handler provides a method called ``createTable()`` +to set up this table for you according to the database engine used:: + + try { + $sessionHandlerService->createTable(); + } catch (\PDOException $e) { + // the database could not be created for some reason + } + +If you prefer to set up the table yourself, these are some examples of the SQL +statements you may use according to your specific database engine. .. _pdo-session-handle-26-changes: From b3d629ad700d343eeef3f854514b5ac52a84c85f Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Mon, 22 Jan 2018 16:06:31 +0100 Subject: [PATCH 2/3] Added a link to the method --- doctrine/pdo_session_storage.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doctrine/pdo_session_storage.rst b/doctrine/pdo_session_storage.rst index dc684e160de..faf8baf27b9 100644 --- a/doctrine/pdo_session_storage.rst +++ b/doctrine/pdo_session_storage.rst @@ -216,7 +216,8 @@ Preparing the Database to Store Sessions ---------------------------------------- Before storing sessions in the database, you must create the table that stores -the information. The session handler provides a method called ``createTable()`` +the information. The session handler provides a method called +:method:`Symfony\Component\HttpFoundation\Session\Storage\Handler::createTable` to set up this table for you according to the database engine used:: try { From 9ae7f6ea57dbb3d04af3ce506563243893febf00 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Tue, 23 Jan 2018 08:49:35 +0100 Subject: [PATCH 3/3] Fixes --- doctrine/pdo_session_storage.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doctrine/pdo_session_storage.rst b/doctrine/pdo_session_storage.rst index faf8baf27b9..57ddfcc233d 100644 --- a/doctrine/pdo_session_storage.rst +++ b/doctrine/pdo_session_storage.rst @@ -217,13 +217,13 @@ Preparing the Database to Store Sessions Before storing sessions in the database, you must create the table that stores the information. The session handler provides a method called -:method:`Symfony\Component\HttpFoundation\Session\Storage\Handler::createTable` +:method:`Symfony\\Component\\HttpFoundation\\Session\\Storage\\Handler::createTable` to set up this table for you according to the database engine used:: try { $sessionHandlerService->createTable(); } catch (\PDOException $e) { - // the database could not be created for some reason + // the table could not be created for some reason } If you prefer to set up the table yourself, these are some examples of the SQL