Skip to content

Commit 9690f2e

Browse files
author
Aidyn Makhataev
committed
fix, conditional binding commands
1 parent 04dd5cf commit 9690f2e

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

src/SessionServiceProvider.php

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,11 @@ public function register(): void
2323
__DIR__.'/../config/tarantool-session.php', 'tarantool-session'
2424
);
2525

26-
$this->commands([
27-
TransferSessionFromFileCommand::class,
28-
]);
26+
if ($this->isCurrentSessionDriverTarantool()) {
27+
$this->commands([
28+
TransferSessionFromFileCommand::class,
29+
]);
30+
}
2931
}
3032

3133
public function boot(): void
@@ -36,7 +38,7 @@ public function boot(): void
3638
], 'tarantool-session-config');
3739
}
3840

39-
if ($this->app['config']['session']['driver'] === self::DRIVER_NAME) {
41+
if ($this->isCurrentSessionDriverTarantool()) {
4042
$this->app->singleton(TarantoolSessionHandler::class, static function (Application $app) {
4143
$options = $app['config']['tarantool-session'];
4244

@@ -54,4 +56,12 @@ public function boot(): void
5456
});
5557
}
5658
}
59+
60+
/**
61+
* @return bool
62+
*/
63+
public function isCurrentSessionDriverTarantool(): bool
64+
{
65+
return $this->app['config']['session']['driver'] === self::DRIVER_NAME;
66+
}
5767
}

0 commit comments

Comments
 (0)