File tree Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ public function boot(): void
4343 'password ' => $ options ['password ' ],
4444 ]);
4545
46- return new TarantoolSessionHandler ($ client , $ client -> getSpace ( $ options ['space ' ]) );
46+ return new TarantoolSessionHandler ($ client , $ options ['space ' ]);
4747 });
4848
4949 Session::extend ('tarantool ' , static function (Application $ app ) {
Original file line number Diff line number Diff line change 66
77use Tarantool \Client \Client ;
88use Tarantool \Client \Schema \Criteria ;
9- use Tarantool \Client \Schema \Space ;
109
1110/**
1211 * Class TarantoolSessionHandler.
@@ -16,6 +15,9 @@ final class TarantoolSessionHandler implements \SessionHandlerInterface
1615 /** @var \Tarantool\Client\Client */
1716 private $ client ;
1817
18+ /** @var string */
19+ private $ spaceName ;
20+
1921 /** @var \Tarantool\Client\Schema\Space */
2022 private $ space ;
2123
@@ -25,11 +27,13 @@ final class TarantoolSessionHandler implements \SessionHandlerInterface
2527 /** @var string */
2628 private $ gcFunctionName = 'php_sessions.gc ' ;
2729
28- public function __construct (Client $ client , Space $ space )
30+ public function __construct (Client $ client , string $ spaceName )
2931 {
3032 $ this ->client = $ client ;
3133
32- $ this ->space = $ space ;
34+ $ this ->spaceName = $ spaceName ;
35+
36+ $ this ->space = $ this ->client ->getSpace ($ this ->spaceName );
3337
3438 session_set_save_handler ($ this );
3539 }
@@ -50,7 +54,7 @@ public function destroy($session_id): bool
5054
5155 public function gc ($ maxlifetime ): bool
5256 {
53- $ this ->client ->call ($ this ->gcFunctionName , $ this ->space , $ maxlifetime );
57+ $ this ->client ->call ($ this ->gcFunctionName , $ this ->spaceName , $ maxlifetime );
5458
5559 return true ;
5660 }
You can’t perform that action at this time.
0 commit comments