File tree Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ public function boot(): void
44
44
'password ' => $ options ['password ' ],
45
45
]);
46
46
47
- return new TarantoolSessionHandler ($ client , $ client -> getSpace ( $ options ['space ' ]) );
47
+ return new TarantoolSessionHandler ($ client , $ options ['space ' ]);
48
48
});
49
49
50
50
Session::extend ('tarantool ' , static function (Application $ app ) {
Original file line number Diff line number Diff line change 6
6
7
7
use Tarantool \Client \Client ;
8
8
use Tarantool \Client \Schema \Criteria ;
9
- use Tarantool \Client \Schema \Space ;
10
9
11
10
/**
12
11
* Class TarantoolSessionHandler
@@ -17,7 +16,10 @@ final class TarantoolSessionHandler implements \SessionHandlerInterface
17
16
/** @var \Tarantool\Client\Client */
18
17
private $ client ;
19
18
20
- /** @var \Tarantool\Client\Schema\Space */
19
+ /** @var string */
20
+ private $ spaceName ;
21
+
22
+ /** @var \Tarantool\Client\Schema\Space */
21
23
private $ space ;
22
24
23
25
/** @var string */
@@ -26,11 +28,13 @@ final class TarantoolSessionHandler implements \SessionHandlerInterface
26
28
/** @var string */
27
29
private $ gcFunctionName = 'php_sessions.gc ' ;
28
30
29
- public function __construct (Client $ client , Space $ space )
31
+ public function __construct (Client $ client , string $ spaceName )
30
32
{
31
33
$ this ->client = $ client ;
32
34
33
- $ this ->space = $ space ;
35
+ $ this ->spaceName = $ spaceName ;
36
+
37
+ $ this ->space = $ this ->client ->getSpace ($ this ->spaceName );
34
38
35
39
session_set_save_handler ($ this );
36
40
}
@@ -51,7 +55,7 @@ public function destroy($session_id): bool
51
55
52
56
public function gc ($ maxlifetime ): bool
53
57
{
54
- $ this ->client ->call ($ this ->gcFunctionName , $ this ->space , $ maxlifetime );
58
+ $ this ->client ->call ($ this ->gcFunctionName , $ this ->spaceName , $ maxlifetime );
55
59
56
60
return true ;
57
61
}
You can’t perform that action at this time.
0 commit comments