mirror of
https://github.com/Bubka/2FAuth.git
synced 2025-02-23 22:01:49 +01:00
Enhance output message of 2fauth:check-db-connection command
This commit is contained in:
parent
30004bad13
commit
08c54328ca
@ -36,14 +36,16 @@ public function __construct()
|
|||||||
*/
|
*/
|
||||||
public function handle() : int
|
public function handle() : int
|
||||||
{
|
{
|
||||||
$this->line('This will return the name of the connected database, otherwise false');
|
$this->newLine();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
DB::connection()->getPDO();
|
DB::connection()->getPDO();
|
||||||
$this->line(DB::connection()->getDatabaseName());
|
$this->info('Currently connected to ' . DB::connection()->getDriverName() . ' db "' . DB::connection()->getDatabaseName() . '"');
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
|
$this->error('Cannot connect to ' . DB::connection()->getDriverName() . ' db "' . DB::connection()->getDatabaseName() . '"');
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user