2017 © Pedro Peláez
 

library dot-session

DotKernel session component extending and customizing zend-session

image

dotkernel/dot-session

DotKernel session component extending and customizing zend-session

  • Friday, May 4, 2018
  • by dotkernel
  • Repository
  • 2 Watchers
  • 2 Stars
  • 675 Installations
  • PHP
  • 4 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 7 % Grown

The README.md

dot-session

[!IMPORTANT] dot-session is a wrapper on top of laminas/laminas-session, (*1)

Dynamic JSON Badge, (*2)

OSS Lifecycle PHP from Packagist (specify version), (*3)

GitHub issues GitHub forks GitHub stars GitHub license, (*4)

Build Static codecov, (*5)

SymfonyInsight, (*6)

DotKernel session component extending and customizing laminas-session, (*7)

Installation

Run the following command in your project folder, (*8)

    composer require dotkernel/dot-session

Configuration

Register SessionMiddleware in your application's pipeline by adding the following line to config/pipeline.php:, (*9)

    $app->pipe(Dot\Session\SessionMiddleware::class);

Register dot-session's ConfigProvider in your application's configurations by adding the following line to config/config.php:, (*10)

    \Dot\Session\ConfigProvider::class,

Usage

Basic usage to access and use the session object in your services:, (*11)

Method #1 - Factory

Step 1: Create a factory that retrieves the SessionManger from the container

class ExampleFactory
{
    // code

    public function __invoke(ContainerInterface $container)
    {
        return new ExampleService(
            $container->get(SessionManager::class)
        )
    }
}

Register the factory in any mode you register factories on your project., (*12)

Step 2: Access through your Service


class ExampleService { private SessionManager $session; public function __construct(SessionManager $session) { $this->session = $session; } //your methods }

Method #2 - Injection

If you use annotated injection you can inject the Session Manager in your services., (*13)

use Dot\AnnotatedServices\Annotation\Inject;
use Laminas\Session\SessionManager;

class ExampleService
{
    private SessionManager $session;

     /**
     * @Inject({SessionManager::class})
     */
    public function __construct(SessionManager $session) 
    {
        $this->session = $session;
    }

     //your methods
}

The Versions

04/05 2018

dev-master

9999999-dev

DotKernel session component extending and customizing zend-session

  Sources   Download

MIT

The Requires

 

The Development Requires

by n3vrax
by DotKernel Team

04/05 2018

dev-develop

dev-develop

DotKernel session component extending and customizing zend-session

  Sources   Download

MIT

The Requires

 

The Development Requires

by n3vrax
by DotKernel Team

04/05 2018

v3.0.0

3.0.0.0

DotKernel session component extending and customizing zend-session

  Sources   Download

MIT

The Requires

 

The Development Requires

by DotKernel Team

15/03 2017
08/03 2017