File tree Expand file tree Collapse file tree 3 files changed +14
-7
lines changed Expand file tree Collapse file tree 3 files changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -42,13 +42,17 @@ class DBImport{
4242 */
4343 private $ db ;
4444
45-
45+
4646 /**
4747 * Construct Instance of Database
48+ *
49+ * @param string|null $connection
50+ * @return void
4851 */
49- public function __construct () {
52+ public function __construct ($ connection = null )
53+ {
5054 $ this ->error = Constant::STATUS_404 ;
51- $ this ->db = DB ::connection ()->dbConnection ();
55+ $ this ->db = DB ::connection ($ connection )->dbConnection ();
5256 }
5357
5458 /**
@@ -58,7 +62,7 @@ public function __construct() {
5862 * @return object
5963 * [status, message]
6064 */
61- public function import ($ path_to_sql = NULL )
65+ public function import ($ path_to_sql )
6266 {
6367 $ this ->realpath = Server::formatWithBaseDirectory ($ path_to_sql );
6468
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ class JoinClause extends Builder
2323 /**
2424 * The connection of the parent query builder.
2525 *
26- * @var \Tamedevelopers\Database\Schema\Builder\connection
26+ * @var \Tamedevelopers\Database\Schema\Builder\connection|mixed
2727 */
2828 protected $ parentConnection ;
2929
Original file line number Diff line number Diff line change @@ -73,13 +73,16 @@ function app_manager()
7373 * Database Importation
7474 *
7575 * @param string $path_to_sql
76+ * @param string|null $connection
7677 *
7778 * @return object
7879 * [status, message]
7980 */
80- function import ($ path_to_sql = null )
81+ function import ($ path_to_sql, $ connection = null )
8182 {
82- return (new DBImport )->import ($ path_to_sql );
83+ $ import = new DBImport ($ connection );
84+
85+ return $ import ->import ($ path_to_sql );
8386 }
8487}
8588
You can’t perform that action at this time.
0 commit comments