Completed
Push — redis_session ( 46c9d7 )
by
unknown
18:13
created

NativeSessionHandler::__construct()   A

Complexity

Conditions 3
Paths 4

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 3
eloc 5
c 1
b 0
f 0
nc 4
nop 2
dl 0
loc 10
rs 9.4285
1
<?php
2
3
/**
4
 * File containing the SymfonyNativeSessionHandler class.
5
 *
6
 * @copyright Copyright (C) eZ Systems AS. All rights reserved.
7
 * @license For full copyright and license information view LICENSE file distributed with this source code.
8
 */
9
10
namespace eZ\Bundle\EzPublishCoreBundle\Session\Handler;
11
12
use Symfony\Component\HttpFoundation\Session\Storage\Handler\NativeSessionHandler as SymfonyNativeSessionHandler;
13
14
class NativeSessionHandler extends SymfonyNativeSessionHandler
0 ignored issues
show
Deprecated Code introduced by
The class Symfony\Component\HttpFo...er\NativeSessionHandler has been deprecated with message: since version 3.4, to be removed in 4.0. Use \SessionHandler instead.

This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.

Loading history...
15
{
16
    /**
17
     * @param string $savePath      Path of directory to save session files
18
     *                              Default null will leave setting as defined by PHP.
19
     *                              '/path', 'host:port'
20
     * @param string $saveHandler   Could be any handler supported by php
21
     *                              Default null will leave setting as defined by PHP.
22
     *                              'redis', 'file'
23
     *
24
     * @see http://php.net/session.configuration.php#ini.session.save-path for further details.
25
     */
26
    public function __construct($savePath = null, $saveHandler = null)
27
    {
28
        if (null !== $savePath) {
29
            ini_set('session.save_path', $savePath);
30
        }
31
32
        if (null !== $saveHandler) {
33
            ini_set('session.save_handler', $saveHandler);
34
        }
35
    }
36
}
37