Skip to content

Instantly share code, notes, and snippets.

@mateusz
Created August 13, 2014 04:37
Show Gist options
  • Save mateusz/24398a6c95f6ac028ced to your computer and use it in GitHub Desktop.
Save mateusz/24398a6c95f6ac028ced to your computer and use it in GitHub Desktop.
diff --cc model/DB.php
index 985a420,5f215a6..0000000
--- a/model/DB.php
+++ b/model/DB.php
@@@ -233,13 -171,9 +233,19 @@@ class DB
self::$connection_attempted = true;
$dbClass = $databaseConfig['type'];
++<<<<<<< HEAD
++||||||| merged common ancestors
++ $conn = new $dbClass($databaseConfig);
++=======
+ $conn = Injector::inst()->create($dbClass, $databaseConfig);
++>>>>>>> origin/3.1
- self::setConn($conn, $label);
+ // Using Injector->get allows us to use registered configurations
+ // which may or may not map to explicit objects
+ $conn = Injector::inst()->get($dbClass);
+ $conn->connect($databaseConfig);
+
+ self::set_conn($conn, $label);
return $conn;
}
@tractorcow
Copy link

$conn = Injector::inst()->create($dbClass);
$conn->connect($databaseConfig);

@mateusz
Copy link
Author

mateusz commented Aug 13, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment