PluginProbe
WPIDE – File Manager & Code Editor / 3.5.10
WPIDE – File Manager & Code Editor v3.5.10
3.5.10 3.5.9 3.5.8 3.5.7 2.0.14 2.0.15 2.0.16 2.0.2 2.0.4 2.0.5 2.0.6 2.0.7 2.0.8 2.0.9 2.1 2.2 2.3 2.3.1 2.3.2 2.4.0 2.5 2.6 3.0 3.1 3.2 All 56 releases
wpide / vendor / symfony / http-foundation / Session / Storage / NativeSessionStorageFactory.php

NativeSessionStorageFactory.php in WPIDE – File Manager & Code Editor 3.5.10, at vendor/symfony/http-foundation/Session/Storage/NativeSessionStorageFactory.php

50 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /*
4 * This file is part of the Symfony package.
5 *
6 * (c) Fabien Potencier <[email protected]>
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;
13
14 use Symfony\Component\HttpFoundation\Request;
15
16 // Help opcache.preload discover always-needed symbols
17 class_exists(NativeSessionStorage::class);
18
19 /**
20 * @author Jérémy Derussé <[email protected]>
21 */
22 class NativeSessionStorageFactory implements SessionStorageFactoryInterface
23 {
24 private $options;
25 private $handler;
26 private $metaBag;
27 private $secure;
28
29 /**
30 * @see NativeSessionStorage constructor.
31 */
32 public function __construct(array $options = [], $handler = null, ?MetadataBag $metaBag = null, bool $secure = false)
33 {
34 $this->options = $options;
35 $this->handler = $handler;
36 $this->metaBag = $metaBag;
37 $this->secure = $secure;
38 }
39
40 public function createStorage(?Request $request): SessionStorageInterface
41 {
42 $storage = new NativeSessionStorage($this->options, $this->handler, $this->metaBag);
43 if ($this->secure && $request && $request->isSecure()) {
44 $storage->setOptions(['cookie_secure' => true]);
45 }
46
47 return $storage;
48 }
49 }
50