jlaso / session-storage-bundle
Layer to create table for PDOSessionHandler
Installs: 49
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Type:bundle
Requires
- php: >=5.3.7
This package is auto-updated.
Last update: 2024-10-15 10:41:50 UTC
README
======== Overview
This bundle creates the table needed for the PDOSessionHandler
In order to install this bundle you need to pay attention with requirements:
php > 5.3.7
Installation
Checkout a copy of the code:
// in composer.json
"require": {
// ...
"jlaso/session-storage-bundle": "*"
// ...
},
Then register the bundle with your kernel:
// in AppKernel::registerBundles()
$bundles = array(
// ...
new JLaso\SessionStorageBundle\SessionStorageBundle(),
// ...
);
Configuration
// in app/config/config.yml
services:
pdo:
class: PDO
arguments:
- "mysql:host=%database_host%;port=%database_port%;dbname=%database_name%"
- "%database_user%"
- "%database_password%"
calls:
- [setAttribute, [3, 2]] # \PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION
session.handler.pdo:
class: Symfony\Component\HttpFoundation\Session\Storage\Handler\PdoSessionHandler
arguments: ["@pdo", "%pdo.db_options%"]
Usage
execute schema:update to create into database the session table:
app/console doctrine:schema:update --force