@@ -62,13 +62,13 @@ public function handle(Filesystem $filesystem, Dumper $dumper)
62
62
{
63
63
$ this ->info ('Restoring Database ' );
64
64
65
- $ hostname = config ('database.connections.mysql.host ' , '127.0.0.1 ' );
66
- $ port = config ('database.connections.mysql.port ' , '3306 ' );
67
- $ database = config ('database.connections.mysql.database ' , 'dbm ' );
68
- $ username = config ('database.connections.mysql.username ' , 'root ' );
69
- $ password = config ('database.connections.mysql.password ' , '' );
70
-
71
65
$ driver = dbm_driver ();
66
+ $ hostname = config ('database.connections. ' .$ driver .'.host ' , '127.0.0.1 ' );
67
+ $ port = config ('database.connections. ' .$ driver .'.port ' , '3306 ' );
68
+ $ database = config ('database.connections. ' .$ driver .'.database ' , 'dbm ' );
69
+ $ username = config ('database.connections. ' .$ driver .'.username ' , 'root ' );
70
+ $ password = config ('database.connections. ' .$ driver .'.password ' , '' );
71
+
72
72
$ directory = 'backups ' .DIRECTORY_SEPARATOR .$ driver ;
73
73
74
74
if ($ this ->option ('path ' ) != null ) {
@@ -87,6 +87,12 @@ public function handle(Filesystem $filesystem, Dumper $dumper)
87
87
$ compressExtension = config ('dbm.backup.compress_extension ' , '.gz ' );
88
88
$ dumpBinaryPath = config ('dbm.backup. ' .$ driver .'.binary_path ' , '' );
89
89
90
+ $ dumper ->setHost ($ hostname )
91
+ ->setPort ($ port )
92
+ ->setDbName ($ database )
93
+ ->setUserName ($ username )
94
+ ->setPassword ($ password );
95
+
90
96
try {
91
97
switch ($ driver ) {
92
98
case 'mongodb ' :
0 commit comments