File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -141,44 +141,7 @@ public static function getConnections()
141141 */
142142 public static function forge ($ group = null )
143143 {
144- // Allow custom connections to be sent in
145- if (is_array ($ group ))
146- {
147- $ config = $ group ;
148- $ group = 'custom- ' . md5 (json_encode ($ config ));
149- }
150- else
151- {
152- $ config = config ('Database ' );
153- }
154-
155- static ::ensureFactory ();
156-
157- if (empty ($ group ))
158- {
159- $ group = ENVIRONMENT === 'testing ' ? 'tests ' : $ config ->defaultGroup ;
160- }
161-
162- if (is_string ($ group ) && ! isset ($ config ->$ group ) && ! is_array ($ config ))
163- {
164- throw new \InvalidArgumentException ($ group . ' is not a valid database connection group. ' );
165- }
166-
167- if (! isset (static ::$ instances [$ group ]))
168- {
169- if (is_array ($ config ))
170- {
171- $ db = static ::connect ($ config );
172- }
173- else
174- {
175- $ db = static ::connect ($ group );
176- }
177- }
178- else
179- {
180- $ db = static ::$ instances [$ group ];
181- }
144+ $ db = static ::connect ($ group );
182145
183146 return static ::$ factory ->loadForge ($ db );
184147 }
You can’t perform that action at this time.
0 commit comments