summaryrefslogtreecommitdiff
path: root/vendor/symfony
diff options
context:
space:
mode:
authorGreg Roach <fisharebest@gmail.com>2017-11-20 14:23:22 +0000
committerGreg Roach <fisharebest@gmail.com>2017-11-20 14:23:22 +0000
commit96b8ac9323f83a2c31631aa8d50c2f7a60574cb0 (patch)
tree438fdd64297b5b012bcf929ab665ab1128e3c770 /vendor/symfony
parente87561c75cda1782612065cd3993555c655bd928 (diff)
downloadwebtrees-96b8ac9323f83a2c31631aa8d50c2f7a60574cb0.tar.gz
webtrees-96b8ac9323f83a2c31631aa8d50c2f7a60574cb0.tar.bz2
webtrees-96b8ac9323f83a2c31631aa8d50c2f7a60574cb0.zip
composer.lock / autoload files out of sync
Diffstat (limited to 'vendor/symfony')
-rw-r--r--vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php19
-rw-r--r--vendor/symfony/http-foundation/Tests/Session/Storage/NativeSessionStorageTest.php12
2 files changed, 19 insertions, 12 deletions
diff --git a/vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php b/vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php
index b27591ec10..5620aae3cd 100644
--- a/vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php
+++ b/vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php
@@ -102,12 +102,6 @@ class NativeSessionStorage implements SessionStorageInterface
*/
public function __construct(array $options = array(), $handler = null, MetadataBag $metaBag = null)
{
- $this->setMetadataBag($metaBag);
-
- if (\PHP_SESSION_ACTIVE === session_status()) {
- return;
- }
-
$options += array(
// disable by default because it's managed by HeaderBag (if used)
'cache_limiter' => '',
@@ -116,6 +110,7 @@ class NativeSessionStorage implements SessionStorageInterface
session_register_shutdown();
+ $this->setMetadataBag($metaBag);
$this->setOptions($options);
$this->setSaveHandler($handler);
}
@@ -287,7 +282,7 @@ class NativeSessionStorage implements SessionStorageInterface
throw new \InvalidArgumentException(sprintf('The SessionBagInterface %s is not registered.', $name));
}
- if ($this->saveHandler->isActive() && !$this->started) {
+ if (!$this->started && $this->saveHandler->isActive()) {
$this->loadSession();
} elseif (!$this->started) {
$this->start();
@@ -335,7 +330,7 @@ class NativeSessionStorage implements SessionStorageInterface
*/
public function setOptions(array $options)
{
- if (headers_sent()) {
+ if (headers_sent() || \PHP_SESSION_ACTIVE === session_status()) {
return;
}
@@ -390,10 +385,6 @@ class NativeSessionStorage implements SessionStorageInterface
throw new \InvalidArgumentException('Must be instance of AbstractProxy or NativeSessionHandler; implement \SessionHandlerInterface; or be null.');
}
- if (headers_sent($file, $line)) {
- throw new \RuntimeException(sprintf('Failed to set the session handler because headers have already been sent by "%s" at line %d.', $file, $line));
- }
-
// Wrap $saveHandler in proxy and prevent double wrapping of proxy
if (!$saveHandler instanceof AbstractProxy && $saveHandler instanceof \SessionHandlerInterface) {
$saveHandler = new SessionHandlerProxy($saveHandler);
@@ -402,6 +393,10 @@ class NativeSessionStorage implements SessionStorageInterface
}
$this->saveHandler = $saveHandler;
+ if (headers_sent() || \PHP_SESSION_ACTIVE === session_status()) {
+ return;
+ }
+
if ($this->saveHandler instanceof \SessionHandlerInterface) {
session_set_save_handler($this->saveHandler, false);
}
diff --git a/vendor/symfony/http-foundation/Tests/Session/Storage/NativeSessionStorageTest.php b/vendor/symfony/http-foundation/Tests/Session/Storage/NativeSessionStorageTest.php
index 72490f0417..e0b34647ed 100644
--- a/vendor/symfony/http-foundation/Tests/Session/Storage/NativeSessionStorageTest.php
+++ b/vendor/symfony/http-foundation/Tests/Session/Storage/NativeSessionStorageTest.php
@@ -262,4 +262,16 @@ class NativeSessionStorageTest extends TestCase
// Assert no exception has been thrown by `getStorage()`
$this->addToAssertionCount(1);
}
+
+ public function testGetBagsOnceSessionStartedIsIgnored()
+ {
+ session_start();
+ $bag = new AttributeBag();
+ $bag->setName('flashes');
+
+ $storage = $this->getStorage();
+ $storage->registerBag($bag);
+
+ $this->assertEquals($storage->getBag('flashes'), $bag);
+ }
}