8000 minor #24623 [Session] remove lazy_write polyfill for php < 7.0 (Tobion) · symfony/symfony@10ab3a6 · GitHub
[go: up one dir, main page]

Skip to content

Commit 10ab3a6

Browse files
committed
minor #24623 [Session] remove lazy_write polyfill for php < 7.0 (Tobion)
This PR was merged into the 4.0-dev branch. Discussion ---------- [Session] remove lazy_write polyfill for php < 7.0 | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | no <!-- don't forget to update src/**/CHANGELOG.md files --> | BC breaks? |no | Deprecations? | no <!-- don't forget to update UPGRADE-*.md files --> | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | Remove the session.lazy_write fallback implementation for php < 7 introduced in #24523 as we don't need it in sf 4 Commits ------- 1f84b1f [Session] remove lazy_write polyfill for php < 7.0
2 parents b2a4acf + 1f84b1f commit 10ab3a6

File tree

2 files changed

+0
-17
lines changed

2 files changed

+0
-17
lines changed

src/Symfony/Component/HttpFoundation/Session/Storage/Handler/AbstractSessionHandler.php

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,6 @@ public function read($sessionId)
8888

8989
$data = $this->doRead($sessionId);
9090
$this->newSessionId = '' === $data ? $sessionId : null;
91-
if (\PHP_VERSION_ID < 70000) {
92-
$this->prefetchData = $data;
93-
}
9491

9592
return $data;
9693
}
@@ -100,14 +97,6 @@ public function read($sessionId)
10097
*/
10198
public function write($sessionId, $data)
10299
{
103-
if (\PHP_VERSION_ID < 70000 && $this->prefetchData) {
104-
$readData = $this->prefetchData;
105-
$this->prefetchData = null;
106-
107-
if ($readData === $data) {
108-
return $this->updateTimestamp($sessionId, $data);
109-
}
110-
}
111100
if (null === $this->igbinaryEmptyData) {
112101
// see https://github.com/igbinary/igbinary/issues/146
113102
$this->igbinaryEmptyData = \function_exists('igbinary_serialize') ? igbinary_serialize(array()) : '';
@@ -125,9 +114,6 @@ public function write($sessionId, $data)
125114
*/
126115
public function destroy($sessionId)
127116
{
128-
if (\PHP_VERSION_ID < 70000) {
129-
$this->prefetchData = null;
130-
}
131117
if (!headers_sent() && ini_get('session.use_cookies')) {
132118
if (!$this->sessionName) {
133119
throw new \LogicException(sprintf('Session name cannot be empty, did you forget to call "parent::open()" in "%s"?.', get_class($this)));

src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/AbstractSessionHandlerTest.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@
1313

1414
use PHPUnit\Framework\TestCase;
1515

16-
/**
17-
* @requires PHP 7.0
18-
*/
1916
class AbstractSessionHandlerTest extends TestCase
2017
{
2118
private static $server;

0 commit comments

Comments
 (0)
0