2017 © Pedro Peláez
 

symfony-bundle doctrine-session-bundle

Store your Symfony sessions in database through doctrine

image

blast-project/doctrine-session-bundle

Store your Symfony sessions in database through doctrine

  • Wednesday, March 28, 2018
  • by beta
  • Repository
  • 3 Watchers
  • 1 Stars
  • 1,942 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 16 Versions
  • 0 % Grown

The README.md

Blast DoctrineSessionBundle

Build Status Coverage Status License, (*1)

Latest Stable Version Latest Unstable Version Total Downloads, (*2)

The goal of this bundle is to make the use of Doctrine as session handler for Symfony, (*3)

Installation

Downloading

$ composer require blast-project/doctrine-session-bundle, (*4)

Add to your AppKernel

//...

class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = [
            //...

            new Blast\DoctrineSessionBundle\BlastDoctrineSessionBundle(),

        ];
        //...
    }
    //...
}

Doctrine

Configure your Doctrine connections, (*5)

# app/config/config.yml

doctrine:
    dbal:
        default_connection: default
        connections:
            default:
                driver:   pdo_pgsql
                host:     "%database_host%"
                port:     "%database_port%"
                dbname:   "%database_name%"
                user:     "%database_user%"
                password: "%database_password%"
                charset:  UTF8
            session: # This will be the connection used by this bundle
                driver:   pdo_pgsql
                host:     "%database_host%" # Please adapt to your needs if you're using another database for sessions
                port:     "%database_port%"
                dbname:   "%database_name%"
                user:     "%database_user%"
                password: "%database_password%"
                charset:  UTF8

    orm:
        default_entity_manager: default
        auto_generate_proxy_classes: "%kernel.debug%"
        entity_managers:
            default:
                connection: default
                naming_strategy: doctrine.orm.naming_strategy.underscore
                auto_mapping: true
                mappings:
                    # Add here your mapping for your default entities
                    # Example below :
                    BlastBaseEntitiesBundle:
                        type: yml
            session:
                connection: session
                naming_strategy: doctrine.orm.naming_strategy.underscore
                auto_mapping: false # Only one entity manager can have auto_mappping set to true
                mappings:
                    BlastDoctrineSessionBundle:
                        type: yml

Configure the framework session handler :, (*6)

# app/config/config.yml

framework:
    # [...]
    session:
        handler_id: blast_doctrine_handler

Database

$ php bin/console doctrine:database:create --connection=session, (*7)

Or, (*8)

$ php bin/console doctrine:schema:update --force --connection=session, (*9)

Usage


use Blast\DoctrineSessionBundle\Handler\DoctrineORMHandler; use Symfony\Component\HttpFoundation\Session\Session; use Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage; //... $doctrinehandler = new DoctrineORMHandler( $this->get('doctrine'), 'Blast\DoctrineSessionBundle\Entity\Session'); $storage = new NativeSessionStorage( array(), $doctrinehandler ); $session = new Session($storage); $session->start(); //...

See

http://symfony.com/doc/current/components/http_foundation/session_configuration.html, (*10)

The Versions

28/03 2018

dev-wip-platform

dev-wip-platform https://github.com/blast-project/BaseEntitiesBundle

Store your Symfony sessions in database through doctrine

  Sources   Download

LGPL-3.0 LGPL-3.0-only

The Requires

 

The Development Requires

by Romain SANCHEZ

doctrine symfony blast

04/05 2017

0.4.2

0.4.2.0 https://github.com/blast-project/BaseEntitiesBundle

Store your Symfony sessions in database through doctrine

  Sources   Download

LGPL-3.0

The Requires

 

The Development Requires

by Romain SANCHEZ

doctrine symfony

27/03 2017

0.3

0.3.0.0 https://github.com/blast-project/BaseEntitiesBundle

Store your Symfony sessions in database through doctrine

  Sources   Download

LGPL-3.0

The Requires

 

by Romain SANCHEZ

doctrine symfony

16/03 2017

dev-sf3.2

dev-sf3.2 https://github.com/blast-project/BaseEntitiesBundle

Store your Symfony sessions in database through doctrine

  Sources   Download

LGPL-3.0

The Requires

 

by Romain SANCHEZ

doctrine symfony sonata admin e-venement libio

07/03 2017
16/02 2017