From ff34ffbd953bbba01f9ba1e06b4fb7a1bd2a4e72 Mon Sep 17 00:00:00 2001 From: Bulat Shakirzyanov Date: Wed, 22 Dec 2010 13:07:03 -0500 Subject: [PATCH 1/2] [HttpFoundation] added ArraySessionStorage for usage in tests --- .../SessionStorage/ArraySessionStorage.php | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100755 src/Symfony/Component/HttpFoundation/SessionStorage/ArraySessionStorage.php diff --git a/src/Symfony/Component/HttpFoundation/SessionStorage/ArraySessionStorage.php b/src/Symfony/Component/HttpFoundation/SessionStorage/ArraySessionStorage.php new file mode 100755 index 0000000000000..dbb1c6bf627a6 --- /dev/null +++ b/src/Symfony/Component/HttpFoundation/SessionStorage/ArraySessionStorage.php @@ -0,0 +1,51 @@ + + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +/** + * ArraySessionStorage. + * + * @author Fabien Potencier + * @author Bulat Shakirzyanov + */ + +class ArraySessionStorage implements SessionStorageInterface +{ + private $data = array(); + + public function read($key, $default = null) + { + return array_key_exists($key, $this->data) ? $this->data[$key] : $default; + } + + public function regenerate($destroy = false) + { + if ($destroy) { + $this->data = array(); + } + return true; + } + + public function remove($key) + { + unset($this->data[$key]); + } + + public function start() + { + } + + public function write($key, $data) + { + $this->data[$key] = $data; + } +} From 173fa614a0f9fc7653e45e9f203bc5af8409369b Mon Sep 17 00:00:00 2001 From: Bulat Shakirzyanov Date: Wed, 22 Dec 2010 13:07:23 -0500 Subject: [PATCH 2/2] [FrameworkBundle] registered array session storage service in DIC --- .../Bundle/FrameworkBundle/Resources/config/session.xml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/config/session.xml b/src/Symfony/Bundle/FrameworkBundle/Resources/config/session.xml index c9575a843da84..8092a5972417b 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Resources/config/session.xml +++ b/src/Symfony/Bundle/FrameworkBundle/Resources/config/session.xml @@ -11,6 +11,8 @@ Symfony\Component\HttpFoundation\SessionStorage\PdoSessionStorage + Symfony\Component\HttpFoundation\SessionStorage\ArraySessionStorage + @@ -30,6 +32,10 @@ %session.storage.pdo.options% + + %session.storage.array.options% + + pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy