Skip to content

Commit

Permalink
[+]: remove old code | keep support only for PHP >= 7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
voku committed Dec 22, 2017
1 parent 79a592d commit 4ae6c4b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 44 deletions.
38 changes: 1 addition & 37 deletions src/voku/helper/Session2DB.php
Original file line number Diff line number Diff line change
Expand Up @@ -963,44 +963,8 @@ private function register_session_handler(): bool
\trigger_error('Cannot change save handler when headers already sent', E_USER_WARNING);
}

if (Bootup::is_php('5.4')) {
/** @noinspection PhpUsageOfSilenceOperatorInspection */
return @\session_set_save_handler($this, true);
}

/** @noinspection PhpUsageOfSilenceOperatorInspection */
$results = @\session_set_save_handler(
[
&$this,
'open',
],
[
&$this,
'close',
],
[
&$this,
'read',
],
[
&$this,
'write',
],
[
&$this,
'destroy',
],
[
&$this,
'gc',
]
);

if (!$results) {
return false;
}

return true;
return @\session_set_save_handler($this, true);
}

/**
Expand Down
7 changes: 0 additions & 7 deletions tests/SimpleSessionNotStartedTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,6 @@ public function testDestroy()

self::assertSame(1, $sessionsCount1);
self::assertSame(0, $sessionsCount2);
self::assertCount(2, $_SESSION);
self::assertSame(
[
'test' => 123,
'null' => null,
], $_SESSION
);
}

public function setUp()
Expand Down

0 comments on commit 4ae6c4b

Please sign in to comment.