From 5c79ee20fa60ebce1e2a72d57b853a7bdc8ff5f3 Mon Sep 17 00:00:00 2001 From: Sean Harvey Date: Thu, 11 Mar 2010 08:36:38 +0000 Subject: [PATCH] ENHANCEMENT Added DatabaseAdapterRegistry::unregister() to remove a database from the registry git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@100908 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- dev/install/DatabaseAdapterRegistry.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dev/install/DatabaseAdapterRegistry.php b/dev/install/DatabaseAdapterRegistry.php index c9524a03e..60020e714 100644 --- a/dev/install/DatabaseAdapterRegistry.php +++ b/dev/install/DatabaseAdapterRegistry.php @@ -35,6 +35,10 @@ class DatabaseAdapterRegistry { self::$adapters[$config['class']] = $config; } + static function unregister($class) { + if(isset($adapters[$class])) unset($adapters[$class]); + } + static function autodiscover() { foreach(glob(dirname(__FILE__) . '/../../../*', GLOB_ONLYDIR) as $directory) { if(file_exists($directory . '/_register_database.php')) include_once($directory . '/_register_database.php');