ServerDriver   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 6
c 1
b 0
f 0
dl 0
loc 16
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 2
1
<?php
2
3
/**
4
 * This file is part of slick/http
5
 *
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 */
9
10
namespace Slick\Http\Session\Driver;
11
12
use Slick\Http\Session\SessionDriverInterface;
13
14
/**
15
 * ServerDriver
16
 *
17
 * @package Slick\Http\Session\Driver
18
*/
19
class ServerDriver extends AbstractDriver implements SessionDriverInterface
20
{
21
22
    /**
23
     * Creates a Server Session Driver
24
     *
25
     * @param array $options
26
     */
27
    public function __construct(array $options = [])
28
    {
29
        parent::__construct($options);
30
31
        session_set_cookie_params($this->lifetime, '/', $this->domain);
32
        session_name($this->name);
33
        if (session_status() !== PHP_SESSION_ACTIVE) {
34
            session_start();
35
        }
36
    }
37
}
38