Permalink
Browse files

MDL-28193 Add $external arg to get_driver_instance

Signed-off-by: Andrew Robert Nicols <andrew.nicols@luns.net.uk>
  • Loading branch information...
1 parent 98e86d8 commit 757ca142ca9af7a75914eda31ce7061b70dc35ae @andrewnicols andrewnicols committed with stronk7 Jul 5, 2011
Showing with 3 additions and 2 deletions.
  1. +3 −2 lib/dml/moodle_database.php
@@ -160,9 +160,10 @@ public function get_prefix() {
* Loads and returns a database instance with the specified type and library.
* @param string $type database type of the driver (mysqli, pgsql, mssql, sqldrv, oci, etc.)
* @param string $library database library of the driver (native, pdo, etc.)
+ * @param boolean $external true if this is an external database
* @return moodle_database driver object or null if error
*/
- public static function get_driver_instance($type, $library) {
+ public static function get_driver_instance($type, $library, $external = false) {
global $CFG;
$classname = $type.'_'.$library.'_moodle_database';
@@ -173,7 +174,7 @@ public static function get_driver_instance($type, $library) {
}
require_once($libfile);
- return new $classname();
+ return new $classname($external);
}
/**

0 comments on commit 757ca14

Please sign in to comment.