Chris@0: Chris@0: * Chris@0: * For the full copyright and license information, please view the LICENSE Chris@0: * file that was distributed with this source code. Chris@0: */ Chris@0: Chris@0: namespace Symfony\Component\HttpFoundation\Session\Storage; Chris@0: Chris@0: /** Chris@0: * Allows session to be started by PHP and managed by Symfony. Chris@0: * Chris@0: * @author Drak Chris@0: */ Chris@0: class PhpBridgeSessionStorage extends NativeSessionStorage Chris@0: { Chris@0: /** Chris@14: * @param \SessionHandlerInterface|null $handler Chris@14: * @param MetadataBag $metaBag MetadataBag Chris@0: */ Chris@0: public function __construct($handler = null, MetadataBag $metaBag = null) Chris@0: { Chris@0: $this->setMetadataBag($metaBag); Chris@0: $this->setSaveHandler($handler); Chris@0: } Chris@0: Chris@0: /** Chris@0: * {@inheritdoc} Chris@0: */ Chris@0: public function start() Chris@0: { Chris@0: if ($this->started) { Chris@0: return true; Chris@0: } Chris@0: Chris@0: $this->loadSession(); Chris@0: Chris@0: return true; Chris@0: } Chris@0: Chris@0: /** Chris@0: * {@inheritdoc} Chris@0: */ Chris@0: public function clear() Chris@0: { Chris@0: // clear out the bags and nothing else that may be set Chris@0: // since the purpose of this driver is to share a handler Chris@0: foreach ($this->bags as $bag) { Chris@0: $bag->clear(); Chris@0: } Chris@0: Chris@0: // reconnect the bags to the session Chris@0: $this->loadSession(); Chris@0: } Chris@0: }