$class, 'plugin' => $plugin, ]); } /** * Create the connection object with the correct driver. * * Part of the template method for Cake\Utility\ObjectRegistry::load() * * @param string|Driver $class The classname or object to make. * @param array $settings An array of settings to use for the driver. * @return Connection A connection with the correct driver. */ protected function _create($class, $settings) { if (is_object($class)) { $instance = $class; } unset($settings['className']); if (!isset($instance)) { $instance = new $class($settings); } $settings['datasource'] = $instance; return new Connection($settings); } /** * Remove a single adapter from the registry. * * @param string $name The adapter name. * @return void */ public function unload($name) { unset($this->_loaded[$name]); } }