mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
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
This commit is contained in:
parent
0f324c852e
commit
5c79ee20fa
@ -35,6 +35,10 @@ class DatabaseAdapterRegistry {
|
|||||||
self::$adapters[$config['class']] = $config;
|
self::$adapters[$config['class']] = $config;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static function unregister($class) {
|
||||||
|
if(isset($adapters[$class])) unset($adapters[$class]);
|
||||||
|
}
|
||||||
|
|
||||||
static function autodiscover() {
|
static function autodiscover() {
|
||||||
foreach(glob(dirname(__FILE__) . '/../../../*', GLOB_ONLYDIR) as $directory) {
|
foreach(glob(dirname(__FILE__) . '/../../../*', GLOB_ONLYDIR) as $directory) {
|
||||||
if(file_exists($directory . '/_register_database.php')) include_once($directory . '/_register_database.php');
|
if(file_exists($directory . '/_register_database.php')) include_once($directory . '/_register_database.php');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user