src/Dev/Install/DatabaseAdapterRegistry.php
public static function register($config)
    {
        // Validate config
        $missing = array_diff(['title', 'class', 'helperClass', 'supported'], array_keys($config));
        if ($missing) {
            throw new InvalidArgumentException(
                "Missing database helper config keys: '" . implode("', '", $missing) . "'"
            );
        }

        // Guess missing module text if not given
        if (empty($config['missingModuleText'])) {
            if (empty($config['module'])) {
                $moduleText = 'Module for database connector ' . $config['title'] . 'is missing.';
            } else {
                $moduleText = "The SilverStripe module '" . $config['module'] . "' is missing.";
            }
            $config['missingModuleText'] = $moduleText
                . ' Please install it via composer or from http://addons.silverstripe.org/.';
        }

        // Set missing text
        if (empty($config['missingExtensionText'])) {
            $config['missingExtensionText'] = 'The PHP extension is missing, please enable or install it.';
        }

        // set default fields if none are defined already
        if (!isset($config['fields'])) {
            $config['fields'] = self::$default_fields;
        }

        self::$adapters[$config['class']] = $config;
    }
public static function register($config)
    {
        // Validate config
        $missing = array_diff(['title', 'class', 'helperClass', 'supported'], array_keys($config));
        if ($missing) {
            throw new InvalidArgumentException(
                "Missing database helper config keys: '" . implode("', '", $missing) . "'"
            );
        }

        // Guess missing module text if not given
        if (empty($config['missingModuleText'])) {
            if (empty($config['module'])) {
                $moduleText = 'Module for database connector ' . $config['title'] . 'is missing.';
            } else {
                $moduleText = "The SilverStripe module '" . $config['module'] . "' is missing.";
            }
            $config['missingModuleText'] = $moduleText
                . ' Please install it via composer or from http://addons.silverstripe.org/.';
        }

        // Set missing text
        if (empty($config['missingExtensionText'])) {
            $config['missingExtensionText'] = 'The PHP extension is missing, please enable or install it.';
        }

        // set default fields if none are defined already
        if (!isset($config['fields'])) {
            $config['fields'] = self::$default_fields;
        }

        self::$adapters[$config['class']] = $config;
    }
public static function register ( $ config ) { // Validate config $ missing = array_diff ( [ 'title' , 'class' , 'helperClass' , 'supported' ] , array_keys ( $ config ) ) ; if ( $ missing ) { throw new InvalidArgumentException ( "Missing database helper config keys: '" . implode ( "', '" , $ missing ) . "'" ) ; } // Guess missing module text if not given if ( empty ( $ config [ 'missingModuleText' ] ) ) { if ( empty ( $ config [ 'module' ] ) ) { $ moduleText = 'Module for database connector ' . $ config [ 'title' ] . 'is missing.' ; } else { $ moduleText = "The SilverStripe module '" . $ config [ 'module' ] . "' is missing." ; } $ config [ 'missingModuleText' ] = $ moduleText . ' Please install it via composer or from http://addons.silverstripe.org/.' ; } // Set missing text if ( empty ( $ config [ 'missingExtensionText' ] ) ) { $ config [ 'missingExtensionText' ] = 'The PHP extension is missing, please enable or install it.' ; } // set default fields if none are defined already if ( ! isset ( $ config [ 'fields' ] ) ) { $ config [ 'fields' ] = self :: $ default_fields ; } self :: $ adapters [ $ config [ 'class' ] ] = $ config ; }
Add new adapter to the registry

@param array $config Associative array of configuration details. This must include:
- title
- class
- helperClass
- supported
This SHOULD include:
- fields
- helperPath (if helperClass can't be autoloaded via psr-4/-0)
- missingExtensionText
- module OR missingModuleText
Add new adapter to the registry