Revert "bug #30620 [FrameworkBundle][HttpFoundation] make session service resettable (dmaicher)"
This reverts commit029fb2e7e3
, reversing changes made to9dad29d61c
.
This commit is contained in:
parent
c3f57d0015
commit
4177331915
@ -15,7 +15,6 @@
|
|||||||
<argument type="service" id="session.storage" />
|
<argument type="service" id="session.storage" />
|
||||||
<argument type="service" id="session.attribute_bag" />
|
<argument type="service" id="session.attribute_bag" />
|
||||||
<argument type="service" id="session.flash_bag" />
|
<argument type="service" id="session.flash_bag" />
|
||||||
<tag name="kernel.reset" method="save" />
|
|
||||||
</service>
|
</service>
|
||||||
|
|
||||||
<service id="Symfony\Component\HttpFoundation\Session\SessionInterface" alias="session" />
|
<service id="Symfony\Component\HttpFoundation\Session\SessionInterface" alias="session" />
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
"symfony/dependency-injection": "^3.4.24|^4.2.5",
|
"symfony/dependency-injection": "^3.4.24|^4.2.5",
|
||||||
"symfony/config": "~3.4|~4.0",
|
"symfony/config": "~3.4|~4.0",
|
||||||
"symfony/event-dispatcher": "~3.4|~4.0",
|
"symfony/event-dispatcher": "~3.4|~4.0",
|
||||||
"symfony/http-foundation": "^3.4.24|^4.2.5",
|
"symfony/http-foundation": "^3.3.11|~4.0",
|
||||||
"symfony/http-kernel": "~3.4|~4.0",
|
"symfony/http-kernel": "~3.4|~4.0",
|
||||||
"symfony/polyfill-mbstring": "~1.0",
|
"symfony/polyfill-mbstring": "~1.0",
|
||||||
"symfony/filesystem": "~2.8|~3.0|~4.0",
|
"symfony/filesystem": "~2.8|~3.0|~4.0",
|
||||||
|
@ -193,10 +193,8 @@ class Session implements SessionInterface, \IteratorAggregate, \Countable
|
|||||||
*/
|
*/
|
||||||
public function save()
|
public function save()
|
||||||
{
|
{
|
||||||
if ($this->isStarted()) {
|
|
||||||
$this->storage->save();
|
$this->storage->save();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
|
@ -260,14 +260,4 @@ class SessionTest extends TestCase
|
|||||||
$flash->get('hello');
|
$flash->get('hello');
|
||||||
$this->assertTrue($this->session->isEmpty());
|
$this->assertTrue($this->session->isEmpty());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testSaveIfNotStarted()
|
|
||||||
{
|
|
||||||
$storage = $this->getMockBuilder('Symfony\Component\HttpFoundation\Session\Storage\SessionStorageInterface')->getMock();
|
|
||||||
$session = new Session($storage);
|
|
||||||
|
|
||||||
$storage->expects($this->once())->method('isStarted')->willReturn(false);
|
|
||||||
$storage->expects($this->never())->method('save');
|
|
||||||
$session->save();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user