File tree Expand file tree Collapse file tree 1 file changed +41
-0
lines changed
src/Symfony/Component/HttpFoundation/Session/Storage/Handler Expand file tree Collapse file tree 1 file changed +41
-0
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ /*
4
+ * This file is part of the Symfony package.
5
+ *
6
+ * (c) Fabien Potencier <fabien@symfony.com>
7
+ *
8
+ * For the full copyright and license information, please view the LICENSE
9
+ * file that was distributed with this source code.
10
+ */
11
+
12
+ namespace Symfony \Component \HttpFoundation \Session \Storage \Handler ;
13
+
14
+ /**
15
+ * NativeFileSessionHandler.
16
+ *
17
+ * Native session handler using PHP's built in file storage.
18
+ *
19
+ * @author Drak <drak@zikula.org>
20
+ */
21
+ class NativeFileSessionHandler extends NativeSessionHandler
22
+ {
23
+ /**
24
+ * Constructor.
25
+ *
26
+ * @param string $savePath Path of directory to save session files. Default null will leave setting as defined by PHP.
27
+ */
28
+ public function __construct ($ savePath = null )
29
+ {
30
+ if (null === $ savePath ) {
31
+ $ savePath = ini_get ('session.save_path ' );
32
+ }
33
+
34
+ if ($ savePath && !is_dir ($ savePath )) {
35
+ mkdir ($ savePath , 0777 , true );
36
+ }
37
+
38
+ ini_set ('session.save_handler ' , 'files ' );
39
+ ini_set ('session.save_path ' , $ savePath );
40
+ }
41
+ }
You can’t perform that action at this time.
0 commit comments