Skip to content

Instantly share code, notes, and snippets.

@mateusz
Created August 13, 2014 05:01
Show Gist options
  • Save mateusz/dc48410719674bc258ad to your computer and use it in GitHub Desktop.
Save mateusz/dc48410719674bc258ad 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,13 @@@ class DB
self::$connection_attempted = true;
$dbClass = $databaseConfig['type'];
- $conn = Injector::inst()->create($dbClass, $databaseConfig);
- // Using Injector->get allows us to use registered configurations
- self::setConn($conn, $label);
++ // Using Injector->create allows us to use registered configurations
+ // which may or may not map to explicit objects
- $conn = Injector::inst()->get($dbClass);
++ $conn = Injector::inst()->create($dbClass);
+ $conn->connect($databaseConfig);
+
+ self::set_conn($conn, $label);
return $conn;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment